johnku2011/boilerplates-with-ai-skills/test-driven-development
Claude Code and agent skill by johnku2011/boilerplates-with-ai-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when implementing a feature or fixing a bug — TDD, red-green-refactor, failing test first, then minimal code, then refactor. Run npm test before claiming done.
Install
npx vskill@latest install johnku2011/boilerplates-with-ai-skills/test-driven-developmentSKILL.md
The same SKILL.md was published earlier as johnku2011/boilerplates-with-ai-skills/test-driven-development.
Test-Driven Development
Overview
Write a failing test before production code. Keep each cycle small and verify with this project's test command (see AGENTS.md).
Core principle: If you did not watch the test fail, you do not know if it tests the right thing.
Iron law: No production code without a failing test first.
When to Use
Always:
- New features
- Bug fixes
- Behavior changes
Exceptions (ask your human partner):
- Throwaway prototypes
- Generated code
- Pure configuration with no runtime behavior
Red-Green-Refactor
- RED — Write one minimal test for one behavior. Run it; confirm it fails
for the expected reason (missing feature, not a typo).
- GREEN — Write the smallest code that passes. Run the full suite.
- REFACTOR — Clean up while staying green. Do not add behavior.
- Repeat for the next increment.
Guidelines
- Prefer many small tests over one large test.
- Test observable behavior (HTTP status/body, CLI output, return values), not
private implementation details.
- Run
npm testafter every change; do not claim completion on a red suite. - Keep tests deterministic: no wall-clock timing, network, or ordering flakes.
- For UI or native screens, unit-test pure logic under
src/; verify layout on
a simulator only when the change is visual.
- Use real code in tests; mock only at unavoidable boundaries.
Verification Checklist
Before marking work complete:
- [ ] Every new function or route has a test
- [ ] Watched each new test fail before implementing
- [ ] Failure was due to missing behavior, not setup errors
- [ ] Wrote minimal code to pass each test
- [ ] Full test suite passes
- [ ] No new warnings in test output
If you cannot check every box, you skipped TDD — start over.
Bug Fixes
- Write a failing test that reproduces the bug.
- Fix with minimal code.
- Keep the test — it prevents regression.
Never fix bugs without a test.
Common Rationalizations
| Excuse | Reality | |
|---|---|---|
| "Too simple to test" | Simple code breaks. A test takes seconds. | |
| "I'll test after" | Tests that pass immediately prove nothing. | |
| "Already manually tested" | Manual checks are not repeatable in CI. | |
| "Deleting code is wasteful" | Unverified code is debt. Delete and rewrite with TDD. |
Anti-patterns
- Writing production code before any failing test.
- Claiming done without running the project's test command.
- Testing private functions instead of public behavior.
- Mocking so heavily you test the mock, not the system.
Upstream Note
Adapted from obra/superpowers TDD workflow, trimmed for bwai boilerplates. Run bwai sync-upstream --skill test-driven-development to compare with upstream.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingshared/skills/test-driven-development/SKILL.md
Popularity
- Repository stars
- 240
- Repository forks
- 24
- Repository npm downloads, 7 days
- 38
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 23 Nov 2026, 4 days ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/johnku2011/boilerplates-with-ai-skills/test-driven-development)