Borrowing it
Nothing to install: this file belongs to Kewton/CommandMate. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Kewton/CommandMate/main/.claude/commands/cause-analysis.mdgit clone --depth 1 https://github.com/Kewton/CommandMateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/kewton/commandmate/cause-analysis)<a href="https://agentmods.dev/commands/kewton/commandmate/cause-analysis"><img src="https://agentmods.dev/badge/commands/kewton/commandmate/cause-analysis/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/kewton/commandmate/cause-analysis"><img src="https://agentmods.dev/badge/commands/kewton/commandmate/cause-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00023 | $0.02118 |
| Opus 5.5 | $0.00009 | $0.00847 |
| Sonnet 5.5 | $0.00005 | $0.00424 |
| Haiku 4.5 | $0.00002 | $0.00212 |
Grade A, and why
cause-analysis 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 1mo ago.
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.
How it starts
The opening of the file, as written. The whole thing — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.
根本原因分析(Cause Analysis)
概要
Issueに記載されている不具合事象を元に、他のコーディングエージェント(commandmatedev経由)を活用して根本原因を深く分析し、原因と対策案をIssue本文に追記します。
使用方法
/cause-analysis [Issue番号]
例:
/cause-analysis 571
/cause-analysis 576
前提条件
- developブランチ上で実行すること
- CommandMateサーバーが稼働していること
- 対象Issueが存在し、事象が記載されていること
- GitHubリポジトリ(https://github.com/Kewton/CommandMate)にアクセス可能
実行内容
あなたはシニアデバッグエンジニアとして、不具合の根本原因を分析します。
重要: commandmatedev で他のコーディングエージェントに分析を委譲する際は、必ず --agent オプションで claude 以外のエージェント(copilot, codex 等)を指定すること。オーケストレーター自身(claude)に送信してはならない。
Step 1: Issue情報の取得
ISSUE_NUM="$ARGUMENTS"
gh issue view "$ISSUE_NUM" --repo Kewton/CommandMate --json number,title,body,labels,comments
Issue本文から以下を抽出:
- 事象の要約
- 再現手順
- 影響範囲
- 関連するソースコード
Step 2: 事前調査(オーケストレーター側)
Issue本文に記載された関連ソースコードを確認し、分析の初期仮説を立てます。
以下の観点で初期仮説を整理:
| 観点 | 内容 |
|---|---|
| 直接原因 | コードのどの部分が事象を引き起こしているか |
| 根本原因の候補 | なぜその状態になるのか(設計問題、仕様漏れ、エッジケース等) |
| 影響パス | データフローのどの経路で問題が発生するか |
Step 3: 他エージェントによる深層分析
commandmatedevを使用して、develop worktreeの別エージェントに根本原因分析を依頼します。
WORKTREE_ID="mycodebranchdesk-develop"
ANALYSIS_PROMPT="Issue #${ISSUE_NUM} の根本原因分析を実施してください。
## Issue内容
$(gh issue view ${ISSUE_NUM} --repo Kewton/CommandMate --json body -q '.body')
## 分析要求
### Phase 1: 事象の再現パス特定
1. Issue記載の再現手順に基づき、コード上の実行パスを特定してください
2. 関連するソースファイルを読み取り、処理フローを追跡してください
3. 事象が発生する条件(トリガー条件)を具体的に特定してください
### Phase 2: 根本原因の特定
以下の観点で根本原因を分析してください:
- **直接原因**: どのコードが事象を直接引き起こしているか(ファイル名:行番号)
- **根本原因**: なぜそのコードがその状態になるのか
- **設計上の問題**: アーキテクチャや設計レベルで改善すべき点があるか
- **類似リスク**: 同じパターンが他の箇所にも存在するか
### Phase 3: 対策案の策定
以下の粒度で対策案を提示してください:
- **即座対策(Quick Fix)**: 最小限の変更で事象を解消する方法
- **恒久対策(Permanent Fix)**: 根本原因を解消する方法
- **予防策(Prevention)**: 再発を防ぐための設計改善・テスト追加"
# 必ず --agent copilot 等でclaude以外のエージェントを指定する
commandmatedev send "$WORKTREE_ID" "$ANALYSIS_PROMPT" --agent copilot --model claude-opus-4.6 --auto-yes --duration 1h
Step 4: 分析結果の待機と取得
commandmatedev wait "$WORKTREE_ID" --timeout 3600 --on-prompt agent
commandmatedev capture "$WORKTREE_ID" --agent copilot
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.
- 1mo ago First seen · 213 lines · 23 tokens per session scan A fcf700db56b5
cause-analysis is a command published in the GitHub repository Kewton/CommandMate (44 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 2,118 once invoked, about $0.0001 per session on Opus 5.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.
Other commands, from other repositories
service-check
Request each agent to run a self-diagnostic to validate their runtime setup.
fix
User-triggered workflow to automatically fix open issues.
bug
Reproduce then TDD-fix a ready-for-agent bug ticket in this checkout. Web bugs get a browser repro first.
errors
Error handling review — silent failure detection, catch block analysis, error logging.
legacy
You MUST start your FIRST response with this exact agent activation line.
bug-blitz
Submit a bug-blitz as one coordinator:bug-blitz Workflow call.