Agent skill

Semantic Equivalence Verifier

by ArabelaTso in ArabelaTso/Skills-4-SE

Analyzes and verifies semantic equivalence between two functions, classes, or modules by examining control flow, data flow, and observable behavior.

Apache-2.0Auto-check passed

Install Semantic Equivalence Verifier

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill semantic-equivalence-verifier -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE semantic-equivalence-verifier --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/semantic-equivalence-verifier .claude/skills/semantic-equivalence-verifier && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
semantic-equivalence-verifier
GitHub stars
253
Token cost
~1.5k tokens
SKILL.md length
537 words
Files
5 (incl. references, assets)
Skills in repo
170
Repo updated
First seen
Licence
Apache-2.0

At a glance

Analyzes and verifies semantic equivalence between two functions, classes, or modules by examining control flow, data flow, and observable behavior.

  • Works in 5 steps: Input Specification → Static Analysis → Behavioral Analysis → …
  • Comparing code implementations (refactored vs original
  • SKILL.md covers Overview, Verification Workflow, Analysis Techniques by Language and Common Equivalence Patterns, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Semantic Equivalence Verifier is an agent skill from ArabelaTso/Skills-4-SE. Analyzes and verifies semantic equivalence between two functions, classes, or modules by examining control flow, data flow, and observable behavior. Use when comparing code implementations (refactored vs original, different implementations of same functionality, migration verification), determining if two code artifacts produce identical behavior, identifying behavioral differences between code versions, or validating that code changes preserve semantics. Supports formal reasoning and symbolic execution approaches.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files and assets (for example `assets/equivalence_report_template.md`, `references/formal_verification.md` and `references/language_patterns.md`).

The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Comparing code implementations (refactored vs original
  • Different implementations of same functionality
  • Migration verification)
  • Determining if two code artifacts produce identical behavior

Example prompts

  • “Use the semantic-equivalence-verifier skill to analyz and verifies semantic equivalence between two functions, classes, or modules by examining…”
  • “/semantic-equivalence-verifier”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Input Specification
  2. Static Analysis
  3. Behavioral Analysis
  4. Advanced Verification (Optional)
  5. Report Generation

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and java).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Semantic Equivalence Verifier loads about 1.5k tokens when it runs, and up to ~6.7k if it reads all its reference files. Until then it costs about 138 tokens; SKILL.md has 537 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~138
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 537 words, ~1,527 tokens.

Download SKILL.mdSave it as .claude/skills/semantic-equivalence-verifier/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
semantic-equivalence-verifier
description
Analyzes and verifies semantic equivalence between two functions, classes, or modules by examining control flow, data flow, and observable behavior. Use when comparing code implementations (refactored vs original, different implementations of same functionality, migration verification), determining if two code artifacts produce identical behavior, identifying behavioral differences between code versions, or validating that code changes preserve semantics. Supports formal reasoning and symbolic execution approaches.

Semantic Equivalence Verifier

Overview

This skill enables rigorous analysis of semantic equivalence between two code artifacts (functions, classes, or modules). It systematically compares control flow, data flow, and observable behavior to determine if implementations are functionally identical, and provides actionable guidance for achieving equivalence when differences exist.

Verification Workflow

Step 1: Input Specification

Clearly identify the two code artifacts to compare:

Artifact A: [function/class/module name and location]
Artifact B: [function/class/module name and location]

Specify the equivalence scope:

  • Strict equivalence: Identical behavior for all possible inputs
  • Partial equivalence: Identical behavior for a specific input domain
  • Observable equivalence: Identical externally visible behavior (may differ internally)
Step 2: Static Analysis

Perform systematic static analysis on both artifacts:

Control Flow Analysis:

  • Extract control flow graphs (CFG) for both artifacts
  • Identify branching conditions, loops, and exit points
  • Compare CFG structure and reachability
  • Note: Different CFG structures don't necessarily mean non-equivalence

Data Flow Analysis:

  • Trace variable definitions and uses
  • Identify data dependencies
  • Compare computation sequences
  • Check for equivalent transformations (e.g., x*2 vs x+x)

Signature Analysis:

  • Compare function signatures (parameters, return types)
  • Check preconditions and postconditions
  • Verify exception handling behavior
Step 3: Behavioral Analysis

Analyze runtime behavior and observable effects:

