Bugfixのロゴ

Bugfix

コミュニティ
dan-the-dev
bugfix

Use when fixing bugs, regressions, failing tests, or unexpected behavior. Applies a strict test-first bugfix workflow with minimal safe changes, isolated commits, and language-agnostic verification strategies.

概要

公開者dan-the-dev
リポジトリxp-developer-skills
スキル名bugfix
スター
33
フォーク
1
同梱ファイル
11
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 11個の同梱ファイル

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

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

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

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

スキルの指示

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

Bugfix TDD

Mission

Shared delivery rules at boundaries: docs/delivery-process.md (§2 verification, §3 change-surface, §4 test strategy, §7 two hats) and docs/project-verification.md, docs/test-strategy-selection.md.

Fix bugs safely using a strict RED → GREEN workflow.

The goal is:

  • reproduce the bug
  • create a deterministic failing test
  • apply the minimal safe fix
  • verify no regressions
  • preserve reviewability and isolation

This skill optimizes for:

  • correctness
  • reproducibility
  • safety
  • small reversible changes

NOT for:

  • speed
  • cleanup
  • optimization
  • refactoring

Core Principles

  • Tests are the source of truth
  • Never fix behavior before reproducing it
  • Every bugfix must be reproducible
  • Prefer the smallest possible change that restores the violated invariant, not one that only hides the symptom
  • Separate reproduction from resolution
  • Preserve system stability
  • Keep commits isolated and reviewable

Language-Agnostic Rules

This skill MUST adapt to the current repository stack.

The agent should:

  • detect the language and framework in use
  • identify existing testing conventions
  • reuse project-native tooling
  • follow existing repository patterns

Examples:

  • JavaScript/TypeScript → npm/pnpm/jest/vitest/playwright
  • Python → pytest/unittest
  • Go → go test
  • Java → junit/maven/gradle
  • Ruby → rspec
  • Rust → cargo test

Never assume:

  • package manager
  • test runner
  • framework
  • directory structure

Always inspect the repository first.


Mandatory Workflow

0. Synchronize Repository

Required steps:

  1. checkout main branch
  2. pull latest changes
  3. create isolated bugfix branch

Branch format:

bugfix/{ticket}-{short-description}

Examples:

  • bugfix/STR-142-null-email-validation

  • bugfix/PLAT-201-invalid-date-format

  • bugfix/fix-missing-user-mapping

Rules:

  • lowercase

  • hyphen-separated

  • concise and descriptive

  • description must summarize the bug behavior

  • avoid generic names like:

    • fix-bug

    • issue-fix

    • quick-patch

Ticket handling:

  • if a ticket identifier exists in the initial request, include it

  • otherwise omit the ticket portion

The agent should automatically generate a meaningful short description derived from:

  • observed failing behavior

  • affected domain

  • expected correction


1. Understand the Failure

Before writing code:

  • complete a brief test strategy note per test-strategy-selection.md — e.g. will mutation run after GREEN if configured and logic is branchy?
  • identify observed behavior
  • identify expected behavior
  • identify affected scope
  • inspect logs/errors/traces if available
  • separate symptom (what looks wrong: crash, wrong UI, log noise) from the invariant or contract that was violated (what the system should guarantee under the same conditions)

Prefer:

  • deterministic reproduction
  • automated reproduction
  • narrow reproduction scope

2. Reproduce the Bug with a Test (RED)

Create a failing test reproducing the issue.

Choose the lowest useful test level:

  1. unit
  2. integration/API
  3. end-to-end

The test MUST:

  • fail for the correct reason
  • be deterministic
  • clearly express expected behavior — i.e. the correct observable outcome or invariant under the failing conditions, not only that “something failed” (see Anti-Patterns: symptom fixes)
  • fail before the fix exists

The reproduction must be sufficient for a reviewer to see what contract was broken, not merely that an error path was exercised.

If reproduction is impossible:

  • STOP
  • document constraints
  • request clarification

3. Verify RED State

Run the minimal test scope first.

Examples:

  • single test
  • single file
  • focused module

If the test passes unexpectedly:

  • strengthen assertions
  • improve reproduction
  • verify execution path

Never continue without confirmed RED.


4. Commit RED State

Stage ONLY test files.

Commit message:

test: reproduce bug STR-XXX

The commit MUST:

  • contain only reproduction logic
  • clearly demonstrate the failure

5. Apply Minimal Fix (GREEN)

Modify only the code required to resolve the bug.

Prefer:

  • local fixes
  • minimal behavioral changes
  • existing abstractions
  • reversible changes

Avoid:

  • refactoring
  • cleanup
  • renaming
  • architectural changes
  • unrelated edits
  • symptom-only changes that hide the failure without restoring the violated invariant (e.g. empty catch, broad default, guard that masks the bug while wrong outcomes remain for other inputs)

6. Verify GREEN State

