Skip to content

Commit bec5f3f

Browse files
committed
Improved agent rules and instructions
1 parent 35fded6 commit bec5f3f

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

.cursor/commands/implement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ IF the task involves fixing a documented BUG:
9797
You are PROHIBITED from responding "Done" until you have verified runtime execution for Database Logic.
9898
9999
1. **Static Analysis:**
100-
- `npx tsc --noEmit` (MUST pass - no errors or warnings)
101-
- `npm run lint` (MUST pass - no errors or warnings)
100+
- `npx tsc --noEmit 2>&1` (MUST pass - no errors or warnings)
101+
- `npm run lint 2>&1` (MUST pass - no errors or warnings)
102102
103103
2. **Runtime Validation (For DB/Logic):**
104104
- IF you modified database logic (actions/services):

.cursor/commands/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Steps to verify:
7878

7979
1. run `npm run test` to perform testing.
8080
2. If the tests fail, FIX the code and RETRY loops until success.
81-
3. run `npx tsc --noEmit` to check for type errors.
82-
4. run `npm run lint` to check for linting errors.
81+
3. run `npx tsc --noEmit 2>&1` to check for type errors.
82+
4. run `npm run lint 2>&1` to check for linting errors.
8383
5. If the tests AND linting AND type checks pass, respond "Done".
8484
6. NEVER respond "Done" until you have verified that the tests are complete and cover all the functionality of the source file and that there are no linting/type errors or warnings.

.cursor/rules/testing.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ When testing Server Actions, NEVER import the real `db` instance.
1111
- Use `jest.mock('@/db')` to mock the Drizzle client.
1212
- Mock return values of queries using `mockReturnValue` or `mockResolvedValue`.
1313
- Example for insert: `(db.insert as jest.Mock).mockReturnValue({ values: jest.fn().mockReturnValue({ returning: jest.fn().mockResolvedValue([mockData]) }) })`.
14+
- **Don't mock `@/db/schema`:** just mock `@/db`. Schema is side-effect-free and gives real Column objects needed by `drizzle-orm`.
1415

1516
## 2. React Testing Library
1617
- **Queries:** Prioritize `getByRole`, `getByLabelText`, `getByText` (Accessibility-first). Avoid `getByTestId` unless necessary.

0 commit comments

Comments
 (0)