Execute Workplan
Selects and executes a workplan from .workplans/Pending/ based on priority.
Priority Order
| Priority | Label |
|---|---|
| P0 | CONT |
| P1 | CRITICAL |
| P2 | BUG |
| P3 | MAINT |
| P4 | DOC |
| P5 | FEAT |
Select highest priority. If tied, pick oldest.
Workflow
Step 1: Find Workplan
Scan .workplans/Pending/ and select by priority:
ls .workplans/Pending/*.md
Step 2: Move to Inprogress
mv .workplans/Pending/issue-{number}-*.md .workplans/Inprogress/
Step 3: Set GitHub Issue to INPROGRESS
Use GitHub CLI to update labels:
gh issue edit {number} --add-label "INPROGRESS" --remove-label "PLANCREATED"
Step 4: Verify Documentation
Before executing, ensure docs are current:
Check memory:
search_nodes → Find relevant knowledge
open_nodes → Get stored details
Fetch fresh docs if needed:
resolve-library-id → Get Context7 ID
query-docs → Get current documentation
Update memory with any new knowledge fetched.
Step 5: Execute Workflow
- Ensure correct branch (create
impl/issue-{number}-{slug}if on main) - Read and follow plan steps
- Create/modify files in
src/dev/ - Create tests in
src/Tests/ - Run tests to verify
Step 6: Move to Done
mv .workplans/Inprogress/issue-{number}-*.md .workplans/Done/
Step 7: Write Summary Report
Create a summary report in .workplanReports/:
.workplanReports/issue-{number}-{slug}-report.md
Report format:
# Workplan Report: Issue #{number}
**Title**: {title}
**Priority**: {label}
**Completed**: {date}
**Branch**: {branch_name}
## Summary
[What was accomplished]
## Files Changed
- `src/dev/...`
- `src/Tests/...`
## Tests
- [Test results summary]
## Notes
- [Any relevant observations]
Step 8: Archive Original Workplan
Move workplan to archive:
mv .workplans/Done/issue-{number}-*.md .workplanReports/originalWorkplans/
Step 9: Commit Changes
git add .
git commit -m "feat(#{number}): complete {short_description}
- Implemented {summary}
- Added tests
- Closes #{number}"
Step 10: Create Pull Request
git push -u origin HEAD
gh pr create --title "feat(#{number}): {title}" --body "$(cat <<'EOF'
## Summary
{summary_of_changes}
## Test Plan
- {test_details}
Closes #{number}
EOF
)"
Step 11: Set GitHub Issue to Complete
Use GitHub CLI to close the issue:
gh issue close {number} --reason completed
Handling Large/Interrupted Work
If the issue is too large or you are interrupted:
-
Commit current progress:
git add . git commit -m "wip(#{number}): partial progress on {description}" -
Create continuation issue:
gh issue create --title "CONT: {original_title} (continued from #{number})" \ --body "Continuation of #{number}
Remaining Work
{remaining_steps}"
--label "CONT"
3. **Update original issue** with reference to continuation
4. **Leave workplan in Inprogress** with notes on what remains
---
## Output
Report at each stage:
- Plan selected and priority
- Branch name
- Current step executing
- Files created/modified
- Test status
- PR link when created
## Example
Selected: issue-42-fix-authentication-timeout.md (P2: BUG)
→ Moved to Inprogress → GitHub #42 labeled INPROGRESS
Executing plan...
- Modified: src/dev/auth/session.ts
- Created: src/Tests/auth/session.test.ts
- Tests: 5/5 passing
→ Moved to Done → Report: .workplanReports/issue-42-fix-authentication-timeout-report.md → Archived: .workplanReports/originalWorkplans/issue-42-fix-authentication-timeout.md → Committed: feat(#42): fix authentication timeout → PR created: https://github.com/owner/repo/pull/43 → Issue #42 closed as completed
