--- name: cmd-architect description: Use when the user wants to create, scaffold, standardize, or overwrite a CLAUDE.md for a project. Interactive wizard that walks a fixed protocol of "Standards" and emits a lean, budget-disciplined, technology-agnostic CLAUDE.md built from scratch. Also use when the user types /cmd-architect or asks for a "standard CLAUDE.md". --- # cmd-architect — CLAUDE.md authoring wizard Walk the developer through a fixed protocol of Standards and emit a lean CLAUDE.md. Read `standards.md` (same directory) for the registry of standards and their per-section guidance. ## When to use - The user wants to create or standardize a CLAUDE.md for an IT project. - The user types `/cmd-architect`. ## Protocol This is an INTERACTIVE wizard. Drive it as a conversation, ONE standard at a time. Cardinal rule: never pre-decide, auto-scan, or batch-draft standards. You touch exactly one standard at a time, and you do NOTHING to a standard until the dev has told you how to source it. ### Preflight (run once) 1. **Project detection:** is the cwd a real project root? Check for manifests (package.json, pyproject.toml, go.mod, pom.xml, Gemfile, composer.json, etc.), source files, or `.git`. Record the answer — it gates `agent-scan`. 2. **Existing CLAUDE.md:** if `./CLAUDE.md` exists, the only choices are **Overwrite** or **Cancel**. There is NO augment / update mode. - **Confirm intent first — ALWAYS, no exceptions:** explicitly ask the dev whether to overwrite the current CLAUDE.md or cancel. Ask this every run. NEVER infer or assume the answer from the prompt, earlier conversation, or any context — the dev must answer this exact question now. On Cancel, stop. - On Overwrite, build a BRAND-NEW CLAUDE.md from scratch, blind. Do NOT read the existing CLAUDE.md or use it as a starting draft. Stage ALL output to `./CLAUDE.draft.md`; NEVER modify the original during the walk. (The dev MAY explicitly ask you to read the old file as a reference during a per-standard discussion — only then, and only as one source among others.) 3. Never accept a path argument. `agent-scan` requires the cwd to BE the root. ### Step 1 — Confirm the standard set (run once, before ANY drafting) Show the dev the full 9-standard list from `standards.md` — each with its required / offer-if-relevant tag and one-line purpose. Ask which to INCLUDE for this project. Required standards default in; VII and IX are proposed. The dev may drop any standard here; if they drop a required one, note it's part of the recommended core, confirm once, then honor the choice. The result is the **working set**. Do not draft anything in this step. ### Step 2 — Walk the working set, ONE standard at a time For each standard in order, run this full loop before touching the next: 1. **Announce** the standard and state its purpose (from the registry). 2. **ASK HOW TO START — do nothing else yet.** Do NOT scan, draft, or write anything. Ask the dev which source to begin with: - `agent-scan` — (only if preflight found a real project) you inspect the repo. - `confluence-scan` — (only if the dev gives a link) you probe it. - `manual-text` — the dev gives raw notes. WAIT for the answer. Never assume or default a source. Never scan pre-emptively. 3. **Gather** from the chosen source. Sources are ADDITIVE, not exclusive: during the discussion the dev may layer in more, in any order (e.g. agent-scan first, then a Confluence link, then manual corrections). Use each only when the dev directs it. Always build from scratch — NEVER seed a standard from the existing CLAUDE.md unless the dev explicitly asks you to read it. 4. **Discuss freely.** Draft, then go back and forth — refine, ask gap-filling questions, trim to budget — for as many turns as it takes. A real conversation, not a one-shot draft-then-confirm. 5. **Finalize only on explicit confirmation.** The standard is done ONLY when the dev explicitly says so. Until then, keep discussing — do not advance. 6. **Cancel option.** At any point the dev may cancel this standard entirely (dropped from the output). Honor it and move on. 7. Only after finalize-or-cancel, move to the NEXT standard. ### Hard rules (never violate) - NEVER auto-scan or pre-draft before the dev picks the source for THAT standard. - NEVER present multiple finalized or pre-decided standards at once. - NEVER advance past a standard the dev hasn't explicitly finalized or cancelled. - ONE standard per turn. Always ask the source before doing anything. - When a CLAUDE.md already exists, ALWAYS explicitly ask the overwrite-intent question. Never infer or assume it from prior prompts or context. - ALWAYS build from scratch, blind. There is NO augment mode — never read or seed from the existing CLAUDE.md unless the dev explicitly asks you to during a run. ### Budget discipline (every standard) CLAUDE.md is reloaded every turn against a ~150–200-instruction ceiling. So: - Emit a tight section + pointers, never an essay. - When a section would bloat, offer to push detail into a referenced doc under `docs/` and link it from the section. - **Exception — Standard VI (Business Flow):** never push its overflow to `docs/` or any repo file. Deep business flow belongs only in a local mempalace KB via Standard VII. If VII is skipped, the depth is left uncaptured in-repo (accepted tradeoff). Keep VI thin and hard-capped. - Do NOT restate lint-/formatter-enforced style rules — point at the config. - Never inline code blocks or long schemas. ### Output format Assemble only the FINALIZED standards using labeled headers exactly as the registry templates show: `## Standard I: