refactor-staff

Automate cleanup of decompiled RB3 code while preserving objdiff match percentage.

4|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/freeqaz/rb3 --skill refactor-staff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-staff
Source: https://github.com/freeqaz/rb3/tree/main/.claude/skills/refactor-staff
Command: npx skills add https://github.com/freeqaz/rb3 --skill refactor-staff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean up decomp code after a first pass. Improve readability and maintainability while preserving exact match percentage.

Core Features & Use Cases

  • Remove unnecessary casts that don't affect codegen and improve clarity.
  • Fix naming & types to align with project style (CamelCase for classes, camelCase for members).
  • Remove dead code such as unused variables and redundant assignments.
  • Adopt engine idioms like MILO_ASSERT and DataNode accessors to match the codebase conventions.
  • DC3 style alignment to ensure consistency with the reference implementation.

Quick Start

Run the refactor-staff cleanup pass on the modified files and verify that the objdiff match percentage is preserved after each change.

Frequently Asked Questions about refactor-staff

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up decompiled code without breaking the exact match percentage?

Decompiled code cleanup involves removing unnecessary casts, fixing naming conventions, eliminating dead code, and adopting engine idioms in a stepwise manner. You verify progress with objdiff after each change to preserve the exact match percentage.

What is the best way to align decompiled RB3 code with DC3 style conventions?

Aligning decompiled RB3 code with DC3 style involves adopting engine idioms like MILO_ASSERT and DataNode accessors, applying CamelCase for classes and camelCase for members, and ensuring consistency with the reference implementation through controlled polish passes.

Can I remove unnecessary casts from decompiled code without affecting codegen?

Yes, you can remove unnecessary casts that do not affect codegen to improve clarity. A controlled refactor pass identifies and strips these casts while using objdiff to verify that the exact match percentage remains preserved.

How does objdiff verification work during decomp code refactoring?

Objdiff verification works by checking the match percentage after each stepwise refactoring change, such as dead code removal or type improvement. This ensures that readability enhancements do not sacrifice the exact binary match.

When do I need to run a decomp code cleanup pass?

You need to run a decomp code cleanup pass after a first-pass decompilation output and during subsequent polish passes. This is required when the code contains redundant assignments, unused variables, or lacks engine idioms.