agentleFS
c-w-zc-w-z/commit-decision-record/.agents/skills/review-architecture/SKILL.md

review-architecture

Skill1 starsChanged 5 days agoMITView on GitHub

Use when the user asks for an architecture review, for refactor candidates, or to make the code easier to test or to navigate.

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use review-testing, review-correctness and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • worldbankSkill

    review-testing

    Review test code for quality, design, and completeness after implementing a feature or fixing a bug. Use when the user asks to "review my tests", "check my test quality", "are these tests good enough", "review testing", or after completing a feature implementation that includes tests. Also use when tests feel brittle, flaky, or superficial. Cross-references production code to find coverage gaps.

    Also in 5 projects that use this

  • navjyotnishantSkill

    review-correctness

    Use this skill when the user asks to "review my changes for bugs", "check this diff for correctness", "did I introduce a regression", or wants a correctness-focused review of the current commit or uncommitted work before pushing. Reviews the changed lines and their blast radius for logic errors, regressions, unhandled edge cases, and missing validation. Works in any git repo; nothing here is project-specific.

    Also in 4 projects that use this

  • PydanticSkill

    review-security

    Security review of the current branch against its merge base — sandbox escapes, memory errors, panics and resource-limit bypasses. Use when reviewing changes for security risk, or before merging anything touching the heap/ module, path_security.rs, the wire protocol or the pool.

    Also in 4 projects that use this

  • SentrySkill

    write-tests

    Write tests following project conventions. Use when adding new tests or modifying existing ones.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 9

    Distinctive

    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:

    Use these words for the architecture.

    line 12
  2. Very specific:

    Use the words in docs/design/GLOSSARY.md for the domain.

    line 30
  3. Very specific:

    Read the docs that AGENTS.md lists for the area, and docs/design/GLOSSARY.md.

    line 34
  4. Distinctive:

    If the user named a module or a problem, start there.

    line 38
  5. Distinctive:

    If not, find the hot spots.

    line 39
  6. Distinctive:

    If there is no clear hot spot, look at the largest files and at the code without tests.

    line 43
  7. Distinctive:

    Read the code and its tests.

    line 47
  8. Very specific:

    Keep the vocabulary words above in English.

    line 64
  9. Distinctive:

    If a candidate changes a public interface that other projects or users depend on, say so.

    line 72
  10. Distinctive:

    If a candidate goes against a rejected option, show a warning in the candidate.

    line 73
  11. Distinctive:

    Ask one question at a time.

    line 80
  12. Distinctive:

    If the user rejects a candidate for a reason that stays true, ask if you must add it to the rejected options of the design doc for that …

    line 84

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “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 review

Find modules that are hard to change or to test. Propose refactors that make them deep. The user decides which refactor to do.

Vocabulary

Use these words for the architecture. Do not use "component", "service", "API" or "boundary".

WordMeaning
moduleA thing with an interface and an implementation: a function, a class, a project.
interfaceAll that a caller must know: types, invariants, call order, errors, settings.
depthThe quantity of behavior behind the interface. Deep: small interface, much behavior. Shallow: the interface is almost as large as the implementation.
seamThe place where the interface is. You can change behavior there and not edit the callers.
adapterA concrete thing that satisfies the interface at a seam.
leverageWhat callers get from depth: more behavior for each thing that they learn.
localityWhat maintainers get from depth: a change, a bug and its test stay in one place.

Principles:

  • Deletion test. Imagine that you delete the module. If the complexity goes away, the module was shallow. If the complexity appears again in the callers, keep the module.
  • The interface is the test surface. Tests use the same seam as callers.
  • One adapter is a possible seam. Two adapters are a real seam. Do not add a seam if nothing changes across it.

Use the words in docs/design/GLOSSARY.md for the domain. Do not invent a generic name such as "the data service".

1. Read first

Read the docs that AGENTS.md lists for the area, and docs/design/GLOSSARY.md. Read the rejected options in those docs. Do not propose a candidate that a rejected option already answers.

2. Find where to look

  • If the user named a module or a problem, start there.
  • If not, find the hot spots. A hot spot is a path that changed many times recently:
    git log -40 --name-only --format= | sort | uniq -c | sort -rn | head -15
  • If there is no clear hot spot, look at the largest files and at the code without tests.

3. Explore

Read the code and its tests. Record where you have difficulty:

  • You must read many small modules to understand one concept.
  • A module is shallow.
  • A pure function has tests, but the bugs are in how callers use it.
  • A module must know the internals of a different module.
  • The code has no tests, or its interface makes tests difficult.

Apply the deletion test to each module that looks shallow.

You can give the exploration to a subagent. Give it this skill and the paths from step 2.

4. Report

Give the report in the conversation. Do not write a report file.

  • Give three candidates or fewer. Remove a candidate if its code will not change again soon.
  • Keep the vocabulary words above in English. Use the docs/design/GLOSSARY.md words for the domain.
  • Each candidate has these parts:
    • Files: the files and modules.
    • Problem: one sentence.
    • Solution: one sentence. Do not design the interface yet.
    • Benefits: short items about locality, leverage and tests.
    • Before and after: a short text diagram or a list of the modules and their callers. Show the shallow modules and the deep module.
    • Strength: Strong, Worth exploring or Speculative.
  • If a candidate changes a public interface that other projects or users depend on, say so.
  • If a candidate goes against a rejected option, show a warning in the candidate. Include the candidate only if the difficulty is large.
  • End with the candidate that you recommend first and one sentence of reason.

Then ask the user which candidate to examine.

5. Examine one candidate with the user

Ask one question at a time. Give your recommended answer with each question. If the code can answer a question, read the code and do not ask.

Topics: the limits, the dependencies, the interface of the deep module, what is behind the seam, which tests stay.

If the user rejects a candidate for a reason that stays true, ask if you must add it to the rejected options of the design doc for that area.

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.