Help us improve
Share bugs, ideas, or general feedback.
From rtl-agent-team
Policy rules, phase gate definitions, quality criteria, feedback loop classification, and checklists for the RTL autopilot 6-phase pipeline. Useful as a reference for hardware design automation.
npx claudepluginhub babyworm/rtl-agent-team --plugin rtl-agent-teamHow this skill is triggered — by the user, by Claude, or both
Slash command
/rtl-agent-team:rat-auto-design-policyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Lower phases MUST NOT violate upper phase specifications:
Internal routing reference for the RTL design pipeline. Maps natural language tasks to Action Skills and defines the agent delegation matrix for HDL/FPGA/ASIC workflows.
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
Lower phases MUST NOT violate upper phase specifications: Spec → Architecture → μArch → RTL → Verification Each phase strictly adheres to decisions made in all preceding phases. Deletion, reduction, or modification of features for convenience is FORBIDDEN. If a change is needed, control returns to the upper phase for approval.
Higher abstraction levels demand MORE iterative refinement because their quality cascades to ALL downstream phases. A defect at the architecture level costs orders of magnitude more to fix at RTL than if caught during architecture review.
Graduated iteration by abstraction level: Phase 1 (Research): 3 mandatory rounds (chief-coordinated) Phase 2 (Architecture): 3 mandatory rounds — memory, performance, ref model consistency Phase 3 (μArch): 3 mandatory rounds — performance, interface, memory optimization Phase 4 (RTL): Wave-based lint+sim (implementation-level) Phase 5 (Verify): Sub-phase parallel (terminal verification)
Iteration count can be increased beyond 3 if convergence is not achieved. Principle: refine thoroughly at the top, execute efficiently at the bottom.
Design artifacts (docs/, reviews/) serve as persistent memory across phases and agents. Each phase reads upstream documents as input context and writes downstream documents as output. No agent needs to "remember" another agent's output — it reads the document.
Document flow: iron-requirements.json + open-requirements.json → arch-designer reads → architecture.md → uarch-designer reads → docs/phase-3-uarch/*.md → rtl-coder reads reviews/phase-N/ → Quality Gate reads → next phase proceeds or fails
State is persisted at .rat/state/rat-auto-design-state.json for resumability.
Every phase transition requires BOTH:
Quality Gate verdicts: PASS or FAIL + findings[]
Every active gate uses a per-gate retry budget N (retry_limit in state):
1..N with normal strategyN+1..2N with immediate strategy switch
2Nneeds_user_decision=true and stop for user directionState contract for hook enforcement lives in:
orchestration_control.active_gate_* (fast path for hooks)orchestration_control.gates.{gate_id} (per-gate detailed counters)When entering fallback or last-chance stages, orchestrator writes:
orchestration_control.dynamic_prompt_text (plain text, single-shot guidance)orchestration_control.dynamic_prompt metadata (source, strategy_tag, used)Fallback templates are available in:
${CLAUDE_PLUGIN_ROOT}/skills/rat-auto-design/templates/escalation-prompts.json (plugin runtime)skills/rat-auto-design/templates/escalation-prompts.json (development repo context)Use templates only when LLM-generated prompt text is unavailable.
If both paths are unreadable, orchestrator MUST use built-in defaults and still write
the chosen text into orchestration_control.dynamic_prompt_text with
orchestration_control.dynamic_prompt.source = "builtin".
Before each phase, verify required upstream files exist:
Agents entering a phase MUST load required files first, then summaries. Specific file lists are defined inline in each orchestrator's phase steps.
During iterative review rounds, reviewers write findings to:
.rat/scratch/phase-{N}/round-{R}-{agent}.md
Coordinator reads all round files to aggregate:
.rat/scratch/phase-{N}/round-{R}-feedback.md
On phase gate PASS: consolidated review saved to reviews/phase-{N}-*/, scratch cleaned.
On phase gate FAIL + retry: scratch files preserved for next round.
Artifact Gate: iron-requirements.json + io_definition.json + timing_constraints.json + domain-analysis.md exist (open-requirements.json optional — absent if P1 had no open items) Quality Gate:
reviews/phase-1-research/research-review.mdreviews/phase-1-research/research-review-r1.md, r2.md, r3.md (mandatory)Summary Validation: docs/phase-1-research/phase-1-summary.md must exist (format: max 1 page with tables for Key Decisions, Module Inventory, Interface Summary, Quality Gate Results, Open Items, Document References)
Artifact Gate: architecture.md (with D2 block diagram) + iron-requirements.json (P2, REQ-A-) + refc//*.c exist Quality Gate:
reviews/phase-2-architecture/feature-coverage.mdreviews/phase-2-architecture/architecture-review-r1.md, r2.md, r3.md (mandatory)reviews/phase-2-architecture/architecture-review.mdPhase 2 Iterative Review (3-round mandatory, coordinated by rtl-architect):
Summary Validation: docs/phase-2-architecture/phase-2-summary.md
ADR Recording: 3-5 key decisions → docs/decisions/ADR-{NNN}.md
Artifact Gate: docs/phase-3-uarch/.md + iron-requirements.json (P3, REQ-U-) + bfm/ directory exist Quality Gate:
reviews/phase-3-uarch/feature-preservation.mdreviews/phase-3-uarch/uarch-review-r1.md, r2.md, r3.md (mandatory)reviews/phase-3-uarch/uarch-review.mdPhase 3 Iterative Review (3-round mandatory, coordinated by rtl-architect):
Summary Validation: docs/phase-3-uarch/phase-3-summary.md
ADR Recording: 3-5 key decisions → docs/decisions/ADR-{NNN}.md
Artifact Gate:
Quality Gate:
reviews/phase-4-rtl/functional-completeness.md, reviews/phase-4-rtl/design-review.mdreviews/phase-4-rtl/lint-report.mdSummary Validation: docs/phase-4-rtl/phase-4-summary.md
Artifact Gate: All verification sub-phases (5a-5e) pass Quality Gate:
reviews/phase-5-verify/requirement-traceability.mdreviews/phase-5-verify/final-compliance.mdreviews/phase-5-verify/e2e-traceability.mdSummary Validation: docs/phase-5-verify/phase-5-summary.md
Artifact Gate: reviews/phase-5-verify/final-compliance.md exists AND verdict=PASS
All 4 deliverables exist AND pass quality checks:
reviews/phase-6-review/code-review.md — verdict PASSreviews/phase-6-review/design-review.md — verdict PASSreviews/phase-6-review/design-note.md — complete documentreviews/phase-6-review/improvements.md — recommendations produced
On FAIL: iterate review → fix cycle (max 2 rounds)Stream B artifacts are generated concurrently with Stream A (RTL implementation):
docs/phase-4-rtl/stream-b-sva-skeletons.mddocs/phase-4-rtl/stream-b-cdc-preliminary.mddocs/phase-4-rtl/stream-b-tb-skeletons.mdTraceability Convention:
// Source: docs/phase-3-uarch/{module}.md, Section: {section}# REQ-{NNN}: {description}Content Quality Gate (prevents empty-skeleton artifacts from passing):
property or assert keyword per referenced moduledocs/phase-3-uarch/clock-domain-map.mdREQ- tag per module and contain at least one test function/taskMerge Point: Stream A (lint-clean + unit PASS) + Stream B artifacts ready (content quality verified) → Phase 4→5 Gate.
| Type | Scope | Handling | Re-verify |
|---|---|---|---|
| UNIT_FIX | Single module (SVA fail, assertion error) | rtl-p4s-bugfix (parallel across modules) | Only failed sub-phases |
| INTEGRATION_FIX | Cross-module interface | rtl-p4s-bugfix (sequential) | 5b + 5c |
| DESIGN_FIX | Architecture-level | IMMEDIATE STOP → user approval | All (5a-5e) after upper phase fix |
Batch UNIT_FIX across sub-phases:
Max 2 feedback loops per sub-phase. After loop 2 fails → escalate to user.
| Fix Type | Re-run Sub-phases | Condition |
|---|---|---|
| UNIT_FIX (SVA fail) | 5a only (formal) | SVA property affected |
| UNIT_FIX (sim fail) | 5c only (integration) | Testbench affected |
| INTEGRATION_FIX | 5b + 5c (CDC + integration) | Interface modified |
| DESIGN_FIX | All (5a-5e) after upper phase approval | Architecture changed |
{
"loop_count": 1,
"max_loops": 2,
"failures": [{
"sub_phase": "5a",
"type": "UNIT_FIX",
"module": "example_module",
"description": "SVA counterexample at cycle 42",
"fix_applied": "Added pipeline register",
"re_run_phases": ["5a"]
}],
"status": "in_progress"
}
After each successful feedback fix:
docs/lessons-learned.md with format: LL-{NNN} with sections: Symptom, Root Cause, Fix Applied, Prevention, Related (REQ IDs, module, fix commit, ADR, Phase 5 Sub-phase)needs_user_decision=true, stop and ask user before any further retryAll phases must enforce:
i_, o_, io_ (NOT suffix). Clock/reset exemptclk (single) or {domain}_clk (multiple). Reset: rst_n or {domain}_rst_nsnake_case or ALL_CAPS onlyALL_CAPS, localparam L_ prefixlogic only (no reg/wire), always_ff/always_comb, ANSI port styleu_, generate prefix: gen_