ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 KilimcininKorOglu

bughunt

/bughunt: を使用して証明主導のバグ ハント ラウンドを実行し、各ラウンドで失敗したコマンドで one のバグを証明します。MOD 自体が実行され、修正され、修正が証明され、ブロックされたラウンドまたは未検証のラウンドでループが停止します。 /bughunt コラボは、読み取り専用スキャナ、プランナー、批評家を順番に実行します。

KilimcininKorOglu@KilimcininKorOglu

KilimcininKorOglu/claude-code-mods/tree/main/plugins/bughunt

翻訳済み

この mod について

#バグハント

バグ ハント プロンプトは、バグを修正する前にバグを証明するようにモデルに指示します。多くの場合、モデルは最初に修正を記述し、その後にテストをパスします。この MOD はラウンドに分けて狩りを実行し、各ラウンドでその証拠を保持します。モデルは証明コマンドを記述し、MOD はそれ自体を実行します。そして、証明が FAIL 行で非 zero を終了するまで、製品コードは変更されません。このラウンドは、同じコマンドが PASS 行で 0 を終了した場合にのみ修正済みとしてカウントされ、MOD が修正を一時的に元に戻すと再び失敗します。ループは各ラウンドの結果を読み取り、次の one を開始するのではなく、ブロックされたラウンドまたは未検証のラウンドで停止します。

/bughunt collab <paths> は 2 番目の読み取り専用モードです。スキャナ、プランナー、および批評家のサブエージェントが順番にパスをレビューし、レポートには調査結果、計画、批評家の評決が含まれます。

何をするのか

ラウンド

1。 /bughunt [--rounds N] [target] は、ターゲットまたはプロジェクト全体にわたって 1 ラウンドから 25 ラウンドへのハントを開始します。 --rounds は引数のどこにでも立つことができます。ハントはセッションのどの時点でも始まります。 2。 MOD は各ラウンドをプロンプトとして送信します: ラウンド番号、スコープ、ラウンドのプルーフ ディレクトリ (.temp_files/bughunt/<round>/)、以前のラウンドのフィンガープリント、およびプロトコル。モデルは最初に、完全なルールを保持する bughunt:hunt スキルを開きます。ラウンドの実行中、MOD はラウンドのブロックをスキルのテキストに追加します。 3。ラウンドの実行中:

  • ラウンドでスキルがオープンになるまで、編集、書き込み、ノートブック編集は停止します。
  • プルーフ ディレクトリの外での編集は、MOD が FAIL を記録するまで停止します。
  • ターゲットがある場合、その外側の編集も FAIL の後に停止します。テスト ファイル (tests/、__tests__/、*.test.*、*.spec.*、*_test.*、test_*.py) が合格したため、回帰テストをスイートに入れることができます。
  • すべてのサブエージェントの出現が停止します。one 会話でラウンドが実行されます。 4。モデルは phase: "before" と証明コマンドの argv を使用して mcp__bughunt__proof を呼び出します。この MOD はコマンドを実行し (最大で 5 分)、非 zero を終了して FAIL で始まる行を出力する場合にのみ FAIL を記録します。そのような行が出力されないセットアップまたはインポート エラーは拒否されます。修正後、同じ argv を持つ phase: "after" がコマンドを再度実行するため、0 を終了し、PASS で始まる行が必要になります。モデルは、終了コード、出力の最後の 20 行、およびその理由を読み取ります。5。 PASS を記録する前に、MOD はプルーフが修正に達していることを確認します。 FAIL が記録されると、作業ツリー (スタッシュ エントリを追加しない git stash create、またはクリーン ツリー上の HEAD) のスナップショットが作成されました。受け入れられた PASS の実行後、そのスナップショット (git diff --diff-filter=M) 以降に変更されたファイルがリストされ、プルーフ ディレクトリとテスト ファイルが除外され、それらが作業ツリーのスナップショットに復元されます (git restore --source、インデックスは元のままです)。もう一度証明を実行してから、修正を元に戻します。 PASS は、元に戻された実行が FAIL 行で非 zero を終了した場合にのみカウントされます。それ以外の場合、呼び出しは拒否され、モデルは証明を修正して再度呼び出しを行うことができます。モデルはそれぞれのケースで理由を読み取ります。
  • 証明は修正を元に戻して合格するため、修正されたコードには到達しません。
  • FAIL 以降、本番ファイルは変更されていません。
  • ディレクトリは git リポジトリではありません。
  • git コマンドが失敗しました。

