safe-refactor-code
Installation
SKILL.md
Safe Refactor Code
Refactor code in small verified slices, then update the repo's continuity files so future agents can resume without rereading the whole session.
Core Rules
- Treat
AGENTS.mdat repo root as the main long-term repo memory. Preserve existing content and update it carefully instead of rewriting blindly. - Keep agent-local
MEMORY.mdshort. It is a working summary for the repo, not a replacement for any shared or tool-managed memory system. - Keep
safe-refactor-code.mdfocused on the repo's refactor rules, guardrails, and recurring cleanup workflow. .safe-code/CHANGELOG.md: under safe-code, only releasable changes, in safe-code's Keep-a-Changelog template (## [Unreleased]+ typed subsections; the file is created on the first releasable change). Standalone, use today's dated section (## [YYYY-MM-DD], below).- Prefer additive or scoped edits to docs. Do not wipe user-written history unless the user explicitly asks.
- After refactors, scan for obvious dead code, unused imports, stale helpers, and outdated doc references before finishing.
- Use the codegraph index when available. Fall back to direct source search and verification when it is unavailable or empty.