agent-planner-mcp 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agentplanner
3
- description: "Agent orchestration skill for AgentPlanner — plan, execute, and track work with dependency management, knowledge graphs, and human oversight"
4
- version: 1.0.0
3
+ description: "Agent orchestration skill for AgentPlanner — BDI-aligned tools for state, goals, and committed actions with human oversight"
4
+ version: 0.9.0
5
5
  homepage: https://agentplanner.io
6
6
  metadata:
7
7
  openclaw:
@@ -13,479 +13,172 @@ metadata:
13
13
 
14
14
  # AgentPlanner — LLM Skill Reference
15
15
 
16
- You have access to the AgentPlanner MCP tools. AgentPlanner is a collaborative planning system where you track work, manage dependencies, and coordinate with humans. This document is your complete reference for using it effectively.
16
+ You have access to the AgentPlanner MCP tools. AgentPlanner is a collaborative planning system where you track work, manage dependencies, and coordinate with humans. This document is your complete reference.
17
17
 
18
- > **Prerequisite:** This skill requires the `agent-planner-mcp` MCP server to be connected. You need an AgentPlanner account and an API token (create one at Settings → API Tokens on [agentplanner.io](https://agentplanner.io)).
18
+ > **Prerequisite:** This skill requires the `agent-planner-mcp` MCP server (v0.9.0+) to be connected. Create an API token at Settings → API Tokens on [agentplanner.io](https://agentplanner.io).
19
19
  >
20
20
  > **Setup by client:**
21
- > - **Claude Code:** `npx agent-planner-mcp setup` (interactive — writes to `.mcp.json`)
22
- > - **Claude Desktop:** Add the MCP server in Settings → Developer → MCP Servers
23
- > - **Cursor / VS Code:** Add to your MCP config with `npx agent-planner-mcp` as the command
24
- > - **ChatGPT:** Use the HTTP endpoint at `https://agentplanner.io/mcp` with your API token
25
- > - **Other MCP clients:** Run `npx agent-planner-mcp` in stdio mode with env vars `API_URL` and `USER_API_TOKEN`
21
+ > - **Claude Desktop:** Download the [.mcpb](https://github.com/TAgents/agent-planner-mcp/releases/latest), double-click to install
22
+ > - **Claude Code:** `npx agent-planner-mcp setup`
23
+ > - **Cursor / VS Code:** Add `npx agent-planner-mcp` to your MCP config with env vars `API_URL` and `USER_API_TOKEN`
24
+ > - **ChatGPT:** HTTP endpoint at `https://agentplanner.io/mcp`
26
25
 
27
- ## When to Use AgentPlanner
26
+ ## The 15 tools, organized by intent
28
27
 
29
- - You are given a plan ID or task ID to work on
30
- - You need to break down complex work into trackable steps
31
- - You need to coordinate with humans on multi-step projects
32
- - You want to persist findings, decisions, or progress across sessions
33
- - You are asked to plan, research, or implement something as part of a tracked workflow
34
- - A user wants help defining or refining a goal
28
+ AgentPlanner exposes a **BDI-aligned** surface Beliefs (state queries), Desires (goal management), Intentions (committed actions). Each tool answers one whole agentic question and returns an `as_of` ISO 8601 timestamp.
35
29
 
36
- ## Goal Coaching
30
+ ### Beliefs — what is the state of the world?
37
31
 
38
- When a user expresses an intent, objective, or want help them turn it into a well-structured goal. Don't just create a goal from their words. Coach them through it:
32
+ - `briefing`bundled mission control state (goals + decisions + my tasks + activity + recommendation) in one call
33
+ - `task_context` — single task at progressive depth 1-4 (task only → +neighborhood → +knowledge → +extended)
34
+ - `goal_state` — single goal deep dive (details + quality + progress + bottlenecks + gaps)
35
+ - `recall_knowledge` — universal knowledge graph query (facts, entities, recent episodes, contradictions)
36
+ - `search` — text search across plans, nodes, content
37
+ - `plan_analysis` — advanced reads: impact analysis, critical path, bottlenecks, coherence
39
38
 
40
- ```
41
- 1. Listen to the user's intent (however vague)
42
- 2. recall_knowledge() → Search for related context in the knowledge graph
43
- 3. list_goals() → Check for overlap with existing goals
44
- 4. list_plans() → Find related work that might link to this goal
45
- 5. Propose a structured goal:
46
- - Clear title
47
- - Description explaining why this matters
48
- - Success criteria with specific metrics + targets
49
- - Linked plans (existing or suggest new ones)
50
- 6. create_goal() + link plans
51
- 7. assess_goal_quality() → Check quality and get improvement suggestions
52
- 8. Iterate with the user until quality is high
53
- ```
39
+ ### Desires — what are we pursuing?
54
40
 
55
- **What makes a good goal:**
56
- - **Clear**has a title and description that explain what and why
57
- - **Measurable** — has success criteria with specific metrics and targets (e.g., "API latency < 100ms p99")
58
- - **Actionable** — has at least one linked plan with concrete tasks
59
- - **Knowledge-grounded** — related facts exist in the knowledge graph (if not, suggest researching first)
60
- - **Committed** — promoted from desire to intention when ready, with a time reference
41
+ - `list_goals` goals with health rollup (`{ on_track, at_risk, stale, total }`)
42
+ - `update_goal`atomic goal update; subsumes link/unlink + achiever changes
61
43
 
62
- Use `assess_goal_quality(goal_id)` after creation to check quality and surface suggestions. Share the results with the user and help them address gaps.
44
+ ### Intentions what am I committing to?
63
45
 
64
- ## Workflow
46
+ - `claim_next_task` — pick + claim + load context in one call (cornerstone for coding agents)
47
+ - `update_task` — atomic state transition (status + log + claim release + optional learning)
48
+ - `release_task` — explicit handoff
49
+ - `queue_decision` — escalate to human (writes to real decisions table — do **not** misuse `add_learning` for this)
50
+ - `resolve_decision` — pick up after human approval/deferral
51
+ - `add_learning` — record a knowledge episode for future recall
65
52
 
66
- Follow this sequence when working on a plan:
53
+ ### Utility
67
54
 
68
- ```
69
- 0. PREFLIGHT → check_coherence_pending to see if anything needs alignment review
70
- ↳ If stale plans found, run_coherence_check on each before starting task work
71
- 1. ORIENT → suggest_next_tasks or get_task_context to understand what needs doing
72
- 2. CLAIM → quick_status to mark the task in_progress
73
- 3. WORK → Do the actual work (code, research, analysis, etc.)
74
- 4. LOG → quick_log or add_log to record what you did and found
75
- ↳ For important findings, also use add_learning to persist to the temporal knowledge graph
76
- 5. COMPLETE → quick_status to mark completed (auto-unblocks downstream tasks)
77
- 6. NEXT → suggest_next_tasks to find the next ready task
78
- ```
55
+ - `get_started` — dynamic reference; call this if you're new to AgentPlanner
79
56
 
80
- ### Preflight: Alignment Check
57
+ ## Canonical workflows
81
58
 
82
- Before diving into tasks, check if goals, plans, and knowledge are aligned:
59
+ ### Mission control loop (Cowork autopilot, scheduled tasks)
83
60
 
84
61
  ```
85
- check_coherence_pending()
86
- → Returns stale plans/goals that changed since last review
87
- → If stale items found:
88
- run_coherence_check({ plan_id: "<plan_id>" })
89
- → Evaluates quality (coverage, specificity, ordering, knowledge)
90
- → Stamps the plan as reviewed
91
- → Returns quality breakdown + coherence issues
92
- ```
62
+ 1. briefing(scope='mission_control')
63
+ → Returns goal_health.summary, pending_decisions[], my_tasks, recent_activity, top_recommendation
93
64
 
94
- This is a lightweight check (seconds, not minutes). Do it at the start of each work session. Skip if you already checked recently.
65
+ 2. If top_recommendation: act on it. Otherwise iterate at_risk goals.
95
66
 
96
- ## Loading Context
67
+ 3. For each chosen goal:
68
+ - goal_state(goal_id) for the bottleneck details
69
+ - If action is reversible (logging, status update, knowledge write):
70
+ update_task(...) or update_goal(...)
71
+ - If action needs human approval (publish, payment, strategy):
72
+ queue_decision({ title, context, smallest_input_needed, plan_id or node_id })
97
73
 
98
- Always load context before starting work. Use `get_task_context` it gives you exactly the right amount of information based on depth level.
99
-
100
- ```
101
- get_task_context({ node_id: "<task_id>", depth: 2 })
74
+ 4. add_learning(content, scope) to record what you did and why.
102
75
  ```
103
76
 
104
- Depth levels:
105
- - **1** — Task only: node details + recent logs. Use when you already know the plan well.
106
- - **2** — Neighborhood: adds parent, siblings, direct dependencies (upstream/downstream). **Default and recommended.**
107
- - **3** — Knowledge: adds Graphiti temporal knowledge (entities, facts). Use when the task requires domain context.
108
- - **4** — Extended: adds plan overview, ancestry path, linked goals, transitive dependencies. Use for first-time orientation or cross-cutting tasks.
77
+ ### Single-task coding session (Claude Code, ap CLI)
109
78
 
110
- If your context window is limited, set `token_budget` to cap the response size:
111
79
  ```
112
- get_task_context({ node_id: "<task_id>", depth: 3, token_budget: 4000 })
80
+ 1. claim_next_task(scope={ plan_id }) returns task with full context
81
+ 2. update_task(task_id, status='in_progress') when work begins
82
+ 3. ... do the work ...
83
+ 4. update_task(task_id, status='completed', log_message='...', add_learning='key insight')
113
84
  ```
114
85
 
115
- ## Finding What to Work On
86
+ The `update_task` call is atomic — status change, log entry, claim release, and knowledge episode all in one round trip.
116
87
 
117
- ```
118
- suggest_next_tasks({ plan_id: "<plan_id>" })
119
- ```
88
+ ### Multi-agent server (OpenClaw)
120
89
 
121
- Returns tasks that are **ready** — all upstream dependencies are completed. Sorted by priority:
122
- 1. RPI research tasks (start of a chain)
123
- 2. Tasks that unblock the most downstream work
124
- 3. Tasks by order index
125
-
126
- Each suggestion includes a `reason` field explaining why it's recommended.
127
-
128
- ## Tool Reference
129
-
130
- ### Quick Actions (Low Friction)
131
-
132
- | Tool | Use When |
133
- |------|----------|
134
- | `quick_plan` | Creating a new plan from a title + task list (provide goal_id to auto-link) |
135
- | `quick_task` | Adding a single task to an existing plan |
136
- | `quick_status` | Updating a task's status (the most common operation) |
137
- | `quick_log` | Logging progress on a task |
138
-
139
- ### Plans
140
-
141
- | Tool | Purpose |
142
- |------|---------|
143
- | `list_plans` | See all accessible plans |
144
- | `create_plan` | Create a plan with full options |
145
- | `update_plan` | Change plan title, description, visibility |
146
- | `delete_plan` | Delete a plan |
147
- | `get_plan_structure` | Get hierarchical tree (minimal fields — fast) |
148
- | `get_plan_summary` | Statistics and overview |
149
- | `share_plan` | Share a plan with another user |
150
-
151
- ### Nodes (Tasks, Phases, Milestones)
152
-
153
- | Tool | Purpose |
154
- |------|---------|
155
- | `create_node` | Create a task, phase, or milestone |
156
- | `update_node` | Change title, description, status, task_mode, etc. |
157
- | `delete_node` | Delete a node and its children |
158
- | `move_node` | Reparent or reorder a node |
159
- | `batch_update_nodes` | Update multiple nodes at once |
160
- | `get_node_ancestry` | Path from root to node |
161
-
162
- When creating nodes:
163
- - `node_type`: `phase` (group of tasks), `task` (unit of work), `milestone` (checkpoint)
164
- - `task_mode`: `free` (default), `research`, `plan`, `implement` (for RPI chains)
165
- - `status`: `not_started`, `in_progress`, `completed`, `blocked`, `plan_ready`
166
-
167
- ### Dependencies
168
-
169
- | Tool | Purpose |
170
- |------|---------|
171
- | `create_dependency` | Create a directed edge between two nodes |
172
- | `delete_dependency` | Remove a dependency edge |
173
- | `list_dependencies` | List all edges in a plan |
174
- | `get_node_dependencies` | Get upstream/downstream/both for a node |
175
- | `analyze_impact` | What happens if a node is delayed/blocked/removed |
176
- | `get_critical_path` | Longest blocking chain through incomplete tasks |
177
-
178
- Dependency types:
179
- - `blocks` — Source must complete before target can start (hard constraint)
180
- - `requires` — Target needs output from source (softer)
181
- - `relates_to` — Informational link, no execution constraint
182
-
183
- Example — "Design API" blocks "Implement API":
184
90
  ```
185
- create_dependency({
186
- plan_id: "...",
187
- source_node_id: "<design_api_id>",
188
- target_node_id: "<implement_api_id>",
189
- dependency_type: "blocks"
190
- })
91
+ 1. claim_next_task(scope={ plan_id }, ttl_minutes=30) → exclusive ownership
92
+ 2. task_context(task_id, depth=4) periodically to refresh as work progresses
93
+ 3. update_task(...) for state transitions
94
+ 4. release_task(task_id, message='handoff to teammate') for explicit handoff
191
95
  ```
192
96
 
193
- Cycle detection is automatic — you cannot create a dependency that would form a cycle.
194
-
195
- ### Context & Analysis
196
-
197
- | Tool | Purpose |
198
- |------|---------|
199
- | `get_task_context` | **Primary.** Progressive context at depth 1-4 with token budgeting |
200
- | `get_plan_context` | Plan overview with phase summaries and knowledge |
201
- | `suggest_next_tasks` | Find ready tasks based on dependency analysis |
202
-
203
- ### Logging
204
-
205
- | Tool | Purpose |
206
- |------|---------|
207
- | `add_log` | Add a structured log entry to a node |
208
- | `get_logs` | Retrieve log entries for a node |
209
-
210
- Log types and when to use them:
211
- - `progress` — Status updates, milestones reached
212
- - `reasoning` — Analysis, findings, thought process (high value for downstream tasks)
213
- - `decision` — Choices made and why (highest value — persists through compaction)
214
- - `challenge` — Obstacles encountered, workarounds found
215
- - `comment` — General notes
216
-
217
- For research and plan tasks, use `reasoning` and `decision` log types — these are preserved when research output is compacted for downstream implement tasks.
218
-
219
- ### Goals
220
-
221
- | Tool | Purpose |
222
- |------|---------|
223
- | `check_goals_health` | Dashboard of all goals with health status, bottlenecks, and gaps |
224
- | `list_goals` | See all goals |
225
- | `create_goal` | Create a goal |
226
- | `update_goal` | Update goal details |
227
- | `get_goal` | Get goal with linked plans |
228
- | `link_plan_to_goal` | Connect a plan to a goal |
229
- | `unlink_plan_from_goal` | Disconnect a plan from a goal |
230
- | `goal_path` | Full dependency path to a goal — all tasks that contribute (direct achievers + upstream blockers) |
231
- | `goal_progress` | Completion percentage calculated from the goal's dependency graph |
232
- | `goal_knowledge_gaps` | Detect tasks on the goal path that lack knowledge — identifies where research is needed |
233
- | `add_achiever` | Link a task to a goal via an "achieves" edge (declares this task contributes to the goal) |
234
- | `remove_achiever` | Remove an achieves edge between a task and a goal |
235
-
236
- Goal-task linking creates a dependency graph from tasks up to goals. Use `add_achiever` to declare which tasks contribute to a goal, then `goal_path` and `goal_progress` to track completion through the full dependency chain. `goal_knowledge_gaps` checks which tasks on the path lack relevant knowledge in the temporal graph — useful for identifying where research is needed before implementation.
237
-
238
- ### Cross-Plan Dependencies
239
-
240
- | Tool | Purpose |
241
- |------|---------|
242
- | `create_cross_plan_dependency` | Create a dependency edge between nodes in different plans |
243
- | `list_cross_plan_dependencies` | List all edges that cross plan boundaries between specified plans |
244
- | `create_external_dependency` | Create an external blocker (vendor API, legal approval, etc.) that optionally blocks a task |
245
-
246
- Cross-plan dependencies work the same as regular dependencies (`blocks`, `requires`, `relates_to`) but connect nodes across plans. External dependencies represent blockers outside the system.
247
-
248
- ### Task Claiming
249
-
250
- | Tool | Purpose |
251
- |------|---------|
252
- | `claim_task` | Claim exclusive ownership of a task (prevents agent collisions) |
253
- | `release_task` | Release a previously claimed task |
254
-
255
- ### Alignment & Review
256
-
257
- Check if goals, plans, and knowledge are aligned. Run as a preflight check before starting work.
258
-
259
- | Tool | Purpose |
260
- |------|---------|
261
- | `check_coherence_pending` | See what needs review — returns stale plans/goals that changed since last check |
262
- | `run_coherence_check` | Evaluate a plan's quality (coverage, specificity, ordering, knowledge) and stamp as reviewed |
263
- | `assess_goal_quality` | Check how well-defined a goal is (clarity, measurability, actionability, knowledge, commitment) |
264
-
265
- ### Knowledge (Temporal Knowledge Graph)
266
-
267
- All knowledge is stored in the Graphiti temporal knowledge graph, which automatically extracts entities and relationships and enables cross-plan knowledge retrieval. The temporal graph is **cross-plan** and **persists across sessions** — anything recorded is available to all future agents and conversations within the organization.
268
-
269
- | Tool | Purpose |
270
- |------|---------|
271
- | `add_learning` | Record knowledge to the temporal graph with automatic entity extraction |
272
- | `recall_knowledge` | Search the temporal knowledge graph across ALL plans in the org |
273
- | `find_entities` | Search for entities (technologies, people, patterns, etc.) |
274
- | `check_contradictions` | Check if knowledge about a topic has changed; returns current and superseded (outdated) facts |
275
- | `get_recent_episodes` | Get recent knowledge episodes from the temporal graph (work session history) |
276
-
277
- `add_learning` params:
278
- - `content` (required) — The knowledge to record
279
- - `title` — Short title for the entry
280
- - `entry_type` — `decision`, `learning`, `context`, or `constraint`
281
- - `plan_id` — Associate with a specific plan
282
- - `node_id` — Associate with a specific node
283
-
284
- `recall_knowledge` params:
285
- - `query` (required) — Natural language search query
286
- - `max_results` — Number of results (default 10)
287
-
288
- `find_entities` params:
289
- - `query` (required) — Entity name or description to search for
290
- - `max_results` — Number of results (default 10)
291
-
292
- `check_contradictions` params:
293
- - `query` (required) — Topic to check for contradictions
294
- - `max_results` — Number of results (default 10)
295
-
296
- Use `check_contradictions` before making decisions based on past knowledge. It returns two sets of facts: **current** (valid) and **superseded** (outdated). If superseded facts exist, review them — the situation may have changed since you last encountered this topic.
297
-
298
- `get_recent_episodes` params:
299
- - `max_episodes` — Maximum episodes to return (default 20)
97
+ ## Goal coaching
300
98
 
301
- Use `get_recent_episodes` to review what has been learned recently across all plans. Useful for session start-up (understanding recent activity) or auditing what knowledge has been captured.
99
+ When a user expresses intent "I want to launch a feature", "we need better testing" coach them into a structured goal before creating it.
302
100
 
303
- ### Organizations
304
-
305
- | Tool | Purpose |
306
- |------|---------|
307
- | `list_organizations` | List your organizations |
308
- | `get_organization` | Organization details |
309
- | `create_organization` | Create an org |
310
- | `update_organization` | Update org details |
311
-
312
- ### Orientation
313
-
314
- | Tool | Purpose |
315
- |------|---------|
316
- | `get_started` | Guidance on how to use AgentPlanner — call when new or unsure how to approach a task |
317
-
318
- `get_started` accepts an optional `topic`: `overview`, `planning`, `execution`, `knowledge`, or `collaboration`.
319
-
320
- To understand a plan before starting, use `get_plan_context({ plan_id })` for the overview, then `get_task_context({ node_id, depth: 4 })` for deep context on a specific task.
321
-
322
- ### Other
323
-
324
- | Tool | Purpose |
325
- |------|---------|
326
- | `search` | Global search across plans and nodes |
327
- | `get_my_tasks` | Tasks assigned to you across all plans |
328
- | `import_plan_markdown` | Create a plan from markdown |
329
- | `export_plan_markdown` | Export a plan as markdown |
330
-
331
- ## RPI Chains (Research → Plan → Implement)
332
-
333
- For complex tasks that need investigation before implementation, decompose into an RPI chain:
334
-
335
- ```
336
- create_rpi_chain({
337
- plan_id: "<plan_id>",
338
- parent_id: "<phase_id>",
339
- title: "Auth Service",
340
- research_description: "Research auth patterns for microservices"
341
- })
342
101
  ```
102
+ 1. Ask 2-3 sharp questions to clarify success criteria
103
+ 2. list_goals to check if a similar goal already exists
104
+ 3. Use update_goal({ add_linked_plans, add_achievers }) to wire it up
343
105
 
344
- This creates 3 tasks with blocking dependencies wired automatically:
345
-
346
- ```
347
- Research (task_mode=research)
348
- │ Investigate the problem. Log findings as reasoning/decision entries.
349
- │ Mark completed when done → research output is auto-compacted.
350
-
351
- Plan (task_mode=plan)
352
- │ Gets compacted research automatically.
353
- │ Design the solution. Mark plan_ready for human review.
354
- ▼ Human approves → mark completed.
355
- Implement (task_mode=implement)
356
- │ Gets compacted research + plan context automatically.
357
- │ Build the solution.
358
- ▼ Mark completed when done.
106
+ Goal types:
107
+ - desire — aspirational, no firm deadline
108
+ - intention — promoted from desire when execution begins
359
109
  ```
360
110
 
361
- When to use RPI vs. a single task:
362
- - **Single task**: Simple, well-understood work. You know how to do it.
363
- - **RPI chain**: Complex or novel work. Needs investigation. Multiple approaches possible. Risk of rework.
111
+ Promote desire intention via `update_goal({ promote_to_intention: true })`.
364
112
 
365
- ## Status Values
113
+ ## Decision queueing
366
114
 
367
- | Status | Meaning | When to Set |
368
- |--------|---------|-------------|
369
- | `not_started` | No work begun | Default. Also set automatically when all blockers complete. |
370
- | `in_progress` | Actively being worked on | When you start working on a task. |
371
- | `completed` | Done and verified | When the work is finished. Triggers auto-unblock of downstream tasks. |
372
- | `blocked` | Cannot proceed | When waiting on a dependency, decision, or external input. Always log the reason. |
373
- | `plan_ready` | Awaiting human review | When a plan/research task is done and needs human approval before the next step. |
115
+ When you need human input, **always** use `queue_decision`. Never write decisions as knowledge episodes via `add_learning(entry_type='decision')` — that pattern was a workaround and is no longer needed.
374
116
 
375
- ## Patterns
376
-
377
- ### Starting a New Session
378
117
  ```
379
- 1. get_my_tasks({}) → see what's in progress or blocked across all plans
380
- 2. get_recent_episodes({ max_episodes: 10 }) → review recent knowledge across all plans
381
- 3. If resuming a task: get_task_context({ node_id: "...", depth: 2 })
382
- 4. If orienting on a plan: get_plan_context({ plan_id: "..." })
383
- 5. If starting fresh: suggest_next_tasks({ plan_id: "..." })
118
+ queue_decision({
119
+ plan_id: "<plan>",
120
+ node_id: "<task>" (optional),
121
+ title: "Approve npm publish v0.9.0?",
122
+ context: "Build is green, .mcpb tested in Claude Desktop, migration written. Risk: breaking change for any direct users.",
123
+ options: [
124
+ { label: "approve", description: "Publish now" },
125
+ { label: "defer", description: "Wait for QA round" }
126
+ ],
127
+ recommendation: "approve — small user base, MIGRATION_v0.9.md covers the diff",
128
+ smallest_input_needed: "approve|defer",
129
+ urgency: "normal"
130
+ })
384
131
  ```
385
132
 
386
- ### Breaking Down a Large Task
387
- ```
388
- 1. Identify the task is too complex for one pass
389
- 2. create_rpi_chain to decompose it
390
- 3. Start with the Research task
391
- 4. Log findings as reasoning/decision entries
392
- 5. Let the chain guide you through plan → implement
393
- ```
133
+ The decision shows up in Cowork briefings, autopilot loops, and the AgentPlanner UI for the human. Resolve via `resolve_decision({ decision_id, action: 'approve'|'defer'|'reject' })`.
394
134
 
395
- ### Handling Blockers
396
- ```
397
- 1. quick_status({ task_id: "...", status: "blocked" })
398
- 2. add_log({ node_id: "...", content: "Blocked on: <reason>", log_type: "challenge" })
399
- 3. suggest_next_tasks({ plan_id: "..." }) → find another task to work on
400
- ```
135
+ ## Knowledge: write decisions, recall context
401
136
 
402
- ### After Research or Investigation
403
- ```
404
- 1. Log findings to the task: add_log({ node_id: "...", content: "...", log_type: "reasoning" })
405
- 2. Persist important findings to the temporal knowledge graph:
406
- add_learning({ content: "Found that X works best because Y", title: "...", entry_type: "learning", plan_id: "..." })
407
- 3. This makes the knowledge discoverable across ALL plans and future sessions via recall_knowledge
408
- 4. Always use add_learning for findings you'd want to remember next session — the temporal graph is cross-plan and persistent
409
- ```
137
+ Use `add_learning` to record:
138
+ - A decision and its reasoning
139
+ - A discovered constraint or pattern
140
+ - Important context for future sessions
410
141
 
411
- ### Before Making an Important Decision
412
142
  ```
413
- 1. recall_knowledge({ query: "relevant topic" }) → check temporal graph for cross-plan knowledge
414
- 2. check_contradictions({ query: "relevant topic" }) verify nothing has been superseded since you last checked
415
- 3. Make the decision (using current, non-superseded facts)
416
- 4. add_log({ node_id: "...", content: "Decision: <what and why>", log_type: "decision" })
417
- 5. add_learning({ content: "Decision: <what and why>", title: "...", entry_type: "decision", plan_id: "..." })
143
+ add_learning({
144
+ content: "Switched to Neo4j Community from FalkorDB because SSPL conflicts with our SaaS license model.",
145
+ scope: { plan_id: "<plan>" },
146
+ entry_type: "decision"
147
+ })
418
148
  ```
419
149
 
420
- ### Understanding Plan Structure
421
- ```
422
- 1. get_plan_structure({ plan_id: "..." }) → hierarchical tree (minimal, fast)
423
- 2. get_plan_summary({ plan_id: "..." }) → statistics and phase progress
424
- 3. get_task_context({ node_id: "...", depth: 4 }) → deep context for a specific task
425
- ```
150
+ Use `recall_knowledge` before making decisions to check cross-plan history:
426
151
 
427
- ### Impact Analysis Before Changes
428
152
  ```
429
- 1. analyze_impact({ plan_id: "...", node_id: "...", scenario: "block" })
430
- See which tasks would be affected if this task is blocked
431
- 2. get_critical_path({ plan_id: "..." })
432
- See the longest dependency chain (what determines overall completion time)
153
+ recall_knowledge({
154
+ query: "knowledge graph backend choice",
155
+ result_kind: "all",
156
+ include_contradictions: true
157
+ })
433
158
  ```
434
159
 
435
- ## Autonomous Goal-Driven Loop
160
+ `result_kind` options: `'facts'`, `'entities'`, `'episodes'`, `'all'`. Default is `'all'` — narrow it to control payload size.
436
161
 
437
- For agents that run periodically (e.g., via cron or event triggers), this is the recommended execution pattern:
162
+ ## Migrating from v0.8.x
438
163
 
439
- ### Phase 1: Orient
440
- ```
441
- check_goals_health()
442
- ```
443
- Identify which goals are stale, at risk, or need attention. Prioritize goals by health status: stale first, then at_risk, then on_track.
164
+ v0.9.0 is a breaking release. The old 63-tool surface is gone. See [MIGRATION_v0.9.md](docs/MIGRATION_v0.9.md) for the full mapping. Highlights:
444
165
 
445
- ### Phase 2: Plan
446
- For each goal needing attention:
447
- ```
448
- get_goal({goal_id}) # Understand the objective
449
- recall_knowledge({query}) # What do we already know?
450
- quick_plan({title, tasks, goal_id}) # Create/update plan linked to goal
451
- ```
166
+ - `check_goals_health` + `get_my_tasks` + `get_recent_episodes` + `check_coherence_pending` → `briefing`
167
+ - `quick_status` + `add_log` + `release_task` → `update_task`
168
+ - `suggest_next_tasks` + `claim_task` + `get_task_context` → `claim_next_task`
169
+ - `add_learning(entry_type='decision')` `queue_decision` (real decision queue, not knowledge graph)
170
+ - `get_goal` + `goal_path` + `goal_progress` + `assess_goal_quality` → `goal_state`
171
+ - `recall_knowledge` + `find_entities` + `get_recent_episodes` + `check_contradictions` → `recall_knowledge`
452
172
 
453
- ### Phase 3: Decompose
454
- For complex tasks, use RPI chains:
455
- ```
456
- create_rpi_chain({plan_id, parent_id, topic}) # Research → Plan → Implement
457
- ```
173
+ CRUD-shaped admin tools (`create_node`, `update_plan`, `delete_*`) are removed in v0.9.0. They return as `ap_admin_*` namespace in v1.0.0. Use the AgentPlanner REST API directly if you need them now.
458
174
 
459
- ### Phase 4: Execute
460
- ```
461
- suggest_next_tasks({plan_id}) # What's unblocked?
462
- claim_task({task_id, plan_id}) # Claim exclusive ownership
463
- get_task_context({node_id, depth: 3}) # Load context
464
- # ... do the work ...
465
- quick_log({task_id, plan_id, message}) # Document progress
466
- add_learning({content, plan_id}) # Capture knowledge
467
- quick_status({task_id, plan_id, status: "completed"}) # Triggers propagation
468
- ```
175
+ ## Principles
469
176
 
470
- ### Phase 5: Report
471
- ```
472
- quick_log({task_id, plan_id, message: "Summary of work done", log_type: "completion"})
473
- ```
177
+ - Tools are intent-shaped, not CRUD-shaped — name what you want to accomplish, not which row to mutate
178
+ - Reads are bundled — minimize round trips, especially for refresh-loops
179
+ - Writes are atomic where possible `update_task` does status + log + release + learning in one call
180
+ - `as_of` on every response — use for stale-data warnings on live artifacts
181
+ - Decisions are first-class — never fake them via the knowledge graph
182
+ - Knowledge persists across plans and sessions — write learnings, recall liberally
474
183
 
475
- ### Key Principles
476
- - **Always claim before working** — prevents collisions with other agents
477
- - **Always link plans to goals** — enables health tracking and progress reporting
478
- - **Log decisions and learnings** — future agents and humans need your reasoning
479
- - **Check for contradictions** — `check_contradictions()` before acting on old knowledge
480
- - **Let propagation work** — completing blockers auto-unblocks downstream tasks
481
-
482
- ## Rules
483
-
484
- 1. **Always load context before working** — never guess what a task requires.
485
- 2. **Log as you work** — not just at the end. Frequent logs help humans and future agents.
486
- 3. **Use `decision` log type for important choices** — these survive research compaction.
487
- 4. **Check dependencies** — don't start a task if its blockers aren't completed. Use `suggest_next_tasks`.
488
- 5. **Mark status transitions promptly** — `in_progress` when starting, `completed` when done, `blocked` when stuck.
489
- 6. **Search knowledge before deciding** — use `recall_knowledge` to check the temporal graph and `check_contradictions` to verify nothing is outdated. Prior decisions may already exist across other plans.
490
- 7. **Use RPI for complex work** — if you're uncertain about the approach, decompose first.
491
- 8. **Don't modify tasks you haven't claimed** — mark `in_progress` before making changes.
184
+ Call `get_started` from any AgentPlanner-aware agent for an up-to-date reference.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-planner-mcp",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "MCP server for AgentPlanner — AI agent orchestration with planning, dependencies, knowledge graphs, and human oversight",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Shared helpers for BDI tool implementations.
3
+ */
4
+
5
+ function asOf() {
6
+ return new Date().toISOString();
7
+ }
8
+
9
+ function formatResponse(data) {
10
+ if (data && data.error) {
11
+ return {
12
+ isError: true,
13
+ content: [{ type: 'text', text: data.error }],
14
+ };
15
+ }
16
+ return {
17
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
18
+ };
19
+ }
20
+
21
+ function errorResponse(error_type, message, extra = {}) {
22
+ return formatResponse({ error: message, error_type, ...extra });
23
+ }
24
+
25
+ function safeArray(value) {
26
+ return Array.isArray(value) ? value : [];
27
+ }
28
+
29
+ module.exports = { asOf, formatResponse, errorResponse, safeArray };