npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin conarylabs-miraThis skill uses the workspace's default tool permissions.
<!-- plugin/skills/refactor/SKILL.md -->
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Requires: Claude Code Agent Teams feature.
Architect-planned, reviewer-validated code restructuring with per-step compilation checks.
Arguments: $ARGUMENTS
Parse arguments (optional):
Determine context: What code to refactor, the goal of the restructuring, and any constraints. If no context is obvious, ask the user what they'd like refactored.
Launch for analysis: Call the Mira launch MCP tool to get the architect agent spec:
launch(team="refactor-team", scope=user_context, members="atlas")
Create the team:
TeamCreate(team_name=result.data.suggested_team_id)
Create and assign the analysis task:
TaskCreate(subject=atlas_agent.task_subject, description=atlas_agent.task_description)
TaskUpdate(taskId=id, owner="atlas", status="in_progress")
Spawn Atlas (architect) using Task tool:
Task(
subagent_type="general-purpose",
name="atlas",
model=atlas_agent.model,
team_name=result.data.suggested_team_id,
prompt=atlas_agent.prompt + "\n\n## Refactoring Goal\n\n" + user_context,
run_in_background=true
)
IMPORTANT: Do NOT use mode="bypassPermissions" -- Atlas is read-only.
IMPORTANT: Always pass model="sonnet" to the Task tool. This ensures read-only agents use a cost-efficient model.
Wait for Atlas to report via SendMessage.
Launch for validation: Call launch to get the reviewer agent spec:
launch(team="refactor-team", scope=user_context, members="iris")
Spawn Iris (safety reviewer) using Task tool:
Task(
subagent_type="general-purpose",
name="iris",
model=iris_agent.model,
team_name=result.data.suggested_team_id,
prompt=iris_agent.prompt + "\n\n## Refactoring Plan\n\n" + atlas_plan,
run_in_background=true
)
IMPORTANT: Do NOT use mode="bypassPermissions" -- Iris is read-only.
IMPORTANT: Always pass model="sonnet" to the Task tool. This ensures read-only agents use a cost-efficient model.
Send Atlas's plan to Iris via SendMessage so she has the specific plan to validate.
Create and assign the validation task.
Wait for Iris to report via SendMessage. Then shut down both analyst agents.
Combine Atlas's plan with Iris's feedback:
Present the validated refactoring plan to the user and WAIT for approval.
Execute the refactoring steps yourself. For each step:
cargo test --no-run to verify compilation (NEVER use --release)For large refactors (5+ files), launch implementation agents:
launch(team="refactor-team", scope=implementation_plan, members="ash")
Spawn implementation agents with mode="bypassPermissions":
cargo test --no-runLaunch for verification: Call launch to get the verifier agent spec:
launch(team="refactor-team", scope=summary_of_changes, members="ash")
Spawn Ash (build verifier) using Task tool:
Task(
subagent_type="general-purpose",
name="ash",
model=ash_agent.model,
team_name=result.data.suggested_team_id,
prompt=ash_agent.prompt + "\n\n## Changes Made\n\n" + summary_of_changes,
run_in_background=true,
mode="bypassPermissions"
)
Wait for Ash to report. If tests fail: fix regressions or update test imports/paths.
shutdown_request to remaining agents, then TeamDelete./mira:refactor
-> Prompts for what to refactor, then runs the full analysis -> validation -> implementation cycle
/mira:refactor Split the database module into separate files per concern
-> Atlas analyzes the DB module, plans the split, Iris validates, then implements
/mira:refactor Rename the "watcher" module to "file_monitor" across the codebase
-> Safe rename with caller analysis and per-step compilation checks
| Phase | Agent | Focus |
|---|---|---|
| Analysis | Atlas (architect) | Map current structure, design target, plan migration steps |
| Validation | Iris (safety reviewer) | Verify completeness, check for hidden behavior changes |
| Verification | Ash (build verifier) | Run tests, compilation, linters between steps |