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
- caidanw/skillstheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 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.
- adr-mdSkill
- briefSkill
- glossary-mdSkill
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
- Very specific: line 15
Observed or inferred: Every fact cites path:line or path:start-end.
- Distinctive: line 38
exhaustive: all of that, plus every endpoint, command and topic in Components, every dependency with its version in Technology stack, every …
- Distinctive: line 44
If the request already says to go ahead without asking, that counts as the yes for every confirmation: take the default, say which choice …
- Distinctive: line 51
Existing doc: If the output file exists, follow regenerate.md up to its choice.
- Distinctive: line 56
Check and save: Run the checks in quality.md and fix what they find.
≈ “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.
Files
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:lineorpath: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.mdorTERMINOLOGY.md, at the root or indocs/) sets what things are called. Name concepts with its terms; where the code uses another name, give the mapping once (classTask, 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]
| Option | Default | Effect |
| path | Root of the current git repo, else the current folder | What to document |
--level | comprehensive | See Levels |
--sections | All | New 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 |
--output | An existing ARCHITECTURE.md under the path (docs/, then the root), else docs/ARCHITECTURE.md | Where the doc goes |
--verify | Off | Independent check of the finished doc before it is saved (quality.md) |
--stride | Off | STRIDE 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.
- 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 (elsenone). 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. - Existing doc. If the output file exists, follow regenerate.md up to its choice. On cancel, stop.
- Estimate. Count and estimate as in explore.md; show the numbers and ask to continue.
- Explore. Map, divide, merge and trace as in explore.md.
- 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.
- 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.
- 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
| File | Read it |
| regenerate.md | At step 2, only when the doc exists |
| explore.md | Before step 3 |
| sections.md | Before step 5 |
| quality.md | Before step 6 |
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
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.

