/lion:lion-archfrom lion
Maintains version-controlled, machine-checked architecture models as canonical Lion JSON with separated model and evidence files, verbatim code anchors, Reflexion checks, and zero-server interactive diffs.
Ships in lion. 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.
lion-arch)Use this skill to maintain a version-controlled, machine-checked architecture model of a codebase in .lion/ (.lion/model.json, .lion/evidence.json, optional .lion/invariants.json, and .lion/conventions.md).
Unlike static diagrams that drift from reality, a lion-arch model pairs:
.lion/model.json) — pure semantic architecture (nodes, groups, directed edge relations with optional via intermediaries, observed/planned/removed presence, and team-owned Datalog rules/invariants)..lion/evidence.json) — byte-for-byte code excerpts (anchor) and explicitly justified external knowledge (known_anchor) kept out of model.json so line-number or snippet churn never pollutes semantic diffs.lion anchor + lion check) — symlink-safe, exact-case, anti-self-reference snippet verification, hardcoded-credential linting, optional two-sided static Reflexion checking (--reflexion), and Datalog invariant checking with why explanations.lion diff --format markdown --git-base <ref> --derived --link) — Markdown PR summaries separating semantic + derived rule impact from collapsed anchor churn, plus optional #deflate-raw viewer links (<= 16 KiB URL budget) or 100% offline single-file HTML artifacts (lion artifact --out).See references/schema.md for the exact relation schema and assets/arch-rules.json for the reusable Datalog rule kernel.
invariant or architectural rule in .lion/invariants.json or .lion/model.json to make a check pass. If a code change breaks an invariant, surface the why provenance trace and either fix the code or escalate to a human decision.anchor path must point to real source/config/IaC code outside .lion/. Anchors pointing inside .lion/ or traversing symlinks are rejected.snippet byte-for-byte verbatim from the file, short (<= 120 chars for PR readability), and free of hardcoded credentials, tokens, or user:pass@host URIs (reference ${ENV_VAR} placeholders or non-secret wiring lines instead).anchor or known_anchor facts directly inside .lion/model.json after formatting — run lion fmt --separate-evidence .lion/model.json so .lion/evidence.json stays isolated..lion/conventions.md if it already exists. If not, draft a concise .lion/conventions.md capturing repository boundaries, group granularity, and external-system rules..lion/model.json using the relations in references/schema.md (starting from assets/arch-rules.json for transitive reachability, cycle, and via rules).(anchor subject path snippet) in .lion/evidence.json for every modeled component and edge (or (known_anchor subject reason) when a dependency is known operationally rather than from repo source).lion fmt --separate-evidence .lion/model.json
lion fmt .lion/evidence.json
lion anchor check --root . --model .lion/model.json --evidence .lion/evidence.json --reflexion
git diff --name-status -M)Do not re-scan the entire repository on routine commits:
git diff --name-status -M <base>..HEAD
.lion/evidence.json for anchors whose path appears in the changed/renamed/deleted list, and inspect newly added modules/imports in those files..lion/model.json and .lion/evidence.json.lion fmt .lion/model.json .lion/evidence.json
lion anchor check --root . --model .lion/model.json --evidence .lion/evidence.json --reflexion
planned + assuming)Before writing code for an architectural RFC or migration:
"planned" presence facts or a small proposal file evaluated inside Lion's counterfactual assuming block (without mutating baseline .lion/model.json).lion diff .lion/model.json --apply proposal.json --derived --format markdown --link
why before implementing.git archive in <tmp>)When reviewing a PR or branch without mutating the current working tree:
git archive:
TMPDIR=$(mktemp -d)
git archive HEAD | tar -x -C "$TMPDIR"
.lion/model.json did not exist on <base> automatically compare against an empty baseline):
lion anchor check --root "$TMPDIR" --model "$TMPDIR/.lion/model.json" --evidence "$TMPDIR/.lion/evidence.json" --reflexion
lion diff .lion/model.json --git-base origin/main --derived --format markdown \
--evidence-after .lion/evidence.json --link
--link fragment exceeds the 16 KiB URL budget, emit a 100% offline standalone HTML artifact with lion artifact --out architecture-diff.html instead.$TMPDIR when finished.conventions.md & Judgment-Call Promotion LoopArchitecture modeling involves recurring team judgment calls (e.g., whether a shared library is a standalone node or folded into services, which queues count as domain boundaries, how external SaaS dependencies are named).
Whenever a reviewer corrects a modeling choice in a PR:
.lion/model.json and .lion/evidence.json..lion/conventions.md as a short, concrete rule so future updates make the same call automatically.invariant in .lion/invariants.json so CI enforces it deterministically.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub andrueandersoncs/lion --plugin lion3 skills in this plugin
/lion-reasoningKeep a Lion logic model of what you have observed and what you believe while you work, so a belief the evidence contradicts, evidence that went out of date when a file changed, and a claim that rests only on what you were told are caught as they happen, not in your final answer. Use it for work where a wrong belief is costly or easy to slip in. That includes debugging and finding the cause of a failure, a change that has to be verified across many places, auditing docs, notes, or memory against the code, mapping how parts of a system depend on each other, making a number better (a benchmark, a size, a test or eval score) by experiments you keep or revert, tuning a prompt, a skill, or an agent's harness against evals and carrying what you learned to a new model or benchmark, and any task long enough that your context will be summarized before it ends. Use it even when the user never mentions Lion or a model. Skip it for a task a few tool calls settle./lion-researchKeep a Lion logic model alongside a deep research run, so findings are checked as they come in and stay queryable afterwards. Use this whenever the user asks for deep research, a multi-source investigation, a literature or market review, due diligence, a fact-check, a competitive or technical comparison, or an incident or timeline reconstruction, and for any question whose answer means reconciling several sources, even if they never mention Lion, a model, or a database. Also use it when the user wants research they can query, audit, or trace to its sources, and when they ask a follow-up about research that already has a model. It records what each source says as facts, derives conclusions with rules, tests your assumptions against the evidence, and delivers a page for the person who asked: their questions answered in plain words, how solid each finding is, and the quoted sources behind it.Other plugins' skills for the same job