sglang: Skill for Claude Code

.claude/skills/mechanical-refactor-verify/SKILL.md

mechanical-refactor-verify is a skill for Claude Code from sgl-project/sglang. It costs 68 tokens per session (1,387 once invoked), scanned A, original, Apache-2.0.

A guide for verifying mechanical refactors, such as moving functions, splitting files, extracting modules, or renaming code, by checking the exact resulting file changes.

In plain words
What is it for?
Use it to reproduce a relocation from the base commit, format it, compare the bytes with the target, and separate preparation or follow-up changes from the certified move.
Why use it?
It detects unrelated edits hidden inside a supposedly mechanical change and makes the proof repeatable instead of relying on visual review.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

This is sgl-project/sglang's own configuration. It tells Claude Code how to work on sglang itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sglang configures →

About the project

SGLang is a framework for running inference for large language models and multimodal models, meaning it processes inputs to produce model outputs such as text or other media. It is used to serve and accelerate open AI models and related workloads.

sgl-project/sglang · 35,551 stars · on GitHub · sglang.io

Reuse

Borrowing it

Nothing to install: this file belongs to sgl-project/sglang. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sgl-project/sglang/main/.claude/skills/mechanical-refactor-verify/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mechanical-refactor-verify

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/mechanical-refactor-verify.svg)](https://agentmods.dev/skills/sgl-project/sglang/mechanical-refactor-verify)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/mechanical-refactor-verify"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/mechanical-refactor-verify.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,387 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01387
Opus 5 $0.00034 $0.00694
Sonnet 5 $0.00014 $0.00277
Haiku 4.5 $0.00007 $0.00139

Measured 8d ago against content hash 418574f04606, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

mechanical-refactor-verify scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 34 executable files (scripts/mechanical_refactor_proof_generator.py, scripts/mechanical_refactor_reproduction_cli.py, scripts/mechanical_refactor_reproduction_utils.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/mechanical-refactor-verify/SKILL.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mechanical Refactor — Machine-Checkable Verification

1. Overview

  • The correctness of a mechanical change (file split, function move, module extraction, rename) must be machine-checkable, not eyeballed — the proof is something anyone can re-run, whoever made the change and whenever.
  • One property: a commit is a pure relocation. One proof: reproduce — regenerate the move from the base commit with faithful primitives, run the formatter, byte-diff against the target.
  • Empty diff = the proof. Any residual = a bundled non-move change, surfaced for review.
  • A reshape must not ride along: split into optional prepare + certified move + optional postpare (guide-split.md).

2. Commands — what do you want to do?

The skill takes an argument naming one of three commands; invoked without one, pick the row matching your task.

  • split <base>..<tip> — author a compliant refactor branch: split it into commits, satisfy the contract (extract, move, file split) → guide-split.md: §1 splits the PR into classified pieces (the chain contract: classification format, correct labeling, proofs PASS, non-mechanical commits correctness-reviewed); §2 splits one piece into prepare + move + postpare (the case recipes and the anti-patterns). The argument is the chain to author (or a single commit / a description of the change to split).
  • construct <base>..<tip> [--match REGEX] [--out DIR] — construct the proof, for the chain or one commit → guide-construct-proof.md: §1 generates + publishes the whole chain's proof folder (the flags are the generator's: scripts/mechanical_refactor_proof_generator.py <base>..<tip> --match REGEX --out DIR); §2 proves a single commit — pass just <commit> (the generator, or a hand-written Repro when it reports UNSUPPORTED).
  • verify --base <base> --branch <branch> --proof <folder> [--jobs N] [--skip-passed] — verify someone's proof: a whole chain / PR branch → guide-verify-proof.md: run the chain verifier with exactly these flags (scripts/mechanical_refactor_reproduction_cli.py) — it checks every commit declares mechanical_provable or non_mechanical_provable, runs every provable commit's proof (never a sample), and writes one full report; then audit the authored surfaces and the HUMAN_REVIEW rows. Re-running one commit's script is for diagnosis only.
  • Decide whether a change counts as a clean movespec-reproduction-utils.md: the property, the whole whitelist / not-allowed list, and each primitive's contract. The source of truth for the reproduction module; if any other file disagrees, it wins.
  • Change this skill itself (edit the engine, the generator, or the spec) → guide-modify-skill.md: the spec-leads rule, the faithfulness invariant, and the testing bar a change must clear before it is trusted.

Read the full file on GitHub · 83 lines

Files

What ships with it

40 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 83 lines · 68 tokens per session scan A 418574f04606

Subscribe to this mod's changes

mechanical-refactor-verify is a skill published in the GitHub repository sgl-project/sglang (35,551 stars, last pushed today), licensed Apache-2.0. It adds 68 tokens to every session and 1,387 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.