Repository navigation
feat(devx-qa): add babysit-pr skill - #19
Merged
Merged
Conversation
Watches a PR's CI after creation, diagnoses failing jobs from their logs, fixes branch-caused failures, reruns genuine flakes (budget: 3), and pushes until the PR is green and mergeable. Bumps devx-qa to 1.6.0 and wires the skill into the plugin README and marketplace manifests.
- Bind $PR in a preflight step; it was referenced but never defined - Check gh auth and a clean tree before acting - Gate every push behind a local verification of the same failing command - Add a per-job fix-attempt budget so a wrong diagnosis cannot loop - Rewrite the description in Use-when form with discovery terms - Number the workflow steps and add a concrete classification example
…skill A max-effort review confirmed 18 defects, reproduced against gh 2.100.0. Every load-bearing gh interaction was wrong. Security and safety: - Stop executing command strings read out of CI logs; verification commands now come from the repo's own scripts. Logs are stated to be data. - Forbid copying literal values from logs into the tree: GitHub masks only registered secrets and secrets-guard inspects paths, not context. - Add disable-model-invocation, a scoped allowed-tools, and argument-hint. This was the only auto-triggering, push-capable skill in the marketplace. - Verify the PR head branch is checked out before committing; refuse forks. - Ask before the first push. Correctness: - Dispatch on bucket, not state: state==FAILURE misses CANCELLED, TIMED_OUT, ERROR and ACTION_REQUIRED, and a cancelled-only run exits 0 (verified on react/react#37589: 238 pass, 6 cancel, exit 0). - Full exit-code table; exit 1 spans no-required-checks, no-checks-yet and real failure (verified: cli/cli#14456 exits 0, react/react#37656 exits 1). - Replace gh run view --job --log-failed, which errors 'run is still in progress' in exactly the state --fail-fast creates, with the jobs logs API plus --allow-escape-sequences. Grep the saved log instead of reading it all. - Stop assuming every check link is an Actions job URL; branch on workflow. - Wait for run completion before rerun (403 'already running') and decrement the budget only on a dispatched rerun. - Re-poll mergeable=UNKNOWN; dispatch on mergeStateStatus so BEHIND merges. - Substitute literal PR values: shell state does not survive between calls, and an empty selector silently resolves to the current branch's PR. - Thread -R owner/repo so a URL argument's repo is not discarded. - Add --required with a fallback for repos without branch protection. - Restore --interval 60 and handle the Bash timeout killing --watch. Structure: - Delegate mutations to devx-git: commits to ci, base merges to update-origin. Nothing here ran git fetch, so Step 6 merged a stale base ref forever. - Global budgets (5 pushes, 3 reruns, 45 min) evaluated at the loop head. Docs: correct the disproven --job claim, align section headers with the directory names Claude Code resolves, drop the phantom claudemd section, and fix the stale /commit reference (the skill directory is ci).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
babysit-prskill so a PR's failing CI can be diagnosed and remediated without re-explaining the loop each time. Distilled from codex'sbabysit-pr, which is ~16KB of instruction the model largely already knows — this keeps only what isn't in the weights: theghmechanics, the branch-caused vs. infrastructure classification, and hard budgets on autonomous pushes.devx-git:ciand base-branch merges throughdevx-git:update-origin, so the push guardrails live in one place instead of being re-implemented without them.Review
A
/code-review maxpass found 18 defects, reproduced live againstgh 2.100.0. All 18 are fixed in 08cbd16, and eachghinvocation in the file was re-verified against real repos before being written.Security and safety
secrets-guardinspects file paths and command strings — not context. Now explicitly forbidden, and logs are grepped rather than read whole.disable-model-invocation: true, a scopedallowed-tools, and confirmation before the first push.headRefName, checks out the PR, and refuses fork PRs.Correctness — verified, not assumed
select(.state=="FAILURE")missed CANCELLED, TIMED_OUT, ERROR, and ACTION_REQUIRED. Worse, a cancelled-only run exits 0:facebook/react#37589reports 238 pass / 6 cancel andgh pr checksexits 0. Now dispatches onbucket.cli/cli#14456exits 0,facebook/react#37656exits 1 withno required checks reported. Replaced with a full exit-code table plus message matching.gh run view --job <id> --log-failederrorsrun is still in progress— exactly the state--fail-fastcreates — so no matrix failure was diagnosable. Replaced withgh api .../actions/jobs/<id>/logs --allow-escape-sequences, which serves a job's log mid-run. The old rationale for--jobwas backwards and is gone.gh run rerun --failedreturns403 This workflow is already runningon an in-progress run, and the budget was decremented for the refused attempt. Now waits forstatus: completedand only counts a rerun that dispatched.mergeable: UNKNOWN— the normal value seconds after a push — was reported as ready, andBEHINDnever triggered the merge written one line below it. Now re-polls, then dispatches onmergeStateStatus.PR=$(...)was set in one Bash call and read in three others. Shell state does not persist, and an empty selector does not error —ghsilently falls back to the current branch's PR. Literal values are now substituted, and-R <owner>/<repo>is threaded through so a URL argument's repo isn't discarded./actions/runs/<id>/job/<id>— external CI, CLA bots, other repos. Now branches on theworkflowfield and surfaces non-Actions checks as blockers.--requiredwas never passed, so advisory checks entered the fix loop forever; it also exits 1 on repos with no branch protection, which is why it needed the exit-code table first.--watchoutlived the Bash tool's timeout with no arm for it;--interval 60restored.Structure
git fetch, so Step 6 merged a stale base ref and looped forever. Delegated todevx-git:update-origin, which fetches, takes a backup branch, and handles a rejected push.git pushviolatedupdate-originGuardrail 6, the fix shipped in 037c512. Nowgit push origin HEADwith the rejection recovery path.Docs — corrected the
--jobclaim the review disproved, aligned### fixing-skills/### fixing-react-antipatternswith their directory names, removed a### claudemdsection for a skill that does not exist, and fixed the stale/commitreference (the directory isci).Test plan
ghinvocation verified against live repos (cli/cli, facebook/react, nodejs/node, microsoft/vscode) on gh 2.100.0bucketfilter catches the cancelled-only false green--allow-escape-sequencesis requiredworkflowfield