agentleFS
iuryszaiurysza/agent-skills/skills/architecture-knowledge-base/SKILL.md

architecture-knowledge-base

Skill5 starsChanged 11 days agoMITView on GitHub

Creates source-backed architecture documentation shaped around the codebase and its readers. Use when asked to document a system, explain project architecture, map important flows, or turn an implementation into a navigable knowledge base.

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 16 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the repository instructions, existing docs, source, tests, configuration, and relevant history.

    line 29
  2. Distinctive:

    Document the system as it exists.

    line 31
  3. Distinctive:

    Ask the user only when a missing product or architecture decision would force speculation.

    line 33
  4. Very specific:

    Read any existing ai-artifacts/CONTEXT.md or ai-artifacts/CONTEXT-MAP.md before naming concepts.

    line 37
  5. Very specific:

    Keep agent-authored project knowledge under ai-artifacts/ unless the user or repository requires another location.

    line 47
  6. Distinctive:

    Do not give every module equal coverage.

    line 74
  7. Distinctive:

    Use explicit evidence labels when a document mixes different confidence levels:

    line 80
  8. Distinctive:

    Do not force these markers into prose when the distinction is already clear.

    line 89
  9. Distinctive:

    Add Mermaid or ASCII diagrams when a relationship, sequence, state model, boundary, or data flow is easier to understand visually.

    line 93
  10. Distinctive:

    Keep each visual close to the prose it supports.

    line 95
  11. Distinctive:

    Create an ADR when a decision is hard to reverse, surprising without context, and based on a real trade-off.

    line 99
  12. Distinctive:

    If the repository proves what was implemented but not why it was chosen, document the implementation elsewhere or mark the rationale …

    line 101
  13. Distinctive:

    When the work produces multiple documents, connect them with normal GitHub-compatible relative Markdown links.

    line 105
  14. Very specific:

    Add concise YAML description frontmatter when the repository or knowledge-base convention uses it.

    line 107
  15. Distinctive:

    Consider adding a short link from the main README.md when the new documentation is useful to the README's audience.

    line 109
  16. Distinctive:

    Use plain, precise technical English.

    line 113
  17. Distinctive:

    Do the glossary, architecture prose, and conceptual diagrams use the same resolved domain terms?

    line 123
  18. Distinctive:

    Do links, paths, symbols, and diagrams work?

    line 125
  19. Distinctive:

    Run the narrowest relevant formatting, documentation, lint, type, or test checks.

    line 129

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

Build the documentation that best explains this codebase. Do not reproduce a standard architecture pack by default. Let the system's real boundaries, risks, and reader needs determine the result.

Use supporting skills as lenses

Load relevant skills when they are available. Useful options include:

  • domain-modeling to resolve domain terms and maintain the shared glossary as described below
  • type-breakdown for types, execution, effects, and errors
  • adr for durable decisions
  • technical-writing for structure and plain language
  • mermaid-diagrams for visual explanations
  • coding-standards for boundaries, dependencies, and failures
  • deslopify or unslop for editing
  • a knowledge-base skill for navigation and progressive disclosure

These skills offer methods, not mandatory deliverables. Use only what helps. Do not install missing skills or block the work because one is unavailable.

Start with the codebase

Read the repository instructions, existing docs, source, tests, configuration, and relevant history. Find the questions a new maintainer would struggle to answer. Trace important behavior from real entry points to real effects.

Document the system as it exists. Use exact names from the repository. Distinguish confirmed behavior from inference, recommendation, and uncertainty whenever readers could confuse them.

Ask the user only when a missing product or architecture decision would force speculation. Answer repository questions by inspecting the repository.

Build shared domain language

Read any existing ai-artifacts/CONTEXT.md or ai-artifacts/CONTEXT-MAP.md before naming concepts. When terms are overloaded or distinctions matter to understanding the system, load domain-modeling if available and use it during the source trace, not only as a final writing check.

Test the terms against concrete edge cases. Can a candidate exist without a selection? Can a target lie outside the search root? Use scenarios from the codebase to distinguish concepts that sound interchangeable. Check the answers against source and tests. Surface contradictions with existing definitions; ask only when resolving them requires a product decision.

Record resolved terms as you go in the relevant context glossary. For a single context, create ai-artifacts/CONTEXT.md when the first useful distinction is resolved. Keep definitions short, choose canonical names, and identify misleading alternatives. Follow domain-modeling's CONTEXT-FORMAT.md when available. Keep runtime details in the architecture explanation, not the glossary.

