@agllama/mcp 0.6.25 → 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.
Files changed (40) hide show
  1. package/dist/api-client.d.ts +30 -2
  2. package/dist/api-client.d.ts.map +1 -1
  3. package/dist/api-client.js +28 -4
  4. package/dist/api-client.js.map +1 -1
  5. package/dist/server.d.ts.map +1 -1
  6. package/dist/server.js +60 -1
  7. package/dist/server.js.map +1 -1
  8. package/dist/tools/__tests__/prScorer.test.d.ts +2 -0
  9. package/dist/tools/__tests__/prScorer.test.d.ts.map +1 -0
  10. package/dist/tools/__tests__/prScorer.test.js +537 -0
  11. package/dist/tools/__tests__/prScorer.test.js.map +1 -0
  12. package/dist/tools/connect.d.ts.map +1 -1
  13. package/dist/tools/connect.js +21 -0
  14. package/dist/tools/connect.js.map +1 -1
  15. package/dist/tools/devLinks.d.ts +5 -22
  16. package/dist/tools/devLinks.d.ts.map +1 -1
  17. package/dist/tools/devLinks.js +15 -110
  18. package/dist/tools/devLinks.js.map +1 -1
  19. package/dist/tools/help.d.ts.map +1 -1
  20. package/dist/tools/help.js +488 -110
  21. package/dist/tools/help.js.map +1 -1
  22. package/dist/tools/index.d.ts +3 -0
  23. package/dist/tools/index.d.ts.map +1 -1
  24. package/dist/tools/index.js +3 -0
  25. package/dist/tools/index.js.map +1 -1
  26. package/dist/tools/prScorer.d.ts +41 -0
  27. package/dist/tools/prScorer.d.ts.map +1 -0
  28. package/dist/tools/prScorer.js +182 -0
  29. package/dist/tools/prScorer.js.map +1 -0
  30. package/dist/tools/prScorerHistory.d.ts +53 -0
  31. package/dist/tools/prScorerHistory.d.ts.map +1 -0
  32. package/dist/tools/prScorerHistory.js +251 -0
  33. package/dist/tools/prScorerHistory.js.map +1 -0
  34. package/dist/tools/prScorerSchema.d.ts +9 -0
  35. package/dist/tools/prScorerSchema.d.ts.map +1 -0
  36. package/dist/tools/prScorerSchema.js +217 -0
  37. package/dist/tools/prScorerSchema.js.map +1 -0
  38. package/dist/types.d.ts +19 -0
  39. package/dist/types.d.ts.map +1 -1
  40. package/package.json +2 -2
@@ -5,40 +5,55 @@ export const helpToolSchema = z.object({
5
5
  topic: z
6
6
  .string()
7
7
  .optional()
8
- .describe('Optional: tool name (e.g., "llama_create_issue") or category (e.g., "issues", "sprints")'),
8
+ .describe('Optional: tool name (e.g., "llama_create_issue") or category (e.g., "issues", "skills", "agents", "prompts")'),
9
9
  });
