agent-planner-mcp 0.6.2 → 0.7.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/AGENT_GUIDE.md CHANGED
@@ -5,6 +5,8 @@ This guide is optimized for AI agents using AgentPlanner MCP tools.
5
5
  ## Core Workflow
6
6
 
7
7
  ```
8
+ 0. check_coherence_pending() → See if plans/goals need alignment review
9
+ → If stale items: run_coherence_check(plan_id) on each
8
10
  1. suggest_next_tasks(plan_id) → Find ready tasks (dependency-aware)
9
11
  2. get_task_context(node_id, depth=2) → Load progressive context
10
12
  3. Work on tasks (quick_status to track)
@@ -15,6 +17,16 @@ This guide is optimized for AI agents using AgentPlanner MCP tools.
15
17
 
16
18
  ## Essential Tools
17
19
 
20
+ ### Preflight: Alignment Check
21
+ ```javascript
22
+ check_coherence_pending()
23
+ // → Returns stale plans/goals that changed since last review
24
+
25
+ run_coherence_check({ plan_id: "..." })
26
+ // → Evaluates quality (coverage, specificity, ordering, knowledge)
27
+ // → Stamps plan as reviewed, returns score breakdown
28
+ ```
29
+
18
30
  ### Before Starting Work
19
31
  ```javascript
20
32
  get_plan_context({ plan_id: "..." })
package/README.md CHANGED
@@ -149,6 +149,10 @@ Add the same JSON config to your Cline MCP settings in VS Code.
149
149
  - `claim_task` / `release_task` - Task locking
150
150
  - `share_plan` - Collaboration management
151
151
 
152
+ ### Alignment & Review
153
+ - `check_coherence_pending` - See which plans/goals need alignment review (staleness check)
154
+ - `run_coherence_check` - Evaluate plan quality and stamp as reviewed
155
+
152
156
  ## LLM Skill Reference
153
157
 
154
158
  See **[SKILL.md](./SKILL.md)** for a complete reference designed to be consumed by LLMs. Include it in system prompts or agent configurations to give any LLM full knowledge of how to use AgentPlanner tools effectively.
package/SKILL.md CHANGED
@@ -31,12 +31,43 @@ You have access to the AgentPlanner MCP tools. AgentPlanner is a collaborative p
31
31
  - You need to coordinate with humans on multi-step projects
32
32
  - You want to persist findings, decisions, or progress across sessions
33
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
35
+
36
+ ## Goal Coaching
37
+
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:
39
+
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
+ ```
54
+
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
61
+
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.
34
63
 
35
64
  ## Workflow
36
65
 
37
66
  Follow this sequence when working on a plan:
38
67
 
39
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
40
71
  1. ORIENT → suggest_next_tasks or get_task_context to understand what needs doing
41
72
  2. CLAIM → quick_status to mark the task in_progress
42
73
  3. WORK → Do the actual work (code, research, analysis, etc.)
@@ -46,6 +77,22 @@ Follow this sequence when working on a plan:
46
77
  6. NEXT → suggest_next_tasks to find the next ready task
47
78
  ```
48
79
 
80
+ ### Preflight: Alignment Check
81
+
82
+ Before diving into tasks, check if goals, plans, and knowledge are aligned:
83
+
84
+ ```
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
+ ```
93
+
94
+ This is a lightweight check (seconds, not minutes). Do it at the start of each work session. Skip if you already checked recently.
95
+
49
96
  ## Loading Context
50
97
 
51
98
  Always load context before starting work. Use `get_task_context` — it gives you exactly the right amount of information based on depth level.
