Orchestrate full implementation workflow from issue to completion (creates branch, docs, tests, and first milestone)
Orchestrate full implementation workflow from issue to completion (creates branch, docs, tests, and first milestone)
/plugin marketplace add Synthesys-Lab/agentize/plugin install synthesys-lab-agentize@Synthesys-Lab/agentizeissue-numberOrchestrate the complete implementation workflow from a GitHub issue with an implementation plan to a fully implemented feature.
/issue-to-impl [issue-number]
Arguments:
issue-number (optional): GitHub issue number to implement. If not provided, extracted from conversation context.From arguments or conversation:
From GitHub issue (via gh issue view):
From git:
Branch created:
issue-{N}Files created/modified:
.milestones/issue-{N}-milestone-{M}.md (one or more milestone documents)Git commits:
Terminal output:
If $ARGUMENTS provided, use as issue number. Otherwise:
Check current branch:
git branch --show-current
Parse branch name:
issue-{N}-* (e.g., issue-42-add-feature → 42)Decision:
issue-{N}-* AND extracted N equals requested issue → Skip Step 3 (branch creation)If Step 2 detected matching branch:
fork-dev-branch invocationOtherwise, invoke: fork-dev-branch skill
Input: Issue number from Step 1
Output: New branch issue-{N}, switched to that branch
Skill handles:
gh issue view {N} --json stategit checkout -b issue-{N}Error handling:
Purpose: Ensure the current issue branch is rebased onto latest origin/main or origin/master to minimize late-stage merge conflicts.
Re-check current branch:
git branch --show-current
Verify we're on the expected issue branch (issue-{N}-*).
Enforce clean working tree:
git status --porcelain
Error handling:
Error: Working directory has uncommitted changes.
Please commit or stash your changes before syncing:
git add .
git commit -m "..."
OR
git stash
Stop execution.Detect default branch:
# Try main first, fall back to master
if git rev-parse --verify origin/main >/dev/null 2>&1; then
DEFAULT_BRANCH="main"
elif git rev-parse --verify origin/master >/dev/null 2>&1; then
DEFAULT_BRANCH="master"
else
echo "Error: Neither origin/main nor origin/master found"
exit 1
fi
Fetch and rebase:
git fetch origin
git rebase origin/$DEFAULT_BRANCH
Error handling:
Error: Rebase conflict detected.
To resolve:
1. Fix conflicts in the files listed above
2. Stage resolved files: git add <file>
3. Continue: git rebase --continue
OR abort: git rebase --abort
Stop execution.Success output:
Synced with origin/{DEFAULT_BRANCH}: branch up to date
Important note: This step syncs the current issue branch with upstream. This is different from /sync-master, which syncs the main/master branch itself before PR creation.
Proceed to Step 4.
Fetch issue body:
gh issue view {issue-number} --json body --jq '.body'
Parse body to extract:
Error handling:
Error: Issue #{N} does not have an implementation plan.
The issue must have a "Proposed Solution" section with:
- Implementation steps
- Files to modify/create
- LOC estimates
- Test strategy
Stop execution.Based on plan: Identify documentation steps from "Documentation Planning" section
For each documentation file in plan:
Read tool if file exists (for updates)Edit or Write tool to create/modify file--diff mode)Create documentation commit:
# Stage only documentation files
git add docs/ README.md **/*.md
# Verify staged files
git diff --cached --name-only
Invoke: commit-msg skill
Input:
delivery[docs]Track: Documentation commit SHA for milestone reference
Note: This creates a separate [docs] commit before tests/implementation, enabling:
Based on plan: Identify test steps (usually Step 2 or Steps N+1-M)
For each test file in plan:
Write tool to create new test filesEdit tool to update existing test filesset -e)Track: Test files created/modified for Milestone 1 commit
Stage files with verification:
# Stage all changes
git add .
# CRITICAL: Verify staged files before proceeding
git diff --cached --name-only
Pre-commit checklist:
.milestones/ files staged (these are local-only checkpoints)If .milestones/ files appear in staged files:
# Unstage milestone files immediately
git restore --staged .milestones/
Create milestone document:
.milestones/issue-{N}-milestone-1.mdInvoke: commit-msg skill
Input:
milestone{N}"0/{total} tests passed"
Output: Milestone commit created with --no-verify flagInform user:
Milestone 1 created: Documentation and tests complete (0/{total} tests passed)
Starting automatic implementation loop...
Invoke: milestone skill
Input:
Milestone skill behavior:
make test or specific test commands)git diff --statHandle milestone skill output:
Output A: Milestone created
Milestone {M} created at {LOC} LOC ({passed}/{total} tests passed).
Work remaining: ~{estimated} LOC
Tests failing: {list}
Resume with: "Continue from the latest milestone"
Command stops. User must resume with natural language (e.g., "Continue from the latest milestone").
Output B: All tests pass (completion)
All tests passed ({total}/{total})!
Implementation complete:
- Total LOC: ~{LOC}
- All {total} tests passing
Next steps:
1. Create a delivery commit (without [milestone] tag)
2. Review the changes with /code-review
3. Create PR with /open-pr
CRITICAL - Create delivery commit on completion:
When milestone skill signals completion (all tests pass), invoke commit-msg skill:
delivery (NOT milestone)--no-verify flag (pre-commit hooks run)[milestone] tagStage and commit:
git add .
git diff --cached --name-only # Verify no .milestones/ files
Then invoke commit-msg skill with purpose=delivery and appropriate tags based on the changes.
Command completes successfully after delivery commit is created.
Output C: Critical error
Critical errors detected. Milestone {M} created with error notes.
Errors:
- {error descriptions}
Resume with: "Continue from the latest milestone"
Command stops. User must fix errors and resume with natural language.
gh issue view {issue-number}
# Exit code: non-zero
Response:
Error: Issue #{issue-number} not found in this repository.
Please provide a valid issue number.
Stop execution.
gh issue view {issue-number} --json state
# Output: {"state": "CLOSED"}
Response:
Warning: Issue #{issue-number} is CLOSED.
Continue implementing a closed issue?
Wait for user confirmation before proceeding.
Scenario 1: Branch matches requested issue
git branch --show-current
# Output: issue-42
# Requested issue: 42
Response: Step 2 detects match. Step 3 skips branch creation and outputs:
Already on issue-42 branch
Continue to Step 4.
Scenario 2: Branch mismatch (on issue-M, requesting issue-N where M ≠ N)
git branch --show-current
# Output: issue-45
# Requested issue: 42
Response:
Warning: Currently on issue-45 branch, but requested issue 42.
Continue on this branch or switch to main and create new branch?
Wait for user choice.
Issue body does not contain "Proposed Solution" section.
Response:
Error: Issue #{N} does not have an implementation plan.
The issue body must include a "Proposed Solution" section.
Stop execution.
gh issue view {N}
# Error: authentication required
Response:
Error: GitHub CLI is not authenticated.
Run: gh auth login
Stop execution.