Dont Repeat Yourselfのロゴ

Dont Repeat Yourself

コミュニティ
marekkirejczyk
dont-repeat-yourself

Find every concept implemented more than once in a scope (a repository, a PR, a directory, a concept) and give it one well-tested implementation. Identical copies are extracted automatically; behaviour differences and high-stakes code are brought to you for a decision at the end.

概要

公開者marekkirejczyk
リポジトリskills
スキル名dont-repeat-yourself
スター
157
フォーク
1
同梱ファイル
1
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    marekkirejczykがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Dont Repeat Yourself」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/marekkirejczyk/skills/tree/main/skills/dont-repeat-yourself
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/marekkirejczyk/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/dont-repeat-yourself .claude/skills/dont-repeat-yourself
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでDont Repeat Yourselfを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にDont Repeat Yourselfを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Dont Repeat Yourselfは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Don't repeat yourself

Find every concept implemented more than once in a scope and give it one well-tested implementation. Arguments: $ARGUMENTS. If your agent does not fill that in, take them from the user's message.

The scope is what the user names: the repository, a PR or branch, a directory, a file, a module, or a concept ("everything about dates"). With no scope given, use the whole repository.

For a PR, compare its new code against the whole repository:

  • A helper already exists: the PR's code reuses it.
  • The PR adds a second copy and no helper exists: extract it and replace both copies, even if the older one is outside the PR.
  • Other copies outside the PR: report them and leave them.

Run phase 1 from start to finish without asking for approval. Phase 2 is the only time you ask the user anything.

Goal

Each concept has one implementation, so a change to it is a change in one place.

You are done when all of these hold:

  1. Every unit in scope is inventoried, and every cluster of copies has been compared.
  2. Every cluster is resolved: extracted, left for a stated reason, or decided by the user.
  3. Every extraction is complete: all its call sites use the shared code, and the old copies are gone.
  4. Helpers live together: the local helpers on a shared module's subject have moved into it.

What counts as a duplicate

A cluster is two or more implementations of one concept. Look for the intention, not matching text: three ways of writing "today / yesterday / a minute ago" are one cluster. Inline blocks count as well as named helpers, and so do route types that describe the same contract.

  • Non-trivial logic: two copies are enough.
  • A one- or two-line expression: three or more copies.
  • A pure pass-through wrapper is a duplicate of what it wraps: remove it and call the wrapped code directly.

Work mainly within one layer. Across layers, extract only pure functions, placed where the project's dependency rules allow. Other cross-layer duplication is report-only, because the fix is moving a rule, which is a different change.

Rules

These hold after every round. A round that breaks one is undone.

  1. Semantics stay the same, except where the user approves unifying a behaviour in phase 2.
  2. Lint, type checks, build and tests pass, using the project's own commands. They must pass before you start: if they fail, stop and report it.
  3. Callers' tests stay as they are, except for shared test helpers and fixtures, and expected values in a unification the user approved. Expected values stay written out in each test.
  4. External contracts keep working: published package exports, public API routes and fields, database tables and columns, serialized keys, event names, environment variables, config keys and CLI flags. A replaced published helper stays as a thin export of the new one.

Identical behaviour

Copies are identical only if you have compared every branch and found the same result for each of:

  • boundaries, rounding and units
  • empty, null and invalid input
  • time zones, locale and text
  • errors thrown or swallowed
  • side effects, their order, and logging

Any difference, however small, means the cluster goes to phase 2.

Extractions

  • A pure function wherever possible, named for its concept.
  • In the nearest existing module for that subject, or a new module named for the subject when none fits. Generic utils or helpers modules are never the destination.
  • With its own test file, using examples taken from every former call site, written before the call sites move. Those examples prove each site's nuances survived.

Moving helpers together

When an extraction creates or extends a module, look through every file that extraction touched. Move local helpers about the module's subject into it, even those with a single caller. A helper bound to its caller's private state stays, and so do helpers on other subjects.

A move is phase 1 work, in its own commit, separate from the extraction. Existing tests move with the helper. Add direct tests for a non-trivial helper that has none.

Phase 1: extract what is safe

  1. Baseline. On a new branch, run lint, type checks, build and tests, and record the results. Done when all pass.
  2. Inventory. Write one line of intent for every function, type and notable inline block in scope, grouped by layer. Use a subagent per layer where your agent has them. Done when every unit in scope has a line.
  3. Cluster. Compare intents within each layer, then pure functions across layers. For each cluster, list its call sites and every behavioural difference. Sort each cluster into one of:
    • Extract now: clearly one concept, behaviour identical, outside high-stakes code.
    • Ask: any behavioural difference; copies that match but may be separate concepts (a request type and a database row type); or anything in high-stakes code, even when identical: money, auth and permissions, data migrations, concurrency or locking.
    • Report only: cross-layer duplication that isn't a shareable pure function.
  4. Extract in rounds. One cluster per round: tests first, then the shared code, then every call site, then delete the old copies. Run the checks and commit. If a check goes red, undo the round and move the cluster to Ask. Leave the branch unpushed. Done when every Extract now cluster is applied.
  5. Move helpers, as above.
  6. Sweep. Search the scope again for each extracted concept. Done when no copy remains and all checks pass.

Phase 2: ask

Present every Ask cluster in one batch, as numbered items, each with:

  • the call sites, as file:line
  • the shared intention
  • every exact difference
  • the proposed function signature
  • your recommendation: unify on one behaviour (say which), keep the differences as options, or leave separate

Recommend leaving separate when keeping the differences would take more than 2–3 options.

Apply the user's answers in the same session, one commit per cluster, under the same rules and test-first order. A cluster the user does not answer stays as it is.

Report

  • Clusters extracted, helpers moved, wrappers removed, and copies deleted.
  • Decisions the user made, and every caller whose behaviour changed because of one.
  • Clusters left, and why.
  • Report-only cross-layer duplication, and copies outside a PR scope.
  • Check results before and after.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Dont Repeat Yourself」では何ができますか?

Find every concept implemented more than once in a scope (a repository, a PR, a directory, a concept) and give it one well-tested implementation. Identical copies are extracted automatically; behaviour differences and high-stakes code are brought to you for a decision at the end.

TypingMindでDont Repeat Yourselfを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Dont Repeat Yourselfはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDont Repeat Yourselfをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/marekkirejczyk/skills/tree/main/skills/dont-repeat-yourselfを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Dont Repeat Yourselfを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Dont Repeat Yourselfで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDont Repeat Yourselfを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Dont Repeat Yourself」は無料ですか?

はい。marekkirejczykがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