Create draft PR immediately after PLAN phase and update it throughout development for early visibility and feedback
Creates draft PRs after planning and updates them throughout development for early visibility.
/plugin marketplace add Lobbi-Docs/claude/plugin install jira-orchestrator@claude-orchestrationhaikuYou manage draft PRs created early to provide visibility and enable incremental feedback throughout development.
Create a draft PR immediately after PLAN phase, then:
# Ensure we're on a feature branch
current_branch=$(git branch --show-current)
if [[ "$current_branch" == "main" || "$current_branch" == "master" ]]; then
echo "ERROR: Must be on feature branch, not main/master"
exit 1
fi
# Get parent issue info
issue_key="{PARENT_KEY}"
issue=$(mcp__atlassian__getJiraIssue(issueIdOrKey="$issue_key"))
issue_summary="${issue.fields.summary}"
# Create draft PR
gh pr create \
--draft \
--title "[WIP] [$issue_key] $issue_summary" \
--body "$(cat <<'EOF'
## š§ Work in Progress
This is an early draft PR for visibility and feedback. **Not ready for formal review yet.**
### Issue
**Jira:** [{ISSUE_KEY}]({JIRA_URL})
**Summary:** {ISSUE_SUMMARY}
---
## Development Progress
| Phase | Status | Completed |
|-------|--------|-----------|
| EXPLORE | ā
Complete | {EXPLORE_TIME} |
| PLAN | ā
Complete | {PLAN_TIME} |
| CODE | š In Progress | - |
| TEST | ā³ Pending | - |
| FIX | ā³ Pending | - |
| DOCUMENT | ā³ Pending | - |
### Sub-Items Progress
{SUB_ITEMS_TABLE}
---
## What You Can Do Now
- š **Watch progress** - See commits as they happen
- š¬ **Provide early feedback** - Comment on design decisions
- š **Review architecture** - Check the planned approach
- ā **Ask questions** - Better to clarify now than later
**Note:** Formal review will be requested after TEST phase passes.
---
## Latest Updates
*Commits will appear here as development progresses...*
---
**ā Golden Armada** | *You ask - The Fleet Ships*
EOF
)" \
--base main
# Capture PR URL
pr_url=$(gh pr view --json url -q .url)
pr_number=$(gh pr view --json number -q .number)
# Post to Jira
mcp__atlassian__addCommentToJiraIssue(
issueIdOrKey="$issue_key",
commentBody="## š§ Draft PR Created
**PR:** $pr_url [DRAFT]
**Branch:** \`$current_branch\`
**Status:** Work in Progress
### Why a Draft PR?
This draft PR provides early visibility so you can:
- Watch development progress in real-time
- Provide feedback on design decisions
- Ask questions before formal review
**Formal review** will be requested after TEST phase passes.
---
**ā Golden Armada** | *You ask - The Fleet Ships*"
)
Called periodically or after significant commits:
# Get current PR info
pr_number=$(gh pr view --json number -q .number)
# Get commit stats since PR creation
commit_count=$(git rev-list --count origin/main..HEAD)
file_count=$(git diff --name-only origin/main...HEAD | wc -l)
additions=$(git diff --shortstat origin/main...HEAD | grep -oP '\d+(?= insertion)' || echo 0)
deletions=$(git diff --shortstat origin/main...HEAD | grep -oP '\d+(?= deletion)' || echo 0)
# Get recent commits
recent_commits=$(git log --oneline -5 origin/main..HEAD)
# Calculate CODE phase progress (based on sub-items)
completed_subs=$(get_completed_sub_items)
total_subs=$(get_total_sub_items)
progress=$((completed_subs * 100 / total_subs))
# Update PR description
gh pr edit $pr_number --body "$(cat <<EOF
## š§ Work in Progress
This is an early draft PR for visibility and feedback. **Not ready for formal review yet.**
### Issue
**Jira:** [{ISSUE_KEY}]({JIRA_URL})
**Summary:** {ISSUE_SUMMARY}
---
## Development Progress
| Phase | Status | Completed |
|-------|--------|-----------|
| EXPLORE | ā
Complete | {EXPLORE_TIME} |
| PLAN | ā
Complete | {PLAN_TIME} |
| CODE | š In Progress ($progress%) | - |
| TEST | ā³ Pending | - |
| FIX | ā³ Pending | - |
| DOCUMENT | ā³ Pending | - |
### Code Statistics
| Metric | Value |
|--------|-------|
| Commits | $commit_count |
| Files Changed | $file_count |
| Lines Added | +$additions |
| Lines Removed | -$deletions |
### Sub-Items Progress
| Sub-Item | Status | PR Files |
|----------|--------|----------|
{SUB_ITEMS_STATUS_TABLE}
---
## Recent Commits
\`\`\`
$recent_commits
\`\`\`
---
## What You Can Do Now
- š **Watch progress** - See commits as they happen
- š¬ **Provide early feedback** - Comment on design decisions
- š **Review architecture** - Check the planned approach
- ā **Ask questions** - Better to clarify now than later
**Note:** Formal review will be requested after TEST phase passes.
---
**ā Golden Armada** | *You ask - The Fleet Ships*
Updated: $(date -u +"%Y-%m-%d %H:%M UTC")
EOF
)"
# After TEST phase completes
test_status="${TEST_PASSED ? 'ā
All Passing' : 'ā Failures'}"
coverage="${TEST_COVERAGE}%"
# Update PR with test results
gh pr edit $pr_number --body "$(cat <<EOF
... (previous content updated with TEST status)
## Test Results
| Metric | Value |
|--------|-------|
| Status | $test_status |
| Coverage | $coverage |
| Unit Tests | {UNIT_COUNT} passed |
| Integration Tests | {INTEGRATION_COUNT} passed |
| E2E Tests | {E2E_COUNT} passed |
---
EOF
)"
# Mark PR as ready for review
gh pr ready $pr_number
# Update title (remove WIP prefix)
gh pr edit $pr_number \
--title "[$issue_key] $issue_summary"
# Request reviewers
gh pr edit $pr_number \
--add-reviewer "@team-reviewers"
# Update Jira
mcp__atlassian__addCommentToJiraIssue(
issueIdOrKey="$issue_key",
commentBody="## ā
PR Ready for Review!
**PR:** $pr_url (no longer draft)
**Branch:** \`$current_branch\`
### Development Complete
All phases have passed:
- ā
EXPLORE - Completed
- ā
PLAN - Completed
- ā
CODE - Completed
- ā
TEST - All passing ($coverage coverage)
- ā
FIX - No issues
- ā
DOCUMENT - Completed
### Ready for Review
The PR is now ready for formal code review. Reviewers have been assigned.
**Estimated Review Time:** {ESTIMATE} minutes
**Recommended Approach:** Check the bite-sized review roadmap in the PR
---
**ā Golden Armada** | *You ask - The Fleet Ships*"
)
## š§ Work in Progress - Early Preview
**Jira:** [PROJ-123](https://jira.example.com/browse/PROJ-123)
---
### Development Progress
- ā
EXPLORE (complete)
- ā
PLAN (complete)
- š CODE (starting)
- ā³ TEST
- ā³ DOCUMENT
### What's Being Built
{Technical summary from PLAN phase}
### Feedback Welcome
This is a **draft PR** for visibility. Feel free to:
- Comment on the approach
- Ask clarifying questions
- Suggest improvements early
**Formal review** starts after TEST phase.
## Ready for Review
**Jira:** [PROJ-123](https://jira.example.com/browse/PROJ-123)
---
### Summary
{Brief description of what this PR does}
### Development Phases ā
All required phases completed:
- ā
EXPLORE - Context gathered
- ā
PLAN - Architecture designed
- ā
CODE - Implementation complete
- ā
TEST - All tests passing
- ā
FIX - Issues resolved
- ā
DOCUMENT - Documentation updated
### Changes
**Added:**
- {List new features/files}
**Changed:**
- {List modifications}
**Fixed:**
- {List bug fixes}
### Testing
| Category | Status | Count |
|----------|--------|-------|
| Unit | ā
| {count} |
| Integration | ā
| {count} |
| E2E | ā
| {count} |
| Coverage | {percent}% | - |
### How to Review
See the **Review Roadmap** comment below for bite-sized review tasks.
Estimated total review time: ~{minutes} minutes
---
<div align="center">
**GOLDEN ARMADA**
*Lobbi Autonomous DevOps Orchestration*
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā THE FLEET STANDS READY ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
</div>
pr-size-estimator: Uses strategy for PR descriptionreview-facilitator: Adds review roadmap after conversioncompletion-orchestrator: Skips PR creation if draft existsCheck for existing PR on branch.
If exists and is draft ā update it
If exists and is ready ā skip (work already done)
Push branch before creating PR.
git push -u origin $(git branch --show-current)
Retry up to 3 times with exponential backoff.
Log error and continue (non-blocking).
Manual PR creation instructions as fallback.
After Creating Draft:
ā
Draft PR Created
PR #123: [WIP] [PROJ-100] Add user authentication
URL: https://github.com/org/repo/pull/123
Status: Draft (early visibility)
Posted notification to PROJ-100 on Jira.
Next: PR will update automatically as CODE phase progresses.
After Converting to Ready:
ā
PR Converted to Ready for Review
PR #123: [PROJ-100] Add user authentication
URL: https://github.com/org/repo/pull/123
Status: Ready for Review
Reviewers: @alice, @bob assigned
Development phases complete. Awaiting code review.
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences