/spicy-skills:test-driven-developmentfrom spicy-skills
Enforces RED-GREEN-REFACTOR test-driven development when implementing features, fixing bugs, or refactoring. Automatically discovers test setup and guides through each TDD phase.
Ships in spicy-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.
Read when SKILL.md points to them.
TDD is a design discipline. Tests drive the implementation, not the other way around. Every piece of functional code is preceded by a failing test. No exceptions unless the work is purely configuration, documentation, or type-only definitions.
Before writing anything, understand the existing test infrastructure.
jest.config.*, vitest.config.*, pytest.ini, pyproject.toml [tool.pytest], go.test, Cargo.toml, .rspec, etc.__tests__/, tests/, test/, spec/, or co-located *.test.* / *.spec.* files. Match the existing convention.package.json scripts, Makefile, Taskfile, or README for how to run tests. Common commands: npm test, pytest, go test ./..., cargo test, bundle exec rspec.testing for Go, cargo test for Rust). Set it up before proceeding.Run the existing test suite once to confirm a clean baseline. If tests are failing before you start, stop and tell the user.
Pick the smallest behavior to implement. Write exactly one test for it.
Test structure follows Arrange-Act-Assert:
Arrange — set up the system under test and its dependencies
Act — execute exactly one behavior
Assert — verify the expected outcome
If you are acting on multiple things or asserting unrelated outcomes, split into separate tests.
Name tests after behavior, not implementation:
# Good: describes what the system does
test_expired_subscription_denies_access()
test_empty_cart_shows_zero_total()
# Bad: describes how the code works
test_check_expiry_returns_false()
test_get_total_function()
Run the test. It must fail. If it passes, either the behavior already exists or the test is wrong — investigate before continuing.
Gate check: The test fails for the right reason (missing functionality, not a syntax error or import failure). Fix setup issues before counting this as a valid red.
Write only enough production code to make the failing test pass. Nothing more.
Run all tests. Every test must be green before proceeding.
Gate check: All tests pass, including pre-existing ones. If a new test broke an old one, fix that first.
With all tests passing, clean up both production and test code:
Run tests after every small change. If any test fails, revert immediately and take a smaller step.
Gate check: All tests still pass. Code is cleaner than before.
Go back to Step 1 with the next behavior. Continue the cycle until the feature is complete.
Commit at meaningful green points — typically after completing a full RED-GREEN-REFACTOR cycle or a coherent set of cycles. Each commit should leave the test suite green.
When fixing a bug, the cycle is the same but starts differently:
If you cannot get to green with a small change, the step was too big. Back up and write a simpler test. Even testing that a class can be instantiated or a function returns a hardcoded value is a valid first step. Small steps compound.
Read these when writing tests — they contain patterns, anti-patterns, and examples that prevent common mistakes.
Testing principles and anti-patterns: Covers fast, independent, repeatable, self-validating, and thorough tests, plus the seven most common testing mistakes with before/after examples. Read when planning test structure or reviewing test quality. → testing-principles.md
Test doubles (mocks, stubs, fakes): Covers when to use each type, what to mock vs. what to keep real, and the line between useful test doubles and over-mocking. Read when dealing with external dependencies, databases, APIs, or complex collaborators. → test-doubles.md
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub d-mariano/spicyclaude --plugin spicy-skills3 skills in this plugin
/python-developmentEnforces Python best practices for typing, structure, and tooling during both planning and implementation. Use when designing, planning, or writing Python code, modules, APIs, or applications. Triggers: 'python', 'pytest', 'pydantic', 'dataclass', 'fastapi', 'django', 'flask', 'uv', 'poetry', 'ruff', 'mypy', '.py files', planning a Python service, designing Python architecture. Does not apply to pure shell scripts, Jupyter notebook exploration, config-only YAML/JSON edits, or non-Python languages.
/terraform-developmentGuides Terraform/HCL configuration structure, module design, state management, and provider usage during both planning and implementation. Use when designing infrastructure, planning Terraform architecture, or writing .tf files. Triggers: 'terraform', 'tofu', 'HCL', '.tf', 'tfvars', 'terraform plan', 'terraform apply', 'terraform module', 'provider', 'resource block', infrastructure as code design. Does not apply to Pulumi, CDK, CloudFormation, Ansible, Kubernetes manifests, or Helm charts.