{"meta":{"title":"フローを中断せずに問題を提出する","intro":"何かがタスクの途中で注意を引いたら、Copilot CLIを使用して、コード コンテキスト、リンクされた PR、ラベルに関するGitHubの問題を提出し、実行していた内容に戻ります。","product":"GitHub Copilot","breadcrumbs":[{"href":"/ja/copilot","title":"GitHub Copilot"},{"href":"/ja/copilot/tutorials","title":"チュートリアル"},{"href":"/ja/copilot/tutorials/copilot-cookbook","title":"GitHub Copilot クックブック"},{"href":"/ja/copilot/tutorials/copilot-cookbook/document-code","title":"コードを文書化する"},{"href":"/ja/copilot/tutorials/copilot-cookbook/document-code/filing-issues-without-breaking-your-flow","title":"作業の流れを止めずに問題を報告する"}],"documentType":"article"},"body":"# フローを中断せずに問題を提出する\n\n何かがタスクの途中で注意を引いたら、Copilot CLIを使用して、コード コンテキスト、リンクされた PR、ラベルに関するGitHubの問題を提出し、実行していた内容に戻ります。\n\nCopilot CLIは、ターミナルからGitHubの問題を開くことができます。 ブラウザに切り替えてIssueを手作業で記入する代わりに、必要な内容を伝えるだけで、Copilot がリポジトリと GitHub からコンテキストを収集し、Issue を作成するため、作業を中断せずに続けられます。\n\n## シナリオ例 1: CI エラーからの問題の報告\n\nCI が失敗しているか、運用ログにエラーが見つかった。 スタック トレースを手動でトレースしてコミットに戻すのではなく、問題を調査して提出するように Copilot CLI に依頼します。\n\n### プロンプトの例\n\n```text copy\nThe CI workflow on main has been failing since yesterday. Look at the failing \nrun, figure out what's breaking and which commit likely introduced it, then \ncreate an issue with the stack trace, a link to the failing run, and the \nsuspected PR that caused it. Label it \"bug\" and \"regression\".\n```\n\n### 応答の例\n\n> \\[!NOTE] 次の応答は例です。 Copilot Chat の応答は非決定的であるため、ここで示したものとは異なる応答が返される可能性があります。\n\nCopilot CLI は、GitHub MCP ツールを使用して次の目的で使用します。\n\n1. **失敗したワークフロー実行をフェッチ** し、ログからスタック トレースを抽出します。\n2. **責任あるコード (** たとえば、 `src/services/payment.ts:94`) を特定します。\n3. そのファイルに触れる**最近のコミットを検索**し、変更を導入した PR を見つけます。\n4. すべてのコンテキストが組み立てられた**問題を作成**します。\n\n   ```text\n   Created issue #421: Regression: PaymentService throws TypeError after #398\n\n   What's failing:\n   The `build` job on main has failed since commit `a3f7c21`. Stack trace:\n\n   TypeError: Cannot read properties of undefined (reading 'amount') at processRefund (src/services/payment.ts:94:22)\n\n   Introduced by: PR #398 (merged 2 days ago) refactored the payment types but missed updating `processRefund` to handle the new nullable `transaction` field.\n\n   Failing run: Actions run #2847\n\n   Suggested fix: Add a null check for `transaction` before accessing `transaction.amount` on line 94.\n\n   Labels: `bug`, `regression`\n   ```\n\n## シナリオ例 2: TODO を追跡作業に変換する\n\n時間の経過と共に、TODO コメントと FIXME コメントは、可視性のないコードベースに蓄積されます。 これらのコメントをスキャンし、優先度を評価し、問題を作成して作業を追跡するように Copilot CLI に依頼できます。\n\n### プロンプトの例\n\n```text copy\nScan this repo for TODO and FIXME comments. Group them by area, pick the 5 \nmost important ones based on the surrounding code context, and create an issue \nfor each. Include the code snippet, file location, and suggest a label.\n```\n\n### 応答の例\n\n> \\[!NOTE] 次の応答は例です。 Copilot Chat の応答は非決定的であるため、ここで示したものとは異なる応答が返される可能性があります。\n\nCopilot CLI はコードベースを検索し、各コメントに関するコンテキストを読み取り、重大度に基づいて優先順位を付けます。\n\n```text\nFound 23 TODO/FIXME comments across the repo. Here are the 5 I'd prioritize:\n\nCreated issue #422: FIXME: SQL injection risk in search query builder\n- src/db/search.ts:34 — user input concatenated directly into query string\n- Label: security, priority:high\n\nCreated issue #423: TODO: Rate limiter bypassed for internal routes\n- src/middleware/rate_limit.ts:12 — comment says \"temporary bypass, remove before launch\"\n- Label: security, technical-debt\n\nCreated issue #424: FIXME: Memory leak in WebSocket handler\n- src/ws/handler.ts:87 — listeners are added on each connection but never cleaned up\n- Label: bug, performance\n\nCreated issue #425: TODO: Retry logic missing for payment webhook\n- src/webhooks/payment.ts:56 — failures silently dropped, no retry queue\n- Label: reliability, priority:medium\n\nCreated issue #426: TODO: Migrate to new auth token format\n- src/auth/token.ts:3 — comment references a closing down API version\n- Label: technical-debt\n```\n\n## 詳細については、次を参照してください。\n\n* [GitHub Copilot CLI](/ja/copilot/how-tos/copilot-cli)"}