Bootstrap Skill
Overview
This skill runs when the Bootstrap Gate is closed (missing CLAUDE.md, Session Config, or .orchestrator/bootstrap.lock) or when the user invokes /bootstrap directly. It scaffolds the minimum structure required by all session-orchestrator skills, commits it, and writes the lock file that opens the gate for all future invocations.
Anti-bureaucracy contract: At most ONE AskUserQuestion call in the normal case (tier confirmation). A second question is only asked when the archetype is truly ambiguous on the Public Path for Standard/Deep tiers. No wizard, no multi-step flow.
Invocation Context
Before starting, determine how this skill was invoked:
- Transitive (gate-closed): Invoked from another skill's Phase 0. The user's original intent (their first prompt) is available in context. After bootstrap completes, execution must return to the original skill's Phase 1.
- Direct (
/bootstrap): User invoked manually. Parse$ARGUMENTSfor flags:--fast,--standard,--deep,--upgrade <tier>,--retroactive. Seecommands/bootstrap.mdfor flag semantics.
Store INVOCATION_MODE = transitive | direct.
Mode dispatch (direct invocation only):
- If
--upgrade <tier>is present in$ARGUMENTS: jump to Upgrade Flow section. Do not proceed to Phase 1. - If
--retroactiveis present in$ARGUMENTS: jump to Retroactive Flow section. Do not proceed to Phase 1. - If
--sync-rulesis present in$ARGUMENTS: jump to Sync-Rules Flow section. Do not proceed to Phase 1. - If
--ecosystem-healthis present in$ARGUMENTS: jump to Ecosystem-Health Flow section. Do not proceed to Phase 1. - Otherwise: continue to Phase 1 below.
Phase 0.5: Determine Private vs. Public Path
Before dispatching to any tier template, read skills/bootstrap/public-fallback.md and execute Step 1 (PATH_TYPE detection). Store the result as PATH_TYPE = private | public. This detection is silent — no user interaction.
private:plan-baseline-pathis present in Session Config AND the path exists on disk. Baseline templates will be used for CLAUDE.md generation and archetype file sourcing.public:plan-baseline-pathis absent, empty, or points to a non-existent path. Plugin-bundled templates fromtemplates/will be used.
Pass PATH_TYPE into Phase 1 and all subsequent phases. All tier templates (fast-template.md, standard-template.md, deep-template.md) must consult public-fallback.md for CLAUDE.md generation and archetype file sourcing when PATH_TYPE = public.
Phase 1: Detect Tier + Archetype
Read skills/bootstrap/intensity-heuristic.md and execute the tier + archetype recommendation algorithm.
Inputs to the heuristic:
- User's first prompt — the message that triggered this skill (most important signal)
- Repo name —
basename $(git rev-parse --show-toplevel)(secondary signal) - Existing files —
ls -laof repo root (presence ofpackage.json,pyproject.toml, etc. shifts archetype) - $ARGUMENTS flags — if
--fast,--standard, or--deepis present, skip heuristic and use the specified tier directly
Output from Phase 1:
RECOMMENDED_TIER=fast|standard|deepRECOMMENDED_ARCHETYPE=static-html|node-minimal|nextjs-minimal|python-uv|nullHEURISTIC_REASON= one-sentence explanation of why this tier was chosen (shown to user)PATH_TYPE=private(plan-baseline-path configured and path exists) |public(no baseline)
Detecting PATH_TYPE: Already determined in Phase 0.5 — use the stored PATH_TYPE value. Do not re-run detection.
Fast tier: RECOMMENDED_ARCHETYPE is always null. No stack selection needed.
Phase 2: Present Tier Confirmation (One Question)
Present exactly one AskUserQuestion unless:
$ARGUMENTSincludes--fast,--standard, or--deep(tier pre-selected, skip question)--retroactiveflag (no scaffolding at all, skip to Phase 4)
AskUserQuestion({
questions: [{
question: "Leeres Repo erkannt. Basierend auf '<HEURISTIC_REASON>' empfehle ich **<RECOMMENDED_TIER>**. Passt das?",
header: "Bootstrap",
options: [
{ label: "<RECOMMENDED_TIER> (Empfohlen)", description: "<one-line description of what this tier scaffolds>" },
{ label: "fast", description: "Nur CLAUDE.md + .gitignore + README. Für Demos, Spikes, Playgrounds." },
{ label: "standard", description: "Fast + package.json/Manifest + TypeScript + Linting + Tests. Für MVPs und echte Produkte." },
{ label: "deep", description: "Standard + CI + CODEOWNERS + CHANGELOG. Für Production, Team, Langlebige Repos." },
{ label: "Abbrechen", description: "Bootstrap abbrechen. Das ursprüngliche Kommando wird ebenfalls abgebrochen." }
],
multiSelect: false
}]
})
If user selects "Abbrechen": stop. Report "Bootstrap abgebrochen. Kein Kommando wird ausgeführt." Do not continue.
Store confirmed tier as CONFIRMED_TIER.
Optional Second Question (Public Path + Standard/Deep + Ambiguous Archetype Only)
If ALL of the following are true:
PATH_TYPE = publicCONFIRMED_TIERisstandardordeepintensity-heuristic.mdreturnedARCHETYPE_CONFIDENCE = low(truly ambiguous)
Then ask one more question — and only then:
AskUserQuestion({
questions: [{
question: "Welchen Tech-Stack soll ich für das Grundgerüst verwenden?",
header: "Archetype",
options: [
{ label: "node-minimal", description: "package.json + TypeScript + Vitest. Für CLIs, Tools, Libraries." },
{ label: "nextjs-minimal", description: "Next.js bare setup. Für Web Apps, SaaS, Fullstack." },
{ label: "static-html", description: "HTML/CSS/JS, kein Build-Step. Für Animationen, Landingpages, Visualisierungen." },
{ label: "python-uv", description: "pyproject.toml + uv + pytest. Für Python Scripts, APIs, ML." }
],
multiSelect: false
}]
})
Store as CONFIRMED_ARCHETYPE. Maximum interactions in bootstrap flow: 2 questions total.
Upgrade Flow (--upgrade <tier>)
Entered when $ARGUMENTS contains --upgrade <tier>. No scaffolding questions are asked.
Steps:
-
Read existing lock. Read
.orchestrator/bootstrap.lock. If missing, abort with:Error: No bootstrap.lock found. Run /bootstrap first to bootstrap this repo. -
Parse current and target tier.
CURRENT_TIER= value oftier:field in the lock file.TARGET_TIER= the<tier>argument supplied after--upgrade.- Valid values for both:
fast|standard|deep.
-
Refuse downgrade. Tier order:
fast < standard < deep. IfTARGET_TIERranks lower than or equal toCURRENT_TIER, abort with:Error: Cannot downgrade from <CURRENT_TIER> to <TARGET_TIER>. Upgrade path is one-directional (fast → standard → deep).Exit non-zero. -
Compute delta. Determine which files the target tier adds over the current tier:
fast → standard: all Standard-tier files (package.json/pyproject.toml,tsconfig.json,eslint.config.mjs,.prettierrc,.editorconfig,tests/,src/)standard → deep: all Deep-tier files (CI pipeline,CODEOWNERS,CHANGELOG.md, issue templates, MR/PR template, branch protection)fast → deep: union of both deltas (apply Standard first, then Deep)
-
Check idempotency. For each file in the delta, skip if it already exists on disk. Only write files that are absent. This makes the operation safe to run twice.
-
Apply delta files. Execute only the relevant template steps for the missing files. Read the appropriate template (
standard-template.mdand/ordeep-template.md) and execute ONLY the steps that produce the delta files. Do NOT re-run already-completed steps. -
Update bootstrap.lock atomically. Overwrite
.orchestrator/bootstrap.lockwithtier: <TARGET_TIER>. Preservearchetype,timestamp(update to now), andsourcefrom the existing lock. Write `plu