Test-first implementation of the current task through the vendored superpowers test-driven-development procedure, with the task plan's files and verification command injected. Use during task execution for any feature, bugfix or refactor, before writing implementation code. Not without a task plan (plan-task or quick-task first).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Test Driven Development?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/yesterday-ai-test-driven-development)
---
name: test-driven-development
metadata:
tier: core
version: 0.1.2
description: "Test-first implementation of the current task through the vendored superpowers test-driven-development procedure, with the task plan's files and verification command injected. Use during task execution for any feature, bugfix or refactor, before writing implementation code. Not without a task plan (plan-task or quick-task first)."
allowed-tools:
- Bash
- Read
- Edit
- Write
- AskUserQuestion
---
# ytstack:test-driven-development
Thin wrapper around the vendored superpowers `test-driven-development` skill (`vendor/superpowers/skills/test-driven-development/SKILL.md`). Injects the current task's plan (Files + Verification sections) as context, then inlines the vendored procedure verbatim. Vendor is single source of truth.
## ytstack context (resolved at render time)
```!
# ytstack resolver (M016): checkout = where this shell runs, via the shared lib.
_LIB="${CLAUDE_SKILL_DIR}/../../hooks/lib/git-ctx.sh"
if [ -f "$_LIB" ]; then
. "$_LIB"; yt_git_ctx "$PWD"; yt_resolve_yt_dir >/dev/null
_PROJECT_DIR="$YT_TOPLEVEL"; _YT_DIR="$YT_DIR"; _YT_SCOPE="$YT_SCOPE"; _IS_GIT="$YT_IS_GIT"; _PROJECT_KEY="$YT_REPO_KEY"
else
# Host did not substitute CLAUDE_SKILL_DIR (e.g. Codex adapter): project scope only.
_IS_GIT=$([ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ] && echo yes || echo no)
_PROJECT_DIR=$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)
_YT_DIR=""; _YT_SCOPE=none; _PROJECT_KEY=""
[ -d "$_PROJECT_DIR/.ytstack" ] && { _YT_DIR="$_PROJECT_DIR/.ytstack"; _YT_SCOPE=project; }
fi
cd "$_PROJECT_DIR" 2>/dev/null || true
_PROJECT_SLUG=$(basename "$_PROJECT_DIR")
_M=none; _S=none; _T=none
if [ -n "$_YT_DIR" ] && [ -f "$_YT_DIR/STATE.md" ]; then
_M=$(sed -n 's/^current_milestone: *//p' "$_YT_DIR/STATE.md" | head -1)
_S=$(sed -n 's/^active_slice: *//p' "$_YT_DIR/STATE.md" | head -1)
_T=$(sed -n 's/^active_task: *//p' "$_YT_DIR/STATE.md" | head -1)
fi
# The plan lives with its milestone: flat or milestones/M###/ (issue #70)
if command -v yt_artifact_path >/dev/null 2>&1; then _TASK_PLAN=$(yt_artifact_path "$_YT_DIR" "$_M-$_S-$_T-PLAN.md"); else _TASK_PLAN="$_YT_DIR/$_M-$_S-$_T-PLAN.md"; fi
echo "HAS_YTSTACK: $([ -n "$_YT_DIR" ] && echo yes || echo no)"
echo "ACTIVE_TASK: $_M-$_S-$_T"
echo "TASK_PLAN: $_TASK_PLAN"
echo "TASK_PLAN_EXISTS: $([ -f "$_TASK_PLAN" ] && echo yes || echo no)"
```
## ytstack invocation notes
You are invoked inside a ytstack project. The work unit is the current task (`_M-_S-_T` above) whose plan file at `TASK_PLAN` contains the `## Files` section (what to touch) and `## Verification` section (how to know it passes). The vendored TDD procedure uses these: the RED test targets the behavior described in the task-plan body; the verification command is the one specified in the plan's Verification section.
HARD-GATE: if `HAS_YTSTACK=no` or `TASK_PLAN_EXISTS=no`, abort with: "Run `ytstack:plan-task` first to produce the task-plan." Do not invoke the vendored procedure; TDD without a target task-plan is guessing.
**Which changes get a new test (ytstack).** The vendored procedure writes a failing test first; that holds for every change with logic in it: a branch, a loop, a parser, money, permissions, a bug fix (the test reproduces the bug). A trivial change gets no new test: a rename, a constant, a text, a config value, a moved line. For those the RED step is the plan's verification command failing or an existing test covering the line, and you write no test to look thorough (`ytstack:minimal-code`, "Never cut"). Where the vendored text and this paragraph differ, this paragraph applies. Run the suite the plan names, not every suite in the repository.
After the vendored procedure completes (test passes + refactor done):
- Do NOT run `ytstack:summarize-task` automatically; the user triggers that when ready.
- If a behavior decision was made during TDD that was not in the plan, append a note to the task-plan's body or log to `KNOWLEDGE.md` if it generalizes.
## Vendored procedure (inlined verbatim)
```!
cat "${CLAUDE_SKILL_DIR}/../../vendor/superpowers/skills/test-driven-development/SKILL.md"
```
## Namespace note (ytstack)
The text above is upstream superpowers content (v7.0.2) rendered inside ytstack. Read `superpowers:<skill>` as `ytstack:<skill>` (for example `superpowers:verification-before-completion` is `ytstack:verification-before-completion`) and invoke the ytstack-namespaced skill via the Skill tool. Relative links such as `writing-good-tests.md` resolve under `vendor/superpowers/skills/test-driven-development/` in the ytstack plugin directory (`${CLAUDE_SKILL_DIR}/../../vendor/superpowers/skills/test-driven-development/`); read them from there when you need them. In the GREEN step, apply `ytstack:minimal-code` (the minimal-code ladder injected at session start when PREFERENCES `minimal_code` is on): the smallest change that passes, never cutting validation, auth, boundary error handling or accessibility.