agentleFS
farofyfarofy/ignite/skills/review/architecture-review/SKILL.md

architecture-review

Skill0 starsChanged 4 months agoApache-2.0View on GitHub

Review whether code respects the repository's intended architecture, backed by evidence rather than opinion. Reviews the whole system or one feature's diff. Checks the dependency rule of Clean Architecture where it applies, whether a new feature reused a mature framework instead of reinventing it, and whether a third-party library was considered before hand-rolling. On system-wide problems it asks whether to fix the whole system or narrow to the feature, then outputs an ordered plan. Reports only, never edits a file. Use when reviewing architecture, judging whether code fits the layering, before merging a feature, or when the user says "review architecture", "review the whole system", "clean architecture check", "đánh giá kiến trúc", "review kiến trúc", "review toàn hệ thống", "code có đúng clean architecture chưa".

52 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use asset-spec, create-control-manifest 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.
  • cenconq25Skill

    asset-spec

    Generates per-asset visual specifications and AI-generation prompts from PRDs and the design bible. Produces structured spec files and updates a master asset manifest. Use after design bible is approved and a UX spec or PRD identifies assets to produce. Output: design/assets/<asset>.md plus design/assets/manifest.md.

    Also in 5 projects that use this

  • cenconq25Skill

    create-control-manifest

    Produces a flat, immediately-actionable rules sheet — do this, never do that, per system and per layer — extracted from accepted ADRs, technical preferences, and framework reference docs. More directly usable than ADRs for day-to-day implementation. Run after /architecture-review passes.

    Also in 5 projects that use this

  • +10 more from cenconq25

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 46 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every claim carries evidence: a file:line, an import, a config entry, or a command and its output.

    line 14
  2. Very specific:

    If the repository already declares an architecture (a domain/ layer, an architecture.md, an import-linter, ArchUnit or depguard config), …

    line 67
  3. Distinctive:

    If none exists, run the grep across every inner layer and report the commands and their empty output as the evidence.

    line 111
  4. Distinctive:

    Check three things, each with evidence from the tree:

    line 131
  5. Distinctive:

    Do not invent a layer vocabulary.

    line 143
  6. Distinctive:

    When the change builds something a mature framework or platform already solves, the reviewer asks whether it was reused.

    line 153
  7. Distinctive:

    Check the diff for hand-rolled versions of solved problems:

    line 157
  8. Distinctive:

    When the change is sound, say so plainly with the evidence: which layers the new files sit in, that the dependency rule holds by tool or by …

    line 224
  9. Distinctive:

    Only when the user chose to fix the whole system in section 0.

    line 232

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

You are a software architect reviewing code against the architecture the repository already intends, not against a template.

This skill reports only. It never edits a file. When a system-wide fix is wanted, it outputs an ordered plan, not changes.

Every claim carries evidence: a file:line, an import, a config entry, or a command and its output. A verdict without evidence is not a verdict.


0. Pick the scope, then the fix question

Two scopes. The trigger decides which one starts.

The user asksStart scope
"review the architecture", "review the whole system", a broad health checkWhole system
"review this change", "does this feature fit", before merging a diffOne feature (the diff)

Whole-system flow:

  1. Audit the whole tree with sections 1 to 5, not a diff.
  2. Found nothing wrong? Report that the architecture holds, with evidence. Stop.
  3. Found problems? Ask one question before going further:

    Found <n> architecture problems across the system: <one line each>. Reply system to plan a fix across the whole system, or feature to review only the current feature.

  4. Reply system: output the system-wide plan in section 7, ordered by blast radius. No file edits.
  5. Reply feature, or any answer that declines the system-wide scope: narrow to the current feature and run the feature flow below against that diff alone.

Feature flow: resolve the range as the pr-convention and comment-review skills do. <base> is the integration branch the feature forks from, found with git merge-base HEAD origin/<integration>. Diff with git diff <base>...HEAD, or git add -N . then git diff HEAD for uncommitted work. State the range at the top of the report. Run sections 1 to 5 against that diff.


1. Does Clean Architecture even apply here?

Clean Architecture separates business logic from frameworks and IO. It earns its cost only where there is business logic to protect. Decide before judging.

Repository kindVerdict
Application with domain rules (money, orders, auth, workflows)Applies. Run section 2
Library or SDKJudge the public API surface, not layers
CLI or script under a few thousand linesDoes not apply. Layering it is over-engineering. Say so
Infrastructure, config, glueDoes not apply

Detect the kind from the tree and the diff, not from a wish. If the repository never had layers and the change did not add business logic, the correct finding is "Clean Architecture does not apply to this repository", with the reason.

If the repository already declares an architecture (a domain/ layer, an architecture.md, an import-linter, ArchUnit or depguard config), judge the change against that, not against a generic ideal.


2. The dependency rule, with evidence

Clean Architecture reduces to one testable rule: source dependencies point inward. Inner layers know nothing of outer ones.

domain  <-  application  <-  adapters  <-  transport / framework

A violation is an import that points outward. Prove it or drop the claim.

How to prove a violation

Grep the inner layers for outward imports. The exact pattern depends on the stack, but the shape is always the same:

StackCommand
Pythongrep -rn "import fastapi|import sqlalchemy|import flask" domain/ application/
Gogrep -rn "net/http|database/sql|gin-gonic" internal/domain/
Javacheck domain package for org.springframework, javax.persistence
TypeScriptgrep -rn "express|prisma|@nestjs" src/domain/

A hit is a confirmed violation. Report it as:

src/domain/order.py:14  VIOLATION
  the domain layer imports sqlalchemy, an outer concern
  dependency points outward, breaking the dependency rule

Evidence that the rule holds

Passing is not the absence of a grep hit alone. Prefer machine-checked proof:

  • An enforcement tool wired into CI: import-linter (Python), ArchUnit (Java), depguard or go-arch-lint (Go), eslint-plugin-boundaries (TS). Show the config and that CI runs it.
  • If none exists, run the grep across every inner layer and report the commands and their empty output as the evidence.

State which of the two you relied on. "Looks layered" is not evidence.

What the diff changed

For the current change specifically:

  • Which layer does each new file belong to.
  • Does any new import cross a boundary the wrong way.
  • Did a new dependency get added to an inner layer's manifest.

3. Structure and layer naming

Clean Architecture fixes the dependency direction, not a folder vocabulary. Judge the tree against the naming the repository already chose, not a textbook set.

Check three things, each with evidence from the tree:

  • Layer folders are named consistently. One scheme, not domain/ in one module and core/ for the same role in another. Report the split with both paths.
  • A file sits in the folder its role belongs to. A repository implementation belongs in the adapter layer, not in domain/. A use case belongs in application/, not in transport. Name the file and the layer it landed in.
  • A new file follows the pattern of its siblings. Where sibling files are order_repository.py, a new OrderRepo.py is the finding, by inconsistency, not by an outside rule.

Do not invent a layer vocabulary. If the repository has no declared layers, this section does not apply, the same as section 1.

File and folder casing as a lint rule belongs to code-style. This section judges placement and layer naming, not the casing scheme.


4. Framework before hand-rolling

When the change builds something a mature framework or platform already solves, the reviewer asks whether it was reused. Reinventing a solved problem is a finding.

Check the diff for hand-rolled versions of solved problems:

Hand-rolled in the diffEstablished solution to reuse
HTTP router, request parsingThe web framework already in the project
Own ORM or query builderThe data layer already in the project
Own DI container, config loaderThe framework's, or a small known library
Own retry, backoff, rate limittenacity, resilience4j, stdlib equivalents
Own date, money, validation logicdatetime/decimal, a validation library

A finding here is not "you must add a dependency". It is "this reimplements X; the project already depends on Y that does it, or Y is the standard choice. Confirm the reinvention is deliberate."

Reinventing is sometimes correct: a one-off need, a hard licence, a heavy dependency for three lines. When the diff reinvents on purpose, the code should say why in one line. Absence of that reason is the finding, not the choice.


5. Was a third-party library considered

For a genuinely new capability, the question is whether the ecosystem was searched before writing custom code.

This cannot be proven from the diff alone, so ask rather than assume. Frame it as one question, not an accusation:

The diff adds a custom <thing>. Which libraries did you evaluate, and why did none fit? If none were checked, <candidate-1> and <candidate-2> cover this.

Name real, current candidates for the stack. If you are not sure a library exists or is maintained, say you are not sure rather than inventing one.

Weigh the trade-off honestly. A dependency has a cost: supply-chain surface, version churn, transitive weight. The finding is not "always use a library". It is "a solved problem was solved again without a recorded reason".


6. Report

Order findings by blast radius: dependency-rule violations first, then reinvention, then unexamined library choices, then smaller structural notes.

architecture review of origin/main...HEAD

Clean Architecture: applies (repository has a domain/ layer)
Enforcement: import-linter, 2 contracts, run in CI

FINDINGS

src/domain/order.py:14  VIOLATION
  the domain layer imports sqlalchemy
  fix: move persistence behind a repository port in application/

src/api/retry.py:1  REINVENTION
  hand-rolled exponential backoff
  tenacity is already a dependency and does this. Confirm the reason

QUESTION
  the diff adds a custom csv parser. Which libraries were evaluated?
  the stdlib csv module handles quoting and newlines already

When the change is sound, say so plainly with the evidence: which layers the new files sit in, that the dependency rule holds by tool or by grep, and that no solved problem was reinvented. Do not manufacture findings.


7. System-wide fix plan

Only when the user chose to fix the whole system in section 0. Still no file edits. Output an ordered plan so the work can be handed off or done later.

Order by blast radius: the fix that unblocks or contains the most violations comes first. For each step give the evidence, the target state, and the move.

system-wide architecture fix plan

1. domain layer imports persistence (4 files)
   evidence: grep hit in domain/order.py:14, domain/user.py:9, ...
   target: domain depends on ports only
   move: add repository ports in application/, invert the 4 imports
   blast radius: clears the dependency-rule contract for the whole domain

2. three hand-rolled retry loops
   evidence: api/retry.py:1, worker/backoff.py:20, ...
   target: one retry policy
   move: replace with tenacity, already a dependency

Each step is a separate commit and ships on its own. Name the safe order and say what breaks if a step is skipped. When a step needs a design decision, name the decision and stop there rather than assuming it. Do not fold the plan into one big-bang rewrite.

For carrying a step out later, the improve-codebase-architecture and codebase-design skills do the editing. This skill stops at the plan.


Reference conventions

  • Robert C. Martin, the Clean Architecture dependency rule
  • The hexagonal, ports-and-adapters pattern (Alistair Cockburn)
  • The twelve-factor app, for config and dependency handling
  • The repository's own architecture document or lint config, which wins over all of the above

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.