code-refactoring

Solid

Use when the user says 'refactor this', 'rename class', or 'move method'. Safely refactors code in any language — finds all callers, updates downstream dependencies, verifies via quality tools.

AI & Automation 7 stars 1 forks Updated today MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
30
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# refactorer ## When to use Use this skill when renaming, moving, extracting, or restructuring code — any change that may have downstream effects on callers, interfaces, tests, documentation, or API contracts. Do NOT use when: - New feature development (use `feature-planning` skill) - Bug fixes that don't involve restructuring (use `bug-analyzer` skill) ## Before refactoring 1. **Read the agent docs** — check `agents/reference/docs/` and `agents/settings/contexts/` for the area you're refactoring. For modules, also read the project's module-docs directory (path varies by stack — Laravel: `app/Modules/{Module}/agents/`; Nx: `apps/{app}/docs/`; mono-repo: per-package `docs/`). See the `project-docs` skill for the mapping. 2. **Understand the scope** — what exactly needs to change and why? 3. **Find ALL references** — use `codebase-retrieval` and `view` with `search_query_regex` to find every caller, implementation, test, and configuration that references the code being changed. 4. **Map the impact** — create a list of all files that will need changes. 5. **Present the plan** — show the user what will be affected before starting. ## Procedure: Refactor code ### Step 1: Make the core change - Rename, extract, move, or restructure the target code. - Keep the change minimal and focused. ### Step 2: Update all downstream dependencies For each affected file (from the impact analysis): - **Callers**: Update method calls, constructor arguments, imports. - **Interfaces...

Details

Author
event4u-app
Repository
event4u-app/agent-config
Created
3 months ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Listed

refactor

ALWAYS use this skill before refactoring any code. It prevents over-refactoring and wrong refactoring by requiring an assessment first — catching code that is already clean, problems that are architectural rather than code-level, and missing test coverage that must exist before touching business logic. Trigger on: refactor, clean up, simplify, reduce complexity, code smells, messy code, break up function, reduce nesting, remove dead code, file too big, extract method, too many parameters, duplicated code, cognitive complexity, god class, magic numbers. Also trigger when a linter or static analysis tool flags complexity issues. Language-agnostic.

0 Updated 4 days ago
svyatov
Data & Documents Listed

refactor

Deep functional refactoring of TypeScript code for purity, testability, and modularity. Use when the user says /refactor, asks to clean up or restructure code, mentions large files, god functions, mixed concerns, poor testability, or when code grew unwieldy after feature iterations. Also triggers on "this file is too big", "split this", "make this more functional", "extract", "decompose", or any mention of code smells like let, try/catch in business logic, for loops, or files over 300 lines. If the user describes messy, tangled, or overgrown code that needs structural improvement, this is the right skill — even without the word "refactor."

1 Updated 3 days ago
supermodo
AI & Automation Listed

refactoring

Improve code structure in small, always-green steps without changing behavior. Use when asked to clean up, simplify, restructure, or de-duplicate working code.

4 Updated 6 days ago
Amey-Thakur