Prerequisites
Phase 3 completion required:
- At least one μArch spec in
docs/phase-3-uarch/ must exist
If prerequisite is missing: WARNING — recommend running /rtl-agent-team:rtl-p3-uarch-design.
Proceed with available artifacts — orchestrator will adapt scope.
Execution
# Step 1: Team creation (main session = leader)
TeamCreate(team_name="p4-implement", description="Phase 4 RTL implementation: 10-wave parallel module coding")
# Step 2: Write team-config.json for hook consumption
Write(".rat/state/team-config.json", json.dumps({
"team_mode": true,
"team_name": "p4-implement",
"leader_session_id": "<current_session_id>",
"coordinator_name": "coordinator",
"worker_count": 4,
"phase": "p4",
"created_at": "<ISO_TIMESTAMP>"
}))
# Step 3: Prepare directories
Bash("mkdir -p reviews/phase-4-rtl docs/phase-4-rtl .rat/scratch/phase-4")
# Step 4: No initial tasks from skill — coordinator creates per-module W1-W10 after reading uarch specs
# Step 5: Spawn coordinator as teammate (orchestrator)
Agent(team_name="p4-implement", subagent_type="rtl-agent-team:p4-implement-team-orchestrator",
name="coordinator", description="P4 implementation coordination",
prompt="You are the Phase 4 RTL implementation coordinator in team 'p4-implement'. "
"Manage the 10-wave task graph using TaskCreate/TaskList/TaskUpdate. "
"Direct workers via SendMessage. "
"Create per-module 10-wave task graph after reading uarch specs. "
"Signal leader ONLY after the Phase 4 Gate (Step 4 — all required checks "
"and artifacts, not merely the W10 integration gate) passes, including the "
"mandatory Codex cross-review. User input: $ARGUMENTS")
# Step 6: Spawn workers as teammates (4 general-purpose)
Agent(team_name="p4-implement", subagent_type="rtl-agent-team:rtl-coder",
name="coder-0", description="P4 RTL coding and lint",
prompt="You are a Phase 4 coding worker in team 'p4-implement'. "
"Coordinator: 'coordinator' (send results via SendMessage). "
"Phase artifacts: rtl/{module}/{module}.sv, reviews/phase-4-rtl/. "
"Specialty: RTL module implementation (W1), lint (W2), lint fix (W3). "
"For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "
"Examples: lint-checker for lint, eda-runner for simulation. "
"Follow the Team Worker Protocol section of your agent definition. "
"Naming: i_/o_ prefixes, snake_case, clk/{domain}_clk, rst_n/{domain}_rst_n.")
Agent(team_name="p4-implement", subagent_type="rtl-agent-team:rtl-coder",
name="coder-1", description="P4 RTL coding and lint",
prompt="You are a Phase 4 coding worker in team 'p4-implement'. "
"Coordinator: 'coordinator' (send results via SendMessage). "
"Phase artifacts: rtl/{module}/{module}.sv, reviews/phase-4-rtl/. "
"Specialty: RTL module implementation (W1), lint (W2), lint fix (W3). "
"For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "
"Follow the Team Worker Protocol section of your agent definition. "
"Naming: i_/o_ prefixes, snake_case, clk/{domain}_clk, rst_n/{domain}_rst_n.")
Agent(team_name="p4-implement", subagent_type="rtl-agent-team:testbench-dev",
name="verify-worker", description="P4 unit test and verification",
prompt="You are a Phase 4 verification worker in team 'p4-implement'. "
"Coordinator: 'coordinator' (send results via SendMessage). "
"Phase artifacts: sim/{module}/, reviews/phase-4-rtl/. "
"Specialty: unit test (W6), CDC analysis (W7), protocol check (W8). "
"For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "
"Examples: eda-runner for sim, cdc-checker for CDC, protocol-checker for W8. "
"Follow the Team Worker Protocol section of your agent definition.")
Agent(team_name="p4-implement", subagent_type="rtl-agent-team:rtl-critic",
name="review-worker", description="P4 code review and refactor",
prompt="You are a Phase 4 review worker in team 'p4-implement'. "
"Coordinator: 'coordinator' (send results via SendMessage). "
"Phase artifacts: reviews/phase-4-rtl/. "
"Specialty: code review (W4), bugfix (W5), refactor (W9), integration (W10). "
"For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "
"Follow the Team Worker Protocol section of your agent definition.")
# Step 7: Leader wait — teardown is gated on the COORDINATOR SIGNAL, not on TaskList.
# "All tasks completed" is necessary but NOT sufficient: the coordinator's post-gate
# work (compliance check, ADR generation, phase summary, Codex cross-review) runs via
# direct Task() calls that never appear in the shared task graph.
while True:
if coordinator_signaled_phase_complete:
# SendMessage from 'coordinator' — sent only after the phase gate
# AND all post-gate mandatory steps pass (see coordinator prompt above)
break
tasks = TaskList()
if all(t.status == "completed" for t in tasks):
# Task graph drained but no coordinator signal yet → the coordinator is
# still running gate/post-gate steps. KEEP WAITING — do NOT TeamDelete.
pass
# Continue polling
# Step 8: Cleanup
TeamDelete()
Bash("rm -f .rat/state/team-config.json")
Bash("rm -rf .rat/scratch/phase-4/")
Compliance Notes
- After each implementation wave completes (lint + unit test), invoke compliance-checker against P1+P2+P3 iron requirements
- RTL implementation must comply with all upstream iron requirements
- Per-wave compliance ensures regressions are caught before the integration gate (W10)
1---2name: rtl-p4-implement-team3description: Phase 4 RTL implementation with native team parallel workers for multi-module coding. Triggers: 'implement team', 'Phase 4 team', 'parallel implement'.4---56<Purpose>7Execute Phase 4 RTL implementation pipeline using Claude Code native team infrastructure.8The skill (main session) handles team lifecycle: TeamCreate, coordinator + worker9spawning, task monitoring, and cleanup. The coordinator teammate manages the 10-wave10task graph and directs workers via SendMessage.11</Purpose>1213<Use_When>14- Phase 3 μArch specs are complete and RTL coding is needed15- User says "implement team", "Phase 4 team", "parallel implement"16- Have 3+ modules that benefit from concurrent RTL coding workers17- Need maximum parallelism for multi-module RTL implementation18</Use_When>1920<Do_Not_Use_When>21- Phase 3 μArch specs are not complete (run rtl-p3-uarch-design first)22- Single module only (use rtl-p4-implement for simpler flow)23- Only need a single module bug fix (use rtl-p4s-bugfix)24- Need RTL + verification together from uarch (use rat-p4p5-impl-verify)25</Do_Not_Use_When>2627## Prerequisites2829Phase 3 completion required:30- At least one μArch spec in `docs/phase-3-uarch/` must exist3132If prerequisite is missing: WARNING — recommend running `/rtl-agent-team:rtl-p3-uarch-design`.33Proceed with available artifacts — orchestrator will adapt scope.3435## Execution3637```python38# Step 1: Team creation (main session = leader)39TeamCreate(team_name="p4-implement", description="Phase 4 RTL implementation: 10-wave parallel module coding")4041# Step 2: Write team-config.json for hook consumption42Write(".rat/state/team-config.json", json.dumps({43 "team_mode": true,44 "team_name": "p4-implement",45 "leader_session_id": "<current_session_id>",46 "coordinator_name": "coordinator",47 "worker_count": 4,48 "phase": "p4",49 "created_at": "<ISO_TIMESTAMP>"50}))5152# Step 3: Prepare directories53Bash("mkdir -p reviews/phase-4-rtl docs/phase-4-rtl .rat/scratch/phase-4")5455# Step 4: No initial tasks from skill — coordinator creates per-module W1-W10 after reading uarch specs5657# Step 5: Spawn coordinator as teammate (orchestrator)58Agent(team_name="p4-implement", subagent_type="rtl-agent-team:p4-implement-team-orchestrator",59 name="coordinator", description="P4 implementation coordination",60 prompt="You are the Phase 4 RTL implementation coordinator in team 'p4-implement'. "61 "Manage the 10-wave task graph using TaskCreate/TaskList/TaskUpdate. "62 "Direct workers via SendMessage. "63 "Create per-module 10-wave task graph after reading uarch specs. "64 "Signal leader ONLY after the Phase 4 Gate (Step 4 — all required checks "65 "and artifacts, not merely the W10 integration gate) passes, including the "66 "mandatory Codex cross-review. User input: $ARGUMENTS")6768# Step 6: Spawn workers as teammates (4 general-purpose)69Agent(team_name="p4-implement", subagent_type="rtl-agent-team:rtl-coder",70 name="coder-0", description="P4 RTL coding and lint",71 prompt="You are a Phase 4 coding worker in team 'p4-implement'. "72 "Coordinator: 'coordinator' (send results via SendMessage). "73 "Phase artifacts: rtl/{module}/{module}.sv, reviews/phase-4-rtl/. "74 "Specialty: RTL module implementation (W1), lint (W2), lint fix (W3). "75 "For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "76 "Examples: lint-checker for lint, eda-runner for simulation. "77 "Follow the Team Worker Protocol section of your agent definition. "78 "Naming: i_/o_ prefixes, snake_case, clk/{domain}_clk, rst_n/{domain}_rst_n.")79Agent(team_name="p4-implement", subagent_type="rtl-agent-team:rtl-coder",80 name="coder-1", description="P4 RTL coding and lint",81 prompt="You are a Phase 4 coding worker in team 'p4-implement'. "82 "Coordinator: 'coordinator' (send results via SendMessage). "83 "Phase artifacts: rtl/{module}/{module}.sv, reviews/phase-4-rtl/. "84 "Specialty: RTL module implementation (W1), lint (W2), lint fix (W3). "85 "For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "86 "Follow the Team Worker Protocol section of your agent definition. "87 "Naming: i_/o_ prefixes, snake_case, clk/{domain}_clk, rst_n/{domain}_rst_n.")88Agent(team_name="p4-implement", subagent_type="rtl-agent-team:testbench-dev",89 name="verify-worker", description="P4 unit test and verification",90 prompt="You are a Phase 4 verification worker in team 'p4-implement'. "91 "Coordinator: 'coordinator' (send results via SendMessage). "92 "Phase artifacts: sim/{module}/, reviews/phase-4-rtl/. "93 "Specialty: unit test (W6), CDC analysis (W7), protocol check (W8). "94 "For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "95 "Examples: eda-runner for sim, cdc-checker for CDC, protocol-checker for W8. "96 "Follow the Team Worker Protocol section of your agent definition.")97Agent(team_name="p4-implement", subagent_type="rtl-agent-team:rtl-critic",98 name="review-worker", description="P4 code review and refactor",99 prompt="You are a Phase 4 review worker in team 'p4-implement'. "100 "Coordinator: 'coordinator' (send results via SendMessage). "101 "Phase artifacts: reviews/phase-4-rtl/. "102 "Specialty: code review (W4), bugfix (W5), refactor (W9), integration (W10). "103 "For specialist work, spawn: Task(subagent_type='rtl-agent-team:<specialist>', prompt='...'). "104 "Follow the Team Worker Protocol section of your agent definition.")105106# Step 7: Leader wait — teardown is gated on the COORDINATOR SIGNAL, not on TaskList.107# "All tasks completed" is necessary but NOT sufficient: the coordinator's post-gate108# work (compliance check, ADR generation, phase summary, Codex cross-review) runs via109# direct Task() calls that never appear in the shared task graph.110while True:111 if coordinator_signaled_phase_complete:112 # SendMessage from 'coordinator' — sent only after the phase gate113 # AND all post-gate mandatory steps pass (see coordinator prompt above)114 break115 tasks = TaskList()116 if all(t.status == "completed" for t in tasks):117 # Task graph drained but no coordinator signal yet → the coordinator is118 # still running gate/post-gate steps. KEEP WAITING — do NOT TeamDelete.119 pass120 # Continue polling121122# Step 8: Cleanup123TeamDelete()124Bash("rm -f .rat/state/team-config.json")125Bash("rm -rf .rat/scratch/phase-4/")126```127128## Compliance Notes129130- After each implementation wave completes (lint + unit test), invoke compliance-checker against P1+P2+P3 iron requirements131- RTL implementation must comply with all upstream iron requirements132- Per-wave compliance ensures regressions are caught before the integration gate (W10)