Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

git-commit-push-pr

БесплатноБез исполняемых скриптовНе проверен

End-to-end commit-to-PR workflow. Use when the user says "create pr", "commit and pr", "push and pr", or wants to go from uncommitted changes to an open PR.

laurigatesот laurigates★ 61 звезда на GitHub

Об этом скилле

When to Use This Skill

Use this skill when... Use X instead when...
Going from uncommitted changes to an open PR in one step Creating commits only with no push or PR (/git:commit)
Auto-detecting issues, committing, pushing, and opening a PR together Pushing existing commits to a remote without opening a PR (/git:push)
Running the full commit-push-PR pipeline non-interactively Opening a PR from already-pushed commits (/git:pr)

Context

  • Pre-commit config: !find . -maxdepth 1 -name ".pre-commit-config.yaml"
  • Current branch: !git branch --show-current
  • Git status: !git status --porcelain=v2 --branch
  • Unstaged changes: !git diff --numstat
  • Staged changes: !git diff --cached --numstat
  • Recent commits: !git log --format='%h %s' --max-count=10
  • Git remotes: !git remote -v

Available labels and open issues are fetched during execution (requires a configured git remote).

Parameters

Parse these parameters from the command (all optional):

  • $1: Remote branch name to push to (e.g., feat/auth-oauth2). If not provided, auto-generate from first commit type. Ignored with --direct.
  • --push: Automatically push after commits
  • --direct: Push current branch directly to same-named remote (e.g., git push origin main). Mutually exclusive with --pr.
  • --pr / --pull-request: Create pull request after pushing (implies --push, uses feature branch pattern)
  • --draft: Create as draft PR (requires --pr)
  • --issue <num>: Link to specific issue number (requires --pr)
  • --no-commit: Skip commit creation (assume commits already exist)
  • --range <start>..<end>: Push specific commit range instead of all commits
  • --labels <label1,label2>: Apply labels to the created PR (requires --pr)
  • --skip-issue-detection: Skip automatic issue detection (use when --issue is provided or for trivial changes)

Your task

IMPORTANT: Execute all steps continuously without pausing to ask for confirmation between steps. This is a complete workflow — commit, push, and PR creation flow as a single operation. Do not stop after committing to ask whether to push or create a PR; proceed through all applicable steps.

Step 1: Verify State and Prepare Branch

  1. Check for changes: Confirm there are staged or unstaged changes to commit (unless --no-commit)
  2. Prepare branch:
    • If --direct: any branch is valid, stay on current branch
    • If on main/master: create a local feature branch before committing. Auto-generate the name from the changes (e.g., fix/handle-timeout-edge-case, feat/add-oauth-support). Use git checkout -b <branch-name>.
    • If already on a feature branch: stay on it

Step 2: Auto-Detect Related Issues (unless --skip-issue-detection or --issue provided)

Follow references/issue-detection.md to match the staged changes against open issues and pick Refs for the commit (Step 3) and Fixes / Closes / Refs for the PR body (Step 5b).

Step 3: Create Commits (unless --no-commit)

  1. Analyze changes and detect if splitting into multiple PRs is appropriate
  2. Group related changes into logical commits
  3. Stage changes: Use git add -u for modified files, git add <file> for new files
  4. Run pre-commit hooks if configured: pre-commit run
  5. Handle pre-commit modifications: Stage any files modified by hooks with git add -u
  6. Create commit with conventional commit message format
  7. Include detected issue references from Step 2 in the commit message footer as Refs #N:
    • Add high-confidence matches automatically
    • Include medium-confidence matches if confirmed
    • Never a closing keyword in a commit message. Fixes #N there closes the issue when the commit lands on the default branch, whatever the PR body says, and under squash with COMMIT_MESSAGES every branch commit message lands in the squash body. The closing keyword goes in the PR body (Step 5b); the no-closing-keywords commit-msg hook rejects it in a commit.
  8. ALWAYS include GitHub issue references in commit messages (Refs #N): Keyword catalogue (closing, reference-only, cross-repo, multiple issues): references/workflow-guidance.md.

Step 4: Push to Remote (if --push or --pr)

If --direct: Push current branch to same-named remote:

# Direct push to current branch
git push origin HEAD

Otherwise (feature branch — created in Step 1 or pre-existing):

# Push the current feature branch and set upstream
git push -u origin $(git branch --show-current)

Step 5: Create PR (if --pr)

5a. Identify post-merge follow-up actions.

Before creating the PR, scan commit messages, diff context, and any conversation context for actions that must happen after the PR is merged:

Signal Examples
Commit mess
Полный SKILL.md на GitHub

Установить git-commit-push-pr в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(git status *)
Bash(git diff *)
Bash(git log *)
Bash(git add *)
Bash(git commit *)
Bash(git push *)
Bash(git branch *)
Bash(git remote *)
Bash(gh pr *)
Bash(gh label *)
Bash(gh repo *)
Bash(gh issue *)
Bash(pre-commit *)
Bash(python3 *)
Bash(find *)
Read
Edit
Grep
Glob
TodoWrite
mcp__github__create_pull_request
mcp__github__list_issues
mcp__github__get_issue

Вложенные файлы

references/issue-detection.mdreferences/workflow-guidance.md

FAQ

Что делает скилл git-commit-push-pr?

End-to-end commit-to-PR workflow. Use when the user says "create pr", "commit and pr", "push and pr", or wants to go from uncommitted changes to an open PR.

Как установить скилл git-commit-push-pr?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл git-commit-push-pr запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить git-commit-push-pr с