Agentops rpi
Full RPI lifecycle orchestrator. Delegates to $discovery, $crank, $validation phase skills. One command, full lifecycle with complexity classification, --from routing, and optional loop. Triggers: "rpi", "full lifecycle", "research plan implement", "end to end".
git clone https://github.com/boshu2/agentops
T=$(mktemp -d) && git clone --depth=1 https://github.com/boshu2/agentops "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills-codex/rpi" ~/.claude/skills/boshu2-agentops-rpi && rm -rf "$T"
skills-codex/rpi/SKILL.md$rpi — Full RPI Lifecycle Orchestrator
Quick Ref: One command, full lifecycle.
→$discovery→$crank. Thin wrapper that delegates to phase orchestrators. YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it. THREE-PHASE RULE + FULLY AUTONOMOUS. Read$validation— it defines the mandatory 3-phase lifecycle, autonomous execution rules, anti-patterns, and phase completion logging. Unlessreferences/autonomous-execution.mdis set, RPI runs hands-free. Do NOT stop after Phase 2. Do NOT ask the user anything between phases.--interactive
Strict Delegation Contract (default)
RPI delegates via
$discovery, $crank, $validation as separate skill invocations. Strict delegation is the default — there is no --full flag because strict delegation is always on.
Anti-pattern to reject: compressing phases into one pass, substituting direct agent-spawns for
$skill invocations, skipping $validation. See ../shared/references/strict-delegation-contract.md for the full contract, rationalizations to reject, supported compression escapes (--quick, --fast-path, --from=<phase>, --no-retro, --no-forge, --no-budget), and detection rules.
A live compression was observed 2026-04-19; see
..agents/learnings/2026-04-19-orchestrator-compression-anti-pattern.md
Codex Lifecycle Guard
When this skill runs in Codex hookless mode (
CODEX_THREAD_ID is set or
CODEX_INTERNAL_ORIGINATOR_OVERRIDE is Codex Desktop), ensure startup context
before phase orchestration:
ao codex ensure-start 2>/dev/null || true
ao codex ensure-start is the single startup guard for Codex skills. It records
startup once per thread and skips duplicate startup automatically. Let
$validation, $post-mortem, or $handoff own the hookless closeout path via
ao codex ensure-stop.
Objective Scope Guard
$rpi owns one lifecycle objective from discovery through validation.
- Keep one objective spine across phases:
- if discovery or resume state yields an
, preserve thatepic_idepic_id - otherwise preserve the original goal plus execution-packet objective
- if discovery or resume state yields an
- Never replace the current objective with a child issue or one ready slice
surfaced by
,bd ready
, orbd show
..agents/rpi/next-work.jsonl - When bead IDs are present, resolve them before routing; when beads are absent,
route by
plus the current goal/execution-packet state.--from - If the input resolves to a child issue with a parent epic, carry the child as
context only and continue
against the parent epic.$rpi
from<promise>PARTIAL</promise>
means re-enter STEP 2 on the same lifecycle objective. It is not completion, and it is not a reason to stop.$crank
Phase ownership stays split even when
$rpi is the entrypoint: $discovery
owns phase-1 sequencing, $crank owns phase-2 execution retries, and
$validation owns phase-3 closeout. $rpi only classifies, routes, loops, and
reports across those phase orchestrators.
DAG — Execute This Sequentially
mkdir -p .agents/rpi classify(goal) -> complexity, start_phase
From
or start_phase, enter the DAG at the matching step and run every step after it:--from
STEP 1 -- if start_phase <= discovery: $discovery <goal> [--interactive] --complexity=<level> BLOCKED? -> stop (manual intervention) DONE? -> read the execution packet (latest alias or matching run archive) and preserve its objective spine Log: PHASE 1 COMPLETE ✓ (discovery) — proceeding to Phase 2 STEP 2 -- if execution-packet has epic_id: $crank <epic-id> [--test-first] [--no-test-first] else: $crank .agents/rpi/execution-packet.json [--test-first] [--no-test-first] PARTIAL? -> retry SAME objective (max 3 total), then stop BLOCKED? -> retry SAME objective with block context (max 3 total), then stop DONE? -> ao ratchet record implement 2>/dev/null || true Log: PHASE 2 COMPLETE ✓ (implementation) — proceeding to Phase 3 STEP 3 -- if execution-packet has epic_id: $validation <epic-id> --complexity=<level> [--strict-surfaces if --quality] else: $validation --complexity=<level> [--strict-surfaces if --quality] FAIL? -> re-crank + re-validate (max 3 total), then stop DONE? -> ao ratchet record vibe 2>/dev/null || true Log: PHASE 3 COMPLETE ✓ (validation) — RPI DONE STEP 4 -- report(verdicts) if --loop && FAIL && cycle < max_cycles: restart from STEP 1 if --spawn-next: read .agents/rpi/next-work.jsonl, suggest next
That's it. Steps 1→2→3→4. No stopping between steps. No summarizing. No asking. Enter at
--from, run to the end. The human's only touchpoint is after STEP 4.
Setup + Classify (STEP 0 detail)
Determine start_phase:
- default:
discovery
(aliases:--from=implementation
) → STEP 2crank
(aliases:--from=validation
,vibe
) → STEP 3post-mortem- aliases
,research
,plan
,pre-mortem
→ STEP 1brainstorm - If input is a bead ID and no
, resolve it before routing:--from
saysbd show <id>
→ STEP 2 using that epic IDissue_type=epic- child issue with
→ STEP 2 using the parent epic IDparent
- If beads are absent or the input is plain goal text:
- preserve the goal as the lifecycle objective
- use
as the phase-2 handoff when discovery does not yield an epic.agents/rpi/execution-packet.json - default to STEP 1 unless the user explicitly set
--from
- Do not infer epic scope from
aloneag-*
Classify complexity:
| Level | Criteria | Behavior |
|---|---|---|
| Goal <=30 chars, no complex/scope keywords | Full DAG. Gates use throughout. |
| Goal 31-120 chars, or 1 scope keyword | Full DAG. Gates use |
| Complex-operation keyword, 2+ scope keywords, or >120 chars | Full DAG. Gates use full council |
Complex-operation keywords:
refactor, migrate, migration, rewrite, redesign, rearchitect, overhaul, restructure, reorganize, decouple, deprecate, split, extract module, port
Scope keywords:
all, entire, across, everywhere, every file, every module, system-wide, global, throughout, codebase
Overrides:
--deep forces full. --fast-path forces fast.
Log:
RPI mode: rpi-phased (complexity: <level>)
Initialize state:
rpi_state = { goal: "<goal string>", epic_id: null, phase: "<discovery|implementation|validation>", complexity: "<fast|standard|full>", test_first: <true by default; false only when --no-test-first>, cycle: 1, max_cycles: <3 when --loop; overridden by --max-cycles>, verdicts: {} }
Gate Logic Detail
STEP 1 gate (discovery):
: read the execution packet (latest alias or matching run archive), preserve<promise>DONE</promise>
, and useobjective
only when it is present. Otherwise pass the execution packet itself to STEP 2.epic_id
: stop — discovery handles its own retries (max 3 pre-mortem attempts)<promise>BLOCKED</promise>
STEP 2 gate (implementation, max 3 attempts):
: proceed to STEP 3<promise>DONE</promise>
: retry<promise>BLOCKED</promise>
on the same lifecycle objective with block context (max 2 retries)$crank
: retry<promise>PARTIAL</promise>
on the same lifecycle objective (max 2 retries). Do not hand off a child issue, narrow to one slice, or stop at a partial phase result.$crank
STEP 3 gate (validation-to-crank loop, max 3 total):
: proceed to STEP 4<promise>DONE</promise>
: extract findings → re-invoke<promise>FAIL</promise>
on the same epic or execution packet → re-invoke$crank$validation
STEP 4 (report + optional loop):
- Summarize all phase verdicts and epic status. See
.references/report-template.md
+ FAIL + cycle < max_cycles: extract 3 fixes from post-mortem, increment cycle, restart from STEP 1--loop
: read--spawn-next
, suggest next.agents/rpi/next-work.jsonl
command (do NOT auto-invoke)$rpi
Flags
| Flag | Default | Description |
|---|---|---|
| | Enter DAG at , , or |
| off | Human gates in discovery only |
| on | Fully autonomous. Inverse of |
| off | Post-mortem FAIL triggers new cycle |
| | Max cycles when enabled |
| off | Surface follow-up work after completion |
| on | Strict-quality (passed to ) |
| off | Opt out of strict-quality |
| auto | Force fast complexity (uses quick inline gates, still runs full lifecycle) |
| auto | Force full complexity |
| off | Pass to , making all 4 surface failures blocking |
| off | Report without mutating queue |
| off | Disable phase time budgets |
Quick Start
$rpi "add user authentication" # full DAG $rpi --interactive "add user authentication" # human gates in discovery only $rpi --from=implementation ag-23k # enter at STEP 2 $rpi --from=validation # enter at STEP 3 $rpi --loop --max-cycles=3 "add auth" # iterate-on-fail loop $rpi --deep "refactor payment module" # force full council $rpi --fast-path "fix typo in readme" # force fast inline gates
Complexity-Scaled Council Gates
Pre-mortem (STEP 5 in discovery)
complexity == "fast": inline review, no spawning (--quick) | complexity == "standard": inline fast default (--quick) | complexity == "full": full council, 2-judge minimum. Retry gate: max 3 total attempts.
Final Vibe (STEP 1 in validation)
complexity == "fast": inline review, no spawning (--quick) | complexity == "standard": inline fast default (--quick) | complexity == "full": full council, 2-judge minimum. Retry gate: max 3 total attempts.
Post-mortem (STEP 2 in validation)
complexity == "fast": inline review, no spawning (--quick) | complexity == "standard": inline fast default (--quick) | complexity == "full": full council, 2-judge minimum. Retry gate: max 3 total attempts.
Phase Data Contracts
All transitions use filesystem artifacts (no in-memory coupling). The execution packet (
.agents/rpi/execution-packet.json as the latest alias, plus .agents/rpi/runs/<run-id>/execution-packet.json as the per-run archive) carries contract_surfaces (repo execution profile), done_criteria, and queue claim/finalize metadata between phases. Sub-skills include $plan, $vibe, $post-mortem, and $pre-mortem. For detailed contract schemas, read references/phase-data-contracts.md.
Examples
Read
references/examples.md for full lifecycle, resume, and interactive examples.
Troubleshooting
Read
references/troubleshooting.md for common problems and solutions.
See also: discovery, crank, validation
Reference Documents
- references/autonomous-execution.md
- references/complexity-scaling.md
- references/context-windowing.md
- references/error-handling.md
- references/examples.md
- references/gate-retry-logic.md
- references/gate4-loop-and-spawn.md
- references/phase-budgets.md
- references/phase-data-contracts.md
- references/report-template.md
- references/troubleshooting.md
Local Resources
references/
- references/autonomous-execution.md
- references/complexity-scaling.md
- references/context-windowing.md
- references/error-handling.md
- references/examples.md
- references/gate-retry-logic.md
- references/gate4-loop-and-spawn.md
- references/phase-budgets.md
- references/phase-data-contracts.md
- references/report-template.md
- references/troubleshooting.md
scripts/
scripts/validate.sh