- Replace all Jira-specific references with generic tracker/work-item terminology (TRACKER-ID, work item epics); delete project-management.mdc and mcp.json.example - Restructure refactor skill: extract 8 phases (00–07) and templates into separate files; add guided mode for pre-built change lists - Add Step 3 "Code Testability Revision" to existing-code workflow (renumber steps 3–12 → 3–13) - Simplify autopilot state file to minimal current-step pointer - Strengthen coding rules: AAA test comments per language, test failures as blocking gates, dependency install policy - Add Docker Suitability Assessment to test-spec and test-run skills (local vs Docker execution) - Narrow human-attention sound rule to human-input-needed only - Add AskQuestion fallback to plain text across skills - Rename FINAL_implementation_report to implementation_report_* - Simplify cursor-meta (remove _docs numbering table, quality thresholds) - Make techstackrule alwaysApply, add alwaysApply:false to openapi
2.6 KiB
Phase 4: Execution
Role: Orchestrator Goal: Execute all refactoring tasks by delegating to the implement skill Constraints: No inline code changes — all implementation goes through the implement skill's batching and review pipeline
4a. Pre-Flight Checks
- Verify refactoring task files exist in TASKS_DIR (created during Phase 2d):
- All
[TRACKER-ID]_refactor_*.mdfiles are present - Each task file has valid header fields (Task, Name, Description, Complexity, Dependencies)
- All
- Verify
TASKS_DIR/_dependencies_table.mdincludes the refactoring tasks - Verify all tests pass (safety net from Phase 3 is green)
- If any check fails, go back to the relevant phase to fix
4b. Delegate to Implement Skill
Read and execute .cursor/skills/implement/SKILL.md.
The implement skill will:
- Parse task files and dependency graph from TASKS_DIR
- Detect already-completed tasks (skip non-refactoring tasks from prior workflow steps)
- Compute execution batches for the refactoring tasks
- Launch implementer subagents (up to 4 in parallel)
- Run code review after each batch
- Commit and push per batch
- Update work item ticket status
Do NOT modify, skip, or abbreviate any part of the implement skill's workflow. The refactor skill is delegating execution, not optimizing it.
4c. Capture Results
After the implement skill completes:
- Read batch reports from
_docs/03_implementation/batch_*_report.md - Read the latest
_docs/03_implementation/implementation_report_*.mdfile - Write
RUN_DIR/execution_log.mdsummarizing:- Total tasks executed
- Batches completed
- Code review verdicts per batch
- Files modified (aggregate list)
- Any blocked or failed tasks
- Links to batch reports
4d. Update Task Statuses
For each successfully completed refactoring task:
- Transition the work item ticket status to Done via the configured tracker MCP
- If tracker unavailable, note the pending status transitions in
RUN_DIR/execution_log.md
For any failed or blocked tasks, leave their status as-is (the implement skill already set them to In Testing or blocked).
Self-verification:
- All refactoring tasks show as completed in batch reports
- All completed tasks have work item tracker status set to Done
- All tests still pass after execution
- No tasks remain in blocked or failed state (or user has acknowledged them)
RUN_DIR/execution_log.mdwritten with links to batch reports
Save action: Write RUN_DIR/execution_log.md
GATE: All refactoring tasks must be implemented. If any tasks failed, present the failures to the user and ask for guidance before proceeding to Phase 5.