Use when starting a new project, initializing a repo, setting up governance on an existing project, or when the spec skill detects missing governance. Triggers on "bootstrap", "new project", "init project", "start a project", "project setup", "add governance".
Scaffold project governance for complex, multi-session Claude Code projects. Audit-first: scans what exists, fills gaps with opinionated defaults, never overwrites.
Replaces the new-project skill. Integrates with spec as a peer — spec owns feature design, bootstrap owns project governance.
Template repo: riamont/project-bootstrap — canonical source for scaffold files.
Scan the project:
git remote -vpackage.json (JS/TS), pyproject.toml/setup.py (Python), go.mod (Go), Cargo.toml (Rust), .uproject (Unreal). If none found, ask.CLAUDE.md, .claude/rules/, docs/decisions/, .github/workflows/, ARCHITECTURE.mdFor every missing file, create it from the template repo pattern. Stack-specific files (.gitignore, Makefile targets, linting, .vscode/extensions.json) are adapted to the detected stack.
Core files (see references/modules.md for full manifest):
CLAUDE.md, ARCHITECTURE.md, Makefile, README.md, LICENSE, .env.example, .editorconfig, .gitignore, .gitattributes.claude/rules/: 5 governance rules (mission, phase gates, truth hierarchy, doc sync, DoD).claude/docs/: 5 agent context files (architecture, conventions, testing, project-state, cheatsheet-standard)docs/: decisions (ADRs), discovery, sessions, logtemplates/: design-doc, feature-spec, session-note.github/: PR template, issue templates, CI workflow.vscode/: settings, extensions.githooks/: pre-push (blocks main)Never overwrite existing files. If a file exists, skip it.
Check for optional modules. Auto-detect where possible, ask one yes/no each otherwise:
See references/modules.md for module file manifests.
Ask exactly two questions:
If worktrees: document in .claude/docs/conventions.md.
If auto-commit: add Stop hook to .claude/settings.json:
{
"hooks": {
"Stop": [
{
"type": "command",
"command": "cd \"$PROJECT_DIR\" && git add -A && git diff --cached --quiet || git commit -m \"auto: session checkpoint $(date +%Y-%m-%d-%H%M)\""
}
]
}
}
If a remote exists, run the github-audit skill. Report the score and what the scaffold fixed vs. what still needs manual attention.
Before committing, verify:
.claude/docs/.claude/docs/project-state.md reflects actual modules installedReport any issues found and fix them.
git init -b main # if not already a repo
gh repo create (private/public) # if no remote, ask
git config core.hooksPath .githooks # activate hooks
git add -A
git commit -m "Bootstrap project governance"
git push -u origin main # if remote exists
Create memory file at ~/.claude/projects/.../memory/project_{name}.md.
Add entry to MEMORY.md.
Print recap:
Log the operation to docs/log.md.
If invoked from /spec, return control to spec with governance confirmed.
| Detection | .gitignore | Makefile | Linting | Testing | CI |
|---|---|---|---|---|---|
package.json | node_modules, dist | npm/pnpm/bun targets | Biome or ESLint+Prettier | Vitest | Node.js setup |
pyproject.toml | pycache, .venv | pip/uv targets | Ruff | pytest | Python setup |
go.mod | vendor, bin | go targets | golangci-lint | go test | Go setup |
Cargo.toml | target | cargo targets | clippy | cargo test | Rust setup |
.uproject | Binaries, Intermediate, Saved | UE targets | — | — | — |
| None detected | generic | echo placeholders | ask | ask | generic |