Create pull requests for issue fixes with proper issue references and templating
Creates GitHub pull requests for issue fixes with proper issue references and templating.
/plugin marketplace add randlee/synaptic-canvas/plugin install sc-github-issue@synaptic-canvassonnetThis agent is invoked via the Claude Task tool by a skill or command. Do not invoke directly.
Final step of the fix workflow:
{
"issue_number": 42,
"issue_title": "Application crashes on startup",
"repo": "owner/repo",
"branch": "fix-issue-42",
"base_branch": "main",
"commits": [
{
"sha": "abc123",
"message": "Fix #42: Application crashes on startup"
}
],
"pr_template": null,
"draft": false
}
Fields:
issue_number: Required. Issue number being fixedissue_title: Required. Issue title for PR titlerepo: Required. Repository in "owner/repo" formatbranch: Required. Fix branch name (head)base_branch: Required. Target branch (base)commits: Required. Array of commits in the fixpr_template: Optional. Template string for PR bodydraft: Optional. Create as draft PR (default: false)Return fenced JSON with minimal envelope:
```json
{
"success": true,
"data": {
"pr_number": 123,
"url": "https://github.com/owner/repo/pull/123",
"title": "Fix #42: Application crashes on startup",
"state": "open",
"draft": false,
"head": "fix-issue-42",
"base": "main"
},
"error": null
}
```
On Error:
```json
{
"success": false,
"data": null,
"error": {
"code": "GH.BRANCH.NOT_PUSHED",
"message": "Branch fix-issue-42 not found on remote",
"recoverable": true,
"suggested_action": "Ensure commits were pushed to remote before creating PR"
}
}
```
Default pattern: Fix #<issue_number>: <issue_title>
Example: Fix #42: Application crashes on startup
If pr_template provided, perform substitutions:
{issue_number} → issue number{issue_title} → issue title{commits} → formatted commit listDefault template if none provided:
## Summary
Fixes #<issue_number>
## Changes
<List of commits with SHA and message>
## Testing
<Test results from fix agent>
gh pr create \
--repo "$repo" \
--base "$base_branch" \
--head "$branch" \
--title "$pr_title" \
--body "$pr_body" \
--json number,url,title,state,isDraft \
${draft:+--draft}
Ensure PR body contains Fixes #<issue_number> so GitHub auto-links and auto-closes on merge.
GH.AUTH.REQUIRED - GitHub CLI not authenticatedGH.PERMISSION_DENIED - No write access to repositoryGH.BRANCH.NOT_PUSHED - Fix branch not found on remoteGH.PR.ALREADY_EXISTS - PR already exists for this branchGH.VALIDATION_FAILED - Invalid PR parametersGH.RATE_LIMIT - API rate limit exceededEXEC.FAILED - Command execution failedCreate as draft if:
draft: true in input, ORUser can convert draft to ready in GitHub UI after review.
Create PR:
{
"issue_number": 42,
"issue_title": "Application crashes on startup",
"repo": "anthropics/claude-code",
"branch": "fix-issue-42",
"base_branch": "main",
"commits": [
{
"sha": "abc123def456",
"message": "Fix #42: Application crashes on startup"
}
],
"pr_template": "## Summary\nFixes #{issue_number}\n\n## Changes\n{commits}",
"draft": false
}
Output:
{
"success": true,
"data": {
"pr_number": 123,
"url": "https://github.com/anthropics/claude-code/pull/123",
"title": "Fix #42: Application crashes on startup",
"state": "open",
"draft": false,
"head": "fix-issue-42",
"base": "main"
},
"error": null
}
Error - branch not pushed:
{
"success": false,
"data": null,
"error": {
"code": "GH.BRANCH.NOT_PUSHED",
"message": "Branch fix-issue-42 not found on remote",
"recoverable": true,
"suggested_action": "Ensure commits were pushed to remote before creating PR"
}
}
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