agentleFS
spuentespspuentesp/lain/skills/lain-architecture/SKILL.md

lain-architecture

Skill9 starsChanged 2 months agoMITView on GitHub

Use for system-shape questions through Lain — "map this subsystem", "compare these modules", "trace the dependency chain", "how deep is this in the stack", "where is the god object", "run a raw graph query". Covers the arch and raw packages.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call load_package("arch") (or set LAIN_TOOL_PROFILE=arch at config time).

    line 14

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.