pr
БесплатноБез исполняемых скриптовНе проверенOpen a PR, wait for CI to pass, fix failures, address review comments, and loop until fully green. Use when opening a PR, fixing CI, or addressing review…
от drn★ 23 звезды на GitHubОб этом скилле
Context
- Current branch: !
git branch --show-current - Git status: !
git status --short
Phase Protocol
This skill participates in a phase chain. Read ~/.claude/skills/_shared/resources/phase-protocol.md for the full protocol.
Before creating the PR: Check .context/phases/ for prior artifacts. If any exist, use them to enrich the PR description:
plan-*.mdorthink-*.md→ use the goal/summary for PR contextbuild-*.md→ use the changes summary and deviationsreview-*.md→ reference review findings and their resolutiontest-*.md→ include test results and coverage metrics
After the PR is created and green: Write a ship-{ts}.md artifact to .context/phases/ (create with mkdir -p .context/phases). The Detail section should include the PR URL, CI status, and any fixes applied. The Handoff section should note the PR number for /merge.
Do NOT git add or commit the ship-{ts}.md artifact (or any .context/ file) into the PR. It is agent-local scratch for cross-phase handoff, not reviewable content — a ship-*.md in the PR diff is a defect reviewers will flag. In every commit step below (Step 1 and Step 4b), stage only the real change; never use git add -A or git add . (they sweep in .context/). As a belt-and-suspenders safeguard, add .context/ to the repo's .gitignore so the artifact can never be swept in.
Your task
Open a PR for the current branch, then loop until CI is fully green and all review comments are addressed. Do not return until the PR is in a mergeable, green state.
If a PR already exists for this branch, skip straight to Step 3 — even if there are no local changes or commits. Your job is to get the PR to a green, mergeable state, not just to open it. Never abort when a PR exists.
Step 0: Check for existing PR
Determine the upstream repo slug (owner/name) — use upstream remote if it exists, otherwise origin. Use gh pr list --repo <owner/repo> --head '<fork-owner>:<branch>' --state open --json number,url to check if a PR already exists. If one exists, note the PR number and skip to Step 3.
Step 1: Commit any uncommitted changes
If there are uncommitted changes (check git status), stage and commit them with an appropriate message before proceeding. Do this before anything else — uncommitted changes are work the user wants shipped. Stage specific files (git add <path>), not git add -A/git add ., so .context/ scratch never gets swept in.
Abort condition (only when NO PR exists): After committing any uncommitted changes, if there are STILL no commits ahead of the default branch, stop and tell the user: "Nothing to ship — no PR exists and there are no commits on this branch."
Step 2: Push the branch
2a: Pre-push markdown formatting check
If the pending push touches any .md files, run prettier --check against them first only when the repo actually enforces prettier. Markdown table edits often force prettier to realign column widths in other tables in the same file, which trips qlty fmt in CI. Catching it before push avoids burning a CI cycle — but reformatting against a repo that doesn't enforce prettier can introduce regressions on files whose existing style differs from prettier's preferred output (e.g., joining 0.-prefixed list items, swapping italics * ↔ _, adding blank lines after list intros).
Gate on a config that actually enforces prettier on markdown. A bare .qlty/qlty.toml is NOT enough — qlty only formats markdown when its config enables a prettier or markdown plugin, and reformatting a repo that never enforced prettier introduces noisy unrelated diffs. If no qualifying config is found, skip this step.
prettier_enforced=false
for cfg in .prettierrc .prettierrc.json .prettierrc.yml .prettierrc.yaml .prettierrc.js .prettierrc.cjs .prettierrc.toml prettier.config.js prettier.config.cjs; do
[ -e "$cfg" ] && { prettier_enforced=true; break; }
done
# qlty counts only when its config actually enables a markdown formatter
if [ "$prettier_enforced" = false ] && [ -e .qlty/qlty.toml ] && grep -qE 'prettier|markdown' .qlty/qlty.toml; then
prettier_enforced=true
fi
# Also detect prettier referenced directly from CI workflows
if [ "$prettier_enforced" = false ] && grep -rlE 'prettier' .github/workflows 2>/dev/null | grep -q .; then
prettier_enforced=true
fi
if [ "$prettier_enforced" = true ]; then
mapfile -t md_files < <(git diff --name-only "$base_branch"...HEAD | grep -E '\.md$')
if [ ${#md_files[@]} -gt 0 ]; then
if ! npx --yes [email protected] --check "${md_files[@]}"; then
echo ":: prettier reformatted markdown — running --write and re-staging"
npx --yes [email protected] --write "${md_files[@]}"
git add "${md_files[@]}"
git commit -m "Format markdown via prettier"
fi
fi
fi
The check is cheap (~2s for a typical PR) and catches the most common qlty fmt failure mode. Skip if no .md files are in the d
Установить pr в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pr?
Open a PR, wait for CI to pass, fix failures, address review comments, and loop until fully green. Use when opening a PR, fixing CI, or addressing review feedback.
Как установить скилл pr?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pr запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub