TDD Implementation with Claude Code ― tsumiki's dev-impl Skill
機械翻訳 / Machine-translated
機械翻訳 / Machine-translated
Original article: TDD Implementation with Claude Code ― tsumiki's dev-impl Skill (cccskills)
Skill page: dev-impl
Key takeaways from this article
When you install tsumiki's dev-impl, agents like Claude Code will write tests first and confirm that they fail.
Only then does it proceed to implement code so the tests pass.
This article explains the difference between normal mode, which follows a plan, and quick mode, which accepts direct instructions.
It also covers installation steps, example prompts, and prerequisites you should know before using it.
When you specify a planned task, dev-impl writes tests, confirms their failure, and then begins implementation.
An example prompt looks like this:
/dev-impl auth 001
The agent starts by reading docs/dev/context.md and the task file.
It then generates test code from the testing policy written in the task, runs it, and confirms failure (Red).
After that, it writes the minimum implementation needed to make the tests pass and confirms success (Green).
Once the tests pass, it inspects related files for line count, security, performance, and coverage.
Finally, it returns a "confidence report."
The report lists coverage and thresholds per package, along with the review priority for each implemented file.
The task file's status is also updated to done.
dev-impl is an implementation skill included in tsumiki, published by Classmethod.
It uses TDD (a development approach where tests are written before implementation) as its guardrail.
The fundamental rule of this skill is that it does not move to the next step until tests pass.
There are two modes, switched by the form of arguments passed.
| Mode | How to invoke | Suited for |
|---|---|---|
| Normal mode | /dev-impl <plan-name> <task-id> | Implementing one task from a Plan |
| Quick mode | /dev-impl "fix instruction" | Small bug fixes, adding cases to existing tests, light refactoring |
Normal mode is the step that comes after planning in tsumiki's development flow.
After analyzing the project with dev-context and breaking it into tasks with dev-plan, dev-impl implements one task at a time.
Verification is handled by dev-verify, and investigation on failure is handled by dev-debug.
Quick mode does not require a Plan.
It uses a sub-agent to find related files, fixes the tests and implementation, then runs the tests to verify.
It also includes a 500-line rule check and a concise report.
The inspection performed after tests turn Green covers the same items every time.
The priority order for decisions is set as "quality > speed > token consumption."
All generated public functions and methods receive an "Intent comment."
These comments indicate where the rationale for a design decision comes from, using a three-level traffic-light system.
| Signal | Meaning | Treatment in review |
|---|---|---|
| Blue | Decision explicitly stated in the task file or context.md | Low priority |
| Yellow | Reasonable decision inferred from instructions | Needs confirmation |
| Red | No basis in prior steps; decision was supplemented by AI | Human review required |
Security and performance issues flagged red are fixed before completion.
The confidence report also categorizes files using the same three levels.
How tests and implementation are handled changes based on the complexity level written in the task file.
| Complexity | Approach |
|---|---|
| low | Create tests and implementation together, verify by running tests |
| medium | Cycle through: write tests, confirm Red, implement, confirm Green |
| high | Add one test at a time, make each one Green one by one |
It can be installed with a single command.
When running it, you can choose the target agent, such as Claude Code or Codex.
npx skills add https://github.com/classmethod/tsumiki --skill dev-impl
To have the agent install it for you, send the following message as-is:
次の Agent Skill をインストールしてください。
https://github.com/classmethod/tsumiki/tree/main/skills/dev-impl
まず SKILL.md と付属ファイルの中身を確認し、不審な処理(外部への送信、認証情報の読み取りなど)がないことを確かめてから、Claude Code なら ~/.claude/skills/dev-impl/、Codex なら ~/.agents/skills/dev-impl/ に配置してください。
The installation location depends on whether you want to use it across all projects or only in a specific project.
| Agent | For all projects | For a specific project only |
|---|---|---|
| Claude Code | ~/.claude/skills/dev-impl/ | .claude/skills/dev-impl/ in your project |
| Codex | ~/.agents/skills/dev-impl/ | .agents/skills/dev-impl/ in your project |
The full repository can be found at classmethod/tsumiki.
Phrases you can use to invoke it include: "implement task," "test-first implementation," "start implementation," "quick fix," and "quick fix" (in English).
Please implement task 001 of the auth plan test-first using dev-impl auth 001.
This prompt uses normal mode.
It starts by confirming that all dependent tasks are done.
Then it proceeds in order: write tests, confirm Red, implement, confirm Green, and inspect.
Finally, a confidence report is returned and the task status is updated to done.
Quick fix: Update the login form to trim whitespace from both ends of the email address before validation.
This uses quick mode.
It finds related files, fixes the tests and implementation, runs the tests, and reports the results.
What comes back is a concise report.
Quick fix: Add a test case for when the page number is 0 to the existing tests.
This is also a quick mode prompt.
Adding cases to existing tests is one of the intended uses of this mode.
It also adjusts the implementation so the added tests pass and reports the results.
dev-impl does not work in isolation — it depends on files created by other tsumiki skills.
Please confirm the following before using it:
docs/dev/context.md does not exist, you will be directed to run dev-context first. The test execution command is also retrieved from this file.docker-compose.yml or docker-compose.yaml exists in the project root, docker compose down will be run at the end. This stops your development containers, so be careful if other work is in progress.git command to get the project root. This skill is intended for projects managed with git.The license is MIT.
There are only two accompanying files — SKILL.md and references/impl-strategies.md — so reading them before installation is a good idea.
The skills used before and after dev-impl are all available in the same tsumiki repository.
dev-context analyzes the tech stack, test framework, and coding conventions to create the project context.
This is the step that prepares the context.md file that dev-impl reads.
dev-plan creates an implementation plan from requirements and breaks it into tasks.
The Plan and tasks specified in normal mode are created here.
dev-debug handles test failures and build errors.
You will be directed to it when dev-impl cannot get tests to pass after three attempts.
In quick mode, neither a Plan nor a task file is required.
You can give instructions directly in the form /dev-impl "fix instruction".
However, if context.md does not exist, you will be directed to dev-context, so creating it first will speed things up.
The cycle of analyzing errors and making fixes runs up to three times.
If the issue is still not resolved after that, you will be directed to use dev-debug.
The install command lets you choose Codex as the target.
However, the process includes Claude Code-specific feature names such as TodoWrite and sub-agent model specifications.
If a related file exceeds 500 lines, it is split along responsibility boundaries.
Test files are split as well, and tests are re-run after the split to confirm they still pass.
dev-impl is a skill that brings the habit of writing tests first into AI-assisted development.
Planned tasks are handled in normal mode; small changes are handled in quick mode.
In both modes, the process completes only after the test results are verified.
What comes back at the end is a report showing the strength of the rationale in three levels.
For more information, see the cccskills page.
This article is a repost of the cccskills article "TDD Implementation with Claude Code ― tsumiki's dev-impl Skill."
Skill details and installation instructions can be found on the cccskills dev-impl page.