auto-debug

An automated process for finding and fixing failed tests. It determines the project’s test command, runs the tests, investigates failures, and applies corrections in stages.

In plain words
What is it for?
Use it when a project’s tests fail and you need to identify the failing cases, diagnose their causes, and repair the code.
Why use it?
Test failures can be spread across many files, and the correct command or cause may not be obvious. The process organizes the investigation and repeats checks after fixes.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/classmethod/tsumiki/auto-debug
Clone the repo
git clone --depth 1 https://github.com/classmethod/tsumiki
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 11,171 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.11171
Opus 5 $0.00028 $0.05586
Sonnet 5 $0.00011 $0.02234
Haiku 4.5 $0.00006 $0.01117

Measured yesterday against content hash a3d298b8bffd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

auto-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/auto-debug.md · 807 lines

How it starts

The opening of the file, as written. The whole thing — 807 lines — stays where its author put it; the contents beside it link to each section on GitHub.

テストエラーを解消して。

step

step1: 失敗テストの特定

  1. グローバルラウンドカウンタの初期化

    • global_round: 0 — step3→step2の外側ループ回数
    • max_global_round: 3 — 最大ラウンド数
  2. テストコマンドの決定

    • tasknote(./docs/implements/**/note.md)に test_command フィールドがあればそこから読み取り
    • tasknoteにない場合、以下の順序で情報を収集して決定:
      • a. プロジェクトドキュメントの確認(存在するもののみ読み取り):
        • CLAUDE.md — テスト実行方法、開発ルール、プロジェクト固有の指示
        • README.md — プロジェクトのセットアップ手順、テスト実行方法
        • AGENTS.md — エージェント向けの開発ルール、テスト関連の指示
        • これらにテスト実行コマンドの記載があればそれを優先採用
      • b. プロジェクト設定ファイルから自動検出(a で確定しなかった場合):
        • playwright.config.ts / playwright.config.js が存在 → npx playwright test
        • pytest.ini / pyproject.toml[tool.pytest]セクションあり)が存在 → pytest
        • package.jsonscripts.test が定義されている → npm test
        • Makefiletest ターゲットがある → make test
        • いずれにも該当しない → npm test(フォールバック)
    • 検出結果を tasknote に記録(tasknoteが存在する場合)
    • 以降の全ステップで検出したコマンドを {{test_command}} として使用
  3. 全テストケースの確認(簡潔モード)

    timeout 300 {{test_command}} 2>&1
    
    • --verboseは使用しない(成功テストの詳細出力はトークンの無駄)
    • 失敗しているテストファイル名のみをリスト化
    • テストファイルごとにグループ化
    • タイムアウト発生時: /tsumiki:timeout-fix コマンドを subagent(general-purpose)で実行
      • timeout-fix 成功 → テスト再実行
      • timeout-fix 失敗(テスト分離成功) → 分離されたテストをレポートに記載し、残りのテストで続行
      • timeout-fix 失敗(分離も不能) → タイムアウトとしてレポート(step5)に報告し終了
  4. ビルドエラーの判定

    • テスト出力を解析し、以下のパターンを検知:
      • コンパイルエラー(SyntaxError, TypeError at compile time, Cannot find module 等)
      • TypeScript型エラー(TS2xxx系エラー)
      • 依存パッケージ未解決(Module not found, Cannot resolve 等)
    • ビルドエラーの場合:
      • /tsumiki:build-fix コマンドを subagent(general-purpose)で実行(test_command と error_output を渡す)
      • build-fix 成功 → テスト再実行して step1-3 の結果確認に戻る
      • build-fix 失敗 → ビルドエラーとして最終レポート(step5)に報告し終了
    • テストエラーの場合: 通常通りstep2へ進む
  5. 失敗テストをTODOに登録

    • TodoWrite ツールで各失敗テストをTODO項目として登録
    • 優先度を設定(重要度: 高/中/低)
    • メタデータに以下を含める:
      • retry_count: 0 - リトライ回数の初期値
      • max_retry: 3 - 最大リトライ回数
      • status: pending - 処理状態(pending/in_progress/resolved/on_hold)

Read the full file on GitHub · 807 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 807 lines · 56 tokens per session scan A a3d298b8bffd

Subscribe to this mod's changes

auto-debug is a command published in the GitHub repository classmethod/tsumiki (974 stars, last pushed 25d ago), licensed MIT. It adds 56 tokens to every session and 11,171 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.