mechanical-refactor-verify

Verify mechanical refactors via transform scripts against target commits.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/annealing-inversion/sglang-kimi-deferral --skill mechanical-refactor-verify-annealing-inversion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mechanical-refactor-verify
Source: https://github.com/annealing-inversion/sglang-kimi-deferral/tree/main/.claude/skills/mechanical-refactor-verify
Command: npx skills add https://github.com/annealing-inversion/sglang-kimi-deferral --skill mechanical-refactor-verify-annealing-inversion

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces auditable verification for mechanical refactors by requiring a reproducible transform script in PR descriptions.

Core Features & Use Cases

  • Enforces a reproducible script-based workflow for file splits, function moves, and module extractions.
  • Provides a standard transform script template and a verification harness that compares against a target commit.
  • Integrates with pre-commit checks and a worktree-based workflow to guard against non-reproducible diffs.

Quick Start

Follow the template to create a reproducible /tmp/transform_<description>.py script and verify it against the target commit.

Frequently Asked Questions about mechanical-refactor-verify

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

FAQPage Schema
How do I verify a mechanical refactor like a file split or module extraction?

Verify a mechanical refactor by applying a reproducible transform script against a local git worktree and comparing the resulting diff against a target commit to ensure a deterministic outcome. This approach enforces an auditable, script-based workflow for structural code changes.

What is a reproducible transform script for mechanical refactoring?

A reproducible transform script is a deterministic file transformation utility, such as a Python script, that systematically executes structural changes like function moves. It guarantees that applying the script to a base commit yields the exact same diff every time, enabling strict pre-commit verification.

How do I use git worktree to test a refactor diff against a target commit?

Use git worktree to create an isolated local checkout, then apply your transform script there to generate a diff. Comparing this diff against the target commit verifies that the mechanical refactor is perfectly reproducible before merging.

Does pre-commit verification work with mechanical refactor transform scripts?

Pre-commit verification integrates directly with mechanical refactor transform scripts by enforcing a strict workflow. It guards against non-reproducible diffs by requiring the script execution and diff comparison to pass before any structural code changes are committed.

Why does my mechanical refactor fail diff verification against the target commit?

Diff verification fails when the mechanical refactor produces non-reproducible changes, meaning the transform script output does not match the target commit. This typically happens if manual edits were introduced instead of relying on the deterministic script.

Can I use this workflow for both file splits and function moves?

Yes, the reproducible script-based workflow handles file splits, function moves, and module extractions. It provides a standard transform template and verification harness to ensure deterministic outcomes across all these mechanical refactor types.