본문으로 건너뛰기
cccskills
무료GitHub에 공개

pr

Prepare a GitHub pull request from staged changes by generating a branch name, commit message, title, and description. It presents the details for confirmation first, then can create the PR as a draft by default.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Create a PR from staged changes with auto-generated branch, title, and description. Use this skill whenever the user wants to create a pull request, ship changes, open a PR, send code for review, or push staged work to GitHub — even if they don't explicitly say "PR".

near/nearcore스타 2,621(GitHub 2,621 + cccskills 0)
연동 도구GitHub

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Open a pull request for staged code changes
  • Send completed work to GitHub for review
  • Create a draft PR with a generated title and summary

포함된 파일(1)

  • SKILL.md7.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Create a pull request with automatically generated title and description based on staged changes.

Before starting, read relevant memory files (especially PR-related feedback memories). Memory preferences override the defaults below.

User instructions: $ARGUMENTS

PRs are created as drafts by default (non-draft PRs auto-assign a random codeowner as reviewer, which then has to be reassigned).

If user instructions are non-empty, parse them for the following hints (they are free-form text, not structured flags):

  • "ready" (or "not draft", "no-draft", "non-draft") → create the PR as ready-for-review instead of a draft
  • "fork" → push to the user's own fork instead of origin
  • "reuse-branch" → reuse the current branch instead of creating a new one (default is to create a new branch)
  • A base branch (e.g., "base: shreyan/project/pr1", "base is master") → use as the PR base branch instead of auto-detecting
  • A project name (e.g., "project is spice", "project: resharding") → use as the project instead of auto-detecting
  • A change type (e.g., "type: fix", "type is refactor") → use as the change type instead of auto-detecting
  • Any other text → treat as extra context to incorporate into the PR description

