lain-architecture

lain-architecture is a skill for Claude Code, Codex from spuentesp/lain. It costs 60 tokens per session (571 once invoked), scanned A, original, MIT.

An architecture analysis skill for mapping a codebase, comparing modules, and tracing how parts depend on one another.

In plain words
What is it for?
It is for exploring module trees, finding highly connected or misplaced code, tracing dependencies, and seeing how deeply a symbol sits in the software stack.
Why use it?
It helps answer system-structure questions without manually following files and dependencies.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for exploring module trees, finding highly connected or misplaced code, tracing dependencies, and seeing how deeply a symbol sits in the software stack.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/spuentesp/lain/lain-architecture
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add spuentesp/lain --skill lain-architecture
Clone the repo
git clone --depth 1 https://github.com/spuentesp/lain

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lain-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/spuentesp/lain/lain-architecture/github.svg)](https://agentmods.dev/skills/spuentesp/lain/lain-architecture)
Your own site
<a href="https://agentmods.dev/skills/spuentesp/lain/lain-architecture"><img src="https://agentmods.dev/badge/skills/spuentesp/lain/lain-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lain-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/spuentesp/lain/lain-architecture"><img src="https://agentmods.dev/badge/skills/spuentesp/lain/lain-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.00571
Opus 5.5 $0.00024 $0.00228
Sonnet 5.5 $0.00012 $0.00114
Haiku 4.5 $0.00006 $0.00057

Measured 19d ago against content hash 920799c0ea49, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lain-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 19d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lain-architecture/SKILL.md · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lain architecture — map the system

The arch package answers shape questions the core deliberately does not. Load it when the question is about structure rather than one symbol.

Load it

Call load_package("arch") (or set LAIN_TOOL_PROFILE=arch at config time). If the tools do not appear in your list, reconnect the client and refetch. The raw package (load_package("raw")) adds the low-level layer.

The tools

  • explore_architecture — file/module tree to a chosen depth. Start here for "what does this subsystem look like".
  • compare_modules — stability and coupling of two modules side by side. Use for "which of these do we refactor first".
  • architectural_observations — patterns, boundary violations, high-fan-out hot spots. Use for architecture review, not for one change.
  • trace_dependency — everything a symbol depends on, recursively. The upstream question; the downstream one is get_blast_radius.
  • get_layered_map / get_context_depth — slices of the stack from an entry point; how deep a symbol sits.
  • navigate_to_anchor / get_anchor_score — climb from a leaf to its controlling anchor; how load-bearing one symbol is.
  • get_master_map — staleness: when each module last synced. Read this before trusting a stale-looking answer.
  • suggest_refactor_targets — complexity + stability hot spots.

raw package, when the high-level tools are not enough: query_graph (JSON ops-array against the graph — read describe_schema first), get_code_snippet, get_call_sites (every call with its line), explain_symbol, get_context_for_prompt, get_cross_runtime_callers, semantic_search (needs a model).

Rules of thumb

  • Depth fields take a number (3) or a range ("1..3").
  • A layered map is for shape; do not use it to answer "who calls this" — that is get_call_chain.
  • query_graph is the escape hatch, not the first tool. Its schema is in describe_schema; prefer the named tools unless you need a traversal nobody anticipated.

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 19d ago First seen · 53 lines · 60 tokens per session scan A 920799c0ea49

Subscribe to this mod's changes

lain-architecture is a skill published in the GitHub repository spuentesp/lain (9 stars, last pushed 2d ago), licensed MIT. It adds 60 tokens to every session and 571 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.

Related

Other skills, from other repositories

lsp-mcp-server

Use with Codex, Claude Code, or another MCP client when lsp-mcp-server is connected and semantic code navigation, analysis, refactoring, or diagnostics are needed. Covers all 29 lsp tools for TypeScript, Python, Rust, Go, C/C++, Ruby, PHP, Elixir, Kotlin, Java, and user-configured languages. Prefer these tools to text…

ProfessioneIT/lsp-mcp-server · 108 tokens

explore

Build an accurate mental model of an unfamiliar codebase, feature, or area before changing it — where it lives, how it connects, what it does, and why. Use when asked how something works, where something is, when onboarding to a repo, or before editing code you don't know. For a cross-cutting question that needs…

TheWinci/mimirs · 79 tokens

debug

Trace a bug, error, or regression to its root cause. Use when investigating a failure, a stack trace, unexpected behavior, or "why does X happen".

TheWinci/mimirs · 35 tokens

speclite-review-adversarial-general

A general review skill that critically examines code, specifications, stories, diffs, or documents for gaps, contradictions, risks, and unclear claims. It returns a Markdown list of findings.

flanliulf/SpecLite · 76 tokens

speclite-review-edge-case-hunter

A review skill that traces code branches and lists only edge cases the code does not handle. It checks inputs such as diffs, files, or functions and returns findings as JSON.

flanliulf/SpecLite · 71 tokens

debug-ci

Use when CI/CD pipeline fails. Provides systematic diagnosis for lint, type, test, and build failures across Python, TypeScript, Java, Rust, and n8n SDKs.

open-metadata/ai-sdk · 40 tokens