Gather these from the user's arguments / message, else ask — keep it to load-bearing questions:
-
Resolve the file set (see references/file-set-resolution.md).
active_tiers = [core] + ([public] if visibility in {public, published}) + ([published] if visibility == published).
The file set is the union, over each active tier t, of everything under templates/<t>/ and
everything under templates/types/<type>/<t>/ — plus, for each chosen add-on, everything
under templates/addons/<addon>/<t>/ (add-ons only add files; they never collide). On a path
collision pick one winner: higher
tier wins (published > public > core), then within a tier the type overlay wins.
Produce an explicit list of (template path → target path) pairs: drop any trailing .tmpl,
and substitute filename placeholders (e.g. {{ModuleName}}.psd1.tmpl → MyModule.psd1).
-
Stamp each file. For each pair: read the template from <base>/templates/…, replace every
placeholder (see references/placeholders.md), and write it to the target path under the new
repo directory. Files with no .tmpl suffix are copied verbatim. Create directories as needed
(docs/adr/, .github/…, any type-specific dirs).
-
Write docs/adr/0001-initial-decisions.md from the docs/adr/0000-template.md you just
stamped, recording the name, type, visibility/tier, licence, author, and any notable interview
choices.
-
Generate the START-HERE map. From the resolved file set, build a short "where things live"
table (rules → AGENTS.md; decisions → docs/adr/; resume state → docs/CHECKPOINT.md
(or docs/STATE.json when the living-docs add-on takes over); conventions & checklists → the
repo-standard skill; CI → .github/workflows/; tests → the type's test dir) and substitute it
into the {{START_HERE_MAP}} placeholder in the stamped AGENTS.md. The resume-state row is
mandatory — scripts/repokit-check.ps1 fails without it. Add a one-line pointer in
the README.
Resolve {{LIVING_DOCS_RULES}} in the stamped AGENTS.md: with the living-docs add-on
on, substitute the verbatim rules block from references/living-docs-rules.md and append that
file's ## Status snippet to the stamped README.md; with the add-on off, delete the
placeholder line entirely. When the add-on is on, finish by running
pwsh scripts/check-docs.ps1 -Update then pwsh scripts/check-docs.ps1 inside the new repo
(both must succeed); if pwsh 7 is missing on this host, say so in the summary — running it is
the user's first task.
Self-check (gate — both must pass before you continue). See references/placeholders.md:
(a) no enumerated placeholder tokens remain anywhere in the output; (b) every expected target
file exists and no .tmpl suffix survived. If either fails, fix and re-check. Then, when
pwsh 7 is available, run pwsh scripts/repokit-check.ps1 inside the new repo — the stamped
compliance self-check must pass (it verifies the shim, the START-HERE paths, and the
changelog / ADR / resume-state artifacts); if pwsh is missing, say so in the summary.
-
Initialise git in the new repo directory:
-
Offer a private remote — opt-in only. Ask whether to create a private GitHub repo. Only if
the user says yes: gh repo create <name> --private --source . --remote origin. Never public,
never push to a public remote, never publish. When a remote is created, also offer the
RepoKit label bootstrap (the workflow-verdict set plus any namespaces the user wants) — the
commands are in the repo-standard skill's standard/labels.md; skip it for repos that won't
run an issue board.
-
Print the summary: the resolved tier × type, the file tree, the START-HERE map, and next
steps — "review locally; you publish when ready."