Update agent workflow: strict TDD order + commit after every step
Tests first → data structures → implementation → verify → commit Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,27 +1,37 @@
|
|||||||
---
|
---
|
||||||
description: Agent development workflow — visual feedback, testing, progress tracking
|
description: Agent development workflow — TDD, commit discipline, visual feedback
|
||||||
alwaysApply: true
|
alwaysApply: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Agent Workflow
|
# Agent Workflow
|
||||||
|
|
||||||
|
## Development Order (STRICT)
|
||||||
|
For every task, follow this sequence:
|
||||||
|
1. **Tests first** — write failing tests that define expected behavior
|
||||||
|
2. **Data structures** — define types, interfaces, JSON schemas
|
||||||
|
3. **Implementation** — write code to make tests pass
|
||||||
|
4. **Verify** — `npm run test:run` for logic, Playwright screenshot for visuals
|
||||||
|
5. **Commit** — `git add -A && git commit` after each successful step
|
||||||
|
|
||||||
|
## Commit Discipline
|
||||||
|
- Commit after EVERY successful step (tests green or visual verified)
|
||||||
|
- Small, focused commits — one concern per commit
|
||||||
|
- Never accumulate uncommitted work across multiple tasks
|
||||||
|
- Commit message format: concise "what + why" in English
|
||||||
|
|
||||||
## Visual Verification
|
## Visual Verification
|
||||||
After ANY visual change, verify via Playwright browser tools:
|
After ANY visual change:
|
||||||
1. Ensure dev server is running (`npm run dev`)
|
1. Ensure dev server is running (`npm run dev`)
|
||||||
2. Navigate to `http://localhost:5173`
|
2. Navigate to `http://localhost:5173`
|
||||||
3. Take screenshot to see result
|
3. Take screenshot to see result
|
||||||
4. Check browser console for errors
|
4. Check browser console for errors
|
||||||
5. Fix issues before moving on
|
5. Fix issues before committing
|
||||||
|
|
||||||
## Testing Strategy
|
|
||||||
- **Chemistry, ecology, math** — write vitest tests FIRST, then implement
|
|
||||||
- **Visual/rendering** — verify via Playwright screenshots
|
|
||||||
- Run `npm run test:run` after logic changes
|
|
||||||
|
|
||||||
## After Completing a Task
|
## After Completing a Task
|
||||||
1. Verify it works (test or screenshot)
|
1. Verify it works (test or screenshot)
|
||||||
2. Update `PROGRESS.md` — mark task complete, add date
|
2. Commit immediately
|
||||||
3. Check `IMPLEMENTATION-PLAN.md` for what's next
|
3. Update `PROGRESS.md` — mark task complete
|
||||||
|
4. Check `IMPLEMENTATION-PLAN.md` for what's next
|
||||||
|
|
||||||
## Code Standards
|
## Code Standards
|
||||||
- TypeScript strict mode — no `any`, no unsafe `as` casts
|
- TypeScript strict mode — no `any`, no unsafe `as` casts
|
||||||
|
|||||||
Reference in New Issue
Block a user