本文へ移動
cccskills
無料GitHub で公開

dry

Refactor duplicated code by extracting helpers, shared abstractions, or clearer reusable structure. Use when asked to apply DRY, remove duplication, consolidate repeated logic, or run `/refactor:dry`.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md1.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

DRY Refactor

Ask the user for the file or directory to refactor. Support multiple files if a directory is provided.

Process

Work through these steps in order, making a separate commit for each extraction:

  1. Extract simple helper methods (strings, calculations, parsing)

    • Identify duplicated logic
    • Extract to focused method with clear name
    • Remove duplicated code immediately after extraction
    • Commit the extraction
  2. Extract complex methods with parameters

    • Find similar code blocks with variations
    • Extract with parameters to handle variations
    • Remove duplicated code immediately after extraction
    • Commit the extraction
  3. Apply design patterns when beneficial

    • Template Method, Strategy, etc. for structural duplication
    • Only when it improves readability/maintainability
    • Avoid over-engineering or premature abstraction
    • Remove duplicated code immediately after extraction
    • Commit the extraction

After EACH extraction:

  • Run tests automatically
  • If tests fail, revert the change immediately
  • If tests pass and using IDE refactoring tool, commit: . r <description>
  • If tests pass but manual refactoring, commit: ^ r <description>
  • Remove the now-duplicated code in the same commit

Output

  • If no duplication found, report "No duplication found"
  • Otherwise provide brief summary at end (e.g., "Extracted 4 methods, removed 3 duplicated blocks")

Commit Format

Use Arlo's Commit Notation (ACN):

  • . r extract saveToDatabase method - IDE refactoring or provably safe
  • ^ r extract validation logic - Manual refactoring validated by tests

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

catchup

無料

Rebuilds session context after a clear by reading git history, plans, and beads state. Triggers on 'catch up'.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

changelog

無料

Generate a bullet-point summary of branch changes for a PR description. Triggers on "changelog", "pr summary", "summarize branch", or "/changelog".

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

commit

無料

Commit the current changes with quality checks, status review, staged diff inspection, appropriate tests, and a clear commit message. Use when the user says "commit", "c", asks to make a commit, or wants changes saved in git.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

declutter

無料

Refactor code to remove dead code, useless comments, unused variables, and unused imports. Use when asked to declutter a class, clean up noisy code, remove cruft, or run `/refactor:declutter`.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

Build a rich, self-contained HTML explanation of a code change — diff, branch, commit range, MR/PR — with background, intuition, a code walkthrough, diagrams, and a glossary, then quiz the reader interactively in chat. Use when the user asks to explain a change, understand a PR/MR, walk through a diff, onboard onto a branch, or says "explain this PR", "what does this branch do", "teach me this change", or "/explain-diff".

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

SDiamante13 のスキルをすべて見る

このスキルの問題を報告する