_archive/skills-deprecated/mp-gh-issue-branch-pr/SKILL.md
DEPRECATED: Use /mp-issue-create + /mp-commit-push-pr instead. Create issue from current work, branch, then commit/push/create PR.
npx skillsauth add MartinoPolo/mpx-claude-code mp-gh-issue-branch-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Log work as a GitHub issue, create/switch branch, then commit/push and create or update draft PR. $ARGUMENTS
GitHub MCP allowed for this skill.
Collect current change context before issue creation.
git status
git diff --stat
git diff --cached --stat
Add context from the current session. Use this context as input for issue drafting.
From $ARGUMENTS and session context, determine:
If relevant files aren't specified, search for affected code using Grep/Glob to identify:
gh label list --limit 50
Match issue type to existing repo labels. Don't create new labels.
Title format: type: description
Body template by type:
Bug:
## Description
[What's broken]
## Steps to Reproduce
1. [Step 1]
2. [Step 2]
## Expected Behavior
[What should happen]
## Actual Behavior
[What happens instead]
## Affected Files
- `path/to/file.ts:123` — [why relevant]
## Acceptance Criteria
- [ ] [How to verify the fix]
Feature:
## Description
[What to build and why]
## Affected Files
- `path/to/file.ts` — [why relevant]
## Acceptance Criteria
- [ ] [Requirement 1]
- [ ] [Requirement 2]
## Notes
[Implementation hints, constraints, related issues]
Chore / Docs:
## Description
[What to do and why]
## Affected Files
- `path/to/file.ts` — [why relevant]
## Acceptance Criteria
- [ ] [Done when...]
gh issue create --title "type: description" --label "label1,label2" --body "$(cat <<'EOF'
[body from Step 2d]
EOF
)"
Capture issue_number, issue_url, issue_title, labels_applied from output.
Derive branch name from issue metadata.
Format:
<issue-number>-<short-kebab-summary>
Example:
123-dashboard-filter-crash
Create and switch:
git checkout -b <branch-name>
If branch exists, switch to it.
git status
git diff --stat
If nothing to commit (clean working tree + no staged changes) → skip to Step 5.
git log --oneline -5
Match repository's commit style.
git add <specific-files>
Prefer specific files over git add -A. Avoid staging sensitive files (.env, credentials).
git commit -m "$(cat <<'EOF'
type(scope): Description
Optional body with details
EOF
)"
Commit Rules:
type(scope): description--amendgit push -u origin $(git branch --show-current)
If nothing to push (local and remote in sync) → skip to Step 6.
node $HOME/.claude/scripts/detect-base-branch.js
Based on result:
AskUserQuestion to pick from candidatesAskUserQuestion to specify manuallyUse the issue created in Step 2. Add Closes #<issue_number> to the PR body.
Fast-path: If the issue number is embedded in the branch name, extract it directly:
node $HOME/.claude/scripts/extract-branch-issue.js
Otherwise use the issue number captured from Step 2e.
gh pr view --json number,title,body,url,state 2>/dev/null
gh pr edit --title "type(scope): Description" --body "$(cat <<'EOF'
## Description
- Summary bullet 1
- Summary bullet 2
## Resolves
Closes #<issue_number>
## Testing (Optional)
- [ ] Manual smoke test: <what was verified>
EOF
)"
gh pr create --draft --base <base> --title "type(scope): Description" --body "$(cat <<'EOF'
## Description
- Summary bullet 1
- Summary bullet 2
## Resolves
Closes #<issue_number>
## Testing (Optional)
- [ ] Manual smoke test: <what was verified>
EOF
)"
PR Rules:
type(scope): Description — conventional commit formatorigin/<base>..HEAD for description## Description → 1-6 concise bullets summarizing full scope## Resolves → Closes #<issue_number> (always present — issue created in Step 2)## Testing (Optional) → include only when tests/manual checks were runReturn:
Code quality and git conventions enforced by hooks.
| Problem | Action |
| --------------------- | ------------------------------------------------ |
| Issue creation fails | Stop and report blocker |
| Branch creation fails | Ask for alternate branch name |
| No changes to commit | Continue PR update path if commits already exist |
| PR creation blocked | Report gh error and remediation |
After completion, display:
development
Audit all active skills for consistency, convention drift, and common issues. Auto-fixes where possible, reports remaining issues. Use when: "audit skills", "skill audit", "check skills", "lint skills"
testing
Ship finished work: sync base, commit, push, PR, wait for CI green, merge. Use when: "ship it", "ship and merge", "ship this"
development
Scan recent Claude Code sessions for grilling/design discussions, extract decisions, and update CONTEXT.md + DECISIONS.md. Use when: "harvest decisions", "extract decisions from sessions", "update docs from sessions", "sync decisions"
tools
Consolidate CONTEXT.md: remove duplicates, outdated items, tighten language. Use when: "consolidate context", "clean up context", "simplify context", "consolidate requirements"