improve-code-structure
Installation
SKILL.md
Improve Code Structure
Analyze code for structural improvements, then implement changes with user approval.
Scope
- Default: entire repo (excluding vendored/generated code, node_modules, build output)
- Narrowed: if the user specifies a file, directory, or function — analyze that, but consider the surrounding context (a function lives in a file; a file lives in a module)
- When scoped to a specific function: analyze the whole file to understand context, then narrow recommendations to changes that affect the target function
- Monorepos / large repos: if the repo has multiple packages or services, ask the user to scope to a specific one rather than analyzing everything
Instructions
You are the lead orchestrating a structural analysis and refactoring workflow.
For three worked examples of how the lead should behave end-to-end (full happy path, Phase 3 skipped because no changes were approved, and a revert-on-fail in Phase 3d), see references/examples.md.