10
- // Tool documentation organized by category
11
10
  const TOOL_DOCS = {
12
11
  overview: {
13
12
  title: 'Llama MCP Tools Overview',
14
- description: `Llama MCP provides 52 tools for project management. Use llama_help with a topic for details.
13
+ description: `Llama MCP exposes 87 tools for AI-driven project management. Use llama_help with a topic for details.
15
14
 
16
- **Quick Start:**
17
- 1. llama_connect - Test your API connection
18
- 2. llama_context - Get project snapshot (statuses, sprints, team, backlog)
19
- 3. Use other tools with IDs from context
15
+ **First-time setup (recommended):**
16
+ 1. llama_connect verify auth. If the response includes \`firstTimeHint\`, the account has no projects — offer the Getting Started Pack.
17
+ 2. llama_set_context { orgSlug, projectKey } set defaults so you don't repeat them.
18
+ 3. llama_context full project snapshot (statuses, sprints, team, backlog).
20
19
 
21
- **Categories:** context, session, organizations, projects, issues, sprints, boards, backlog, comments, labels, members, links, search, plans, skills, errors, decomposition
20
+ **Getting Started Pack:** llama_install_getting_started_pack installs 4 core skills + a board template in one step. Call once with no \`confirm\` to preview, then again with \`confirm: true\` after the user approves.
21
+
22
+ **Categories:** context, session, onboarding, organizations, projects, issues, status, sprints, boards, backlog, comments, labels, members, links, search, plans, skills, agents, prompts, attachments, refinement, roadmap, rollup, errors, notifications, import, patterns
22
23
 
23
24
  **Examples:**
24
- - llama_help { topic: "issues" } - Learn about issue tools
25
- - llama_help { topic: "llama_create_issue" } - Details for a specific tool`,
25
+ - llama_help { topic: "issues" } list issue tools
26
+ - llama_help { topic: "skills" } skills + agents + prompts overview
27
+ - llama_help { topic: "llama_create_issue" } — details for a specific tool
28
+ - llama_help { topic: "patterns" } — common multi-tool flows`,
26
29
  },
27
30
  context: {
28
31
  title: 'Context Tools',
29
32
  tools: [
30
33
  {
31
34
  name: 'llama_connect',
32
- description: 'Test API connection and get current user info',
35
+ description: 'Test API connection and get current user info. Includes a firstTimeHint when the account has no projects.',
33
36
  params: 'None',
34
- use: 'Starting a session to verify authentication',
37
+ use: 'Starting a session to verify authentication. Watch for `firstTimeHint` in the response — that means the user is brand new and the Getting Started Pack should be offered.',
35
38
  },
36
39
  {
37
40
  name: 'llama_context',
38
- description: 'Get complete project snapshot: workflow statuses, sprints, backlog, team',
39
- params: 'orgSlug (required), projectKey (required)',
40
- use: 'Before creating/updating issues to get valid IDs',
41
- returns: 'Project info, org info, workflow statuses, active sprint, pending sprints, backlog (first 50), team members',
41
+ description: 'Get complete project snapshot: workflow statuses, sprints, backlog, team. Use llama_set_context first to make orgSlug/projectKey optional.',
42
+ params: 'orgSlug (optional, session default), projectKey (optional, session default), compact (optional)',
43
+ use: 'Before creating/updating issues to get valid status IDs, sprint IDs, and assignee IDs',
44
+ returns: 'Project info, org info, workflow statuses, active sprint with issues, pending sprints, backlog (first 50), team members',
45
+ },
46
+ {
47
+ name: 'llama_help',
48
+ description: 'This tool. Returns categorized docs.',
49
+ params: 'topic (optional)',
50
+ use: 'When you forget how to use a tool',
51
+ },
52
+ {
53
+ name: 'llama_get_user_docs',
54
+ description: 'Fetch full AG-Llama user documentation (quickstart + user guide).',
55
+ params: 'None',
56
+ use: 'Answering user questions about AG-Llama features, AI automation, MCP usage',
42
57
  },
43
58
  ],
44
59
  },
@@ -62,7 +77,7 @@ const TOOL_DOCS = {
62
77
  {
63
78
  name: 'llama_save_state',
64
79
  description: 'Checkpoint your execution state. State is replaced (not merged) on each call. Returned by llama_resume.',
65
- params: 'currentIssueKey (optional), currentPhase (optional: planning|coding|review|testing|custom), storyQueue (optional: array of issue keys), completedStories (optional: array), workflowId (optional), workflowStep (optional), notes (optional: max 2000 chars)',
80
+ params: 'currentIssueKey (optional), currentPhase (optional: planning|coding|review|testing|custom), storyQueue (optional), completedStories (optional), workflowId (optional), workflowStep (optional), notes (optional: max 2000 chars)',
66
81
  use: 'Call when starting a story, changing phases, completing work, or before any pause',
67
82
  example: `{
68
83
  "currentIssueKey": "PROJ-42",
@@ -72,6 +87,42 @@ const TOOL_DOCS = {
72
87
  "notes": "Backend done, working on frontend component"
73
88
  }`,
74
89
  },
90
+ {
91
+ name: 'llama_list_sessions',
92
+ description: 'List active sessions for the current user',
93
+ params: 'None',
94
+ use: 'Check what other sessions exist before deleting',
95
+ },
96
+ {
97
+ name: 'llama_delete_session',
98
+ description: 'Delete a specific session by ID, or all of the current user\'s sessions',
99
+ params: 'sessionId (optional — omit to delete all)',
100
+ use: 'Clean up stale sessions',
101
+ },
102
+ {
103
+ name: 'llama_update_claude_session_notes',
104
+ description: 'Append durable notes to the current session — surfaced on next llama_resume',
105
+ params: 'notes (required: string, max 4000 chars)',
106
+ use: 'Capture in-flight work, blockers, or decisions before /clear so they survive into the next session',
107
+ },
108
+ ],
109
+ },
110
+ onboarding: {
111
+ title: 'Onboarding — Getting Started Pack',
112
+ description: 'New project or new user? Install the Getting Started Pack to get a working baseline in one step: 4 core Claude skills + a configured board.',
113
+ tools: [
114
+ {
115
+ name: 'llama_install_getting_started_pack',
116
+ description: 'Install the Getting Started Pack into a project. Two-step UX — preview first, then confirm.',
117
+ params: 'orgSlug (optional, session default), projectKey (optional, session default), confirm (optional, default false)',
118
+ use: 'Call without confirm to preview. Show the user the preview and ask for approval. Call again with confirm=true only after they say yes. After install, write each SKILL.md file to .claude/skills/<id>/SKILL.md and tell the user to run /getting-started-walkthrough.',
119
+ returns: 'Step 1 (preview): requiresConfirmation=true, preview, warning. Step 2 (confirmed): skill manifest with file paths and markdown content.',
120
+ example: `// Step 1 — preview
121
+ { "orgSlug": "my-team", "projectKey": "PROJ" }
122
+
123
+ // Step 2 — install (after user approves preview)
124
+ { "orgSlug": "my-team", "projectKey": "PROJ", "confirm": true }`,
125
+ },
75
126
  ],
76
127
  },
77
128
  organizations: {
@@ -133,7 +184,7 @@ Optional: description, priority (CRITICAL|HIGH|MEDIUM|LOW|TRIVIAL), assigneeId,
133
184
  },
134
185
  {
135
186
  name: 'llama_update_issue',
136
- description: 'Update issue fields. Only include fields to change. Set assigneeId/sprintId to null to unassign.',
187
+ description: 'Update issue fields. Only include fields to change. Set assigneeId/sprintId to null to unassign. Set statusId to transition status.',
137
188
  params: `orgSlug (required), projectKey (required), issueKey (required)
138
189
  Optional: summary, description, type, priority, statusId, assigneeId, sprintId, estimate, labels`,
139
190
  },
@@ -142,6 +193,30 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
142
193
  description: 'Soft-delete an issue (can be restored)',
143
194
  params: 'orgSlug (required), projectKey (required), issueKey (required)',
144
195
  },
196
+ {
197
+ name: 'llama_batch_create_issues',
198
+ description: 'Create up to 50 issues in one call. Returns issueKeys for each created issue.',
199
+ params: 'orgSlug (required), projectKey (required), issues (required: array of issue objects)',
200
+ use: 'Bulk story creation from a plan, importing checklists',
201
+ },
202
+ {
203
+ name: 'llama_batch_update_issues',
204
+ description: 'Update up to 50 issues in one call.',
205
+ params: 'updates (required: array of {issueKey, ...fields})',
206
+ use: 'Bulk reassignment, status sweeps, sprint reshuffles',
207
+ },
208
+ ],
209
+ },
210
+ status: {
211
+ title: 'Workflow Status Tools',
212
+ description: 'Add or remove statuses (board columns) in a project workflow. Statuses are referenced by ID in llama_update_issue.',
213
+ tools: [
214
+ {
215
+ name: 'llama_manage_status',
216
+ description: 'Add or delete a workflow status (board column)',
217
+ params: 'action (required: add|delete), orgSlug (required), projectKey (required), workflowId (required), name/category/color (for add), statusId (for delete)',
218
+ use: 'Use llama_context to get workflowId first',
219
+ },
145
220
  ],
146
221
  },
147
222
  sprints: {
@@ -172,10 +247,22 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
172
247
  description: 'Complete an active sprint',
173
248
  params: 'sprintId (required), moveIncompleteToBacklog (optional: default true), moveIncompleteToSprintId (optional)',
174
249
  },
250
+ {
251
+ name: 'llama_reopen_sprint',
252
+ description: 'Reopen a completed sprint',
253
+ params: 'sprintId (required)',
254
+ use: 'Recover from accidental sprint completion',
255
+ },
175
256
  {
176
257
  name: 'llama_update_sprint',
177
- description: 'Update sprint name, goal, or dates',
178
- params: 'sprintId (required), name (optional), goal (optional), startDate (optional), endDate (optional)',
258
+ description: 'Update sprint name, goal, or AI completion instructions',
259
+ params: 'sprintId (required), name (optional), goal (optional), aiCompletionInstructions (optional)',
260
+ },
261
+ {
262
+ name: 'llama_override_sprint_dates',
263
+ description: 'Override sprint start or end date directly (bypasses the start/complete state machine)',
264
+ params: 'sprintId (required), startDate (optional), endDate (optional)',
265
+ use: 'Fix incorrect dates without changing sprint state',
179
266
  },
180
267
  {
181
268
  name: 'llama_delete_sprint',
@@ -187,6 +274,21 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
187
274
  description: 'Move issues to a sprint. Pass null for sprintId to move to backlog.',
188
275
  params: 'orgSlug (required), projectKey (required), issueKeys (required: array, max 20), sprintId (required: sprint ID or null for backlog)',
189
276
  },
277
+ {
278
+ name: 'llama_reorder_sprint',
279
+ description: 'Reorder issues within a sprint',
280
+ params: 'sprintId (required), issueKeys (required: array in desired order)',
281
+ },
282
+ {
283
+ name: 'llama_get_sprint_analytics',
284
+ description: 'Get burndown, completion %, and velocity for a sprint',
285
+ params: 'sprintId (required)',
286
+ },
287
+ {
288
+ name: 'llama_get_velocity',
289
+ description: 'Get team velocity (avg points/sprint) over recent sprints',
290
+ params: 'orgSlug (required), projectKey (required), sprintCount (optional: default 5)',
291
+ },
190
292
  ],
191
293
  },
192
294
  boards: {
@@ -209,7 +311,7 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
209
311
  },
210
312
  {
211
313
  name: 'llama_get_board_config',
212
- description: 'Get full board configuration including all column AI settings',
314
+ description: 'Get full board config including all column AI settings',
213
315
  params: 'orgSlug (required), projectKey (required)',
214
316
  use: 'View AI agent configurations for all board columns',
215
317
  },
@@ -219,6 +321,21 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
219
321
  params: 'boardId (required), columnId (required), aiEnabled (optional), agentType (optional), instructions (optional), requiredActions (optional), contextHints (optional), color (optional), icon (optional)',
220
322
  use: 'Configure AI behavior for specific board columns',
221
323
  },
324
+ {
325
+ name: 'llama_list_board_templates',
326
+ description: 'List available board templates with their column AI configs',
327
+ params: 'None',
328
+ },
329
+ {
330
+ name: 'llama_apply_board_template',
331
+ description: 'Apply a template to set up a board with pre-configured AI columns',
332
+ params: 'orgSlug (required), projectKey (required), boardId (required), templateId (required)',
333
+ },
334
+ {
335
+ name: 'llama_clone_board_config',
336
+ description: 'Clone full workflow + board config (statuses, transitions, columns, AI) from one project to another',
337
+ params: 'sourceOrgSlug (required), sourceProjectKey (required), targetOrgSlug (required), targetProjectKey (required)',
338
+ },
222
339
  ],
223
340
  },
224
341
  backlog: {
@@ -230,6 +347,11 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
230
347
  params: 'orgSlug (required), projectKey (required)',
231
348
  returns: 'Total count, breakdown by type, issue list',
232
349
  },
350
+ {
351
+ name: 'llama_reorder_backlog',
352
+ description: 'Reorder issues in the backlog',
353
+ params: 'orgSlug (required), projectKey (required), issueKeys (required: array in desired order)',
354
+ },
233
355
  ],
234
356
  },
235
357
  comments: {
@@ -239,7 +361,7 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
239
361
  name: 'llama_manage_comment',
240
362
  description: 'List, add, update, or delete comments on issues or plans',
241
363
  params: 'action (required: list|add|update|delete), target (optional: issue|plan, default issue), issueKey (for issues), planId (for plans), commentId (for update/delete), content (for add/update)',
242
- use: 'Manage comments on both issues and plans with a single tool',
364
+ use: 'Single tool for all comment operations on both issues and plans',
243
365
  },
244
366
  ],
245
367
  },
@@ -252,14 +374,9 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
252
374
  params: 'orgSlug (required), projectKey (required)',
253
375
  },
254
376
  {
255
- name: 'llama_create_label',
256
- description: 'Create a new label',
257
- params: 'orgSlug (required), projectKey (required), name (required), color (required: hex e.g., "#ff0000"), description (optional)',
258
- },
259
- {
260
- name: 'llama_delete_label',
261
- description: 'Delete a label (removes from all issues)',
262
- params: 'orgSlug (required), projectKey (required), labelName (required)',
377
+ name: 'llama_manage_label',
378
+ description: 'Create or delete a project label. Delete removes from all issues.',
379
+ params: 'action (required: create|delete), orgSlug (required), projectKey (required), name (for create), color (for create: hex), description (optional), labelName (for delete)',
263
380
  },
264
381
  ],
265
382
  },
@@ -281,7 +398,7 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
281
398
  ],
282
399
  },
283
400
  links: {
284
- title: 'Issue Link Tools',
401
+ title: 'Issue & Plan Link Tools',
285
402
  tools: [
286
403
  {
287
404
  name: 'llama_manage_issue_link',
@@ -291,7 +408,7 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
291
408
  },
292
409
  {
293
410
  name: 'llama_batch_link_issues',
294
- description: 'Create multiple issue links in one call (max 50). More efficient for bulk operations.',
411
+ description: 'Create multiple issue links in one call (max 50)',
295
412
  params: 'links (required: array of {sourceIssueKey, targetIssueKey, type})',
296
413
  example: `{
297
414
  "links": [
@@ -301,6 +418,12 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
301
418
  }`,
302
419
  use: 'Linking multiple stories to an EPIC, setting up dependency chains',
303
420
  },
421
+ {
422
+ name: 'llama_manage_plan_link',
423
+ description: 'Create or delete a link between an issue and a plan',
424
+ params: 'action (required: create|delete), issueKey (required), planId (for create), linkId (for delete)',
425
+ use: 'Tie implementation issues back to the plan they came from',
426
+ },
304
427
  ],
305
428
  },
306
429
  search: {
@@ -319,156 +442,419 @@ Optional: summary, description, type, priority, statusId, assigneeId, sprintId,
319
442
  },
320
443
  ],
321
444
  },
322
- // documents - disabled (feature not ready yet)
323
- // To re-enable, uncomment this block and the corresponding tools in server.ts
445
+ plans: {
446
+ title: 'Plan Tools',
447
+ description: 'Plans are markdown pages for product specs, PRDs, and roadmaps. Project-scoped, folder-organized, link to issues.',
448
+ tools: [
449
+ {
450
+ name: 'llama_list_plans',
451
+ description: 'List plans in a project (supports folder + search filters)',
452
+ params: 'orgSlug (required), projectKey (required), folderId (optional), search (optional)',
453
+ },
454
+ {
455
+ name: 'llama_get_plan',
456
+ description: 'Get a plan by ID with full content + linked issues',
457
+ params: 'orgSlug (required), projectKey (required), planId (required)',
458
+ },
459
+ {
460
+ name: 'llama_get_plan_tree',
461
+ description: 'Get a plan and its sub-plans recursively',
462
+ params: 'orgSlug (required), projectKey (required), planId (required)',
463
+ },
464
+ {
465
+ name: 'llama_create_plan',
466
+ description: 'Create a new plan',
467
+ params: 'orgSlug (required), projectKey (required), title (required), content (required: markdown), folderId (optional), parentPlanId (optional)',
468
+ },
469
+ {
470
+ name: 'llama_update_plan',
471
+ description: 'Update a plan\'s title, content, or folder',
472
+ params: 'planId (required), title (optional), content (optional), folderId (optional)',
473
+ },
474
+ {
475
+ name: 'llama_delete_plan',
476
+ description: 'Soft-delete a plan',
477
+ params: 'planId (required)',
478
+ },
479
+ {
480
+ name: 'llama_create_plan_folder',
481
+ description: 'Create a folder for organizing plans',
482
+ params: 'orgSlug (required), projectKey (required), name (required), parentFolderId (optional)',
483
+ },
484
+ {
485
+ name: 'llama_delete_plan_folder',
486
+ description: 'Delete a plan folder and its contents',
487
+ params: 'orgSlug (required), projectKey (required), folderId (required)',
488
+ },
489
+ ],
490
+ },
324
491
  skills: {
325
492
  title: 'Skill Tools',
326
- description: 'Reusable Claude skills (procedures) that can be installed and executed with parameters.',
493
+ description: 'Skills are reusable Claude procedures (markdown SKILL.md files with optional parameters and triggers). Scopes: project | organization | personal. Install copies a skill into the project.',
327
494
  tools: [
328
495
  {
329
496
  name: 'llama_list_skills',
330
- description: 'List available skills (project-level and org-level)',
497
+ description: 'List skills (project-level + inherited org-level)',
331
498
  params: 'orgSlug (required), projectKey (required), includeHidden (optional)',
332
499
  },
333
500
  {
334
501
  name: 'llama_get_skill',
335
- description: 'Get skill details including content and parameters',
502
+ description: 'Get skill content and parameters',
336
503
  params: 'orgSlug (required), projectKey (required), skillId (required)',
337
504
  },
338
505
  {
339
506
  name: 'llama_create_skill',
340
- description: 'Create a new Claude skill (reusable procedure)',
507
+ description: 'Create a new skill',
341
508
  params: 'orgSlug (required), name (required), content (required), scope (optional: project|organization|personal), projectKey (optional), description (optional), parameters (optional: JSON array), triggers (optional: comma-separated), isEnabled (optional)',
342
509
  },
343
510
  {
344
511
  name: 'llama_update_skill',
345
- description: 'Update an existing skill',
512
+ description: 'Update a skill. Change scope to promote/demote between project and org.',
346
513
  params: 'orgSlug (required), skillId (required), projectKey (optional), name (optional), description (optional), content (optional), parameters (optional), triggers (optional), isEnabled (optional), scope (optional)',
347
514
  },
348
515
  {
349
516
  name: 'llama_set_skill_visibility',
350
- description: 'Hide or unhide a skill at user or project level',
517
+ description: 'Hide or unhide a skill for the user or the whole project. Works for agents too.',
351
518
  params: 'orgSlug (required), projectKey (required), skillId (required), action (required: hide|unhide), scope (required: user|project)',
352
519
  },
353
520
  {
354
521
  name: 'llama_install_skill',
355
- description: 'Install a skill from the skill library into the current project',
522
+ description: 'Install a skill from the library into the current project. Returns markdown for the SKILL.md file.',
356
523
  params: 'skillId (required), orgSlug (optional), projectKey (optional — omit to use org-level endpoint)',
357
524
  returns: 'slug, filename, and markdown content of the installed skill',
358
525
  },
359
526
  ],
360
527
  },
361
- onboarding: {
362
- title: 'Onboarding Tools',
363
- description: 'Set up a new project with the Getting Started Pack 4 core skills + board configuration in one step.',
528
+ agents: {
529
+ title: 'Agent Tools',
530
+ description: 'Agents are sub-agents with a custom system prompt and config (model, allowed tools). Stored alongside skills in the same library; the API filters by type. Install writes a frontmatter markdown file to ~/.claude/agents/.',
364
531
  tools: [
365
532
  {
366
- name: 'llama_install_getting_started_pack',
367
- description: 'Install the Getting Started Pack (4 skills + board config). Two-step: preview first, then confirm.',
368
- params: 'orgSlug (optional, session default), projectKey (optional, session default), confirm (optional, default false)',
369
- use: 'Call without confirm to preview. Call with confirm=true only after the user approves. After install, write SKILL.md files to .claude/skills/<id>/SKILL.md and tell the user to run /getting-started-walkthrough.',
370
- returns: 'Step 1 (preview): requiresConfirmation=true, preview, warning. Step 2 (confirmed): skill manifest with file paths to write.',
533
+ name: 'llama_list_agents',
534
+ description: 'List agents (project-level + inherited org-level). Returns only records with type="agent".',
535
+ params: 'orgSlug (required), projectKey (optional), includeHidden (optional)',
536
+ },
537
+ {
538
+ name: 'llama_get_agent',
539
+ description: 'Get agent system prompt and config. Use llama_get_skill if you have a skill ID.',
540
+ params: 'orgSlug (required), agentId (required), projectKey (optional)',
541
+ },
542
+ {
543
+ name: 'llama_create_agent',
544
+ description: 'Create a new agent (sub-agent definition with system prompt + config)',
545
+ params: 'orgSlug (required), name (required), content (required: system prompt), scope (optional: project|organization|personal), projectKey (optional), description (optional), config (optional: {model, tools, color, etc.}), triggers (optional), isEnabled (optional)',
546
+ },
547
+ {
548
+ name: 'llama_update_agent',
549
+ description: 'Update an agent. Patch name/description/content/config/scope.',
550
+ params: 'orgSlug (required), agentId (required), projectKey (optional), name (optional), description (optional), content (optional), config (optional), triggers (optional), isEnabled (optional), scope (optional)',
551
+ },
552
+ {
553
+ name: 'llama_install_agent',
554
+ description: 'Install an agent into ~/.claude/agents/. Returns frontmatter markdown ready to write to disk.',
555
+ params: 'agentId (required), orgSlug (optional), projectKey (optional)',
556
+ returns: 'filename and markdown content of the installed agent',
371
557
  },
372
558
  ],
373
559
  },
374
- errors: {
375
- title: 'Error Inbox Tools',
376
- description: 'Manage errors reported by external systems. Accept errors to create BUG issues, or dismiss them.',
560
+ prompts: {
561
+ title: 'Prompt Tools',
562
+ description: 'Prompts are reusable markdown payloads with no parameters or triggers — Claude executes them verbatim. Scopes: organization | project | personal (resolution priority: personal > project > organization).',
377
563
  tools: [
378
564
  {
379
- name: 'llama_list_errors',
380
- description: 'List errors from the Error Inbox with filtering and sorting',
381
- params: 'orgSlug (optional), projectKey (optional), status (optional: PENDING|ACCEPTED|DISMISSED), sortBy (optional: createdAt|lastSeenAt|occurrenceCount), sortOrder (optional: asc|desc), page (optional), limit (optional)',
382
- use: 'Triage incoming errors before accepting or dismissing',
565
+ name: 'llama_run_prompt',
566
+ description: 'Fetch a prompt and return its markdown content for immediate execution',
567
+ params: 'orgSlug (optional, session default), projectKey (optional, session default), promptId (uuid) OR name (one is required)',
568
+ returns: 'Markdown content the model should follow as instructions',
569
+ },
570
+ {
571
+ name: 'llama_list_prompts',
572
+ description: 'List prompts visible in the current scope. Returns summaries without content.',
573
+ params: 'orgSlug (optional), projectKey (optional), scope (optional: organization|project|personal), folderId (optional), search (optional), includeHidden (optional)',
574
+ },
575
+ {
576
+ name: 'llama_create_prompt',
577
+ description: 'Create a new prompt',
578
+ params: 'orgSlug (optional), projectKey (when scope=project), scope (required: organization|project|personal), name (required), description (optional), content (required: markdown), folderId (optional)',
383
579
  },
384
580
  {
385
- name: 'llama_get_error',
386
- description: 'Get full error details including stack trace and metadata',
387
- params: 'orgSlug (optional), projectKey (optional), errorId (required)',
388
- use: 'View complete error information before accepting',
581
+ name: 'llama_update_prompt',
582
+ description: 'Partial update only fields you pass are changed',
583
+ params: 'promptId (required), name (optional), description (optional, null to clear), content (optional), folderId (optional, null to detach)',
389
584
  },
390
585
  {
391
- name: 'llama_get_error_count',
392
- description: 'Get count of pending errors needing attention',
393
- params: 'orgSlug (optional), projectKey (optional)',
394
- use: 'Check if there are new errors to triage',
586
+ name: 'llama_delete_prompt',
587
+ description: 'Soft-delete a prompt',
588
+ params: 'promptId (required)',
395
589
  },
396
590
  {
397
- name: 'llama_accept_error',
398
- description: 'Accept an error and create a BUG issue from it. Error details are included in the issue description.',
399
- params: 'orgSlug (optional), projectKey (optional), errorId (required), priority (optional: CRITICAL|HIGH|MEDIUM|LOW|TRIVIAL), assigneeId (optional), sprintId (optional), labels (optional)',
400
- use: 'Convert error into a trackable bug issue',
591
+ name: 'llama_manage_prompt_folder',
592
+ description: 'Manage prompt folders: list, create, rename, or delete',
593
+ params: 'action (required: list|create|rename|delete), scope (for create), folderId (for rename/delete), name (for create/rename)',
594
+ },
595
+ ],
596
+ },
597
+ attachments: {
598
+ title: 'Attachment Tools',
599
+ description: 'Upload, list, download, and delete files attached to issues. Max 10MB per file.',
600
+ tools: [
601
+ {
602
+ name: 'llama_attach_file',
603
+ description: 'Upload a local file to an issue (images, docs, archives)',
604
+ params: 'orgSlug (required), projectKey (required), issueKey (required), filePath (required: absolute path)',
401
605
  },
402
606
  {
403
- name: 'llama_dismiss_error',
404
- description: 'Dismiss a single error (hide from default view)',
405
- params: 'orgSlug (optional), projectKey (optional), errorId (required)',
406
- use: 'Mark noise/duplicate errors as not actionable',
607
+ name: 'llama_list_attachments',
608
+ description: 'List all attachments on an issue',
609
+ params: 'orgSlug (required), projectKey (required), issueKey (required)',
610
+ },
611
+ {
612
+ name: 'llama_download_attachment',
613
+ description: 'Download and view an attachment. Images returned visually, text as readable content. Files >1MB return metadata only.',
614
+ params: 'attachmentId (required)',
615
+ },
616
+ {
617
+ name: 'llama_delete_attachment',
618
+ description: 'Delete an attachment from an issue',
619
+ params: 'attachmentId (required)',
620
+ },
621
+ ],
622
+ },
623
+ refinement: {
624
+ title: 'Story Refinement Tools',
625
+ description: 'AI-assisted story refinement: structured Q&A, codebase context, optional voice transcription.',
626
+ tools: [
627
+ {
628
+ name: 'llama_refine_story',
629
+ description: 'Refine a draft story into a properly-scoped one using AI',
630
+ params: 'orgSlug (required), projectKey (required), summary (required), description (optional), additional context fields',
631
+ },
632
+ {
633
+ name: 'llama_get_refinement',
634
+ description: 'Get a refinement session by ID',
635
+ params: 'refinementId (required)',
636
+ },
637
+ {
638
+ name: 'llama_get_transcription',
639
+ description: 'Get text transcription of an uploaded voice memo (used during refinement)',
640
+ params: 'transcriptionId (required)',
641
+ },
642
+ ],
643
+ },
644
+ roadmap: {
645
+ title: 'Roadmap Tools',
646
+ tools: [
647
+ {
648
+ name: 'llama_get_roadmap',
649
+ description: 'Get a roadmap with items, milestones, and computed drift/progress. Without roadmapId returns the most recently updated.',
650
+ params: 'orgSlug (required), projectKey (required), roadmapId (optional)',
407
651
  },
408
652
  {
409
- name: 'llama_bulk_dismiss_errors',
410
- description: 'Dismiss multiple errors at once (max 100)',
411
- params: 'orgSlug (optional), projectKey (optional), errorIds (required: array of error IDs)',
412
- use: 'Quickly clear multiple non-actionable errors',
653
+ name: 'llama_manage_roadmap',
654
+ description: 'Create, update, or delete roadmaps. Update supports batch items/milestones/dependencies.',
655
+ params: 'action (required: create|update|delete), orgSlug (required), projectKey (required), roadmapId (for update/delete), name/items/milestones/dependencies (for create/update)',
413
656
  },
414
657
  ],
415
658
  },
416
- decomposition: {
417
- title: 'Feature Decomposition',
418
- description: 'Break down features into stories/tasks. This is now a Claude Workflow - say "decompose [feature]" to trigger it.',
659
+ rollup: {
660
+ title: 'Rollup Tools',
661
+ description: 'Configure how parent issues (EPICs) compute aggregate metrics from their children.',
419
662
  tools: [
420
663
  {
421
- name: 'Feature Decomposition Skill',
422
- description: 'Use llama_list_skills or say "decompose" to trigger this skill',
423
- params: 'featureTitle, featureDescription',
424
- use: 'Clarifies requirements, analyzes codebase, creates EPIC with Stories/Tasks',
664
+ name: 'llama_configure_rollup',
665
+ description: 'Set rollup configuration for a project',
666
+ params: 'orgSlug (required), projectKey (required), config fields (estimateRollup, statusRollup, etc.)',
667
+ },
668
+ ],
669
+ },
670
+ errors: {
671
+ title: 'Error Inbox Tools',
672
+ description: 'Manage errors reported by external systems. Accept errors to create BUG issues, dismiss noise.',
673
+ tools: [
674
+ {
675
+ name: 'llama_manage_error',
676
+ description: 'Single tool for all Error Inbox actions: list, get, count, accept (creates BUG), dismiss (single or up to 100).',
677
+ params: 'action (required: list|get|count|accept|dismiss), orgSlug (optional), projectKey (optional), errorId / errorIds (depends on action), filters (status/sortBy/sortOrder/page/limit for list), priority/assigneeId/sprintId/labels (for accept)',
678
+ use: 'Triage, accept errors as bugs, or clear noise',
679
+ example: `// List pending errors
680
+ { "action": "list", "status": "PENDING" }
681
+
682
+ // Accept and create BUG
683
+ { "action": "accept", "errorId": "err-123", "priority": "HIGH" }
684
+
685
+ // Dismiss many at once
686
+ { "action": "dismiss", "errorIds": ["err-1", "err-2", "err-3"] }`,
687
+ },
688
+ ],
689
+ },
690
+ notifications: {
691
+ title: 'Notification Rule Tools',
692
+ description: 'Notification rules deliver Slack alerts on events (status changes, label adds, sprint lifecycle). Slack integration must be installed via the web UI first.',
693
+ tools: [
694
+ {
695
+ name: 'llama_manage_notification_rule',
696
+ description: 'Single dispatcher: list, create, update, or delete notification rules.',
697
+ params: 'action (required: list|create|update|delete), orgSlug (optional), name/eventTypes/deliveryMethod/deliveryConfig/scope/filters (for create), ruleId (for update/delete)',
698
+ tip: 'Event types: STATUS_CHANGED, ISSUE_CREATED, ISSUE_ASSIGNED, COMMENT_ADDED, LABEL_ADDED, LABEL_REMOVED, SPRINT_STARTED, SPRINT_COMPLETED. Delivery: SLACK_DM | SLACK_CHANNEL.',
699
+ example: `{
700
+ "action": "create",
701
+ "integrationId": "int-123",
702
+ "name": "Notify QA when bugs enter testing",
703
+ "eventTypes": "STATUS_CHANGED",
704
+ "deliveryMethod": "SLACK_CHANNEL",
705
+ "deliveryConfig": "{\\"channelId\\":\\"C123456\\"}",
706
+ "scope": "PROJECT",
707
+ "projectId": "proj-123",
708
+ "issueTypes": "BUG"
709
+ }`,
710
+ },
711
+ ],
712
+ },
713
+ import: {
714
+ title: 'Import Tools',
715
+ tools: [
716
+ {
717
+ name: 'llama_import_csv',
718
+ description: 'Import issues from a CSV file (Jira/GitHub/generic formats supported)',
719
+ params: 'orgSlug (required), projectKey (required), filePath (required: absolute path), format (optional), mapping (optional)',
720
+ },
721
+ ],
722
+ },
723
+ prScorer: {
724
+ title: 'PR Scorer Tools',
725
+ description: 'Author and install PR quality-scoring rulesets. Rules are written in a small DSL; ' +
726
+ 'call llama_get_pr_scorer_schema for the full grammar, variable table, function table, ' +
727
+ 'and runnable examples.',
728
+ tools: [
729
+ {
730
+ name: 'llama_get_pr_scorer_schema',
731
+ description: 'Return the complete PR Scorer DSL reference: grammar (EBNF), operator table, ' +
732
+ 'built-in function table, variable table (EvalContext shape), hard limits, and ' +
733
+ 'two runnable examples. Call this before authoring or editing rules.',
734
+ params: 'None',
735
+ use: 'Read this first when you need to write, understand, or debug PR Scorer rules',
736
+ returns: 'Full DSL reference as text',
737
+ },
738
+ {
739
+ name: 'llama_get_pr_scorer_rules',
740
+ description: 'Fetch the current PR Scorer ruleset for a project (DSL source + enabled flag)',
741
+ params: 'orgSlug (optional, session default), projectKey (optional, session default)',
742
+ returns: '{ source, enabled, updatedAt, updatedBy }',
743
+ },
744
+ {
745
+ name: 'llama_set_pr_scorer_rules',
746
+ description: 'Install or replace the PR Scorer ruleset. On parse failure, returns a structured ' +
747
+ 'parseErrors array [{ line, column, message }] — not a flattened string — so each ' +
748
+ 'error can be fixed by its exact position.',
749
+ params: 'orgSlug (optional, session default), projectKey (optional, session default), ' +
750
+ 'source (required: DSL text), enabled (optional: boolean)',
751
+ returns: 'On success: { success: true, source, enabled, updatedAt }. ' +
752
+ 'On parse failure: { success: false, parseErrors: [{ line, column, message }] }',
753
+ example: `// Read schema first
754
+ llama_get_pr_scorer_schema
755
+
756
+ // Install a simple ruleset
757
+ {
758
+ "source": "when files.any(f -> pathMatches(f.path, \\"**/*.test.ts\\")) then +1 reason \\"has tests\\"\\nwhen pr.isDraft == true then -1 reason \\"draft PR\\"",
759
+ "enabled": true
760
+ }`,
761
+ },
762
+ {
763
+ name: 'llama_test_pr_scorer',
764
+ description: 'Dry-run a PR Scorer ruleset against a real PR without saving. ' +
765
+ 'Returns { score, grade, reasons[], flags[], trace[] }. ' +
766
+ 'trace[] has one entry per rule — use it to explain why a rule fired or did not fire. ' +
767
+ 'prId is the DevLink UUID (not the ADO PR number); use llama_get_dev_links to find it.',
768
+ params: 'orgSlug (optional, session default), projectKey (optional, session default), ' +
769
+ 'source (required: DSL rules to test), prId (required: DevLink UUID)',
770
+ returns: '{ success, score, grade, reasons[], flags[], trace[{ ruleIndex, matched, delta, reason?, flag? }] }. ' +
771
+ 'On parse failure: { success: false, parseErrors: [{ line, column, message }] }',
772
+ use: 'Validate new or edited rules before calling llama_set_pr_scorer_rules',
773
+ },
774
+ {
775
+ name: 'llama_list_pr_scorer_history',
776
+ description: 'List the save history for a project\'s PR Scorer ruleset — metadata only ' +
777
+ '(savedAt, updatedById, sourceLineCount, sourceLength). ' +
778
+ 'Full rule bodies are stripped to keep token cost low. ' +
779
+ 'Entry indices are 0-indexed from most-recent-first and correspond directly to ' +
780
+ 'the historyIndex parameter of llama_revert_pr_scorer.',
781
+ params: 'orgSlug (optional, session default), projectKey (optional, session default)',
782
+ returns: '{ success, count, entries[{ index, savedAt, updatedById?, sourceLineCount?, sourceLength? }] }',
783
+ use: 'Before calling llama_revert_pr_scorer to see what history is available',
784
+ },
785
+ {
786
+ name: 'llama_revert_pr_scorer',
787
+ description: 'Revert the PR Scorer ruleset to a previous saved version. ' +
788
+ 'historyIndex is 0-indexed from most-recent-first (0 = most recent save before the current state). ' +
789
+ 'After revert, call llama_get_pr_scorer_rules to confirm the restored ruleset.',
790
+ params: 'orgSlug (optional, session default), projectKey (optional, session default), ' +
791
+ 'historyIndex (required: integer >= 0)',
792
+ returns: '{ success, source, enabled, updatedById, message }',
793
+ use: 'Undo a bad llama_set_pr_scorer_rules call. Use llama_list_pr_scorer_history first.',
425
794
  },
426
795
  ],
427
796
  },
428
797
  patterns: {
429
798
  title: 'Common Patterns',
430
- description: `**Creating issues for a sprint:**
799
+ description: `**First-time setup:**
800
+ 1. llama_connect — if response has \`firstTimeHint\`, the account has no projects
801
+ 2. Ask user about their work; help them create an org/project (or use existing)
802
+ 3. llama_set_context { orgSlug, projectKey }
803
+ 4. llama_install_getting_started_pack (preview, then confirm) — installs 4 core skills + board
804
+ 5. After install, write the SKILL.md files to .claude/skills/<id>/SKILL.md
805
+ 6. Tell user: "Run /getting-started-walkthrough"
806
+
807
+ **Creating issues for a sprint:**
431
808
  1. llama_context → get sprintId from active/pending sprints
432
809
  2. llama_create_issue → include sprintId
433
810
 
434
811
  **Moving issue through workflow:**
435
812
  1. llama_context → get status IDs from workflow.statuses
436
813
  2. llama_update_issue → set statusId for target status
814
+ 3. (or) llama_move_issue_on_board → drop into a column on a specific board
437
815
 
438
816
  **Assigning issues:**
439
- 1. llama_find_members_by_skill → find members with specific expertise
817
+ 1. llama_find_members_by_skill → find members with the right expertise
440
818
  2. llama_update_issue → set assigneeId
441
819
 
442
- **Listing all members:**
443
- 1. llama_list_members → get all user IDs and skills
444
-
445
820
  **Sprint planning:**
446
821
  1. llama_get_backlog → see available issues
447
822
  2. llama_create_sprint → create new sprint
448
- 3. llama_add_to_sprint → add issues to sprint
449
- 4. llama_start_sprint → begin the sprint
823
+ 3. llama_add_to_sprint → add issues
824
+ 4. llama_start_sprint → begin
825
+
826
+ **Decomposing a feature into stories:**
827
+ 1. llama_list_skills — find a decomposition skill (e.g., create-stories-from-plan)
828
+ 2. Run that skill — it walks you through codebase analysis and story generation
829
+ 3. llama_batch_create_issues — create the resulting stories in one call
450
830
 
451
831
  **Searching for work:**
452
832
  1. llama_search → find issues by text/filters
453
- 2. llama_get_issue → get full details for specific issue
833
+ 2. llama_get_issue → get full details
454
834
 
455
835
  **Triaging Error Inbox:**
456
- 1. llama_get_error_count → check for pending errors
457
- 2. llama_list_errors view pending errors
458
- 3. llama_get_errorview stack trace/metadata for specific error
459
- 4. llama_accept_error create BUG issue from error
460
- OR llama_dismiss_error mark as not actionable
836
+ 1. llama_manage_error { action: "count" } → check pending count
837
+ 2. llama_manage_error { action: "list", status: "PENDING" } → review
838
+ 3. llama_manage_error { action: "get", errorId } see stack trace
839
+ 4. llama_manage_error { action: "accept", errorId, priority } — create BUG issue
840
+ OR llama_manage_error { action: "dismiss", errorIds: [...] }
461
841
 
462
842
  **Surviving /clear (session persistence):**
463
843
  1. llama_save_state → checkpoint current issue, phase, queue
464
844
  2. (user runs /clear)
465
845
  3. llama_resume → get back context, state, and live board snapshot
466
- 4. Continue working from where you left off`,
846
+ 4. Continue working from where you left off
847
+
848
+ **Running a saved prompt:**
849
+ 1. llama_list_prompts → find prompts in the current scope
850
+ 2. llama_run_prompt { name } → fetch markdown and execute it
851
+
852
+ **Installing a skill or agent from the library:**
853
+ - Skills: llama_install_skill { skillId } → write returned content to .claude/skills/<slug>/SKILL.md
854
+ - Agents: llama_install_agent { agentId } → write returned content to ~/.claude/agents/<filename>`,
467
855
  },
468
856
  };
469
- // Individual tool details for deep lookup
470
857
  const TOOL_DETAILS = {};
471
- // Build tool details from categories
472
858
  Object.entries(TOOL_DOCS).forEach(([category, data]) => {
473
859
  if ('tools' in data && Array.isArray(data.tools)) {
474
860
  data.tools.forEach((tool) => {
@@ -478,7 +864,6 @@ Object.entries(TOOL_DOCS).forEach(([category, data]) => {
478
864
  });
479
865
  export async function executeHelp(input) {
480
866
  const { topic } = input;
481
- // No topic - return overview
482
867
  if (!topic) {
483
868
  const categories = Object.keys(TOOL_DOCS)
484
869
  .filter((k) => k !== 'overview')
@@ -495,35 +880,28 @@ export async function executeHelp(input) {
495
880
  help: {
496
881
  title: TOOL_DOCS.overview.title,
497
882
  content: TOOL_DOCS.overview.description,
498
- categories: categories,
883
+ categories,
499
884
  tip: 'Use llama_help { topic: "category" } for details on a category, or llama_help { topic: "tool_name" } for a specific tool.',
500
885
  },
501
886
  });
502
887
  }
503
- // Check if topic is a tool name
504
888
  const normalizedTopic = topic.toLowerCase().replace(/^llama_/, '');
505
889
  const toolName = topic.startsWith('llama_') ? topic : `llama_${normalizedTopic}`;
506
890
  if (TOOL_DETAILS[toolName]) {
507
891
  return JSON.stringify({
508
892
  success: true,
509
- help: {
510
- tool: TOOL_DETAILS[toolName],
511
- },
893
+ help: { tool: TOOL_DETAILS[toolName] },
512
894
  });
513
895
  }
514
- // Check if topic is a category
515
896
  const categoryKey = normalizedTopic;
516
897
  if (TOOL_DOCS[categoryKey]) {
517
- const categoryData = TOOL_DOCS[categoryKey];
518
898
  return JSON.stringify({
519
899
  success: true,
520
- help: categoryData,
900
+ help: TOOL_DOCS[categoryKey],
521
901
  });
522
902
  }
523
- // Topic not found - return suggestions
524
903
  const allTools = Object.keys(TOOL_DETAILS);
525
904
  const allCategories = Object.keys(TOOL_DOCS).filter((k) => k !== 'overview');
526
- // Simple fuzzy match
527
905
  const matchingTools = allTools.filter((t) => t.includes(normalizedTopic) || normalizedTopic.includes(t.replace('llama_', '')));
528
906
  const matchingCategories = allCategories.filter((c) => c.includes(normalizedTopic) || normalizedTopic.includes(c));
529
907
  return JSON.stringify({