refactor-safe
Skill15 starsChanged 5 months agoMITView on GitHub
Safe refactor in bounded scope (1-10 files, no behavior change). Use proactively for safe, bounded refactoring tasks.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- Markssuave/Markssuave-Agent-skillstheir own version, first seen Nov 8, 2026
- Vinix24/vnx-orchestrationtheir own version, first seen Nov 1, 2026
- AhmiDarrow/RemedyAItheir own version, first seen Oct 19, 2026
- 0King0P/Claude-Skillstheir own version, first seen Oct 13, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- AlpayC/claude-skill-settheir own version, first seen Sep 14, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- Vinix24/vnx-orchestration★ 63same name
- AhmiDarrow/RemedyAI★ 5same name
- aprameyak/coding-skills★ 1same name
- Markssuave/Markssuave-Agent-skills★ 1same name
- 0King0P/Claude-Skills★ 0same name
- AlpayC/claude-skill-set★ 0same name
- ccpowerpack/claude-code-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- public/llms-full.txtllms.txt
- public/llms.txtllms.txt
- add-componentSkill
- add-diagram-componentSkill
- add-languageSkill
- add-pageSkill
- ai-diff-reviewerSkill
- dailybotSkill
- deepworkplanSkill
- doc-editSkill
- fix-lintSkill
- git-commit-pushSkill
- pr-review-liteSkill
- quick-fixSkill
- responsive-lighthouse-auditSkill
- security-checkSkill
- translate-syncSkill
- type-fixSkill
- update-stylesSkill
- write-testsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 11 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Does NOT change public API or behavior
- Distinctive: line 25
Does NOT add new features
- Distinctive: line 26
Does NOT do large-scale or cross-module architecture changes
- Distinctive: line 27
Does NOT touch security-related logic without explicit scope
- Distinctive: line 48
Before running this skill, ensure:
- Distinctive: line 58
Run build and note current behavior
- Distinctive: line 65
Ensure each step keeps build working
- Very specific: line 70
Run pnpm run biome:check and pnpm run astro:check after each step
- Distinctive: line 71
Commit after each step if desired (incremental commits)
- Distinctive: line 118
Stop and escalate: if:
- Distinctive: line 135
Escalate to architect: if: cross-module design, API changes, or large-scale restructure needed.
- Very specific: line 148
Create src/lib/date.ts with formatDate function
- Very specific: line 149
Update MethodologyPage.astro to import from lib/
- Very specific: line 163
Create subcomponents (e.g., HeroTitle.astro, HeroActions.astro)
- Distinctive: line 164
Import in main component
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Refactor Safe
Objective
Refactor code in a bounded scope (1-10 files, up to ~500 LOC) without changing observable behavior. Extract functions, rename for clarity, reorder imports, split modules. Adapted for this repo: Astro, Svelte, TypeScript; follow docs/STANDARDS.md and AGENTS.md.
Non-Goals
- Does NOT change public API or behavior
- Does NOT add new features
- Does NOT do large-scale or cross-module architecture changes
- Does NOT touch security-related logic without explicit scope
Tier Classification
Tier: 2 - Standard
Reasoning: Moderate reasoning (dependencies, component impact); scope 1-10 files, 100-500 LOC; safe, reversible refactors only.
Inputs
Required Parameters
$TARGET: File(s) or directory to refactor (e.g.,src/components/pages/)$GOAL: What to refactor (e.g., "extract helper", "rename for clarity", "split into smaller components")
Optional Parameters
$CONSTRAINTS: What not to change (e.g., "keep component props unchanged")
Prerequisites
Before running this skill, ensure:
- Build passes (
pnpm run build) - Scope is clear and bounded (1-10 files)
- No concurrent changes to same files
Steps
Step 1: Establish Baseline
- Run build and note current behavior
- List files and dependencies in scope
- Identify what must not change (props, exports, behavior)
Step 2: Plan Refactor
- Break into small steps (extract one function, then rename, etc.)
- Ensure each step keeps build working
Step 3: Execute Step by Step
- One logical change at a time
- Run
pnpm run biome:checkandpnpm run astro:checkafter each step - Commit after each step if desired (incremental commits)
Step 4: Final Validation
pnpm run biome:check
pnpm run astro:check
pnpm run buildOutput Format
Success Output
## ✅ Refactor Safe Complete
### Target
{What was refactored}
### Changes
- `{file1}`: {what changed}
- `{file2}`: {what changed}
### Behavior
- No intentional behavior change
- Build passes
### Validation
- pnpm run biome:check: ✅
- pnpm run astro:check: ✅
- pnpm run build: ✅
### Commit Message
refactor: {brief description}Guardrails
Scope Limits
- Maximum files: 10
- Maximum LOC changed: 500
- Allowed: Extract, rename, reorder, split within same module/area
Stop Conditions
Stop and escalate if:
- Public API or behavior must change
- More than 10 files or 500 LOC
- Build starts failing and root cause is unclear
- Data flow significantly affected
Definition of Done
- Refactor goal achieved within scope
pnpm run biome:checkpassespnpm run astro:checkpassespnpm run buildpasses- No intentional behavior change
Escalation Conditions
Escalate to architect if: cross-module design, API changes, or large-scale restructure needed.
Examples
Example 1: Extract Utility Function
Input:
$TARGET: src/components/pages/MethodologyPage.astro
$GOAL: Extract date formatting to lib/Execution:
- Create
src/lib/date.tswithformatDatefunction - Update
MethodologyPage.astroto import from lib/ - Run validation
- Commit with
refactor: extract date formatting to lib/
Example 2: Split Large Component
Input:
$TARGET: src/components/home/HeroSection/HeroSection.astro
$GOAL: Split into smaller subcomponentsExecution:
- Identify logical sections
- Create subcomponents (e.g.,
HeroTitle.astro,HeroActions.astro) - Import in main component
- Run validation
- Commit with
refactor: split HeroSection into subcomponents
Related
- quick-fix - Small fixes
- write-tests - Add/expand tests
- reviewer - Review refactor
- architect - For design decisions
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

