rea-analysis-optimization
MOmorluto/rea485k近 7 天新增 7,690 个 star
Audit an existing repository or multi-module subsystem for evidence-backed architecture improvements, rank bounded candidates, and present them in a visual HTML report with before-and-after diagrams and a top recommendation. Use when the user asks where architecture investment would pay off across a codebase, wants multiple architecture candidates ranked, or needs systemic coupling, shotgun-change, testability, or AI-navigability problems diagnosed. For one named module's responsibility, deepening, splitting, or contract use codebase-design; for a source-tree or package audit use structure-codebase; for an already-selected path whose success is an evidence-backed net-mechanism-reduction claim use reduce-system-complexity. This is audit-and-selection by default.
Find the highest-value bounded architecture improvement rather than producing a generic cleanup list. Combine change pressure, caller burden, locality, dependency direction, testability, ownership, runtime risk, and project intent. Use deep-module design as one lens, not as a mandate to consolidate everything.
Keep this skill distinct from:
codebase-design, which designs one selected module's responsibility and caller-facing contract;structure-codebase, which owns physical trees, package boundaries, import direction, enforcement, and folder migration;reduce-system-complexity, which conserves behavior while gathering same-scope evidence for a calibrated claim that total mechanism fell in an already-selected path;evaluate-existing-solutions, which compares current external and built-in implementation options after the job and constraints are selected;refactoring, which implements behavior-preserving improvements after the safety net is trustworthy.A request specifically to review a source tree, folder scheme, package split, or import enforcement belongs directly to structure-codebase. Use this skill when the unresolved question is which architecture investment is worth making and why now. On an ambiguous “architecture refactor” request, audit and select first; do not start this and refactoring as concurrent workflows.
Read references/html-report.md before creating the report. Read references/source-notes.md when explaining provenance or comparing this adaptation with its upstream source.
Use the user's named scope when provided. Otherwise infer a useful review area from several signals:
Walk enough history to distinguish an active hotspot from a one-off migration. When evidence is scattered, state the uncertainty and widen only as much as needed.
Inspect:
Do not create a global CONTEXT.md, invent an ADR path, or silently coin domain terms. Load ubiquitous-language only when a real terminology decision arises.
Follow representative behavior from entrypoint to observable outcome. Record:
Use parallel exploration when independent repository areas can be inspected without duplicating work. Give explorers raw scope and evidence, not a preferred diagnosis.
Look for more than consolidation:
Consult codebase-design in lens-only mode for depth, leverage, locality, interface burden, seams, and thin-edge safeguards. Do not run its contract workflow or propose an exact interface before selection. Load structure-codebase, hexagonal-architecture, or domain-driven-design only when the candidate actually involves their concerns.
Reject candidates based only on file length, folder aesthetics, a single adapter, one duplicated code shape, or speculative future flexibility.
For each candidate, weigh:
| Dimension | Evidence to seek |
|---|---|
| Why now | Active change pressure, defects, planned work, or measurable maintenance cost |
| Locality gain | Policy, bugs, and verification would move to one coherent owner |
| Caller leverage | Common callers would learn and coordinate materially less |
| Architectural honesty | Ownership, runtime, trust, failure, and dependency direction improve |
| Testability | Stable behavior can be exercised without reconstructing internals |
| Migration safety | A small reversible path and trustworthy verification exist |
| Counterevidence | Independent change axes, thin-edge roles, compatibility, or fidelity gaps argue against it |
Assign one recommendation strength:
Do not use a numeric score that implies false precision. Give a confidence level separately from recommendation strength.
If no candidate rises above speculative, recommend no architecture investment now. State what evidence or change pressure would justify revisiting the area rather than manufacturing a top refactor.
Create the visual report as a first-class deliverable using references/html-report.md.
If the user explicitly requests Markdown or another format, honor that choice while preserving the same candidate content.
Stop after the audit unless the user already authorized a specific candidate. Ask which candidate to explore, leading with the top recommendation.
For the selected candidate:
grill-me where installed when constraints or trade-offs remain decision-heavy. Otherwise, ask one focused question at a time and include a recommended answer with its trade-off.codebase-design and its Design It Twice process for a consequential contract.ubiquitous-language if the design needs a new or changed domain term.structure-codebase if placement, packages, exports, or dependency enforcement change.evaluate-existing-solutions only when the selected direction introduces or replaces a material generic mechanism or dependency; do not research products for every audit candidate.Only implement when requested:
finding-seams as needed, then characterisation-tests; run mutation-testing over the accumulated change area at the end-of-phase PR-readiness gate.refactoring, keeping observable behavior stable.reduce-system-complexity, preserving behavior while applying the behavior gate on every slice and the mechanism gate at terminal reduction.tdd, testing, and refactoring during implementation, then mutation-testing once for the accumulated change at PR readiness.api-design.structure-codebase and its migration gates.hexagonal-architecture.planning after the candidate and contract are selected.evaluate-existing-solutions after candidate selection and before implementation planning.double-check for an adversarial second opinion.Keep moves, dependency inversion, behavior changes, and compatibility removal in separate verifiable slices wherever possible.
Every reported candidate must contain:
Adapted from Matt Pocock's MIT-licensed improve-codebase-architecture skill and HTML report resource, with its deep-module lens supplied by the attributed codebase-design sibling. See references/source-notes.md and LICENSE for pinned provenance and license terms.
MOmorluto/rea485k近 7 天新增 7,690 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star