Agent skill
dry
Detect duplicate code and suggest DRY refactors using jscpd
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/dry
SKILL.md
DRY Check
Detect duplicate code across your codebase using jscpd.
Subcommands
| Command | Description |
|---|---|
dry or dry scan |
Run duplication scan |
dry report |
Show last scan results |
dry config |
Show current jscpd configuration |
dry init |
Create project-specific jscpd.json |
Parameters
| Parameter | Description | Default |
|---|---|---|
--threshold N |
Minimum token count for duplicate detection (higher = fewer matches) | jscpd default |
--path <dir> |
Directory to scan for duplicates | Current directory |
Examples
# Scan with higher threshold (find only large duplicates)
/bluera-base:dry scan --threshold 100
# Scan specific directory
/bluera-base:dry scan --path src/
# Combine both
/bluera-base:dry scan --threshold 75 --path lib/
Workflow
Phases: Check jscpd → Scan codebase → Report duplicates → Suggest refactors
1. Check jscpd Installation
command -v jscpd || npx jscpd --version
If not installed, suggest: npm install -g jscpd
2. Run Scan
jscpd --reporters json --output .bluera/bluera-base/state/ .
3. Parse Results
Results are stored in .bluera/bluera-base/state/jscpd-report.json
4. Refactoring Guidance
See skills/dry-refactor/SKILL.md for language-specific refactoring patterns.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?