dry-check
Tool to detect and flag manual code duplication when new functions are introduced.
Install
mkdir -p .claude/skills/dry-check && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12344" && unzip -o skill.zip -d .claude/skills/dry-check && rm skill.zipInstalls to .claude/skills/dry-check
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
新規・変更した関数について、同等ロジックを手書きしている箇所を grep で検索し DRY 違反をフラグする。関数の新規定義・変更時に使用。Key capabilities
- →Extract function name and major operations from arguments
- →Grep codebase for individual major operations
- →Identify handwritten duplicate logic
- →Evaluate each candidate for replacement or maintenance
- →Report findings with file, line, and rationale
How it works
The skill analyzes a given function, extracts its core operations, then searches the codebase for manual implementations of these operations to identify potential DRY violations.
Inputs & outputs
When to use dry-check
- →Check for duplicate logic
- →Refactor codebase for DRY compliance
- →Identify redundant function implementation
About this skill
$ARGUMENTS に関連する DRY 違反を検査する。 $ARGUMENTS が空の場合は、会話の直近の変更内容から対象を推定する。
背景
関数を作ることと、既存コード全体にその関数を適用することは別の作業。関数より前に手書きされた重複コードは、関数が内包する振る舞い(例: emit() 呼び出し)を欠いたまま残りやすい。
Step 1 — 関数の分析
$ARGUMENTS から以下を抽出する:
- 関数名
- 関数が行う主要操作(grep 可能なパターンのリスト)
例:
関数: show_egui_main
主要操作:
- .show()
- .set_focus()
- reset_pending.store(true, ..)
$ARGUMENTS に操作が明示されていない場合は、先に関数本体を読む。
Step 2 — 各主要操作を grep
コードベース全体で各操作を個別に検索する。 関数自身の内部のマッチは除外する。
Step 3 — 手書き重複の特定
以下の条件を満たす呼び出し箇所を候補とする:
- 主要操作のうち2つ以上を手動で実行している、かつ
- 当該関数を呼び出していない
各候補について十分なコンテキストを読んで理解する。
Step 4 — 各候補の評価
候補: <file>:<line> — <説明>
現状: <手動で行っている処理>
欠落: <関数が追加する処理のうち手動版にないもの>
判定: [置換] <関数呼び出し> に置き換える
[維持] 理由: <置換が不適切な理由>
出力
根拠の規律: 全判定に根拠(file:line または grep 結果)を付ける。コードを確認せずに下した判定は [置換]/[維持] とせず [要確認] として報告する。
全候補を判定と根拠付きで列挙する。 違反が見つからなかった場合: 「手書き重複は見つかりませんでした。」(Step 2 で実行した grep パターンを添える)
When not to use it
- →When the user wants to modify code directly
- →When the user does not want to analyze function behavior
- →When the user wants to ignore DRY violations
Limitations
- →It does not modify code directly
- →It requires manual confirmation for replacement or maintenance decisions
- →It relies on grep patterns for identifying operations
How it compares
This skill specifically targets handwritten duplicate logic that should be encapsulated by a function, providing a focused analysis for refactoring opportunities beyond general code duplication detection.
Compared to similar skills
dry-check side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| dry-check (this skill) | 0 | 5mo | No flags | Intermediate |
| effective-go | 323 | 9mo | No flags | Beginner |
| solid-principles | 57 | 9mo | No flags | Intermediate |
| typescript-review | 39 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
effective-go
openshift
Apply Go best practices, idioms, and conventions from golang.org/doc/effective_go. Use when writing, reviewing, or refactoring Go code to ensure idiomatic, clean, and efficient implementations.
solid-principles
SmidigStorm
Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.
typescript-review
metabase
Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.
ast-grep
ast-grep
Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.
serena
massgen
This skill provides symbol-level code understanding and navigation using Language Server Protocol (LSP). Enables IDE-like capabilities for finding symbols, tracking references, and making precise code edits at the symbol level.
typescript
lobehub
TypeScript code style and optimization guidelines. Use when writing TypeScript code (.ts, .tsx, .mts files), reviewing code quality, or implementing type-safe patterns. Triggers on TypeScript development, type safety questions, or code style discussions.