{"id":"87cd2330-6243-4a5d-b2ea-545a97f1ae81","shortId":"7wUrVG","kind":"skill","title":"ci-debug-loop","tagline":"Watch a GitHub Actions CI run, diagnose failures from logs, apply fixes, re-push, and repeat until green or escalate. Use when CI is failing and the user wants to debug and fix it iteratively, or says \"fix CI\", \"debug the build\", or similar.","description":"# CI Debug Loop\n\nIteratively watch CI, diagnose failures, fix, and re-trigger until the run passes or escalation is needed.\n\n## 1. Identify the Run\n\nFind the latest run for the current branch:\n\n```bash\ngh run list --branch $(git branch --show-current) --limit 1 --json databaseId,status,conclusion,name\n```\n\nIf a specific run ID or workflow is provided by the user, use that instead.\n\n## 2. Watch\n\nIf the run is still in progress:\n\n```bash\ngh run watch <run_id> --exit-status\n```\n\nIf it already completed, proceed to diagnosis.\n\n## 3. Diagnose Failure\n\nOn failure, fetch logs for the failed job(s):\n\n```bash\ngh run view <run_id> --log-failed\n```\n\n**Delegate log analysis to a two-stage subagent pipeline** when the failed-log output is more than ~200 lines. CI logs flood main context fast and the parent only needs the root cause, not the raw output. Per `parallelize-subagents`, `delegate-investigation`, and `subagent-model-routing`:\n\n**Stage 1 — Extract (Haiku):** Spawn an `Explore` subagent (`model: haiku`) per failed job (parallel if multiple jobs failed). Prompt: paste the **command to fetch the log** (not the log itself); ask for \"first failing assertion + ~10 lines of surrounding context, ≤50 lines, prefixed with `Status: ...`\". Haiku handles the mechanical extraction; no interpretation needed at this stage.\n\n**Stage 2 — Interpret (Sonnet):** After Stage 1 completes, spawn a `generalPurpose` subagent (`model: sonnet`) with the Stage 1 structured output pasted inline plus the failure categories below. Ask for \"likely root cause + file:line if identifiable, ≤100 words, prefixed with `Status: ...`\".\n\n- Parent receives the Stage 2 summary, decides the fix.\n\nFor short logs (<200 lines), inspect inline.\n\nCommon failure categories:\n- **Build errors**: compilation failures, missing dependencies\n- **Test failures**: assertion errors, timeouts, flaky tests\n- **Auth/permissions**: token scopes, registry auth, SSH keys\n- **Config/YAML**: syntax errors, wrong flags, missing env vars, heredoc issues\n- **Infrastructure**: runner issues, Docker rate limits, service unavailability\n\n## 4. Fix\n\nIf the fix is **mechanical** (typo, missing flag, wrong version, import ordering, fmt issue):\n- Apply the fix directly\n- Commit using [Conventional Commits](https://www.conventionalcommits.org/) format\n- Push\n\nIf the fix requires a **design decision** or is **ambiguous**:\n- Present the diagnosis and options to the user\n- Wait for direction before applying\n\n## 5. Re-watch\n\nAfter pushing the fix, wait for the new run to appear:\n\n```bash\ngh run list --branch $(git branch --show-current) --limit 1\n```\n\nThen watch it (back to step 2).\n\n## 6. Escalation\n\n**Stop and escalate to the user** if:\n- The same job fails twice with the same error after a fix attempt\n- The failure is in infrastructure outside the repo's control (runner issues, external service outages)\n- The fix would require changes to a different repository or CI configuration not in this repo\n\nReport what was tried, what failed, and what options remain.\n\n**Escalate to `bisect`** when log analysis can't pinpoint *which change* broke the job. Typical signs: failure looks unrelated to the recent diff, error message points at code untouched in the branch, or a previously-green test on the same branch is now red. Hand the failing test/command to `/bisect` as the reproducer; it isolates the offending commit.\n\n## Cross-references\n\n- Per `~/.claude/rules/probe-not-assume.md`: confirm via tool/command before recommending; do not infer.","tags":["debug","loop","skill","issue","paultyng","agent-skills","ai-tools","claude-code","cursor","dotfiles"],"capabilities":["skill","source-paultyng","skill-ci-debug-loop","topic-agent-skills","topic-ai-tools","topic-claude-code","topic-cursor","topic-dotfiles"],"categories":["skill-issue"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/paultyng/skill-issue/ci-debug-loop","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add paultyng/skill-issue","source_repo":"https://github.com/paultyng/skill-issue","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 8 github stars · SKILL.md body (3,511 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:09:00.233Z","embedding":null,"createdAt":"2026-05-18T13:21:24.973Z","updatedAt":"2026-05-18T19:09:00.233Z","lastSeenAt":"2026-05-18T19:09:00.233Z","tsv":"'/)':388 '/.claude/rules/probe-not-assume.md':574 '/bisect':561 '1':71,94,209,270,281,440 '10':243 '100':300 '2':115,265,309,447 '200':176,317 '3':138 '4':362 '5':414 '50':248 '6':448 'action':8 'alreadi':133 'ambigu':400 'analysi':159,516 'appear':428 'appli':15,378,413 'ask':238,291 'assert':242,332 'attempt':469 'auth':341 'auth/permissions':337 'back':444 'bash':83,124,150,429 'bisect':513 'branch':82,87,89,433,435,542,552 'broke':522 'build':47,324 'categori':289,323 'caus':191,295 'chang':489,521 'ci':2,9,28,44,50,55,178,495 'ci-debug-loop':1 'code':538 'command':229 'commit':382,385,569 'common':321 'compil':326 'complet':134,271 'conclus':98 'config/yaml':344 'configur':496 'confirm':575 'context':182,247 'control':479 'convent':384 'cross':571 'cross-refer':570 'current':81,92,438 'databaseid':96 'debug':3,36,45,51 'decid':311 'decis':397 'deleg':157,201 'delegate-investig':200 'depend':329 'design':396 'diagnos':11,56,139 'diagnosi':137,403 'diff':533 'differ':492 'direct':381,411 'docker':357 'env':350 'error':325,333,346,465,534 'escal':25,68,449,452,511 'exit':129 'exit-status':128 'explor':214 'extern':482 'extract':210,257 'fail':30,147,156,170,219,225,241,460,506,558 'failed-log':169 'failur':12,57,140,142,288,322,327,331,471,527 'fast':183 'fetch':143,231 'file':296 'find':75 'first':240 'fix':16,38,43,58,313,363,366,380,393,421,468,486 'flag':348,371 'flaki':335 'flood':180 'fmt':376 'format':389 'generalpurpos':274 'gh':84,125,151,430 'git':88,434 'github':7 'green':23,547 'haiku':211,217,253 'hand':556 'handl':254 'heredoc':352 'id':104 'identifi':72,299 'import':374 'infer':582 'infrastructur':354,474 'inlin':285,320 'inspect':319 'instead':114 'interpret':259,266 'investig':202 'isol':566 'issu':353,356,377,481 'iter':40,53 'job':148,220,224,459,524 'json':95 'key':343 'latest':77 'like':293 'limit':93,359,439 'line':177,244,249,297,318 'list':86,432 'log':14,144,155,158,171,179,233,236,316,515 'log-fail':154 'look':528 'loop':4,52 'main':181 'mechan':256,368 'messag':535 'miss':328,349,370 'model':206,216,276 'multipl':223 'name':99 'need':70,188,260 'new':425 'offend':568 'option':405,509 'order':375 'outag':484 'output':172,195,283 'outsid':475 'parallel':198,221 'parallelize-subag':197 'parent':186,305 'pass':66 'past':227,284 'per':196,218,573 'pinpoint':519 'pipelin':166 'plus':286 'point':536 'prefix':250,302 'present':401 'previous':546 'previously-green':545 'proceed':135 'progress':123 'prompt':226 'provid':108 'push':19,390,419 'rate':358 'raw':194 're':18,61,416 're-push':17 're-trigg':60 're-watch':415 'receiv':306 'recent':532 'recommend':579 'red':555 'refer':572 'registri':340 'remain':510 'repeat':21 'repo':477,500 'report':501 'repositori':493 'reproduc':564 'requir':394,488 'root':190,294 'rout':207 'run':10,65,74,78,85,103,119,126,152,426,431 'runner':355,480 'say':42 'scope':339 'servic':360,483 'short':315 'show':91,437 'show-curr':90,436 'sign':526 'similar':49 'skill' 'skill-ci-debug-loop' 'sonnet':267,277 'source-paultyng' 'spawn':212,272 'specif':102 'ssh':342 'stage':164,208,263,264,269,280,308 'status':97,130,252,304 'step':446 'still':121 'stop':450 'structur':282 'subag':165,199,205,215,275 'subagent-model-rout':204 'summari':310 'surround':246 'syntax':345 'test':330,336,548 'test/command':559 'timeout':334 'token':338 'tool/command':577 'topic-agent-skills' 'topic-ai-tools' 'topic-claude-code' 'topic-cursor' 'topic-dotfiles' 'tri':504 'trigger':62 'twice':461 'two':163 'two-stag':162 'typic':525 'typo':369 'unavail':361 'unrel':529 'untouch':539 'use':26,112,383 'user':33,111,408,455 'var':351 'version':373 'via':576 'view':153 'wait':409,422 'want':34 'watch':5,54,116,127,417,442 'word':301 'workflow':106 'would':487 'wrong':347,372 'www.conventionalcommits.org':387 'www.conventionalcommits.org/)':386","prices":[{"id":"d15fd84b-aa43-4e63-ac03-37f3cc963f89","listingId":"87cd2330-6243-4a5d-b2ea-545a97f1ae81","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"paultyng","category":"skill-issue","install_from":"skills.sh"},"createdAt":"2026-05-18T13:21:24.973Z"}],"sources":[{"listingId":"87cd2330-6243-4a5d-b2ea-545a97f1ae81","source":"github","sourceId":"paultyng/skill-issue/ci-debug-loop","sourceUrl":"https://github.com/paultyng/skill-issue/tree/main/skills/ci-debug-loop","isPrimary":false,"firstSeenAt":"2026-05-18T13:21:24.973Z","lastSeenAt":"2026-05-18T19:09:00.233Z"}],"details":{"listingId":"87cd2330-6243-4a5d-b2ea-545a97f1ae81","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"paultyng","slug":"ci-debug-loop","github":{"repo":"paultyng/skill-issue","stars":8,"topics":["agent-skills","ai-tools","claude-code","cursor","dotfiles"],"license":"mit","html_url":"https://github.com/paultyng/skill-issue","pushed_at":"2026-05-18T18:26:54Z","description":"Personal Claude Code / Cursor agent skills, rules, and config","skill_md_sha":"71fc3ef8c8bc5f3942fa9c5503ee69da54b12ce4","skill_md_path":"skills/ci-debug-loop/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/paultyng/skill-issue/tree/main/skills/ci-debug-loop"},"layout":"multi","source":"github","category":"skill-issue","frontmatter":{"name":"ci-debug-loop","description":"Watch a GitHub Actions CI run, diagnose failures from logs, apply fixes, re-push, and repeat until green or escalate. Use when CI is failing and the user wants to debug and fix it iteratively, or says \"fix CI\", \"debug the build\", or similar."},"skills_sh_url":"https://skills.sh/paultyng/skill-issue/ci-debug-loop"},"updatedAt":"2026-05-18T19:09:00.233Z"}}