Perform holistic review of completed refactoring, validate improvements, and create follow-up tasks if needed
Validates completed refactoring work, identifies remaining issues, and creates follow-up tasks if needed.
/plugin marketplace add jamie-bitflight/claude_skills/plugin install plugin-creator@jamie-bitflight-skills<task-file-path>sonnetensure-complete/You MUST perform a holistic review and validation of the completed plugin refactoring. This workflow validates that the refactoring achieved its goals, improved the plugin score, and follows project standards. If issues are found, follow-up task files are created for resolution.
<task_file> $ARGUMENTS </task_file>
EXECUTE this multi-phase review workflow to validate refactoring completeness. This workflow is recursive - if the review creates follow-up tasks, the orchestrator should run /implement-refactor again until no more tasks are generated.
IMMEDIATELY after reading this command, you MUST create todos using TodoWrite:
TodoWrite(todos=[
{"content": "Phase 1: Plugin Validation - Re-assess plugin structure and score", "status": "pending", "activeForm": "Running plugin validation"},
{"content": "Phase 2: Code Review - Validate refactored code quality", "status": "pending", "activeForm": "Running code review"},
{"content": "Phase 3: Documentation Audit - Check for documentation drift", "status": "pending", "activeForm": "Running documentation audit"},
{"content": "Phase 4: Gap Identification - Create follow-up tasks if needed", "status": "pending", "activeForm": "Identifying gaps and creating follow-up tasks"},
{"content": "Final: Display completion summary and next steps", "status": "pending", "activeForm": "Displaying completion summary"}
])
RULES:
in_progress BEFORE starting that workcompleted AFTER the phase finishescompletedObjective: Re-run plugin assessment to measure improvement from refactoring.
Action: LAUNCH the plugin-assessor agent using the Task tool:
Task(
subagent_type="plugin-assessor",
prompt="""
Your ROLE_TYPE is sub-agent.
<task_file>
$ARGUMENTS
</task_file>
<context>
WHERE you are validating:
- Extract plugin path from task file header
- Compare against original assessment scores
WHAT to validate:
1. Plugin structure is valid after refactoring
2. All links resolve correctly
3. No orphaned files remain (that weren't marked for removal)
4. Frontmatter validates against schema
5. Score improved from original assessment
</context>
<success_criteria>
MUST deliver:
1. Post-refactoring assessment score
2. Comparison with pre-refactoring score (from REFACTOR-PLAN.md)
3. List of any remaining issues
4. STATUS: DONE or BLOCKED response
</success_criteria>
<instructions>
1. READ the task file to understand what was refactored
2. IDENTIFY the plugin path from task metadata
3. RUN full plugin assessment protocol
4. COMPARE scores with original (from .claude/plan/REFACTOR-PLAN.md)
5. RETURN STATUS output with validation findings
</instructions>
"""
)
Phase 1 Completion Requirements:
After the plugin-assessor agent completes:
=== PHASE 1 COMPLETE: Plugin Validation ===
Status: [DONE/BLOCKED]
Original Score: [X/100]
New Score: [Y/100]
Improvement: [+Z points]
Remaining Issues: [count]
- [issue description if any]
completedThe plugin-assessor agent MUST validate these plugin components against authoritative schemas:
Validate against authoritative plugin.json schema from claude-plugins-reference-2026:
Required checks:
# Validate plugin structure
claude plugin validate {plugin-directory}
Common plugin.json issues after refactoring:
| Issue | Cause | Fix |
|---|---|---|
agents: Invalid input | Used "./agents/" directory string instead of array | Change to array of file paths: ["./agents/file1.md", "./agents/file2.md"] |
name: Required | Missing required name field | Add "name": "plugin-name" in kebab-case |
| Invalid path format | Absolute paths or missing ./ prefix | All paths must be relative and start with ./ |
| Referenced file doesn't exist | Path in plugin.json points to moved/deleted file | Update paths to match new file locations after refactoring |
SOURCE: Lines 25-92 of claude-plugins-reference-2026/SKILL.md
If plugin includes hooks, validate hook configuration:
Hook validation checklist:
${CLAUDE_PLUGIN_ROOT} variablechmod +x script.sh)Valid hook events:
SOURCE: Lines 186-227 of claude-plugins-reference-2026/SKILL.md
If plugin bundles MCP servers, validate MCP configuration:
MCP validation checklist:
.mcp.json or inline in plugin.json)${CLAUDE_PLUGIN_ROOT} for plugin-relative pathsargs arrays are properly formattedSOURCE: Lines 235-270 of claude-plugins-reference-2026/SKILL.md
If plugin provides LSP servers, validate LSP configuration:
LSP validation checklist:
.lsp.json or inline in plugin.json)extensionToLanguage mapping is defined for all supported file typescommand references binary in PATH or uses absolute path with ${CLAUDE_PLUGIN_ROOT}IMPORTANT: LSP servers require separate binary installation. Plugin only configures connection, doesn't bundle the server.
Example LSP validation error:
LSP server 'gopls' not found in $PATH
→ User must install separately: go install golang.org/x/tools/gopls@latest
SOURCE: Lines 271-338 of claude-plugins-reference-2026/SKILL.md
CRITICAL: Plugins are copied to cache directory during installation. Validate path resolution:
Path resolution warnings to check:
../ parent directory references (will break after caching)./ prefix${CLAUDE_PLUGIN_ROOT} used in all hook/MCP/LSP commandsCommon caching issues:
| Issue | Problem | Solution |
|---|---|---|
../shared-utils reference | Parent directory not copied to cache | Use symlink or restructure marketplace to include shared dir |
Hook script uses relative path without ./ | Ambiguous path resolution | Change to ./scripts/hook.sh or use ${CLAUDE_PLUGIN_ROOT} |
| MCP server references user home directory | Won't work for other users | Use plugin-relative paths or environment variables |
SOURCE: Lines 349-398 of claude-plugins-reference-2026/SKILL.md
Document any agents referenced in tasks that are NOT included in the plugin:
Action if external agent required:
~/.claude/agents/ or project .claude/agents/Objective: Validate that refactored skills, agents, and documentation follow project standards.
Action: LAUNCH the python-code-reviewer agent using the Task tool:
Task(
subagent_type="python-code-reviewer",
prompt="""
Your ROLE_TYPE is sub-agent.
<task_file>
$ARGUMENTS
</task_file>
<context>
WHERE you are reviewing:
- Plugin directory from task file
- All files created or modified during refactoring
WHAT to validate:
1. Skills follow Claude Code skill format
2. Agents follow prompt engineering best practices
3. Reference files are properly linked
4. Frontmatter is correctly formatted
5. No broken cross-references
</context>
<success_criteria>
MUST deliver:
1. Code review findings categorized by severity
2. List of issues requiring follow-up tasks
3. STATUS: DONE or BLOCKED response
</success_criteria>
<instructions>
1. READ the task file to understand what was changed
2. IDENTIFY all files modified from task "Expected Outputs"
3. REVIEW each file against skill/agent format standards
4. CHECK all links and cross-references
5. RETURN STATUS output with review findings
</instructions>
"""
)
Phase 2 Completion Requirements:
After the code-reviewer agent completes:
=== PHASE 2 COMPLETE: Code Review ===
Status: [DONE/BLOCKED]
Files Reviewed: [count]
Issues Found: [count]
- Critical: [count]
- High: [count]
- Medium: [count]
- Low: [count]
completedObjective: Check if plugin documentation has drifted from the refactored implementation.
Action: LAUNCH the doc-drift-auditor agent using the Task tool:
Task(
subagent_type="doc-drift-auditor",
prompt="""
Your ROLE_TYPE is sub-agent.
<task_file>
$ARGUMENTS
</task_file>
<context>
WHERE you are auditing:
- Plugin README.md
- Skill SKILL.md files
- Agent .md files
- Reference documentation
WHAT changed during refactoring:
- Skills may have been split
- Agents may have new descriptions
- Documentation structure may have changed
</context>
<success_criteria>
MUST deliver:
1. Audit of README.md accuracy
2. Cross-reference validation
3. List of drift items
4. STATUS: DONE or BLOCKED response
</success_criteria>
<instructions>
1. READ the task file to understand what was refactored
2. IDENTIFY all documentation files that should reflect changes
3. COMPARE documented capabilities vs actual implementation
4. IDENTIFY any drift or missing documentation
5. RETURN STATUS output with audit findings
</instructions>
"""
)
Phase 3 Completion Requirements:
After the doc-drift-auditor agent completes:
=== PHASE 3 COMPLETE: Documentation Audit ===
Status: [DONE/BLOCKED]
Documentation Files Checked: [count]
Drift Items Found: [count]
- README outdated: [yes/no]
- Missing skill docs: [count]
- Broken references: [count]
completedObjective: Analyze all findings and create follow-up task file if issues require resolution.
Action: Based on findings from Phases 1-3, determine if follow-up tasks are needed.
Decision Logic:
IF (score_improvement < expected) OR
(critical_issues > 0) OR
(high_issues > 2) OR
(drift_items > 0):
→ CREATE follow-up task file
ELSE:
→ Refactoring is complete
If follow-up tasks needed, CREATE a new task file:
Task(
subagent_type="swarm-task-planner",
prompt="""
Your ROLE_TYPE is sub-agent.
<findings>
Phase 1 Issues: [list from plugin validation]
Phase 2 Issues: [list from code review]
Phase 3 Issues: [list from documentation audit]
</findings>
<context>
WHERE to write:
- Task file: .claude/plan/tasks-refactor-{plugin-slug}-followup-{N}.md
- N = next sequential number
WHAT to include:
- Tasks for each unresolved issue
- Appropriate agent assignments
- Dependency mapping
</context>
<success_criteria>
MUST deliver:
1. Follow-up task file created
2. All issues mapped to tasks
3. STATUS: DONE response with file path
</success_criteria>
<instructions>
1. ANALYZE all issues from phases 1-3
2. GROUP related issues into tasks
3. ASSIGN appropriate agents
4. WRITE follow-up task file
5. UPDATE REFACTOR-PLAN.md with follow-up reference
6. RETURN STATUS with file path
</instructions>
"""
)
Phase 4 Completion Requirements:
After determining follow-up status:
=== PHASE 4 COMPLETE: Gap Identification ===
Follow-up Tasks Needed: [YES/NO]
[If YES]:
Follow-up Task File: .claude/plan/tasks-refactor-{slug}-followup-{N}.md
Tasks Created: [count]
[If NO]:
All issues resolved or within acceptable thresholds
completedBEFORE displaying the final summary, YOU MUST:
completedpending or in_progress, go back and complete the missing workin_progress<final_summary_structure>
================================================================================
REFACTORING COMPLETION WORKFLOW FINISHED
================================================================================
Task File: $ARGUMENTS
Plugin: {plugin_name}
PHASE RESULTS:
--------------
Phase 1 - Plugin Validation: [DONE/BLOCKED]
Original Score: [X/100]
New Score: [Y/100]
Improvement: [+Z points]
Phase 2 - Code Review: [DONE/BLOCKED]
Issues Found: [count]
Phase 3 - Documentation Audit: [DONE/BLOCKED]
Drift Items Found: [count]
Phase 4 - Gap Identification: [DONE/BLOCKED]
Follow-up Tasks Created: [yes/no]
FOLLOW-UP TASKS:
----------------
[If tasks were created, list them here]
- .claude/plan/tasks-refactor-{slug}-followup-{N}.md
NEXT STEPS:
-----------
[If follow-up tasks exist]:
→ Run: /implement-refactor {followup-task-file} to continue refactoring
[If no follow-up tasks]:
→ Refactoring is COMPLETE
→ Plugin score improved from [X] to [Y]
→ Update REFACTOR-PLAN.md to move entry to Completed section
================================================================================
</final_summary_structure>
completedThis workflow supports recursive validation:
/implement-refactor to address those tasks/complete-refactor again on the new task fileThis ensures the plugin is truly refactored and meets all quality standards.
When refactoring is complete (no follow-up tasks):
## Completed Refactoring Projects
| Plugin | Task File | Completion Date | Score Improvement |
| ------------------- | ------------------------------------ | --------------- | ----------------- |
| python3-development | tasks-refactor-python3-development.md | 2026-01-21 | 72 → 91 (+19) |
IF any agent returns BLOCKED:
/complete-refactor after resolvingIF task file path is invalid: