Skip to content
Back to skills

Tdd Cycle

ASecurity

Run one Red-Green-Refactor slice: write the failing test first, make it pass with minimum code, then refactor. Use for each task in tasks.md.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 24, 2026
developmentgo

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add Facta-Dev/ai-coding-playbook --skill tdd-cycle --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tdd Cycle?

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

Security grade badge for Tdd Cycle
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/facta-dev-tdd-cycle/badge)](https://www.skillsdirectory.com/skills/facta-dev-tdd-cycle)

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-cycle
description: Run one Red-Green-Refactor slice: write the failing test first, make it pass with minimum code, then refactor. Use for each task in tasks.md.
when_to_use: ["run a tdd cycle", "/tdd-cycle [task]", "implement T-00X test-first", "red green refactor"]
argument-hint: [T-00X]
---

# One TDD cycle

## Procedure

1. Read `specs/<slug>/tasks.md` and pick the next open task (or the one named).
   If none is open, stop.
2. Detect the test runner, in this order, and stop with a clear error if none
   is found:
   - `scripts/tdd/run-tests <slice>`
   - `scripts/tdd/slice-test <slice>`
   - `go.mod` → `go test ./...`
   - `Cargo.toml` → `cargo test`
   - `pyproject.toml` → `pytest`
   - `package.json` → its `test` script
3. **RED** — write only the test(s) for this task's acceptance criteria. Run
   the runner and confirm they fail for the expected reason. Record the
   command and the failing output.
4. **GREEN** — write the minimum production code that passes. Run the runner
   until green. Do not change the test to make it pass.
5. **REFACTOR** — clean up with the suite green; re-run after each change.
6. Mark the task `[x]` and note the run evidence (command + result) next to it.
7. Set the spec `status: in-progress` on the first cycle if it is `planned`.

## Rules

- Never write production code before a recorded failing test.
- One slice per invocation; do not batch unrelated tasks.
- If a test fails for the wrong reason, fix the test setup, not the assertion.
- If the task cannot be done as specified, stop and report — do not silently
  shrink scope.

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.

View all in development →

Comments

Loading comments…

Newsletter

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