/engineering-skills:tddfrom engineering-skills
Guides Claude Code through test-driven development: red-green-refactor cycle, one behavior at a time, confirming real failure before writing production code.
Ships in engineering-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Implement behavior one failing test at a time. The cycle is red, green, refactor. Do not write the production code for a behavior before a test has failed for that behavior, and do not start the next behavior until the current one is green and cleaned up.
This skill is agent-neutral. It does not install hooks, slash commands, or a required subagent. Run the project's existing test command from the current agent.
Use this skill when:
Skip the cycle only when the user explicitly asks for a spike or a non-behavioral change (formatting, comments, generated files). Say that the cycle was skipped and why.
AGENTS.md, CLAUDE.md, or the equivalent) and find the test command. Prefer a documented command over guessing.Makefile, pytest / go test / cargo test / mvn test / gradle test / phpunit / bin/rspec, or the language's usual runner. Run the narrowest command that executes one example or one file.If the test command cannot be found or cannot be executed, stop and say so. Do not claim a cycle completed without a run.
Repeat until the requested behavior is complete. Each iteration covers exactly one behavior.
Write the smallest test that expresses the next behavior and nothing else.
Run that test alone when the runner allows it.
The test must fail, and it must fail because the behavior is missing or wrong — not because of a typo, a missing import, a wrong path, or a setup error. Read the failure. If the failure is not the expected one, fix the test and run it again before writing production code.
If the new test passes immediately, the behavior already exists or the test does not exercise it. Do not treat that as success. Adjust the test or choose a behavior that is not already covered, then re-run until the failure is real.
Write the minimum production code that makes this test pass. Do not implement the next behavior, the general case, or "what we'll need later."
Hard-coding a single return value is acceptable when it is the smallest change that turns this test green. The following test is what forces the code to become general.
Run the same test again. It must pass. If it fails, change the production code or correct a bad test — do not weaken the assertion to hide a real miss. Then run the relevant surrounding tests to confirm the change did not break an existing behavior.
Only refactor while the tests are green.
Run the same tests again after refactoring. If they fail, undo the refactor or fix it before continuing. Do not begin the next behavior on a red suite.
Keep a short list of behaviors, ordered so each test teaches one new fact. Typical order:
Do not write that list as a finished test file. Track it as a plan, then turn one item into a test at a time.
Prefer several small cycles over one test that asserts an entire feature. A cycle that touches many files is a signal to slice again.
The work is done when every requested behavior has been through red, green, and refactor, the tests that cover those behaviors pass, and the relevant existing suite still passes. Summarize the behaviors added and the command used to run them. Do not claim coverage that was not executed.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/conventional-commentsUse this skill when writing, rewriting, or reviewing feedback comments so they follow the Conventional Comments format./conventional-commitsThis skill should be used when creating Git commits to ensure they follow the Conventional Commits specification. It provides guidance on commit message structure, types, scopes, and best practices for writing clear, consistent, and automated-friendly commit messages. Use when committing code changes or reviewing commit history./legacy-code-protocolProtocol for working in legacy code, meaning existing code with few or no tests, or code nobody understands. Modes - survey maps an unfamiliar area (structure, coupling, coverage, hotspots, seams); plan sequences the work into stacked PRs and tickets; pin locks current behavior with characterization tests; change makes one change safely through seams and test-first edits; replace swaps in a new implementation using characterization tests as the parity oracle; review audits a pull request that touches legacy code. Based on Michael Feathers' Working Effectively with Legacy Code. For new code, or code already covered by tests, use tdd.npx claudepluginhub dgalarza/agent-skills --plugin engineering-skillsOther plugins' skills for the same job