Skip to content
cccskills
FreePublished on GitHub

bugfix

Standardized bug fix workflow using TDD (Red-Green-Refactor). Use when fixing bugs, resolving issues, or when the user invokes /bugfix. Ensures root cause analysis, failing test first, then minimal fix.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Bug Fix Workflow

バグ修正の標準化されたワークフロー。TDD(Red-Green-Refactor)とroot cause analysisを組み合わせる。

ワークフロー

Phase 1: 理解

  1. バグの報告・症状を確認する

    • ユーザーからの報告、issueの内容、エラーメッセージを把握
    • 再現条件を明確にする
  2. 関連コードを読む

    • バグが発生している箇所のソースコードを読む
    • 呼び出し元・呼び出し先の依存関係を理解する
    • 既存テストを確認: 関連するテストファイルを読み、テストパターン(アサーション、データ構造、ヘルパー関数)を把握する
  3. 根本原因を特定する(5 Whys)

    • エラーメッセージの最初を確認する(最後ではない)
    • 症状ではなく根本原因を探る
    • 仮定に頼らず、コードを実際に読んで確認する
    • 確信が持てない場合は logic-validator で推論を検証する

Phase 2: Red(失敗するテストを書く)

  1. バグを再現する失敗テストを書く
    • 既存テストのパターンに合わせる: アサーションスタイル、データ構造、命名規則を既存テストから踏襲する
    • テストがバグの症状を正確に捉えていることを確認する
    • テストを実行し、確実に失敗することを確認する

Phase 3: Green(最小限の修正)

  1. テストが通る最小限のコード修正を行う
    • 根本原因に対する修正のみ行う
    • 周辺コードのリファクタリングは行わない
    • テストを実行し、新しいテストが通ることを確認する

Phase 4: Refactor(リグレッション確認)

  1. 全テストスイートを実行してリグレッションがないことを確認する

    • 新しいテストだけでなく、既存テスト全体を実行する
    • lint/type checkも実行する
  2. 必要に応じてコードを整理する

    • テストが全て通った状態でのみリファクタリングする
    • 修正に直接関係する箇所のみ

Phase 5: まとめ

  1. バグの原因と修正内容をサマリーする
    • 根本原因は何だったか
    • どのように修正したか
    • 影響範囲と確認した内容

注意事項

  • 症状的修正を避ける: 「とりあえず動く」修正ではなく根本原因に対処する
  • 既存パターンを尊重する: テスト構造、エラーハンドリング、コーディングスタイルをプロジェクトに合わせる
  • 最小限の変更: バグ修正に直接関係ない変更は別コミットにする
  • debugging.md を参照: 詳細なデバッグ手順は @~/.claude/rules/debugging.md に従う

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Migrate existing ADRs to YAML frontmatter format. Scans docs/decisions/ for ADRs without frontmatter, infers status from body text, shows dry-run for approval. Trigger: /adr-migrate

The English summary is being prepared. Showing the original description.

berlysia/dotfiles9Updated Oct 20, 2026

Start or resume an ADR session. Without number: show status overview and recommend next actionable ADR. With number: provide phase-specific guidance. Trigger: /adr-session, /adr-session NNN, /adr-session new

The English summary is being prepared. Showing the original description.

berlysia/dotfiles9Updated Oct 20, 2026

Analyze a project's harness maturity and guide staged adoption of Harness Engineering best practices (quality loops, safety gates, linters, CLAUDE.md optimization).

The English summary is being prepared. Showing the original description.

berlysia/dotfiles9Updated Oct 20, 2026

Create detailed specifications by iteratively clarifying unclear points for Plan mode. Use when: After completing a plan when detailed requirements need clarification before implementation.

The English summary is being prepared. Showing the original description.

berlysia/dotfiles9Updated Oct 20, 2026

Policy-enforcing installer that deploys hardened Claude Code Action workflows (`@claude` manual mention + dependency-bot auto-fix) into a personal GitHub repository the user administers. Use when asked to introduce Claude Code Action, apply `@claude` mention support, or set up automated CI auto-fix for dependency bot PRs, using the security-hardened templates shipped with this skill.

The English summary is being prepared. Showing the original description.

berlysia/dotfiles9Updated Oct 20, 2026

説明的な文章に緩急を設計するための規範。緩急を装飾ではなく認知モードの切替(観察→逡巡→断定→再観察)と未回収の緊張の管理として扱い、文の拍、段落の密度波形、節の入り方、緩みと駄文の判別、執筆後の機械的な点検手順を定める。読み物として読ませたい章・記事・解説文を生成するとき、または「密度はあるが平坦でおもしろくない」文章を診断・修正するときに使用する。

The English summary is being prepared. Showing the original description.

berlysia/dotfiles9Updated Oct 20, 2026

See all skills by berlysia

Report a problem with this skill