Agent skill · kevmoo
deslop-duplication-audit
Detects, audits, and safely remediates structural code duplication across Dart and Flutter repositories using the standalone Deslop CLI tool and empirical test gating. Use when asked to run Deslop, clean up duplicate Dart code, analyze copy-paste blocks, evaluate code redundancy, or audit structural code health across Dart and Flutter Git repositories. Don't use for non-Dart projects, non-Git checkouts, or simple single-file syntax lints.
What it needs
About 5k tokens when loaded.
What this skill does
Deslop Duplication Audit Protocol This skill provides an empirical, architecturally disciplined workflow for identifying and refactoring duplicated code in Dart and Flutter repositories using Deslop (a tree-sitter structural duplicate code detection engine). 1. Toolchain & Execution Setup Locating or Installing Deslop: Verify if deslop is available on $PATH (which deslop). Default: Install via Cargo: cargo binstall deslop cargo install deslop Fallback (mise / binary releases): Run mise use -g github:Nimblesite/deslop@latest (or mise exec -- deslop), or download the pre-compiled platform binary from Nimblesite/Deslop Releases. Environment & Tooling Verification: Ensure the repository's Dart/Flutter toolchains (dart, flutter) are accessible on $PATH. Sandbox note for Dart repositories: In restricted container or sandbox environments where .darttool pre-compilation encounters atomic rename exceptions (PathNotFoundException, errno = 2), pass --no-precompile (e.g., dart test --no-precompile). 2. Phase 1: Read-Only Discovery Scans & Reporting Execute the bundled Dart helper script (deslopreport.dart) to run Deslop in strictly read-only mode and emit an instant, token-efficient Markdown summary with clickable source and HTML links: A. Full Repository / Directory Scan If Deslop was already executed manually, parse an existing report directly: dart run skills/deslop-duplication-audit/bin/deslopreport.dart --report {pathtoreport.json} --dir {targetdir} B. PR / CL Delta Scan (Changed Code Focus) To avoid noisy legacy duplicate reports and focus strictly on code modified in a Pull Request or Google3 Changelist, pass a diff command or changed files: Target working trees remain untouched (zero .deslop/ cache directory bloat or dirty git status). Note: Tracking upstream feature request Nimblesite/Deslop#364 for native diff ingestion. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills kevmoo/deslop-duplication-audit