Create a detailed refactor plan with tiny commits via user interview, then file it as a Jira ticket. Use when planning a refactor, creating a refactoring RFC, or breaking a refactor into safe incremental steps.
From claude-toolkitnpx claudepluginhub johwer/marketplace --plugin claude-toolkitThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Create a structured refactor plan through deep interview and codebase exploration, then file it as a Jira ticket for the team.
$ARGUMENTS
Ask the user for a detailed description of:
Use the Explore agent to understand the current state:
Report back: "Here's what I found..." before proceeding.
Present 2-3 alternative approaches before interviewing on implementation. Ask:
This surfaces assumptions and ensures the planned solution is the right one.
Go deep on the specifics. Be thorough — vague plans produce bad refactors:
Check the current test coverage of the area:
If coverage is insufficient, ask: "There are no tests covering [area]. How do you want to handle this — write characterization tests first, or proceed carefully with manual verification?"
Don't proceed until there's a clear answer. Refactors without tests are the highest-risk code changes in the codebase.
Break the refactor into the smallest possible commits. Follow Martin Fowler's rule: every commit leaves the codebase in a working state. Tests pass after every single step.
Format each commit as:
[n]. <verb> <what changes>
Why: <one sentence on why this step is isolated>
Risk: <low / medium — and what could go wrong>
Example pattern for a service extraction:
1. Add INewService interface (no implementation yet)
Why: Establishes the contract before touching anything
Risk: Low — additive only
2. Implement NewService behind the interface (not wired up)
Why: Build and test in isolation before integrating
Risk: Low — not called yet
3. Wire NewService into DI container alongside OldService
Why: Both exist simultaneously — no callers broken
Risk: Low — parallel run
4. Migrate callers one at a time to NewService
Why: Each migration is independently rollbackable
Risk: Medium — test each caller after migration
5. Delete OldService
Why: Cleanup only after all callers verified
Risk: Low — all callers already migrated
Write the plan to /tmp/refactor-plan-<slug>.txt then create the ticket:
acli jira workitem create \
--project PLRS \
--type Task \
--title "Refactor: <concise title>" \
--body-file /tmp/refactor-plan-<slug>.txt
Use this template for the body (plain text — no Jira wiki markup):
PROBLEM STATEMENT
-----------------
<The problem from the developer's perspective. Why does this need fixing?>
SOLUTION
--------
<The chosen approach and why it was selected over alternatives.>
COMMIT PLAN
-----------
<The full tiny-commit breakdown from Step 6. Be detailed.>
DECISIONS
---------
- Modules affected: <list>
- Interface changes: <describe — no file paths>
- Schema/migration changes: <describe or "none">
- API contract changes: <describe or "none">
- Key architectural decisions made: <list>
TESTING APPROACH
----------------
- What makes a good test here: only test external behavior, not internals
- Modules to test: <list>
- Existing test patterns to follow: <reference similar test files by description, not path>
- Coverage gaps to address first: <if any>
OUT OF SCOPE
------------
<Explicitly list what is NOT changing in this refactor.>
NOTES
-----
<Anything else the implementer should know.>
After creating the ticket, print the ticket key and a one-line summary of the plan.
/workspace-launch <TICKET_KEY>)"