agentleFS
okeefecookeefeco/pyeye-mcp/.claude/skills/architecture-review/SKILL.md

architecture-review

Skill1 starsChanged 11 days agoMITView on GitHub

Use when reviewing a Python codebase's architecture against what it has recorded — "review the architecture", "audit conventions", "does this area follow our decisions", "where does this code disagree with itself", "find inconsistent error-handling/layering/validation patterns". Reviews ONE area against its architecture facts, CHECK rules and decision entries, and reports adherence, deviation, decisions needed and ambiguity, each anchored. A resolved item becomes a decision entry (and, where it can be checked, a CHECK line), so each run leaves less to judge. Needs a docs-facts config with the structure kind; without recorded architecture it says so. Does NOT find duplicated code (that is duplication-review) and does NOT map the architecture (that is /arch-facts).

91 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use create-stories, story-done and 10 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.
  • lilangMaxSkill

    create-stories

    Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.

    Also in 12 projects that use this

  • lilangMaxSkill

    story-done

    End-of-story completion review. Reads the story file, verifies each acceptance criterion against the implementation, checks for GDD/ADR deviations, prompts code review, updates story status to Complete, and surfaces the next ready story from the sprint.

    Also in 12 projects that use this

  • +10 more from lilangMax

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 83 edited versions we read keep these.

  • 0

    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. Very specific:

    Plan: Run plan AREA and save the packet to a scratch file.

    line 71
  2. Very specific:

    Report: Run report and present it to the user verbatim, in its order:

    line 81
  3. Very specific:

    Draft a CHECK line: when the decision is one an existing rule kind can check.

    line 109

“Common” is measured: kept by at least 6 in 10 of the 83 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

Review one area of a codebase against its recorded architecture: the architecture facts pyeye extracted, the CHECK rules on its architecture pages, and its decision entries. Every finding is one of four outcomes, each anchored, and the maintainer decides what happens next. Each decision becomes a record the next run checks, so the review leaves less to judge every time.

What This Is (and Is NOT) — Read First

  • It compares the code with records, never with itself alone. A deviation always names the rule, decision or convention it deviates from. Where no record covers a pattern, the finding asks for a decision; it never picks one.
  • The tool never decides. Nothing is written, no rule and no decision entry, without the maintainer.
  • It needs recorded architecture. It reads the repository's docs-facts snapshot: the structure kind's facts (/arch-facts makes them). Without them, the plan says "no recorded architecture for this area; run /arch-facts first", and you stop there.
  • Not duplication. Copied code is duplication-review.

The Four Outcomes

OutcomeMeansRests onWay forward
adherencethe code follows a recorded rule, decision or conventionthat recordnone: a confirmation
deviationthe code contradicts onethat recorda recommendation
decision_neededno record covers it, and one pattern is clearly the normthe evidence (a fact or a symbol)the question, and one proposed decision
ambiguityno record covers it, and several patterns competethe evidencethe question, 2–3 options with costs, and a recommendation on an anchor or an "unanchored: judgment only" assessment

Running It

The engine is python -m pyeye.docs_facts architecture. Run it from the repository root. Through the plugin:

if [ -n "${CLAUDE_PLUGIN_ROOT}" ]; then  # the plugin's environment
  CLAUDE_PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT}" CLAUDE_PLUGIN_DATA="${CLAUDE_PLUGIN_DATA}" \
    uv run --no-project python "${CLAUDE_PLUGIN_ROOT}/scripts/plugin_runtime.py" \
    python -m pyeye.docs_facts architecture plan AREA
else  # pyeye's own repository, where this is a project skill: the checkout's environment
  uv run --project "$(git rev-parse --show-toplevel)" --frozen \
    python -m pyeye.docs_facts architecture plan AREA
fi

Otherwise, any environment with pyeye-mcp installed: python -m pyeye.docs_facts architecture …. Every command prints JSON.

CommandDoes
plan AREA [--decisions-dir D] [--convention PATH ...]The area's packet: its facts, the rules in scope (already run), the candidate decisions, and the mechanical findings.
validate FINDINGS --packet PACKETEach invalid finding's problems; exit 1 when any.
report FINDINGS --packet PACKETThe ranked report, with the mechanical findings and the valid reviewer ones.

AREA is an area ID from the structure kind's areas (inline or a data file), or else a module prefix (pkg.core covers pkg.core and pkg.core.*). It is required: never review the whole repository at once.

--convention PATH: for a repository with no decision entries, its convention document (AGENTS.md, CONTRIBUTING.md) is the prose anchor. Pass it, repeatable.

The Review Loop

  1. Plan. Run plan AREA and save the packet to a scratch file. If its notes say there's no recorded architecture, tell the user and stop.
  2. Dispatch the reviewer, one fresh subagent for the area, with reviewer.md and the packet. It reads the packet's facts and the candidate decisions, uses pyeye for evidence with targeted reads only, and returns a JSON array of findings, nothing else.
  3. Validate. You run it, never the reviewer: write the findings to a scratch file and run validate FINDINGS --packet PACKET. A finding with problems goes back to the reviewer with the problems quoted; never fix it up yourself.
  4. Report. Run report and present it to the user verbatim, in its order:

    1. rule deviations;
    2. deviations from decisions and conventions;
    3. decisions needed;
    4. ambiguities;
    5. adherence, as a count, with the findings on request.

    Then what the review couldn't settle: unverified rules, unresolved decision sites, unassigned modules and coverage gaps. Show each finding's evidence as the report gives it; don't re-narrate it.

  5. The user decides, item by item:
    • a deviation: fix the code, or decide the record changes (then codify the new decision, step 6);
    • a decision needed or an ambiguity: their answer, including "both patterns are acceptable here", is codified (step 6);
    • deferred: nothing is recorded. The item comes back on the next run.

There are no dismissals. Every resolution is a decision entry, and the next run reports adherence to it instead of asking again.

Codify (always on the user's decision)

  1. Write the decision entry through the decision-log skill's flow, which applies in full: its gates, fields and file convention. Pull the question, the evidence and the chosen option from the finding verbatim. Its Applies-to must name the sites the decision governs, by canonical handle (the finding's evidence, and the rest of the area it covers): that is how the next run's plan finds it as a candidate.
  2. Draft a CHECK line when the decision is one an existing rule kind can check. Today that is CHECK no-import: A -> B ("modules under A never import B at runtime"). Show the line and the architecture page it belongs on (a registered page holding the area's other CHECK lines). Add it only when the user confirms. From then on docs_facts check enforces it on every commit, and the review reports adherence or deviation mechanically.
  3. A decision no existing rule kind can express stays a decision entry: future reviews check it. Don't invent a rule kind.

Honesty Invariants

  • No deviation without a record. An unanchored "this looks wrong" is a decision needed or an ambiguity, never a deviation.
  • Prevalence is evidence, never correctness. "Most sites do X" can make a decision needed; it never makes the minority a deviation.
  • Rule outcomes are mechanical. The plan runs the CHECK lines; nobody re-judges them. An unmeasured module leaves a rule unverified, never passing.
  • An unresolved site is reported. A decision site pyeye can't resolve is listed, never treated as "not in this area".

Failure Modes

  • No area given → ask for one.
  • No docs-facts config → plan exits 1, "nothing to check". The repository hasn't set up docs-facts: say so.
  • No recorded architecture → the plan's note; suggest /arch-facts.
  • pyeye unavailable to the reviewer → it can still judge from the packet's facts, but can't check evidence handles; validate will reject unresolved ones. Say the review is reduced.
  • The reviewer returns non-JSON → a contract violation: re-dispatch.

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.