A project born elsewhere gets the harness.
From a session inside the project, /arch-adopt installs this .claude/ into a project that was never generated by Nerviz, or pulls a newer version into one that is behind. It refuses a dirty worktree, stamps a hash for every file it writes, and leaves the diff for you to review.
One operation, two starting states
It is not two commands. What tells them apart is the provenance stamp; the rest of the procedure is the same. The skill decides: which source, which blueprint, whether it is safe to write. Almost every byte is then written by the deterministic export mode, from a manifest of data.
| Starting state | What happens | How the skill knows |
|---|---|---|
A project never generated by /init-project, with no .claude/ of this shape | Install | no .claude/.arch-provenance.json |
A project that already has this .claude/ and is behind | Update | the stamp exists and names an earlier ref |
# the example in docs/en/10-arch-adopt.md; the ref, counts and file names are illustrative › /arch-adopt --ref latest-tag --blueprint hexagonal ✅ updated — blueprint hexagonal, ref v0.9.3 (a1b2c3d) Source ....... codeload.github.com, fetched at 14:22 Files ........ 136 written · 118 unchanged · 4 overwritten Warnings ..... none Schema ....... exit 0 Provenance ... ⚠️ 2 files edited locally since the stamp: .claude/rules/persistence.md .claude/settings.json Bounded ctx .. already declared Migrations ... 1 below, to paste when you choose Review: git diff · Undo: git checkout -- .claude Next: /arch-doctor for the full diagnosis
The output is the example in nerviz's docs. The ref, the counts and the file names are illustrative.
What the procedure promises
- It refuses a dirty worktree. Not a git repository, or a non-empty
git status --porcelain: it stops. An update overwrites, sogit diffis how you review it andgit checkouthow you undo it. It says what to run and does not commit for you. - None of the four
sourcevalues is written from memory.base_url,git_url,auth_envanddefault_refare data inextensions.json.auth_envnames an environment variable and never carries its value; a public repository needs no credential. - Provenance is written, not promised. The stamp records ref, sha, blueprint and the hash of every file written.
/arch-doctorcompares those hashes with the disk and names the files you edited by hand before the next update overwrites them.
What goes into the project, and what stays out
All of it is the export block of extensions.json: data, not prose. ArchHook.java schema checks the manifest against the disk, so a skill or agent that is in neither the include list nor the exclude list fails by name.
| Group | What |
|---|---|
| Hook and data | ArchHook.java, ArchHook.jar (copied as bytes) and extensions.json |
settings.json | overwritten whole, from project-bootstrap's template: the project's own hooks and permissions disappear, and show up in git diff |
| Rules | every norm, with its paths rewritten for the active blueprint's packages |
| Skills and agents | the development skills and the executor agents. init-project, project-bootstrap and project-initializer stay out: they only serve before the project exists |
| Blueprint | only the active one, never the catalog; without it, the next update could not resolve the id the stamp records |
| Audit trail | .claude/audit-usage/ is created, which switches the trail on, and versioned with the project; docs/lessons-learned/ is local and is not |
A project that already has its own .claude/ keeps whatever has a different path from the manifest's. Run --dry-run first: it lists what would be overwritten and writes nothing.
Four situations, and the floor is one
/arch-adopt does not judge the project's code. It only decides whether it is safe to write into .claude/.
| Situation | Step | Effect |
|---|---|---|
Not a git repository, or git status --porcelain was not empty | 1 | stops; nothing written |
| Fetch without credentials, or an HTTP error | 3 | stops; --fail turns the 404 into an error rather than a broken tarball |
Spring Boot below doctor.platform.min_line (today 4.0) | 5 | export exits 2 before writing a byte; there is no --force. The way up is /platform-upgrade |
schema does not exit 0 after the export | 6 | the files are already written; the report shows the failure first and steps 7 to 9 do not run |
The floor is only a floor: there is no ceiling. Spring Boot 5.x passes, and the norms written for the 4 line may diverge from it with no warning. A build that hides its version, such as a corporate parent or an external BOM, passes too.
A prompt to paste, never an edit
When the norms change in a way that leaves code generated before behind, the change ships as an entry in the migrations block of extensions.json. On an update, the skill prints every entry the project has not seen yet and that applies to its blueprint: a note, and a prompt to paste into Claude Code in the project. It never runs it. The project's own copy of extensions.json is the record of what it was shown, so a project generated after an entry never sees it.
Review, undo, diagnose
It leaves the tree with the diff ready for review and says how to undo it. Then /arch-doctor gives the full diagnosis. What it finds becomes a report line; only the lines of doctor.gate.labels fail CI.
- Generate a project. With no
pom.xmlorbuild.gradle,/init-projectis what you want. - Write business code, or touch
src/. - Commit.
- Ask for a blueprint again when the stamp already records one: on an update, it is a fact of the project.
# review git diff # undo git checkout -- .claude && git clean -fd .claude # then the full diagnosis › /arch-doctor
- The skill
Its contract, its write territory and what the guard does with it.
arch-adopt · the skill's page → - The full doc
In the nerviz repository.
10-arch-adopt.md →