---
description: "Create a project skeleton with the enabled toolkit's scaffold skill and prove it builds, tests and lints before the first commit; no remote is created. Use when starting a new iOS, Android, web or backend project."
description-tr: "Etkin toolkit'in scaffold skill'i ile yeni bir proje iskeleti kurar, ilk commit'ten önce build, test ve lint'ten temiz geçtiğini kanıtlar. Yalnızca lokal: uzak repo oluşturulmaz. Yeni bir iOS, Android, web veya backend projesine başlarken kullanılır."
argument-hint: "<ios|android|web|backend> <name> [--dir <path>]"
parameters: [{"name":"stack","kind":"enum","required":true,"enum":["ios","android","web","backend"]},{"name":"name","kind":"text","required":true},{"name":"--dir","kind":"path"}]
gui: form
destructive: false
confirm: none
---

# multi-agent scaffold  -  a skeleton that is green before its first commit

**Input**: $ARGUMENTS

> **Language**: instruction prose stays English. Anything a person reads (pickers, the final report) follows `prefs.global.outputLanguage`; picker `header` stays English (<=12-char chip). Full contract: `$HOME/.claude/multi-agent-refs/rules.md` "Language Application".

> **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.

The pipeline does not generate project code. It calls the enabled toolkit's `scaffold` skill, then verifies what came back with the stack adapter's own commands. Contract, manifest and the between-stories check: `$HOME/.claude/multi-agent-refs/features/scaffold.md`. Read it first.

## Input

- `<stack>` - `ios`, `android`, `web` or `backend`; resolves to `ai-<stack>-toolkit` (`web` is `ai-frontend-toolkit`).
- `<name>` - the project name, letters, digits and `-` only.
- `--dir <path>` - where to create it. Default `./<name>`. It must not exist, or be an empty directory.

## Steps

1. **Resolve** the skill `ai-<toolkit>-toolkit:scaffold`. Not available means the plugin is not enabled in this repo: stop with `scaffold needs ai-<toolkit>-toolkit enabled (/multi-agent:stack <stack>)`. Never write a skeleton by hand in its place.
2. **Dispatch** it through the Skill tool with `<name>` and the target directory. The skill writes the skeleton, `.scaffold.json`, a `.gitignore` that ignores `.pipeline/`, and runs `git init`. It creates no remote and makes no commit.
3. **Verify**:
   ```bash
   node "$HOME/.claude/scripts/scaffold-gate.mjs" --dir "$DIR" --phase skeleton
   ```
   Exit 0 is the proof. Exit 1: show the failing checks and their logs (`$DIR/.pipeline/scaffold/`), hand them back to the scaffold skill once, re-run the gate; a second exit 1 stops here with the skeleton left uncommitted. Exit 3: the manifest is missing or invalid, which is the skill's defect to report, not to patch.
4. **First commit**, only after exit 0: `git -C "$DIR" add -A && git -C "$DIR" commit -m "chore: scaffold <name>"` with the Git identity from prefs.
5. **Remote** is a separate question, asked once after the commit: `Keep it local` / `Create the remote repository`. The second option is an outward write: show the exact command (`gh repo create <name> --private --source "$DIR"`) and run it only on an explicit yes to that command. With `MULTI_AGENT_UNATTENDED=1` the question is never asked and agent-guard refuses the command.

## Report

At most 8 lines in `outputLanguage`: the toolkit and skill, the directory, each check with its result, the commit sha, and whether a remote exists.

## Never

- No remote repository, no push, no PR from inside this command without the explicit answer in step 5.
- No commit before `scaffold-gate.mjs --phase skeleton` exits 0.
- No edits to the skeleton to make a check pass; a failing check goes back to the scaffold skill.
