skills/dry/SKILL.md
Scan all crates for SOLID/DRY/KISS violations, rank top 5 worst offenders, fix them
npx skillsauth add api-haus/my-claude-workflow dryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an autonomous refactoring agent. Your job is to scan the entire workspace for principle violations, rank the top 5 worst offenders, and fix them one by one.
Read these files to understand the project's architectural contracts:
docs/ARCHITECTURE.md — Layer hierarchy, extension points, pipeline stagesdocs/BRIDGE_DESIGN.md — Bridge contract, invariants, coordinate spacesCLAUDE.md — Multi-consumer rules, testing pyramid, layer boundariesScan every .rs file under crates/*/src/ for violations of the principles below. Use grep, file reads, and structural analysis. Do NOT run clippy or debtmap — those are handled by the generic /refactor skill.
For each finding, record:
crate/path/file.rs:lineScore each finding: severity x blast_radius x instance_count
Sort descending. Pick the top 5. Present them to the user as a numbered list:
## Top 5 Offenders
### 1. [Title] — Score: N
**Principle:** DRY | **Severity:** VIOLATION | **Blast radius:** cross-crate | **Instances:** 4
**Locations:**
- `crates/voxel_bevy/src/gpu/mod.rs:142`
- `crates/voxel_bevy/src/gpu/mod.rs:285`
- `crates/voxel_game/src/noise_lod.rs:340`
- `crates/voxel_game/src/noise_lod.rs:520`
**Description:** <what the violation is>
**Fix approach:** <how to fix it>
### 2. ...
Process offenders 1 through 5 in order. For each:
pub fn, pub struct, pub trait). A fix for one consumer must not break another.cargo test --workspace
just build-wasm && just test-wasm
Both gates must pass — native tests AND WASM e2e.just visual-qa and inspect test-results/.After all 5 offenders are fixed and tests pass, commit everything via /commit.
SRP (Single Responsibility)
OCP (Open-Closed)
VolumeSampler trait, material generics, debug modules)LSP (Liskov Substitution)
VolumeSampler impls that violate purity (same inputs must produce same outputs)BRIDGE_DESIGN.mdISP (Interface Segregation)
DIP (Dependency Inversion)
voxel_plugin importing Bevy types (must be engine-agnostic)voxel_bevy importing game-specific types from voxel_gameDRY (Don't Repeat Yourself)
Rule of Three
KISS (Keep It Simple, Stupid)
YAGNI (You Aren't Gonna Need It)
LoD (Law of Demeter / Least Knowledge)
a.b.c.d.do_thing()Composition over Inheritance
impl Deref chains used to simulate inheritanceEncapsulation
pub fields that should be behind accessor methodsSeparation of Concerns
Fail Fast
.unwrap_or_default() hiding real bugsResult values (the #[must_use] lint catches some, but not all)Least Surprise
&self methods that mutate via interior mutability without clear naming)Ownership Clarity
Arc/Rc where owned values or borrows suffice.clone() used to silence the borrow checker instead of restructuring ownershipBox<dyn Trait> where monomorphic generics work and there's only one implementorString parameters where &str suffices (unnecessary allocation at call site)Type Safety
usize/i32/u64 for domain IDs where a newtype adds safety (e.g. WorldId is good — look for places that aren't as careful)fn process(include_debug: bool) → fn process(mode: ProcessMode)Error Handling
unwrap()/expect() in library code (voxel_plugin, voxel_bevy) outside of testspanic! in recoverable pathsString errors vs structured error enums)? propagation (manual match + return instead of ?)Layer Violations
voxel_game → voxel_bevy → voxel_plugin → voxel_noisevoxel_plugin must NEVER import from voxel_bevy or any engine cratevoxel_bevy must NEVER import from voxel_gamevoxel_game that should be pushed down to voxel_bevy or voxel_pluginMulti-Consumer Safety
pub item in voxel_plugin or voxel_bevy, grep ALL crates for usagevoxel_game, voxel_unity, integration tests, benchmarksPrecision Guards
as f32 casts in grid-offset arithmetic (must stay i64)==) in SDF paths (use sign checks or thresholds)sdf_conversion::to_storage/to_float with manual castspub item change requires a call-site audit across all crates.cargo test --workspace or just build-wasm && just test-wasm fails after a fix, resolve it before moving on./commit./refactor work. Skip complexity metrics, clippy findings, cognitive complexity scores — those belong to the generic /refactor skill.data-ai
Extract research content from YouTube presentations, PDFs, or PPTX files into structured markdown. Dispatches each pass to a dedicated sub-agent (research-extractor / research-vision / research-refiner) so per-deck vision passes scale to hundreds of slides without bloating the parent context.
development
Build, run, and analyze Unity profiler data with perf-report-style call-stack attribution
documentation
Write a handoff prompt for a future session. A handoff is a continuation-link — minimal context plus a kickoff line the user can copy-paste. Never a diagnosis, never an investigation script, never a prescribed deliverable.
testing
Multi-agent orchestration mode. The orchestrator never reads, edits, runs, or tests directly — it scopes work, runs a re-implementation audit, presents a freeform method brief with grounded recommendations, then dispatches every step to sub-agents through shared context files at `docs/orchestrate/<topic>/`. Use when invoked via /delegate, when the user asks to orchestrate or coordinate multi-agent work, or when the task explicitly calls for delegation.