Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions templates/skills/tdd/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: tdd
description: Use when implementing any feature or bug fix — requires writing a failing test before any implementation code
context: fork
---

# Test-Driven Development (TDD)
Expand Down Expand Up @@ -112,7 +113,35 @@ Cannot check all boxes? You skipped TDD. Start over.

## Integration with MAXSIM

### Context Loading

When running within a MAXSIM project, load project context:

```bash
node ~/.claude/maxsim/bin/maxsim-tools.cjs skill-context tdd
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maxsim-tools.cjs skill-context does not appear to be a valid CLI command (the CLI command registry in packages/cli/src/cli.ts doesn’t include skill-context). As written, this example will error at runtime. Please either change this to an existing command (e.g., roadmap analyze, state, init execute-phase) or add a supported skill-context command to maxsim-tools and document its output/flags.

Suggested change
node ~/.claude/maxsim/bin/maxsim-tools.cjs skill-context tdd
node ~/.claude/maxsim/bin/maxsim-tools.cjs state

Copilot uses AI. Check for mistakes.
```

This returns: current phase, active plan, artifact paths, and recent decisions. Use this to:
- Reference the current plan's `<verify>` blocks when writing tests
- Know which phase you are implementing within
- Check for existing test patterns in the project

### STATE.md Hooks

Track TDD metrics in STATE.md via the tools router:
- After each RED→GREEN→REFACTOR cycle, the executor records the cycle in the plan's task completion
- TDD violations (production code before test) are recorded as deviations
- Cycle count is tracked per task for velocity metrics
Comment on lines +131 to +134
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section claims TDD cycle counts and TDD-violation tracking are recorded to STATE.md via the tools router, but the documented executor state updates only record duration/tasks/files via state record-metric and there’s no maxsim-tools command/API for recording RED/GREEN/REFACTOR cycles. Please align this text with the current tooling (or implement the missing metric/deviation recording behavior end-to-end).

Suggested change
Track TDD metrics in STATE.md via the tools router:
- After each RED→GREEN→REFACTOR cycle, the executor records the cycle in the plan's task completion
- TDD violations (production code before test) are recorded as deviations
- Cycle count is tracked per task for velocity metrics
Track TDD-related work using the existing MAXSIM tooling:
- Use `state record-metric` to capture duration, tasks, and touched files for TDD-focused work.
- Use commit messages and plan/task notes to indicate RED/GREEN/REFACTOR cycles for each `tdd="true"` task.
- If you violate the Iron Law (implementation before a failing test), explicitly note the deviation in `STATE.md` or the relevant plan artifact.

Copilot uses AI. Check for mistakes.

### Commit Protocol

In MAXSIM plan execution, tasks marked `tdd="true"` follow this cycle with per-step commits:
- **RED commit:** `test({phase}-{plan}): add failing test for [feature]`
- **GREEN commit:** `feat({phase}-{plan}): implement [feature]`
- **REFACTOR commit (if changes made):** `refactor({phase}-{plan}): clean up [feature]`

### Artifact References

- Check `.planning/phases/{current}/PLAN.md` for task-specific test requirements
- Reference `.planning/phases/{current}/RESEARCH.md` for test patterns discovered during research
Comment on lines +145 to +146
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The referenced artifact paths don’t match MAXSIM’s documented naming conventions: phase plans and research artifacts are typically *-PLAN.md / *-RESEARCH.md within .planning/phases/<phase-dir>/ (not PLAN.md or RESEARCH.md). Please update these bullets to point to the actual file patterns used in the workflow templates so readers can find the right artifacts.

Suggested change
- Check `.planning/phases/{current}/PLAN.md` for task-specific test requirements
- Reference `.planning/phases/{current}/RESEARCH.md` for test patterns discovered during research
- Check `.planning/phases/{current}/*-PLAN.md` for task-specific test requirements
- Reference `.planning/phases/{current}/*-RESEARCH.md` for test patterns discovered during research

Copilot uses AI. Check for mistakes.
- Test results feed into SUMMARY.md documentation