---
name: multi-agent-scaffold
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."
user-invocable: true
argument-hint: "<ios|android|web|backend> <name> [--dir <path>]"
metadata:
  language: en
---

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

**Input**: `$ARGUMENTS`

The pipeline does not generate project code. It calls the toolkit's `scaffold` skill and verifies the result with the stack adapter's commands. Contract: `multi-agent-refs/features/scaffold.md`.

## Core rules

- **The toolkit writes, the pipeline verifies.** No toolkit skill available: stop, never hand-write a skeleton.
- **Green before the first commit**: `scripts/scaffold-gate.mjs --dir <dir> --phase skeleton` exits 0 (build, test and lint through the stack adapter, no commit yet, no remote).
- **No remote** without an explicit yes to the exact `gh repo create` command, asked after the commit. Never with `MULTI_AGENT_UNATTENDED=1`.

## Flow

| Step | Action |
|---|---|
| Resolve | `ai-<stack>-toolkit:scaffold` (`web` is `ai-frontend-toolkit`); missing: stop |
| Dispatch | the skill writes the skeleton, `.scaffold.json`, `.gitignore`, runs `git init` |
| Verify | `scaffold-gate.mjs --phase skeleton`; exit 1 goes back to the skill once; exit 3 is the skill's defect |
| Commit | `chore: scaffold <name>`, only after exit 0 |
| Remote | ask `Keep it local` / `Create the remote repository`; run only on an explicit yes |
