debug について
debug は、ファイルを編集せずに手動テストや実装中の問題を調査するエージェントスキルです。ログ、データベースの状態、Git の履歴、サービスの稼働状況を確認して診断を進めます。
主な機能
- 01アプリケーションログの確認
- 02SQLite データベース状態の確認
- 03Git の変更と履歴の確認
- 04プロセスと待受ポートの確認
- 05根拠に基づく調査結果の整理
活用シーン
- 01手動テスト中に発生したエラーの調査
- 02直近のコード変更後に起きた問題の追跡
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ parcadei/ continuous-claude-v3 --skill debugインストール後、Claude Code で/debugを入力して読み込まれたか確認します。
詳細
デバッグ
手動テスト中や実装中に発生した問題のデバッグを支援します。このコマンドを使うと、ファイルを編集せずにログ、データベースの状態、Git の履歴を調べて問題を調査できます。メインウィンドウのコンテキストを使わずにデバッグセッションを開始する方法として活用してください。
初期応答
プラン/チケットファイルを指定して呼び出した場合:
I'll help debug issues with [file name]. Let me understand the current state.
What specific problem are you encountering?
- What were you trying to test/implement?
- What went wrong?
- Any error messages?
I'll investigate the logs, database, and git state to help figure out what's happening.
パラメーターなしで呼び出した場合:
I'll help debug your current issue.
Please describe what's going wrong:
- What are you working on?
- What specific problem occurred?
- When did it last work?
I can investigate logs, database state, and recent changes to help identify the issue.
環境情報
以下の主な場所やツールを利用できます。
ログ:
- アプリケーションログ(プロジェクト固有の場所を確認してください)
- 一般的な場所:
./logs/、~/.local/share/{app}/、/var/log/
データベース(該当する場合):
- SQLite データベースは
sqlite3でクエリできます - データベースの場所はプロジェクトの設定を確認してください
Git の状態:
- 現在のブランチ、最近のコミット、未コミットの変更を確認します
commitコマンドやdescribe_prコマンドと同様です
サービスの状態:
- 実行中のプロセスを確認します:
ps aux | grep {service} - リッスン中のポートを確認します:
lsof -i :{port}
手順
ステップ 1:問題を把握する
ユーザーが問題を説明した後:
-
提供されたコンテキスト(プランまたはチケットファイル)を読みます:
- 実装/テストしている内容を把握します
- どのフェーズまたはステップにいるか確認します
- 期待される動作と実際の動作を特定します
-
簡単な状態確認:
- 現在の Git ブランチと最近のコミット
- 未コミットの変更
- 問題が発生し始めた時期
ステップ 2:問題を調査する
効率よく調査するため、複数の Task エージェントを並行して起動します。
Task 1 - Check Recent Logs:
Find and analyze the most recent logs for errors:
1. Find latest logs: ls -t ./logs/*.log | head -1 (or project-specific location)
2. Search for errors, warnings, or issues around the problem timeframe
3. Note the working directory if shown
4. Look for stack traces or repeated errors
Return: Key errors/warnings with timestamps
Task 2 - Database State (if applicable):
Check the current database state:
1. Locate database file (check project config)
2. Connect: sqlite3 {database_path}
3. Check schema: .tables and .schema for relevant tables
4. Query recent data based on the issue
5. Look for stuck states or anomalies
Return: Relevant database findings
Task 3 - Git and File State:
Understand what changed recently:
1. Check git status and current branch
2. Look at recent commits: git log --oneline -10
3. Check uncommitted changes: git diff
4. Verify expected files exist
5. Look for any file permission issues
Return: Git state and any file issues
ステップ 3:調査結果を提示する
調査結果に基づき、要点を絞ったデバッグレポートを提示します。
## Debug Report
### What's Wrong
[Clear statement of the issue based on evidence]
### Evidence Found
**From Logs**:
- [Error/warning with timestamp]
- [Pattern or repeated issue]
**From Database** (if applicable):
```sql
-- Relevant query and result
[Finding from database]
Git/ファイルからの情報:
- [関連する可能性のある最近の変更]
- [ファイルの状態に関する問題]
根本原因
[証拠に基づく、最も可能性の高い説明]
次の手順
-
まずこれを試してください:
[Specific command or action] -
解決しない場合:
- 関連するサービスを再起動します
- フロントエンドのエラーがないか、ブラウザーのコンソールを確認します
- デバッグフラグを有効にして実行します
アクセスできない場合
一部の問題は、こちらでは確認できない場合があります:
- ブラウザーのコンソールエラー(ブラウザーで F12)
- MCP サーバーの内部状態
- システムレベルの問題
特定の項目をさらに調査しましょうか?
## Important Notes
- **Focus on manual testing scenarios** - This is for debugging during implementation
- **Always require problem description** - Can't debug without knowing what's wrong
- **Read files completely** - No limit/offset when reading context
- **Think like `commit` or `describe_pr`** - Understand git state and changes
- **Guide back to user** - Some issues (browser console, MCP internals) are outside reach
- **No file editing** - Pure investigation only
## Quick Reference
**Find Latest Logs**:
```bash
ls -t ./logs/*.log | head -1
# Or check project-specific log locations
データベースクエリ(SQLite):
sqlite3 {database_path} ".tables"
sqlite3 {database_path} ".schema {table}"
sqlite3 {database_path} "SELECT * FROM {table} ORDER BY created_at DESC LIMIT 5;"
サービスの確認:
ps aux | grep {service_name}
lsof -i :{port}
Git の状態:
git status
git log --oneline -10
git diff
このコマンドを使うと、メインウィンドウのコンテキストを消費せずに調査できます。手動テスト中に問題が発生し、ログ、データベース、Git の状態を詳しく調べたいときに最適です。
コメント
Markdown 対応