tdd

Solid

Enforces strict Test-Driven Development with RED-GREEN-REFACTOR cycles. Writes one failing test at a time, implements minimal code to pass, then refactors. Delegates to the `test-provenance-guard` skill during REFACTOR to detect tests-by-construction (static + mutation checks). Pairs with the `code-quality` skill: invokes `Skill('code-quality')` during the REFACTOR phase to apply the full code-quality rule set against the GREEN output, and cites refactor recipes (R1–R20) by ID when reporting changes. Triggers on: "tdd", "write tests", "test this", "add test coverage", "test driven", "red green refactor", "/tdd".

Testing & QA 8 stars 2 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
32
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Test-Driven Development Enforce strict RED-GREEN-REFACTOR discipline. One test at a time. Tests describe WHAT the system does, never HOW. --- ## Input Check `$ARGUMENTS` for the feature or behavior description. - If `$ARGUMENTS` contains a feature description, use it directly. - If `$ARGUMENTS` contains **"after"** (e.g., `/tdd after`), run in **Test-After Mode** — write tests for existing code. See `rules/test-after.md`. - If `$ARGUMENTS` is empty, ask the user what behavior they want to implement or test. --- ## Step 0: Discover Project Test Setup Before writing any tests: 1. **Find existing tests** — glob for `**/*.test.*`, `**/*.spec.*`, `**/*_test.*`, `**/test_*.*`, `**/tests/**` to identify the test framework, naming conventions, and directory structure. 2. **Find the test runner** — check `package.json` scripts, `Makefile`, `pyproject.toml`, `Cargo.toml`, `go.mod`, or similar for the test command. 3. **Adopt existing patterns** — match the project's test style exactly: same imports, same assertion library, same file naming, same directory placement. Never introduce a new test framework or pattern. 4. **Identify the run command** — store it mentally as `TEST_CMD` for use throughout the cycle. If you can run a single test file or test case, prefer that over the full suite. If no tests exist yet, ask the user which framework to use before proceeding. --- ## Step 1: Prioritize by Business Criticality Before diving into implementation, identify what matters m...

Details

Author
mthines
Repository
mthines/agent-skills
Created
3 months ago
Last Updated
2 days ago
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category