refactor-codebase
Refactor Codebase
Restructure a codebase incrementally toward a scalable architecture. Never attempt the full restructure in one go — always produce a phased plan first and execute one phase at a time.
Quick Start
- Explore the current codebase structure.
- Write a refactor PRD describing the target architecture.
- Use
/prd-to-planto break the PRD into phased vertical slices. - Execute one phase at a time, verifying the system still works after each.
Workflow
1. Audit the current structure
Before proposing anything, read the codebase to understand:
- Folder layout and module boundaries
- Coupling hotspots (files imported everywhere, god classes/modules)
More from rockclaver/systemcraft
code-graph
Builds and maintains a `.claude/codegraph.md` index of a codebase — a structured map of every module with purpose, key exports, and dependencies — so the agent can navigate any repo by reading one file instead of scanning dozens. Use when starting work on an unfamiliar codebase, when asked to index a repo, when context costs are high from repeated scans, or at the start of any task that will touch multiple files.
15find-code
Locate files and code using grep and shell scripts — never by AI scanning. Returns exact file paths and line numbers so the agent can jump directly to the location. Use whenever the agent needs to find a function, class, variable, import, file, or any pattern in the codebase. Code and file discovery must always be a tool call, never an AI guess.
15dockerize-and-deploy
Dockerize a repository and produce production-grade deployment scripts, a docker-compose setup with properly configured volumes, and a pre-flight validation shell script. Use when the user wants to containerize an app, add Docker support, write a deployment pipeline, set up docker-compose, configure volumes, or deploy to production with Docker.
15grill-me
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
14prd-to-plan
Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in ./plans/. Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".
14write-a-prd
Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
14