harness-bootstrap, end to end

purple = the model, billed green = script, free blue = you red = guardrail
.claude/ empty
agents?rules?guardrails?tasks?

Mode first - and it is not about size

greenfield empty or near-empty repo
brownfield source exists, agents will modify it
audit agents analyze, a human applies every fix
PURPLE - a model is required
Codebase analysis - MANDATORY stack, modules, data layer, integrations, conventions, risky ops, existing .claude/, git reality
Inventory Report
modules → dev agents conventions → rules risky ops → deny + hooks
You confirm or correct it no file is generated before it is confirmed
PURPLE - a model is required
Intake questionnaire AskUserQuestion, max 4 per call. Brownfield pre-fills from evidence and asks only what the code cannot decide
Detect + confirm tools scan .cursor/ .codex/ AGENTS.md, then ask: Claude Code / Cursor / Codex
One-screen setup plan created / kept / modified, roster with model + effort. You confirm
PURPLE - a model is required
Roster Tier 0 unconditional, preset S / M / L, explicit model: AND effort: on every agent
Detect the dev OS Windows to .ps1, macOS or Linux to .sh
vars.json vars + flags: ui, db, ai, audit, exactly one of windows / posix
GREEN - a script, deterministic and free
scaffold.py --dry-run
scaffold.py a deterministic copy of assets/
ADDEDfile did not exist
KEPTexists, byte-identical
CONFLICTexists and differs - not written
Reconcile by hand: keep / adapt / add / flag exits 0
GREEN - a script, deterministic and free
scaffold.py --dry-run scaffold.py
unresolved {{ VAR }} exit 1
a placeholder shipped into a live rule file matches nothing and fails silently
PURPLE again - what no template can know
Model-authored gap-fill orchestrator routing table, dev-agent scopes, tech-stack.md, coding-standards.md, git-workflow.md, settings.json allow / deny for the real stack, .env.example
Orchestration wiring master-plan index table, Phase 1 seeded from the analysis gap list, AGENTS.md entry point, CLAUDE.md as a thin @AGENTS.md import
Quality gate structure / cost and context / safety / grounding / handoff
all green
Smoke-test the loop Port to your tools
Harness runs under orchestration

Read it as three bands

analyse + decidea model is required
scaffolda script, for free
gap-fill + wirewhat no template knows