Rtl p4s refactor policy

From babyworm/rtl-agent-team · View interactive version

Rtl p4s refactor policy is an AI agent skill from the GitHub repository babyworm/rtl-agent-team. Internal reference: rtl p4s refactor policy (agent-loaded; do not invoke).

How to use this skill

Skill file

RTL Refactoring Policy

Refactoring Decision Criteria

Naming Convention Audit Rules

Refactoring plans MUST include naming convention audit:

Common refactoring patterns:

When renaming ports, prefer sv-renamer (https://github.com/babyworm/sv-renamer) when installed:

# Dry-run preview
sv_renamer.py --dir rtl/ --recursive --prefix i_ --dry-run --report json
# Apply + verify equivalence
sv_renamer.py --dir rtl/ --recursive --prefix i_
sv_semantic_diff.py --before original/ --after rtl/  # formal equivalence check

If sv-renamer is not installed, use Grep to find ALL instantiation sites across the codebase

and update them in the same task.

Equivalence Proof Policy

invoke equivalence-checker (RTL-vs-RTL) before completion

```bash

sv2v rtl/{module}/*.sv -o rtl/{module}/{module}_v2v.v

cd formal/ && sby -f {module}.sby # .sby must reference _v2v.v, not .sv

```

Escalation & Stop Conditions

Final Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.