skill · built into metaphor
/ai-ci
Budgeted investigation of failed GitHub Actions / PR checks — bootstrap annotations first, then failed logs, localize to code, classify flake vs real vs infra
- Built in
- Slash command
you ›/ai-ci
metaphor ›Loaded the ai-ci skill. What should I work on?
What the agent is told
This is the skill's SKILL.md, exactly what Metaphor reads before the task.
Use when the ask is why CI / a PR check failed — a red GitHub Action, failed gh pr checks entry, or a linked Actions run.
Prefer to delegate: task({ subagent_type: "ci", description, prompt }) runs this ladder in the background; await_subagent before you answer. Follow the ladder yourself only when you are already inside that subagent or no spawn is available.
Ladder
Scope — pin PR number, run id, check/job name, branch, or commit before fetching logs. Default: current branch's open PR (
gh pr list --head). A wrong run makes every later log meaningless.Enumerate — list failing checks (
gh pr checks/gh run view <id> --json jobs). Note duration and whethersteps/runner_nameare empty.Bootstrap gate (before logs) — job finished in a few seconds with zero steps or no runner → do not download logs (empty zip / 404 / 401). Fetch the platform reason:
gh api repos/<owner>/<repo>/check-runs/<check_run_id>/annotationscheck_run_idis the trailing id in the check details URL (.../actions/runs/.../job/<id>) or fromgh api repos/<owner>/<repo>/commits/<sha>/check-runs. The annotationmessageis often the whole answer (billing, spending limit, missing runner label, cancelled). Report it and stop.Logs — only if the job actually ran steps:
gh run view <run-id> --log-failed. Two strikes on a badghshape → help / search the verbatim error; do not thrash zip download flags.Localize — map file:line / test name / type error to this checkout with
grep/read.Classify — real failure vs flake vs infra (timeout, OOM, registry, auth, canceled, billing/spending limit, empty bootstrap).
Conclude — stop when evidence supports a claim. Suggest the smallest next fix in prose; do not edit.
Budget
Cap at about 10 bash/gh calls. Batch independent calls in the same turn. Large logs spill under @state/tool-output/ — aggregate with script; never paste raw job logs into the answer.
If a command returns background: true + shellId, await_shell until finished before concluding.
Do not re-run the full suite unless the parent prompt explicitly asks — this agent diagnoses.
Evidence discipline
- Claim a cause only from a returned log line, check status, or annotation message. Otherwise inconclusive + the one command that would settle it.
- Quote check name, run id, job/check-run id, test/file:line, exit code, or annotation text. Never invent a stack frame.
- Prefer
ghover any GitHub MCP. Auth fail → tell themgh auth login -h github.comand stop. - Empty log zip / BlobNotFound after a 2–10s failure is a bootstrap signal → annotations, not more download retries.
Output
Four short labelled parts, 3–12 lines total: Root cause · Evidence · Gaps · Next. Cite ≤8 lines of the failing snippet (or the annotation message) plus run/check ids.
Agents that use it
Questions
What is the ai-ci skill?
Budgeted investigation of failed GitHub Actions / PR checks — bootstrap annotations first, then failed logs, localize to code, classify flake vs real vs infra
How do I use ai-ci in Metaphor?
It is built into Metaphor. Type /ai-ci in the composer, or describe the task and the agent loads the skill when it fits.
What is a skill?
A skill is a set of written instructions the agent reads before it starts a kind of task. It changes how the agent works, not what it is allowed to do.
More built-in skills
- /ai-prSkillBudgeted whole-PR critique via the pr subagent — map diff, evidence findings, return a pr_review_draft for the Agent Review canvasships with metaphor
- /ai-securitySkillBudgeted security and AI-agent risk review — ai_security scan, OSV CVE/GHSA lookups, OWASP LLM/MCP/Top10 tagging, draft for Agent Review canvasships with metaphor
- /ai-sreSkillBudgeted production investigation against connected observability/logs MCP servers — scope, resolve schema, query, correlate, conclude with evidenceships with metaphor
- /boardSkillHow to work on the shared Board canvas — when to use it, locking onto one board, teaching with drawings, tool choice, placement, camera, narration and the…ships with metaphor
- /board-designSkillDesign language for the Board canvas — layout grid, hierarchy, roles and colour, typography, arrows, frames and patterns for common diagram typesships with metaphor
- /browser-debugSkillReproduce and diagnose a front-end bug in the Browser tab using the page snapshot and console errors.ships with metaphor