AGENT SKILL

pr-checks

Load this whenever the user asks about the CI checks of one specific PR — even when they paste the check output or logs themselves — before answering. It defines how to classify each check (branch-related, flaky/infra, cancelled = superseded), when to rerun or escalate, and the closing "in flight" summary. Review and respond to a single PR's CI checks: snapshot status, diagnose a failing run, classify it as branch-related or flaky/infra, and either fix, rerun, or escalate. Use when asked "why is CI failing on PR N", "check the PR checks", "is CI green on my PR", "rerun the flaky check", "fix the lint failure on my PR", or similar — for a specific PR, not a sweep across many. Parse `$ARGUMENTS` for a PR number or URL; if a caller already has pre-fetched `checks`/`failedRuns` JSON in the shape documented below (e.g. a `pr-babysit`-style snapshot), pass that through instead of re-fetching — this skill accepts either.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 1
Forks
0

01 前言 Front Matter

name
pr-checks
license
MIT
metadata
{ "version": "1.0.0" }
description
Load this whenever the user asks about the CI checks of one specific PR — even when they paste the check output or logs themselves — before answering. It defines how to classify each check (branch-related, flaky/infra, cancelled = superseded), when to rerun or escalate, and the closing "in flight" summary. Review and respond to a single PR's CI checks: snapshot status, diagnose a failing run, classify it as branch-related or flaky/infra, and either fix, rerun, or escalate. Use when asked "why is CI failing on PR N", "check the PR checks", "is CI green on my PR", "rerun the flaky check", "fix the lint failure on my PR", or similar — for a specific PR, not a sweep across many. Parse `$ARGUMENTS` for a PR number or URL; if a caller already has pre-fetched `checks`/`failedRuns` JSON in the shape documented below (e.g. a `pr-babysit`-style snapshot), pass that through instead of re-fetching — this skill accepts either.

03 SKILL.md 正文

PR checks: review and respond

Contract

  • Input: a PR number or URL via $ARGUMENTS, optionally with pre-fetched checks/failedRuns JSON in the pr-babysit snapshot shape (skips the re-fetch).
  • Output: one report line per check (name, classification, action taken) plus a one-line "in flight" summary a caller can lift verbatim.
  • Does not: snapshot other PRs, address review comments, or merge.

Standalone entry point for one PR's CI status — snapshot, diagnose, classify, act, report. No project-supplied snapshot script or sibling skill is required: everything here has a plain gh-only path. If a caller (e.g. pr-babysit) already has fresher data in the same shape, hand it in and this skill skips straight to diagnosing instead of re-fetching.

Parse $ARGUMENTS: a PR number or URL (required for the gh-only path), and optionally pre-fetched checks[] / failedRuns[] data in the shape below.

Step 1 — snapshot the checks

With only a PR number/URL:

gh pr checks <n>

For each failing entry, pull its log:

gh run view <runId> --log-failed

Normalize every check to one of pass / pending / fail / skip, while keeping the raw GitHub conclusion (SUCCESS, CANCELLED, FAILURE, etc.) alongside it. A CANCELLED run is not a real failure — it's almost always a run superseded by a newer push (e.g. under a concurrency group with cancel-in-progress: true). Both CANCELLED and FAILURE normalize to state: "fail", but only a non-cancelled failure is a genuine, fixable CI failure worth diagnosing below.

With pre-fetched data: accept checks[] / failedRuns[] in the same shape pr-babysit's snapshot contract emits (see plugins/github-pr/skills/pr-babysit/SKILL.md's "Snapshot contract" section for the authoritative field list). The fields this skill reads:

  • checks[]: name, state (pass/pending/fail/skip), conclusion (raw), required.
  • failedRuns[]: runId, workflow, runAttempt, conclusion, url, rerunBudgetLeft.

Either path produces the same in-memory shape for the steps below — there's one code path from here on, regardless of how the data arrived.

Step 2 — diagnose

When --log-failed's summary isn't enough to explain a failure, escalate in the order documented in docs/github-actions.md ("Debugging a failing run") — quoted here just enough to act without opening the doc:

  1. gh pr checks / gh run view <runId> --log-failed — already done in Step 1; this is the default and usually sufficient.
  2. gh api repos/<owner>/<repo>/actions/runs/<runId>/jobs — per-step status and timing (started_at/completed_at) the summary view collapses.
  3. gh run rerun <runId> --debug --failed — re-runs the failed jobs with verbose step logging, nothing persisted to repo secrets afterward.
  4. gh run watch <runId> --compact --exit-status — follow an in-progress run live instead of polling.
  5. Last resort, and only for a run that already reaches a runner: act (local reproduction via Docker, low-fidelity for secrets/service containers) or a temporary mxschmitt/action-tmate step, guarded with if: ${{ failure() }}, placed immediately after the failing step, scoped with limit-access-to-actor: true, and removed once resolved.

