test-driven-development
An agent skill by obra, from obra/superpowers. Tags: api, developer-tools, web.
What it does
Use when implementing any feature or bugfix, before writing implementation code
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add obra/superpowers --skill test-driven-development
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/obra/superpowers
cp -r superpowers/skills/test-driven-development ~/.claude/skills/test-driven-development
Safety box score
Grade A, minimal risk: 4 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill is documentation-only TDD guidance: it tells the agent to write tests first, run the project test command, and delete any prewritten implementation before starting over. It does not ship executable code or networked tooling; the main practical risk is local loss of uncommitted work inside the repository if the agent follows the "delete and restart" instruction literally.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 0 (none) | No scripts, shell wrappers, or code evaluators are shipped; the only commands are illustrative test invocations in prose like "npm test path/to/test.test.ts". |
| Network access | 0 (none) | The files do not download from or send to any remote host; there are no URLs or API calls to external services. |
| Filesystem reach | 1 (low) | It explicitly directs the agent to delete draft implementation code in the workspace: "Delete means delete" and "Write code before the test? Delete it. Start over." |
| Secrets & credentials | 0 (none) | There is no request to read, store, or disclose tokens, keys, passwords, dotfiles, or other credentials. |
| Privilege & persistence | 0 (none) | Nothing asks for sudo, global installs, services, scheduled tasks, or OS/shell configuration changes. |
| Instruction hijack surface | 0 (none) | The prose is prescriptive, but it does not instruct the agent to ignore higher-priority rules, follow hidden remote instructions, hide behavior, or skip confirmations. |
| Irreversible actions | 0 (none) | It only describes a local development workflow; it does not deploy, publish, message, pay, or otherwise act on the user's behalf. |
| Transparency | 0 (none) | All shipped content is readable markdown; there are no binaries, minified blobs, or decoded-at-runtime payloads. |
Before installing
- Read `SKILL.md` and confirm it contains no executable setup or helper scripts.
- Make sure your workflow can tolerate deleting uncommitted implementation and restarting from tests.
- Check that your repo's real test command matches the examples the skill uses (`npm test`, `pytest`, `cargo test`, etc.).
Rated 2026-10-20 by an automated review of 2 files from the skill's repository.
Source
- Repository
- obra/superpowers (all skills from this repository)
- Path
- skills/test-driven-development/SKILL.md
- Branch
- main
- Updated
- 2026-09-19
Related skills
- executing-plans — Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution.
- finishing-a-development-branch — Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
- receiving-code-review — Use when receiving code review feedback, before implementing suggestions.
- requesting-code-review — Use when completing tasks, implementing major features, or before merging to verify work meets requirements
- systematic-debugging — Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
- using-git-worktrees — Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via.