
dev-practices
Test-driven development skill that enforces red-green-refactor cycles only when explicitly requested.
- version
- 0.0.23
- GitHub stars
- 37
What it does
- Adds the
tddskill, a Test-Driven Development workflow built around the red-green-refactor cycle - Activates only when a user explicitly asks for TDD, not for general test writing in your project
Development practices: TDD workflow with red-green-refactor
Add marketplace
/plugin marketplace add spences10/claude-code-toolkitRun it inside Claude Code once, then install the plugin below.
Install
/plugin install dev-practices@claude-code-toolkitRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceTest-Driven Development
Drive implementation through tests using the red-green-refactor cycle.
Adapted from Matt Pocock's TDD skill
Trigger Patterns
- "use TDD"
- "TDD this feature"
- "red-green-refactor"
- "test-driven"
- "write tests first"
Do not activate for general "write tests for X" or "add test coverage" requests. This skill is specifically for the TDD workflow where tests lead implementation.
Philosophy
Test behavior, not implementation. Every test should verify what the code does from the outside, not how it works inside. See deep-modules.md for the reasoning behind this.
Good tests act as a contract: they define what the module promises to its callers. If you can swap the internals completely and your tests still pass, they're testing the right thing.
Workflow
1. Plan the Interface
Before writing any code, decide the public surface area:
- What functions/methods/endpoints will exist?
- What are the inputs and outputs?
- What are the edge cases and error conditions?
Design for the caller, not the implementation. See interface-design.md.
2. Write a Tracer Bullet Test
Start with one test that exercises the simplest meaningful path through the feature. This test should:
- Call the public API as a real consumer would
- Assert the most basic expected output
- Fail — because the implementation doesn't exist yet
RED: test exists, code does not
Run the test. Confirm it fails for the right reason (missing function, wrong return value — not a syntax error).
3. Make It Green
Write the minimum code to pass that one test. Do not write more than what the test demands. Hardcode return values if that's all it takes. The goal is a green test suite, not elegant code.
GREEN: test passes with minimal implementation
4. Refactor Under Green
With the test passing, clean up. Remove duplication, improve names, extract helpers — but only while tests stay green. See refactoring.md.
REFACTOR: improve code quality, tests still pass
5. Repeat
Add the next test. Pick the next simplest behavior that isn't covered. Follow the same cycle:
- Write a failing test
- Make it pass with minimal code
- Refactor while green
Build up complexity incrementally. Each cycle should take minutes, not hours.
6. Handle Edge Cases
After the core behavior works, add tests for:
- Invalid inputs and error conditions
- Boundary values
- Empty/null/undefined cases
- Concurrent access if relevant
7. Final Refactor
Once all behavior is covered, do a final pass:
- Look for patterns across tests — consolidate setup with helpers
- Check that test names clearly describe the behavior being verified
- Ensure no test depends on another test's state
- Review implementation for unnecessary complexity
When to Mock
Use real dependencies when practical. Mock only at system boundaries — network calls, databases, file systems, clocks. See mocking.md for detailed guidance.
Test Quality
Write tests that are readable, independent, and fast. See tests.md for patterns on naming, structure, and assertion style.
Anti-patterns
- Writing implementation before the test (defeats the purpose)
- Writing multiple tests before making any pass (too much red)
- Skipping the refactor step (accumulates mess)
- Testing private methods or internal state
- Making tests pass by weakening assertions
- Mocking everything instead of testing real behavior
References
- deep-modules.md - Why to test surface area, not internals
- interface-design.md - Contract-first design
- mocking.md - When and how to use test doubles
- refactoring.md - Safe refactoring under green tests
- tests.md - Test structure, naming, and assertions
From the spences10/claude-code-toolkit README
claude-code-toolkit
Productivity and ecosystem tools for Claude Code.
For vendor-agnostic skills usable outside Claude Code's plugin marketplace, use spences10/skills.
Quick Start
# Add marketplace
/plugin marketplace add spences10/claude-code-toolkit
# Install plugins
/plugin install mcp-essentials
/plugin install analytics
/plugin install toolkit-skills
/plugin install claude-workflow
/plugin install dev-environment
/plugin install devops-skills
/plugin install dev-practices
/plugin install nopeek
Plugins
mcp-essentials
Setup guide for recommended MCP servers:
| Server | Purpose |
|---|---|
| mcp-omnisearch | Unified search (Tavily, Kagi, GitHub, Perplexity) |
| mcp-sqlite-tools | Safe SQLite operations |
| mcpick | Manage MCP servers, plugins, cache, and profiles |
Skills: mcp-setup — setup guide for configuring MCP servers
analytics
Query Claude Code usage from ccrecall database:
- Token usage by model/project/day
- Session history
- Thinking block search
Skills: analytics — query token usage and session history
toolkit-skills
Core skills for the toolkit ecosystem.
| Skill | Description |
|---|---|
| ecosystem-guide | Guide to choosing the right tool across the ecosystem |
| research | Verify sources before presenting findings |
| skill-creator | Design and create Claude Skills using progressive disclosure |
| reflect | Extract learnings from sessions and persist to skills |
| plugin-dev | Validate, test, and distribute Claude Code plugins |
claude-workflow
Claude Code workflow patterns.
| Skill | Description |
|---|---|
| advanced-prompting | High-leverage prompts that challenge Claude's defaults |
| claude-md-maintenance | Maintain CLAUDE.md files effectively |
| orchestration | Multi-agent orchestration patterns for team mode |
| structured-rpi | Enhanced Research-Plan-Implement workflow with structured phase gates |
dev-environment
Development environment setup.
| Skill | Description |
|---|---|
| terminal-optimization | Terminal setup for Claude Code (Ghostty, statusline, tmux) |
| worktree-mastery | Git worktree patterns for parallel Claude sessions |
devops-skills
DevOps patterns.
| Skill | Description |
|---|---|
| ci-debug-workflow | Debug failing CI pipelines and reproduce bugs locally |
| techdebt-finder | Find duplicated code, inconsistent patterns, and refactoring opportunities |
| deslop | Identify and remove AI-generated code patterns (slop) |
| improve-codebase-architecture | Find architectural improvement opportunities and deepen shallow modules |
dev-practices
Development practice skills.
| Skill | Description |
|---|---|
| tdd | Test-Driven Development workflow with red-green-refactor cycle |
nopeek
Secret safety for Claude Code sessions. Powered by the nopeek CLI.
| Hook | Event | What it does |
|---|---|---|
| redact-output | PreToolUse(Bash) | Best-effort pattern redaction for selected cloud CLI stdout; not stderr |
Tell your coding agent: Use npx nopeek if you need keys.
Swap npx for pnpx or bunx if that's what you use.
The agent selects keys and uses run for each credential-dependent command.
init is an optional cloud-auth audit, not an installation prerequisite.
Security migration: Update to nopeek CLI 0.0.17 or newer and
nopeek plugin 0.0.24 or newer. Stored credentials
and CLI profiles are no longer automatically loaded into sessions, and
load no longer writes CLAUDE_ENV_FILE. Remove legacy SessionStart
registrations and restart affected sessions. The retired session-load.sh
entry point only prints migration guidance; it never reads stored keys.
Neither updating nor deleting stored keys clears old environments,
session files, histories, or transcripts. Rotate exposed credentials.
Persistence remains explicit, global plaintext, and not project-scoped;
load --persist now requires --only. Prefer per-command run instead.
run --only filters the file, not inherited parent variables, and does
not prevent child output or argument disclosure. Redaction is not a guarantee.
Skills: nopeek — per-command credentials, migration, and limitations
Regression checks (synthetic credentials only):
python3 -m unittest discover -s plugins/nopeek/tests -v
claude plugin validate plugins/nopeek
See the cross-agent assessment for source-backed comparisons and the tested delivery boundary.
Ecosystem
Related projects for Claude Code power users. For portable skills across compatible agents, use spences10/skills.
| Project | What it does |
|---|---|
| nopeek | Per-command credential loading that reduces accidental disclosure |
| svelte-skills-kit | Production-ready Svelte 5 & SvelteKit skills (90%+ verified accuracy) |
| claude-skills-cli | Create skills with progressive disclosure validation and 84% activation hooks |
| mcpick | Manage MCP servers, plugins, cache, and profiles from the CLI |
| ccrecall | Sync Claude Code transcripts to SQLite for usage analytics and search |
Local Development
git clone git@github.com:spences10/claude-code-toolkit.git ~/repos/claude-code-toolkit
# Add local marketplace
/plugin marketplace add ~/repos/claude-code-toolkit
# Install plugin
/plugin install mcp-essentials
Releasing Updates
Version lives in one place: .claude-plugin/marketplace.json. Bump all
"version" values there, commit, and push. Users with auto-update get
changes on startup. Others run /plugin update plugin-name@spences10-claude-code-toolkit.
Details
- Marketplace
- spences10/claude-code-toolkit
- Source
- plugins/dev-practices
- Author
- Scott Spence
- Category
- Skills
- License
- MIT
- Keywords
- tdd, testing, red-green-refactor, test-driven
- Listed since
- Apr 7, 2026
More from spences10/claude-code-toolkit
All 8Similar to dev-practices
More Testing & QA
tdd-workflowPlugindgalarza/claude-code-workflows72 starsTest-driven development skill that enforces red-green-refactor, one test at a time
testPluginudecode/dotai1.1K starsTest-driven development workflow for writing tests before implementation - red-green-refactor cycle with deterministic unit tests
tddPluginposhan0126/dotclaude871 starsStrict red-green-refactor TDD loop. Failing test, then minimum code, then refactor. Commits after each cycle.
test-driven-developmentSkilladdyosmani/agent-skills75.8K installsStructured red-green-refactor workflow that writes a failing test before any code change, including bug fixes.
testing-strategiesPluginmiles990/claude-software-skills26 starsUnit, integration, E2E testing and TDD practices
tdd-workflows-tdd-greenSkillsickn33/agentic-awesome-skills263 installsMinimal-implementation guidance for the TDD green phase that makes failing tests pass without refactoring or redesign.