agentleFS
cdvelcdvel/architecture-skills/skills/architecture-md/SKILL.md

architecture-md

Skill4 starsChanged 52 days agoMITView on GitHub

Writes a detailed ARCHITECTURE.md for a repository by reading the code itself (components with file tables, C4 diagrams in ASCII, infrastructure, CI/CD, traced data flows, security and threats, configuration, data stores), saved under docs/ by default, and updates only the changed sections when the doc already exists. Use when asked to document a codebase's architecture, write or regenerate ARCHITECTURE.md, map an inherited or legacy codebase, write onboarding or architecture-review docs, or write down what is deployed and how auth works, for example "document the architecture of this repo", "regenerate our ARCHITECTURE.md", "map this codebase with C4 diagrams". Not for a quick overview in chat (brief), recording one decision as an ADR (adr-md), glossary terms (glossary-md), README edits, a single diagram, API reference from docstrings, explaining C4 in general, or refactoring.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. caidanw/skills★ 11same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Observed or inferred: Every fact cites path:line or path:start-end.

    line 15
  2. Distinctive:

    exhaustive: all of that, plus every endpoint, command and topic in Components, every dependency with its version in Technology stack, every …

    line 38
  3. Distinctive:

    If the request already says to go ahead without asking, that counts as the yes for every confirmation: take the default, say which choice …

    line 44
  4. Distinctive:

    Existing doc: If the output file exists, follow regenerate.md up to its choice.

    line 51
  5. Distinctive:

    Check and save: Run the checks in quality.md and fix what they find.

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

architecture-md

One detailed ARCHITECTURE.md written from the code, for onboarding, reference, architecture or security review, and pre-production checks. An existing doc gets only its changed sections rewritten; hand-written notes stay.

Ground rules

  • Read-only. The only file written is the ARCHITECTURE.md (creating its folder if needed). Git is used read-only: HEAD, remote, tags, log, diff, file list. Never run builds, tests, installs, migrations, deploys or the code itself.
  • Static reading. Missing evidence never stops the run; it becomes a marked gap (quality.md).
  • Code over docs. READMEs, wikis and comments are leads. Where they contradict the code, the doc follows the code and notes the conflict with both citations.
  • Observed or inferred. Every fact cites path:line or path:start-end. Every inference starts with Inferred: and names what it rests on. Nothing unmarked is a guess.
  • Glossary for names, code for facts. A glossary (GLOSSARY.md or TERMINOLOGY.md, at the root or in docs/) sets what things are called. Name concepts with its terms; where the code uses another name, give the mapping once (class Task, the glossary's job). Where the code contradicts a definition, the doc follows the code and notes the conflict with both citations. Never define a glossary term in the doc, not even in passing or in a vocabulary line; link the glossary instead. A conflict note quotes only the disputed words. Never write to the glossary. No glossary is not a gap: names follow the code.

Options

Taken from arguments or from plain words in the request ("exhaustive", "only security and data flows").

architecture-md [path] [--level comprehensive|exhaustive] [--sections a,b,c] [--output file] [--verify] [--stride]

OptionDefaultEffect
pathRoot of the current git repo, else the current folderWhat to document
--levelcomprehensiveSee Levels
--sectionsAllNew doc: only these sections are written; the doc lists the rest as skipped. Existing doc: only these are rewritten; the rest are copied as stable
--outputAn existing ARCHITECTURE.md under the path (docs/, then the root), else docs/ARCHITECTURE.mdWhere the doc goes
--verifyOffIndependent check of the finished doc before it is saved (quality.md)
--strideOffSTRIDE threat table per trust boundary instead of the baseline list (sections.md)

Levels

Both levels are detailed. They differ by content, not line counts.

  • comprehensive (default): every applicable section, all four C4 levels, a file table per component, data flows at wire level, the threat table.
  • exhaustive: all of that, plus every endpoint, command and topic in Components, every dependency with its version in Technology stack, every TODO, FIXME and HACK marker in Open work, longer code excerpts, and none of the size caps in quality.md.

Confirmations

The run asks before acting on an existing doc (step 2), after the time estimate (step 3), and when the update guardrail trips (regenerate.md). Ask in plain text, or with the harness's question tool if it has one, and name the default.

If the request already says to go ahead without asking, that counts as the yes for every confirmation: take the default, say which choice was taken, and continue.

Run

Show the phases (in the harness's task list if it has one) and one line per unit explored and per section written.

  1. Inputs. Resolve path, level, sections and output. Record HEAD (full and short SHA), the remote URL with any embedded credentials removed (else none), and the release version from release manifests or package files (else none). If source files have uncommitted changes, say so: the doc reads the working tree but records HEAD. Read the glossary if there is one; if there are several, read them all. Announce path, level, sections, output and the glossary used, if any.
  2. Existing doc. If the output file exists, follow regenerate.md up to its choice. On cancel, stop.
  3. Estimate. Count and estimate as in explore.md; show the numbers and ask to continue.
  4. Explore. Map, divide, merge and trace as in explore.md.
  5. Plan. Build this repo's outline from sections.md: drop sections that don't apply (say which and why), mark thin ones as gaps, announce the outline.
  6. Write. Write sections in the order sections.md sets, from the merged findings, marking gaps as quality.md shows. With subagents, sections that don't depend on each other can be written in parallel, each subagent given the findings, the glossary terms, sections.md and quality.md; otherwise write them one after another.
  7. Check and save. Run the checks in quality.md and fix what they find. Then write the file once and report.

Report

End with, in chat: output path, level, commit and mode (new, update or rewrite); sections written, updated, copied unchanged and skipped; the number of gaps with the most important open questions; uncovered files; the glossary used, or that none was found and glossary-md can start one; terms that several glossaries define differently, suggesting glossary-md to merge them; conflicts between docs and code, the glossary included; the --verify result if it ran; any size warning from quality.md.

References

FileRead it
regenerate.mdAt step 2, only when the doc exists
explore.mdBefore step 3
sections.mdBefore step 5
quality.mdBefore step 6

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.