Prerequisites
No phase prerequisites (starts from Phase 1).
Specification documents should be available in specs/ directory.
Execution
# Legacy migration: rename pre-0.6.10 state file ONLY if new file does not exist
legacy = Read(".rat/state/rtl-spec-to-uarch-state.json") # may not exist
if legacy:
new_exists = Read(".rat/state/rat-p1p3-spec-uarch-state.json") # check new file
if not new_exists:
Bash("mv .rat/state/rtl-spec-to-uarch-state.json .rat/state/rat-p1p3-spec-uarch-state.json")
# Initialize or resume state
state = Read(".rat/state/rat-p1p3-spec-uarch-state.json") # may not exist
if state and state.current_phase > 1:
# Resume: skip completed phases
pass
else:
# Fresh start
Write(".rat/state/rat-p1p3-spec-uarch-state.json",
{ "schema_version": "3.0", "current_phase": 1, "pipeline_scope": "phase-1-to-3",
"execution_mode": "team",
"phases": {
"1": { "status": "pending" },
"2": { "status": "pending" },
"3": { "status": "pending" }
}
})
# ── Phase 1: Research (team) ──────────────────────────────────
if phases["1"]["status"] != "completed":
Skill(skill="rtl-agent-team:rtl-p1-research-team", args="$ARGUMENTS")
# Phase 1→2 artifact gate (iron-requirements is the settled SSOT;
# open-requirements is optional — absent if Phase 1 had no deferred research)
Glob("docs/phase-1-research/iron-requirements.json")
Glob("docs/phase-1-research/io_definition.json")
Glob("docs/phase-1-research/timing_constraints.json")
Glob("docs/phase-1-research/domain-analysis.md")
# All four required artifacts must exist. If missing: FAIL.
# Update state
# phases["1"]["status"] = "completed"
# ── Phase 2: Architecture + RefC (team) ───────────────────────
if phases["2"]["status"] != "completed":
Skill(skill="rtl-agent-team:rtl-p2-arch-team", args="Phase 1 artifacts complete")
# Phase 2→3 artifact gate
Glob("docs/phase-2-architecture/architecture.md")
Glob("refc/**/*.c")
# Must exist. If missing: FAIL.
# Update state
# phases["2"]["status"] = "completed"
# ── Phase 3: uArch + BFM (team) ──────────────────────────────
if phases["3"]["status"] != "completed":
Skill(skill="rtl-agent-team:rtl-p3-uarch-team", args="Phase 2 artifacts complete")
# Phase 3 artifact gate
Glob("docs/phase-3-uarch/*.md")
Glob("bfm/")
# Must exist. If missing: FAIL.
# Update state
# phases["3"]["status"] = "completed"
# ── Completion ────────────────────────────────────────────────
# Report: Phase 1-3 artifacts, reviews, ADR count
# Suggest: "Run /rtl-agent-team:rat-p4p5-impl-verify to begin RTL implementation"
# Do NOT proceed to Phase 4
Each phase's team skill handles its own TeamCreate/TeamDelete lifecycle. This skill sequences phases and enforces inter-phase quality gates.