跳到正文
cccskills
免费在 GitHub 公开

create-pr

Create branch, atomic commits, push, and open a pull request with terse, exact messages. Conventional branch + commit format. PR title ≤70 chars, body says "why", not "what". Use when the user says "create pr", "create pullrequest", "create pull request", "make pr", "open pr", "open pullrequest", "open pull request", "submit pr", "raise pr", "/create-pr", or asks to ship/send changes as a pull request (PR/pullrequest/pull-request, any spelling).

中文简介正在准备中。当前显示原文说明。

集成工具GitHub
查看安装方法

包含的文件(1)

  • SKILL.md6.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Context

  • Current git status: !git status --short
  • Diff summary vs HEAD (file + line counts): !git diff HEAD --stat
  • Current branch: !git branch --show-current
  • Default branch: !gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 2>/dev/null || echo "main"
  • Recent commits on this branch: !git log --oneline -10

The full diff is intentionally NOT loaded above. To write the PR body, read only what you need:

  • Per-file hunks: git diff <base>...HEAD -- <file> (replace <base> with the default branch)
  • Branch-wide stat: git diff <base>...HEAD --stat Do not run unfiltered git diff — it floods context for nothing.

Your task

Create a branch (if needed), commit changes as atomic commits, push, and open a pull request. Terse and exact at every layer: branch name, commit messages, PR title, PR body.

Steps

  1. Detect base branch — use the default branch from context above. Target the PR against this branch.

  2. Ensure a valid branch name — <type>/<short-description> convention before pushing.

    • Valid types: feat, fix, chore, refactor, docs, style, perf, test, build, ci, revert
    • Pick a name based on the changes (e.g., feat/add-user-export, fix/login-redirect)
    • If on the default branch: create a new branch with git checkout -b <type>/<short-description>
    • If on a non-conventional branch (e.g., auto-generated worktree branches like claude/..., or any name not matching the convention): rename it in place with git branch -m <type>/<short-description>. This works inside worktrees too.
    • If already on a conventional branch: keep it.
  3. Analyze and stage changes — read the code to understand what changed and why. Stage specific files by name. Do NOT use git add -A or git add .. NEVER stage secret files (.env, *.key, *.pem, credentials, tokens).

  4. Create atomic commits — split into multiple commits when changes involve different concerns, types, or file patterns. Each commit must build and make sense on its own.

    Subject line:

    • <type>(<scope>): <imperative summary> — <scope> optional
    • Types: feat, fix, refactor, perf, docs, test, chore, build, ci, style, revert
    • Imperative mood: "add", "fix", "remove" — not "added", "adds"
    • ≤50 chars when possible, hard cap 72
    • No trailing period
    • Match project convention for capitalization after the colon

    Body (only if needed):

    • Skip when the subject is self-explanatory
    • Add for: non-obvious why, breaking changes, migration notes, linked issues
    • Wrap at 72 chars, bullets - not *
    • Reference issues at end: Closes #42, Refs #17

    Always include body for: breaking changes, security fixes, data migrations, reverts.

    Breaking changes: mark subject with ! and add a BREAKING CHANGE: footer.

    What NEVER goes in: "This commit does X", "I"/"we"/"now"/"currently", "As requested by...", AI attribution, emoji (unless project convention), filename restated when scope covers it.

    Use HEREDOC for commit messages.

  5. Push the branch — use git push -u origin <branch>.

  6. Create the PR using gh pr create:

    Title:

    • Same format as a commit subject: <type>(<scope>): <imperative summary>
    • Under 70 chars, no trailing period
    • If the branch has one commit, reuse its subject. If multiple, summarize the overall change.

    Labels:

    • Infer appropriate labels from the change type and content. Use --label flags (one per label).
    • Common labels: bug, enhancement, documentation, refactor, dependencies, breaking-change.
    • Only apply labels that exist in the repository. Run gh label list first to check. If none match, skip labeling.

    Body — terse, why over what:

    gh pr create --title "title" --label "label1" --body "$(cat <<'EOF'
    - why this change exists (not a diff restatement)
    - notable decisions or tradeoffs
    
    ## Test plan
    - [ ] concrete step a reviewer can run
    - [ ] edge case covered
    EOF
    )"
    

    Body rules:

    • No ## Summary heading — open the body directly with why-bullets. The PR title already names the change; a heading would just repeat it.
    • ## Test plan is mandatory — always include it with concrete, actionable steps a reviewer can run (commands, URLs, edge cases). Avoid vague items like "test it works".
    • Analyze ALL commits on the branch for the why-bullets, not just the latest
    • Why-bullets state the why, not a list of files touched
    • Bullets - not *
    • No AI attribution, no "Generated with Claude Code"
    • No emoji unless project convention requires
    • Add other sections only when applicable (skip otherwise):
      • ## Related issues — when commits reference issues (#123, fixes #456), list Closes #N
      • ## Breaking changes — for breaking changes, include migration notes
      • ## Screenshots — for UI changes, include before/after images or a short clip
  7. Output the PR URL after creation.

Edge Cases

  • No changes at all: say so and stop. Do not create an empty PR.
  • Branch already has an open PR: surface the existing URL instead of creating a duplicate (gh pr list --head <branch>).
  • Push fails due to diverged history: do NOT force push. Inform the user and stop.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

中文简介正在准备中。当前显示原文说明。

samuelpatro/.claude32026年9月3日 更新

Monitor a pull request through review and CI until it's green: verify every bot claim against the code, fix what's real, push back on what's wrong, rerun flaky checks. Use when the user asks to babysit, monitor, watch, or shepherd a PR, says "get this PR green" or "handle the review comments". Accepts an optional PR number/URL; defaults to the current branch's open PR.

中文简介正在准备中。当前显示原文说明。

samuelpatro/.claude32026年9月3日 更新

changelog

免费

Generate a single unified changelog from git history that works for everyone in the company (managers and non-tech colleagues as well as developers). Outputs Slack mrkdwn so it can be pasted straight into Slack. Defaults to Slovak (English only on explicit request) and to comparing the release branch (main) against develop to show unreleased changes; also supports date ranges like "today", "yesterday", "last week", or an explicit git range. User-invoked only via /changelog.

中文简介正在准备中。当前显示原文说明。

samuelpatro/.claude32026年9月3日 更新

commit

免费

Create atomic git commits with terse, exact Conventional Commits messages. Cuts noise, preserves intent. Subject ≤50 chars. Body only when "why" isn't obvious. Use when the user says "commit", "commit this", "/commit", or asks to stage and commit changes.

中文简介正在准备中。当前显示原文说明。

samuelpatro/.claude32026年9月3日 更新

Create atomic git commits with terse Conventional Commits messages, then push to remote. Subject ≤50 chars, body only when "why" isn't obvious. Never force pushes. Use when the user says "commit and push", "commit & push", "/commit-push", or asks to stage, commit, and push in one flow.

中文简介正在准备中。当前显示原文说明。

samuelpatro/.claude32026年9月3日 更新

Type-safe ORM for Cloudflare D1 using Drizzle. Use when building D1 schemas, writing type-safe queries, generating migrations with Drizzle Kit, defining relations, using db.batch, or hitting D1_ERROR, BEGIN TRANSACTION failures, foreign key constraints, env.DB undefined, or schema inference issues.

中文简介正在准备中。当前显示原文说明。

samuelpatro/.claude32026年9月3日 更新

查看 samuelpatro 的全部技能

报告此技能的问题