Plan & Task Persistence
Goal
Claude Code セッション間で計画とタスクの進捗を維持し、コンテキストを失うことなく作業を再開できるようにします。
Execution
計画/タスク作業を Sonnet サブエージェントに委譲し、メインコンテキストの消費を最小限に抑えます。
- ユーザーの入力またはセッションコンテキストから操作モードを決定します
- サブエージェント用の構造化入力フィールドを準備します
- 以下の設定でサブエージェントを起動します:
Agent(
subagent_type: "general-purpose",
model: "sonnet",
description: "plan and task management",
prompt: |
You are a plan and task management agent. Read the procedure file and follow it precisely.
## Operation
{mode}
## Input
### what(事実)
{what}
### why(判断理由)
{why}
### context(背景情報)
{context}
### tags_hint(推奨タグ)
{tags_hint}
## Instructions
1. Read the procedure file at: {plugin_root}/skills/plan-task/procedure.md
2. Execute the procedure section matching the operation mode: {mode}
3. The project root is: {project_root}
4. The tasks directory is: {project_root}/.claude/tasks/
5. For setup, asset files are at: {plugin_root}/skills/plan-task/assets/
6. Return: operation performed, files created/modified, current plan status, and knowledge candidates (if any)
)
プレースホルダーを置き換えます:
{mode}— 以下のいずれか:session-start,create-plan,update-progress,revise-plan,pause,complete{what}— 事実の状況(例:「ユーザーがDocker移行の計画を作成したい」または「3つのタスクが完了、1つのブロッカーが見つかりました」){why}— この操作が今必要な理由(例:「新しいセッションが開始されたため、未完了の作業を確認する必要がある」){context}— 関連する背景情報(現在のブランチ、関連イシュー、最近変更されたファイル、既知のアクティブな計画スラッグ){tags_hint}— 作成される可能性のあるナレッジエントリに推奨されるタグ(特にcompleteモードで重要){plugin_root}— プラグインのインストールパス(スキル読み込みメッセージに「Base directory for this skill」と表示されます){project_root}— プロジェクトの作業ディレクトリ
- サブエージェントの結果をユーザーに報告します(実行した操作、変更したファイル、現在のステータス)
- サブエージェントがナレッジ候補を返した場合(通常は
completeモード)、提供された構造化フィールドを使用して各候補に対してrecord-knowledgeを呼び出します
重要: 手続きファイルのパスはプロジェクトディレクトリではなく、プラグインのベースディレクトリを使用します。スキル読み込みメッセージから「Base directory for this skill」行を読み取り、正しいパスを判断してください。
モード選択ガイド
| ユーザーのシグナル | モード |
|---|---|
| セッション開始直後 / コンパクション後 / 再開 | session-start |
| "plan ...", "let's plan ...", "create a plan for ..." | create-plan |
| "progress update", "update progress", 休憩の合図 | update-progress |
| "revise the plan", "the approach needs to change" | revise-plan |
| "taking a break", "that's it for today", "pausing" | pause |
| "plan is done", "all tasks complete", "wrap up" | complete |