Skip to content
Back to skills

Tdd Workflow

ASecurity

Implement features using TDD workflow with requirements-first approach. Use when implementing new features, adding functionality, or when user asks to build something.

  • 5 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 2, 2026
developmenttypescriptgobashtestingrefactoringgitapi

Works with

  • api

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add kookr-ai/kookr --skill tdd-workflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tdd Workflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tdd Workflow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kookr-ai-tdd-workflow/badge)](https://www.skillsdirectory.com/skills/kookr-ai-tdd-workflow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tdd-workflow
description: Implement features using TDD workflow with requirements-first approach. Use when implementing new features, adding functionality, or when user asks to build something.
keywords: tdd, test-driven, red-green-refactor, requirements, feature implementation
related: testing-patterns, safe-refactoring
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task
---

# TDD Workflow

Implement features using Test-Driven Development with requirements-first approach.

## When to Use

- Implementing new features
- Adding functionality
- User asks to "build", "create", "add", "implement"
- Changes that should be tested

## Steps

### 1. Requirement First
Before any code:
1. Add/update the canonical requirement in `docs/requirements.md`
2. Use "shall" for mandatory, active voice, positive statements, quantifiable criteria
3. Assign unique ID: `{CATEGORY}-{AREA}-{NUMBER}` (FR-*, NFR-*, API-*, DR-*)
4. Define testable acceptance criteria

### 2. Test Second (TDD)
Write tests BEFORE implementation:
```typescript
describe('FR-AUTH-001: User authentication', () => {
  it('shall authenticate valid credentials', () => { ... });
});
```
Map acceptance criteria to test cases.

### 3. Implement
Write minimal code to pass tests. If deviation needed, STOP and ask:
```
Implementation needs to differ because [reason]. Should I:
A) Update requirement, or B) Find different approach?
```

### 4. Verify Coherence
Run tests. Check:
- [ ] Requirements match implementation
- [ ] Modified requirements have tests
- [ ] Test specs up to date
- [ ] Traceability current
- [ ] No orphaned/untested items

### 5. Commit
Reference requirement: `git commit -m "feat: implement FR-AUTH-001 user authentication"`
Include code + docs in same commit when possible.

## Requirement ID Schema

| Category | Prefix | Example |
|----------|--------|---------|
| Functional | FR | FR-AUTH-001 |
| Non-Functional | NFR | NFR-PERF-001 |
| API | API | API-TASK-001 |
| Data | DR | DR-USER-001 |
| Test | TS | TS-AUTH-001 |

## Requirement Template
```markdown
### {ID}: {Short Title}
**Status:** Draft | Approved | Implemented | Deprecated
**Priority:** Critical | High | Medium | Low

**Requirement:** The system shall {action} {object} {condition}.
**Rationale:** {Why}

**Acceptance Criteria:**
- [ ] Given {context}, when {action}, then {result}

**Linked Tests:** TS-{AREA}-{NUM}
**Dependencies:** {Other IDs}
```

## Before Commit Checklist
- [ ] `pnpm test` passes
- [ ] `pnpm typecheck` clean
- [ ] `git status` shows intended files only
- [ ] Requirement documented in `docs/requirements.md`
- [ ] Tests cover the new/changed behavior

## See Also

- [[testing-patterns]] -- Test configuration and isolation
- [[playwright-e2e-patterns]] -- E2E test patterns

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.