rpi
Run discovery, crank, validation.
What this skill does
# /rpi - Full Lifecycle Orchestrator
> Quick ref: `/discovery` -> `/crank` -> `/validate`, then report.
**Execute this workflow. Do not only describe it.** RPI is autonomous unless
`--interactive` is set. The user touchpoint is after validation, or after a
real blocked state exhausts retries. Read
[references/autonomous-execution.md](references/autonomous-execution.md) when
you need the full autonomy contract.
## Loop position
`/rpi` is the orchestrator across **every move** of the [operating loop](../../docs/architecture/operating-loop.md): BDD intent → vertical slices → conflict-free wave → bead acceptance → evidence + learning capture. It delegates each move to the skill that owns it (`/discovery`, `/plan`, `/crank`, `/validate`, `/forge`/`/post-mortem`), and enforces three loop-level invariants:
- **No move-skipping.** Strict delegation is on by default; phases never compress, and validation cannot be skipped. The lifecycle objective is preserved across the whole loop.
- **The first failing test is the bead's contract.** With `--test-first` on (the default), `/crank` is invoked with the TDD-per-slice discipline; `--no-test-first` is an explicit opt-out, not a fast path.
- **Acceptance examples close the bead, not activity.** Validation FAIL re-cranks on the same objective up to 3 attempts; DONE requires the acceptance roll-up in the [slice-validation template](../../docs/templates/slice-validation.md) to be fully green.
- **Ports stay visible.** Preserve the
[Intent-to-Loop Hexagon](../../docs/architecture/intent-to-loop-hexagon.md)
boundary as the objective crosses `shape_intent`, `persist_intent`,
`plan_slices`, `execute_wave`, `validate_acceptance`, and `record_evidence`.
- **Context density survives phase boundaries.** Apply the [Context Density Rule](../domain/references/context-density-rule.md) to every phase handoff and final report: keep intent, boundary, evidence, decision, constraint, and next action; omit or link anything else.
## Core Contract
RPI delegates via `Skill(skill="discovery", ...)`,
`Skill(skill="crank", ...)`, and `Skill(skill="validate", ...)` as separate
tool invocations. Keep strict delegation on by default; do not compress phases,
replace phase skills with direct agent spawns, or skip validation. Read
[../shared/references/strict-delegation-contract.md](../shared/references/strict-delegation-contract.md)
for the full anti-compression contract.
See [references/isolation-contract.md](references/isolation-contract.md) for
the four-lever model, phase-isolated skill transport, and the compression
patterns `scripts/check-skill-isolation.sh` flags. See
[references/best-practices.md](references/best-practices.md) for the principle
and anti-pattern citation table.
When the runtime supports phase isolation, keep `/rpi` visible in the main
session and run each phase contract through isolated transport: phase skill
name in, bounded handoff artifact in, phase artifact/verdict/next action out.
The transport may be a daemon job, process runner, or subagent wrapper, but it
must execute the declared phase skill contract rather than doing phase work
directly.
RPI owns one lifecycle objective across all phases. Preserve the discovered
`epic_id` when present; otherwise preserve the original goal and execution
packet objective. A child bead or one ready slice is context, not a replacement
objective. `<promise>PARTIAL</promise>` from `/crank` means retry Phase 2 on the
same objective.
## Route And Classify
1. Create `.agents/rpi/`.
2. Resolve `--from`:
- default, `research`, `plan`, `pre-mortem`, `brainstorm` -> discovery
- `implementation` or `crank` -> implementation
- `validation`, `vibe`, or `post-mortem` -> validation
3. If the input is a bead and `--from` is absent, resolve it with `bd show`:
- epic -> implementation with that epic
- child with parent -> implementation with the parent epic
4. Classify complexity:
- `fast`: short/simple goal or `--fast-path`
- `standard`: medium goal or one scope keyword
- `full`: `--deep`, complex-operation keyword, 2+ scope keywords, or >120 chars
5. Log `RPI mode: rpi-phased (complexity: <level>)`.
Track state compactly:
```text
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,
verdicts: {}
}
```
Complex-operation keywords include `refactor`, `migrate`, `rewrite`,
`redesign`, `rearchitect`, `overhaul`, `decouple`, `deprecate`, `split`,
`extract module`, and `port`. Scope keywords include `all`, `entire`, `across`,
`everywhere`, `every file`, `system-wide`, `global`, and `codebase`.
## Phase DAG
Enter at the routed phase and run every phase after it.
1. **Discovery:** invoke `/discovery <goal> [--interactive] --complexity=<level>`
directly or through phase-isolated skill transport.
On DONE, read `.agents/rpi/execution-packet.json` or the run archive and
preserve its objective spine. On BLOCKED, stop with the discovery verdict.
2. **Implementation:** invoke `/crank <epic-id>` when the packet has `epic_id`;
otherwise invoke `/crank .agents/rpi/execution-packet.json`, directly or
through phase-isolated skill transport. Pass `--test-first` or
`--no-test-first` through. On DONE, record `ao ratchet record implement
2>/dev/null || true` and continue. On PARTIAL or BLOCKED, retry the same
objective up to 3 total attempts.
3. **Validation:** invoke `/validate <epic-id> --complexity=<level>` when an
epic exists; otherwise invoke `/validate --complexity=<level>`, directly
or through phase-isolated skill transport. Add `--strict-surfaces` when
`--quality` is set. On FAIL, extract findings, re-run `/crank` on the same
objective, then re-run `/validate`, up to 3 total validation attempts. On
DONE, record `ao ratchet record vibe 2>/dev/null || true`.
4. **Report:** summarize phase verdicts and epic status using
[references/report-template.md](references/report-template.md). With
`--loop`, restart from discovery on FAIL while `cycle < max_cycles`. With
`--spawn-next`, read `.agents/rpi/next-work.jsonl` and suggest the next
command without invoking it. Before emitting the report, apply the Context
Density Rule: every line should carry intent, boundary, evidence, decision,
constraint, or next action.
## Phase Data Contract
The execution packet carries the repo execution profile through
`contract_surfaces`, `done_criteria`, and queue claim/finalize metadata. Keep
the latest alias at `.agents/rpi/execution-packet.json` and read
[references/phase-data-contracts.md](references/phase-data-contracts.md) for
schemas and archive paths.
## Complexity-Scaled Gates
### Pre-mortem
- `complexity == "low"` or `"fast"`: inline review, no spawning (`--quick`)
- `complexity == "medium"` or `"standard"`: inline fast default (`--quick`)
- `complexity == "high"` or `"full"`: full council, 2-judge minimum; max 3 total attempts
### Final Vibe
- `complexity == "low"` or `"fast"`: inline review, no spawning (`--quick`)
- `complexity == "medium"` or `"standard"`: inline fast default (`--quick`)
- `complexity == "high"` or `"full"`: full council, 2-judge minimum; max 3 total attempts
### Post-mortem (STEP 2)
- `complexity == "low"` or `"fast"`: inline review, no spawning (`--quick`)
- `complexity == "medium"` or `"standard"`: inline fast default (`--quick`)
- `complexity == "high"` or `"full"`: full council, 2-judge minimum; max 3 total attempts
## Flags
| Flag | Default | Purpose |
|------|---------|---------|
| `--from=<phase>` | discovery | Start at discovery, implementation, or validation |
| `--discovery-artifact=<path>` | unset | With implementation start, convert an existing artifact into the handoff packet |
| `--interactive` | off | Human gates in discovery/validate |
| `--auto` | on | Fully autonomous default |
| `--loop --max-cycles=<n>` | off / 3 |Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.