Input-Output Mapping:

  • Identify representative test inputs covering edge cases
  • Compare outputs for identical inputs
  • Check boundary conditions and error cases

Side Effects:

  • File I/O operations
  • Network calls
  • Database modifications
  • Global state changes
  • Memory allocations

Performance Characteristics:

  • Time complexity (O-notation)
  • Space complexity
  • Note: Performance differences don't affect semantic equivalence unless specified
Step 4: Advanced Verification (Optional)

For rigorous verification, apply formal methods:

Symbolic Execution:

  • Generate symbolic constraints for both artifacts
  • Use SMT solvers to check constraint equivalence
  • Identify input conditions where behaviors diverge

Formal Proof:

  • Define formal specifications for expected behavior
  • Prove both artifacts satisfy the same specification
  • Use proof assistants (Coq, Isabelle) for complex cases

Equivalence Checking:

  • Apply program equivalence algorithms
  • Use translation validation techniques
  • Leverage existing verification tools (KLEE, SymDiff, SeaHorn)
Show full SKILL.md (234 more words)Show less
Step 5: Report Generation

Generate a comprehensive equivalence report using the template in assets/equivalence_report_template.md:

If Equivalent:

  • State equivalence type (strict/partial/observable)
  • Summarize analysis evidence
  • Note any performance or style differences

If Not Equivalent:

  • Identify specific divergence points
  • Provide concrete input examples demonstrating differences
  • Explain root causes of non-equivalence
  • Suggest modifications to achieve equivalence

Analysis Techniques by Language

Different languages require adapted analysis approaches:

Statically Typed (Java, C++, Rust):

  • Leverage type system for stronger guarantees
  • Use compiler-level analysis tools
  • Check type-level equivalence first

Dynamically Typed (Python, JavaScript):

  • Require more extensive runtime analysis
  • Consider duck typing and dynamic dispatch
  • Test broader input ranges

Functional (Haskell, OCaml):

  • Exploit referential transparency
  • Use equational reasoning
  • Apply denotational semantics

Common Equivalence Patterns

Refactoring Patterns:

  • Extract method: Original function ≡ New function + extracted helper
  • Inline variable: temp=x; return temp ≡ return x
  • Rename: Identifier changes don't affect semantics

Optimization Patterns:

  • Loop unrolling: Semantically equivalent, different performance
  • Constant folding: x*0 ≡ 0
  • Dead code elimination: Removing unreachable code preserves semantics

Algorithm Substitution:

  • Different sorting algorithms with same comparison function
  • Alternative data structures with same interface
  • Mathematical identities: pow(x,2) ≡ x*x

Practical Examples

Example 1: Simple Function Comparison

python
# Artifact A
def sum_squares(n):
    total = 0
    for i in range(1, n+1):
        total += i * i
    return total

# Artifact B
def sum_squares(n):
    return n * (n + 1) * (2*n + 1) // 6

Analysis: Mathematically equivalent for all non-negative integers. Different algorithms, same result.

Example 2: Class Refactoring

java
// Artifact A
class Calculator {
    int add(int a, int b) { return a + b; }
    int multiply(int a, int b) { return a * b; }
}

// Artifact B
class Calculator {
    int add(int a, int b) { return a + b; }
    int multiply(int a, int b) {
        int result = 0;
        for(int i = 0; i < b; i++) result += a;
        return result;
    }
}

Analysis: Not strictly equivalent - Artifact B fails for negative b. Partial equivalence for b >= 0.

References

For detailed guidance on specific analysis techniques:

  • Formal methods: See references/formal_verification.md
  • Symbolic execution: See references/symbolic_execution.md
  • Language-specific patterns: See references/language_patterns.md

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references, assets) in skills/semantic-equivalence-verifier of ArabelaTso/Skills-4-SE.

  • SKILL.md
  • assets/equivalence_report_template.md
  • references/formal_verification.md
  • references/language_patterns.md
  • references/symbolic_execution.md

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Semantic Equivalence Verifier next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Semantic Equivalence Verifier compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Semantic Equivalence Verifier this skillArabelaTso/Skills-4-SE253—~1.5kAutomated safety check: PassApache-2.0
Verifyasgeirtj/system_prompts_leaks69k—~3kAutomated safety check: PassCC0-1.0
Verify Thiscursor/plugins11k2 repos~693Automated safety check: PassNone
Verify Releaseopenclaw/openclaw392k—~2.4kAutomated safety check: PassMIT
Verifycodewhale-hq/Codewhale41k—~156Automated safety check: PassMIT
Verify Before CompletionYeachan-Heo/oh-my-claudecode40k—~277Automated safety check: PassMIT