修正が元に戻されている間、MOD は $.store に記録を保持します。クラッシュによってチェックが短くなった場合、元に戻されたファイルがまだ変更されていない場合、同じディレクトリ内の次のセッションで修正が元に戻されます。それ以降に変更された場合は、上書きされず、修正を戻す git restore コマンドが通知されます。 6。ラウンドのターンが終了すると、MOD は答えの結果行、つまり結果ラベルで始まる最初の行を読み取るため、その前の文によって隠蔽されません。

  • fixed-and-verified は、MOD がラウンド中に FAIL を記録し、次に /bughunt [--rounds N] [target] start a hunt of N rounds (1 by default, 25 at most) /bughunt collab <paths> a read-only scanner, planner and critic review /bughunt stop end the running hunt /bughunt status on or off, and the running round /bughunt on | off on by default; off starts nothing and holds no edit Q を記録した場合にのみ継続します。そうしないと狩猟が停止します。
  • no-proven-bug が続きます。
  • blocked、fixed-verification-incomplete、結果行なし、割り込みまたは API エラーによりハントが停止します。
  • 最終ラウンドの後、狩りは終了します。

各回答の fingerprint: 行は次のラウンドのプロンプトに含まれるため、同じ根本原因が 2 回カウントされることはありません。 7。自分でプロンプトを作成すると、探索は終了します。 /bughunt コマンドは行いません。

コラボ

1。 /bughunt collab <paths>、またはモデルの mcp__bughunt__collab ツールは、three サブエージェントを順番に開始します。これらは MOD 独自のエージェント タイプ (bughunt:scanner、bughunt:planner、bughunt:critic) であり、モデルのエージェント リストからは隠されており、それぞれ読み取り可能です: Read、Grep、Glob。 2。スキャナーは、各検出結果を mcp__bughunt__found (ファイル、行、重大度、説明、オプションの修正) で一度に報告します。 MOD はフィールドをチェックし、結果を保持します。実行中のスキャナのみがツールを呼び出すことができます。 3。プランナーは結果とスキャナーのレポートを受け取り、修正計画を作成します。批評家は調査結果と計画を受け取り、verdict: approve、revise、または reject で答えを始めます。4。各ステップには時間制限があります (スキャナー 10, プランナー ❯ ./register.ts hooks: session.start, command.run{command=bughunt}, agent.offer{agent=/"^bughunt:(scanner|planner|critic)$"/}, tool.describe{tool=/"^mcp__bughunt__(proof|found|collab)$"/}, tool.call{tool=/"^mcp__bughunt__proof$"/}, tool.call{tool=/"^mcp__bughunt__found$"/}, tool.call{tool=/"^mcp__bughunt__collab$"/}, prompt.submit, skill.prompt{skill=bughunt:hunt}, tool.call{tool=Skill}, tool.call{tool=Edit}, tool.call{tool=Write}, tool.call{tool=NotebookEdit}, agent.spawn, turn.complete ❯ ./register.ts calls: $.agent.register (via declare), $.agent.spawn (via portsOf), $.clock.after (via portsOf, send), $.command.register (via declare), $.command.run (via send), $.process.run (via git, recoverFix, runProof), $.prompt.submit (via send), $.sidebar.clear (via show), $.sidebar.set (via show, toPerson), $.store.delete (via putBack, recoverFix), $.store.get (via readSettings, recoverFix), $.store.set (via revertCheck, setEnabled), $.tool.register (via declare), $.ui.log (via launchCollab, send, toPerson) Q 批評家 6 分)。不足したステップはレポート内で timed-out という名前が付けられ、その前にスキャナーが送信した検出結果はレポートに残ります。 5。批評家が評決の線を示さない場合、評決は no-verdict となり、決して approve にはなりません。 6。スキャナーが開始されると、コマンドとツールが戻ります。レポートは後で one メッセージとして到着し、モデルはそれを読み取り専用レビューとして読み取ります。ステップのハンドバック メッセージは MOD によって取得されて削除されるため、独自のターンは開始されません。 7。ラウンドの実行中はコラボは開始されません。

あなたが見ているもの

サイドバー には、ラウンド、スキルが公開されているかどうか、証明の状態、および終了した各ラウンドの結果とフィンガープリントという、常設の bughunt セクションが表示されます。停止した編集、証明結果、およびハントの終了はサイドバー ストリームに送られます。サイドバーがなければ、それぞれは bughunt: edit stopped (proof): src/a.ts などの one 転写行です。

コマンド

/bughunt [--rounds N] [target]    start a hunt of N rounds (1 by default, 25 at most)
/bughunt collab <paths>           a read-only scanner, planner and critic review
/bughunt stop                     end the running hunt
/bughunt status                   on or off, and the running round
/bughunt on | off                 on by default; off starts nothing and holds no edit

インストール

claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install bughunt@kilimcininkoroglu-mods

関数フックは早期アクセスです。Claude 2.1.288 をコード化し、後でデフォルトでロードするため、オンにするものは何もありません。

インストール後

1。Claude Codeを再起動します。 2。コマンドラインからテストを実行できるリポジトリで /bughunt を実行します。 proof コマンドはユーザーの権限で実行されるため、モデルが提案する内容を読んでください。

到達できるもの

Claude Code 2.1.284 の claude plugin validate で検証済み:

❯ ./register.ts hooks: session.start, command.run{command=bughunt}, agent.offer{agent=/"^bughunt:(scanner|planner|critic)$"/}, tool.describe{tool=/"^mcp__bughunt__(proof|found|collab)$"/}, tool.call{tool=/"^mcp__bughunt__proof$"/}, tool.call{tool=/"^mcp__bughunt__found$"/}, tool.call{tool=/"^mcp__bughunt__collab$"/}, prompt.submit, skill.prompt{skill=bughunt:hunt}, tool.call{tool=Skill}, tool.call{tool=Edit}, tool.call{tool=Write}, tool.call{tool=NotebookEdit}, agent.spawn, turn.complete
❯ ./register.ts calls: $.agent.register (via declare), $.agent.spawn (via portsOf), $.clock.after (via portsOf, send), $.command.register (via declare), $.command.run (via send), $.process.run (via git, recoverFix, runProof), $.prompt.submit (via send), $.sidebar.clear (via show), $.sidebar.set (via show, toPerson), $.store.delete (via putBack, recoverFix), $.store.get (via readSettings, recoverFix), $.store.set (via revertCheck, setEnabled), $.tool.register (via declare), $.ui.log (via launchCollab, send, toPerson)

L2 に到達すると、モデル名の証明コマンドが実行されます。

1. Reads:    the path of each Edit, Write and NotebookEdit call; your prompts, only to see whether you wrote one; each round's final answer; the collab subagents' answers
2. Runs:     the proof command the model passes to mcp__bughunt__proof, as argv without a shell, in the working directory or the cwd it names, for 5 minutes at most, a second time with the fix reverted; git stash create, rev-parse, diff and restore --worktree in the working directory for that check; three read-only subagents for a collab
3. Sends:    each round's prompt and each collab report to the model as a message, a deny text for a stopped edit or spawn, the round's block after the skill's text, sidebar sections and lines or transcript lines to you; nothing leaves the machine
4. Persists: in $.store, the on/off setting, and while a revert check runs the snapshot that holds the fix and the reverted files; the hunt itself lives in memory and ends with the session
5. Hostile input: the proof command is the model's and runs with your permissions, as a Bash call would, but without a shell; a finding's fields are checked before they are kept

