- Introduced coding standards for TypeScript and React in SKILL.md. - Added continuous learning skill with configuration and evaluation scripts. - Created detail layout guidelines for read-only pages. - Established form layout rules for data-entry forms. - Documented project guidelines for the frontend monorepo. - Implemented security review checklist for frontend/Electron applications. - Developed a verification loop skill for comprehensive session checks. This commit enhances the skill set available for developers, ensuring adherence to best practices and improving code quality.
1.2 KiB
1.2 KiB
description
| description |
|---|
| Enforce test-driven development. Scaffold types, write Vitest tests FIRST, then implement the minimum to pass. Ensure 80%+ coverage. |
TDD Command
This command invokes the tdd-guide agent.
What This Command Does
- Scaffold types — inputs/outputs first
- Write failing tests (RED) with Vitest
- Implement the minimum (GREEN)
- Refactor while green
- Check coverage (80%+)
When to Use
- New validators, transformers, stores, components
- Bug fixes (reproducing test first)
- Refactors of existing logic
Cycle
RED → GREEN → REFACTOR → REPEAT
Example
User: /tdd Add validation for the full-page name field
// full-page.validator.test.ts
import { createFullPageSchema } from './full-page.validator'
it('rejects an empty name', () => {
const schema = createFullPageSchema((k) => k)
expect(schema.safeParse({ code: 'ABC', name: '' }).success).toBe(false)
})
pnpm --filter web test
pnpm test
pnpm check:all
Mock @repo/core-api / apiClient, not a database. UI in packages/ui uses Testing Library.
Related
Agent: .cursor/agents/tdd-guide.md
Skill: .agents/skills/tdd-workflow/