system-map
Regenerate the fleet architecture map (crawl every repo under E:\automation, render to architecture/system-map.png) and post the refreshed image to Telegram. E.g. "/system-map", "update the architectu
SKILL.md.claude/skills/system-map/SKILL.md
GitHubsystem-map
Goal: keep one always-current, shareable picture of the whole personal fleet. Crawl the fleet, reconcile it against the written architecture, render the visual, commit when it changed, drop the fresh image in Telegram — every run, on-demand or scheduled.
The map is self-describing: each repo declares its own card in a root .fleet.toml, and .claude/skills/system-map/build_data.py aggregates those (plus the hand-maintained architecture/fleet.residual.json) into the generated architecture/fleet.data.js that both renderers read — architecture/system-map.html (the PNG) and .claude/skills/system-map/render_mermaid.py (the text-native .mmd fleet-map doc global-CLAUDE.md points at). architecture/ARCHITECTURE.md is the human-readable narrative that must agree with it; tests/run_acceptance.py fails if the fleet, the data file, and the doc drift apart. Per-repo .fleet.toml aggregation is the exception: its inputs live in sibling checkouts, so drift reports as SKIP and this skill owns fixing it (step 2).
Execution rules (read first)
- Run from the
fleet-configrepo root (E:/automation/fleet-config). All paths below are relative to it. - Never leak hardware specs. The render always forces
?placeholders=1, so the committed PNG shows<model> · <NN> GBplaceholders even though a localsystem-map.local.jsexists. Do not put real specs intoARCHITECTURE.md, theDATAobject, or the commit. (Seearchitecture/README.md.) - Keep the residual and
ARCHITECTURE.mdin lockstep. Any project add/remove/edit happens inarchitecture/fleet.residual.json(or the repo's.fleet.toml) andARCHITECTURE.mdin the same run, then regeneratefleet.data.jswithbuild_data.py. Never hand-editfleet.data.js. - Don't disturb in-progress work. Only touch
architecture/and the generated repo list indocs/fleet-guide.md, and only commit those two paths. - Degrade gracefully, never block on a prompt — this runs unattended.
Steps
Run in order. A failure on one step prints a short error and stops.
1. Load the sources
hooks/projects.toml→ the fleet: every[<name>]table's bare name is a repo; the[global] architecture_ignorearray lists repos to exclude (vendored/legacy/out-of-scope). The fleet set = all repo names −architecture_ignore.- each repo's
<cwd_prefix>/.fleet.toml→ that repo's self-declared card (authoritative when present). Schema inarchitecture/README.md. architecture/fleet.residual.json→ the hand-maintained input: non-repo structure (access/edge/compute/external/principles) + fallback cards (curated order) + the_adoptedregistry of repos that MUST carry a.fleet.toml.architecture/fleet.data.js→ the generated map data (window.FLEET = { …strict JSON… };); never hand-edit it.architecture/ARCHITECTURE.md→ the current layer assignment + prose descriptions.
2. Reconcile the fleet, then regenerate
Compute the difference between the fleet set (step 1) and the projects currently represented in the map:
- New repo (in the fleet, absent from the map): prefer its own
<cwd_prefix>/.fleet.toml— if present, the card comes from there automatically. If it has none, read itsREADME.md(first paragraph) andCLAUDE.md, write one concise sentence in the existing card voice, assign a layer (default working — pipelines unless plainly a shared enabling tool used by more than one app), and add a fallback card toarchitecture/fleet.residual.json(matching array:enabling/web/pipe; set"repo"when the displaynmdiffers). Also add it toARCHITECTURE.md. - Departed repo (in the map, no longer in the fleet, or newly in
architecture_ignore): remove it fromfleet.residual.json,ARCHITECTURE.md, and its_adoptedentry if any. - Otherwise: no content change — proceed to regenerate (specs/date may still refresh).
Keep edits minimal and in the existing card voice. Don't restructure layers or rewrite untouched cards.
Then regenerate the data file and validate:
E:/automation/fleet-config/.venv/Scripts/python.exe .claude/skills/system-map/build_data.py # residual + per-repo .fleet.toml → fleet.data.js
E:/automation/fleet-config/.venv/Scripts/python.exe skills/_lib/gate_evidence.py run --label gate -- E:/automation/fleet-config/.venv/Scripts/python.exe tests/run_acceptance.py
A build_data: REFUSED <repo>: … line means that repo's .fleet.toml description is longer than its card shows in two lines (per-layer cap: architecture/README.md, fleet-config#1250). The file is still regenerated with the repo's residual fallback card, but the run exits 1. Name every refused repo in the step-7 report; the fix is a shorter description in the owning repo, never a raised cap. Then run build_data.py --coupling: it lists each cross-repo reference a card's depends_on does not declare, each repo it could not scan and each refused card, and exits 1 on any of them, which is a failure of this run — name them in the step-7 report with the counts. The fix is in the owning repo's .fleet.toml (depends_on, or a reviewed ignore_refs entry), never a skipped check.
The system_map: checks fail if the fleet, fleet.data.js, and ARCHITECTURE.md disagree. Fix any failure before rendering.
This skill owns fleet-wide .fleet.toml freshness (fleet-config#562). The fleet_toml: aggregate checks read sibling repos' live checkouts, so they report as SKIP in tests/run_acceptance.py (advisory) — otherwise another repo's .fleet.toml commit would block every /issue-finish, /quick, and /issue-yolo here; only fleet-config's own card is gated hard. Here they are load-bearing: any SKIP fleet_toml: line in this step is a failure of this run — the regeneration above resolves it, so re-run build_data.py, and if a line survives, fix it in the owning repo (or drop it from _adopted) before rendering. Never leave this step with drift outstanding: the weekly run is the only thing that clears it.
3. Render the visual
E:/automation/fleet-config/.venv/Scripts/python.exe .claude/skills/system-map/render.py
Measures the page and screenshots architecture/system-map.png at 2× with placeholders forced. On a render failure it prints the real Chrome/console error — fix the DATA/HTML and re-run (the page logs a single DIMS w h line on success).
Then render the text-native companion — a second, independent consumer of the same fleet.data.js, no new crawl logic:
E:/automation/fleet-config/.venv/Scripts/python.exe .claude/skills/system-map/render_mermaid.py
Regenerates architecture/system-map.mmd (icons + names; tag edges solid, depends_on edges dotted), the fleet-map doc agents open on demand, architecture/CONTRACTS.md (every declared interface, ownership and dependency), and the repo list between the fleet-repos markers in docs/fleet-guide.md (render_guide.py; the prose around it is never touched). Idempotent; --check exits 1 when any of them is stale.
4. Compute the week-over-week change line
Before committing (so HEAD still points at the previous run), capture the one-line "what changed" summary for the Telegram post:
E:/automation/fleet-config/.venv/Scripts/python.exe .claude/skills/system-map/whatchanged.py
Diffs the freshly-reconciled working architecture/fleet.data.js against the previously-committed one (git show HEAD:…) and prints a single line — +whatsapp-radar, −suna, 3 repos updated (added/removed repos named, in-place edits counted). A no-op week prints no fleet changes; the very first run (no prior snapshot) prints baseline. Keep this string for step 6.
5. Commit when the map changed
git status --porcelain architecture/
If nothing changed, skip the commit (idempotent — a no-op week makes no commit). If it did, run the grant as its own command first and confirm it succeeded:
E:/automation/fleet-config/.venv/Scripts/python.exe skills/_lib/commit_guard/marker.py grant . --reason system-map --path architecture/ --path docs/fleet-guide.md
Only then, as a separate command:
git add architecture/ docs/fleet-guide.md
git commit -m "docs: refresh system map (<YYYY-MM-DD>)"
Never chain the grant and the git commit in one shell command (&&, ;, a newline-joined block): the guard is a PreToolUse hook that judges the whole command before any part of it runs, so the marker does not exist yet and the commit is refused.
If the current branch is main (the scheduled unattended case), also git push. On a feature branch, leave pushing to the normal PR/issue-finish flow. Then E:/automation/fleet-config/.venv/Scripts/python.exe skills/_lib/commit_guard/marker.py revoke . whether or not the commit happened.
The grant is what lets this commit land on main: hooks/main_commit_guard.py refuses a commit on the default branch unless the repo holds a marker covering every staged path (15 minutes, then it lapses). Grant exactly these two paths, never wider.
6. Post the image to Telegram (every run)
Post the refreshed map with the step-4 change line, on-demand and scheduled. This is activity-log traffic, so route it with --category log (the helper resolves the coding log chat from hooks/projects.toml — never hardcode a channel id):
E:/automation/fleet-config/.venv/Scripts/python.exe hooks/notify_send.py --category log \
--file architecture/system-map.png \
--title "Roberto's System — architecture" \
--text "🛠️ Fleet architecture map - refreshed <YYYY-MM-DD>. <change line from step 4>."
The helper never raises; a missing token just logs and exits non-zero.
7. Report
Print: the change line from step 4, projects added/removed (if any), whether a commit was made (and pushed), and the Telegram post result. Keep it to a few lines.
Wiring the weekly schedule
An app-launcher Jobs entry (Windows Task Scheduler under \AppLauncher\) that runs weekly, targeting the co-located .claude/skills/system-map/run-weekly.bat; it preserves /system-map plus bypass permissions and streams filtered milestones through the shared claude_progress.py adapter.
cwd = E:/automation/fleet-config. Same executor as every other scheduled job; the skill handles render + commit-if-changed + Telegram itself. (Alternatively a scheduled cloud agent invoking the same skill.)