github-pr-workflow
ALWAYS invoke this skill first when asked to merge, approve or auto-merge a PR — never run or suggest `gh pr merge` before loading it, because a PR that edits `.github/workflows/` must be handed to a human. Also load it before drafting a PR body, a PR comment or a `gh pr` command — even for a one-off request ("merge PR 55", "post this comment on the PR") with the details already given. It defines the AI-authorship marker on anything posted to a PR, the `## Sequencing` section for dependent PRs, the squash-merge rule, and the hand-off of security-critical merges (workflow edits) to a human. Conventions and guardrails for working with GitHub PRs: permissions, opening and sizing PRs, checking CI, responding to review comments, and the security-critical merge rule. Load whenever doing PR work in any repo — creating, updating, commenting on, or merging a pull request.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- github-pr-workflow
- license
- MIT
- metadata
- { "version": "1.0.0" }
- description
- ALWAYS invoke this skill first when asked to merge, approve or auto-merge a PR — never run or suggest `gh pr merge` before loading it, because a PR that edits `.github/workflows/` must be handed to a human. Also load it before drafting a PR body, a PR comment or a `gh pr` command — even for a one-off request ("merge PR 55", "post this comment on the PR") with the details already given. It defines the AI-authorship marker on anything posted to a PR, the `## Sequencing` section for dependent PRs, the squash-merge rule, and the hand-off of security-critical merges (workflow edits) to a human. Conventions and guardrails for working with GitHub PRs: permissions, opening and sizing PRs, checking CI, responding to review comments, and the security-critical merge rule. Load whenever doing PR work in any repo — creating, updating, commenting on, or merging a pull request.
03 SKILL.md 正文
GitHub PR workflow
Permissions
Never create or modify a GitHub issue or PR, post a comment, edit a body, or
submit a review without explicit, request-scoped permission — see
gh-publish-guide; the .claude/settings.json
ask-rules backstop it.
Any comment, reply, or review posted on a GitHub PR or issue must be clearly
identified as AI-generated — lead the body with an explicit marker (e.g.
🤖 **Claude:**) rather than letting it read as if a human wrote it.
pr-review-rubric's 🤖 **Claude:** / ## 🤖 Claude Auto-Review markers
already satisfy this for review output; apply the same idea to a plain
pr-babysit reply or a one-off gh pr comment/gh issue comment. This is a
transparency requirement, not a style choice — don't drop the marker to keep a
reply terse.
Opening and sizing a PR
- Always open PRs as drafts (
gh pr create --draft) unless the user explicitly asks for a ready-for-review PR. A draft prevents an unreviewed PR from landing in someone's review queue before it's been looked at. To mark one ready:gh pr ready <number>— but only do so with explicit user confirmation, not autonomously after CI passes. - Before
gh pr create, rungit fetch origin mainandgit log --oneline origin/main..HEAD, and confirm it lists only your own commits. If the branch's earlier PR already merged, don't open a PR from it: see the dead-branch bullet ingit-worktree-usage. - Size a PR by whether it would be mergeable and valuable standing alone, not by line count. Split when a piece is independently useful on its own; keep pieces together when they only make sense as one concern.
- When two or more PRs are in flight and their merge order matters, add a
## Sequencingsection to the PR body: name every related PR, state what happens under each possible merge order, and say explicitly what gets closed or superseded rather than leaving it to be inferred from the diff. - A PR that touches
plugins/*/evals/**needs a body heading named exactly## Eval results(any level 1 to 6, case-insensitive, nothing else on the line; "Evidence" or "Results" fails). Write the run-evals summary under it, or why no run was made;run-evals --pr <n>writes the heading itself. TheEval results checkjob reads the body from the event that triggered it, so re-running a failed job re-reads the old body and fails again. Fix the body withgh pr edit: the edit fires a new run on the new body. - Merge via squash: this repo's practice is one commit per PR on the default
branch, so use
gh pr merge --squash.
After opening a PR
The task isn't done once a PR is open. Once CI has had a few minutes to produce
signal, check its status (gh pr checks) and any early review comments
(gh pr view --comments), and act on what's actionable before ending the turn.
CodeRabbit's "draft, review skipped" notice on a draft PR is not actionable: skip it
(github-pr:pr-comments, Skip rule).
Some projects have a dedicated skill/script for this shepherding pass; use it if
present, otherwise do the check manually.
When gh pr checks/gh run view --log-failed doesn't explain a failure,
escalate through the Actions jobs API and a verbose debug rerun before reaching
for local reproduction (act) or a guarded, temporary action-tmate step as a
last resort — see the github-pr:pr-checks skill (Step 2) for the
exact order, flags, and safety guards, and docs/github-actions.md for the
full rationale and incident history. bash scripts/ci.sh lint-actions/actionlint remain
the required check for a workflow-syntax problem — none of the above can
diagnose one, since a syntax error never reaches a runner.
Follow-ups must be filed issues
If a PR body says "follow-up", "later" or "out of scope", file each item as an
issue first and cite its number in the body (Follow-up: #N). A PR that merges
with an unfiled follow-up loses it. Before opening or merging, grep the body for
those words and confirm each has a number (github-pr:pr-followups does the
full detect, dedupe and file pass). For issues filed by someone else,
also read issue-reporter-etiquette before closing them or merging Closes #N.
Responding to review comments
When a change addresses a PR review comment (bot or human), reply to that specific comment rather than pushing silently — say what changed, or push back with why not.
- Inline/review comment:
gh api repos/<owner>/<repo>/pulls/<pr>/comments/<comment-id>/replies -f body="<reply>" - General PR-level comment:
gh pr comment <pr> --body "<reply>"
Treat CI passing, not an approving human review, as the actual merge gate — don't wait on or expect an approval that isn't part of how this repo works.
Classify and reply to each review finding using the
github-pr:pr-comments skill's four-outcome rubric
(Fixed/Refuted/Confirmed-but-deferred/Judged-not-real) and its exact reply
templates — including its rules for an automated reviewer re-litigating a
refuted finding and for spinning an out-of-scope finding into a new issue
rather than scope-creeping the current PR.
.github/ stays config-only
Limit .github/ to platform configuration: workflows (.github/workflows/),
CODEOWNERS, dependabot/release config, and a generic PR/issue template.
Feature- or product-specific docs, playbooks, or checklists belong under the
project's own docs directory, not .github/. If a specific feature genuinely
needs its own PR template, use an opt-in file under
.github/PULL_REQUEST_TEMPLATE/<feature>.md — never grow the generic template
with feature-specific sections.
Security-critical paths: keep a human on the merge/approve button
The "CI passing is the merge gate" rule above is this repo's own default; it
does not extend to security-critical or regulated paths. Research shows a
crafted comment or string literal in code under review can instruct a
reviewing agent to overlook a vulnerability or wave it through — an attack
surface that doesn't exist for a human reviewer, with no fully solved defense
yet (arXiv:2606.13175 §VI.C; corroborated by Endor Labs, NVIDIA, and Cloud
Security Alliance write-ups on the same 2026 concern). As a standing guardrail:
an agent must never autonomously approve or merge a pull request touching a
security-critical or regulated path. Any "move the workstream forward via
agents" design (this repo's pr-babysit/--auto-merge included) keeps a
human on that button for these paths — surface the PR and diff and stop, don't
gh pr merge or approve it yourself.
"Security-critical," for this purpose, means at minimum: auth/authz code;
credential, secret, or token handling; .github/workflows/ and other CI/CD
definitions; dependency manifests/lockfiles (supply-chain surface);
.claude/settings.json permissions or hooks; and this repo's own PR
review/merge tooling (pr-review-rubric, pr-babysit, pr-comments,
pr-checks, gh-publish-guide). Treat that as a floor — extend it by
judgment to a given repo's actual regulated surface (PCI/HIPAA/PII-handling
code, for instance).
04 同仓库更多 Skills
youtube-transcript
ALWAYS invoke before fetching a transcript, captions or description for a YouTube video, even when only asked how you would get them. Given a YouTube URL (youtube.com/watch, youtu.be, shorts), save the video's English auto-captions as plain text and its description to files with `yt-dlp`, and print the title, channel and duration. Use when asked to "get the transcript for this video", "grab the captions", "summarize this YouTube video", "put these videos' transcripts in an artifact", or when a YouTube link is pasted and its spoken content is needed. Do not drive the browser's transcript panel or try `youtube-transcript-api` first: both were tried and are slower or empty.
git-worktree-usage
Load this before pushing to, or opening a PR from, a branch whose earlier PR already merged (a squash merge leaves its commits off the default branch, so a new PR from it shows stale history), even when only advising: it defines the fresh-branch and cherry-pick fix. Create worktrees with the `EnterWorktree` tool, never raw `git worktree add`. Git worktree and branch mechanics for isolating non-trivial work: locking and the stale-worktree sweep, picking what to parallelize by file surface, the repo-wide `git stash` collision hazard and its `git restore` alternative, branch naming, catching a branch up to a moved `main` via merge (not rebase), CI/coverage gotchas after a merge, conflict-resolution escalation levels, and PR-splitting sequencing. Also ships two SessionStart hooks that self-heal a project's own symlinked-worktree-directory convention and auto-prune merged worktrees, and a commit-branch guard hook that asks before a git commit lands on the default or an unrelated checked-out branch. Use when creating, entering, or cleaning up a git worktree, including before starting work in an existing worktree that another session may be using; deciding how to parallelize agent sessions across a repo; hitting a `git stash` collision between sessions; resolving a merge/rebase conflict; splitting an already-written diff into multiple PRs; or a stale or wrongly-linked worktree directory needs diagnosing. Do not use for a plain `git stash` in a single clone with no other worktrees or sessions, for rewriting an unpushed branch's history, or for running commands in a worktree the user just created.
url-to-audio
ALWAYS invoke before answering any request to narrate or convert a URL or article to audio, even when only asked what you would do or which backend you would use (including when `OPENAI_API_KEY` is unset and the fallback is `say`). Turn a web article into a narrated audio file: fetch the page, extract the clean reading text, and synthesize it with macOS `say` by default (free, local, already installed, no API key) or OpenAI TTS optionally (when `OPENAI_API_KEY` is set and a `say` voice isn't good enough). Voice and speed are configurable per call, with env var defaults. Produces a `.m4a`/`.mp3` file at a predictable path and prints it. Use when asked to "read this article to me", "convert this page/URL to audio", "make an audio version of this link", or "text-to-speech this article" — including when asked only for the commands or plan, or when `OPENAI_API_KEY` is unset.
subagent-orchestration
Use FIRST, before answering or planning, whenever the user hands over a list of two or more separate tasks ("do A, B and C", numbered or in no order) that each need real exploration, even if they only ask how you would tackle them: it triages which can run as parallel sub-agents and which must stay serial. Also use when asked how to configure a sub-agent already chosen for a large search or exploration (agent type, model tier), and when about to spawn a sub-agent, fan out with the Workflow tool, or run a task that would put large tool output (more than ~50 lines, or ~3 file reads) into the main context. Routes the work to the main context, a single Agent call, or a Workflow; defines the compact handback a delegated agent should return; and picks the model tier. Use for "should I delegate this", "which agent do I use", or "keep my context small".
config
Internal primitive that reads YAML frontmatter from vault config files via mcp__obsidian__* tools, and returns it as merged key-value data. Not a user-facing slash command — this skill is never triggered by a user request directly; other agent-config skills (screen-capture, and second-brain's own capture/query skills) invoke it to load their own settings. Degrades to an empty config, never a hard failure, when the Obsidian MCP is disconnected or the config file doesn't exist. Parse `$ARGUMENTS` as `<skill-name> [project-name]`.
lighthouse
Run a Lighthouse CLI pass (mobile + desktop) against a URL and store the results in the second-brain vault under knowledge/lighthouse/<project>/. ALWAYS invoke this skill first when asked to run, repeat or script a Lighthouse pass or performance/accessibility audit against a URL, before writing any `lighthouse` command, including when the config disables it (it defines the no-op behaviour). Complements, not replaces, a manual responsive resize-and-look pass. Not for advice about fixing a Lighthouse finding. Config-driven: which form factors run, whether the skill runs at all, and where results land are all controlled by lighthouse_enabled, lighthouse_form_factors, and lighthouse_output_dir.