init
Install the INSPIRE runtime into this repository: materialize the skills, validators, hooks and knowledge-base skeleton, register the hooks, and freeze the runtime version. Run once per project. Use when setting up INSPIRE in a new or existing repo.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- init
- description
- Install the INSPIRE runtime into this repository: materialize the skills, validators, hooks and knowledge-base skeleton, register the hooks, and freeze the runtime version. Run once per project. Use when setting up INSPIRE in a new or existing repo.
03 SKILL.md 正文
/inspire:init — install INSPIRE into this project
Materializes the plugin's inert payload into the repository and registers it. Once committed, the runtime travels with the repo: teammates and CI need no plugin.
Preconditions
- A git repository. Run
git rev-parse --show-toplevel. If it fails, stop and tell the operator togit initfirst. - Tools.
yq(Mike Farah v4) andjq1.6+ must be onPATH. Check withcommand -v yq jq. If either is missing, stop and report which. - Not already installed. If
.inspire.lockexists, stop — this project is already initialized. Direct the operator to/inspire:updateinstead. - Not the template repo. If
plugin/.claude-plugin/plugin.jsonexists at the project root, stop: this is the INSPIRE template itself, and installing here would activate the runtime against it. - Not an unmigrated pre-0.3 project. If
.inspire_kb/exists andinspire_kb/does not, stop: this is a v0.2 layout that has not been migrated, and/inspire:initnever migrates — it only installs fresh.materialize.shrefuses this too (exit 1), but say it here rather than surfacing it as an error — initializing over it would strand the entire knowledge base at.inspire_kb/, where no v0.3 skill looks. The remedy is to run/inspire:update, which migrates a pre-0.3 project: it detects the old layout and runs the hop chain to bring it forward, then applies the current base around whatever survives.
Step 1 — Detect the shape
Record, before writing anything:
BROWNFIELD— whether the repo has code already. Heuristic: any ofpackage.json,pyproject.toml,go.mod,Cargo.toml,pom.xml,Gemfileat root, or asrc/directory. Used only to recommend roots in Step 2.EXISTING_KB— whetherinspire_kb/is already present. With no.inspire.lock(precondition 3), that means this is an adoption, not a fresh install: a completed v0.2 migration, a restored backup, a KB vendored in before init, or a lock deleted by hand.materialize.shseeds the KB additively — it replaces nothing underinspire_kb/— but the operator must be told, not have it inferred.
Step 2 — Ask the operator
One AskUserQuestion with these questions:
- Product roots. Greenfield (
source_root: source,prototype_root: prototype) or brownfield-in-place (source_root: .,prototype_root: none)? Recommend byBROWNFIELD. - Declare the marketplace for teammates? If yes, Step 3 passes
--declare-marketplacetomaterialize.sh, which writesextraKnownMarketplaces+enabledPluginsinto.claude/settings.jsonso a teammate who trusts the repo folder is prompted to install the plugin. Recommend yes. Declining breaks nothing — the runtime is in the repo either way; only running a future/inspire:updateneeds the plugin.
Step 3 — Show the plan, then materialize
Everything mechanical is handled by materialize.sh — copying (including the
inspire_kb/ skeleton, seeded once here and never again), chmod, the test/
exclusion, design-system seeding, a provisional root CLAUDE.md, the .gitignore
block, product roots, the settings.json merge and .inspire.lock. This skill does
not reimplement any of it, and must not perform file operations of its own.
First a dry run, and show the operator what it will do:
"${CLAUDE_PLUGIN_ROOT}/scripts/materialize.sh" \
--mode init \
--plugin-root "${CLAUDE_PLUGIN_ROOT}" \
--project-root "$(git rev-parse --show-toplevel)" \
--source-root "<answer>" --prototype-root "<answer>" \
[--declare-marketplace] \
--dry-run
Summarize the returned JSON for the operator: what will be created, what already exists and will be left alone. Two fields need more than a summary line:
existing_kb: true— the run is adopting a KB that is already there. Say so explicitly and confirm before proceeding: "inspire_kb/already exists (N files). Init will keep everything in it and only add skeleton files it lacks. Proceed?" If the operator did not expect a KB to be there, stop — a KB present without a lock usually means an interrupted migration or a restored backup, and it is worth understanding which before writing.warnings: [...]— print each one verbatim. These are conditions the run cannot fix on the operator's behalf. A.gitignorethat excludes the runtime is the common one, and it silently defeats the point of committing the runtime at all.
Then run the same command without --dry-run.
If it exits non-zero, report its stderr verbatim and stop. Do not hand-patch a partial
install: on exit 2 the payload may already be on disk, but the settings block and
.inspire.lock were not written. Because the lock is written last, its absence means the
install did not complete — re-running /inspire:init is the correct recovery.
Parse the JSON summary from stdout and use it for Step 4's report. Report what the script says it did, never what you assume it did.
Step 4 — Report, and hand off
Print what was created — and re-print any warnings from the final run, above the handoff
rather than buried under it. A warning the operator scrolls past is a warning that did not
happen. Then:
INSPIRE <version> installed.
Run: /reload-skills
Then: /inspire-bootstrap init
(/reload-skills picks up the newly materialized skills; /inspire-bootstrap init
fills in CLAUDE.md's placeholders and starts the KB.)
Do not invoke /reload-skills or /inspire-bootstrap init on the operator's behalf —
/reload-skills is the operator's action, and chaining /inspire-bootstrap init across it
would run against whatever skill state existed before the reload. Instruct, don't chain.
Remind the operator to commit the result — that is what makes the runtime available to teammates and CI.
Rules
- All file operations go through
materialize.sh. This skill never copies,chmods, or editssettings.jsonitself. Mechanics live in the script so they are testable and shared with/inspire:update; judgment lives here. If something mechanical is missing, fix the script — do not work around it in prose. - Report the script's JSON, not your assumptions. The summary on stdout is the record of what happened.
- Stop rather than guess. Every Precondition above is a hard stop with a clear message, never a thing to work around — and a non-zero exit from the script is a stop too, not something to patch up by hand.
- This skill does not author content. Language, stack, theme and the project README
belong to
/inspire-bootstrap init. - Instruct, don't chain. Report the handoff and stop;
/reload-skillsand/inspire-bootstrap initare the operator's next actions, not this skill's.
04 同仓库更多 Skills
update
Update this project's INSPIRE runtime to the installed plugin's version: report drift, re-materialize unchanged files, and refuse to clobber local edits. Use after /plugin update inspire reports a newer base.
migrate
Move this project's knowledge base from the layered layout (01_adr, 02_modules, 03_features, 04_domain, 05_screens and the surface roster) to the concept layout under inspire_kb/01_spec/, where every artifact has a typed extension, and convert its [[wikilinks]] to relative Markdown links. Run once, on purpose, after /inspire:update reports the layered layout or counts wikilinks. Rebuilds nothing that is already built.
inspire-workspace
Workspace-level validation: the global pre-PR review (orchestrating module + cross-module checks) and vault-structure validation. Use for the required pre-merge gate and top-level structure checks. ADR lifecycle lives in /inspire-adr; the task tracker in /inspire-task.
inspire-task
Task tracker: create / update / close / list / show tickets in inspire_kb/99_tracker/. A plain-file kanban (one Markdown file per ticket, no external tool) for tracking work, drift, and skill-feedback. Use to open, advance, close, or query tickets.
inspire-spike
Vertical spikes: register and harvest external functional-prototype repos. A spike is a narrow, deep, throwaway build in its OWN repo that answers 'can we build it as we think?'. Use to register such a repo (name/reference it, set up its learnings hygiene) and to capture its learnings into the vault as a gap analysis against the current project.
inspire-screens
Create and validate screens (a screen is the UI spec for one view). A screen declares its own bindings — data sources, dispatches, navigation, states — and names a shared layout and shared components as dependencies. Use when designing or reviewing an application's screens.