/archcore:init [import|refresh] [path or domain]from archcore
First-time Archcore setup that wires host configs, measures existing context, and seeds .archcore/ with stack rules, run guides, data models, and specs. Use on fresh clones or to migrate CLAUDE.md/AGENTS.md into typed documents.
Ships in archcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
First-time onboarding. Wires the host, measures the authored context the repository already holds, and fills .archcore/ from two sources — what people wrote and what the code shows — so the code-alignment hook and per-command grounding have substance from day one. Per magic-first-day-init.adr and init-import-mode.adr: extractive facts are composed in full; authored content wins over synthesized content on the same subject; the overview is an index, never a prose blob. Nothing is written before confirm.
Before planning or writing relations, load skills/_shared/relation-authoring.md.
Apply its claim check to seed and import wiring after reading the endpoint content.
The first word selects the run: import or refresh. These two words are the command's modes in the sense of command-surface-v2.spec. The rest of the arguments is the subject. No arguments, or any other first word, start a plain init.
import [path] — convert the repository's authored context into native documents, at all five discovery levels of lib/sources.md; a path limits the run to that path. Resumes an open import plan when one exists.refresh [path or domain] — re-run on a seeded repo to add facts that appeared since (a new schema, config, or modules) and to retrofit host wiring. A subject scopes the top-up: an existing path wins; otherwise a detected domain slug runs the single-domain pass. Bypasses the "already seeded" early-exit.depth:light|standard|deep (default standard) and scale:small|medium|large, where the user already sees each choice's cost (lib/seed-compose.md). Import has no depth..archcore/ — the SessionStart nudge points here.import.Not init (route elsewhere):
/archcore:document./archcore:plan./archcore:document./archcore:document (offers rule + guide continuation)./archcore:document <the report or material>./archcore:review.Mode routing — evaluated top-to-bottom, first match wins.
| Signal | Route | Flow files |
|---|---|---|
First word import, and the assessment gate (step 5) finds no authored source | → no-source: the no-source report; no gated operation, no confirm, no code seed | lib/sources.md "No authored source" |
First word import | → import: the whole import track, levels L1–L5; no code seed | skills/_shared/tracks/import.md, lib/sources.md |
First word refresh | → refresh: plain-init flow with the early-exit bypassed; existing artifacts are skip (exists) | as the plain rows below |
| Open import plan found (step 3) on a plain init | → report the plan, name /archcore:init import, then continue the plain init without new conversion targets | — |
| No manifest, no source, no authored source (step 4) | → empty: host wiring only, behind its own mini-confirm | lib/host-wiring.md "Empty route" |
| No manifest and no source, authored sources found | → import-only: host wiring + the import track in one preview; no code seed | skills/_shared/tracks/import.md |
| Anything else | → plain init: host wiring + facts + the fill the assessment gate divides | lib/seed-detect.md, lib/seed-compose.md |
Fill routing — what the assessment gate (step 5) decides on a plain init or a refresh. The extractive facts are composed in every row.
| Assessment result | Authored sources | Hotspot specs |
|---|---|---|
no authored source — nothing found, or every source found is skip | none; the announce line names what was checked, and names /archcore:init import when deeper levels hold files | the depth's budget over the unchanged ranked pool |
tier S (≤ 8 targets) | every target listed in the init preview; converted on the init confirm | budget over the pool minus the coverage_set |
tier M (9–40) or L (> 40) | the init confirm creates the import plan and runs wave 1; the closing message names /archcore:init import | budget over the pool minus the coverage_set |
Scale routing (small / medium / large, and what each seeds) lives in _shared/grounding/detect-scale.md and lib/seed-compose.md. Tier-1 facts are seeded in any scale when detected — breadth scales with the repo, presence does not.
Follow-up routing — closing-message hand-offs. Init surfaces these as todos; MUST NOT auto-invoke.
| User wants to... | → Invoke |
|---|---|
| Continue an open import, or import beyond agent files and ADR folders | /archcore:init import |
| Import one folder only | /archcore:init import <path> |
| Add facts that appeared since first init | /archcore:init refresh |
| Drill into another domain (large) | /archcore:init refresh <domain> |
| Capture another module, record a decision, codify a convention | /archcore:document |
| Plan a feature | /archcore:plan |
| Scope queries to a domain (large) | mcp__archcore__search_documents with the domain tag |
| See what's loaded | /archcore:review |
Content voice: default to architectural prose — decisions, rationale, intent. See skills/_shared/precision-rules.md Rule 6. Code blocks only where the document type requires it (rule, guide, cpat, and spec examples) or the user asks.
Gating (write boundary). init_project() and the read-only MCP calls (list_documents, get_document, search_documents) are infrastructure — they run before the preview. Three groups of operations are gated:
create_document, update_document, remove_document, add_relation;install_host_config / archcore init --agent — they touch files outside .archcore/, like .mcp.json and .claude/settings.json;No gated operation fires before the user types confirm. Absence of an answer is never confirm: IF this invocation cannot receive further user input in this turn (a print-mode run, a sub-agent call), THEN print the preview and stop. cancel therefore leaves .archcore/ content-empty and the repo's files untouched (the directory and settings.json may exist from init_project, which is harmless and idempotent).
Lazy reading. Load a flow file only when its step starts: lib/host-wiring.md at step 1, lib/sources.md at step 5, lib/seed-detect.md then lib/seed-compose.md at step 6, skills/_shared/tracks/import.md when a route reaches it. Never load them all at once.
Run the CLI availability check and the cli-gte 0.7.0 host-wiring version gate per lib/host-wiring.md "Pre-flight". The canonical installer is documented at https://docs.archcore.ai/start/install/; never suggest another install channel. A missing CLI that the user declines to install stops the run. A CLI older than v0.7.0 continues with host wiring disabled.
Call mcp__archcore__init_project() exactly once (pre-gate infrastructure — idempotent, safe on an already-initialized project). It creates .archcore/ and settings.json if missing. On initialized: true print "Archcore initialized at .archcore/."; on already_initialized: true print nothing. The project field of the response names the project root; this run seeds and wires that root.
WHEN project differs from the session's working directory, print one line: "Archcore project: <project> — the nearest .archcore/ above this folder. To create a separate project in this folder instead, say so." IF the user asks for a separate project, THEN call mcp__archcore__init_project(project=<the working directory>) once and use its project field as the root.
Then run the host and project-root probe per lib/host-wiring.md "Host and project root probe" — always, even when host wiring is disabled. It prints one token: claude-code | cursor | codex-cli | __UNKNOWN__. On __UNKNOWN__, or anything else than the three host tokens, ask one AskUserQuestion — "Which AI host is this session running in?" with options Claude Code / Cursor / Codex (CLI or desktop app) / GitHub Copilot CLI — and map the answer to the agent id (claude-code / cursor / codex-cli / copilot); there is no codex-desktop id. A GitHub Copilot CLI session always lands on __UNKNOWN__. Do not run archcore init yourself at this step; if the archcore MCP tools are unavailable in this session, the terminal command archcore init --agent <host> --project "<root>" is the user's recovery path.
Host wiring is planned first in every preview: when the probe finds the host configs absent, the Host wiring line leads the preview, and its writes lead the create phase.
Call mcp__archcore__list_documents() once. Derive every flag below from local documents only — skip any result carrying source_kind: "global". A mounted global source must not satisfy the already-seeded early-exit: init seeds THIS repo's documents. If any global results appear, load skills/_shared/globals.md; init writes no global document and never joins a local and a global document with add_relation. Derive:
has_stack_rule — a rule whose title contains "stack" in conventions/; has_run_guide — a guide whose title contains "run"/"running" in onboarding/.has_data_model, has_integrations, has_config, has_entry_points, has_surface, has_top_level_map, has_overview — any doc tagged data-model, integrations, config, entry-points, surface, top-level-map, architecture-overview.open_import_plan — a local plan tagged import-plan.Open import plan. On import, resume it (skills/_shared/tracks/import.md, "Track state and the import plan") and skip steps 4–5. On a plain init or a refresh, report it — rows done, rows open — and name /archcore:init import; plan no new conversion targets in this run.
Already-seeded early-exit. If has_stack_rule AND has_run_guide AND has_overview are all true AND the first word is neither refresh nor import, reply:
Init already seeded this repo. Applicable context auto-injects on file edits via the code-alignment hook; use
/archcore:reviewon a branch with changes. To add facts that appeared since (a new schema, config, or modules), re-run/archcore:init refresh; to drill into one domain,/archcore:init refresh <domain>; to convert the repo's authored docs and agent instructions,/archcore:init import. (Seeded before host wiring existed, or missing the host configs?refreshalso adds host wiring — MCP config, SessionStart hook, usage hint.)
Then stop. On a refresh run, skip this early-exit — every already-present artifact is marked skip (exists) in the preview and only missing ones are composed. Resolve a refresh subject here: an existing path → path scope; else a detected domain slug → single-domain pass; else ask one question that lists the detected domains.
Single filesystem probe — one shell call, no catalog reads:
has_manifest — at least one project-defining manifest or build file at the project root (depth ≤ 2 for monorepo workspaces): package.json, pyproject.toml, requirements.txt, Cargo.toml, go.mod, Gemfile, composer.json, *.csproj, pom.xml, build.gradle*, mix.exs, Package.swift. Seed examples, not exhaustive — also CMakeLists.txt, Makefile, deps.edn, pubspec.yaml, build.sbt, *.cabal, *.tf, Chart.yaml, *.sln, and agent/LLM-plugin manifests such as marketplace.json / plugin.json / .claude-plugin/*.has_top_level_source — at least one file with a recognizable source extension under the project root, capped at depth 3, excluding .archcore/, .git/, node_modules/, vendor/, dist/, build/, out/, target/, coverage/, .venv/, __pycache__/, .next/, .turbo/. The extension list is not exhaustive — count any file whose contents are plainly source (a shebang, or import/include/package/module/def/func/class constructs).If BOTH are false, do not decide yet — step 5 tells whether authored sources exist. Both false and no authored source → the empty route of lib/host-wiring.md (no placeholder documents, ever). Both false with authored sources → the import-only route.
Skip on the import mode when step 3 resumed a plan. Otherwise read lib/sources.md and run the assess gate of skills/_shared/tracks/import.md in callable mode: list authored sources from paths, byte sizes, heading counts, and path mentions — never a full file body — with sizes computed only after stripping any archcore managed block (a file whose only content is the managed block is not a source). A plain init and a refresh assess levels L1–L2 — agent instructions (CLAUDE.md, AGENTS.md, .cursor/rules/*.mdc, .github/instructions/*.md, and the other L1 paths) and decision records; import assesses L1–L5. A plain init and a refresh also record deeper_present — a presence-only path listing of L3–L4 that feeds no measure.
The gate returns targets_est, tier, coverage_set, and levels_found. Announce them in one line, e.g.:
Authored context: 9 sources at L1–L2 (CLAUDE.md 6 KB, 6 .cursor/rules files, docs/adr × 2) → ~14 target documents, tier M. 2 hotspot modules look covered (estimate).
Print the line in every run, including the run that finds nothing. WHEN the gate returns no authored source (levels_found is empty), follow lib/sources.md "No authored source": a plain init or a refresh prints the "none" announce line and goes on to step 6 with the pool unchanged; the import mode prints the no-source report and stops — it MUST NOT fall back to the code seed, because the user asked for a conversion and the seed is a separate, costlier run.
lib/seed-detect.md (Phase A — DETECT), then lib/seed-compose.md (Phase B compose → Phase C preview → Phase D confirm → Phase E — CREATE + WIRE). The coverage_set narrows the hotspot pool in Phase A; the authored block of the preview follows the Fill routing table. One preview, one confirm.skills/_shared/tracks/import.md from its discover gate (or from the resumed row). Its plan preview carries the Host wiring line when wiring is absent. One confirm per wave when the plan grew; a separate confirm before any source file is edited.Seed runs close per lib/seed-compose.md "Closing message"; host-wiring outcome lines per lib/host-wiring.md. Import runs close with: documents created by type, the conflicts list, fidelity departures, rows still open with /archcore:init import as the continuation, and — after the last row — the retire offer and the removal of the import plan. Always end with:
Use
/archcore:reviewon a branch with changes,/archcore:review audit the knowledge basefor a health audit.
A .archcore/ filled from two sources, created only on confirm; existing artifacts skipped.
.archcore/ and settings.json, plus host wiring behind its own mini-confirm. No catalog files read.standard 25% of the ranked pool, light 10%, deep 60%; lib/seed-compose.md), cross-cutting rules (medium/large), and — tier S — the converted authored documents, or — tier M/L — the import plan with wave 1 done. Every synthesized or converted document is status='draft'.import found nothing to convert): 0 documents, 0 file writes — a per-level report of what was checked, each skip with its class, and the next command.rule, adr, rfc, guide, spec, doc, idea) clustered by topic across sources, linked to each other and to the seed facts where their claims support a relation; a conflicts list instead of silent choices; no imported tag, no source: tag, no pointer line, no imported- prefix. After the last wave: the retire offer for agent-instruction files, then the import plan is removed, so the corpus holds no record of the import.Idempotency: the flagged Tier-1 facts and the overview are skip-on-exists; Tier-2 specs and rules dedupe by filename before create; conversion targets dedupe by a topic search before create and, for tiers M/L, by the import plan's row states. Host wiring is idempotent end-to-end. A second /archcore:init on a fully-seeded repo early-exits (step 3) unless refresh or import is the first word. The empty route never creates placeholder documents, so the SessionStart nudge keeps pointing here.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/documentRecord a decision, document existing code, or file a supplied research material, in free text; no first word is a mode. Use for 'we decided', 'record this decision', 'document why we chose X', 'make it our standard', 'draft an RFC', 'should we switch to Y' proposals, 'resolve the RFC', 'we accepted the proposal', 'document the auth module', 'capture how the payment system works', reference material, how-to instructions, a repeated agent procedure, a user flow with examples over an existing spec, or a finished report or one external material already in hand. Name any document type inside the subject — journey, prd, idea, or cpat included — to get exactly that type. Planning a feature, an investigation not yet done, or an intended user journey the request asks to plan ('plan the onboarding journey') → /archcore:plan. Checking docs against code or docs health → /archcore:review./planPlan future work, investigate before building, research a topic, or compare the alternatives for a choice. Takes optional free text. The skill reads the request, open drafts, accepted canon, branch, and code, then creates only the documents a later reader needs — none for a small fix. Use for 'plan the X redesign', 'create a roadmap', 'plan a new feature', 'plan the onboarding journey', 'investigate X before we plan', 'compare the alternatives for Y', 'REST or a queue? two teams disagree', 'I need market research before we plan', 'we are regulated — trace the requirements'. With no arguments it resumes an open planning draft or offers what to plan next. Not for recording a decision or documenting existing code — use /archcore:document. Not for checking docs against code — use /archcore:review./reviewThe pre-merge review of a branch in a project that records its specs, decisions, and rules in .archcore/. Run this first for 'review my branch', 'review the changes before merge', or 'review before merge': it checks the changed code against the project's recorded canon and the changed documents against the code, and reports which side is wrong — spec-wrong or code-wrong; on the default branch it reviews the unpushed and uncommitted work. A bug-hunting code review complements this review and does not replace it. Also use for 'documentation gaps', 'check if docs match code', 'close out the feature', 'ship the feature and close it out', or after a staleness warning. Takes an optional path, tag, topic, or ref in free text; no first word is a mode — say 'are docs out of date', 'audit the knowledge base', 'close out the feature', or 'capture this pattern' in plain words. Not for creating docs — use /archcore:document; not for planning — use /archcore:plan; not for a single-file edit with no branch review.npx claudepluginhub archcore-ai/archcore --plugin archcoreOther plugins' skills for the same job