AgentPM について
AgentPM は、AI を活用したソフトウェア開発の計画と進行管理を行うシステムで、MCP サーバーとしてローカルに導入します。Cursor、VS Code Copilot、Cline などの IDE で作業する開発者を対象に、要件整理、タスク分解、実装支援を担います。
主な機能
- 01構造化されたインタビューによる要件整理
- 02依存関係と優先度を持つタスク分解
- 03タスクの検索、ステータス更新、サブタスク管理
- 04Context7 連携によるドキュメント取得
- 05Markdown 形式のプロジェクト文書生成
活用シーン
- 01ゼロから始める新規プロジェクトの要件定義と計画
- 02IDE 上で次に取り組むタスクの選定
- 03実装の進行に合わせた後続タスクの更新
MCP 対応
AgentPM は MCP サーバーとして、apm_task や apm_task_modify などのタスク管理ツールを MCP 対応の IDE やコーディングエージェントに提供します。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
ツール
10掲載時のツール一覧 · 3 週間前に更新
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
| action | enum | はい | 実行する具体的な操作:get_all、get_single、get_next、filter_by_status、filter_by_priorityget_all | get_single | get_next | filter_by_status | filter_by_priority |
| projectRoot | string | いいえ | プロジェクトのディレクトリ。PROJECT_ROOT 環境変数で設定できます。 |
| file | string | いいえ | タスクファイルのパス(プロジェクトルートからの相対パスまたは絶対パス) |
| id | string | いいえ | タスク ID(get_single 操作で必須) |
| status | enum | いいえ | ステータスでタスクを絞り込みます(get_all および filter_by_status 操作で使用)pending | in-progress | done | deferred | cancelled | |
| priority | enum | いいえ | 優先度でタスクを絞り込みます(get_next および filter_by_priority 操作で使用)high | medium | low |
| withSubtasks | boolean | いいえ | 応答にサブタスクを含めます |
| containsText | string | いいえ | 指定したテキストを含むタスクを絞り込みます(get_next 操作で使用) |
詳細
AgentPM
AgentPM は、AI 駆動のソフトウェア開発のための計画・オーケストレーションシステムです。MCP サーバーとしてローカルにインストールされ、Anthropic の Model Context Protocol 仕様をサポートするあらゆる IDE(Cursor、Augment、VS Code Copilot、Cline、Roo など)と統合されます。
AgentPM はプロダクトマネージャーの役割を担い、開発者が複雑なプロジェクトを計画し、優先順位を付け、実行するのを支援します:
- 包括的な要件を策定します
- 複雑なプロジェクトを、明確な依存関係を持つ実行可能なタスクに分解します
- コンテキストを考慮した支援により実装をオーケストレーションします
- 必要なときに適切なドキュメントとコンテキストを提供します
- 技術的な意思決定とシステム設計を導きます
- ソフトウェア開発のベストプラクティス(TDD、バーティカルスライシング)を推進します
https://github.com/user-attachments/assets/6ddb551c-0c10-4a93-8665-fc5c1e3127c1
なぜ AgentPM なのか?
-
摩擦のないセットアップ: コーディングエージェントとチャットするだけで始められます - CLI や複雑なルールは必要ありません。
-
トークン/コンテキストの最適化: コンテキスト的に経済的で、コーディングエージェントが使いやすく理解しやすい、動的なコアツール群を中心に機能を集約します。
-
インテリジェントなコンテキスト管理: 適切な情報を適切なタイミングでコーディングエージェントに提供し、トークンの使用を最適化するとともに、手動でのコンテキスト処理や「メモリバンク」の必要性を排除します。
-
構造化された出力: 明確で人間が読める Markdown ドキュメントを自動生成します。JSON やプレーンテキストのファイルを解読する必要はありません。
-
統合されたドキュメント取得: Context7 連携を通じて、関連するドキュメントを自動的に取得します。
-
包括的なタスク管理: 適切な依存関係、優先度、実装の詳細、ステータス追跡を備えた、よく構造化されたタスクを作成します。複雑な作業は、明確な関係を持つ管理しやすいサブタスクに分解できます。
-
柔軟な要件プロセス: 既存のドキュメントがあってもなくても機能し、ゼロから始める場合は構造化されたインタビューを通じて導き、既存のプロジェクトや計画にも簡単に適応します。
-
AI による生成: IDE のコーディングモデルに関係なく、一貫したタスク生成のために Claude Sonnet 3.7 を活用し、リサーチに基づく結果を得るためのオプションの Perplexity API 連携を備えています。
-
適応的なプロジェクトの進化: 完了した作業に基づいて今後のタスクを更新し、実装のずれに対応するとともに、プロジェクトとともに進化する生きたドキュメントを維持します。
-
ベストプラクティスを標準搭載: コード品質を向上させる、意見を明確にした推奨事項とともに、ソフトウェア開発のベストプラクティスを取り入れています。
-
シームレスな IDE 統合: Model Context Protocol のサポートを通じて、お好みの開発環境内で直接動作します。
はじめに
前提条件
- Node.js: バージョン 20.0.0 以上
- Anthropic API キー: Claude AI 連携用
- Perplexity API キー: リサーチに基づくタスク生成用
インストールと設定
Cursor
プロジェクトの .cursor/mcp.json ファイルに以下を追加します(または ~/.cursor/mcp.json にグローバルインストールします)。
{
"mcpServers": {
"agent-pm": {
"command": "npx",
"args": [
"-y",
"@gannonh/agent-pm@latest"
],
"env": {
"PROJECT_ROOT": "/path/to/project/root/",
"ANTHROPIC_API_KEY": "sk-your-anthropic-api-key",
"PERPLEXITY_API_KEY": "pplx-your-perplexity-api-key"
}
}
}
}
Augment
VS-Code の Augment ユーザー設定ファイル(CMD+SHIFT+P > Augment: Edit Settings > Edit in settings.json)に以下を追加します:~/Library/Application Support/Code/User/settings.json。
"augment.advanced": {
"mcpServers": [
{
"name": "agent-pm",
"command": "npx",
"args": [
"-y",
"@gannonh/agent-pm@latest"
],
"env": {
"PROJECT_ROOT": "/path/to/project/root/",
"ANTHROPIC_API_KEY": "sk-your-anthropic-api-key",
"PERPLEXITY_API_KEY": "pplx-your-perplexity-api-key"
},
]
}
MCP サーバーの設定について詳しくは、お使いの IDE のドキュメントを参照してください:
- Cursor MCP Server Docs
- Augment MCP Server Docs
- VS Code Copilot MCP Server Docs
- Cline MCP Server Docs
環境変数
⚠️ 警告: ほとんどの設定オプションは、最適な結果が得られるように慎重に調整されています。特別な要件がない限り、必須変数のみを設定し、その他はデフォルト値のままにすることをお勧めします。
必須変数
| 変数 | 説明 | デフォルト |
|---|---|---|
PROJECT_ROOT | プロジェクトディレクトリへのパス | カレントディレクトリ |
ANTHROPIC_API_KEY | Claude AI 統合用の API キー | なし |
一般的なオプション変数
| 変数 | 説明 | デフォルト |
|---|---|---|
PERPLEXITY_API_KEY | Perplexity AI 統合用の API キー | なし |
DEBUG_LOGS | ファイルログを伴うデバッグモードを有効化 | false |
詳細設定 (変更は推奨されません)
Anthropic API 設定
| 変数 | 説明 | デフォルト |
|---|---|---|
ANTHROPIC_MODEL | 使用する Claude モデル | "claude-3-7-sonnet-20250219" |
ANTHROPIC_TEMPERATURE | Claude API 呼び出しの temperature | 0.2 |
ANTHROPIC_MAX_TOKENS | Claude API の最大トークン数 | 64000 |
ANTHROPIC_MAX_CACHE_SIZE | Claude API の最大キャッシュサイズ | 100 |
ANTHROPIC_CACHE_TTL | Claude API のキャッシュ TTL (ms) | 3600000 |
ANTHROPIC_MAX_RETRIES | Claude API の最大リトライ回数 | 5 |
ANTHROPIC_BASE_URL | Claude API のベース URL | "https://api.anthropic.com" |
ANTHROPIC_SYSTEM_PROMPT | Claude API のシステムプロンプト | "You are a helpful assistant." |
Perplexity API 設定
| 変数 | 説明 | デフォルト |
|---|---|---|
PERPLEXITY_MODEL | 使用する Perplexity モデル | "sonar-pro" |
PERPLEXITY_MAX_TOKENS | Perplexity API の最大トークン数 | 1024 |
PERPLEXITY_MAX_CACHE_SIZE | Perplexity API の最大キャッシュサイズ | 100 |
PERPLEXITY_CACHE_TTL | Perplexity API のキャッシュ TTL (ms) | 3600000 |
PERPLEXITY_MAX_RESULTS | Perplexity API の最大結果数 | 5 |
PERPLEXITY_MAX_RETRIES | Perplexity API の最大リトライ回数 | 5 |
PERPLEXITY_BASE_URL | Perplexity API のベース URL | "https://api.perplexity.ai" |
PERPLEXITY_TEMPERATURE | Perplexity API 呼び出しの temperature | 0.7 |
PERPLEXITY_SYSTEM_PROMPT | Perplexity API のシステムプロンプト | "You are a helpful research assistant. Provide factual information with sources." |
ファイルとディレクトリの設定
| 変数 | 説明 | デフォルト |
|---|---|---|
ARTIFACTS_DIR | 成果物用のディレクトリ | "apm-artifacts" |
ARTIFACTS_FILE | 成果物のファイル名 | "artifacts.json" |
PRODUCT_BRIEF_FILE | プロジェクト概要のファイル名 | "project-brief.md" |
デバッグモード
DEBUG_LOGS=true を設定すると、以下が有効になります:
logsディレクトリ内のファイルへの詳細なログ出力- タイムスタンプ付きのログファイル名(例:
apm-2025-05-04-18-16.log) - API 連携や複雑な操作のトラブルシューティングに役立ちます
DEBUG_LOGS=false(デフォルト)の場合:
- ログファイルは作成されません
- 重要なメッセージは引き続き stderr に出力されます
- 通常操作のパフォーマンスが向上します
MCP ツール
タスク管理(apm_task)
目的:プロジェクト内のタスクを照会します。
アクション:
get_all:タスクを一覧表示します。オプションでステータスによる絞り込みが可能ですget_single:ID を指定して特定のタスクを表示しますget_next:次に取り組むタスクを検索しますfilter_by_statusまたはfilter_by_priority:対象を絞ったタスクリスト
機能の詳細
apm_task ツールが呼び出されると:
-
パラメータの検証:
actionパラメータを検証します(必須。有効なアクションのいずれかである必要があります)projectRootパラメータを検証します(必須。絶対パスである必要があります)- アクション固有のパラメータを検証します:
get_singleの場合:idパラメータを検証します(必須。空でない文字列)filter_by_statusの場合:statusパラメータを検証します(必須。有効なステータスである必要があります)filter_by_priorityの場合:priorityパラメータを検証します(必須。有効な優先度である必要があります)
- オプションのパラメータを検証します:
file、withSubtasks、containsText
-
タスクの取得:
- 指定された場所からタスクファイルを読み取ります(指定されていない場合はデフォルトで
apm-artifacts/artifacts.jsonになります) - ファイルからタスクリストを抽出します
- 指定された場所からタスクファイルを読み取ります(指定されていない場合はデフォルトで
-
アクションの実行:
actionパラメータに基づいて適切なアクションを実行します:get_all:すべてのタスクを返します。オプションでステータスによる絞り込みが可能ですget_single:ID を指定して特定のタスクを返しますget_next:依存関係とステータスに基づいて次に取り組むタスクを返しますfilter_by_status:ステータスで絞り込んだタスクを返しますfilter_by_priority:優先度で絞り込んだタスクを返します
-
アクション固有の処理:
get_allおよびfilter_by_statusの場合:- 指定されている場合はステータスでタスクを絞り込みます
withSubtasksパラメータに基づいてサブタスクを処理します- サマリーメトリクスを計算します
get_singleの場合:- タスク ID を解析してサブタスクかどうかを判定します
- 特定のタスクまたはサブタスクを検索します
get_nextの場合:- 完了したタスクを除外します
- 指定されている場合は優先度とテキストのフィルターを適用します
- 依存関係が満たされているかを確認します
- 優先順位を付けて次のタスクを選択します
filter_by_priorityの場合:- 優先度でタスクを絞り込みます
withSubtasksパラメータに基づいてサブタスクを処理します- サマリーメトリクスを計算します
-
レスポンスの整形:
- 以下を含む構造化された JSON レスポンスを返します:
- 要求されたタスクデータ
- 成功ステータスとメッセージ
- クエリに関するコンテキスト情報
- タイムスタンプとセッション情報
- 以下を含む構造化された JSON レスポンスを返します:
-
エラー処理:
- 検証エラー(必須フィールドの欠落、無効な値)を処理します
- ファイルが見つからないエラーを処理します
- タスクが見つからないエラーを処理します
- コンテキスト情報を含む標準化されたエラーレスポンスを返します
JSON-RPC リクエスト
{
"method": "apm_task",
"params": {
"action": "get_all|get_single|get_next|filter_by_status|filter_by_priority",
"projectRoot": "/absolute/path/to/project",
"file": "optional/path/to/artifacts.json",
"id": "5", // Required for get_single action
"status": "pending|in-progress|done|deferred|cancelled", // For get_all and filter_by_status actions
"priority": "high|medium|low", // For get_next and filter_by_priority actions
"withSubtasks": true|false,
"containsText": "optional search text" // For get_next action
}
}
JSON-RPC レスポンス
get_all および filter_by_status アクションの場合:
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"tasks": [
{
"id": "1",
"title": "Task 1",
"description": "Description",
"status": "pending",
"priority": "high",
"dependencies": []
}
],
"stats": {
"totalTasks": 10,
"completedTasks": 3,
"pendingTasks": 5,
"inProgressTasks": 2,
"taskCompletionPercentage": 30
},
"filter": "pending"
},
"message": "Found 5 tasks with status 'pending'",
"memory": {
"sessionId": "session-123456",
"context": {
"lastQuery": {
"action": "get_all",
"status": "pending",
"withSubtasks": false
},
"projectRoot": "/path/to/project",
"timestamp": "2023-06-15T10:30:00Z"
}
}
}
}
]
}
get_single アクションの場合:
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"task": {
"id": "5",
"title": "Implement Feature",
"description": "Create the feature",
"status": "pending",
"priority": "high",
"dependencies": ["3", "4"],
"details": "Implementation details..."
}
},
"message": "Found task: Implement Feature",
"memory": {
"sessionId": "session-123456",
"context": {
"lastQuery": {
"action": "get_single",
"id": "5"
},
"projectRoot": "/path/to/project",
"timestamp": "2023-06-15T10:30:00Z"
}
}
}
}
]
}
get_next アクションの場合:
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"nextTask": {
"id": "2",
"title": "Next Task",
"description": "Description",
"status": "pending",
"priority": "high",
"dependencies": []
},
"allTasks": [
/* Array of all tasks */
]
},
"message": "Found next task: Next Task",
"memory": {
"sessionId": "session-123456",
"context": {
"lastQuery": {
"action": "get_next",
"priority": "high",
"containsText": null
},
"taskCount": 10,
"readyTaskCount": 3,
"timestamp": "2023-06-15T10:30:00Z"
}
}
}
}
]
}
filter_by_priority アクションの場合:
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"tasks": [
{
"id": "1",
"title": "Task 1",
"description": "Description",
"status": "pending",
"priority": "high",
"dependencies": []
}
],
"stats": {
"totalTasks": 10,
"completedTasks": 3,
"pendingTasks": 5,
"inProgressTasks": 2,
"taskCompletionPercentage": 30
},
"filter": "high"
},
"message": "Found 5 tasks with priority 'high'",
"memory": {
"sessionId": "session-123456",
"context": {
"lastQuery": {
"action": "filter_by_priority",
"priority": "high",
"withSubtasks": false
},
"projectRoot": "/path/to/project",
"timestamp": "2023-06-15T10:30:00Z"
}
}
}
}
]
}
目的: タスクとサブタスクの作成、更新、削除
アクション:
create: 新しいタスクを追加しますupdate: タスクの詳細を更新しますupdate_status: タスクのステータスを変更しますdelete: タスクを削除しますadd_subtask: タスクにサブタスクを追加しますremove_subtask: タスクからサブタスクを削除しますclear_subtasks: タスクからすべてのサブタスクを削除しますexpand: タスクをサブタスクに分解しますexpand_all: 保留中のすべてのタスクを展開します
パラメータ:
action: 実行する具体的なアクションprojectRoot: プロジェクトのルートディレクトリ- アクション固有のパラメータ (id、status、data など)
機能の詳細
apm_task_modify ツールが呼び出されると、次の処理が行われます:
-
パラメータの検証:
actionパラメータを検証します (必須、有効なアクションのいずれかである必要があります)projectRootパラメータを検証します (必須、絶対パスである必要があります)- 実行するアクションに基づいてアクション固有のパラメータを検証します
fileなどのオプションパラメータを検証します
-
アクションの実行:
actionパラメータに基づいて適切なアクションを実行します:create: 指定されたプロパティを持つ新しいタスクを作成しますupdate: 既存のタスクを新しい情報で更新しますupdate_status: 1 つ以上のタスクのステータスを変更しますdelete: プロジェクトからタスクを削除しますadd_subtask: 既存のタスクにサブタスクを追加しますremove_subtask: タスクからサブタスクを削除しますclear_subtasks: 1 つ以上のタスクからすべてのサブタスクを削除しますexpand: AI を使用してタスクをサブタスクに分解しますexpand_all: AI を使用して保留中のすべてのタスクをサブタスクに展開します
-
ファイル操作:
- 指定された場所からタスクファイルを読み取ります (指定されていない場合はデフォルトで
apm-artifacts/artifacts.jsonになります) - 実行されたアクションに基づいてタスクデータを更新します
- 更新されたタスクデータをファイルに書き戻します
- 必要に応じて個別のタスクファイルを生成します (
skipGenerateが true でない場合)
- 指定された場所からタスクファイルを読み取ります (指定されていない場合はデフォルトで
-
AI 統合 (特定のアクションの場合):
- タスクの展開と更新に Claude AI を使用します
- リサーチに基づく操作のためにオプションで Perplexity AI を使用します
- タスクのコンテキストに基づいてインテリジェントなサブタスクを生成します
-
レスポンスのフォーマット:
- 以下を含む構造化された JSON レスポンスを返します:
- アクション固有のデータ (タスク、サブタスクなど)
- 成功メッセージ
- ユーザーへのコミュニケーションガイダンス
- 次のステップに向けたエージェントへの指示
- 以下を含む構造化された JSON レスポンスを返します:
-
エラー処理:
- 検証エラー (必須フィールドの欠落、無効な値) を処理します
- ファイルが見つからないエラーを処理します
- タスクが見つからないエラーを処理します
- AI サービスエラーを処理します
- コンテキスト情報を含む標準化されたエラーレスポンスを返します
JSON-RPC リクエスト
{
"method": "apm_task_modify",
"params": {
"action": "create|update|update_status|delete|add_subtask|remove_subtask|clear_subtasks|expand|expand_all",
"projectRoot": "/absolute/path/to/project",
// Action-specific parameters
// For create action
"title": "Task Title",
"description": "Task Description",
"priority": "high|medium|low",
"dependencies": "1,2,3",
"details": "Implementation details",
"testStrategy": "Test strategy",
// For update action
"id": "1",
"prompt": "Update information",
"research": true|false,
"researchOnly": true|false,
// For update_status action
"id": "1",
"status": "pending|in-progress|done|deferred|cancelled",
// For delete action
"id": "1",
"confirm": true|false,
// For add_subtask action
"id": "1",
"title": "Subtask Title",
"description": "Subtask Description",
"details": "Subtask details",
"dependencies": "1.1,1.2",
"status": "pending|in-progress|done|deferred|cancelled",
"taskId": "2", // Existing task ID to convert to subtask
"skipGenerate": true|false,
// For remove_subtask action
"id": "1.1",
"convert": true|false,
"skipGenerate": true|false,
// For clear_subtasks action
"id": "1", // Can be comma-separated for multiple tasks
"all": true|false, // Clear subtasks from all tasks
// For expand action
"id": "1",
"num": 3, // Number of subtasks to generate
"prompt": "Additional context",
"research": true|false,
"force": true|false,
// For expand_all action
"num": 3,
"prompt": "Additional context",
"research": true|false,
"force": true|false,
// Common optional parameters
"file": "optional/path/to/artifacts.json"
}
}
JSON-RPC レスポンス
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
// Action-specific response data
// For create action
"task": {
"id": "1",
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"priority": "high",
"dependencies": ["1", "2", "3"],
"details": "Implementation details",
"testStrategy": "Test strategy"
},
// For update action
"task": {
"id": "1",
"title": "Updated Task Title",
"description": "Updated Task Description",
"status": "pending",
"priority": "high",
"dependencies": ["1", "2", "3"],
"details": "Updated implementation details",
"testStrategy": "Updated test strategy"
},
// For update_status action
"updatedTasks": [
{
"id": "1",
"title": "Task Title",
"status": "done"
}
],
// For delete action
"removedTask": {
"id": "1",
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"priority": "high",
"dependencies": [],
"details": "Implementation details",
"testStrategy": "Test strategy"
},
// For add_subtask action
"task": {
"id": "1",
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"priority": "high",
"dependencies": [],
"details": "Implementation details",
"testStrategy": "Test strategy",
"subtasks": [
{
"id": "1.1",
"title": "Subtask Title",
"description": "Subtask Description",
"status": "pending",
"details": "Subtask details",
"dependencies": []
}
]
},
// For remove_subtask action
"task": {
"id": "1",
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"priority": "high",
"dependencies": [],
"details": "Implementation details",
"testStrategy": "Test strategy",
"subtasks": []
},
// For clear_subtasks action
"updatedTasks": [
{
"id": "1",
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"priority": "high",
"dependencies": [],
"details": "Implementation details",
"testStrategy": "Test strategy"
}
],
// For expand action
"task": {
"id": "1",
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"priority": "high",
"dependencies": [],
"details": "Implementation details",
"testStrategy": "Test strategy",
"subtasks": [
{
"id": "1.1",
"title": "Generated Subtask 1",
"description": "Description for Generated Subtask 1",
"status": "pending",
"details": "Details for Generated Subtask 1",
"dependencies": []
},
{
"id": "1.2",
"title": "Generated Subtask 2",
"description": "Description for Generated Subtask 2",
"status": "pending",
"details": "Details for Generated Subtask 2",
"dependencies": ["1.1"]
},
{
"id": "1.3",
"title": "Generated Subtask 3",
"description": "Description for Generated Subtask 3",
"status": "pending",
"details": "Details for Generated Subtask 3",
"dependencies": ["1.2"]
}
]
},
// For expand_all action
"expandedTasks": [
{
"id": "1",
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"priority": "high",
"dependencies": [],
"details": "Implementation details",
"testStrategy": "Test strategy",
"subtasks": [
{
"id": "1.1",
"title": "Generated Subtask 1",
"description": "Description for Generated Subtask 1",
"status": "pending",
"details": "Details for Generated Subtask 1",
"dependencies": []
},
{
"id": "1.2",
"title": "Generated Subtask 2",
"description": "Description for Generated Subtask 2",
"status": "pending",
"details": "Details for Generated Subtask 2",
"dependencies": ["1.1"]
},
{
"id": "1.3",
"title": "Generated Subtask 3",
"description": "Description for Generated Subtask 3",
"status": "pending",
"details": "Details for Generated Subtask 3",
"dependencies": ["1.2"]
}
]
}
]
},
"message": "Action-specific success message",
"userCommunication": {
"message": "User-friendly message about the action result"
},
"agentInstructions": "Instructions for the AI agent on how to proceed"
}
}
]
}
目的: artifacts.json に基づいて、apm-artifacts/ ディレクトリに個別のタスクファイルを生成します。
機能の詳細
apm_task_generate ツールが呼び出されると、次の処理を行います。
-
パラメータの検証:
projectRootパラメータを検証します (必須、絶対パスである必要があります)- オプションのパラメータ
fileとoutputを検証します
-
タスクの取得:
- 指定された場所からタスクファイルを読み取ります (指定がない場合は artifacts.json が既定値です)
- タスクファイルが見つからない、または空の場合はエラーを返します
-
ディレクトリの準備:
- 出力ディレクトリが存在することを確認します (必要に応じて作成します)
- 出力ディレクトリが指定されていない場合は、既定の artifacts ディレクトリを使用します
-
ファイル生成プロセス:
- タスクデータ内の各タスクについて:
- タスクの詳細を含む Markdown ファイルを生成します
- すべてのタスクプロパティ (タイトル、説明、ステータス、依存関係など) を含めます
- サブタスクが存在する場合は、ネストされたセクションとして整形します
- タスク ID に基づく一貫した命名規則を使用します
- 各タスクファイルごとに、構造化された読みやすい形式を作成します
- タスクデータ内の各タスクについて:
-
レスポンスの整形:
- 以下を含む構造化された JSON レスポンスを返します:
- 成功ステータス
- 生成されたタスクファイルの数
- artifacts ディレクトリのパス
- タスクファイルのパス
- 成功メッセージ
- コンテキスト情報 (タイムスタンプ、タスク数)
- 以下を含む構造化された JSON レスポンスを返します:
-
エラー処理:
- ファイルが見つからないエラーを処理します
- ディレクトリ作成エラーを処理します
- ファイル書き込みエラーを処理します
- コンテキスト情報を含む標準化されたエラーレスポンスを返します
JSON-RPC リクエスト
{
"method": "apm_task_generate",
"params": {
"projectRoot": "/absolute/path/to/project",
"file": "optional/path/to/artifacts.json",
"output": "optional/path/to/output/directory"
}
}
JSON-RPC レスポンス
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"success": true,
"taskCount": 10,
"artifactsDir": "/path/to/project/apm-artifacts",
"tasksPath": "/path/to/project/apm-artifacts/artifacts.json"
},
"message": "Generated 10 task files in /path/to/project/apm-artifacts",
"context": {
"timestamp": "2023-06-15T10:30:00Z",
"taskCount": 10
}
}
}
]
}
目的: 対話形式のインタビュープロセスを通じてプロジェクトブリーフを作成し、タスクを生成します。
apm_project_brief_statusを使用して操作の進行状況を確認しますapm_project_brief_resultを使用して完了したブリーフィングを取得します
機能の詳細
apm_project_brief_create ツールが呼び出されると、次の処理を行います:
-
パラメータの検証:
projectRootパラメータを検証します (必須、絶対パスである必要があります)- オプションのパラメータ
sessionId、input、stage、response、exportFormat、maxTasksを検証します
-
セッションの処理:
sessionIdが指定されていない場合は、新しいインタビューセッションを開始しますsessionIdが指定されている場合は、既存のインタビューセッションを続行します- 複数のやり取りにわたって状態を維持します
-
インタビュープロセス:
- 複数のステージからなる構造化されたインタビューへとユーザーを導きます:
- プロジェクトの概要: プロジェクトの目的と範囲に関する基本情報
- 目標とステークホルダー: プロジェクトの目的と関係者
- 制約事項: 制限、要件、境界
- テクノロジー: 技術スタックとツール
- タイムラインとフェーズ: プロジェクトのスケジュールと主要なマイルストーン
- 機能: 詳細な機能要件
- レビュー: 最終確認と調整
- 以前の回答に基づいて、文脈に即した質問を行います
- ユーザーの回答を処理して、包括的なプロジェクトブリーフを構築します
- 複数のステージからなる構造化されたインタビューへとユーザーを導きます:
-
タスクの生成:
- インタビューの完了後、プロジェクトブリーフに基づいてタスクを生成します
- 適切な依存関係を備えた構造化されたタスク階層を作成します
- フェーズと機能ごとにタスクを整理します
maxTasksパラメータに基づいてタスクの数を制限します- タスクを artifacts.json ファイルに保存します
-
レスポンスのフォーマット:
- 新しいセッションの場合: インタビュープロセスを追跡するための操作 ID を返します
- 継続セッションの場合: 次の質問、またはタスク生成の確認を返します
- 推奨される応答を含む、ユーザーとのコミュニケーションのガイダンスを含めます
- 明確な次のステップとコマンドを提示します
-
エラー処理:
- 検証エラーを処理します
- ファイルが見つからないエラーを処理します
- インタビュー処理のエラーを処理します
- コンテキスト情報を含む標準化されたエラーレスポンスを返します
JSON-RPC リクエスト
{
"method": "apm_project_brief_create",
"params": {
"projectRoot": "/absolute/path/to/project",
"sessionId": "optional-session-id-for-continuing-interviews",
"input": "optional/path/to/existing/brief.json",
"stage": "project_overview|goals_and_stakeholders|constraints|technologies|timeline_and_phases|features|review",
"response": "Your answer to the current interview question",
"exportFormat": "json|markdown|text",
"maxTasks": 10
}
}
JSON-RPC レスポンス
{
"content": [
{
"type": "text",
"text": {
"operationId": "project-brief-123456",
"message": "Project brief interview started",
"nextAction": "check_operation_status",
"checkStatusCommand": "apm_project_brief_status --operationId=project-brief-123456",
"metadata": {
"userCommunication": {
"message": "I'm starting the project brief interview process.",
"expectationType": "immediate",
"suggestedResponse": "I'll start the project brief interview process. I'll ask you a series of questions to gather information about your project. Let's begin with understanding your project overview."
}
}
}
}
]
}
apm_project_brief_status
目的: プロジェクトブリーフのインタビュー操作のステータスを取得します。
機能の詳細
apm_project_brief_status ツールが呼び出されると、次の処理を行います:
-
パラメータの検証:
projectRootパラメータを検証します (必須、絶対パスである必要があります)operationIdパラメータを検証します (必須、空でない文字列)
-
ステータスの取得:
- AsyncOperationManager から操作ステータスを取得します
- 操作が見つからない場合はエラーを返します
- 操作の現在の状態に関する詳細情報を提供します
-
進行状況のレポート:
- 現在の進行状況のパーセンテージ (0〜100) を返します
- 現在のステージについての説明的なメッセージを提供します
- 作成、更新、完了 (該当する場合) のタイムスタンプを含めます
-
ユーザーとのコミュニケーションのガイダンス:
- 実行中の操作については、ユーザーに状況を伝えるための推奨される応答を提供します
- 完了した操作については、次のステップを提案します
- 失敗した操作については、何が問題だったのか、どのように進めるかを説明します
-
レスポンスのフォーマット:
- 次の内容を含む構造化された JSON レスポンスを返します:
- 操作 ID
- 現在のステータス (pending、running、completed、failed)
- 進行状況のパーセンテージ
- ステータスメッセージ
- タイムスタンプ (created、updated、completed)
- ユーザーとのコミュニケーションのガイダンス
- 次の内容を含む構造化された JSON レスポンスを返します:
-
エラー処理:
- 操作が見つからない場合を処理します
- ステータス取得中の内部エラーを処理します
- コンテキスト情報を含む標準化されたエラーレスポンスを返します
JSON-RPC リクエスト
{
"method": "apm_project_brief_status",
"params": {
"projectRoot": "/absolute/path/to/project",
"operationId": "project-brief-123456"
}
}
JSON-RPC レスポンス
{
"content": [
{
"type": "text",
"text": {
"operationId": "project-brief-123456",
"status": "running",
"progress": 65,
"message": "Generating tasks",
"createdAt": "2023-06-15T10:30:00Z",
"updatedAt": "2023-06-15T10:30:05Z",
"completedAt": null,
"metadata": {
"operationType": "task-generation",
"userCommunication": {
"message": "Task generation is in progress.",
"expectationType": "long_wait",
"estimatedTimeSeconds": 180,
"suggestedResponse": "The task generation is in progress (65% complete).\n\nWhile we wait, here's what's happening behind the scenes:\n- The AI is analyzing your project requirements\n- It's identifying key components, features, and dependencies\n- It will create a structured task breakdown with proper sequencing\n- Tasks will be saved to the apm-artifacts directory, along with an overall project brief.\n\nYou can ask me to \"check status\" anytime if you'd like an update, or we can discuss other aspects of your project while we wait."
}
}
}
}
]
}
apm_project_brief_result
目的: 完了したプロジェクトブリーフインタビュー操作の結果を取得します。
機能の詳細
apm_project_brief_result ツールが呼び出されると、次の処理を行います。
-
パラメータの検証:
projectRootパラメータを検証します(必須、絶対パスである必要があります)operationIdパラメータを検証します(必須、空でない文字列)
-
結果の取得:
- AsyncOperationManager から操作の結果を取得します
- 結果が利用できない場合(操作が完了していない、または見つからない場合)はエラーを返します
- 操作が失敗した場合はエラーを返します
-
結果の処理:
- 操作の結果から生成されたタスクを抽出します
- 保存された成果物へのファイルパスを含めます
- 今後のアクションに備えたセッション情報を提供します
- ユーザーに次のステップを提案します
-
レスポンスの整形:
- 次の内容を含む構造化された JSON レスポンスを返します:
- 操作 ID とステータス
- タイトル、説明、優先度、詳細を含む生成されたタスク
- 保存された成果物へのファイルパス(artifacts.json、プロジェクトブリーフの Markdown)
- セッション情報(sessionId、projectBriefUri、interviewStateUri)
- 次のアクションの提案とコマンド
- ユーザーへのコミュニケーションガイダンス
- 次の内容を含む構造化された JSON レスポンスを返します:
-
エラー処理:
- 操作が見つからない場合を処理します
- 操作がまだ実行中の場合を処理します
- 操作が失敗した場合を処理します
- コンテキスト情報を含む標準化されたエラーレスポンスを返します
-
ユーザーガイダンス:
- ユーザーに明確な次のステップを提供します
- 生成されたタスクを表示および管理するためのコマンドを提案します
- 結果を説明するユーザーフレンドリーなメッセージを含めます
JSON-RPC リクエスト
{
"method": "apm_project_brief_result",
"params": {
"projectRoot": "/absolute/path/to/project",
"operationId": "project-brief-123456"
}
}
JSON-RPC レスポンス
{
"content": [
{
"type": "text",
"text": {
"operationId": "project-brief-123456",
"status": "completed",
"message": "Task generation completed successfully",
"tasks": [
{
"id": "1",
"title": "Set up project infrastructure",
"description": "Initialize the project repository and set up basic infrastructure",
"status": "pending",
"priority": "high",
"dependencies": [],
"details": "Create the repository, set up CI/CD, and configure development environment"
}
],
"tasksPath": "/path/to/project/apm-artifacts/artifacts.json",
"markdownPath": "/path/to/project/apm-artifacts/project-brief.md",
"sessionId": "session-123456",
"projectBriefUri": "resource://project-brief-123456",
"interviewStateUri": "resource://interview-state-123456",
"nextAction": "view_tasks",
"suggestedCommand": "apm_get_tasks",
"userCommunication": {
"message": "I've successfully generated tasks based on your project brief. You can now view and manage these tasks using the task management tools.",
"expectationType": "immediate",
"suggestedResponse": "Great! I've generated a set of tasks based on your project requirements. These tasks have been saved to your project directory and are ready for you to work on. You can view them using the 'apm_get_tasks' command. Would you like to see the tasks now?"
}
}
}
]
}
目的: タスクの依存関係を管理します
アクション:
add: タスク間に依存関係を追加しますremove: タスク間の依存関係を削除しますvalidate: 依存関係の問題をチェックしますfix: 依存関係の問題を自動的に修正します
パラメータ:
action: 実行する具体的なアクションprojectRoot: プロジェクトのルートディレクトリ- アクション固有のパラメータ (id、dependsOn など)
機能の詳細
apm_dependencies ツールが呼び出されると、次の処理を行います:
-
パラメータの検証:
actionパラメータを検証します (必須、有効なアクションのいずれかである必要があります)projectRootパラメータを検証します (必須、絶対パスである必要があります)- アクション固有のパラメータを検証します:
addおよびremoveの場合:idおよびdependsOnパラメータを検証します (必須、空でない文字列)
- オプションのパラメータを検証します:
file
-
タスクの取得:
- 指定された場所からタスクファイルを読み取ります (指定されていない場合はデフォルトで
apm-artifacts/artifacts.jsonになります) - ファイルからタスクリストを抽出します
- 指定された場所からタスクファイルを読み取ります (指定されていない場合はデフォルトで
-
アクションの実行:
actionパラメータに基づいて適切なアクションを実行します:add: 2 つのタスク間に依存関係を追加しますremove: 2 つのタスク間の依存関係を削除しますvalidate: 依存関係の問題 (循環参照、欠落した依存関係) をチェックしますfix: 依存関係の問題を自動的に修正します
-
アクション固有の処理:
addの場合:- 別のタスクに依存するタスクを検索します
- 依存される側のタスクを検索します
- 依存関係がすでに存在するかどうかをチェックします
- 存在しない場合は依存関係を追加します
- 循環参照がないことを確認するために依存関係を検証します
removeの場合:- 別のタスクに依存するタスクを検索します
- 依存関係が存在するかどうかをチェックします
- 存在する場合は依存関係を削除します
validateの場合:- 循環依存をチェックします
- 欠落した依存関係をチェックします
- 検証結果を返します
fixの場合:- 欠落した依存関係を削除して修正します
- 循環依存を循環を断ち切ることで修正します
- 修正結果を返します
-
ファイル操作:
- メモリ内のタスクデータを更新します
- 更新されたタスクをファイルに書き戻します
- 個別のタスクファイルを生成します
-
レスポンスのフォーマット:
- 以下を含む構造化された JSON レスポンスを返します:
- アクション固有のデータ (タスク、依存タスク、検証結果、修正結果)
- 成功ステータスとメッセージ
- 操作に関するコンテキスト情報
- タイムスタンプとセッション情報
- 以下を含む構造化された JSON レスポンスを返します:
-
エラー処理:
- 検証エラー (必須フィールドの欠落、無効な値) を処理します
- ファイルが見つからないエラーを処理します
- タスクが見つからないエラーを処理します
- 循環依存エラーを処理します
- コンテキスト情報を含む標準化されたエラーレスポンスを返します
JSON-RPC リクエスト
{
"method": "apm_dependencies",
"params": {
"action": "add|remove|validate|fix",
"projectRoot": "/absolute/path/to/project",
// Action-specific parameters
// For add and remove actions
"id": "1",
"dependsOn": "2",
// Common optional parameters
"file": "optional/path/to/artifacts.json"
}
}
JSON-RPC レスポンス
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
// Action-specific response data
// For add action
"task": {
"id": "1",
"title": "Task 1",
"description": "Description for Task 1",
"status": "pending",
"priority": "high",
"dependencies": ["2"]
},
"dependencyTask": {
"id": "2",
"title": "Task 2",
"description": "Description for Task 2",
"status": "pending",
"priority": "medium",
"dependencies": []
},
"tasksPath": "/path/to/project/apm-artifacts/artifacts.json"
},
"message": "Added dependency: Task 1 now depends on task 2",
"memory": {
"sessionId": "session-123456",
"context": {
"taskId": "1",
"dependsOn": "2",
"timestamp": "2023-06-15T10:30:00Z"
}
}
}
}
]
}
validate アクションの場合:
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"validationResults": {
"circularDependencies": [
{
"taskId": "1",
"path": ["1", "3", "2", "1"]
}
],
"missingDependencies": [
{
"taskId": "4",
"missingDependencies": ["999"]
}
],
"valid": false
},
"tasksPath": "/path/to/project/apm-artifacts/artifacts.json"
},
"message": "Dependency issues detected",
"memory": {
"sessionId": "session-123456",
"context": {
"timestamp": "2023-06-15T10:30:00Z",
"validationResults": {
"circularDependencies": [
{
"taskId": "1",
"path": ["1", "3", "2", "1"]
}
],
"missingDependencies": [
{
"taskId": "4",
"missingDependencies": ["999"]
}
],
"valid": false
}
}
}
}
}
]
}
fix アクションの場合:
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"fixResults": {
"circularDependenciesFixed": [
{
"taskId": "2",
"removedDependencies": ["1"]
}
],
"missingDependenciesFixed": [
{
"taskId": "4",
"removedDependencies": ["999"]
}
],
"fixesApplied": true
},
"tasksPath": "/path/to/project/apm-artifacts/artifacts.json"
},
"message": "Dependency issues fixed",
"memory": {
"sessionId": "session-123456",
"context": {
"timestamp": "2023-06-15T10:30:00Z",
"fixResults": {
"circularDependenciesFixed": [
{
"taskId": "2",
"removedDependencies": ["1"]
}
],
"missingDependenciesFixed": [
{
"taskId": "4",
"removedDependencies": ["999"]
}
],
"fixesApplied": true
}
}
}
}
}
]
}
目的: タスクの複雑性を分析し、拡張の推奨事項を生成し、レポートを作成することを単一の操作で行います。
機能の詳細
apm_complexity_node ツールが呼び出されると、以下の処理を行います。
-
パラメータの検証:
projectRootパラメータを検証します (必須、絶対パスである必要があります)- オプションのパラメータ (
file、output、markdownOutput、threshold、model、research) を検証します - オプションのパラメータにデフォルト値を適用します:
output: "apm-artifacts/resources/reports/task-complexity-report.json"markdownOutput: "apm-artifacts/resources/reports/task-complexity-report.md"threshold: 5 (複雑性が 5 以上のタスクが拡張の対象として推奨されます)research: false (Perplexity AI を使用した調査に基づく分析を行うかどうか)
-
タスクの取得:
- 指定された場所からタスクファイルを読み取ります (指定されていない場合はデフォルトで artifacts.json になります)
- ファイルからタスクリストを抽出します
- ステータスが 'done' でも 'cancelled' でもないタスクのみを含めるようにフィルタリングします
- すでにサブタスクを持つタスクはスキップします (すでに分割されているため)
-
タスク分析プロセス:
- 各タスクについて:
- 基本的な複雑性の要因を計算します:
- 説明の長さ (0~0.2 点)
- 詳細の長さ (0~0.2 点)
- 依存関係の数 (0~0.2 点)
- 優先度の要因 (高: 0.2、中: 0.1、低: 0 点)
- 技術用語の数 (0~0.2 点)
- research が有効な場合は、Perplexity AI で分析を強化します
- Claude AI を使用して 1~10 のスケールで複雑性を分析します
- 複雑性に基づいてサブタスクの数を推奨します
- 拡張プロンプトとコマンドを生成します
- 基本的な複雑性の要因を計算します:
- 各タスクについて:
-
レポートの生成:
- 以下を含む複雑性レポートを作成します:
- タスク固有の分析 (ID、タイトル、複雑性スコア、推奨されるサブタスク)
- 複雑なタスクを分割するための拡張プロンプト
- タスク拡張のために実行するコマンド
- メタデータ (生成タイムスタンプ、閾値、タスク数、平均複雑性)
- 出力ディレクトリが存在することを確認します
- JSON レポートを指定された出力パスに書き込みます
- レポートを読みやすい markdown ドキュメントに整形します
- markdown レポートを指定された markdown 出力パスに書き込みます
- 以下を含む複雑性レポートを作成します:
-
応答の整形:
- 以下を含む構造化された JSON 応答を返します:
- 完全な複雑性レポートデータ
- 整形されたレポートの markdown 文字列
- JSON レポートと markdown レポートの両方の出力ファイルパス
- タスク分析の統計 (分析されたタスク、検出された複雑なタスク)
- ユーザーへのコミュニケーションガイダンス
- 次のステップに向けたエージェントへの指示
- 以下を含む構造化された JSON 応答を返します:
-
エラー処理:
- ファイルが見つからないエラーを処理します
- ディレクトリ作成エラーを処理します
- ファイル書き込みエラーを処理します
- コンテキスト情報を含む標準化されたエラー応答を返します
JSON-RPC リクエスト
{
"method": "apm_complexity_node",
"params": {
"projectRoot": "/absolute/path/to/project",
"file": "optional/path/to/artifacts.json",
"output": "apm-artifacts/resources/reports/task-complexity-report.json",
"markdownOutput": "apm-artifacts/resources/reports/task-complexity-report.md",
"threshold": 5,
"model": "optional-model-name",
"research": false
}
}
JSON-RPC レスポンス
{
"content": [
{
"type": "text",
"text": {
"success": true,
"data": {
"report": {
"tasks": [
{
"taskId": "15",
"title": "Implement GraphQL API Integration",
"complexity": 8,
"recommendedSubtasks": 6,
"expansionPrompt": "Break down the implementation...",
"expansionCommand": "apm_task_modify_node --action=expand --id=15 --num=6"
}
],
"metadata": {
"generated": "2025-04-24T14:40:04.508Z",
"threshold": 5,
"totalTasks": 4,
"averageComplexity": 7
}
},
"formattedReport": "# Task Complexity Analysis Report\n\n## Report Summary\n\n- **Generated:** 4/24/2025, 7:40:04 AM\n- **Complexity Threshold:** 5\n- **Total Tasks Analyzed:** 4\n- **Average Complexity:** 7.0\n\n## Task Analysis\n\n### 🔴 Task 15: Implement GraphQL API Integration\n\n- **Complexity Score:** **8/10 ⚠️\n- **Recommended Subtasks:** 6\n- **Action Required:** This task should be broken down into subtasks\n- **Expansion Command:** `apm_task_modify_node --action=expand --id=15 --num=6`\n\n**Expansion Guidance:**\nBreak down the implementation of the GraphQL API integration...\n\n---\n\n## Recommendations\n\nThe following tasks should be prioritized for breakdown:\n\n- Task 15: Implement GraphQL API Integration (Complexity: 8/10)\n",
"jsonOutputPath": "/path/to/project/apm-artifacts/resources/reports/task-complexity-report.json",
"markdownOutputPath": "/path/to/project/apm-artifacts/resources/reports/task-complexity-report.md",
"tasksAnalyzed": 4,
"complexTasks": 1
},
"message": "Analyzed 4 tasks and identified 1 complex task that should be broken down.",
"userCommunication": {
"message": "I've analyzed your project tasks and identified which ones might benefit from being broken down into subtasks. Here's the complexity report:\n\n# Task Complexity Analysis Report\n\n...",
"expectationType": "immediate"
},
"agentInstructions": "The complexity analysis is complete. The report has been formatted for display and saved as both JSON and Markdown. You can suggest using 'apm_task_modify_node' with the 'expand' action for tasks with high complexity scores."
}
}
]
}
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。