agentleFS
ryanportfolioryanportfolio/Harness-Firmware/.agents/skills/babysit-ci/SKILL.md

babysit-ci

Skill1 starsChanged 21 days agoMITView on GitHub

Watches a PR's checks and fixes failures. Use for $babysit-ci, \"watch CI\", \"fix CI\", \"get checks green\", or a PR with failing or pending checks; not a bare merge request.

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read checks with gh pr checks <pr> --json name,bucket,state,workflow,link.

    line 17
  2. Very specific:

    Caused by this PR: if the failing command is cheap to run locally, reproduce the failure first and rerun it after the change.

    line 30
  3. Distinctive:

    After any push, restart at step 2.

    line 32

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Babysit CI

Mode

  • watch: inspect and report. No edits, pushes, or reruns.
  • fix ("fix CI", "get checks green"): scoped fixes and pushes. Never merge.
  • Ambiguous request: watch.

Loop

  1. Find the PR: gh pr view <pr> --json number,url,headRefName,headRefOid. No PR given: pass the branch from git branch --show-current.
  2. Read checks with gh pr checks <pr> --json name,bucket,state,workflow,link. Judge the PR by this output alone: Actions runs are only part of it, since apps and status contexts report here too.
  3. Diagnose failures before waiting on anything. Each failing check gets one root error: the earliest log line that names a cause; errors after it often follow from it.
    • Actions check: take the run id from its link; gh run view <run-id> --log-failed.
    • External check: open its link and find the step or service that failed.
  4. Pending checks: run gh pr checks <pr> --watch --fail-fast as a long-running command if this runtime supports one and keep diagnosing meanwhile; otherwise run it in the foreground.
  5. Watch mode: once the watcher exits, reread the checks and the head SHA, report, and stop. Fix mode continues below.

Fix

Sort each failure before touching code:

  • Not from this PR's diff: see whether the default branch already passes that check. If it does, git fetch origin and git merge origin/<default> bring the fix in; this PR carries no patch for it.
  • Flake: one rerun (gh run rerun <run-id> --failed), and cite the evidence: it passed on rerun with no change, or it is a known flake (say where it is recorded).
  • Caused by this PR: if the failing command is cheap to run locally, reproduce the failure first and rerun it after the change. One cause per push. Stage explicit paths. Never pass --no-verify.

After any push, restart at step 2. A push can trigger workflows the old list lacked or retire ones it showed, so check state read before the push is stale.

Stop, report, and ask before continuing

  • 3 fix pushes done.
  • The same failure survives a fix: switch to $fable-mode, rethink the cause, and name the fix tier.
  • The fix needs secrets, infra, permissions, or a user decision.

Before calling it green

Re-read headRefOid; if it moved, run the loop on the new head. A missing, skipped, or unavailable expected check does not pass; list it.

Each fix push leaves a head without the pre-merge review. State that in the report. Rerunning the cross-vendor $claude-review uses the user's Claude subscription and needs their OK.

A CI quirk that cost a retry goes to pitfalls via $recall.

Report

  • Each iteration: check → first root error line → link → fix applied.
  • Final: status and PR URL, or blocked plus the next action.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.