| name | create-pr-current | |||
|---|---|---|---|---|
| displayName | Create PR for Current Branch | |||
| description | Creates a pull request for the current branch in java-sdk repository. Must be explicitly invoked with /create-pr-current to avoid confusion with create-prs agent. | |||
| version | 1.0.0 | |||
| disable-model-invocation | true | |||
| requiredTools |
|
Creates a pull request for the current branch in the java-sdk repository.
When invoked, follow these steps:
🚨 CRITICAL: Before starting the workflow, use TodoWrite to set up all steps as pending todos.
Step Setup (Use TodoWrite tool immediately):
1. Get current branch information
2. Check for merge conflicts with master branch
3. Get repository information
4. Push current branch
5. Generate PR title and description
6. Create pull request
7. Report results
TodoWrite Setup Example:
{
"todos": [
{
"content": "Get current branch information",
"activeForm": "Getting current branch information",
"status": "pending"
},
{
"content": "Check for merge conflicts with master branch",
"activeForm": "Checking for merge conflicts with master branch",
"status": "pending"
},
{
"content": "Get repository information",
"activeForm": "Getting repository information",
"status": "pending"
},
{
"content": "Push current branch",
"activeForm": "Pushing current branch",
"status": "pending"
},
{
"content": "Generate PR title and description",
"activeForm": "Generating PR title and description",
"status": "pending"
},
{
"content": "Create pull request",
"activeForm": "Creating pull request",
"status": "pending"
},
{
"content": "Report results",
"activeForm": "Reporting results",
"status": "pending"
}
]
}After completing each step, use TodoWrite to mark it as completed before proceeding to the next step.
Mark this step as in_progress using TodoWrite
- Use
git branch --show-currentto get the current branch name - Use
git statusto verify there are no uncommitted changes - If uncommitted changes exist, warn user and ask if they want to commit first
Mark Step 1 as completed using TodoWrite before proceeding
Mark this step as in_progress using TodoWrite
- Fetch latest master:
git fetch origin master - Check for physical conflicts:
git merge-tree $(git merge-base HEAD origin/master) HEAD origin/master - Check for .md file changes:
git diff --name-only origin/master...HEAD | grep '\.md$' - Decision logic:
- If .md files changed → ALWAYS proceed to conflict analysis (even if no physical conflicts)
- Reason: Logical conflicts in agent configs/prompts cannot be detected by git
- If only non-.md files changed AND no physical conflicts → Skip to step 3
- If physical conflicts detected → Proceed to conflict analysis
- If .md files changed → ALWAYS proceed to conflict analysis (even if no physical conflicts)
🚨 CRITICAL: Follow the detailed process in prompts/rules/git-logical-merge.md
This process handles both physical conflicts (detected by git) and logical conflicts (semantic incompatibilities in .md files that git cannot detect).
The process includes these critical steps:
- Step b: Analyze files with semantic evaluation (understand what EACH side added)
- Step c: Categorize conflict severity (CRITICAL/HIGH/MEDIUM/LOW)
- Step d: Present critical conflicts to user with impact assessment
- Step e: BLOCKING - Use AskUserQuestion tool for user decision (MANDATORY)
- Step f: Execute resolution strategy based on user choice
- Step g: MANDATORY - Verify resolution preserves intent using Read tool
- Step h: GATE CHECK - Pre-commit checklist (all answers must be YES)
See git-logical-merge.md for complete step-by-step instructions with examples.
Mark Step 2 as completed using TodoWrite before proceeding
Mark this step as in_progress using TodoWrite
- Repository owner: Extract from git remote (e.g., "optimizely")
- Repository name: "java-sdk"
- Base branch: Typically "master" (verify with
git remote show origin | grep "HEAD branch")
Mark Step 3 as completed using TodoWrite before proceeding
Mark this step as in_progress using TodoWrite
- Push branch to remote:
git push -u origin <branch-name> - Verify push succeeded
Mark Step 4 as completed using TodoWrite before proceeding
Mark this step as in_progress using TodoWrite
- Format:
[TICKET-ID] Brief description of changes - Ticket ID: Use uppercase format (e.g.,
[FSSDK-12345]) or[FSSDK-0000]if no ticket - Example:
[FSSDK-12345] Add feature rollout support
🚨 CRITICAL WORKFLOW - Follow these steps exactly:
Step 1: Read the Template
- ALWAYS read
prompts/rules/pr-format.mdfirst (lines 55-70 for template) - The template has ONLY these sections:
Step 2: Read Forbidden Sections
- Read pr-format.md lines 48-53 for what NOT to include
- NEVER add: Testing, Test Coverage, Quality Assurance, Files Modified, Implementation Details
- NEVER add: Commits section (similar to Files Modified)
Step 3: Generate PR Description
- Use ONLY the template sections from pr-format.md
- Summary: 2-3 sentences max
- Changes: 3-5 bullet points, high-level only
- Jira Ticket:
[FSSDK-0000](https://optimizely-ext.atlassian.net/browse/FSSDK-0000)or actual ticket - Notes: Only if breaking changes exist
Step 4: Verify Before Sending
- Check: Does output have exactly Summary, Changes, Jira Ticket (and optionally Notes)?
- Check: Does output have ANY sections not in the template (Commits, Files, Tests, etc.)?
- If ANY extra sections exist → REMOVE THEM
- Only proceed when output matches template exactly
Mark Step 5 as completed using TodoWrite before proceeding
Mark this step as in_progress using TodoWrite
- Use
mcp__github__list_pull_requestswithheadparameter to check for existing PR - Search for PRs with head branch matching current branch
- Use
mcp__github__update_pull_requestwith PR number - Parameters:
owner: Repository ownerrepo: "java-sdk"pullNumber: Existing PR numbertitle: New PR titlebody: New PR description
- Report: "Updated existing PR #X"
- CRITICAL: Use GitHub MCP tool
mcp__github__create_pull_request - NEVER use
gh pr createvia Bash - Parameters:
owner: Repository ownerrepo: "java-sdk"title: PR titlehead: Current branch namebase: Base branch (usually "master")body: PR description
- Report: "Created new PR #X"
Mark Step 6 as completed using TodoWrite before proceeding
Mark this step as in_progress using TodoWrite
- Display PR URL
- Show PR title and base branch
- Confirm PR was created successfully
Mark Step 7 as completed using TodoWrite - PR creation complete!
User: "/create-pr-current"
Assistant executes:
- Gets current branch:
jae/add-feature - Checks for merge conflicts with master (if any, resolves interactively)
- Gets repository information
- Pushes:
git push -u origin jae/add-feature - Generates PR title and description
- Creates PR using
mcp__github__create_pull_request - Returns PR URL
Note: Triggers are disabled to avoid confusion with create-prs agent.
Must be explicitly invoked with /create-pr-current command.
- If no git repository: Report error
- If on master/main branch: Warn and ask for confirmation
- If uncommitted changes: Offer to show status and ask to commit first
- If push fails: Report error and abort
- If GitHub MCP fails: Report error (do NOT fall back to gh CLI)