Files
redwoodjs__local-ci/packages/cli/SKILL.md
Peter Pistorius 23fca333a2 docs(skills): cover --json NDJSON stream and exit-77 pause contract (#289, #315) (#328)
Update the agent-facing skill surfaces to match the recent pause-on-failure
fixes and `--json` event stream:

- skills/agent-ci/SKILL.md (published) and packages/cli/SKILL.md: document
  `--json` / `AGENT_CI_JSON=1`, list the NDJSON event types, and note that
  pipes/redirects are safe — pause-on-failure exits 77 in non-TTY mode.
- .claude/commands/agent-ci-dev.md and .pi/skills/agent-ci-dev/SKILL.md:
  switch the monitor pattern from grepping plaintext "Step failed" to
  matching `"event":"(run.paused|run.finish)"`, and call out exit-77 as a
  pause signal alongside the `run.paused` event.
- experiments/skill-evals/variants/v2-run-first.md and v3-no-mangling.md:
  remove stale "no pipes / no redirects" warnings — those scenarios are now
  the supported path via the detached launcher.

Refs #289, #315.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 15:35:33 +02:00

1.9 KiB

name, description, keywords
name description keywords
agent-ci Run GitHub Actions workflows locally with pause-on-failure for AI-agent-driven CI iteration
github-actions
local-ci
pause-on-failure
ai-agent
runner

What agent-ci does

Runs the official GitHub Actions runner binary locally (in Docker), emulating GitHub's cloud API. Cache is bind-mounted (instant). When a step fails, the container pauses — you can fix and retry the failed step without restarting.

When to use agent-ci (not act)

  • You want bit-for-bit compatibility with remote GitHub Actions
  • You need pause-on-failure for AI agent debugging loops
  • Cache round-trip speed matters

Key commands

  • Run workflow: npx @redwoodjs/agent-ci run --workflow <path>
  • Run all relevant workflows (those whose on triggers match the current branch/event, just like GitHub): npx @redwoodjs/agent-ci run --all
  • Retry after fix: npx @redwoodjs/agent-ci retry --name <runner>
  • Abort: npx @redwoodjs/agent-ci abort --name <runner>

Agent output mode

Pass --json (or set AGENT_CI_JSON=1) to emit an NDJSON event stream on stdout — one JSON object per line, with run.start/paused/finish, job.start/finish, step.start/finish, and diagnostic events. run.start carries schemaVersion: 1. Pair with --pause-on-failure: when stdout isn't a TTY the launcher detaches and the foreground process exits 77 the instant a run.paused event fires, so callers can react cleanly without parsing plaintext.

Common mistakes

  • Don't push to remote CI to test changes — use npx @redwoodjs/agent-ci run locally first
  • Don't use --from-start when only the last step failed — use retry with no flags to re-run only the failed step
  • The AI_AGENT=1 env variable disables animated output for cleaner agent logs
  • Use --no-matrix to collapse matrix jobs into a single run — your local machine is likely faster than GitHub's runners, so parallelizing across matrix combinations is unnecessary