babyworm/rtl-agent-team/rat-ultraloop-ppa
Claude Code and agent skill by babyworm/rtl-agent-team
- community
Checking that the SKILL.md file is still in the repository.
Auto-loop wrapper repeating rtl-ppa-optimize-dc until PPA convergence or plateau. Triggers: 'ultraloop PPA', 'PPA auto-loop', 'optimize PPA until converge'.
Install
npx vskill@latest install babyworm/rtl-agent-team/rat-ultraloop-ppaSKILL.md
<Purpose> Drive the DC-based PPA optimization loop to convergence. Wraps rtl-ppa-optimize-dc in an auto-repeat loop with three termination tiers: early plateau, normal convergence, max cycles. On normal convergence, runs full Phase 5 regression and writes rtl-verify-done + ppa-opt-done. </Purpose>
<Use_When>
- User says "ultraloop PPA", "PPA auto-loop", "optimize PPA until converge"
- Verified RTL ready for PPA refinement
- Industrial flow with dc_shell/genus available
</Use_When>
<Do_Not_Use_When>
- Preconditions of rtl-ppa-optimize-dc are not met
- User wants a single iteration only (use rtl-ppa-optimize-dc)
- Design is still under architectural change (freeze first)
</Do_Not_Use_When>
Invocation
Loop Body
Loop Protocol (the LLM executes these steps iteratively)
For each cycle in 1..max_cycles:
- Invoke action skill — call
/rtl-agent-team:rtl-ppa-optimize-dc <TOP>.
This runs exactly one PPA iteration via the orchestrator, which writes docs/ppa-opt/iter-{cycle}/verdict.txt on completion.
1a. Refresh auto-continue timestamp — update last_cycle_timestamp in .rat/state/ppa-loop-state.json to the current epoch seconds BEFORE invoking rtl-ppa-optimize-dc. This ensures the 30-minute stop-gate.sh window restarts each cycle, not only at loop start. ```python import json, time, pathlib, os, tempfile, fcntl
STATE_PATH = pathlib.Path(".rat/state/ppa-loop-state.json") LOCK_PATH = str(STATE_PATH) + ".lock"
with open(LOCK_PATH, "a") as lock_f: # long-lived lock file; never replaced fcntl.flock(lock_f.fileno(), fcntl.LOCK_EX) try: s = json.loads(STATE_PATH.read_text()) s["last_cycle_timestamp"] = int(time.time()) dir_ = STATE_PATH.parent fd, tmp = tempfile.mkstemp(prefix=".ppa-state-", dir=str(dir_)) try: with os.fdopen(fd, "w") as tmp_f: json.dump(s, tmp_f, indent=2) os.replace(tmp, str(STATE_PATH)) # atomic swap except BaseException: try: os.unlink(tmp) except OSError: pass raise finally: fcntl.flock(lock_f.fileno(), fcntl.LOCK_UN) `` Uses the same atomic lock-file + os.replace() pattern as compute_delta.py: a .lock file is held via fcntl.flock during the read-modify-write cycle, and the updated state is written to a temp file then atomically renamed onto the canonical path. This prevents stop-gate.sh` from observing a truncated state file between steps.
- Read verdict — read
docs/ppa-opt/iter-{cycle}/verdict.txt. Expected
values: CONTINUE, CONVERGED_STREAK, CONVERGED_TARGETS, EARLY_PLATEAU, MAX_CYCLES, TIMING_REGRESSION. If verdict.txt is ABSENT, the orchestrator hard-halted on an equivalence or smoke-regression FAIL before writing a verdict — handle via the "Missing verdict.txt" branch in step 3.
- Dispatch by verdict:
- `CONVERGED_STREAK` or `CONVERGED_TARGETS`:
- Invoke
/rtl-agent-team:rtl-p5-verifyfor a full final regression
confirmation. Pass the run intent as the free-text argument, e.g. final regression (source: ppa-opt) — rtl-p5-verify forwards its argument to the P5 orchestrator verbatim (it does NOT parse --mode/--source flags).
- Write
.rat/state/rtl-verify-donewithppa-opt-converge cycle {cycle}\n. - Write
.rat/state/ppa-opt-donewithconverge cycle {cycle}\n(triggers
P6 cascade re-review if the design-note was written prior).
- Generate
docs/ppa-opt/final-report.md(see template below). - Remove
.rat/state/ppa-loop-state.json. - Exit the loop.
- `EARLY_PLATEAU`:
- Generate
reviews/ppa-opt/early-plateau-escalation.md. - Remove
.rat/state/ppa-loop-state.json. - Exit the loop.
- `MAX_CYCLES`:
- Generate
docs/ppa-opt/final-report.mdwith exit_reasonMAX_CYCLES
(best-so-far iteration recorded).
- Remove
.rat/state/ppa-loop-state.json. - Exit the loop.
- `TIMING_REGRESSION`:
- Orchestrator already rolled back the patch via
git checkout -- rtl/<top>,
wrote TIMING_REGRESSION to verdict.txt, and removed .rat/state/ppa-loop-state.json (its Rollback Cleanup Protocol).
- Generate
reviews/ppa-opt/timing-regression-escalation.md. - Remove
.rat/state/ppa-loop-state.json(idempotent — orchestrator
already removed it).
- Exit the loop.
- Missing `verdict.txt` (orchestrator hard-halted on an equivalence or
smoke-regression FAIL — see reviews/ppa-opt/{equiv,smoke}-fail-iter-{cycle}.md):
- The orchestrator already rolled back the patch and removed
.rat/state/ppa-loop-state.json (Rollback Cleanup Protocol); the one-shot skill's terminal cleanup does the same.
- Generate
reviews/ppa-opt/rollback-halt-escalation.mdsummarizing the
failing check and the rolled-back iteration.
- Ensure the state file is gone:
rm -f .rat/state/ppa-loop-state.json. - Exit the loop (this is a terminal failure — do NOT continue).
- `CONTINUE`:
- Proceed to the next cycle (increment cycle counter, re-enter step 1).
- Safety net — if the loop falls through
max_cycleswithout a terminal
verdict (should not happen), generate final-report with exit_reason LOOP_EXIT_UNEXPECTED and remove the state file.
Note: The per-cycle refresh oflast_cycle_timestamp(step 1a) iscritical:stop-gate.shuses it to decide whether the 30-min auto-continuewindow is still active. Without it, long DC iterations would be interrupted30 minutes after loop start even when the loop is making progress.
Final Report (docs/ppa-opt/final-report.md)
30-Min Auto-Continue
Reuses the stop-gate.sh escalation pattern: when .rat/state/ppa-loop-state.json is present with mode == "ppa-loop" and last_cycle_timestamp + auto_continue_minutes*60 > now, the hook auto-continues instead of stopping.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/rat-ultraloop-ppa/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/babyworm/rtl-agent-team/rat-ultraloop-ppa)