制限

  • ゲートには Edit、Write、NotebookEdit と表示されます。 Bash を通じて変更されたファイル (sed -i、リダイレクト、スクリプト) は保持されません。
  • 元に戻すチェックでは、証明が修正によって変更されたファイルに依存していることが示されます。証明が正しい動作を主張しているかどうかを判断することはできません。
  • 元に戻すチェックでは、修正によって変更された追跡ファイルのみが元に戻されます。ファイルを追加するだけの修正には元に戻すものが何もないため、その claude plugin marketplace add KilimcininKorOglu/claude-code-mods claude plugin install bughunt@kilimcininkoroglu-mods Q は拒否されます。 git リポジトリの外では、PASS は記録されません。
  • チェックの実行中 (最大で one 以上のプルーフ実行)、修正されたファイルには古いコードが保持されます。そのウィンドウでそれらを読み取る別のプロセスはバグを認識します。
  • MOD は、モデルがスキルを読み取ったことではなく、スキルが提供されたことを測定します。
  • 時間切れになったコラボ ステップは、終了するまでバックグラウンドで実行され続けます。 MOD はもうそれを待ちません。- テスト エンジンはサブエージェントを開始できないため、コラボ待機 (ハンドバック、早期応答、時間制限、失敗終了) は pipeline.ts で偽のエンジン呼び出しを使用してテストされ、実行全体がライブでチェックされます。 2.1.284 でのライブ: two ラウンドのハントは FAIL の後に PASS を記録し、指紋をラウンド 2 に運び、そこで終了しました。共同研究者はスキャナーの発見結果を保管し、批評家の評決を読みましたが、three の差し戻しは始まりませんでした。元に戻した実行が失敗した後、Git リポジトリ内のラウンドで PASS が記録され、その後修正が元の位置に戻り、git stash list は空のままでした。
  • ラウンドゲートのバイパスはありません。 /bughunt stop はハントを終了し、/bughunt off は MOD をオフにします。

開発

make install     # eslint, typescript-eslint, typescript
make lint        # complexity limit 10, the build fails above it
make typecheck   # needs .claude/types/ from /plugin-types
make validate
make test        # claude plugin test

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install bughunt
原文 / README

bughunt

A bug hunt prompt tells the model to prove a bug before it fixes it, and the model often writes the fix first and a test that passes after. This mod runs the hunt in rounds and holds each round to its proof. The model writes a proof command, the mod runs it itself, and production code stays unchanged until the proof exits non-zero with a FAIL line. The round counts as fixed only when the same command then exits 0 with a PASS line, and fails again once the mod reverts the fix for a moment. The loop reads each round's outcome and stops at a blocked or unverified round instead of starting the next one.

/bughunt collab <paths> is a second, read-only mode: a scanner, a planner and a critic subagent review the paths in turn, and the report carries the findings, the plan and the critic's verdict.

What it does

