babyworm/rtl-agent-team/rtl-p4s-refactor-policy

Claude Code and agent skill by babyworm/rtl-agent-team

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Internal reference: rtl p4s refactor policy (agent-loaded; do not invoke).

Install

npx vskill@latest install babyworm/rtl-agent-team/rtl-p4s-refactor-policy

SKILL.md

RTL Refactoring Policy

Refactoring Decision Criteria

  • Module >500 lines: consider splitting
  • 3+ modules share similar code: extract common module
  • Naming inconsistency flagged by rtl-critic: rename pass
  • Missing parameterization: add parameters for magic numbers
  • Refactoring is selective — not all modules need it

Naming Convention Audit Rules

Refactoring plans MUST include naming convention audit:

  • Ports: i_/o_/io_ prefix (NOT suffix _i/_o) — flag violations for correction
  • Clocks: clk (single domain) or {domain}_clk (multiple domains) — flag clk_i, clk_sys
  • Resets: rst_n (single domain) or {domain}_rst_n (multiple domains) — flag rst_ni
  • Instances: u_ prefix — flag missing prefix
  • Generates: gen_ prefix — flag missing prefix
  • logic only — flag any reg/wire usage

Common refactoring patterns:

  • data_i -> i_data, valid_o -> o_valid (suffix to prefix)
  • clk_i -> clk or sys_clk (suffix clock to conformant name)
  • rst_ni -> rst_n or sys_rst_n (suffix reset to conformant name)
  • fifo_inst -> u_fifo (missing instance prefix)
  • reg [7:0] data -> logic [7:0] data (reg to logic)

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

bash
# 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

  • Cosmetic/style-only cleanup: lint + smoke simulation sufficient
  • Any change touching combinational/sequential logic, reset, clock enable, or constraints intent:

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

  • Formal equivalence via SymbiYosys (requires sv2v conversion first):

``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

  • Equivalence check fails → revert to original, report diff to user
  • Refactoring plan conflicts with uarch spec → pause, flag to user
  • For large module splits, update all instantiation sites in the same task to maintain consistency

Final Checklist

  • [ ] All changed files pass lint (verilator --lint-only -Wall + slang --lint-only)
  • [ ] Equivalence verified (formal or smoke sim)
  • [ ] No instantiation sites broken
  • [ ] Refactoring plan followed exactly
  • [ ] All port names use i_/o_/io_ prefix (NOT suffix _i/_o)
  • [ ] All clocks: clk or {domain}_clk — NOT clk_i
  • [ ] All resets: rst_n or {domain}_rst_n — NOT rst_ni
  • [ ] All instances: u_ prefix, generates: gen_ prefix
  • [ ] No reg/wire keywords — logic only

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

Popularity

Repository stars
60
Repository forks
15
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. 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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/babyworm/rtl-agent-team/rtl-p4s-refactor-policy/badge)](https://verified-skill.com/skills/babyworm/rtl-agent-team/rtl-p4s-refactor-policy)

Something wrong with this skill or its page? Tell us.