drift-audit-semantic

Detect semantically duplicated code units across a codebase using AST parsing and structural fingerprinting.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/chris-arsenault/svap --skill drift-audit-semantic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drift-audit-semantic
Source: https://github.com/chris-arsenault/svap/tree/main/.claude/skills/drift-audit-semantic
Command: npx skills add https://github.com/chris-arsenault/svap --skill drift-audit-semantic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill identifies instances where the same functional concept is implemented multiple times across a codebase, even with different names, APIs, or implementations, leading to consolidation opportunities and improved maintainability.

Core Features & Use Cases

  • Semantic Duplication Detection: Finds functionally identical code units that lack structural or naming similarities.
  • Codebase Consolidation: Identifies candidates for shared components or utilities to reduce redundancy.
  • Use Case: Discover that three different components, named ButtonHeader, ToolBar, and GridComponent, all serve the purpose of rendering a horizontal bar of action buttons, suggesting they can be refactored into a single, reusable component.

Quick Start

Analyze the codebase for semantic duplication opportunities by running the semantic drift audit.

Frequently Asked Questions about drift-audit-semantic

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

FAQPage Schema
How do I find semantic code duplication when function names and implementations differ?

Semantic code duplication is detected by analyzing code units for identical functional purposes using AST parsing, structural fingerprinting, and semantic embedding similarity assessment, identifying consolidation opportunities even without naming similarities.

What is the best way to detect reusable components for codebase consolidation?

The best way to detect reusable components for codebase consolidation is auditing UI components, data infrastructure, and behavioral contracts to find functionally identical units. This identifies candidates like multiple button bars that can become a single shared utility.

How does semantic analysis identify refactoring opportunities for DRY principles?

Semantic analysis identifies refactoring opportunities by assessing code similarity through structural fingerprinting and semantic embedding. It uncovers hidden duplication across differing implementations, promoting full-stack DRY principles and improving overall maintainability.

Can I audit data infrastructure and UI components for functional duplication?

Yes, you can audit data infrastructure and UI components for functional duplication. The audit detects functionally identical code units across these layers, highlighting opportunities to consolidate differing implementations into shared reusable components.

What are the limitations of semantic drift analysis for code maintainability?

A limitation of semantic drift analysis is its reliance on AST parsing and semantic embedding, which requires complex processing to accurately assess similarity. It identifies consolidation opportunities but may need manual verification before refactoring.

When do I need semantic embedding to assess code similarity?

You need semantic embedding to assess code similarity when detecting functional duplication that lacks structural or naming similarities. It evaluates the underlying purpose of code units to uncover hidden refactoring opportunities across the codebase.