ds-tdd — Claude Code skill: what it does, how to install
The ds-tdd Claude Code skill guides bug fixes through a failing test, then a minimal code change. It activates for TDD or regression-test requests and bugs with a simple local test target.
MIT 542 installs ★ 320 updated 2026-10-28
npx skills add aicodeking/deepseek-stack --skill ds-tdd -a claude-codeWhat ds-tdd does
ds-tdd turns a bug into a test before changing production code. It follows the project’s existing test style, adds a focused check, and runs it to confirm the failure points to the bug rather than a typo or missing import. Then it makes the smallest change for the intended behavior and runs the new test alongside the surrounding suite.
When a full test is impractical because setup is heavy, mocks are brittle, or the relevant state exists only in production, the skill uses the closest runnable check and explains why it skipped the test. After three failed fix attempts, it stops, reports what it found, and runs /ds-unstick. Test output should be shown both before and after the fix.
What it helps with
- reproduce a bug with a test before changing code
- check that a test fails for the bug itself
- fix a defect with a minimal code change
- run the new test and the surrounding suite
- stop after three unsuccessful fix attempts
Example prompts for the agent
- Fix this bug with TDD and add a regression test first.
- Write a test for this defect that fails for the right reason before changing the code.
- Run
/ds-tddon the bug in this module.
How to install ds-tdd
1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-tdd -a claude-code2Manually: put the files in place
~/.claude/skills/ds-tdd/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ds-tdd/
1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-tdd -a codex2Manually: put the files in place
.agents/skills/ds-tdd/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-tdd -a cursor2Manually: put the files in place
.cursor/skills/ds-tdd/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aicodeking/deepseek-stack skills/ds-tdd2Manually: put the files in place
.github/skills/ds-tdd/SKILL.md1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-tdd -a gemini-cli2Platform CLI
gemini skills install https://github.com/aicodeking/deepseek-stack --path skills/ds-tddManually: put the files in place
.devin/skills/ds-tdd/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-tdd -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ds-tdd
How do I install ds-tdd in Claude Code?
Run npx skills add aicodeking/deepseek-stack --skill ds-tdd -a claude-code. The skill file is at ~/.claude/skills/ds-tdd/SKILL.md.
What does ds-tdd do?
It adds a test that reproduces the bug, makes a minimal fix, then runs the test and the surrounding suite again. The skill asks for test output from before and after the change.
What happens after several failed fix attempts?
After three unsuccessful attempts, ds-tdd stops, reports what it learned, and runs /ds-unstick.
Source text
SKILL.md · MIT
--- name: ds-tdd description: "Fix a bug by first writing a focused test that fails for the right reason, then making the smallest change that makes it pass. Use when the user asks for TDD or a regression test, when a bug has a cheap local test target, or for /ds-tdd." --- # ds-tdd Make the bug executable before touching production code, so the fix is proven, not claimed. ## Steps 1. Pin down the bug: expected behavior, actual behavior, the code path, and the smallest way to reproduce it. 2. Find the nearest existing test style for that code path. Use it. Do not build a new harness just for this. 3. Write the smallest test that would have caught the bug. It checks intended behavior, not the current implementation. 4. Run it. Show the output. It must fail, and fail for the bug, not for a typo or missing import. If not, fix the test first. 5. Make the smallest production change that gives the intended behavior without breaking nearby contracts. 6. Run the new test and the surrounding suite. Show the output. 7. If a clean test is impractical (heavy setup, brittle mocks, production-only state), use the closest runnable check instead: a script, a repro command or a log check. Say why you skipped the test. ## Stop when - The new test failed before the fix and passes after it, both shown with output, and the surrounding suite passes. - Or after three fix attempts the test still fails. Stop, report what you learned and run /ds-unstick. ## Rules - Never edit a test to match a wrong implementation. - Do not weaken existing assertions without a clear, stated reason. - No test beats a bad test: one that mostly tests mocks, depends on timing, or would be deleted right after.
© aicodeking · MIT · aicodeking/deepseek-stack