Safe code refactoring combining Sherpa's refactor workflow, Julie's reference checking and safe renaming, and Goldfish's before/after checkpointing. Activates for code improvement with systematic testing, refactoring, and verification. Use when cleaning up or improving existing code.
Safe refactoring workflow combining test-first approach, safe renaming, and before/after checkpointing. Activates when you request code cleanup, reorganization, or improvements to ensure systematic, test-protected changes with full verification.
/plugin marketplace add anortham/mcp-toolbox-workflows/plugin install anortham-mcp-toolbox-workflows@anortham/mcp-toolbox-workflowsThis skill is limited to using the following tools:
Perform safe, systematic code refactoring with test protection and full tracking. Combines Sherpa's refactor workflow guidance, Julie's safe refactoring tools, and Goldfish's before/after state preservation.
Sherpa: Guides refactor phases (Tests → Refactor → Verify) Julie: Safe renames, reference checking, impact analysis Goldfish: Pre/post state checkpoints, decision tracking
1. Goldfish: checkpoint({ description: "Pre-refactor baseline: [current state]" })
2. Sherpa: approach({ workflow: "refactor" })
3. Julie: get_symbols → Capture current structure
guide() → "Ensure test coverage exists"
Check existing tests:
- Run test suite
- Verify coverage for code being refactored
- Add missing tests if needed
checkpoint({ description: "Verified test coverage for [component]" })
guide({ done: "test coverage verified" })
guide() → "Refactor while staying green"
Julie safe refactoring:
- fast_refs → Check all references before rename
- rename_symbol → Workspace-wide safe rename
- fuzzy_replace → Targeted improvements
- Tests stay green throughout!
checkpoint({ description: "Refactored: [specific changes made]" })
guide({ done: "refactoring complete, tests still green" })
guide() → "Verify no regressions"
Verification:
- Run full test suite → All green
- get_symbols → Verify structure
- fast_refs → Check updated references
checkpoint({ description: "Refactor verified: all tests pass, [N] files updated" })
guide({ done: "verified refactor, all tests pass" })
User: "This UserService is too big, extract validation logic"
PRE-REFACTOR:
→ checkpoint({ description: "Pre-refactor: UserService 487 lines with inline validation" })
→ approach({ workflow: "refactor" })
PHASE 1: TESTS
→ guide()
→ Run tests → 23 tests pass ✅
→ checkpoint({ description: "Verified UserService has 23 passing tests" })
PHASE 2: REFACTOR
→ guide()
→ Julie: Create UserValidator class
→ Julie: fuzzy_replace to extract validation methods
→ Julie: rename_symbol to update references
→ Tests → 23 tests still pass ✅
→ checkpoint({ description: "Extracted UserValidator class, UserService now 312 lines" })
PHASE 3: VERIFY
→ guide()
→ fast_refs({ symbol: "UserService" }) → All references updated
→ get_symbols → Structure cleaner
→ Full test suite → 23 tests pass ✅
→ checkpoint({ description: "Refactor complete: UserService 312 lines, UserValidator 175 lines, all 23 tests pass" })
Result: Clean separation, all tests green, tracked in Goldfish!
✅ DO:
❌ DON'T:
Safe refactoring: Test → Refactor → Verify. Sherpa guides, Julie protects, Goldfish preserves!
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.