/act101:architectural-refactoringfrom act101
Executes structural refactorings from an architecture audit: breaks circular dependencies, splits god classes, reduces coupling, and extracts interfaces at seams. Requires prior architecture-audit output.
Ships in act101. 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.
None: SKILL.md is the whole skill.
Execute structural decompositions from an architectural analysis report.
project-map.md at the workspace root: the living architectural document,
including its ## Refuted & Re-characterized Findings ledger..act/runs/<YYYY-MM-DD-HHMMSS>/report.md; use the highest
timestamp (legacy runs may sit read-only under docs/act/). .act/runs/ is
gitignored, so on a fresh clone the report may be absent while project-map.md
survives; then work from the map and re-run architecture-audit to regenerate a
report.If neither exists, run the architecture-audit skill first.
project-map.md and the latest report first.
Every refactoring decision traces to a confirmed finding by its finding ID. Check
the Refuted ledger before acting: a smell already investigated and disproven is
left alone.act analyze seams together with
act analyze clusters. A zero-seam result is not proof that no boundary exists;
read it per the protocol's seam / hub-collapse rule and use dampened clusters,
split_module, and simulate to find the smallest verified cut.act analyze surface --files <files> gives the API
surface of a proposed extraction. A surface that is too wide means the extraction
adds coupling rather than removing it.act analyze cycles finds them; break the simplest edge
in each.act query interface <file> shows the current
API; act refactor extract-interface <Class> <InterfaceName> creates the
interface both sides depend on.act analyze coupling and make them independent before touching unstable ones.act analyze coupling and
act analyze cycles to confirm coupling dropped and cycles broke.act analyze dead-code before and
after each major step.remediation-log.md (workspace root),
keyed to the finding ID it resolves (see Recording remediations). Leave
project-map.md to architecture-audit, which folds the log into it on the next
run.Read project-map.md (including its Refuted ledger) and the latest report.
Prioritize confirmed findings by ID: cycles > god classes > high coupling > dead code
For each finding:
a. Confirm it is still present (act analyze cycles, act analyze coupling).
b. Plan the change: identify boundaries and seams, measure the surface.
c. Simulate before cutting. Call simulate(ops=[…], include=[…]) with the
planned change as split_file, move_file, remove_edge, merge_files, or
delete_module ops and record the predicted deltas (cycles resolved, coupling
changes, violations cleared or introduced) in the remediation row's "Verified
by" cell. For a chokepoint or refuted-ledger row that hinges on "is this wide
module load-bearing or a pass-through?", delete_module{file} settles it: read
the deletions delta in the protocol's canonical order (surface_consumers
first, surface_modeled as the honesty gate, then rewired_edges and
severed_edges) and record the surface count plus a named consumer. Example
for a god-module split:
simulate(ops=[{op: "split_file", file: "src/core.ts", groups: [["parseUser", "validateUser"], ["formatReport"]]}])
The result shows cycles.resolved, coupling.changed (per-unit before and
after instability), and, when an [architecture] contract exists,
violations.cleared and violations.introduced. Revise a cut that introduces
violations or leaves the target cycle unresolved before touching disk.
d. Execute with act refactor operations. When the change is the same transform
repeated across many sites, author and run a recipe instead (see Mass changes).
e. Verify: re-run the specific analysis, run the tests.
f. Commit the code change.
g. Append the remediation row to remediation-log.md in its own follow-up commit,
since the row's Commit column names the step-f commit.
After the batch, re-run architecture-audit. It reads the log, re-verifies each
claimed fix against fresh structural evidence, and folds confirmed remediations
into the map. That closes one audit → refactor → re-audit cycle; the next cycle
starts from the refreshed map.
When there is nothing to remediate (every confirmed finding is already
RESOLVED in the log, or the report holds only refuted and re-characterized
entries), the next step is a fresh audit, not invented work and not a re-opened
refuted smell. Hand off the same way the audit does: "Clear context, then run
/architecture-audit." A new audit re-baselines against the current structure and
surfaces the next layer of findings.
When a remediation is the same transform repeated across many sites (a deprecation
rename, an import reorganization, wrapping a recurring pattern), drive it as a
codemod recipe. A recipe (match → transform → optional verify) runs one
act refactor operation across every matching site, atomically, with optional
gate verification and receipts. Site-by-site act refactor calls are for the few
one-off cuts.
Run it with the recipe_run MCP tool or act recipe run <recipe.toml>:
preview / --preview) lists every match and its planned
operation. Confirm the match set is exactly the intended sites before applying.FLAGGED instead of applied.all_or_nothing / --all-or-nothing when the change
must land whole: if any site fails, the run rolls back through history and the
tree is untouched.receipts / --receipts and put the receipt IDs in the
remediation row's "Verified by" cell.recipe_run parameters: recipe_path (required), root, preview,
all_or_nothing, receipts. Its per-site report (matched / applied / failed /
flagged / rolled_back) is the evidence for the remediation row; one recipe run
resolves the finding across all sites, so log it as a single remediation.
recipe_run is Enterprise tier.
Remediations go in an append-only ledger, separate from project-map.md (the
protocol's Artifact Directory Structure explains the split): the log is action
history, the map is current state.
remediation-log.md at the workspace root, git-tracked, sibling of
project-map.md. It must be durable, so it never lives under the gitignored
.act/runs/ tree.Row format:
| Date | Finding | Status | Change | Commit | Verified by |
|------|---------|--------|--------|--------|-------------|
| 2026-05-28 | C-3 (auth↔router cycle) | RESOLVED | Extracted `AuthPort` interface at the seam; router depends on the interface, not auth | abc1234 | `act analyze cycles` → 0 cycles; tests pass |
| 2026-06-12 | C-7 (validateAge logic) | RESOLVED | Tightened boundary condition in validateAge | def5678 | `act analyze coupling` → 0 violations; receipt `8bb683bbfe8e27cf` |
When the step ran act gate --receipts (or gate(receipts=true)), or a refactor op
ran with receipt=true, put the receipt IDs in the Verified-by cell beside the
structural check. Receipts are evidence, not authority: a hash or schema mismatch at
consumption time discards the receipt and triggers fresh verification. Emission
mechanics and the receipt schema are in the refactor-receipt skill.
Status is RESOLVED (fix verified) or PARTIAL (reduced, with what remains
noted). The next architecture-audit reads this log in Phase 0, re-verifies each
claim against fresh structural evidence, and reflects confirmed fixes in the map,
flagging any claim the structure contradicts.
refactoring skill for individual operations (rename, extract, move).code-generation skill for scaffolding new modules.code-navigation skill to understand code before modifying it.act analyze cycles --max-length 3 for the tightest cycles first.act analyze coupling --threshold 0.7 for the most unstable modules.act query skeleton instead of reading full files.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub act101-ai/act101 --plugin act10126 skills in this plugin
/agent-safety-auditUse before an autonomous agent edits a sensitive or high-blast-radius file, or to judge an edit it already made. Composes secret surface, taint flow, blast radius, API width, and the repo scan into one safety verdict./architecture-auditUse when asked to audit architecture, get the full structural picture of a codebase, assess overall health or porting readiness, or find module boundaries, circular dependencies, coupling hotspots, dead code, or code smells. Full hypothesis-driven audit, optionally enriched with coverage and git evidence./boundary-analysisUse when looking for extraction candidates, planning a module split, analyzing module boundaries, or asked "where should I split this?". Produces ranked extraction candidates with cut costs, layer violations, interface width, orphan types, and a decomposition sequence./change-impactUse before modifying a file or symbol, or when asked "what breaks if I change X?". Returns a blast-radius, test-coverage, and cycle-risk verdict immediately, with no follow-up investigation./code-generationGenerates boilerplate (constructors, accessors, builders, equals and hash methods, JSON serialization, toString, interface stubs, test stubs) from a type's existing fields, previewed and reversible. Use when creating any of that boilerplate from an existing class or struct, or when porting a type and its boilerplate to another language. Business logic is written by hand./code-navigationAnswers questions about code structure and bindings without reading whole files. Use when exploring unfamiliar code, mapping dependencies, reading an API surface, tracing call chains or data flow across files, or checking a function's side effects before changing it.Other plugins' skills for the same job