reviewing-architecture
Skill1 starsChanged 4 months agoMITView on GitHub
Performs a high-level architectural review evaluating structural health, design principles, and long-term maintainability. Use when the user says "AR", "architecture review", or "architectural review". Distinct from line-level code review. Produces a numbered findings report, waits for terse directives (fix/stet/GH), then implements approved refactors.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- doneyli/ch-sa-sidekick-templatetheir own version, first seen Mar 5, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- doneyli/ch-sa-sidekick-template★ 1same 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 repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adopting-dependabotSkill
- auditing-ci-costSkill
- coordinating-epicsSkill
- curating-contextSkill
- deploying-releasesSkill
- enforcing-architectureSkill
- init-project-fastapiSkill
- init-socraticodeSkill
- maintaining-host-diskSkill
- managing-skillsSkill
- orchestrating-issue-backlogSkill
- patching-hostsSkill
- reviewing-code-phpSkill
- reviewing-code-python-clickSkill
- reviewing-code-python-fastapiSkill
- reviewing-codeSkill
- shipping-workSkill
- using-git-worktreesSkill
- using-mayfly-chatSkill
- vendoring-openapi-clientSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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 24
If you haven't run gather-context.sh and surveyed the actual current architecture, you have not completed Phase 1.
- Distinctive: line 25
If the user hasn't responded with directives, you cannot implement anything.
- Distinctive: line 73
Read AGENTS.md, README.md, and project layout documentation — note the *documented* architecture so Phase 2 can check the real one against …
- Distinctive: line 75
Read key files: settings, routing, models, entry points, service configs
- Distinctive: line 96
Test architecture — isolation seams, coverage by layer, missing unit tier
- Distinctive: line 130
If any refactor was prototyped in this conversation, re-run the test suite and report failures as 🔴 findings regardless of cause
- Distinctive: line 131
Do NOT claim a structural problem exists unless you have output from this session (file listing, dependency trace, line count) confirming it
- Distinctive: line 153
After directives, implement all requested changes.
- Distinctive: line 167
If the review leads to structural changes:
≈ “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
Architectural Review
A high-level review of application architecture: structural health, design principles, and long-term maintainability. Distinct from line-level code review.
Activation triggers: AR (shorthand for architecture review), "architecture review", "architectural review".
The Iron Law
NO FINDINGS REPORT WITHOUT RUNNING GATHER-CONTEXT FIRST
NO CHANGES WITHOUT A FINDINGS REPORT AND EXPLICIT USER DIRECTIVESIf you haven't run gather-context.sh and surveyed the actual current architecture, you have not completed Phase 1.
If the user hasn't responded with directives, you cannot implement anything.
Rationalization prevention
| Thought | Reality |
| "This is a strategic review, no need for detailed evidence" | Without specific code/structure citations, findings are opinions. Cite the modules that triggered each finding. |
| "I already understand this architecture" | Familiarity bias. Re-survey the actual current state, not your remembered version — directory trees and dependency graphs change. |
| "Tests pass, that's the architecture" | Tests verify behavior, not coupling, cohesion, layering, or scalability. |
| "I'll suggest a refactor as I go" | Phase 4 exists. Present findings first; user picks which refactors warrant doing. |
| "This module wasn't in the diff" | Architecture review crosses boundaries — call graphs, dependency direction, layering. The diff is the trigger, not the scope. |
| "The user seems in a hurry" | A fast bad architecture pivot is slower than a thorough correct one. |
| "I listed the exact lines — that's as specific as it gets" | Lines move; the command that found them doesn't. Record the grep beside the conclusion so the reader re-runs it instead of trusting a snapshot. |
Parameterized invocation
Trigger phrases may include scope inline — e.g., AR services/, architecture review routers/, AR #22. Apply the appended context as the explicit scope (step 1 of Scope detection); skip the conversation-context and full-project fallbacks.
Scope detection
Determine what to review (priority order):
- Explicit scope — apps, modules, layers, or areas of concern specified by the user
- Conversation context — if recent work touched a subsystem, review that subsystem
- Full project — if no scope is given or implied, review the entire project
- Ask — if scope is ambiguous, ask before proceeding
Procedure
Phase 1 — Gather context
<!-- skill:required id=skill-scripts -->N=reviewing-architecture S=gather-context.sh SD=
{ [ ! -x .skills/doctor.sh ] || bash .skills/doctor.sh; } || exit 1
for d in scripts ".claude/skills/$N/scripts" "$HOME/.claude/skills/$N/scripts"; do
[ -f "$d/$S" ] && { SD="$d"; break; }
done
[ -n "$SD" ] || echo "$S not found in scripts/, .claude/skills/$N/scripts/, or ~/.claude/skills/$N/scripts/" >&2
bash "${SD:?}/$S"The first line is a preflight: when .skills/doctor.sh is present, it heals any dangling vendor symlinks (or reports an actionable error); when absent, the group is a no-op. || exit 1 skips gather-context.sh if the doctor reports unrecoverable state so the original "No such file or directory" noise doesn't drown out the doctor's message. The loop then resolves the script against the skill directory rather than the cwd — a bare scripts/ path resolves relative to the project root, where the script does not exist (#63). A project-local scripts/ copy still wins if one exists; when no candidate resolves, the block stops, naming the script and the searched paths. Resolution runs after the doctor so a freshly healed symlink chain is visible to it.
gather-context.sh prints more than a file listing: internal import fan-in (which modules the system leans on), churn hotspots, and temporal coupling (files that change together) mined from the git log. Read those sections — they are the coupling and decay evidence the rest of the review cites.
When SocratiCode is indexed for this project, use its graph tools for real dependency edges the static snapshot cannot give — codebase_graph_circular (import cycles), codebase_graph_query (fan-in/fan-out for a module), codebase_impact (blast radius of a change), codebase_graph_visualize (layering overview). A coupling or dependency-direction finding backed by graph output is evidence; one backed by eyeballing a file tree is an opinion.
Also:
- Read AGENTS.md, README.md, and project layout documentation — note the documented architecture so Phase 2 can check the real one against it (drift)
- Survey the full directory tree; identify all modules, apps, and layers
- Read key files: settings, routing, models, entry points, service configs
- Review dependency manifest (
pyproject.toml,package.json, etc.) for health
Phase 2 — Analyze
Evaluate against these dimensions. See references/dimensions.md for the Look for / How to find it / Example finding detail on each — use it; it is what keeps findings evidence-backed.
Altitude rule (what makes this not a code review): Could a reviewer find it by reading one file? If yes, it belongs to reviewing-code, not here. Report the structural cousin — duplicated responsibility not duplicated lines, resilience architecture not a bare except, a data-access pattern not a single N+1.
- Separation of concerns & boundaries — logic leaking across layers; missing domain seams
- Coupling & dependency direction — cycles, layering violations, poor evolvability
- Service contracts & interface stability — breaking API/schema changes at boundaries, client/spec drift
- Module size & cohesion — size as a proxy for a module doing too many jobs (>300 scrutinize, >500 split)
- Resilience & failure architecture — timeouts, retries, circuit breakers, blast radius of one failure
- Scalability & data-access patterns — pagination, async offload, patterns that break at 10×/100×
- Observability — correlation IDs, structured logs, metrics/tracing at boundaries
- Trust boundaries & security architecture — where authz lives, tenant isolation, secrets flow (structural slice only; line-level →
security-review) - Configuration & environment — secrets management, config flow, 12-factor
- Schema & data-model health — constraints, normalization, migration hygiene
- DRY of responsibility — the same decision owned in two places that must change together
- Naming & discoverability — layout that lets a newcomer predict where things live
- Test architecture — isolation seams, coverage by layer, missing unit tier
- Architecture drift — does the real structure match AGENTS.md's documented one?
Where a coupling/layering/contract finding is accepted, consider whether it can graduate into an executable fitness function (import-linter, dependency-cruiser, deptrac, a module-size gate, or an OpenAPI diff gate) so it can't silently regress — see the end of references/dimensions.md. Surface it as the finding's suggested approach; never adopt one unprompted. When the user opts in (see the fitness directives below), delegate the actual generation and wiring to enforcing-architecture via the Skill tool, handing off the finding's rule, scope, and stack.
Phase 3 — Present findings
Required report structure:
## Architectural Review — [scope]### Architecture summary— 2–4 sentence description of current architecture (shared context for findings)### What's solid— genuine architectural strengths worth preserving### Findings— numbered findings grouped by severity- Group by severity: 🔴 Structural problems → 🟡 Design improvements → 💭 Observations & opportunities
- Numbered findings are sequential across ALL severity groups — never reset
- Sub-items under a single finding use
2a.,2b.etc. ### Summary— 1–2 sentences on overall architectural health and top priorities
Each finding within ### Findings must follow this format:
N. [module/file] What: <precise description with file/module reference>. Evidence: <the command, query, or gather-context section that produced the citation, written so the reader can re-run it —
rg -n "is StreamProvider\." src/,codebase_graph_circular, the=== File sizes ===block>. Why it matters: <architectural impact: maintainability? performance? correctness?>. Suggested approach: <concrete refactoring direction — name new modules, describe the split, sketch the pattern>. Effort/Blast radius: <rough cost and reach of the fix: how many modules move, and is it reversible or a one-way door>.
All five labels (What:, Evidence:, Why it matters:, Suggested approach:, Effort/Blast radius:) are required in every finding, verbatim. The severity marker (🔴/🟡/💭) ranks how bad the problem is; Effort/Blast radius: is a separate axis for how expensive and risky the fix is — a user triaging refactors needs both, because "severe but cheap and reversible" and "severe but a risky migration" warrant different decisions.
Evidence: records how the citation was obtained, not a second copy of where it points. A finding whose grep travels with it can be re-run by whoever implements it, months later, in a second; a finding carrying only the conclusion has to be re-derived, and re-derivation is the step that gets skipped. Where the finding rests on reading rather than on a command, say so — "read settings.py end to end" is honest evidence; a grep reconstructed for the report is not.
Shelf life — lead with the invariant. A finding's file:line specifics are evidence-of-the-moment, not specification. Findings become issue bodies read later, after other findings from the same review have been implemented, so staleness is not random: it is proportional to how deep in the execution order a finding sits, and it is worst exactly where the work is hardest. Phrase What: so the durable claim leads and the specifics merely evidence it — "every provider branch is inline at the call site" survives a refactor that "seven is X checks, at lines 40, 88, 133…" does not. Keep the specifics, mark them as observed at review time, and treat line numbers as evidence rather than as specification; Evidence: is what the implementer re-runs. (Measured: a 13-issue backlog carved from one such review carried a material error in every issue body by implementation time — one finding's branch-point table was 5 of 7 stale when its batch ran, because an earlier batch in the same backlog had changed the column type. See orchestrating-issue-backlog, 2026-08-09.)
Phase 3.5 — Verify before reporting
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION- Each finding must cite a specific module, file, or directory — not a generic claim about "the architecture" — and its
Evidence:must be the command you actually ran to reach that citation, not one reconstructed afterwards to look rigorous. If you cannot name what produced the citation, you do not have a finding yet - If any refactor was prototyped in this conversation, re-run the test suite and report failures as 🔴 findings regardless of cause
- Do NOT claim a structural problem exists unless you have output from this session (file listing, dependency trace, line count) confirming it
Phase 4 — Wait for feedback
Stop. Do not make changes until the user responds.
Accept terse directives referencing item numbers:
| Directive | Meaning |
1: fix | Implement the suggested refactoring |
3: stet | Leave as-is (acknowledged, no action) |
5: fix, but use X approach | Refactor with the user's preferred approach |
4: fix + fitness | Refactor, then graduate the rule into an executable fitness function (delegates to enforcing-architecture) |
6: fitness | Encode the rule as a fitness function without a refactor — the architecture is already correct, just lock it so it can't regress (delegates to enforcing-architecture) |
2: document as TODO | Add a code comment or AGENTS.md note instead of fixing |
7: investigate further | Gather more information before deciding |
8: ADR | Record the decision as an Architecture Decision Record (capture the why, not just the change) |
10: GH | Create or update a corresponding GitHub issue |
For fix + fitness and bare fitness, invoke the enforcing-architecture skill (Skill tool) once the tree satisfies the rule, handing off the finding's rule, scope, and stack. For fix + fitness, complete the refactor first.
After directives, implement all requested changes. Before committing, run the test suite and confirm it passes — report any failures before committing. Then commit and present a summary table:
| Item | Action | Result |
| 1 | Fixed | Split services/parser.py → parser.py + recovery.py |
| 3 | Stet | — |
| 10 | GH | Issue #22 created |
Second review rounds
Continue numbering from where the previous round ended. Never reset.
Documentation sweep
If the review leads to structural changes:
- AGENTS.md project layout and architecture sections
- README.md if module boundaries or service topology changed
- Module-level docstrings affected by refactoring
- An ADR (if directed) capturing why the change was made — the decision, the alternatives, the tradeoff — so the next reviewer inherits the reasoning, not just the result
Self-budget: held to a 6,000-token ratchet (estimate and exact) by
tests/structural/test_skill_self_budget.py — both readings must clear it, so
no choice of measurement can loosen it.
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.

