From scm-utils
Best practices and procedures for creating and maintaining high-quality pull requests. Covers PR creation, body formatting, title conventions, and lifecycle management. Triggers on: "create a PR", "update the PR", "open a pull request", "push and PR", "fix PR", "fix PR body", "PR formatting", or automatically after any push to a feature branch per the auto-pr-management rule.
npx claudepluginhub nsheaps/ai-mktpl --plugin scm-utilsThis skill is limited to using the following tools:
Create and maintain pull requests for feature branches using `gh api` with `--hostname github.com` (required for web sessions where the git remote is a local proxy).
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Create and maintain pull requests for feature branches using gh api with --hostname github.com (required for web sessions where the git remote is a local proxy).
Current branch: !git branch --show-current 2>/dev/null || echo "(not in a git repo)"
eval "$(mise activate bash)"
The gh CLI must be available (installed via mise) and GH_TOKEN must be set in the environment.
Always check before creating to avoid duplicates. Use server-side filtering:
gh api "repos/nsheaps/ai-mktpl/pulls?head=nsheaps:<branch-name>&state=open" \
--hostname github.com \
--jq '.[0] | {number, title, state}'
If a PR already exists, skip to Step 3: Update PR.
PR_NUMBER=$(gh api repos/nsheaps/ai-mktpl/pulls \
--hostname github.com \
--method POST \
--field title="Short descriptive title" \
--field head="<branch-name>" \
--field base="main" \
--field draft=true \
--field body="$(cat <<'PREOF'
## Summary
- What changed and why
## Test plan
- [ ] Verification steps
<!-- Include Claude Code session link if available, e.g.: https://claude.ai/code/session_XXXXX -->
PREOF
)" --jq '.number')
Then add the request-review label to trigger AI code review:
gh api repos/nsheaps/ai-mktpl/issues/${PR_NUMBER}/labels \
--hostname github.com \
--method POST \
--field 'labels[]=request-review'
After subsequent pushes, update the PR body to reflect all current changes:
gh api repos/nsheaps/ai-mktpl/pulls/<PR_NUMBER> \
--hostname github.com \
--method PATCH \
--field body="$(cat <<'PREOF'
## Summary
- Updated description reflecting all changes
## Test plan
- [ ] Updated verification steps
<!-- session link -->
PREOF
)"
Only after review feedback is addressed and CI passes:
gh api repos/nsheaps/ai-mktpl/pulls/<PR_NUMBER> \
--hostname github.com \
--method PATCH \
--field draft=false
CRITICAL: PR bodies must contain real newlines, not literal \n escape sequences.
gh api, use heredocs ($(cat <<'PREOF' ... PREOF)) — they preserve newlines naturallymcp__github__create_pull_request), pass the body as a multi-line string with actual newlines — MCP tool string parameters support real newlines\n — GitHub renders them as literal text, not line breaks| Error | Resolution |
|---|---|
gh not found | Run eval "$(mise activate bash)" or mise install |
| 401 Unauthorized | Check GH_TOKEN is set and has PR write scope |
| 422 Validation failed | Branch may not exist on remote yet — push first |
| PR already exists | Use PATCH to update instead of POST to create |