| name | implement-story |
| description | Implement a backlog story following the layer order (Domain, Database, API, Frontend, E2E) with TDD. |
| disable-model-invocation | true |
Steps
- Check branch — verify you are NOT on
main. If on main, create and switch to a feature branch (e.g., feat/e2-us01-jwt-token-security) before proceeding. Never commit directly to main.
- Read the story — read the story file from
docs/backlog/
- Understand the acceptance criteria — every checkbox must be satisfied
- Follow layer order — Domain → Database → API → Frontend → Mobile → E2E
- TDD for each layer:
- Write failing test
- Write minimum implementation
- Verify test passes
- Refactor if needed
- Add E2E tests — use
/add-e2e-tests skill. Must include both API tests (@api tag) and UI browser tests (@ui tag)
- Verify everything passes:
pnpm lint
pnpm test
pnpm test:e2e
pnpm test:e2e:mobile
- Update story status — mark checkboxes and set status to "Done"
- Update epic README — set the story's status column to "Done" in the epic README table
- Update USER_FEATURES.md — add new features for affected user types
Example: Implementing a Note use case
packages/domain/src/use-cases/__tests__/CreateNote.test.ts
packages/domain/src/use-cases/CreateNote.ts
packages/database/src/adapters/__tests__/DrizzleNoteRepository.test.ts
packages/database/src/adapters/DrizzleNoteRepository.ts
packages/api/src/controllers/notes.controller.ts
packages/frontend/src/features/notes/
packages/mobile/src/features/notes/
e2e/tests/notes/crud.spec.ts
packages/mobile/maestro/flows/notes/
Definition of Done