Link the glossary from the architecture explanation and use its terms consistently in prose and conceptual diagrams. A small embedded domain diagram can clarify relationships without repeating the implementation flow. Create a context map only for genuinely separate contexts. Do not force a glossary, context map, or ADR when none adds useful knowledge.

Choose the right shape

Keep agent-authored project knowledge under ai-artifacts/ unless the user or repository requires another location.

Choose the smallest structure that explains the system well. A compact project may need one document. A larger system may benefit from separate domain context, architecture explanations, flow references, decision records, or an index. Create a navigation page only when there is enough material to navigate.

Possible artifacts include:

  • a map of the system and its boundaries
  • a glossary of terms that are easy to confuse
  • an explanation of an important runtime flow
  • a reference for types, states, effects, and failures
  • a record of a durable architectural decision
  • a guide that routes readers to existing documentation

This list is a menu, not a checklist. Combine, split, rename, or omit artifacts according to the codebase. Do not create empty sections, speculative prose, or documents whose only purpose is to satisfy a template.

Follow the important ideas

Spend detail where the system earns it. Look for:

  • boundaries where data, control, trust, or ownership changes
  • entry points and effects that define the product's behavior
  • state transitions, concurrency, retries, cancellation, or recovery
  • types and validation that protect important invariants
  • failure paths that operators or callers need to understand
  • dependencies that constrain future changes
  • decisions whose rationale is not obvious from the code

Do not give every module equal coverage. Explain the architecture, not the directory tree.

Make evidence visible

Ground claims in source, tests, configuration, or repository history. Link to files or name symbols when that helps readers verify a statement.

Use explicit evidence labels when a document mixes different confidence levels:

[existing]  Confirmed in the repository
[inferred]  Implied by the implementation
[proposed]  A recommendation, not current behavior
[?]         Unresolved

Do not force these markers into prose when the distinction is already clear. Never invent rationale, alternatives, line numbers, or behavior.

Use visuals when they clarify

Add Mermaid or ASCII diagrams when a relationship, sequence, state model, boundary, or data flow is easier to understand visually. Choose the diagram from the explanation. Do not start with a required diagram inventory.

Keep each visual close to the prose it supports. Use domain language for conceptual views and implementation names for technical views. Prefer a small diagram that answers one question over a complete diagram nobody can read. Validate Mermaid that you add.

Record decisions only when the evidence supports them

Create an ADR when a decision is hard to reverse, surprising without context, and based on a real trade-off. Keep one decision per record and connect it to related documentation.

If the repository proves what was implemented but not why it was chosen, document the implementation elsewhere or mark the rationale unresolved. Do not manufacture alternatives to complete an ADR template.

Build useful navigation

When the work produces multiple documents, connect them with normal GitHub-compatible relative Markdown links. Put links in sentences that explain what the reader will find and why it matters. Use progressive disclosure so an entry page routes readers without repeating the detailed documents.

Add concise YAML description frontmatter when the repository or knowledge-base convention uses it. Keep terminology and claims consistent across the set.

Consider adding a short link from the main README.md when the new documentation is useful to the README's audience. Do not rewrite unrelated README content or expose secrets, credentials, private setup details, internal release procedures, or sensitive operations.

Write for maintainers

Use plain, precise technical English. Prefer real symbols and concrete behavior over generic architecture language. Use active voice, focused paragraphs, and headings that help readers answer questions. Explain important limitations and failures directly.

The documentation should help someone reason about a change. It should not merely prove that documentation exists.

Review the result

Review the work against its purpose rather than a fixed inventory:

  • Does the structure fit this codebase and its likely readers?
  • Are the important boundaries and flows easier to understand?
  • Do the glossary, architecture prose, and conceptual diagrams use the same resolved domain terms?
  • Can readers tell evidence from inference or advice?
  • Do links, paths, symbols, and diagrams work?
  • Does each artifact earn its place?
  • Did the work preserve existing documentation and user changes?

Run the narrowest relevant formatting, documentation, lint, type, or test checks. Fix failures caused by the documentation change. Report unrelated or pre-existing failures without changing unrelated code.

Finish with a short account of what you created, what it helps readers understand, what you verified, and what remains uncertain. Do not commit or push unless the user explicitly asks.

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.