jpskill.com
💬 コミュニケーション コミュニティ

bugfix

Use when given a bug report, failing test, stack trace, or CI failure that needs diagnosis and repair. Autonomously diagnoses root cause, implements minimal fix, verifies correctness, and commits. Keywords: fix bug, failing test, stack trace, CI failure, debug error, broken test.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o bugfix.zip https://jpskill.com/download/9154.zip && unzip -o bugfix.zip && rm bugfix.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9154.zip -OutFile "$d\bugfix.zip"; Expand-Archive "$d\bugfix.zip" -DestinationPath $d -Force; ri "$d\bugfix.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して bugfix.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → bugfix フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1
📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

Bugfix

Autonomous end-to-end bug fix: diagnose from evidence, find root cause, minimal fix, verify, commit.

NEVER

  • Never ask the user for more information unless the bug description is completely ambiguous — use tools to find it.
  • Never refactor unrelated code while fixing a bug — scope creep breaks regression isolation.
  • Never fix other bugs you notice while fixing the target — create a new task instead.
  • Never git add -A — stage only the files you changed.
  • Never skip running the full workspace test suite after a fix — targeted test passing doesn't mean no regression.
  • Never commit until typecheck passes on the affected workspace.

Root Cause Classification (decide before writing any code)

Type Signal Fix approach
Code bug Logic error, wrong query, bad comparison Fix implementation
Test bug Expectation contradicts documented contract Fix the test — explain why it was wrong
Mock wiring mockReset: true pattern not followed, stale mock state Use correct mock pattern from CLAUDE.md
Type error TypeScript compilation failure Fix types, not tests
Import error Wrong package path, missing export Fix import resolution

If it's a mock wiring issue: read the mock patterns in CLAUDE.md before writing anything — there are three distinct patterns (forwarding, object-bag, counter-based sequencing).

Evidence-First Thinking

Collect before hypothesizing:

  1. Run the failing test — see the exact error output, not just the description
  2. Read the failing test — understand what it expects
  3. Read the source under test
  4. git log --oneline -10 -- <file> — was this recently changed?
  5. For runtime errors: check logs, route/plugin/service code

State hypothesis explicitly before writing code: "The test fails because X, caused by Y."

Abort Conditions (stop and ask user)

  • Bug is in security-sensitive area (auth, RBAC, IDOR) — confirm fix approach first
  • Fix requires changing more than 5 files — may be an architectural issue
  • Root cause requires changing the mock strategy for an entire test suite

Scripts

bash scripts/collect-bugfix-context.sh apps/api/src/tests/routes/auth.test.ts
bash scripts/run-targeted-test.sh apps/api/src/tests/routes/auth.test.ts
bash scripts/run-targeted-test.sh apps/api/src/tests/routes/auth.test.ts "returns 500"

Verification Sequence

  1. Run the specific failing test — must pass
  2. Run the full workspace suite — no new failures
  3. Run typecheck on the affected workspace (npx tsc --noEmit)
  4. git diff --name-only — verify every changed file relates to the bug; revert anything that doesn't

Commit Format

fix(scope): what was broken and how it was fixed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Arguments

$ARGUMENTS: Error message, failing test path, CI log URL, or reproduction steps. If empty, ask for the error or failing test name.