From craft
Stops duplication and reinvention — the failure GitClear measures as "rework" (copy-paste up, refactoring down, the signature of AI code with a short shelf life). Use before writing any helper, util, type, constant, or component, and when reviewing a diff for repeated logic. Enforces search-before-build, consolidate- don't-clone, and DRY-as-knowledge (one rule, one authoritative place). Triggers: "is there already a function for this", "this looks duplicated", "DRY this up", "extract the common logic", "we keep rewriting this", before adding any utility.
How this skill is triggered — by the user, by Claude, or both
Slash command
/craft:dry-and-reuseThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Purpose**: kill the duplication that gives AI code its short shelf life. GitClear's
Purpose: kill the duplication that gives AI code its short shelf life. GitClear's 211M-line study found copy-pasted code now exceeds refactored code for the first time ever, and duplicated blocks rose 8× — because agents reflexively add and almost never move/merge. Duplicated blocks carry 15–50% more defects. The senior move is to find what exists and reuse it.
The real rule (Pragmatic Programmer): every piece of knowledge has a single, authoritative representation. Two consequences agents get wrong in both directions:
itertools/lodash/slices/Intl
already gives you. Reinventing stdlib is DRY slop and a bug farm.craft:right-sized-design.)groupBy, debounce, chunk, deepEqual, date math, etc.refactoring-patterns: Extract Function, Pull Up Method, Extract Class). Place the
single source where both callers can reach it without creating a bad dependency.# ❌ Agent clones the rule into a third place
def can_edit(user, doc):
return user.role == "admin" or user.id == doc.owner_id # rule copy #3
# ✅ One authoritative home, reused
# permissions.py
def can_edit(user, doc) -> bool:
"""Single source of truth for edit permission."""
return user.is_admin or user.id == doc.owner_id
# everywhere else: from permissions import can_edit
When the rule changes (say, editors can also edit), you change it once — not hunt three drifted copies.
Scan the diff for repeated logic, duplicated constants, and reinvented stdlib/existing
utilities. For each: is this knowledge duplication (consolidate) or incidental
similarity (leave it)? Tag [dry-and-reuse · duplicate-knowledge|reinvented-util · SEV].
Cross-check suspected structural duplication with dependency-analyzer.
../../references/PRINCIPLES.md §A../../references/SMELLS.md../../references/EVIDENCE.md../../RULES.mdnpx claudepluginhub manutej/craftProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.