/coograph:coograph-init Target project path (optional — will ask if not provided).from coograph
Initializes a new project with the Coograph template, auto-detecting the tech stack and filling placeholders. Supports multiple AI tool configs (Claude Code, Copilot, Codex CLI, OpenCode, Cursor, Devin, Aider, Cline).
Ships in coograph. 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.
None: SKILL.md is the whole skill.
Initialize a new project with this Coograph template. Auto-detect the tech stack from the target repo and fill in all template placeholders.
Every "copy" instruction below copies from the template root. Resolve it once, before Step 1:
<coograph>/.github/skills/coograph-init/SKILL.md inside a coograph checkout. Template root = <coograph>.<plugin>/skills/coograph-init/SKILL.md and <plugin>/template/ exists (Claude Code or Cowork plugin install). Template root = <plugin>/template/. There is no coograph checkout and no projects.json: detect install state from files on disk and skip Step 8. Marketplace Update refreshes only the plugin's own skills, agents, and hooks; files this procedure copies into the project do not auto-update, so tell the user to re-run init to refresh them.<project>/.github/skills/coograph-init/SKILL.md in a project that was itself initialized (no templates/ or setup.sh next to it). Template root = <project>. Per-tool files under templates/ (Cursor, Devin Desktop, Aider, Cline) are unavailable here: if the user selects one of those tools, say so and point them to the plugin or a coograph checkout. Skip Step 8.The template root mirrors the coograph repo layout (.github/…, .claude/…, templates/…), so every path below resolves the same way in every mode.
Ask the user these questions one at a time (wait for each answer before proceeding):
CLAUDE.md + AGENTS.md, .claude/commands/, .claude/hooks/, .claude/settings.json.github/agents/, .github/skills/, AGENTS.md.agents/skills/coograph-init/SKILL.md, .agents/skills/coograph-doctor/SKILL.md + AGENTS.md (Codex scans .agents/skills/ from repo root for native slash).opencode/commands/coograph-*.md + AGENTS.md + opencode.json (native /coograph-init slash; opencode.json carries the skills pointer and, when question 5 is yes, the code-graph MCP entry — OpenCode's equivalent of .mcp.json).cursor/rules/coograph.mdc (from templates/cursor/).windsurfrules (from templates/windsurf/)CONVENTIONS.md (from templates/aider/).clinerules (from templates/cline/).github/copilot-instructions.md and .github/instructions/ (which contains brutal-honesty.instructions.md) are always copied — every tool reads or references them.yes (recommended for projects with 10+ files), no.github/code-graph/ and wired into the AI tool(s) selected in question 2 — no external package install required beyond mcp>=1.0.0,<2.uv is recommended (auto-installs deps); pip works too.yes.yes, noyes, ask for additional paths (optional). Include .code-graph/ by default.yes (recommended), no/coograph-retro skill, but no capture. Say this if Claude Code was not selected in question 2.CI + pre-commit (recommended), CI only, pre-commit only, no.github/layout/) is always installed; this only decides whether anything runs it automatically.Before copying or filling anything, classify the target so a second run never clobbers customized files. Run this immediately after the target path is known.
Build the "expected files" set:
projects.json, take its tools +
code_graph entry and expand to the files those tools own (the per-tool lists in
Step 3 plus the always-copy block).projects.json, derive the set from which coograph files
already exist on disk (whatever is present defines what "complete" means here).projects.json — fall back to disk detection.Per-file signal (the _TBD_ / <!-- FILL markers are the only "customized vs
template" signal — reuse the same invariant Steps 4, 5 and the Guardrails key off):
_TBD_ or <!-- FILL → template-untouched (safe to refill).Classify into one state:
_TBD_ / <!-- FILL markers.
→ Update mode. Only patch tool-config files for tools newly selected in Q2 that are
not yet installed. Never touch instruction files (.github/copilot-instructions.md,
CLAUDE.md, AGENTS.md, openspec/config.yaml). Skip Step 2 (stack detection) and
Step 4 (placeholder fill) entirely — see the State-C guards in those steps.Template-managed files are exempt from the B and C restrictions. Files that
sync.py keeps up to date are copied whenever they are missing, and refreshed
when they differ from the template root, in every state (a plugin project has
no sync, so re-init is its only refresh; keeping a stale retro.py beside a
newer hook breaks both): .github/skills/, .github/agents/,
.claude/commands/coograph-*.md, .claude/hooks/, .claude/settings.json,
.github/retro/ (without rules.json), and .github/layout/ (without
layout.json). A project may have edited one on purpose (a retro hook upgrade,
a local fix), so never replace them blindly: in repo mode, when the target is
already in projects.json, refresh them with
python3 <coograph>/.github/sync.py --project <target>, which keeps locally
edited files, writes the upstream version to .coograph/upstream/<path> and
names each one; otherwise list the files that differ and ask once (replace all,
or keep the ones the user names) before replacing them. This is how a project initialized before a
template feature existed (for example Retro) receives it on re-init. Step 10 then
runs when the user enabled Retro in question 7 and .github/retro/rules.json is
absent.
State the detected state to the user before proceeding (e.g. "State C — already initialized; entering update mode, instruction files will not be touched").
State C skip: if Step 1b classified the target as State C (initialized + customized), skip this entire step — the instruction files are already filled and will not be touched. Stack detection only feeds placeholder filling (Step 4), which State C also skips.
Investigate the TARGET project to auto-detect as much as possible. Read these files if they exist:
README.md — project description, setup instructions, architecturepackage.json — Node.js deps, scriptstsconfig.json / jsconfig.json — TypeScript/JS configCargo.toml — Rustgo.mod — Gopyproject.toml, setup.py, requirements.txt — Pythonpom.xml, build.gradle — Java/KotlinGemfile — Ruby.eslintrc*, .prettierrc*, biome.json — linter/formatterdocker-compose.yml, Dockerfile — infrastructure hintsMakefile — build commandssrc/ directory listing — project structureExtract:
Present findings in a summary table and ask the user to confirm or correct before proceeding.
Copy files from the template root (see Template source) to the target project. Only copy what's relevant to the tools selected in Step 1.
Always copy (shared conventions used by every tool):
.github/copilot-instructions.md (CLAUDE.md pre-flight + on-demand reads depend on this).github/instructions/ (all instruction .md files — testing, styling, brutal-honesty).github/skills/ (all skill directories, never a tests/ or __pycache__/ folder inside one — every supported tool delegates here, including the Claude Code command wrappers in .claude/commands/ and the multi-tool slash registrations under templates/)openspec/config.yaml (create openspec/ dir if needed).github/layout/ (layout.py, layout.seed.json, README.md, coograph-layout.yml, pre-commit; never tests/, never layout.json). Then create the project's config: cd <target> && python3 .github/layout/layout.py --merge-seed (creates layout.json from the seed, or adds new keys to an existing one without touching its values). Never copy layout.json from the template root; it is the coograph repo's own. For a monorepo (workspaces in package.json, pnpm-workspace.yaml, go.work, Cargo.toml), set routers in the new layout.json to one <workspace>/AGENTS.md per workspace; for a single package set it to [].GOTCHAS.md (format header, no entries), only when the target has none. Never overwrite an existing GOTCHAS.md: it is project knowledge..github/retro/ (retro.py, _coograph_signals.py, rules.seed.json, README.md; never tests/, never rules.json). Always, whatever the answer to Step 1 question 7: the analyzer and the /coograph-retro skill must be able to bootstrap later. Only when question 7 is yes, also create the live registry: cd <target> && python3 .github/retro/retro.py --merge-seed (creates rules.json from rules.seed.json, or adds new seeded rules to an existing one without touching local edits). Never copy rules.json from the template root; it is the coograph repo's own live registry.For Claude Code:
CLAUDE.mdAGENTS.md (CLAUDE.md imports it with @AGENTS.md: the hard rules, workflow and routing live there. Without it Claude Code skips the import silently and every hard rule is gone. Same file as VS Code Copilot, Codex CLI and OpenCode: copy once).claude/commands/coograph-*.md (every Coograph slash command: /coograph-init itself, so the project can re-init others, plus /coograph-doctor, /coograph-new-ticket, /coograph-plan, /coograph-review, /coograph-ultra-review, /coograph-verify, /coograph-debug, /coograph-search, /coograph-retro, which the copied CLAUDE.md references).claude/hooks/ (all hook scripts: block-generated, log-bash, report-graph, warn-scope, capture-signals, the rule warn hooks, gotcha-surface, plus the shared _coograph_guard.py module and the _coograph_signals.py shim that loads .github/retro/_coograph_signals.py).claude/settings.json (wires the hooks into Claude Code lifecycle events).claude/settings.local.json — that's per-machine personal overridesFor VS Code Copilot:
.github/agents/ (all agent .md files — used by VS Code Copilot Chat)AGENTS.md.github/skills/ is in the always-copy block above — VS Code Copilot consumes it but does not need a tool-specific copy directive)For Codex CLI:
.agents/skills/coograph-*/SKILL.md (coograph-init and coograph-doctor; Codex scans .agents/skills/ from repo root and surfaces them as $coograph-init / $coograph-doctor)AGENTS.md (auto-read by Codex CLI; same file as VS Code Copilot — copy once).github/skills/coograph-init/ and .github/skills/coograph-doctor/ — already supplied by the always-copy block)For OpenCode:
.opencode/commands/coograph-*.md (every command file: coograph-init, coograph-doctor, coograph-retro, coograph-docs-restructure, coograph-suggest-multi-models, coograph-disable-multi-models; note the plural commands/).opencode/plugin/log-bash.ts → target project's .opencode/plugin/ (bash audit plugin — OpenCode auto-loads plugin/*.ts at session start)AGENTS.md (auto-read by OpenCode; same file as VS Code Copilot — copy once)opencode.json at the workspace root, when code-graph was enabled (question 5) — written per Step 6e; this file alone registers the code-graph MCP server and the .github/skills/ paths (OpenCode reads neither .mcp.json nor .github/skills/ on its own).github/skills/coograph-init/ and .github/skills/coograph-doctor/ — already supplied by the always-copy block)For Cursor:
templates/cursor/.cursor/ → target project's .cursor/ (preserves rules subdirectory structure)coograph.mdc rule tells the agent to follow .github/skills/coograph-init/SKILL.md whenever the user types /coograph-init (skills directory already supplied by the always-copy block).For Devin Desktop:
templates/windsurf/.windsurfrules → target project root .windsurfrules/coograph-init (skills directory already supplied by the always-copy block).For Aider:
templates/aider/CONVENTIONS.md → target project root CONVENTIONS.md/coograph-init (skills directory already supplied by the always-copy block).For Cline:
templates/cline/.clinerules → target project root .clinerules/coograph-init (skills directory already supplied by the always-copy block).Multi-tool selections: copy the union of all selected tool sections plus the always-copy section. Skip duplicate destinations (e.g. AGENTS.md is shared between Claude Code, VS Code Copilot, Codex CLI, and OpenCode: copy once). .github/skills/ is in the always-copy block; do not re-copy it from per-tool selections.
Apply the Step 1b state before any copy — decide per file, not with one project-wide prompt:
.github/copilot-instructions.md, CLAUDE.md, AGENTS.md, openspec/config.yaml).coograph-* command wrappers, hooks, settings.json, .github/retro/ without
rules.json, .github/layout/ without layout.json) are copied when missing
and refreshed when they differ, as Step 1b says (sync --project in repo mode, one
question otherwise). Say which ones were replaced and which were kept as local edits.Per-file overwrite safety (applies in every state): use the Step 1b signal.
_TBD_ / <!-- FILL) may be refilled
normally.When you do ask (customized file the user might want replaced), show both versions side by side (existing vs template) and offer:
Do NOT attempt automatic merging — the risk of duplicated or corrupted content is too high.
State C skip: if Step 1b classified the target as State C, skip this entire step. All instruction files are already filled (zero markers by definition) and must not be touched. Only the tool-config files written in Step 3 apply in update mode.
State B note: fill placeholders only in files that were freshly copied in Step 3. Existing customized files are never refilled.
Using the detected info from Step 2, replace all _TBD_ placeholders and <!-- FILL: ... --> comment blocks in the copied files.
In .github/copilot-instructions.md:
<!-- FILL: ... --> comments after filling## Project-Specific Rules (create concise bullet points; do not duplicate existing global rules)In CLAUDE.md:
AGENTS.md and .github/copilot-instructions.md with @ and adds Claude-only sections. Keep the two import lines at the top.In AGENTS.md:
Touching <glob> → the doc or instruction file to read first); keep the testing and styling rows; fill the generated API types row or delete it_TBD_ or <!-- FILL markersAskUserQuestion, TodoWrite, replace_string_in_file, multi_replace_string_in_file) and replace with runtime-supported names where neededRun this step only if the user selected yes in Step 1 question 5.
Copy .github/code-graph/ from the template root to the target project.
This includes:
builder.py — parses source files into SQLiteserver.py — MCP server exposing tools to the AI assistantvisualize.py — generates standalone HTML graph visualizationparsers/ — per-language parser modules (regex + tree-sitter)package.json — d3 dependency for visualizationrequirements.txt — mcp>=1.0.0,<2 plus optional tree-sitter language packagespost-commit / post-merge / post-rewrite — optional git hooks for automatic graph updatesDo NOT copy node_modules/ — it will be installed in the next step.
cd <target-project>/.github/code-graph && npm install
This installs d3 (used by visualize.py to generate offline-capable HTML graphs).
uv is installeduv is the recommended way to run the MCP server (auto-installs Python deps without polluting the system).
Check availability:
command -v uv
If uv is not found, install it automatically:
curl -LsSf https://astral.sh/uv/install.sh | sh
After install, ensure ~/.local/bin (or the printed install path) is on $PATH for the current session:
export PATH="$HOME/.local/bin:$PATH"
Verify:
uv --version
Do NOT ask the user to install uv manually — install it automatically and report the result.
If the install script fails (e.g. no internet, corporate proxy), fall back to pip install 'mcp>=1.0.0,<2' and use python instead of uv in MCP configs.
Pin the interpreter. uv run resolves against the machine's default Python, not
the newest one installed. mcp>=1.0.0,<2 requires Python 3.10+, so on a machine whose
default is older the server dies at start-up with
your requirements are unsatisfiable — and the MCP host reports only
CONNECTION_CLOSED, with the real cause buried in the server log.
Check the default:
python --version
If it is below 3.10, every uv run invocation this procedure writes or runs — the MCP
configs in 6e, the git hooks in 6h, and the build command in 6f — must carry the
interpreter constraint -p ">=3.10" immediately after run. Use the range, never an
exact version: with the system-only pins from 6e (UV_NO_MANAGED_PYTHON,
UV_PYTHON_DOWNLOADS=never), an exact -p 3.12 fails on every machine whose system
Python is another 3.1x. Without those pins, uv downloads a managed interpreter when no
installed one satisfies the range:
uv run -p ">=3.10" --with-requirements .github/code-graph/requirements.txt .github/code-graph/server.py --build
Report the pin to the user, since it has to stay in the committed config.
.code-graph/ to .gitignoreAppend .code-graph/ to the target project's .gitignore if not already present.
Also ensure node_modules/ is in .gitignore (usually already present).
The graph database is local/generated — it must not be committed.
By this point uv should be installed (step 6c). If step 6c fell back to pip, use "command": "python" and "args": ["${workspaceFolder}/.github/code-graph/server.py"] in all configs below instead of the uv variant.
If the server instead dies with DLL load failed while importing _overlapped (Windows Smart App Control blocks the uv-managed Python build), create a system-Python venv — python -m venv .code-graph/venv then pip install -r .github/code-graph/requirements.txt — and point the command at its interpreter, or keep uv and add "env": {"UV_NO_MANAGED_PYTHON": "1", "UV_PYTHON_DOWNLOADS": "never"} ("environment" in opencode.json) to pin uv onto a system Python install.
The configs below carry the -p ">=3.10" interpreter constraint from step 6c. Drop it only when the machine's default python is already 3.10 or newer; keeping it is harmless either way.
VS Code Copilot → create or merge into .vscode/mcp.json:
{
"servers": {
"code-graph": {
"type": "stdio",
"command": "uv",
"args": ["run", "-p", ">=3.10", "--with-requirements", "${workspaceFolder}/.github/code-graph/requirements.txt", "${workspaceFolder}/.github/code-graph/server.py"]
}
}
}
Claude Code → create or merge into .mcp.json at repo root:
{
"mcpServers": {
"code-graph": {
"type": "stdio",
"command": "uv",
"args": ["run", "-p", ">=3.10", "--with-requirements", ".github/code-graph/requirements.txt", ".github/code-graph/server.py"]
}
}
}
Cursor → create or merge into .cursor/mcp.json:
{
"mcpServers": {
"code-graph": {
"type": "stdio",
"command": "uv",
"args": ["run", "-p", ">=3.10", "--with-requirements", ".github/code-graph/requirements.txt", ".github/code-graph/server.py"]
}
}
}
OpenCode → create or merge opencode.json in the workspace root (OpenCode reads neither .mcp.json nor .github/skills/ on its own):
{
"$schema": "https://opencode.ai/config.json",
"skills": { "paths": [".github/skills"] },
"mcp": {
"code-graph": {
"type": "local",
"command": ["uv", "run", "--with-requirements", ".github/code-graph/requirements.txt", ".github/code-graph/server.py"],
"cwd": ".",
"enabled": true,
"timeout": 120000,
"environment": { "UV_NO_MANAGED_PYTHON": "1", "UV_PYTHON_DOWNLOADS": "never" }
}
}
}
(If uv was skipped, "command" is the plain string "python" with "args": [".github/code-graph/requirements.txt", ".github/code-graph/server.py"].)
If Both was selected in Step 1, write all applicable configs.
Do NOT overwrite existing MCP configs: merge the code-graph key into the servers/mcpServers/mcp object (and "skills": {"paths": [".github/skills"]} into opencode.json), and leave every other key alone. sync.py follows the same rule on later pulls, so a hand-edited config survives.
The --build flag does NOT require the mcp package. Tree-sitter packages (installed via requirements.txt) are used automatically where available and fall back to regex parsers otherwise.
Run in the target project root:
uv run --with-requirements .github/code-graph/requirements.txt .github/code-graph/server.py --build
Expected output includes timed progress per phase, ending with:
Graph built: N files → .code-graph/graph.db (X.XXs)
If the build fails:
python --version--build path does NOT import MCP — if you see an mcp error, something else is wrong.Confirm .code-graph/graph.db exists. Report the file size and build time to the user as confirmation.
Ask the user a Yes/No question:
Install git hooks? — "Auto-update the code graph on commit, merge, and rebase?" Options:
Yes(recommended),No
If the user selects No, skip to 6i.
If the user selects Yes:
GIT_DIR=$(git -C <target-project> rev-parse --git-dir)
mkdir -p "$GIT_DIR/hooks"
cp <target-project>/.github/code-graph/post-commit "$GIT_DIR/hooks/post-commit"
cp <target-project>/.github/code-graph/post-merge "$GIT_DIR/hooks/post-merge"
cp <target-project>/.github/code-graph/post-rewrite "$GIT_DIR/hooks/post-rewrite"
chmod +x "$GIT_DIR/hooks/post-commit" "$GIT_DIR/hooks/post-merge" "$GIT_DIR/hooks/post-rewrite"
Each hook runs:
uv run --with-requirements .github/code-graph/requirements.txt .github/code-graph/server.py --update
(Falls back to python .github/code-graph/server.py --update if uv is unavailable.)
Behavior:
.code-graph/graph.db does not exist yet, the hook exits silently..git/hooks/ is not committed), so each developer installs it once.git fetch alone does not update the graph because it does not change the checked-out files..git/ is above the target project root.Run this only if Step 1 question 6 is yes.
git config --global core.excludesfile
~/.config/git/ignore and set it:git config --global core.excludesfile "$HOME/.config/git/ignore"
mkdir -p "$HOME/.config/git"
touch "$HOME/.config/git/ignore"
.code-graph/ and any user-provided local-only folder entries if missing.The copied agent files already include a mandatory "Step 0 — Orient with Code-Graph" section with HARD-RULE wording (code-graph first, non-negotiable, only fall back when the DB is genuinely absent).
Verify it is present in the target project by grepping each agent file for MANDATORY — non-negotiable (or MANDATORY - non-negotiable in a project whose openspec/config.yaml sets sync: em_dash: hyphen):
grep -LE "MANDATORY (—|-) non-negotiable" <target>/.github/agents/*.agent.md
Files returned (missing the marker) need the block restored — copy the Step 0 block from the matching file in <template root>/.github/agents/ verbatim (with every — written as - under em_dash: hyphen, so sync still recognises the file as untouched). Do not improvise the wording; the literal HARD RULE phrasing is what enforces the rule.
Skip this step in plugin mode and initialized-project mode (see Template source) — there is no coograph checkout to register with.
Register the target project so future git pull updates in coograph auto-propagate.
projects.json in the coograph root (create with {"projects": []} if missing).{
"path": "<absolute-path-to-target-project>",
"tools": ["claude", "vscode"],
"code_graph": true,
"registered_at": "YYYY-MM-DD"
}
Set tools to match what was selected in Step 1, using these ids: claude (Claude Code), vscode (VS Code Copilot), codex (Codex CLI), opencode (OpenCode), cursor (Cursor), devin (Devin Desktop; older entries say windsurf, which means the same), aider (Aider), cline (Cline). Set code_graph to match Step 1 question 5, and registered_at to today's date. /coograph-doctor compares these ids against the files on disk.projects.json back../setup.sh in the coograph root to ensure git hooks are configured for auto-sync:
cd <coograph-path> && ./setup.sh
After setup, every git pull in coograph will automatically sync updated agents, skills, commands, code-graph files, and .mcp.json to all registered projects — and rebuild their graphs if code_graph: true.Run this step only if the user selected yes in Step 1 question 5. Skip if .code-graph/graph.db does not exist (the build in Step 6f failed earlier — surface that instead).
Run these queries against the target project's .code-graph/graph.db and collect the results:
sqlite3 .code-graph/graph.db "SELECT COUNT(*) FROM nodes;"
sqlite3 .code-graph/graph.db "SELECT COUNT(*) FROM edges;"
sqlite3 .code-graph/graph.db "SELECT COUNT(DISTINCT file) FROM nodes;"
sqlite3 .code-graph/graph.db "SELECT kind, COUNT(*) FROM nodes GROUP BY kind ORDER BY COUNT(*) DESC LIMIT 5;"
Compare to expectations based on the source tree (Step 2 detection):
find src/ -type f -name '*.<ext>' | wc -l or equivalent for the detected language)file values in graph (from query above)Flag the graph as suspect if ANY of these are true:
nodes count is 0 or "unrealistically low" (< 50% of source files for projects with 20+ files)edges count is 0 (parser produced symbols but no relationships — likely a parser fallback issue)file count is < 80% of detected source files (parser silently skipped files)kind values are missing expected categories for the language (e.g. Python project with zero function or class nodes)graph.db size is < 10kb (likely empty schema, no real content)If the graph looks healthy, output a one-line summary:
[code-graph] healthy — N nodes, M edges, K files indexed.
If the graph looks suspect, output a structured report:
[code-graph] possible issues:
- <issue 1, e.g. "only 12 of 47 source files indexed (26%)">
- <issue 2, e.g. "0 edges — relationships may be missing">
The graph may not be returning useful results. Want me to try fixing it?
(a) Yes — rebuild from scratch and try alternate parsers where available
(b) No — leave as-is, I'll investigate manually
Wait for the user's choice. Do not auto-fix.
.code-graph/graph.db and any stale parser caches.uv run --with-requirements .github/code-graph/requirements.txt .github/code-graph/server.py --build --verbose
[code-graph] rebuild did not resolve all issues. See log above.
Likely causes: tree-sitter language pack missing, source files using a dialect/version
not supported by the fallback parsers, or symlinks/large generated files inflating counts.
Open an issue at github.com/paullukic/coograph if you want help.
Run this step only if the user selected yes in Step 1 question 7.
<target>/.github/retro/rules.json, rules.seed.json, retro.py, _coograph_signals.py, and README.md exist. If Claude Code was selected, <target>/.claude/hooks/capture-signals.py and the _coograph_signals.py shim exist and <target>/.claude/settings.json wires capture-signals.py under both SessionStart and SessionEnd. Run:
cd <target> && python3 .github/retro/retro.py --validate
It must print retro: rules.json valid.
Claude Code keeps every transcript for the project under ~/.claude/projects/<slug>/, where <slug> is the absolute target path with every character outside A-Z a-z 0-9 replaced by -:
| OS | example path | slug |
|---|---|---|
| Windows | C:\paul\code\app | C--paul-code-app |
| macOS / Linux | /home/paul/app | -home-paul-app |
Work out the directory and count its *.jsonl files. If it does not exist or is empty, say so and skip to 10c. Otherwise ask a Yes/No question:
Backfill Retro from existing transcripts? "Found Claude Code transcripts for this project at
<path>. Retro stores tool names, counts, rule ids, file paths, and token totals only; no prompt text, code, or output. Read them now?"
On yes:
cd <target> && python3 .claude/hooks/capture-signals.py --backfill "<path>" --cwd .
Report the printed captured / skipped / failed line verbatim.
cd <target> && python3 .github/retro/retro.py --report
Show the user the first paragraph it prints (the plain-language opener) and the path to report.md. If nothing was captured, the opener says so; that is fine. Tell the user: "From now on every Claude Code session start prints a [retro] line, and /coograph-retro turns the report into proposals when there is enough evidence."
Run this step only if Step 1 question 8 is not no.
cd <target> && python3 .github/layout/layout.py --budget. Report the per-tier lines. If it prints STRUCTURAL (an existing project with large maps), say so and point to /coograph-docs-restructure; do not try to fix it here.CI + pre-commit or CI only): copy .github/layout/coograph-layout.yml to <target>/.github/workflows/coograph-layout.yml. Do not overwrite an existing file of that name without asking. sync.py refreshes it later only while its first line carries coograph:managed; tell the user to delete that line if they edit the workflow.CI + pre-commit or pre-commit only): find the git dir (git -C <target> rev-parse --git-dir). If <git-dir>/hooks/pre-commit does not exist, copy .github/layout/pre-commit there and chmod +x it. If one exists, do not replace it: add the line "$(git rev-parse --show-toplevel)/.github/layout/pre-commit" || exit 1 once, at the end, or just before the last line when that line starts with exec (nothing after an exec runs), and tell the user. Local only, like the code-graph hooks: each developer installs it once.Run the install check last, on the target:
python3 <template-root>/.github/skills/coograph-doctor/doctor.py --project <target>
From a coograph checkout (repo mode) this also compares the target against its new projects.json entry. Show the output. Every check should be PASS or SKIP; a WARN is expected only for an option the user declined (for example hooks:git when they said no to git hooks in Step 6h). Fix any FAIL before calling initialization done, or name it to the user as open. The procedure for later checks is /coograph-doctor.
CLAUDE.md or copilot-instructions.md, warn and ask (merge/overwrite/skip)._TBD_ and <!-- FILL markers in copied instruction files..code-graph/graph.db exists in the target project, at least one MCP config file has been written, AND Step 9 health check has run (either reporting healthy or finishing the user-chosen fix path).retro.py --validate passed and Step 10c printed a report opener..github/layout/layout.json exists and layout.py --budget ran (its result reported, pass or fail).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/coograph-applyImplement tasks from an OpenSpec change. Use when the user wants to start or continue implementing a proposed change./coograph-archiveArchive a completed change. Use when implementation is done and the change is ready to be moved to the archive./coograph-debugRoot-cause a bug or build error with minimal investigation, then apply the smallest fix. Reproduce, gather evidence, fix, verify, with a 3-attempt circuit breaker. Use for failing builds, tests, or runtime errors.npx claudepluginhub paullukic/coograph --plugin coographOther plugins' skills for the same job