Follow these steps in order:

  1. Validate:

    • Record the current branch name
    • Run git diff --cached to capture the staged diff. If empty, warn the user and stop
    • If there are unstaged changes, briefly warn the user that they won't be included in the PR
    • Do NOT analyze unstaged changes
    • Fetch the GitHub username by running: gh api user --jq .login
    • Determine reuse-branch and base branch:
      • If user instructions specify "reuse-branch", set reuse-branch = true.
      • Otherwise, set reuse-branch = false (this is the default).
      • Base branch: if user instructions specify a base branch, use that. If reuse-branch is true, use master. Otherwise, use the current branch.
      • When reuse-branch is true, use the current branch name as the branch name.
    • Detect push remote:
      • If user instructions contain "fork", determine the user's fork remote:
        1. List remotes: git remote -v
        2. Look for a remote whose URL contains the GitHub username (e.g., github.com/{username}/). This is the fork remote.
        3. Record the fork remote name for later use.
      • If "fork" is not specified, the push remote is origin.
  2. Analyze staged changes (reuse the diff output from Step 1):

    • Read the modified files to understand the surrounding code context
    • Identify the project/area (e.g., spice, resharding, state-sync, ci). If changes span multiple projects, pick the most dominant one. If user instructions specify a project, use that instead.
    • Read the CONTRIBUTING.md "## Pull Requests" section for valid change types and PR title conventions
    • Determine the change type (fix, feat, refactor, doc, test, chore, perf, revert). If multiple apply, pick the most dominant. If user instructions specify a type, use that instead.
    • Generate a short hyphenated task name, 2-4 words (e.g., add-metrics, fix-header-validation, refactor-chunk-apply)
  3. Generate all details — do NOT run any state-modifying commands (no creating branches, committing, or pushing) in this step:

    • Branch name (local) and remote branch name:
      • If reuse-branch is true: the local branch name is the current branch. Skip collision checks.
      • Otherwise, generate a new local branch name:
        • If pushing to a fork: {project}/{task}
        • If pushing to origin: {username}/{project}/{task}
        • Check for collisions: git branch --list <name> (local) and git ls-remote --heads <push-remote> <name> (remote)
        • On collision, append -2, -3, etc.
      • Remote branch name: when pushing to origin, the remote branch must have the {username}/ prefix. If the local branch name already starts with {username}/, the remote name is the same. Otherwise, prepend it: {username}/{local-branch-name}. When pushing to a fork, the remote branch name is the same as the local branch name.
    • Commit message: single line, same style as the PR title
    • PR title: <type>(<project>): <title> — title must be lowercase (per CONTRIBUTING.md)
      • Example: feat(state-sync): add metrics tracking
    • PR description:
      • Concise summary of what changed and why. Use prose, bullet points, or a mix — whatever fits the change best. A one-line description is fine for small changes.
      • Incorporate any extra context from user instructions
      • Do not include implementation details, test plan sections, or AI attribution
    • Draft: false if user instructions opt out via "ready" (or "not draft", "no-draft", "non-draft"), true otherwise
    • Push remote: the fork remote name if "fork" was specified, otherwise origin
  4. Confirm with user:

    • First, print the details in exactly this format (no horizontal rules, no extra fields):
      Branch: <local-branch-name> (remote: <remote-branch-name>)
      Push remote: <push-remote>
      Base branch: <base-branch>
      Draft: Yes/No
      
      PR title: <title>
      
      PR description:
      <description>
      
    • Then use AskUserQuestion with two options: "Yes, create PR" / "Abort"
      • Do NOT put the details inside the AskUserQuestion options
      • The user can select "Other" (built-in) to provide edits — apply their changes and re-confirm
    • If "Abort": stop immediately. Nothing was modified, so no cleanup is needed.
  5. Execute — only after user confirms:

    • If reuse-branch is false, create the branch: git checkout -b <branch-name>
    • Commit staged changes using a HEREDOC for the message:
      git commit -m "$(cat <<'EOF'
      <commit message>
      EOF
      )"
      
    • Push: git push -u <push-remote> <local-branch-name>:<remote-branch-name> (If local and remote names are the same, git push -u <push-remote> <branch-name> is fine.)
    • Create the PR using a HEREDOC for the body:
      • If pushing to a fork, use --head <username>:<remote-branch-name>:
        gh pr create --base <base-branch> --head <username>:<remote-branch-name> \
          --title "<title>" \
          --body "$(cat <<'EOF'
        <description>
        EOF
        )"
        
      • If pushing to origin, use --head <remote-branch-name>:
        gh pr create --base <base-branch> --head <remote-branch-name> \
          --title "<title>" \
          --body "$(cat <<'EOF'
        <description>
        EOF
        )"
        
      Add --draft if the draft flag is set.
    • Display the PR URL on success
    • If push or PR creation fails but the branch was already created locally, tell the user the branch exists and suggest how to retry

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Update NEAR Protocol’s minimum supported version by one and bundle the related feature and configuration cleanup into a single pull request. It also regenerates snapshots and API specifications and runs the prescribed checks.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Deprecating the next supported protocol version
  • Removing obsolete protocol feature gates
  • Bundling version cleanup into one pull request
near/nearcore2.6천2026년 10월 29일 업데이트

Convert a pytest integration test into a deterministic test-loop test. The workflow documents scenarios and setup, studies existing test-loop patterns, plans the migration for confirmation, then writes and verifies the replacement and cleans up references.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Migrate a pytest integration test to test-loop
  • Document test scenarios before a migration
  • Replace an existing pytest with a deterministic test
near/nearcore2.6천2026년 10월 29일 업데이트

pr-review

무료

Review a Rust pull request for merge-blocking problems in correctness, production safety, performance, security, Rust usage, and code comments. It checks surrounding project context and returns actionable findings with file and line references.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Review a Rust pull request before merging
  • Check a branch diff for blocking issues
  • Look for security and production risks in Rust changes
near/nearcore2.6천2026년 10월 29일 업데이트

Regenerate the checked-in OpenAPI specification, insta snapshots, and protocol schema in sequence. The workflow stops when a step fails and asks before copying a changed protocol schema into the tracked file.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Refresh the checked-in OpenAPI specification
  • Accept updated insta test snapshots
  • Check and review generated protocol schema changes
near/nearcore2.6천2026년 10월 29일 업데이트

near의 스킬 모두 보기

이 스킬의 문제 신고