Rounds

  1. /bughunt [--rounds N] [target] starts a hunt of 1 to 25 rounds over the target, or over the whole project. --rounds may stand anywhere among the arguments. The hunt starts at any point of the session.

  2. The mod sends each round as a prompt: the round number, the scope, the round's proof directory (.temp_files/bughunt/<round>/), the fingerprints of the earlier rounds and the protocol. The model first opens the bughunt:hunt skill, which holds the full rules; while a round runs, the mod appends the round's block to the skill's text.

  3. While a round runs:

    • Edit, Write and NotebookEdit stop until the skill is open in the round.
    • An edit outside the proof directory stops until the mod recorded a FAIL.
    • With a target, an edit outside it stops after the FAIL too. A test file (tests/, __tests__/, *.test.*, *.spec.*, *_test.*, test_*.py) passes, so the regression test can go into the suite.
    • Every subagent spawn stops: a round runs in one conversation.
  4. The model calls mcp__bughunt__proof with phase: "before" and the proof command's argv. The mod runs the command (5 minutes at most) and records FAIL only when it exits non-zero and prints a line that starts with FAIL. A setup or import error that prints no such line is rejected. After the fix, phase: "after" with the same argv runs the command again and needs exit 0 and a line that starts with PASS. The model reads the exit code, the last 20 lines of output and the reason.

  5. Before it records the PASS, the mod checks that the proof reaches the fix. When the FAIL was recorded, it took a snapshot of the working tree (git stash create, which adds no stash entry, or HEAD on a clean tree). After an accepted PASS run it lists the files modified since that snapshot (git diff --diff-filter=M), leaves out the proof directory and test files, and restores them to the snapshot in the working tree (git restore --source, the index stays as it was). It runs the proof again and then puts the fix back. The PASS counts only when that reverted run exits non-zero with a FAIL line. Otherwise the call is rejected and the model can fix the proof and call again. The model reads the reason in each case:

    • the proof passes with the fix reverted, so it does not reach the fixed code;
    • no production file was modified since the FAIL;
    • the directory is not a git repository;
    • a git command failed.

    While the fix is reverted, the mod keeps a record in $.store. When a crash cuts the check short, the next session in the same directory puts the fix back, if the reverted files are still unchanged. If they changed since, it does not overwrite them and tells you the git restore command that brings the fix back.

  6. When the round's turn ends, the mod reads the answer's outcome line: the first line that begins with an outcome label, so a sentence before it does not hide it:

    • fixed-and-verified goes on only when the mod recorded FAIL then PASS in the round; otherwise the hunt stops.
    • no-proven-bug goes on.
    • blocked, fixed-verification-incomplete, no outcome line, an interrupt or an API error stop the hunt.
    • After the last round the hunt ends.

    The fingerprint: line of each answer goes into the next rounds' prompts, so the same root cause is not counted twice.

  7. A prompt you write yourself ends the hunt; /bughunt commands do not.

Collab

  1. /bughunt collab <paths>, or the model's mcp__bughunt__collab tool, starts three subagents in turn. They are the mod's own agent types (bughunt:scanner, bughunt:planner, bughunt:critic), hidden from the model's agent list, and each can only read: Read, Grep, Glob.
  2. The scanner reports each finding at once with mcp__bughunt__found (file, line, severity, description, optional fix). The mod checks the fields and keeps the finding. Only the running scanner may call the tool.
  3. The planner receives the findings and the scanner's report, and writes a fix plan. The critic receives the findings and the plan, and begins its answer with verdict: approve, revise or reject.
  4. Each step has a time limit (scanner 10, planner 8, critic 6 minutes). A step that runs out is named in the report as timed-out, and the findings the scanner sent before that stay in the report.
  5. When the critic gives no verdict line, the verdict is no-verdict, never approve.
  6. The command and the tool return once the scanner started; the report arrives later as one message, and the model reads it as a read-only review. A step's hand-back message is taken by the mod and dropped, so it does not start a turn of its own.
  7. A collab does not start while a round runs.

What you see

The sidebar shows a standing bughunt section: the round, whether the skill is open, the proof state and each finished round's outcome and fingerprint. Stopped edits, proof results and the hunt's end go to the sidebar stream. Without the sidebar, each of them is one transcript line such as bughunt: edit stopped (proof): src/a.ts.

Command

/bughunt [--rounds N] [target]    start a hunt of N rounds (1 by default, 25 at most)
/bughunt collab <paths>           a read-only scanner, planner and critic review
/bughunt stop                     end the running hunt
/bughunt status                   on or off, and the running round
/bughunt on | off                 on by default; off starts nothing and holds no edit

Install

claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install bughunt@kilimcininkoroglu-mods

Function hooks are early access. Claude Code 2.1.288 and later load them by default, so there is nothing to switch on.