For a workflow-syntax problem specifically (a run that never reaches a runner at all), actionlint / bash scripts/ci.sh lint-actions is the required check — none of the escalation steps above can diagnose a syntax error, since the run never gets far enough for them to help.

Full detail, rationale, and this repo's actual incident history live in docs/github-actions.md — read it rather than re-deriving the order from memory if anything here is ambiguous.

Step 3 — classify and act

For each real (non-cancelled) failure:

  • Branch-related — the failure traces to this PR's own changes (compile/lint/type/test/snapshot failures in touched areas): fix locally (see "Fixing locally" below), verify with the failing check's local equivalent (not the whole suite for a small fix), commit (fix: <what>), push.
  • Flaky/infra — timeouts, runner provisioning, registry/network outages, CI infra issues: if rerunBudgetLeft, gh run rerun <runId> --failed; otherwise report the blocker. Never "fix" a flake by editing tests, CI config, or dependency pins — that masks a real signal instead of resolving it.

Known patterns

Check docs/github-actions.md's "Known failure patterns" section before treating a failure as novel. Two documented there already:

  • Coverage-gate-fails-on-a-newly-visible-file (dfadler/agent-config#106) — a trace-based coverage gate (kcov, etc.) can fail a PR that only adds tests, never removes any, the first time it measures a file the coverage run had never executed before. The fix is to finish covering the newly-visible file, not to lower the threshold.
  • Post-merge stricter-rule stragglers — after merging a PR that adds or tightens an enforcing CI rule, a branch cut before that PR merged can carry violations its own (pre-rule) CI never saw, going red on the default branch despite every individual PR having been green. Watch the merge-timing race too (verify against the PR's own state, not the branch name).

If you hit a new recurring pattern, add it to docs/github-actions.md rather than re-deriving it ad hoc on a future pass — that doc is the single source of truth for this repo's failure history, and this skill intentionally doesn't duplicate it.

Hard limits

  • At most 2 reruns per failing workflow run per SHA (rerunBudgetLeft encodes this via the run's own attempt count) — then escalate instead of rerunning again.
  • Never bypass branch protection.
  • Only run local verification, fixes, or build/test commands for a PR authored by the person driving this pass. For a bot or fork PR, report and escalate — never check out and run a third party's branch locally.

Fixing locally

Never commit against a checkout another concurrent session might also be using:

  • Confirm the checkout's current commit matches the PR's headSha before editing; if it doesn't (or a pull fails), stop and escalate rather than editing against stale state.
  • Branch names are data — put the head branch name in a variable and quote every expansion ("$BRANCH"), never splice it bare into a command.
  • Verify proportionately before pushing: run the failing check's local equivalent, not the full suite, for a small fix.

Report

End with one line per check: the check name, the action taken (fixed and pushed / rerun triggered / reported as blocked / escalated), and whether a rerun or push is now in flight. For example:

lint: FAILURE (branch-related) — fixed locally, pushed as fix: quote unquoted expansion in build.sh
integration-tests: FAILURE (flaky, rerunBudgetLeft) — reran via `gh run rerun 123456 --failed`
coverage: CANCELLED — superseded by newer push, not a real failure, no action

Close with a one-line "in flight" summary (e.g. "rerun in progress" / "push just landed, CI retriggering" / "nothing in flight, all quiet") — phrased so a caller folding this into a larger pacing report (e.g. pr-babysit's PACING: line) can lift it directly rather than re-deriving it.

Works standalone

No project-supplied snapshot script, no sibling skill, and no prior pass are required — a bare PR number or URL via $ARGUMENTS is enough to run snapshot through report end to end using only gh. Pre-fetched checks/failedRuns data is an optional accelerant, not a dependency.

04 同仓库更多 Skills

dfadler
dfadler/agent-config

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.

★ 1
dfadler
dfadler/agent-config

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.

★ 1
dfadler
dfadler/agent-config

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.

★ 1
dfadler
dfadler/agent-config

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".

★ 1
dfadler
dfadler/agent-config

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]`.

★ 1
dfadler
dfadler/agent-config

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.

★ 1