---
name: ralplan
description: Alias for /omagy:plan --consensus.
argument-hint: "[--interactive|--deliberate] <task>"
---

# Ralplan

Ralplan is a shorthand alias for `/omagy:plan --consensus`. It triggers
iterative planning with Planner, Architect, and Critic roles until consensus is
reached, using RALPLAN-DR structured deliberation.

Do not implement directly inside Ralplan. It produces `.omagy/plans/prd-*.md`
and `.omagy/plans/test-spec-*.md`, then hands off to `/omagy:team` or
`/omagy:ralph`.

## Runtime Contract

1. Read existing planning state:

   ```bash
   omagy plan status --json
   ```

2. Follow `/omagy:plan --consensus <arguments>`.
3. Use `omagy question --input <json> --json` for interactive approval when a
   visible tmux renderer is available; otherwise use Antigravity native
   structured prompting when available.
4. Persist final PRD/test-spec directly under `.omagy/plans/`:

   ```text
   .omagy/plans/prd-<YYYYMMDDTHHMMSSZ>-<slug>.md
   .omagy/plans/test-spec-<same-YYYYMMDDTHHMMSSZ>-<same-slug>.md
   ```

5. Complete runtime state and verify launch hints before execution:

   ```bash
   omagy plan complete --json
   omagy plan handoff --mode team --json
   omagy plan handoff --mode ralph --json
   ```

## RALPLAN-DR

Short mode is the default. Use `--deliberate` or auto-enable deliberate mode for
auth/security, migrations, destructive changes, production incidents,
compliance/PII, or public API breakage.

Planner output must include:

- Principles (3-5)
- Decision Drivers (top 3)
- Viable Options (at least 2) with bounded pros/cons
- Explicit invalidation rationale when only one option remains
- Deliberate mode only: pre-mortem and expanded test plan

Architect review must run before Critic review. Do not run them in parallel.
Critic must reject weak alternatives, vague risks, untestable acceptance
criteria, missing verification, or missing deliberate-mode sections.

Final output must include an ADR, visible execution launch hints, and a matching
test spec. Without both PRD and test spec, `omagy plan handoff` must fail closed
and execution should not start.
