/claude-leverage:arch-map [--depth N] [--validate] [--target path] [--noninteractive]from claude-leverage
Maintains a machine-readable architecture.yml at repo root with module metadata (path, role, stability, public surface, dependencies). Use after repo setup, restructures, or before refactors to give agents structured answers about module roles and stability.
Ships in claude-leverage. 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.
Maintains architecture.yml at the repo root — a hand-curated,
machine-readable map of top-level modules. Complements
/repo-map, which generates a human-readable
mermaid diagram; this skill produces the structured-metadata layer an
agent can load and query in one parse.
The point: agents proposing refactors regularly ask "is this module
stable or experimental?" / "what's the public surface I shouldn't
silently rename?" / "what module does this pair with?". Re-deriving the
answer from prose AGENTS.md + directory tree walks is wasted tokens
every session. architecture.yml answers in one YAML load.
This skill drafts the file (from directory walk + AGENTS.md hints).
The user confirms role and stability per module. Auto-generated
guesses get a <TODO> placeholder until the user fills them.
See ADR 0005 for the rationale (why YAML over JSON, why root over
docs/, why not per-folder).
/init-repo and ideally
after /repo-map).architecture.yml first than guess at module roles.Do NOT invoke for:
/repo-map's
madge/pydeps block).# claude-leverage:architecture-map v1
# Hand-curated structured architecture metadata. Update via /arch-map
# or by hand-editing this file. Schema: claude-leverage v1.
# See: https://github.com/Filip-Podstavec/claude-leverage/blob/main/skills/arch-map/SKILL.md
repo:
name: "<repo-name>"
primary_lang: "<lang or lang+lang+lang>"
one_line: "<one-sentence concrete description: what + for whom>"
modules:
- path: "<dir-or-file>/"
role: "<one-line purpose>"
stability: stable | evolving | experimental | deprecated
public_surface:
- "<name agents must not silently rename>"
- "<another>"
depends_on:
- "<other module path>"
paired_with: "<module that mirrors this one>"
owners:
- "<name or @handle>"
repo.name, repo.primary_lang, repo.one_linepath, role, stabilitymodules[].public_surface — names/files agents must not casually
rename (the rename will break callers outside the module). Strings.modules[].depends_on — array of other module path values this
module depends on at the architectural level (not import-level).modules[].paired_with — single module path that mirrors this one,
e.g. agents/ paired with .codex/agents/.modules[].owners — array of names or @handles.| Value | Meaning |
|---|---|
stable | Public surface is load-bearing; renames need an ADR + caller migration. |
evolving | Public surface may change; callers should pin imports. |
experimental | May be deleted entirely. Don't depend on this module from outside. |
deprecated | Scheduled for removal. New code should not reference it. |
Resolve repo root. git rev-parse --show-toplevel. If not in a
git repo, STOP and report.
Detect mode.
--validate → parse existing architecture.yml, check required
fields, check path values exist, report findings, write
nothing.--validate → extend / refresh mode:
re-walk directories, suggest entries for new modules; preserve
existing module entries unchanged.Walk top-level directories (depth 1 by default; pass
--depth N for 1–3). Skip:
.codex / .claude* (those are tooling).node_modules, __pycache__, dist, build,
.next, .pytest_cache, target, vendor, bench/archive-*.For each non-trivial directory, infer:
path — the directory path relative to repo root, with trailing
slash.role (draft) — read the directory's AGENTS.md if present;
extract the first H1 heading + first paragraph. If no AGENTS.md,
emit "<TODO: one-line purpose>".stability (draft) — emit <TODO: stable|evolving|experimental|deprecated>.
The skill won't guess this; the user knows.public_surface (draft) — best-effort: list top-level filenames
without leading _, plus any obvious exports (Python __all__,
TS named exports, Go exported identifiers). Cap at 10 entries.
If unclear, omit the field.depends_on (draft) — omit; the user fills if architecturally
meaningful.paired_with (draft) — heuristic: if there's a .codex/<name>/
mirror of <name>/, propose that pairing.owners (draft) — omit by default. The user can fill or skip.Read existing architecture.yml if present. Parse YAML
(stdlib-only via python -c 'import yaml' if available, else a
conservative line-based parser — see "Parser fallback" below).
Compute set of modules[].path values already documented.
New module entries proposed only for paths not in that set.
Show the user the draft (interactive mode):
I'll write architecture.yml at <repo-root>/. Confirm or edit:
repo:
name: "claude-leverage"
primary_lang: "shell+python+markdown"
one_line: "<TODO: one-sentence concrete description: what + for whom>"
modules (proposed):
- path: "scripts/hooks/"
role: "<TODO: one-line purpose>" <-- AGENTS.md present at this path? no
stability: <TODO>
- path: "skills/"
role: "Cross-tool on-demand skills (agentskills.io spec)" <-- from skills/README.md
stability: <TODO>
- path: "agents/"
role: "Claude Code subagents" <-- from agents/README.md
stability: <TODO>
paired_with: ".codex/agents/"
...
Proceed? (y / n / edit-each)
With edit-each, walk modules and prompt for role + stability
per module. With y, write as-shown (<TODO> placeholders intact).
In --noninteractive, write as-shown without prompting.
Write the YAML. Use a deterministic key order (the order in the
schema above). Quote strings that contain : or start with -.
Use 2-space indentation. End with a single newline.
Validate the written file. Run the YAML parser on it; check:
# claude-leverage:architecture-map v1.repo.name, repo.primary_lang, repo.one_line are present
and non-empty (a <TODO> placeholder counts as "present").modules is a non-empty list.path, role, stability.path value exists on disk (warn if not — could be an
intentional placeholder for a planned module).stability is one of the four valid values OR a <TODO>
placeholder.
If validation fails, print the error with line number and stop
before writing the final version.Update AGENTS.md (idempotent, ask before write). If AGENTS.md
exists and doesn't already mention architecture.yml, offer to
append:
### Architecture metadata
Machine-readable module map: [`architecture.yml`](architecture.yml).
When proposing refactors that cross module boundaries, **read this
first** for `stability` and `public_surface` constraints.
Skip if --no-update-agents-md is passed.
Report. Print path, count of modules total, count of <TODO>
placeholders remaining, suggested next step (/arch-map --validate
after filling).
--validate)Read architecture.yml, run the same checks as step 8, exit. Useful in
CI: a future job can run claude /skill arch-map --validate to fail
the build if the file drifts. Output is a structured report:
# architecture.yml validation — <YYYY-MM-DD>
Schema version: v1 ✓
Required fields: ✓
| Module | Status | Notes |
|--------|--------|-------|
| scripts/hooks/ | ok | — |
| skills/ | ok | — |
| agents/ | **TODO** | role + stability still placeholders |
| legacy/ | **missing** | path declared but not on disk |
If neither python nor python3 is on PATH, or PyYAML isn't
installed, fall back to a conservative regex line parser inside the
skill body:
- prefix.If even that fails (file structure is too foreign), print the parse error and STOP. Don't try to "fix" the file — that's the user's job.
role or stability. Both are user-supplied or
<TODO> placeholders. The skill drafts, the user confirms.depends_on from imports. Import-level deps
belong in /repo-map's madge/pydeps block. depends_on here is
architectural (user-decided), not derived.# claude-leverage:architecture-map v1 comment is load-bearing.architecture.yml is the
user's call to fix; the skill never rewrites a file it can't parse.--depth N — directory walk depth (1–3, default 1).--validate — schema-only mode; write nothing, exit non-zero on
failure.--target <path> — non-default file location (default
<repo-root>/architecture.yml).--no-update-agents-md — skip the AGENTS.md pointer step.--noninteractive — write the draft as-shown without per-module
prompts./repo-map's madge/pydeps block. This skill captures the
architectural dependency the user names, not the import graph.architecture.yml is structured metadata about the
module's role in the system, not its internal workings.depends_on is acyclic. Cycle detection is future
work for /stack-check integration.Same SKILL.md ships in Codex via scripts/install-codex.sh. Codex
host writes the same YAML; the format is tool-agnostic.
/stack-check could validate architecture.yml schema as part of
its repo-walk, flag <TODO> placeholders > 30 days old, and warn
on depends_on cycles. Tracked as a future enhancement./repo-map could read architecture.yml to color-code mermaid
nodes by stability. Future enhancement.architecture.schema.json) for IDE
validation in editors that support it. Out of scope for v1.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/adr-newUSE WHEN a load-bearing architectural decision is being made in conversation (database / framework / auth model / integration choice, or explicit rejection of an alternative) — one likely to be re-litigated in 6 months without the rationale. Bootstraps a numbered MADR ADR in `docs/adr/`, asks for context + decision + alternatives, updates the index. Immutable status once accepted. See `docs/adr/README.md` for the convention; full Do/Don't list in this SKILL body.
/codex-sandboxUSE WHEN setting up Codex CLI in a project, tightening sandbox for prod/CI, or when user asks about Codex permissions. Interactive helper for per-project `.codex/config.toml`: `dev` / `prod` / `custom` profiles, idempotent via markers, preserves unmanaged config below the block. Codex-only artifact.
/conventions-initUSE WHEN setting up a repo for AI-first work (after /init-repo), or when the context-surface hook should start feeding repo conventions to agents before edits. Drafts `conventions.yml` at repo root: per-kind casing (inferred from the code), a vague-name denylist seed, directory roles, and a hand-filled house-rules block. Idempotent — never overwrites a populated file; re-running prints suggested additions for manual merge. Read-only on code; never invents house rules. After writing, run /refresh-context-map so the hook picks it up.
/dynamic-checkUSE WHEN the user explicitly asks to verify that this repo's DECLARED build/test/lint commands actually run ("does the quickstart work?", "validate the commands in AGENTS.md"), typically after /repo-doctor or /repo-doctor --semantic raised suspicion. Executes only commands the repo itself declares (AGENTS.md build/test blocks, README quickstart), with preview + explicit confirmation, denylist tripwire, and timeouts. Advisory — results never enter /repo-doctor's deterministic score (ADR 0012/0013). Opt-in by invocation; never fired by hooks or other skills.
/explain-diffUSE WHEN about to open a PR, when teammate asks "what's in this diff?", or when returning to a branch and needing self-orientation. Three modes: `--for pr|review|self`. Reads `git diff HEAD` (or passed range), returns 3–5 bullet plain-English narration. Read-only — defers security/test concerns to other skills.
/glossary-initUSE WHEN setting up a repo for AI-first work, when an agent hallucinates domain term meaning, or when user asks to bootstrap / extend the repo's domain glossary. Surfaces candidate terms by identifier frequency, asks the user for 1-sentence definitions, writes `GLOSSARY.md` at repo root. Idempotent — re-running adds new terms without overwriting existing ones. Read-only on code; never invents domain meaning. Full Do/Don't list in this SKILL body. See ADR 0005 for why this file lives at root.
npx claudepluginhub filip-podstavec/claude-leverage --plugin claude-leverageOther plugins' skills for the same job