Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aicodeking/deepseek-stack --skill ds-tdd -a claude-code
Open on GitHub

What 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-tdd on the bug in this module.

How to install ds-tdd

1Skills CLI (Vercel)

npx skills add aicodeking/deepseek-stack --skill ds-tdd -a claude-code

2Manually: put the files in place

~/.claude/skills/ds-tdd/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/ds-tdd/

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

Similar skills

All skills for Testing and QA →

From the same set29

The whole set →
ds-ledger This Claude Code skill logs decisions during long or unattended work. It is triggered for multi-phase tasks, work that a person will review later, or with /ds-ledger. CX Codex +1 545installs ds-explain Skill explains code logic and architectural reasons in plain language for Claude Code, Codex, and Cursor. Runs during subsystem onboarding or via /ds-explain. CX Codex +1 545installs ds-lessons ds-lessons is a Claude Code skill that turns recurring agent mistakes in a repository into hard checks, from types to linters. It runs after user corrections, repeated bugs, or long sessions. CX Codex +1 544installs ds-sharpen The ds-sharpen Claude Code skill refines your prompts, deepens tasks, and stress-tests plans for AI agents. It runs before starting vague or high-stakes work to identify potential weaknesses. CX Codex +1 542installs ds-catchup ds-catchup — a skill for Claude Code summarizes changes since the last message and lists decisions awaiting the user's input. It runs when someone returns after a long pause or asks what happened. CX Codex +1 540installs ds-jury The ds-jury Claude Code skill gathers independent reviews of a code change from several models. The agent works through accepted findings and runs another review round until the reviewers agree. CX Codex +1 539installs ds-best-of-n The ds-best-of-n Claude Code skill creates several independent versions of a task and combines the strongest result with selected parts from the others. It runs for substantial work where a single attempt may take the wrong direction. CX Codex +1 539installs ds-swarm Claude Code skill splits broad tasks across parallel workers and merges their verified outputs into a single report. Triggers on /ds-swarm during audits or multi-branch races. CX Codex +1 537installs

Project sponsors

Companies that keep this analytics open