@@ -205,6 +252,16 @@ Cross-plan dependencies work the same as regular dependencies (`blocks`, `requir
205
252
  | `claim_task` | Claim exclusive ownership of a task (prevents agent collisions) |
206
253
  | `release_task` | Release a previously claimed task |
207
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
+
208
265
  ### Knowledge (Temporal Knowledge Graph)
209
266
 
210
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-planner-mcp",
3
- "version": "0.6.2",
3
+ "version": "0.7.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": {
package/src/api-client.js CHANGED
@@ -613,6 +613,11 @@ const goals = {
613
613
  const response = await apiClient.get('/goals/dashboard');
614
614
  return response.data;
615
615
  },
616
+
617
+ getQuality: async (goalId) => {
618
+ const response = await apiClient.get(`/goals/${goalId}/quality`);
619
+ return response.data;
620
+ },
616
621
  };
617
622
 
618
623
  /**
@@ -919,6 +924,13 @@ function createApiClient(token) {
919
924
  // Export the axios instance for direct use
920
925
  const axiosInstance = apiClient;
921
926
 
927
+ // ─── Coherence ────────────────────────────────────────────────
928
+ const coherence = {
929
+ getPending: () => apiClient.get('/coherence/pending').then(r => r.data),
930
+ runCheck: (planId, goalId) => apiClient.post(`/plans/${planId}/coherence/check`, goalId ? { goal_id: goalId } : {}).then(r => r.data),
931
+ getPlanCoherence: (planId) => apiClient.get(`/plans/${planId}/coherence`).then(r => r.data),
932
+ };
933
+
922
934
  module.exports = {
923
935
  plans,
924
936
  nodes,
@@ -932,6 +944,7 @@ module.exports = {
932
944
  context,
933
945
  graphiti,
934
946
  dependencies,
947
+ coherence,
935
948
  axiosInstance, // Export for direct API calls
936
949
  createApiClient // Factory for per-session clients (HTTP mode)
937
950
  };
package/src/tools.js CHANGED
@@ -178,6 +178,41 @@ function setupTools(server, apiClientOverride) {
178
178
  }
179
179
  },
180
180
 
181
+ // ========================================
182
+ // COHERENCE - Check alignment across goals/plans/knowledge
183
+ // ========================================
184
+ {
185
+ name: "check_coherence_pending",
186
+ description: "Check what needs coherence review. Returns stale plans and goals that have changed since their last coherence check. Call this at the start of a maintenance cycle to discover what needs attention. Uses timestamp comparison (updated_at vs coherence_checked_at) — no expensive processing.",
187
+ inputSchema: {
188
+ type: "object",
189
+ properties: {}
190
+ }
191
+ },
192
+ {
193
+ name: "run_coherence_check",
194
+ description: "Run a coherence check on a specific plan. Evaluates quality (coverage, specificity, ordering, knowledge completeness), flags contradictions, and stamps the plan as checked. Returns quality breakdown with sub-scores and rationale.",
195
+ inputSchema: {
196
+ type: "object",
197
+ properties: {
198
+ plan_id: { type: "string", description: "Plan ID to check" },
199
+ goal_id: { type: "string", description: "Optional goal ID to evaluate coverage against" }
200
+ },
201
+ required: ["plan_id"]
202
+ }
203
+ },
204
+ {
205
+ name: "assess_goal_quality",
206
+ description: "Assess how well-defined a goal is. Evaluates 5 dimensions: clarity (title+description), measurability (success criteria), actionability (linked plans), knowledge grounding (related facts), and commitment (desire vs intention, deadline). Returns score, dimension breakdown, and specific improvement suggestions. Use this when helping users define or refine goals.",
207
+ inputSchema: {
208
+ type: "object",
209
+ properties: {
210
+ goal_id: { type: "string", description: "Goal ID to assess" }
211
+ },
212
+ required: ["goal_id"]
213
+ }
214
+ },
215
+
181
216
  // ========================================
182
217
  // CONTEXT LOADING - Get everything you need
183
218
  // Use before starting work on a plan/goal
@@ -2233,12 +2268,14 @@ function setupTools(server, apiClientOverride) {
2233
2268
  "Knowledge - Persistent storage for decisions, context, constraints, and learnings"
2234
2269
  ],
2235
2270
  recommended_workflow: [
2236
- "1. Check list_goals to understand current objectives",
2237
- "2. Use list_plans to see existing plans",
2238
- "3. Before working on a plan, use get_plan_context to get the full picture",
2239
- "4. Update task statuses as you work (update_node with status)",
2240
- "5. Store important decisions and learnings using add_learning",
2241
- "6. Check recall_knowledge before making decisions to see past context"
2271
+ "1. PREFLIGHT: check_coherence_pending to see if any plans/goals need alignment review",
2272
+ " If stale items found, run_coherence_check on each before starting task work",
2273
+ "2. Check list_goals to understand current objectives",
2274
+ "3. Use list_plans to see existing plans",
2275
+ "4. Before working on a plan, use get_plan_context to get the full picture",
2276
+ "5. Update task statuses as you work (update_node with status)",
2277
+ "6. Store important decisions and learnings using add_learning",
2278
+ "7. Check recall_knowledge before making decisions to see past context"
2242
2279
  ],
2243
2280
  quick_tips: [
2244
2281
  "Always capture WHY decisions were made, not just WHAT",
@@ -2375,6 +2412,43 @@ function setupTools(server, apiClientOverride) {
2375
2412
  });
2376
2413
  }
2377
2414
 
2415
+ // ===== COHERENCE =====
2416
+ if (name === "check_coherence_pending") {
2417
+ const result = await apiClient.coherence.getPending();
2418
+ const totalStale = (result.stale_plans?.length || 0) + (result.stale_goals?.length || 0);
2419
+ return formatResponse({
2420
+ ...result,
2421
+ tip: totalStale > 0
2422
+ ? "Review stale items. For each stale plan, call run_coherence_check to evaluate quality and stamp as checked."
2423
+ : "Everything is up to date. No coherence review needed."
2424
+ });
2425
+ }
2426
+
2427
+ if (name === "assess_goal_quality") {
2428
+ const { goal_id } = args;
2429
+ const result = await apiClient.goals.getQuality(goal_id);
2430
+ const lowDims = Object.entries(result.dimensions || {})
2431
+ .filter(([, v]) => v.score < 0.5)
2432
+ .map(([k]) => k);
2433
+ return formatResponse({
2434
+ ...result,
2435
+ tip: result.suggestions?.length > 0
2436
+ ? `Goal needs improvement in: ${lowDims.join(', ') || 'minor areas'}. Follow the suggestions to strengthen it.`
2437
+ : 'Goal is well-defined. Ready for agent execution.'
2438
+ });
2439
+ }
2440
+
2441
+ if (name === "run_coherence_check") {
2442
+ const { plan_id, goal_id } = args;
2443
+ const result = await apiClient.coherence.runCheck(plan_id, goal_id);
2444
+ return formatResponse({
2445
+ ...result,
2446
+ tip: result.coherence_issues_count > 0
2447
+ ? `${result.coherence_issues_count} coherence issues found. Review tasks with stale_beliefs or contradiction_detected status.`
2448
+ : "Plan is coherent. Quality score and checked_at timestamp updated."
2449
+ });
2450
+ }
2451
+
2378
2452
  // Tool not found
2379
2453
  throw new Error(`Unknown tool: ${name}`);
2380
2454
  } catch (error) {