executing-tdd-cycle
FreeNo executable scriptsNot checkedThis skill MUST be invoked when the user says "execute cycle", "implement tasks", "TDD cycle", or "red green refactor". SHOULD also invoke when implementing…
by deepeshBodh★ 41 GitHub starsAbout this skill
Executing TDD Cycles
Overview
Transform a cycle task list into implemented code via strict red/green/refactor discipline. Parse tasks from tasks.md, write failing tests first, implement code to pass them, refactor, mark tasks complete, and produce a structured cycle-report.md. This skill governs both normal cycle execution and retry/fix modes.
Violating the letter of the rules is violating the spirit of the rules.
TDD discipline exists to catch failures before they compound. Every shortcut in this process is a regression waiting to happen.
When to Use
- Executing a cycle's task list from
tasks.md - Retry after checkpoint failure (targeted rework)
- Fix mode after final-validation failure (unconstrained by cycle boundaries)
- Any task with
[EXTEND]or[MODIFY]markers (invokebrownfield-integrationskill alongside) - Writing cycle-report.md after cycle completion
When NOT to Use
- Running quality gates (lint, build, test suite) — handled by the verification skill
- Parsing or evaluating checkpoint/validation reports — handled by the analysis layer
- Deciding which cycle to execute next — determined by the instructions provided
- Modifying DAG state or pass lifecycle — handled by the graph operations layer
Core Process
Cycle Execution Sequence
Execute in strict order. No skipping steps. No reordering.
1. Parse Cycle Tasks
Extract the task list for the current cycle from tasks.md. See references/TASK-PARSING.md for parsing rules.
For each task, extract:
- Task ID (
T{N}.{X}) - Description
- File path(s) in backticks
[EXTEND]or[MODIFY]markers- Sub-bullet details
2. Red Phase — Write Failing Tests
For each task that specifies a test:
- Write the test file at the specified path
- Run the test to verify it fails
- Verify the failure reason matches expectations (not a syntax error, import error, or wrong assertion)
- If the test passes without implementation, the test is not testing what you think — rewrite it
3. Green Phase — Implement Code
For each implementation task:
- Write the minimum code to make the failing test pass
- Run the test to verify it passes
- Do not add features, abstractions, or optimizations the task did not request
- For
[EXTEND]tasks: read the existing file first, follow existing patterns (invokebrownfield-integrationskill) - For
[MODIFY]tasks: read the existing file first, change only what the task specifies (invokebrownfield-integrationskill)
4. Refactor Phase
After tests pass:
- Remove duplication introduced in this cycle only
- Improve names if unclear
- Do NOT refactor code from previous cycles
- Do NOT add abstractions "for the future"
- Re-run tests after refactoring to confirm they still pass
5. Mark Tasks Complete
Update tasks.md: change - [ ] to - [x] for each completed task in this cycle.
6. Write Cycle Report
Produce cycle-report.md following the format in references/CYCLE-REPORT-FORMAT.md.
Progress Tracking
- Mark each task
[x]intasks.mdimmediately after completing it - Write
cycle-report.mdwith YAML frontmatter and prose sections - Frontmatter provides structured data for the checkpoint gate
- Prose sections provide context for the State Analyst and carry_forward
Retry Handling
When dispatched after a checkpoint failure:
- Read the checkpoint report to identify specific failures
- Trace each failure to the responsible task(s)
- Re-open failed tasks: change
- [x]back to- [ ]intasks.md - Execute only the re-opened tasks through the red/green/refactor cycle
- Do NOT re-implement tasks that passed — they are done
- Write a new
cycle-report.mdwith updated attempt number
Fix Mode
When dispatched after final-validation failure:
- Read the final-validation report to identify specific failures
- Fix each failure — you are NOT constrained by cycle boundaries
- May touch files from any cycle as needed to resolve failures
- Scope strictly to reported failures — this is not a refactoring opportunity
- Write
cycle-report.mdwithcycle: fixin frontmatter
Red Flags — STOP and Restart Properly
If any of these thoughts arise, STOP immediately:
- "The test already passes so I'll skip writing it first"
- "I'll write all the code first and tests after"
- "This task is trivial, no test needed"
- "I'll refactor this existing code while I'm here"
- "The task says EXTEND but I need to rewrite this"
- "I'll add this helper/utility that will be useful later"
- "The checkpoint will catch it if something's wrong"
- "I know this works from the previous cycle"
All of these mean: Rationalization in progress. Return to the execution sequence. Follow every step.
No exceptions:
- Not for "trivial" tasks
- Not for "obvious" implementations
- Not for "tight deadlines"
- Not for "I already know this works"
- Not even if the user says "just
Install executing-tdd-cycle in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the executing-tdd-cycle skill do?
This skill MUST be invoked when the user says "execute cycle", "implement tasks", "TDD cycle", or "red green refactor". SHOULD also invoke when implementing cycle task lists, encountering `[EXTEND]`/`[MODIFY]` markers, generating cycle reports, or handling retry after checkpoint failure.
How do I install the executing-tdd-cycle skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the executing-tdd-cycle skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic