AGENT SKILL

refactor-equivalence

暂无简介

使用场景代码审查
License 许可
MIT
最近更新
2026-11-02
Stars
★ 0
Forks
0

03 SKILL.md 正文

Refactor-Equivalence (CrossHair diffbehavior + Hypothesis fallback)

An agent asserting "this refactor is behavior-preserving" is the weakest kind of verifier — it is grading its own work. This skill replaces the assertion with an external, symbolic proof: CrossHair's diffbehavior drives Z3 to hunt for a concrete input where the old and new implementations diverge. Find one → the "pure refactor" is a silent behavior change; find none across all explored paths → high confidence the refactor is sound.

This is the differential (two-function) counterpart to the cosmetic-patch tripwire (which proves a change cannot alter behavior at the bytecode level). Use this when the code genuinely changed but is claimed semantically identical.

Evidence: MASTER decision-queue A-Tier2 (CrossHair diffbehavior), agentic-repair-2 #5, general 4f — REC: ADOPT, verified.

When to run

  • A diff is described as a pure / deterministic refactor: "same output", "no functional change", "just cleaner", extract/inline, rewrite a pure helper, simplify a branch.
  • During VALIDATE for a work-unit whose acceptance is "behavior unchanged".
  • Before trusting an agent-authored refactor of a pure function (arithmetic, string/collection transforms, parsers, clamps, comparators, encoders).

Scope guard (READ FIRST — false results otherwise)

diffbehavior only reasons about pure, deterministic functions. It will give misleading or unstable answers if the function:

  • does I/O, touches the filesystem/network, or logs;

Protocol

1. Make old and new both importable

2. Run the symbolic diff (primary rail)

in a Python 3.12 venv with: pip install crosshair-tool

tuning knobs when needed:

--per_condition_timeout=<sec> cap Z3 time per path (raise for hard fns)

--per_path_timeout=<sec>

3. Hypothesis differential fallback (when CrossHair can't)

4. Report (advisory / shadow — never blocks)

Why symbolic beats "I re-read it and it looks the same"

Verified (this machine)

04 同仓库更多 Skills

Prekzursil
Prekzursil/agent-skills-toolchain

clarify-requirements

Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

openmm-md

Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein / protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.

Skill与智能体开发
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

visual-review

Take screenshots of web pages and UI using Playwright for visual review and iteration

演示文稿测试与质量
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

status

Diagnostic status report — shows metaswarm installation state, project setup, and potential issues

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

start

Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work

Skill与智能体开发
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

setup

Interactive project setup — detects your project, configures metaswarm, writes project-local files

★ 0