Skip to content

Commit 4cc1fae

Browse files
committed
docs: update instructions and prompts for clarity and route usage
Generated-by: aiautocommit
1 parent 2346d70 commit 4cc1fae

8 files changed

Lines changed: 9 additions & 17 deletions
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
description: Move logic into a client loader
2+
description:
33
---
44
## React Router Client Loader
55

6-
76
Do this in a `clientLoader` and use `loaderData` to render the component. DO NOT create mock data, new interfaces, or mock data loader functions. Instead, assume `loaderData` has all of the data you need to render the component.

.cursor/rules/secrets.mdc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
description: Add or mutate system secrets
2+
description:
33
---
44
## Secrets
55

6-
76
Here's how environment variables are managed in this application:
87

98
- `.envrc` entry point to load the correct env stack. Should not contain secrets and should be simple some shell logic and direnv stdlib calls.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
2-
description:
3-
globs:
4-
alwaysApply: false
2+
description:
53
---
64
## TypeScript DocString
75

8-
96
Add a file-level docstring with a simple description of what this file does.

.github/instructions/react-router.instructions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ applyTo: "web/app/routes/**/*.tsx"
55

66
- The primary export in a routes file should specify `loaderData` like `export default function RouteNamePage({ loaderData }: Route.ComponentProps)`. `loaderData` is the return value from `clientLoader`.
77
- When using an import from `~/configuration/client` (1) use `body:` for request params and (2) always `const { data, error } = await theCall()` (3) add `invariant(data, "error loading $xyz")`
8-
- Use `href("/products/:id", { id: "abc123" })` to generate a url path for a route managed by the application.
9-
- Look at [routes.ts](mdc:web/app/routes.ts) to determine what routes and path parameters exist.
108
- Use `export async function clientLoader(loaderArgs: Route.ClientLoaderArgs)` to define a clientLoader on a route.
119
- Use `loaderArgs.params.$THE_KEY` to use a query string parameter.
1210
- Do not define `Route.*` types, these are autogenerated and can be imported from `import type { Route } from "./+types/routeFileName"`

.github/instructions/react.instructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ applyTo: "**/*.tsx"
1717
- Only use a separate interface for component props if there are more than 4 props.
1818
- Put the interface definition right above the related function
1919
- Internally, store all currency values as integers and convert them to floats when rendering visually
20-
- Never edit the `components/ui/*.tsx` files
20+
- Never edit (or add) `components/ui/*.tsx` files
2121
- When building forms use React Hook Form.
2222
- Include a two line breaks between any `useHook()` calls and any `useState()` definitions for a component.
23+
- Use `href("/products/:id", { id: "abc123" })` to generate a url path for a route managed by the application.
24+
- Look at @routes.ts to determine what routes and path parameters exist.
2325

2426
### React Hook Form
2527

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
mode: 'agent'
3-
description: 'Move logic into a client loader'
3+
description: ''
44
---
55
## React Router Client Loader
66

7-
87
Do this in a `clientLoader` and use `loaderData` to render the component. DO NOT create mock data, new interfaces, or mock data loader functions. Instead, assume `loaderData` has all of the data you need to render the component.

.github/prompts/secrets.prompt.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
mode: 'agent'
3-
description: 'Add or mutate system secrets'
3+
description: ''
44
---
55
## Secrets
66

7-
87
Here's how environment variables are managed in this application:
98

109
- `.envrc` entry point to load the correct env stack. Should not contain secrets and should be simple some shell logic and direnv stdlib calls.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
mode: 'agent'
3-
description: 'Add a docstring to a TypeScript file'
3+
description: ''
44
---
55
## TypeScript DocString
66

7-
87
Add a file-level docstring with a simple description of what this file does.

0 commit comments

Comments
 (0)