/re-arch:re-arch-auditfrom re-arch
Performs an evidence-based architecture audit of existing codebases: domain mapping, dependency leaks, tech debt assessment, refactoring options with cost estimates, management pitch, and guardrails. Supports JS/TS, PHP, .NET, Java/Kotlin, C/C++, Go, Rust.
Ships in re-arch. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill runs the re-arch suite in order. Each step is a separate skill so a team can also run one step alone (for example only re-arch-pitch once the plan is validated).
All artifacts go to .re-arch/ at the root of the audited repository (suggest adding it to .gitignore unless the team wants to version the audit; authors-map.json must never be versioned or shared). The data contract is in references/contract.md; read it once before starting.
Copy this checklist into your notes and tick it as you go:
- [ ] 1 Frame (meta.json, quality drivers, assumptions)
- [ ] 2 Scan (graph sources checked)
- [ ] 3 Domains (checkpoint: map validated or assumed)
- [ ] 4 Diagnose (validate.py clean)
- [ ] 5 Options (checkpoint: option chosen or assumed)
- [ ] 6 Plan (validate.py: coverage OK)
- [ ] 7 Pitch
- [ ] 8 Guardrails (rules tested)
- [ ] 9 Academy
- [ ] 10 Report (validate.py 0 error, check_render.py OK, screenshots looked at, OKF bundle 0 error)
- [ ] 11 Hand over
Frame (no skill): find out, from the conversation or by asking in one short message if the person is present:
--allow-build executes the project's build scripts: CMake configure, Maven/Gradle compile) and whether tools may be downloaded (--fetch-tools);.re-arch/meta.json. If the person is not there to answer, take the defaults (no build steps, tools may be fetched, drivers inferred from the product and marked as assumed), list every default in meta.assumptions (the report shows them in its header), and carry on. Keep appending to meta.assumptions whenever a later step decides instead of the team.Scan: run re-arch-scan. Read .re-arch/scan-summary.md, starting with "Graph sources". Query scan.json with short scripts for details.
Domains: run re-arch-domains -> .re-arch/domains.json. Checkpoint: if the person is present, show the map in a few lines and ask for corrections; every later step is organised per domain, and a wrong map spreads errors everywhere. If absent, validated_by_team: false and continue.
Diagnose: run re-arch-diagnose -> .re-arch/findings.json.
Options: run re-arch-options -> .re-arch/options.json. Checkpoint: present the options (one line each with both sizes and their fit with the quality scenarios) and ask which one the team retains. If nobody answers, take the recommended one with decision.by: "assumed"; the report says it awaits validation.
Plan: run re-arch-plan for the retained option -> .re-arch/plan.json + plan.md.
Pitch: run re-arch-pitch -> .re-arch/pitch.json + pitch.md (skip only if the person said management is not an audience).
Guardrails: run re-arch-guardrails -> .re-arch/guardrails/ + guardrails.json.
Academy: run re-arch-academy -> .re-arch/academy/ + academy.json.
Report: run re-arch-report -> .re-arch/report.html (+ architecture.md with Mermaid diagrams, + okf/: the audit as an Open Knowledge Format bundle for the repository's docs and for agents).
Verify, then hand over. Before saying anything is done, run and read the output of:
python3 <re-arch-report-dir>/scripts/validate.py <repo>/.re-arch: 0 error (fix the JSON, re-render);python3 <re-arch-report-dir>/scripts/check_render.py <repo>/.re-arch/report.html: OK at 390px and 1280px, and look at the phone screenshots of the summary and the domain map.
A claim of success needs fresh command output, not a recollection of an earlier run. Then deliver report.html as a file (with the session's file-sending tool if there is one; otherwise give its path). If the session can publish web pages, offer in one line to publish it, but do not publish without asking: the report contains code excerpts and possibly the location of secrets. In the message: the main weakness, the recommended or retained option with its two sizes, the size of the first phase, the decision requested from management if any, and the open questions for the maintainers. Do not recap the steps.When .re-arch/ already holds an audit (the person asks for a follow-up, "where are we", "re-run the audit"):
python3 <this-skill-dir>/scripts/diff_rearch.py snapshot <repo>/.re-arch (copies the current audit to .re-arch/history/<date>_<head>/).findings.json and keeps the same id for persisting findings; the plan keeps phase ids and updates each phase status from the code and the exit criteria (verified, not assumed); options and pitch change only if the context changed (say so).python3 <this-skill-dir>/scripts/diff_rearch.py compare <repo>/.re-arch/history/<snapshot> <repo>/.re-arch -> diff.json + diff.md: findings resolved, new, worse, better; metric trends; phase status. The report shows it at the top of the summary.to_okf.py): log.md gains a dated entry from diff.json and keeps the previous ones.--baseline-update), update reference implementations in AGENTS.md if new, better examples now exist..re-arch/ and says what is missing.Below roughly 2,000 lines of production code, scale the deliverables to the code: 3 to 10 findings (grouped harder), 2 to 4 options, 2 to 4 phases, 2 to 4 academy modules, a one-page pitch. A full audit of a small app should be readable in fifteen minutes; volume is not rigor.
Above roughly 2,000 source files or several services:
--out .re-arch/<service>), then audit the service that matters most first, or the one the person names;What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
TypeScript, JavaScript, PHP, Rust, Go, C++, Java, Kotlin
npx claudepluginhub gregorybabonaux/re-arch --plugin re-arch10 skills in this plugin
/re-arch-academyProduces training material to upskill a development team on the architecture and practices of a refactoring - a learning path ordered by the refactoring plan, modules anchored in the team's own code (before/after taken from their repository, katas extracted from real files, exercises, review checklists), curated references, for juniors and seniors. Use when a team must learn clean architecture, hexagonal, DDD, layering, testing legacy code or refactoring techniques, when a tech lead wants onboarding or workshop material about their codebase's target architecture, when developers who vibe-code need to learn craftsmanship basics, or as the training step of an architecture audit. Part of the re-arch suite; reads .re-arch/findings.json, options.json and plan.json./re-arch-diagnoseDiagnoses the architectural weaknesses of an existing codebase with evidence (file and line) for every finding, rated by severity and fix size, explained in technical and business impact, with the strengths to keep and what looks bad but is fine. Covers layering, business logic in controllers or UI, coupling and cycles, duplicated rules, domain boundaries, data model, testability, state, error handling, configuration and secrets, dependency hygiene, knowledge concentration, and the tells of vibe-coded or AI-generated code. Use for architecture-level code reviews, technical debt assessments, "what is wrong with this codebase", before a refactoring plan, or as the diagnosis step of an architecture audit. Part of the re-arch suite; reads .re-arch/scan.json and domains.json.Other plugins' skills for the same job