Run progressively:

  1. focused tests
  2. related module/package tests
  3. broader suites if needed
  4. all applicable project verify steps at bugfix boundary — lint, format, typecheck, SonarQube/static analysis when configured, mutation if adopted (docs/project-verification.md, docs/test-strategy-selection.md)

Verify:

  • failing test now passes for the right reason (assertions still encode the correct contract, not loosened to force green)
  • related behavior remains stable
  • no regressions detected

7. Commit GREEN State

Stage ONLY fix-related files.

Commit message:

fix: resolve bug STR-XXX

The commit MUST:

  • contain only the minimal fix
  • preserve review clarity

8. Push Branch

Push branch upstream.

Do NOT:

  • squash commits
  • rewrite history
  • open PR automatically

9. Stop

Once:

  • RED reproduced
  • GREEN verified
  • branch pushed

STOP.

Do not:

  • optimize
  • refactor
  • continue exploring
  • expand scope

Escalation Rules

STOP and escalate if:

  • bug cannot be reproduced deterministically
  • tests are flaky
  • unrelated failures appear
  • fix requires architectural changes
  • repository conventions are unclear
  • missing tooling prevents safe validation

Document:

  • blockers
  • attempted approaches
  • observed behavior

Anti-Patterns

Never:

  • fix without a failing test
  • mix refactoring with bugfixing
  • create large fixes
  • modify unrelated files
  • combine RED and GREEN in one commit
  • skip regression validation
  • assume tooling without inspection
  • apply a symptom fix that silences the failure while the broken invariant remains (see references/anti-patterns.md)

Verification Strategy

Discover all verify steps the current project defines for the language/module you touched — then run each applicable step before claiming done (delivery-process §2; docs/project-verification.md). Do not stop after only the test runner if the project defines compile, typecheck, lint, format, SonarQube/static analysis, integration, or other gates.

Fix new violations you introduced — do not suppress lint or Sonar rules to force green.

Prefer incremental validation within that set:

  1. focused automated check
  2. local module/package verify step
  3. service/application verify step
  4. full project verify only when justified

Avoid expensive full runs after every micro-edit unless the project requires it; run the full applicable set at the bugfix boundary.


Definition of Done

A bugfix is complete only when:

  • bug is reproduced by automated test that asserts the correct invariant / expected outcome, not only a generic failure
  • RED state confirmed
  • minimal fix applied (restores the contract; not a symptom-only silencing)
  • GREEN state confirmed
  • all applicable project verify steps for this scope passed
  • test strategy table in output (practices evaluated → adopt/skip)
  • change-surface complete if construction/import/API changed
  • related regressions checked
  • two isolated commits exist
  • branch pushed upstream
  • no unrelated changes remain
  • Root cause and recurrence prevention are documented in the output (see Output Format)

Output Format

markdown
Branch: <branch-name>

Bug:
<short description>

Observed Behavior:
<actual behavior>

Expected Behavior:
<expected behavior>

Invariant / contract (one line):
<what the system should guarantee under the failing conditions — the repro test must assert this>

1. Reproduction
- <approach>

2. RED
- Test: <file::test>
- Result: failing as expected

3. GREEN
- Fix: <minimal change summary>
- Result: passing

4. Verification
- Commands executed
- Scope validated
- Regression status
- Test strategy (mutation, integration, etc.): adopted / skipped with reason

5. Git
- RED commit
- GREEN commit
- Branch pushed

6. Root cause
<one short paragraph: why the bug occurred — wrong assumption, missing branch, bad state, regression, etc.>

7. Recurrence prevention
<one short paragraph: how this class of bug is prevented now — e.g. new test covers edge, documented constraint, follow-up ticket for structural fix>

Additional Resources

Workflow References

  • references/workflow.md
  • references/heuristics.md
  • references/verification.md
  • references/anti-patterns.md
  • references/language-agnostic-testing.md

Examples

  • examples/javascript.md
  • examples/typescript.md
  • examples/python.md
  • examples/go.md
  • examples/java.md

Completion Checklist

  • checklists/done.md

Resource Usage Guidance

Open additional files only when needed.

Suggested usage:

  • workflow.md → when execution order is unclear

  • heuristics.md → when multiple fix strategies are possible

  • anti-patterns.md → before large or risky changes

  • verification.md → when validation scope is uncertain

  • language-agnostic-testing.md → when repository tooling is unfamiliar

  • examples/* → when repository language matches example ecosystem

  • checklists/done.md → before finalizing work

同梱ファイル

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

よくある質問

AIスキル「Bugfix」では何ができますか?

Use when fixing bugs, regressions, failing tests, or unexpected behavior. Applies a strict test-first bugfix workflow with minimal safe changes, isolated commits, and language-agnostic verification strategies.

TypingMindでBugfixを使うメリットは何ですか?

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

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

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

Bugfixを使えるAIモデルはどれですか?

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

Bugfixは何個のAIモデルで使えますか?

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

AIスキル「Bugfix」は無料ですか?

dan-the-devがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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