agentsclimarketplace

Dry

Skill dustinkeeton/wafflestack/stacks/code-quality/skills/dry

πŸ§‡ One batter, every repo β€” reusable AI agent & skill definitions rendered into harness-native files (.claude/, .codex/, .agents/)

Install
npx -y skills add dustinkeeton/wafflestack --skill dry

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Find and remove genuine code duplication β€” repeated blocks, magic literals, copy-pasted markup/components, duplicated test setup β€” under disciplined judgment. Applies the rule of three, verifies sameness is semantic (not merely textual), and abstracts only where a shared seam is warranted, extracting to the project's existing shared-code convention and updating every call site. Invokable by users and agents.

SKILL.md

5.0 KB, as published. Nobody here has run it

DRY β€” Don't Repeat Yourself

When this skill is invoked, hunt down and remove genuine duplication. If invoked with an argument (e.g., /dry src/shared/), scope the scan to that file, directory, or diff. If invoked without arguments, scan the working diff and propose a de-duplication plan before touching code.

DRY is a judgment skill, not a find-and-replace pass. The goal is to collapse duplication that is actually one idea expressed twice β€” not to fuse every pair of similar-looking lines into an abstraction. A premature or wrong abstraction is more expensive than the duplication it removes, so the guardrails in Β§2 matter as much as the detection in Β§1.

This skill is both user-invocable and agent-granted:

  • User-invoked β€” run /dry <path> to scope the scan to a file, directory, or diff, or /dry with no argument to scan the working diff and propose a plan.
  • Agent-granted β€” agents that list dry in their skills: frontmatter apply this discipline while writing or refactoring code, without an explicit invocation.

1. Detect

Look for duplication in these forms:

  • Repeated code blocks β€” the same sequence of statements (a loop body, a guard clause, a transform) appearing in two or more places.
  • Magic values & literals β€” the same constant (URL, key, limit, timeout, error string, regex) hard-coded in multiple spots.
  • Copy-pasted structure β€” component / markup / config blocks duplicated with only small values changed (UI trees, schema definitions, route tables).
  • Duplicated test setup β€” the same arrange / fixture / mock scaffolding repeated across test files instead of a shared factory or helper.

2. Judgment guardrails β€” apply before extracting anything

These are what separate DRY from over-abstraction. A candidate must clear all three:

  • Rule of three β€” two occurrences is not yet a pattern. Do not abstract on the second copy by default; wait for a third (or a clear, near-term third). Two copies are usually cheaper left alone.
  • Semantic, not textual, sameness β€” verify the copies encode the same idea, not merely the same characters. Two blocks that look alike today but answer to different reasons for change (different rules, different domains) are incidental duplication β€” leave them apart. Coupling them manufactures a false seam that fights every future edit.
  • A wrong abstraction costs more than the duplication β€” a premature or ill-fitting abstraction forces every caller through the wrong shape and is painful to unwind. When you are unsure the sameness is real, prefer to leave the duplication (and note it) rather than lock in a bad seam.

If a candidate fails any guardrail, do not extract it β€” state why and move on. Declining is a valid, often correct, outcome.

3. Choose the abstraction level

Match the extraction to the kind of duplication and the smallest seam that fits:

  • Constant / config value β€” for a repeated literal.
  • Helper function β€” for a repeated block of logic.
  • Shared module β€” for a cluster of related helpers used across features.
  • Component / template β€” for duplicated markup or UI structure.
  • Test factory / fixture β€” for repeated test setup.

Extract into the project's existing convention for shared code β€” the shared-utils directory, the constants file, the test-utils location the codebase already uses. Do not invent a new shared location; follow what is already there.

4. Workflow

  1. Detect β€” find the candidate duplication (Β§1).
  2. Verify semantic sameness β€” apply the guardrails (Β§2): confirm it is one idea, past the rule of three, and safe to couple. Drop candidates that fail.
  3. Extract β€” introduce the abstraction at the right level (Β§3), in the project's shared-code convention.
  4. Update all call sites β€” replace every occurrence with the new abstraction. Leaving one copy behind defeats the purpose and hides a live divergence.
  5. Prove behavior is unchanged β€” run the full suite:
    {{project.testCmd}}
    
    The tests must pass unchanged: a DRY refactor alters structure, never behavior.

When called by agents

An agent granted dry applies these guardrails inline while writing or refactoring β€” collapsing real duplication as it appears and, just as importantly, declining to abstract incidental similarity or a mere second occurrence. Report both what was de-duplicated and what was deliberately left duplicated (and why), so a reviewer sees the judgment, not just the diff.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.