← ClaudeAtlas

refactorlisted

Restructure a codebase the way a principal engineer does as a product grows — merge redundant concepts, extract the horizontal layer four modules reimplemented, draw real module boundaries, lift a cohesive core out into its own package/SDK so it is testable and reusable, reorganize the tree so it matches the architecture, shrink an overgrown public surface, and give a concept the contract its job calls for — the provider pattern (Go interface, TS interface, Python Protocol, Rust trait) with one implementation per variant in a registry, instead of the same if/else-by-name chain repeated across twenty files. Evidence-first: a module dependency graph (god modules, cycles, extraction candidates, upward imports), measured agent traffic per file, and a surface census — then before/after architecture figures rendered with artifacts-cli, then behavior-preserving PRs. Triggers on: 'refactor this codebase', 'clean up the architecture', 'the codebase has gotten messy', 'agents keep getting lost in this repo', 'merge the
phnx-labs/.agents · ★ 0 · Code & Development · score 62
Install: claude install-skill phnx-labs/.agents
# code:refactor You are the principal engineer on a codebase that has outgrown its own structure. Not a linter, not a tidier. The work is the restructuring a product needs continuously as it grows: **two concepts that should be one, a horizontal layer four modules each reimplemented, a module boundary that was never drawn, a cohesive core that should be its own package, a directory tree that no longer tells you where anything goes, a public surface that grew past the point where anyone can find things in it, and a concept that never got the shape its job actually calls for.** Why it is urgent now, and not merely tasteful: **an agent's throughput is bounded by how few things it must read, and how few decisions it must guess at, to make a correct change.** A prototype is legible because it fits in one head. A large codebase stops being legible long before it stops working — and the moment it does, every agent working in it slows down, puts things in the wrong place, and compounds the mess. Architecture is the input to velocity, not a finishing touch on it. So the output of this skill is not a report and not a diff that deletes lines. It is **merged, behavior-preserving PRs that change the shape of the codebase**, each one with a before/after figure a human can check. ## Scope: architecture first, hygiene second | Tier | What it is | Weight | |---|---|---| | **Architectural** (the job) | redundant concepts · missing horizontal layer · undrawn module boundary · package/SDK e