From jira-orchestrator
Analyze issue and create PR delivery strategy before coding
npx claudepluginhub markus41/claude --plugin jira-orchestrator# Plan PRs Command
Generate a **proactive PR delivery strategy** for a Jira issue BEFORE coding begins.
## Step 0: Time Tracking Initialization
**AUTOMATIC**: This step runs silently before command execution begins.
The orchestration system tracks execution time for this command. When the command completes:
- If duration >= 60 seconds AND a Jira issue key is detected
- A worklog is automatically posted with comment: `[Claude] /jira:plan-prs - {duration}`
### Issue Key Detection Priority
1. Command argument (e.g., `${issue_key}`)
2. Git branch name (e.g., `feature/PROJ-123-desc`)
3. Env...Generate a proactive PR delivery strategy for a Jira issue BEFORE coding begins.
AUTOMATIC: This step runs silently before command execution begins.
The orchestration system tracks execution time for this command. When the command completes:
[Claude] /jira:plan-prs - {duration}${issue_key})feature/PROJ-123-desc)JIRA_ISSUE_KEYTime logging can be configured in jira-orchestrator/config/time-logging.yml:
enabled: Toggle auto-logging (default: true)threshold_seconds: Minimum duration to log (default: 60)format: Worklog comment format (default: "[Claude] {command} - {duration}")Large PRs are hard to review and often lead to:
This command helps by planning how to split work into small, reviewable PRs upfront.
Fetches Issue Details
Estimates PR Size
Creates Splitting Strategy
Posts Plan to Jira
Configures Orchestration
/jira:work/jira:plan-prs ISSUE-KEY
๐ PR Size Estimation Complete
Parent Issue: PROJ-123
Total Estimated: ~1,450 lines (๐ด Large - Split Required)
Strategy: 3-PR Split (Sub-Item Based)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PR #1: [PROJ-123] Part 1: Database Layer โ
โ โโ Sub-Items: PROJ-201, PROJ-202 โ
โ โโ Est. Size: ~350 lines โ
โ โโ Dependencies: None โ
โ โโ Merge Order: First โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PR #2: [PROJ-123] Part 2: API Layer โ
โ โโ Sub-Items: PROJ-203, PROJ-204, PROJ-205 โ
โ โโ Est. Size: ~600 lines โ
โ โโ Dependencies: PR #1 โ
โ โโ Merge Order: After PR #1 merges โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PR #3: [PROJ-123] Part 3: UI Components โ
โ โโ Sub-Items: PROJ-206, PROJ-207 โ
โ โโ Est. Size: ~500 lines โ
โ โโ Dependencies: PR #2 โ
โ โโ Merge Order: Final โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Strategy posted to Jira: https://jira.company.com/browse/PROJ-123
โ
Configuration saved for CODE phase agents
โ
Work plan artifact saved: `.claude/orchestration/plans/PROJ-123-plan.json`
Next Steps:
1. Run /jira:work PROJ-123 to start development
2. Checkpoint PRs will be created automatically
3. Each PR stays under 400 lines for easy review
| Total Lines | Strategy | What Happens |
|---|---|---|
| < 200 | Single PR | โ Proceed normally |
| 200-400 | Single PR with roadmap | โ ๏ธ Create review chunks |
| 400-800 | Split into 2-3 PRs | ๐ Split recommended |
| > 800 | Split into 3+ PRs | ๐ด Split required |
graph TD
A[/jira:plan-prs ISSUE-KEY] --> B[Fetch Issue from Jira]
B --> C[Get Sub-Items]
C --> D[Analyze Complexity]
D --> E{Estimated Size?}
E -->|< 400 lines| F[Single PR Strategy]
E -->|400-800 lines| G[2-3 PR Strategy]
E -->|> 800 lines| H[3+ PR Strategy]
F --> I[Generate Report]
G --> I
H --> I
I --> J[Post to Jira]
J --> K[Save Config + Work Plan Artifact]
K --> L[Ready for /jira:work]
This command invokes the pr-size-estimator agent which:
Environment variables to customize behavior:
# Size thresholds
PR_WARN_THRESHOLD=400 # Warn above this many lines
PR_BLOCK_THRESHOLD=800 # Require split above this
# Strategy preferences
PR_SPLIT_STRATEGY=auto # auto, sub_item, layer, feature_slice
PR_MAX_SIZE=400 # Target max size per PR
This command works with:
/jira:work: Uses the strategy during CODE phase/jira:work: Loads the work plan artifact to adapt phase staffing, gating, and PR splits/jira:plan-prs writes a JSON artifact to .claude/orchestration/plans/{ISSUE-KEY}-plan.json.
/jira:work must load this file before task breakdown to enforce scope, sequencing, and PR splits.
{
"issue_key": "PROJ-123",
"estimated_total_loc": 1450,
"pr_strategy": "sub_item",
"max_pr_size": 400,
"pr_splits": [
{"name": "Database Layer", "sub_items": ["PROJ-201", "PROJ-202"], "dependencies": []},
{"name": "API Layer", "sub_items": ["PROJ-203"], "dependencies": ["Database Layer"]}
],
"gates": {
"max_parallel_prs": 2,
"required_reviewers": ["backend-architect", "api-security-expert"]
}
}
Run this command:
/jira:work - Start full orchestration (uses this strategy)/jira:pr - Create PR (respects size guard)/jira:status - Check current orchestration statusPhilosophy: "The best time to split a PR is before you write the code."