Skip to content
Agentmart
Submit a tool

refactor-safe

Use for safe refactors that preserve behavior.

Skill by mtvrkan

IndexedMIT★ 10
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/mtvrkan-refactor-safe

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use for safe refactors that preserve behavior. Keep diffs small and verification strong.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/refactor-safe

Tools it pre-approves 6

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read,
  • Grep,
  • Glob,
  • Bash,
  • Edit,
  • Write

What's inside

Skill name
refactor-safe
Description
Use for safe refactors that preserve behavior. Keep diffs small and verification strong.
License
MIT
Allowed tools
Read,, Grep,, Glob,, Bash,, Edit,, Write
Instructions
23 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# refactor-safe

Behavior must be identical before and after. If tests don't exist: write them FIRST, then refactor.

1. One concern per diff: rename | move | extract | restructure — never combine two.
2. Run tests before edit, record baseline. Apply ONE mechanical transformation only. Run same tests after — must be identical pass/fail.
3. Diffs >150 lines → split into sequential mini-refactors. No features/bugfixes in same diff.
4. Read budget: refactored file + grep for symbol importers + existing test file. Imports updated across independent files → apply in one parallel batch.

5. Refactor that moves a module boundary (extract, restructure): run `/arch-check` before and after. The point of a boundary refactor is that violations go down — unmeasured, "cleaner" is an opinion.

Deep reference: `${CLAUDE_PLUGIN_ROOT}/agent_docs/testing-strategy.md` (baseline coverage before refactor) · `${CLAUDE_PLUGIN_ROOT}/agent_docs/architecture.md` (module boundary rules).

## Output

```text
CONCERN: [rename | move | extract | restructure]
· [files changed — count]
TEST BEFORE: [N passed] → TEST AFTER: [N passed — ✓ identical]
RISK: low
```

From mtvrkan/senior-dev-kit, MIT.

More from mtvrkan/senior-dev-kit

Signals

Stars
10
Forks
0
Open issues
0
Last commit (this folder)
Oct 5, 2026 (24 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from mtvrkan

Cite this page

refactor-safe skill. Agent Mart. https://agentmart.dev/skills/mtvrkan-refactor-safe (last updated 2026-10-24)