Architecture audit

From KRISACHAN/ying-practice · View interactive version

Architecture audit is an AI agent skill from the GitHub repository KRISACHAN/ying-practice. Read-only codebase reconnaissance and architecture diagnosis for a repository, package, app, or module. Produces a functional/architecture map plus evidence-backed hotspots, code smells, dependency, code-comment, and documentation problems. Use before major refactors or when understanding a brownfie

How to use this skill

Skill file

Architecture Audit

Understand the current system before judging or changing it.

Read:

Then load the target project's own rules and nearest README/architecture docs.

Mode

Code is read-only. Writing an audit artifact is allowed; changing production/test behavior is not.

Workflow

  1. Define scope — repository / package / app / module; record baseline ref/working-tree state.
  2. Functional map — purpose, responsibilities, non-responsibilities, entry points, public contracts, callers/consumers.
  3. Architecture map — modules/layers, dependency direction, data flow, state/persistence, network/filesystem/process boundaries, composition roots, extension points.
  4. Verification map — tests and checks that protect the scope, plus important unprotected behavior.
  5. Knowledge/navigation map — assess whether structured code comments expose important local purpose/capability/boundary/invariant context, and whether README/AGENTS/ADR/spec/index documents provide accurate progressive navigation without drift.
  6. Hotspot analysis — identify structurally significant large files/functions, change concentration, fan-in/fan-out, broad interfaces, mixed responsibilities, duplicated knowledge, difficult-to-test seams. Maintain a Hotspot Watchlist for hotspots that the later plan/execution must explicitly resolve or intentionally preserve.
  7. Pattern analysis — identify useful or misused layering, Port/Adapter, Strategy, Plugin, and unnecessary abstractions.
  8. Diagnose root causes — for each meaningful issue record evidence → cost → likely root cause → safe direction → risk.
  9. Assess scope fit — prefer keeping the current package/app/module as one refactor scope. Recommend sub-scopes only when responsibility, contract, rollback/migration risk, verification strategy, or context size forms a real independent boundary.

Hotspot Watchlist

LOC is a discovery signal, not a verdict. Do not mark a file defective merely because it is long, but do not let a major hotspot disappear from the audit merely because tests pass.

For each structurally significant hotspot, explicitly judge:

Classify each watchlist item with one of these dispositions:

Required Output Sections

Findings must include concrete paths/symbols/lines when available. File size alone is not a defect; judge cohesion, reasons to change, blast radius, testability, and navigability.

Do not turn each finding into a future Refactor Unit. The audit diagnoses problems; the planning skill decides how related findings should be grouped into a concise scope-level plan.

Persist the result using project conventions or the fallback artifact protocol. Stop after the audit; do not start refactoring.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.