.claude/skills/tdd/SKILL.md
Use when implementing any feature or bug fix — before writing any production code
npx skillsauth add mezivillager/hacer tddInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write one test that describes the behavior you want. Run it. Watch it fail.
pnpm run test -- --run path/to/file.test.ts
Confirm: The test fails (not errors out), it fails because the feature is missing, and the failure message is exactly what you expected.
Write the smallest amount of production code that makes the test pass. No extra features. No refactoring. Just pass the test.
pnpm run test -- --run path/to/file.test.ts
Remove duplication, improve names, extract helpers. Run tests after every change. Never add behavior during refactor.
pnpm run test:runpnpm run test:e2e:storepnpm run lint
</instructions>
beforeEach(() => { useCircuitStore.setState({ /* copy from canonical or derive from initialState */ }) })
it('should do X when Y', () => { circuitActions.someAction(/* args */) const state = useCircuitStore.getState() expect(state.someSlice).toBe(expected) })
</example>
<example>
### React components (React Testing Library)
```typescript
import { render, screen } from '@testing-library/react'
import { MyComponent } from './MyComponent'
it('renders label when visible', () => {
render(<MyComponent visible={true} />)
expect(screen.getByText('Expected Label')).toBeInTheDocument()
})
</example>
</examples>
<rules>
## HACER Test File Conventions
- Store actions: `src/store/actions/myAction.test.ts`
- React components: Co-located `src/components/MyComponent.test.tsx`
- Generic logic: Co-located `src/utils/helpers.test.ts`
- E2E Store tests: `e2e/specs/feature.spec.ts` (tagged `@store`)
development
A comprehensive verification system for Claude Code sessions.
development
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
tools
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
testing
Use when auditing Claude skills and commands for quality. Supports Quick Scan (changed skills only) and Full Stocktake modes with sequential subagent batch evaluation.