Similar skills

  • Verify

    asgeirtj/system_prompts_leaks

    Verify that a code change actually does what it's supposed to by exercising it end-to-end and observing behavior — drive the affected flow, not just tests or typecheck.

    69k GitHub stars~3k tokensUpdated today
    Testing & QAAuto-check passed
  • Verify This

    cursor/plugins

    Official

    Verify a claim with fresh local evidence: restate it falsifiably, capture baseline and treatment, compare artifacts, and return VERIFIED, NOT VERIFIED, or INCONCLUSIVE.

    11k GitHub starsUsed in 2 repos~693 tokens
    Auto-check passed
  • Verify Release

    openclaw/openclaw

    Verify regular or extended-stable OpenClaw releases against the exact publication surfaces, workflow identities, package provenance, smoke tests, and live Gateway behavior expected for that release…

    392k GitHub stars~2.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Verify

    codewhale-hq/Codewhale

    Exercise the real app/API/CLI and collect observable evidence; tests alone do not count as end-to-end verification.

    41k GitHub stars~156 tokensUpdated today
    Testing & QAAuto-check passed
  • Verify Before Completion

    Yeachan-Heo/oh-my-claudecode

    Has the agent prove that a feature, fix or refactor works, using existing tests first, then narrow commands and manual checks, and report only what was actually verified.

    40k GitHub stars~277 tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Naming Analyzer

    davila7/claude-code-templates

    Suggest better variable, function, and class names based on context and conventions.

    33k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed

More from ArabelaTso/Skills-4-SE

All 170 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Semantic Equivalence Verifier

What does Semantic Equivalence Verifier do?

Analyzes and verifies semantic equivalence between two functions, classes, or modules by examining control flow, data flow, and observable behavior. Semantic Equivalence Verifier is an agent skill from ArabelaTso/Skills-4-SE. Analyzes and verifies semantic equivalence between two functions, classes, or modules by examining control flow, data flow, and observable behavior.

When should I use Semantic Equivalence Verifier?

Semantic Equivalence Verifier fits situations like: comparing code implementations (refactored vs original; different implementations of same functionality; migration verification); determining if two code artifacts produce identical behavior.

How do I install Semantic Equivalence Verifier in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill semantic-equivalence-verifier -a claude-code`. Or copy the skill folder (skills/semantic-equivalence-verifier in ArabelaTso/Skills-4-SE) into .claude/skills/semantic-equivalence-verifier in your project. Claude Code loads it when a task matches its description.

How do I install Semantic Equivalence Verifier in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill semantic-equivalence-verifier -a codex`. Or copy the skill folder (skills/semantic-equivalence-verifier in ArabelaTso/Skills-4-SE) into .agents/skills/semantic-equivalence-verifier in your project. Codex loads it when a task matches its description.

Can I use Semantic Equivalence Verifier in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill semantic-equivalence-verifier -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/semantic-equivalence-verifier, .gemini/skills/semantic-equivalence-verifier, .github/skills/semantic-equivalence-verifier and .opencode/skills/semantic-equivalence-verifier in your project.

What does Semantic Equivalence Verifier need to run?

SKILL.md names no scripts, command-line tools or credentials: Semantic Equivalence Verifier is instructions for the agent only. Our summary lists: Python 3.

Does Semantic Equivalence Verifier access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Semantic Equivalence Verifier safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Semantic Equivalence Verifier use?

Semantic Equivalence Verifier is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Semantic Equivalence Verifier use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.2k tokens, read only when the agent opens those files.

What are the alternatives to Semantic Equivalence Verifier?

Skills that share tags, products or a category with Semantic Equivalence Verifier: Verify (asgeirtj/system_prompts_leaks, 69k stars), Verify This (cursor/plugins, 11k stars), Verify Release (openclaw/openclaw, 392k stars) and Verify (codewhale-hq/Codewhale, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Semantic Equivalence Verifier?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 170 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.