/claude-apd:apd-setupfrom claude-apd
Scaffolds or repairs an APD framework project: generates CLAUDE.md, per-agent files, rules, memory, verify script, and runs gap analysis. Invoke via /apd-setup.
Ships in claude-apd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Manual-only skill (
disable-model-invocation: true). The user invokes it with/apd-setup. CC-only — on Codex use theapd cdx initCLI.
Use when:
.claude/ and wanting to validateSkip when:
apd-audit is clean — nothing to doapd cdx init CLI instead, this skill writes .claude/ paths| File | Content |
|---|---|
CLAUDE.md | Project instructions — generated from user responses |
.claude/agents/*.md | Builder agents with scopes and ${CLAUDE_PLUGIN_ROOT} hook paths (generated by this skill) |
.claude/agents/code-reviewer.md, .claude/agents/adversarial-reviewer.md, .claude/agents/supervisor.md | The three review roles — written by apd-init from the shipped templates when missing; init also refreshes a supervisor.md that predates the v7.1 Question/Notes contract (previous copy kept as supervisor.md.bak.pre-v7.1) |
.claude/rules/workflow.md | Copied verbatim by apd-init from plugins/apd/rules/workflow.md (CC does not load rules from plugins). Init records the shipped copy it took in .apd/.workflow.md.shipped (v7.1.6) and, whenever the framework's file changes, MERGES the change into the project's copy with git merge-file — local edits survive, a clean merge is backed up as workflow.md.bak.pre-v<version>, a conflict leaves the copy untouched and init says so. A project set up before v7.1.6 has no record: init reports the difference at session start and step 5c creates the record. Drift dimension C audits it |
.claude/rules/principles.md | Rules for the user's stack and language — apd-init seeds it from templates/principles/en.md; see step 3 for Serbian |
.claude/scripts/verify-all.sh | Build/test commands for the stack |
.claude/memory/MEMORY.md | Project memory index |
.claude/memory/status.md | Current status |
.claude/memory/session-log.md | Session log (empty) |
.claude/memory/pipeline-skip-log.md | Skip log (empty) |
.claude/settings.json | Written and merged by apd-init: env, enabledPlugins (superpowers off), attribution (empty), Notification hook, and permissions — Edit allow for .claude/memory/** and the seven .apd/pipeline/ files the gates mandate, Bash(bash .claude/bin/apd *), plus the 8 mkdir .apd/pipeline deny patterns. Never hand-write this file |
.claude/.apd-config | PROJECT_NAME, APD_VERSION, STACK (CC-native activation marker) |
.claude/.apd-version | APD plugin version |
.claude/bin/apd | The apd shortcut — created by session-start, not by this skill |
.apd/pipeline/, .gitignore entries | Pipeline state dir + ignore entries from templates/gitignore-entries.txt — apd-init |
Dual activation paths. APD recognizes two locations for the config file:
.claude/.apd-config— CC-native (what this skill generates; used on all CC-enabled projects).apd/config— runtime-neutral, used on pure-Codex projects that never create.claude/(auto-seeded byapd cdx init)The framework reads either; write to whichever matches the host runtime. Hybrid projects work with either.
Guard scripts, pipeline scripts, hooks/hooks.json, skills, templates — all live in the plugin and are used via ${CLAUDE_PLUGIN_ROOT}. The one file that is copied INTO the project is .claude/rules/workflow.md (table above): CC does not auto-load rules from plugins, so apd-init copies it and drift detection keeps the copy honest.
bash "${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/apd-init"
bash "${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/session-start"
Do NOT skip this. Do NOT do your own analysis instead. Run both scripts and read their output. The second script creates the apd shortcut and loads project context. Only proceed to step 2 if the scripts report missing files.
Init refreshes some existing files on its own, with a backup — do not redo or undo them: a workflow.md whose shipped source changed (merged with git merge-file, local edits kept, backup workflow.md.bak.pre-v<version>; v7.1.6) or, on a project without the shipped-copy record, one with stale guidance markers or stale guard paths (kept as workflow.md.bak.preaudit), a supervisor.md without the v7.1 **Question:**/### Notes contract (kept as supervisor.md.bak.pre-v7.1), every review agent and each builder's charter block whose framework text changed (v7.3: the same record-and-merge as workflow.md — record under .apd/.shipped/, local edits kept, backup <file>.bak.pre-v<version>; with no record, a copy equal to an earlier shipped text is refreshed and an edited one is merged from the nearest earlier text; a CONFLICT is reported with a recipe naming .apd/.shipped/<key>.md and .apd/.shipped/<key>.new.md — resolve it, do not overwrite the copy), a workflow.md with no record that is an unedited earlier shipped text (refreshed, backup kept). Backups init writes beside a copy (and the Codex installer's .codex/hooks.json.bak.* / config.toml.bak.*) are hidden from git status by a line in .git/info/exclude (v7.3.1) — do not add them to the project's .gitignore and do not commit them. principles.md is NOT refreshed — it is the project's file once seeded, stale bin/core/ guard paths in agents (→ bin/adapter/cc/), a builder missing the charter block, the permissions entries in settings.json, and APD_VERSION in .apd-config. Whatever init reports as refreshed is done; the reconcile in step 5c covers what init deliberately leaves alone (models, template fields).
Check whether .claude/ or CLAUDE.md already exists:
Gap analysis checklist + example output: See reference/init-checklist.md.
Show the analysis to the user, generate ONLY what is missing, and never overwrite existing files.
Some values come pre-filled from plugin userConfig (set at plugin enable time):
$CLAUDE_PLUGIN_OPTION_PROJECT_NAME (confirm with user)$CLAUDE_PLUGIN_OPTION_STACK (confirm with user)$CLAUDE_PLUGIN_OPTION_AUTHOR_NAME (confirm with user)Ask only for values NOT provided by userConfig:
apd-init has already seeded .claude/rules/principles.md from templates/principles/en.md; if the user chooses Serbian, regenerate it from templates/principles/sr.md. This is the one file setup overwrites after init, because init wrote it seconds ago with no user inputRead the layout with ls -d */ and propose builder agents.
Detection rules + per-role agent specs (builder + reviewer): See reference/agent-templates.md.
Show the suggestion — the user approves or adjusts before generation.
Generate each file from the per-role and per-template rules:
The reviewer agent is mandatory — every project gets one with claude-opus-5-5 / max / plan / orange (apd-init writes it from reviewer-template.md if this skill has not).
After base agents + skills exist, detect project stacks and offer to generate stack-specific agents + skills. This produces Festico-level richness automatically instead of requiring 50-100h of manual customization.
# 1. Detect what stacks are in the repo
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/pipeline-stack-detect
This lists detected stacks (e.g., .NET high, PHP/Symfony high, KMP/Compose high) with confidence + signal file locations. Multi-stack monorepos show every detected stack.
For each detected stack with available templates (use apd scaffold --list-stacks to enumerate), ask the user:
"Detected
.NETstack with high confidence (signals: src/PLAZMA.Loyalty.sln, ...). Generate 3 .NET-specific agents (backend-api, database, test-guardian) + 2 skills (dotnet-conventions, ef-core-migrations)? [Y/n]"
If user confirms:
# 2. Dry-run first (shows what would be created/skipped)
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/pipeline-stack-scaffold dotnet --dry-run
# 3. Actual scaffold (additive — skips existing files)
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/pipeline-stack-scaffold dotnet
Additive policy: files that already exist in .claude/agents/ or .claude/skills/ are SKIPPED. Combined with v6.10 drift detection (which flags stale existing files), the user gets a safe upgrade path:
pipeline-stack-scaffold dotnet --force (with .bak.preaudit backup)Multi-stack handling: repeat per detected stack. User may opt out of any (e.g., already has custom backoffice agent — skip Node/React scaffolding for that project).
Scope path defaults can be overridden via environment variables before invoke (e.g., APD_SCOPE_BACKEND=src/MyApp/) when project layout differs from defaults.
Supported stacks: dotnet — the only stack template shipped (ls ${CLAUDE_PLUGIN_ROOT}/plugins/apd/templates/stack is the authority). Every other stack gets the generic agents from step 4; do not promise stack templates that are not in that directory.
This step is setup's job, not apd-init's. Init deliberately never rewrites a model once a profile is declared (apd-init:336 — rewriting a hand-picked model on every session-start is the footgun v6.16.1 removed). The consequence: when the plugin changes what it ships — as v7.0 did (every bare alias replaced with a full id, the supervisor moved off Fable to the Opus pin, guidance that v6.31 retracted deleted) and as v7.1.9 did again (every pin moved to the 5.5 generation) — nothing carries that into an existing project. Setup is the only place that reconciles it, and it does so by asking.
Measured cost of not doing it (Bambi, 2026-07-26, hours after v7.0.2): 7 of 9 agents on stale models, the supervisor still on a model no profile names, workflow.md 103 lines behind and still instructing the orchestrator to raise maxTurns — a field proven inert on 2026-07-09. Every mechanical check said the project was fine.
Gather all four before asking anything. One report, one question.
# 1. Models vs the declared profile
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/pipeline-model-profile status
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/pipeline-model-profile <declared> --dry-run # writes nothing
# 2. Config, permissions, workflow.md content
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/pipeline-audit-drift
Agent frontmatter vs the shipped template — compare every agent against reference/agent-templates.md: tools, permissionMode, memory, color, skills (builders preload apd-tdd since v7.2.2 — a project builder without it never sees the TDD procedure workflow.md mandates, because no builder carries the Skill tool), and memory: none on the adversarial reviewer. scope is project-specific and NEVER reset; model/effort belong to the profile (item 1), not the template.
Fields the framework no longer ships — anything in an agent that the current template has no line for. maxTurns is the live example, and a special one: v6.31 removed it after a controlled test on CC 2.1.204 (a subagent with maxTurns: 3 ran 34 turns), but CC enforces it again since 2.1.246 (re-measured 2026-10-01 on 2.1.286: a capped subagent returns partial output, each resume fires a new SubagentStart). Report it, do NOT strip it — a project that set a working knob did so on purpose; the ledger records every same-id re-start as a resume (v7.2), so a capped-and-resumed agent is one dispatch for the budget. Any OTHER field the template has no line for is dead: report it and strip it on accept. Prose telling the user to tune maxTurns for speed (the pre-v6.31 workflow.md section) stays wrong — the dispatch budget sizes a task.
Present ONE report and ask once. The recommendation is full 1:1 alignment — never a subset, never a per-item negotiation:
"Project declares profile
cruise. Four things differ from framework v:
- Models: 6 builders + code-reviewer on the bare alias
opus/ xhigh →claude-opus-5-5 / high; supervisor on a Fable pin no profile names / max →claude-opus-5-5 / max- workflow.md: 103 lines behind — still documents
maxTurnstuning, which v6.31 removed- Agent frontmatter: 2 agents missing
permissionMode, adversarial missingmemory: none- Project-set fields:
maxTurnson 8 agents — not shipped by the template (CC enforces it; kept unless you say otherwise)Recommended: align all four 1:1 with v. Apply? [Y/n]"
apd profile <declared> (owned roles), unowned roles to their template pin, reconcile workflow.md — ask which case applies, never just overwrite (v7.1.6): (a) no shipped-copy record and the copy differs — if the difference is local edits the project wants to keep, run cp <plugin>/plugins/apd/rules/workflow.md .apd/.workflow.md.shipped (declares the current shipped file as the base; the edits become local and init merges framework changes forward from now on — it does NOT mean everything is merged: whatever the framework changed between the copy's real origin and today stays as it is, and drift dim C keeps reporting the difference until the copy equals the shipped file); if it is an older framework text, cp <plugin>/plugins/apd/rules/workflow.md .claude/rules/workflow.md after backing the copy up; (b) init reported a CONFLICT — git merge-file -p .claude/rules/workflow.md .apd/.workflow.md.shipped <plugin>/plugins/apd/rules/workflow.md > /tmp/workflow.merged (never in place: an in-place merge writes <<<<<<< markers into the live rules file CC loads), resolve the markers in the temp file, cp /tmp/workflow.merged .claude/rules/workflow.md, then cp <plugin>/plugins/apd/rules/workflow.md .apd/.workflow.md.shipped; (c) record present, copy differs (drift dim C IMPORTANT) — local edits belong in CLAUDE.md: move them there and take the shipped file. <plugin> is ${CLAUDE_PLUGIN_ROOT}, fix frontmatter fields, strip dead fields except maxTurns (a working CC knob — report it, keep it unless the user says otherwise). Then say the session must be restarted — agent definitions are cached at session start, and apd profile drops .apd/.pending-reload so the PreToolUse guard blocks dispatch until apd reload-done or a fresh session.Where references collide, name the authority instead of guessing. model-profiles.conf is authoritative for model/effort — a missing row means "this profile does not mention that role", never "reset it to the default row", so a declared cruise builder is NOT dragged down to the template's claude-sonnet-5-5. The template is authoritative for structural fields. If a project rule and a framework file genuinely conflict, report the conflict in the same report rather than silently picking a side.
If everything is in sync, say so in one line and move on.
First setup (in step 1 apd-init printed Mode: New project) — the full check, end-to-end test included:
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/verify-apd
Maintenance of an existing project (in step 1 apd-init printed Mode: Update) — the same check without Section 8:
bash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/verify-apd --no-e2e
Section 8 drives a synthetic task through the project's real pipeline directory. On a fresh project that is the proof the pipeline works; on a project somebody is working in — a second session, a worktree, a task between two steps — it is a risk with nothing to prove, since that pipeline has already carried real tasks. Say in the report that the end-to-end test was not run and that apd verify runs it on request.
The check must report 0 FAIL before this skill finishes. If a FAIL surfaces, escalate to the user with the concrete file and line — do NOT silently rerun.
apd-init and session-start → Do run the scripts first; they may already have set up most of the projectCLAUDE.md with {{PLACEHOLDER}} values → Do ask the user (or read from CLAUDE_PLUGIN_OPTION_* env vars) and fill every placeholderpackage.json, pom.xml, Cargo.toml, etc.) to confirm before suggesting agentsmodel: claude-opus-5-5, effort: max, permissionMode: plan — this is the one agent where shortcuts mattermodel: line for a role the profile owns, and don't offer partial alignment ("update the builders, leave the supervisor") → Do run apd profile <declared>, which moves every owned role at once. A profile the project only half-matches is worse than a declared drift: apd profile status then reports IN SYNC for a state nobody choseapd verify-contracts supports TypeScript ↔ C# only (v6.12+). For PHP/Python/Java/Go/Ruby/Kotlin/Rust backends, the verifier ERRORS — do NOT write "apd verify-contracts automatically checks DTO ↔ TS types" in generated docs for those stacks. Instead write "Cross-layer type mapping is manual — follow workflow.md section 7 (Cross-layer verification: the backend DTO is the source of truth); keep the per-stack mapping in CLAUDE.md". (Section 7 holds four rules; earlier text pointed at a table there that never existed — fixed in v7.1.6.) This anti-pattern was observed in Festico apd-setup (2026-05-28) — orchestrator confabulated PHP support claim that does not exist. When uncertain about framework feature scope, read ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/<command> script header for exact supported scope, or docs/SPEC.md.You're done when:
apd-init and session-start ran successfully and the apd shortcut worksbash ${CLAUDE_PLUGIN_ROOT}/plugins/apd/bin/core/verify-apd passes (X PASS / 0 FAIL) — with --no-e2e when maintaining an existing project (step 6)claude-opus-5-5 / max / plan / orange.claude/.apd-config (or .apd/config) is present with PROJECT_NAME, APD_VERSION, STACK.mcp.json recommendations have been presented to the user (and either accepted or skipped explicitly)pipeline-model-profile status was run and its verdict acted on: IN SYNC reported in one line, or DRIFTED presented as a single full-alignment offer that the user explicitly accepted or declinedapd-audit to confirm content quality (mechanical checks just passed; quality is a separate gate)apd pipeline spec "<task>"verify-apd still has FAILs after this skill runs → escalate to user with concrete file:line references; do NOT silently rerun the skillWhat SKILL.md sets; muted values are Claude Code's defaults
maxThree short reads, in order
npx claudepluginhub zstevovich/claude-apd --plugin claude-apdOther plugins' skills for the same job
11 skills in this plugin
/apd-auditUse when verifying that APD is correctly configured in the current project — qualitative deep audit of agents, hooks, CLAUDE.md, pipeline state, MCP wiring, and guardrails. Goes further than verify-apd. Triggers on "audit APD", "review setup", "is APD configured", "verify framework", "check APD", "APD health", "is everything wired", after any major framework upgrade or version bump./apd-brainstormUse BEFORE writing the APD spec-card.md whenever the task is vague, broad, ambiguous, or has multiple reasonable approaches. Asks ONE question at a time, presents 2-3 options when there are real choices, converges on a design the user explicitly approves. Triggers on "improve X", "what should we", "thinking about", "options", "not sure", "maybe", "vague", "broad", "redesign", any spec-card.md with unclear scope or fewer than 3 R-criteria. For the pipeline gate contract (plan format, rationale format, BLOCKs) load /apd-pipeline-guide — that one is mandatory on every task; this one is for unclear scope./apd-debugMANDATORY before re-dispatching the builder after any APD verifier failure or critical reviewer finding. Use on any bug, test failure, build failure, error, crash, regression, or unexpected behavior during the APD pipeline. Four-phase root-cause analysis — investigate, pattern-match, hypothesize + controlled test, fix with TDD. Triggers on "bug", "fail", "failing", "broken", "doesn't work", "error", "crash", "regression", "verifier blocked", "reviewer rejected"./apd-finishMANDATORY after every successful APD pipeline commit. Use as soon as the pipeline reports commit done — verifies tests from a clean state, shows the pipeline report, presents four options (push, push+PR, keep local, discard), executes the user's choice. Triggers on "after commit", "push", "PR", "pull request", "deploy", "next", "pipeline done", "shipped", commit hash present in pipeline state./apd-githubUse when the project has GitHub Projects configured (GITHUB_PROJECTS_URL in CLAUDE.md) and APD pipeline tasks need to sync with the board. Creates issues for specs, moves cards through columns (todo → in-progress → review → done), closes on commit. Triggers on "GitHub Projects", "issue", "board", "card", "sync", "kanban", "project board", any APD pipeline phase transition when a board URL is configured./apd-miroUse when the project has a Miro board configured (MIRO_BOARD_URL in CLAUDE.md) and the APD pipeline dashboard needs updating. Visualizes current pipeline status, completed tasks, recent metrics, and active spec cards. Triggers on "Miro", "dashboard", "board update", "visualize pipeline", "pipeline view", "metrics", any pipeline phase change when a Miro URL is configured.