After installing

  1. Restart Claude Code.
  2. Run /bughunt in a repository whose tests you can run from the command line. The proof command runs with your permissions, so read what the model proposes.

What it can reach

Validated with claude plugin validate on Claude Code 2.1.284:

❯ ./register.ts hooks: session.start, command.run{command=bughunt}, agent.offer{agent=/"^bughunt:(scanner|planner|critic)$"/}, tool.describe{tool=/"^mcp__bughunt__(proof|found|collab)$"/}, tool.call{tool=/"^mcp__bughunt__proof$"/}, tool.call{tool=/"^mcp__bughunt__found$"/}, tool.call{tool=/"^mcp__bughunt__collab$"/}, prompt.submit, skill.prompt{skill=bughunt:hunt}, tool.call{tool=Skill}, tool.call{tool=Edit}, tool.call{tool=Write}, tool.call{tool=NotebookEdit}, agent.spawn, turn.complete
❯ ./register.ts calls: $.agent.register (via declare), $.agent.spawn (via portsOf), $.clock.after (via portsOf, send), $.command.register (via declare), $.command.run (via send), $.process.run (via git, recoverFix, runProof), $.prompt.submit (via send), $.sidebar.clear (via show), $.sidebar.set (via show, toPerson), $.store.delete (via putBack, recoverFix), $.store.get (via readSettings, recoverFix), $.store.set (via revertCheck, setEnabled), $.tool.register (via declare), $.ui.log (via launchCollab, send, toPerson)

Reach L2, it runs the proof command the model names.

1. Reads:    the path of each Edit, Write and NotebookEdit call; your prompts, only to see whether you wrote one; each round's final answer; the collab subagents' answers
2. Runs:     the proof command the model passes to mcp__bughunt__proof, as argv without a shell, in the working directory or the cwd it names, for 5 minutes at most, a second time with the fix reverted; git stash create, rev-parse, diff and restore --worktree in the working directory for that check; three read-only subagents for a collab
3. Sends:    each round's prompt and each collab report to the model as a message, a deny text for a stopped edit or spawn, the round's block after the skill's text, sidebar sections and lines or transcript lines to you; nothing leaves the machine
4. Persists: in $.store, the on/off setting, and while a revert check runs the snapshot that holds the fix and the reverted files; the hunt itself lives in memory and ends with the session
5. Hostile input: the proof command is the model's and runs with your permissions, as a Bash call would, but without a shell; a finding's fields are checked before they are kept

Limits

  • The gate reads Edit, Write and NotebookEdit. A file changed through Bash (sed -i, a redirect, a script) is not held.
  • The revert check shows that the proof depends on the files the fix modified. It cannot tell whether the proof asserts the right behaviour.
  • The revert check reverts only tracked files the fix modified. A fix that only adds files has nothing to revert, so its PASS is rejected. Outside a git repository, no PASS is recorded.
  • While the check runs (at most one more proof run), the fixed files hold the old code. Another process that reads them in that window sees the bug.
  • The mod measures that the skill was delivered, not that the model read it.
  • A collab step that runs out of time keeps running in the background until it ends; the mod no longer waits for it.
  • The test engine cannot start a subagent, so the collab waits (hand-back, early answer, time limit, failed end) are tested in pipeline.ts with fake engine calls, and the whole run is checked live. Live on 2.1.284: a two-round hunt recorded FAIL then PASS, carried the fingerprint into round 2 and ended there; a collab kept the scanner's finding, read the critic's verdict, and its three hand-backs started no turn. A round in a git repository recorded PASS after the reverted run failed, the fix was back in place afterwards, and git stash list stayed empty.
  • There is no bypass of a round's gates. /bughunt stop ends the hunt, and /bughunt off turns the mod off.

Development

make install     # eslint, typescript-eslint, typescript
make lint        # complexity limit 10, the build fails above it
make typecheck   # needs .claude/types/ from /plugin-types
make validate
make test        # claude plugin test

関連作品