build-fix

A command workflow for investigating and fixing build failures, including compilation errors, type errors, and missing dependencies.

In plain words
What is it for?
Use it to inspect project instructions, run the test or build command, classify the failure, locate the source, and apply a fix.
Why use it?
It turns an error message into a diagnosis and retryable repair process instead of requiring manual troubleshooting from scratch.

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/build-fix
Clone the repo
git clone --depth 1 https://github.com/classmethod/tsumiki
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,296 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.00060 $0.01296
Opus 5 $0.00030 $0.00648
Sonnet 5 $0.00012 $0.00259
Haiku 4.5 $0.00006 $0.00130

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

Security

Grade A, and why

build-fix 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/build-fix.md · 117 lines

How it starts

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

ビルドエラーを解消して。

context

test_command: {{test_command}} (テスト実行コマンド。未指定の場合は npm test)
error_output: {{error_output}} (ビルドエラーの出力内容)
max_retry: 3 (最大リトライ回数)
retry_count: 0 (現在のリトライ回数)

step

step0: プロジェクトコンテキストの確認

以下のファイルが存在する場合は読み取り、テスト実行方法や開発ルールを把握する:

  • CLAUDE.md — テスト実行方法、プロジェクト固有の指示
  • README.md — セットアップ手順、ビルド方法
  • AGENTS.md — エージェント向けの開発ルール

test_command が未指定の場合は、これらの情報から適切なテストコマンドを決定する。

step1: ビルドエラーの分析

  1. エラー出力の取得

    • error_output が提供されている場合はそれを使用
    • 提供されていない場合は以下を実行:
      {{test_command}} 2>&1
      
  2. エラー種別の特定

    • Task tool (subagent_type: Explore, thoroughness: medium) を使用
    • 以下のエラー分類に従って分析:
      • 構文エラー: SyntaxError, Unexpected token 等
      • 型エラー: TS2xxx系エラー, TypeError at compile time 等
      • 依存パッケージ未解決: Cannot find module, Module not found, Cannot resolve 等
      • 設定ファイル不備: 設定ファイルの構文エラー, 未定義のプロパティ参照 等
    • エラー箇所(ファイル名、行番号)を特定
    • 修正方針を決定

step2: 自動修正の試行

エラー種別に応じた修正を実施:

  1. 依存パッケージ未解決の場合

    • package.json / requirements.txt 等を確認
    • 不足パッケージを特定
    npm install {{missing_package}}
    
    • または npm ci(lockfileとの不整合の場合)
  2. import文エラーの場合

    • 正しいモジュールパスを探索(Explore quick)
    • import文を修正(Edit tool)
  3. 型エラーの場合

    • 型定義ファイルの不足: npm install -D @types/{{package}}
    • 型注釈の誤り: コード修正(Edit tool)
    • tsconfig.json の設定不備: 設定修正
  4. 構文エラーの場合

    • エラー箇所のコードを読み取り(Read tool)
    • 構文エラーを修正(Edit tool)
  5. 設定ファイル不備の場合

    • 設定ファイルの構文チェック
    • 不足プロパティの追加、誤記の修正

step3: ビルド再実行による確認

  1. テスト(ビルド)を再実行

    {{test_command}} 2>&1
    
  2. 結果判定

    • ビルド成功(テスト実行段階まで到達): 修正完了。修正内容を報告して終了
    • 別のビルドエラーが発生: retry_count < max_retry なら step1 に戻る
    • 同じビルドエラーが継続: retry_count < max_retry なら別のアプローチで step2 を再試行
    • retry_count >= max_retry: 修正不能としてレポートを出力して終了

step4: 結果レポート

# build-fix 結果レポート

## 結果: [成功 / 部分成功 / 失敗]

## 修正内容
(修正した場合のみ)
- エラー種別: [構文エラー / 型エラー / 依存パッケージ / 設定不備]
- 修正ファイル: [ファイルパス]
- 修正内容: [具体的な変更内容]
- リトライ回数: X/3

## 未解決のエラー
(修正できなかった場合のみ)
- エラー内容: [エラーメッセージ]
- 試行した修正: [各試行の内容]
- 推奨対応: [手動での修正が必要な理由と方針]

Read the full file on GitHub · 117 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 · 117 lines · 60 tokens per session scan A 19f44b6d578c

Subscribe to this mod's changes

build-fix is a command published in the GitHub repository classmethod/tsumiki (974 stars, last pushed 25d ago), licensed MIT. It adds 60 tokens to every session and 1,296 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.