mcpField
G
gitnexus-debugging

gitnexus-debugging

github.com/mindfold-ai開発15.1k86 回インストール6 週間前に更新
リポジトリ

gitnexus-debugging について

gitnexus-debugging は、エラーや予期しない挙動を調査する開発者向けの GitNexus スキルです。コード検索、呼び出し関係の確認、実行フローの追跡を通じて、原因の特定を支援します。

主な機能

  1. 01エラーに関連するコードの検索
  2. 02呼び出し元と呼び出し先の確認
  3. 03実行フローの追跡
  4. 04独自の呼び出しチェーンクエリ
  5. 05変更による回帰の確認

活用シーン

  1. 01エラーメッセージの発生元を追跡
  2. 02500 を返すエンドポイントの調査
  3. 03誤った結果につながるデータフローの確認
  4. 04最近の変更が影響するフローの確認

MCP 対応

このスキルは query、context、cypher、detect_changes などの GitNexus ツールを使い、GitNexus のリポジトリプロセスリソースを読み取ります。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/mindfold-ai/trellis --skill gitnexus-debugging

インストール後、Claude Code で/gitnexus-debuggingを入力して読み込まれたか確認します。

詳細

GitNexus を使用したデバッグ

使用する場面

  • 「この関数が失敗するのはなぜですか?」
  • 「このエラーの発生元を追跡してください」
  • 「このメソッドを呼び出しているのは誰ですか?」
  • 「このエンドポイントが 500 を返します」
  • バグ、エラー、または予期しない動作の調査

ワークフロー

1. query({query: "<error or symptom>"})            → Find related execution flows
2. context({name: "<suspect>"})                    → See callers/callees/processes
3. READ gitnexus://repo/{name}/process/{name}                → Trace execution flow
4. cypher({query: "MATCH path..."})                 → Custom traces if needed

「インデックスが古くなっています」と表示された場合は、ターミナルで node .gitnexus/run.cjs analyze を実行してください。

チェックリスト

- [ ] Understand the symptom (error message, unexpected behavior)
- [ ] query for error text or related code
- [ ] Identify the suspect function from returned processes
- [ ] context to see callers and callees
- [ ] Trace execution flow via process resource if applicable
- [ ] cypher for custom call chain traces if needed
- [ ] Read source files to confirm root cause

デバッグパターン

症状GitNexus のアプローチ
エラーメッセージエラーテキストを query で検索 → throw 箇所で context を実行
戻り値が誤っている関数で context を実行 → 呼び出し先をたどってデータフローを確認
断続的な失敗context を実行 → 外部呼び出しや非同期依存関係を確認
パフォーマンスの問題context を実行 → 呼び出し元が多いシンボル(ホットパス)を特定
最近のリグレッションdetect_changes で変更がどこに影響するか確認

ツール

query — エラーに関連するコードを検索します:

query({query: "payment validation error"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError, PaymentException

context — 疑わしい箇所の全コンテキストを取得します:

context({name: "validatePayment"})
→ Incoming calls: processCheckout, webhookHandler
→ Outgoing calls: verifyCard, fetchRates (external API!)
→ Processes: CheckoutFlow (step 3/7)

cypher — カスタムの呼び出しチェーンを追跡します:

MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
RETURN [n IN nodes(path) | n.name] AS chain

例:「決済エンドポイントが断続的に 500 を返す」

1. query({query: "payment error handling"})
   → Processes: CheckoutFlow, ErrorHandling
   → Symbols: validatePayment, handlePaymentError

2. context({name: "validatePayment"})
   → Outgoing calls: verifyCard, fetchRates (external API!)

3. READ gitnexus://repo/my-app/process/CheckoutFlow
   → Step 3: validatePayment → calls fetchRates (external)

4. Root cause: fetchRates calls external API without proper timeout

コメント