/afb-tdd:afb-tdd-setupfrom afb-tdd
Tune the afb-tdd loop to this repo — detects stack, commands, architecture and conventions, audits the existing test suite, and writes committed resources the loop reads. Use when asked to set up, bootstrap, initialise or refresh afb-tdd (or TDD generally) for a project or polyrepo. Not for running the TDD loop itself; that is the afb-tdd skill.
Ships in afb-tdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Write .claude/afb-tdd/ for this repo: committed resources the afb-tdd loop reads instead of rediscovering the project every cycle. A deterministic script does the codebase detection (zero tokens); you fill in only what it can't detect, reading a small fixed set of files it points you to. Never explore the repository on your own — the only files you may read are the ones the digest names.
.claude/afb-tdd/
├── manifest.json what was generated, when, against which commit (script)
├── project.md facts: stack, commands, layout, slice order (script + you, step 3)
└── practices.md taste: how this team tests (you, step 4)
This skill only sets up. It never runs the TDD loop, and it never writes a skill — the loop is the separate afb-tdd skill and treats these files as a soft dependency: it works without them and falls back to its own references. Nothing you write here may name another skill's install path.
The test-suite audit (step 4) runs by default. If the user asked for a quick/simple/shallow setup (e.g. /afb-tdd-setup --simple, or words like "simple", "quick", "skip the audit"), pass --simple in step 1 and skip step 4.
Run the detector (writes only into .claude/afb-tdd/, never your source):
bash ${CLAUDE_SKILL_DIR}/scripts/setup-local.sh
Flags: --simple skips the test audit, --no-polyrepo forces single-repo treatment of a folder-of-repos, --refresh regenerates beside existing files for a human to merge, --force overwrites in place.
If it reports resources already exist, stop and tell the user — these files belong to them once written. Offer --refresh (writes project.md.new to diff) or --force (discards their edits). Never pick --force for them.
Polyrepo: if .claude/afb-tdd/DIGEST.txt begins with POLYREPO=true, the detector found ≥2 child git repos and delegated to setup-polyrepo.sh — follow references/polyrepo-setup-mode.md instead of the steps below. That file refers to "the detector"; the path is the one above.
Read .claude/afb-tdd/DIGEST.txt and .claude/afb-tdd/project.md. Then read only the files the digest lists under PROJECT KNOWLEDGE FOUND — the project's own style rules, instruction files (CLAUDE.md etc.), and the named README architecture sections. That fixed list is your entire context budget for this step; do not open anything else.
Fill project.md, resolving every # TODO(...) / NEEDS CONFIRMATION marker:
If the digest contains DEEP_AUDIT=requested, write practices.md. This is the main event, not an appendix. Fan out one agent per module listed under LOCATED FOR DEEP AUDIT. Each agent first reads the project's own style rules (located in step 2), then audits that module's test files against them and returns (a) gold-standard exemplar files with file:line, (b) shipped violations grouped by area, (c) the single worst file to not imitate.
Then write .claude/afb-tdd/practices.md with these sections:
afb-tdd skill's references/conventions/*.md, which the digest lists by full path) rewritten against this repo: its real helper APIs, its real names, its actual examples. Not a copy. If the repo's own rule files disagree with a built-in convention, the repo wins and you say so.file:line and one line on what each demonstrates.Ask the human the ASK THE HUMAN questions (Q5–Q9) from the digest, using the script's proposed defaults. Lead each with the recommended answer so it can be accepted in a word; skip any the digest already settled. Q9's links go into project.md's External / linked docs line as pointers (they may need an MCP connector or the user to paste content; don't try to inline them).
Delete DIGEST.txt. Then tell the user: which files were written, that they are committed and belong to the team, that /afb-tdd will now read them, and the resolved full-suite command. Offer once to add a pointer to the repo's CLAUDE.md — don't do it unprompted, it costs context in every session including non-TDD ones.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub afbreilyn/afb-tdd --plugin afb-tdd2 skills in this plugin