@amsterdamdatalabs/enact-extensions 0.1.0 → 0.1.1

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 (152) hide show
  1. package/README.md +94 -20
  2. package/dist/index.d.ts +3 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/install.d.ts +89 -0
  7. package/dist/install.d.ts.map +1 -1
  8. package/dist/install.js +219 -18
  9. package/dist/install.js.map +1 -1
  10. package/dist/validate/index.d.ts +21 -0
  11. package/dist/validate/index.d.ts.map +1 -1
  12. package/dist/validate/index.js +77 -0
  13. package/dist/validate/index.js.map +1 -1
  14. package/extensions/cmux/.agents/plugin.json +37 -0
  15. package/extensions/cmux/skills/cmux/SKILL.md +82 -0
  16. package/extensions/cmux/skills/cmux/agents/openai.yaml +4 -0
  17. package/extensions/cmux/skills/cmux/references/handles-and-identify.md +35 -0
  18. package/extensions/cmux/skills/cmux/references/panes-surfaces.md +37 -0
  19. package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +23 -0
  20. package/extensions/cmux/skills/cmux/references/windows-workspaces.md +31 -0
  21. package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +122 -0
  22. package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +4 -0
  23. package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +66 -0
  24. package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +45 -0
  25. package/extensions/cmux/skills/cmux-workspace/SKILL.md +93 -0
  26. package/extensions/dev-state/.agents/plugin.json +35 -0
  27. package/extensions/dev-state/skills/dev-state-plan-graduation/SKILL.md +194 -0
  28. package/extensions/dev-state/skills/dev-state-plan-graduation/agents/openai.yaml +4 -0
  29. package/extensions/dev-state/skills/dev-state-plan-graduation/references/reference.md +130 -0
  30. package/extensions/devops/.agents/plugin.json +36 -0
  31. package/extensions/devops/skills/azure-devops-cli/SKILL.md +431 -0
  32. package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +4 -0
  33. package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +217 -0
  34. package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +4 -0
  35. package/{plugins/net-revenue-management/.codex-plugin → extensions/net-revenue-management/.agents}/plugin.json +10 -6
  36. package/extensions/plugin-dev/.agents/plugin.json +42 -0
  37. package/extensions/plugin-dev/.mcp.json +3 -0
  38. package/extensions/plugin-dev/agents/agent-creator.md +199 -0
  39. package/extensions/plugin-dev/agents/plugin-validator.md +91 -0
  40. package/extensions/plugin-dev/agents/skill-reviewer.md +212 -0
  41. package/extensions/plugin-dev/commands/_archive/create-marketplace.md +427 -0
  42. package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +12 -0
  43. package/extensions/plugin-dev/commands/create-plugin.md +498 -0
  44. package/extensions/plugin-dev/commands/start.md +81 -0
  45. package/extensions/plugin-dev/hooks/hooks.json +3 -0
  46. package/extensions/plugin-dev/skills/agent-development/SKILL.md +641 -0
  47. package/extensions/plugin-dev/skills/agent-development/examples/agent-creation-prompt.md +250 -0
  48. package/extensions/plugin-dev/skills/agent-development/examples/complete-agent-examples.md +461 -0
  49. package/extensions/plugin-dev/skills/agent-development/references/advanced-agent-fields.md +246 -0
  50. package/extensions/plugin-dev/skills/agent-development/references/agent-creation-system-prompt.md +216 -0
  51. package/extensions/plugin-dev/skills/agent-development/references/permission-modes-rules.md +226 -0
  52. package/extensions/plugin-dev/skills/agent-development/references/system-prompt-design.md +464 -0
  53. package/extensions/plugin-dev/skills/agent-development/references/triggering-examples.md +474 -0
  54. package/extensions/plugin-dev/skills/agent-development/scripts/create-agent-skeleton.sh +176 -0
  55. package/extensions/plugin-dev/skills/agent-development/scripts/test-agent-trigger.sh +227 -0
  56. package/extensions/plugin-dev/skills/agent-development/scripts/validate-agent.sh +227 -0
  57. package/extensions/plugin-dev/skills/command-development/SKILL.md +763 -0
  58. package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +612 -0
  59. package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +527 -0
  60. package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +762 -0
  61. package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +769 -0
  62. package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +508 -0
  63. package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +966 -0
  64. package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +943 -0
  65. package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +637 -0
  66. package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +191 -0
  67. package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +447 -0
  68. package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +723 -0
  69. package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +234 -0
  70. package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +160 -0
  71. package/extensions/plugin-dev/skills/hook-development/SKILL.md +861 -0
  72. package/extensions/plugin-dev/skills/hook-development/examples/load-context.sh +55 -0
  73. package/extensions/plugin-dev/skills/hook-development/examples/validate-bash.sh +57 -0
  74. package/extensions/plugin-dev/skills/hook-development/examples/validate-write.sh +48 -0
  75. package/extensions/plugin-dev/skills/hook-development/references/advanced.md +871 -0
  76. package/extensions/plugin-dev/skills/hook-development/references/hook-input-schemas.md +145 -0
  77. package/extensions/plugin-dev/skills/hook-development/references/migration.md +392 -0
  78. package/extensions/plugin-dev/skills/hook-development/references/patterns.md +430 -0
  79. package/extensions/plugin-dev/skills/hook-development/scripts/README.md +181 -0
  80. package/extensions/plugin-dev/skills/hook-development/scripts/hook-linter.sh +153 -0
  81. package/extensions/plugin-dev/skills/hook-development/scripts/test-hook.sh +276 -0
  82. package/extensions/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
  83. package/extensions/plugin-dev/skills/mcp-integration/SKILL.md +775 -0
  84. package/extensions/plugin-dev/skills/mcp-integration/examples/http-server.json +20 -0
  85. package/extensions/plugin-dev/skills/mcp-integration/examples/sse-server.json +19 -0
  86. package/extensions/plugin-dev/skills/mcp-integration/examples/stdio-server.json +38 -0
  87. package/extensions/plugin-dev/skills/mcp-integration/examples/ws-server.json +26 -0
  88. package/extensions/plugin-dev/skills/mcp-integration/references/authentication.md +601 -0
  89. package/extensions/plugin-dev/skills/mcp-integration/references/server-discovery.md +190 -0
  90. package/extensions/plugin-dev/skills/mcp-integration/references/server-types.md +572 -0
  91. package/extensions/plugin-dev/skills/mcp-integration/references/tool-usage.md +623 -0
  92. package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +222 -0
  93. package/extensions/plugin-dev/skills/plugin-structure/SKILL.md +705 -0
  94. package/extensions/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md +774 -0
  95. package/extensions/plugin-dev/skills/plugin-structure/examples/minimal-plugin.md +83 -0
  96. package/extensions/plugin-dev/skills/plugin-structure/examples/standard-plugin.md +611 -0
  97. package/extensions/plugin-dev/skills/plugin-structure/references/advanced-topics.md +289 -0
  98. package/extensions/plugin-dev/skills/plugin-structure/references/component-patterns.md +592 -0
  99. package/extensions/plugin-dev/skills/plugin-structure/references/github-actions.md +233 -0
  100. package/extensions/plugin-dev/skills/plugin-structure/references/headless-ci-mode.md +193 -0
  101. package/extensions/plugin-dev/skills/plugin-structure/references/manifest-reference.md +625 -0
  102. package/extensions/plugin-dev/skills/plugin-structure/references/output-styles.md +116 -0
  103. package/extensions/plugin-dev/skills/skill-development/SKILL.md +564 -0
  104. package/extensions/plugin-dev/skills/skill-development/examples/complete-skill.md +465 -0
  105. package/extensions/plugin-dev/skills/skill-development/examples/frontmatter-templates.md +167 -0
  106. package/extensions/plugin-dev/skills/skill-development/examples/minimal-skill.md +111 -0
  107. package/extensions/plugin-dev/skills/skill-development/references/advanced-frontmatter.md +225 -0
  108. package/extensions/plugin-dev/skills/skill-development/references/commands-vs-skills.md +39 -0
  109. package/extensions/plugin-dev/skills/skill-development/references/skill-creation-workflow.md +379 -0
  110. package/extensions/plugin-dev/skills/skill-development/references/skill-creator-original.md +210 -0
  111. package/package.json +8 -11
  112. package/scripts/enact-extensions.mjs +751 -16
  113. package/scripts/hooks/session-start-drift-check.mjs +58 -0
  114. package/scripts/lib/build-index.mjs +50 -0
  115. package/scripts/lib/bundle-hash.mjs +137 -0
  116. package/scripts/lib/hooks.mjs +389 -0
  117. package/scripts/lib/ledger.mjs +162 -0
  118. package/scripts/lib/list-bundles.mjs +70 -0
  119. package/scripts/lib/outdated.mjs +144 -0
  120. package/scripts/lib/provision-mcp.mjs +369 -0
  121. package/scripts/lib/resolve-bundle.mjs +121 -0
  122. package/scripts/lib/run-install.mjs +321 -39
  123. package/scripts/lib/run-uninstall.mjs +220 -0
  124. package/scripts/lib/run-update.mjs +152 -0
  125. package/scripts/lib/run-validate.mjs +12 -18
  126. package/scripts/lib/serve.mjs +454 -0
  127. package/scripts/postinstall.mjs +63 -0
  128. package/scripts/setup-enact-context.sh +2 -2
  129. package/spec/index.json +59 -0
  130. package/web/assets/README.md +111 -0
  131. package/web/assets/logo-full.png +0 -0
  132. package/web/assets/logo-slim.png +0 -0
  133. package/web/assets/tokens/base.css +45 -0
  134. package/web/assets/tokens/colors.css +248 -0
  135. package/web/assets/tokens/effects.css +24 -0
  136. package/web/assets/tokens/fonts.css +8 -0
  137. package/web/assets/tokens/index.css +18 -0
  138. package/web/assets/tokens/spacing.css +50 -0
  139. package/web/index.html +1188 -0
  140. package/.agents/plugins/marketplace.json +0 -20
  141. package/catalog/enact-context.json +0 -9
  142. package/catalog/enact-factory.json +0 -7
  143. package/catalog/enact-operator.json +0 -7
  144. package/catalog/enact-wiki.json +0 -7
  145. package/catalog/net-revenue-management.json +0 -8
  146. package/scripts/rename-supervisor-to-operator.pl +0 -66
  147. package/scripts/sync-manifests.mjs +0 -23
  148. package/scripts/validate-catalog.mjs +0 -37
  149. package/scripts/validate-plugin.mjs +0 -10
  150. /package/{plugins → extensions}/net-revenue-management/.mcp.json +0 -0
  151. /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-risks/SKILL.md +0 -0
  152. /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-scenario/SKILL.md +0 -0
@@ -0,0 +1,623 @@
1
+ # Using MCP Tools in Commands and Agents
2
+
3
+ Complete guide to using MCP tools effectively in Claude Code plugin commands and agents.
4
+
5
+ ## Overview
6
+
7
+ Once an MCP server is configured, its tools become available with the prefix `mcp__plugin_<plugin-name>_<server-name>__<tool-name>`. Use these tools in commands and agents just like built-in Claude Code tools.
8
+
9
+ ## Tool Naming Convention
10
+
11
+ ### Format
12
+
13
+ ```
14
+ mcp__plugin_<plugin-name>_<server-name>__<tool-name>
15
+ ```
16
+
17
+ ### Examples
18
+
19
+ **Asana plugin with asana server:**
20
+
21
+ - `mcp__plugin_asana_asana__asana_create_task`
22
+ - `mcp__plugin_asana_asana__asana_search_tasks`
23
+ - `mcp__plugin_asana_asana__asana_get_project`
24
+
25
+ **Custom plugin with database server:**
26
+
27
+ - `mcp__plugin_myplug_database__query`
28
+ - `mcp__plugin_myplug_database__execute`
29
+ - `mcp__plugin_myplug_database__list_tables`
30
+
31
+ ### Discovering Tool Names
32
+
33
+ **Use `/mcp` command:**
34
+
35
+ ```bash
36
+ /mcp
37
+ ```
38
+
39
+ This shows:
40
+
41
+ - All available MCP servers
42
+ - Tools provided by each server
43
+ - Tool schemas and descriptions
44
+ - Full tool names for use in configuration
45
+
46
+ ## Using Tools in Commands
47
+
48
+ ### Pre-Allowing Tools
49
+
50
+ Specify MCP tools in command frontmatter:
51
+
52
+ ```markdown
53
+ ---
54
+ description: Create a new Asana task
55
+ allowed-tools: ["mcp__plugin_asana_asana__asana_create_task"]
56
+ ---
57
+
58
+ # Create Task Command
59
+
60
+ To create a task:
61
+
62
+ 1. Gather task details from user
63
+ 2. Use mcp__plugin_asana_asana__asana_create_task with the details
64
+ 3. Confirm creation to user
65
+ ```
66
+
67
+ ### Multiple Tools
68
+
69
+ ```markdown
70
+ ---
71
+ allowed-tools:
72
+ [
73
+ "mcp__plugin_asana_asana__asana_create_task",
74
+ "mcp__plugin_asana_asana__asana_search_tasks",
75
+ "mcp__plugin_asana_asana__asana_get_project",
76
+ ]
77
+ ---
78
+ ```
79
+
80
+ ### Wildcard (Use Sparingly)
81
+
82
+ ```markdown
83
+ ---
84
+ allowed-tools: ["mcp__plugin_asana_asana__*"]
85
+ ---
86
+ ```
87
+
88
+ **Caution:** Only use wildcards if the command truly needs access to all tools from a server.
89
+
90
+ ### Tool Usage in Command Instructions
91
+
92
+ **Example command:**
93
+
94
+ ```markdown
95
+ ---
96
+ description: Search and create Asana tasks
97
+ allowed-tools:
98
+ [
99
+ "mcp__plugin_asana_asana__asana_search_tasks",
100
+ "mcp__plugin_asana_asana__asana_create_task",
101
+ ]
102
+ ---
103
+
104
+ # Asana Task Management
105
+
106
+ ## Searching Tasks
107
+
108
+ To search for tasks:
109
+
110
+ 1. Use mcp__plugin_asana_asana__asana_search_tasks
111
+ 2. Provide search filters (assignee, project, etc.)
112
+ 3. Display results to user
113
+
114
+ ## Creating Tasks
115
+
116
+ To create a task:
117
+
118
+ 1. Gather task details:
119
+ - Title (required)
120
+ - Description
121
+ - Project
122
+ - Assignee
123
+ - Due date
124
+ 2. Use mcp__plugin_asana_asana__asana_create_task
125
+ 3. Show confirmation with task link
126
+ ```
127
+
128
+ ## Using Tools in Agents
129
+
130
+ ### Agent Configuration
131
+
132
+ Agents can use MCP tools autonomously without pre-allowing them:
133
+
134
+ ```markdown
135
+ ---
136
+ name: asana-status-updater
137
+ description: This agent should be used when the user asks to "update Asana status", "generate project report", or "sync Asana tasks"
138
+ model: inherit
139
+ color: blue
140
+ ---
141
+
142
+ ## Role
143
+
144
+ Autonomous agent for generating Asana project status reports.
145
+
146
+ ## Process
147
+
148
+ 1. **Query tasks**: Use mcp__plugin_asana_asana__asana_search_tasks to get all tasks
149
+ 2. **Analyze progress**: Calculate completion rates and identify blockers
150
+ 3. **Generate report**: Create formatted status update
151
+ 4. **Update Asana**: Use mcp__plugin_asana_asana__asana_create_comment to post report
152
+
153
+ ## Available Tools
154
+
155
+ The agent has access to all Asana MCP tools without pre-approval.
156
+ ```
157
+
158
+ ### Agent Tool Access
159
+
160
+ Agents have broader tool access than commands:
161
+
162
+ - Can use any tool Claude determines is necessary
163
+ - Don't need pre-allowed lists
164
+ - Should document which tools they typically use
165
+
166
+ ## Tool Call Patterns
167
+
168
+ ### Pattern 1: Simple Tool Call
169
+
170
+ Single tool call with validation:
171
+
172
+ ```markdown
173
+ Steps:
174
+
175
+ 1. Validate user provided required fields
176
+ 2. Call mcp__plugin_api_server__create_item with validated data
177
+ 3. Check for errors
178
+ 4. Display confirmation
179
+ ```
180
+
181
+ ### Pattern 2: Sequential Tools
182
+
183
+ Chain multiple tool calls:
184
+
185
+ ```markdown
186
+ Steps:
187
+
188
+ 1. Search for existing items: mcp__plugin_api_server__search
189
+ 2. If not found, create new: mcp__plugin_api_server__create
190
+ 3. Add metadata: mcp__plugin_api_server__update_metadata
191
+ 4. Return final item ID
192
+ ```
193
+
194
+ ### Pattern 3: Batch Operations
195
+
196
+ Multiple calls with same tool:
197
+
198
+ ```markdown
199
+ Steps:
200
+
201
+ 1. Get list of items to process
202
+ 2. For each item:
203
+ - Call mcp__plugin_api_server__update_item
204
+ - Track success/failure
205
+ 3. Report results summary
206
+ ```
207
+
208
+ ### Pattern 4: Error Handling
209
+
210
+ Graceful error handling:
211
+
212
+ ```markdown
213
+ Steps:
214
+
215
+ 1. Try to call mcp__plugin_api_server__get_data
216
+ 2. If error (rate limit, network, etc.):
217
+ - Wait and retry (max 3 attempts)
218
+ - If still failing, inform user
219
+ - Suggest checking configuration
220
+ 3. On success, process data
221
+ ```
222
+
223
+ ## Tool Parameters
224
+
225
+ ### Understanding Tool Schemas
226
+
227
+ Each MCP tool has a schema defining its parameters. View with `/mcp`.
228
+
229
+ **Example schema:**
230
+
231
+ ```json
232
+ {
233
+ "name": "asana_create_task",
234
+ "description": "Create a new Asana task",
235
+ "inputSchema": {
236
+ "type": "object",
237
+ "properties": {
238
+ "name": {
239
+ "type": "string",
240
+ "description": "Task title"
241
+ },
242
+ "notes": {
243
+ "type": "string",
244
+ "description": "Task description"
245
+ },
246
+ "workspace": {
247
+ "type": "string",
248
+ "description": "Workspace GID"
249
+ }
250
+ },
251
+ "required": ["name", "workspace"]
252
+ }
253
+ }
254
+ ```
255
+
256
+ ### Calling Tools with Parameters
257
+
258
+ Claude automatically structures tool calls based on schema:
259
+
260
+ ```typescript
261
+ // Claude generates this internally
262
+ {
263
+ toolName: "mcp__plugin_asana_asana__asana_create_task",
264
+ input: {
265
+ name: "Review PR #123",
266
+ notes: "Code review for new feature",
267
+ workspace: "12345",
268
+ assignee: "67890",
269
+ due_on: "2025-01-15"
270
+ }
271
+ }
272
+ ```
273
+
274
+ ### Parameter Validation
275
+
276
+ **In commands, validate before calling:**
277
+
278
+ ```markdown
279
+ Steps:
280
+
281
+ 1. Check required parameters:
282
+ - Title is not empty
283
+ - Workspace ID is provided
284
+ - Due date is valid format (YYYY-MM-DD)
285
+ 2. If validation fails, ask user to provide missing data
286
+ 3. If validation passes, call MCP tool
287
+ 4. Handle tool errors gracefully
288
+ ```
289
+
290
+ ## Response Handling
291
+
292
+ ### Success Responses
293
+
294
+ ```markdown
295
+ Steps:
296
+
297
+ 1. Call MCP tool
298
+ 2. On success:
299
+ - Extract relevant data from response
300
+ - Format for user display
301
+ - Provide confirmation message
302
+ - Include relevant links or IDs
303
+ ```
304
+
305
+ ### Error Responses
306
+
307
+ ```markdown
308
+ Steps:
309
+
310
+ 1. Call MCP tool
311
+ 2. On error:
312
+ - Check error type (auth, rate limit, validation, etc.)
313
+ - Provide helpful error message
314
+ - Suggest remediation steps
315
+ - Don't expose internal error details to user
316
+ ```
317
+
318
+ ### Partial Success
319
+
320
+ ```markdown
321
+ Steps:
322
+
323
+ 1. Batch operation with multiple MCP calls
324
+ 2. Track successes and failures separately
325
+ 3. Report summary:
326
+ - "Successfully processed 8 of 10 items"
327
+ - "Failed items: [item1, item2] due to [reason]"
328
+ - Suggest retry or manual intervention
329
+ ```
330
+
331
+ ## Performance Optimization
332
+
333
+ ### Batching Requests
334
+
335
+ #### Good: Single query with filters
336
+
337
+ ```markdown
338
+ Steps:
339
+
340
+ 1. Call mcp__plugin_api_server__search with filters:
341
+ - project_id: "123"
342
+ - status: "active"
343
+ - limit: 100
344
+ 2. Process all results
345
+ ```
346
+
347
+ #### Avoid: Many individual queries
348
+
349
+ ```markdown
350
+ Steps:
351
+
352
+ 1. For each item ID:
353
+ - Call mcp__plugin_api_server__get_item
354
+ - Process item
355
+ ```
356
+
357
+ ### Caching Results
358
+
359
+ ```markdown
360
+ Steps:
361
+
362
+ 1. Call expensive MCP operation: mcp__plugin_api_server__analyze
363
+ 2. Store results in variable for reuse
364
+ 3. Use cached results for subsequent operations
365
+ 4. Only re-fetch if data changes
366
+ ```
367
+
368
+ ### Parallel Tool Calls
369
+
370
+ When tools don't depend on each other, call in parallel:
371
+
372
+ ```markdown
373
+ Steps:
374
+
375
+ 1. Make parallel calls (Claude handles this automatically):
376
+ - mcp__plugin_api_server__get_project
377
+ - mcp__plugin_api_server__get_users
378
+ - mcp__plugin_api_server__get_tags
379
+ 2. Wait for all to complete
380
+ 3. Combine results
381
+ ```
382
+
383
+ ## Integration Best Practices
384
+
385
+ ### User Experience
386
+
387
+ **Provide feedback:**
388
+
389
+ ```markdown
390
+ Steps:
391
+
392
+ 1. Inform user: "Searching Asana tasks..."
393
+ 2. Call mcp__plugin_asana_asana__asana_search_tasks
394
+ 3. Show progress: "Found 15 tasks, analyzing..."
395
+ 4. Present results
396
+ ```
397
+
398
+ **Handle long operations:**
399
+
400
+ ```markdown
401
+ Steps:
402
+
403
+ 1. Warn user: "This may take a minute..."
404
+ 2. Break into smaller steps with updates
405
+ 3. Show incremental progress
406
+ 4. Final summary when complete
407
+ ```
408
+
409
+ ### Error Messages
410
+
411
+ **Good error messages:**
412
+
413
+ ```
414
+ ❌ "Could not create task. Please check:
415
+ 1. You're logged into Asana
416
+ 2. You have access to workspace 'Engineering'
417
+ 3. The project 'Q1 Goals' exists"
418
+ ```
419
+
420
+ **Poor error messages:**
421
+
422
+ ```
423
+ ❌ "Error: MCP tool returned 403"
424
+ ```
425
+
426
+ ### Documentation
427
+
428
+ **Document MCP tool usage in command:**
429
+
430
+ ```markdown
431
+ ## MCP Tools Used
432
+
433
+ This command uses the following Asana MCP tools:
434
+
435
+ - **asana_search_tasks**: Search for tasks matching criteria
436
+ - **asana_create_task**: Create new task with details
437
+ - **asana_update_task**: Update existing task properties
438
+
439
+ Ensure authentication to Asana before running this command.
440
+ ```
441
+
442
+ ## Testing Tool Usage
443
+
444
+ ### Local Testing
445
+
446
+ 1. **Configure MCP server** in `.mcp.json`
447
+ 2. **Install plugin locally** in `.claude-plugin/`
448
+ 3. **Verify tools available** with `/mcp`
449
+ 4. **Test command** that uses tools
450
+ 5. **Check debug output**: `claude --debug`
451
+
452
+ ### Test Scenarios
453
+
454
+ **Test successful calls:**
455
+
456
+ ```markdown
457
+ Steps:
458
+
459
+ 1. Create test data in external service
460
+ 2. Run command that queries this data
461
+ 3. Verify correct results returned
462
+ ```
463
+
464
+ **Test error cases:**
465
+
466
+ ```markdown
467
+ Steps:
468
+
469
+ 1. Test with missing authentication
470
+ 2. Test with invalid parameters
471
+ 3. Test with non-existent resources
472
+ 4. Verify graceful error handling
473
+ ```
474
+
475
+ **Test edge cases:**
476
+
477
+ ```markdown
478
+ Steps:
479
+
480
+ 1. Test with empty results
481
+ 2. Test with maximum results
482
+ 3. Test with special characters
483
+ 4. Test with concurrent access
484
+ ```
485
+
486
+ ## Common Patterns
487
+
488
+ ### Pattern: CRUD Operations
489
+
490
+ ```markdown
491
+ ---
492
+ allowed-tools:
493
+ [
494
+ "mcp__plugin_api_server__create_item",
495
+ "mcp__plugin_api_server__read_item",
496
+ "mcp__plugin_api_server__update_item",
497
+ "mcp__plugin_api_server__delete_item",
498
+ ]
499
+ ---
500
+
501
+ # Item Management
502
+
503
+ ## Create
504
+
505
+ Use create_item with required fields...
506
+
507
+ ## Read
508
+
509
+ Use read_item with item ID...
510
+
511
+ ## Update
512
+
513
+ Use update_item with item ID and changes...
514
+
515
+ ## Delete
516
+
517
+ Use delete_item with item ID (ask for confirmation first)...
518
+ ```
519
+
520
+ ### Pattern: Search and Process
521
+
522
+ ```markdown
523
+ Steps:
524
+
525
+ 1. **Search**: mcp__plugin_api_server__search with filters
526
+ 2. **Filter**: Apply additional local filtering if needed
527
+ 3. **Transform**: Process each result
528
+ 4. **Present**: Format and display to user
529
+ ```
530
+
531
+ ### Pattern: Multi-Step Workflow
532
+
533
+ ```markdown
534
+ Steps:
535
+
536
+ 1. **Setup**: Gather all required information
537
+ 2. **Validate**: Check data completeness
538
+ 3. **Execute**: Chain of MCP tool calls:
539
+ - Create parent resource
540
+ - Create child resources
541
+ - Link resources together
542
+ - Add metadata
543
+ 4. **Verify**: Confirm all steps succeeded
544
+ 5. **Report**: Provide summary to user
545
+ ```
546
+
547
+ ## Troubleshooting
548
+
549
+ ### Tools Not Available
550
+
551
+ **Check:**
552
+
553
+ - MCP server configured correctly
554
+ - Server connected (check `/mcp`)
555
+ - Tool names match exactly (case-sensitive)
556
+ - Restart Claude Code after config changes
557
+
558
+ ### Tool Calls Failing
559
+
560
+ **Check:**
561
+
562
+ - Authentication is valid
563
+ - Parameters match tool schema
564
+ - Required parameters provided
565
+ - Check `claude --debug` logs
566
+
567
+ ### Performance Issues
568
+
569
+ **Check:**
570
+
571
+ - Batching queries instead of individual calls
572
+ - Caching results when appropriate
573
+ - Not making unnecessary tool calls
574
+ - Parallel calls when possible
575
+
576
+ ## Conclusion
577
+
578
+ Effective MCP tool usage requires:
579
+
580
+ 1. **Understanding tool schemas** via `/mcp`
581
+ 2. **Pre-allowing tools** in commands appropriately
582
+ 3. **Handling errors gracefully**
583
+ 4. **Optimizing performance** with batching and caching
584
+ 5. **Providing good UX** with feedback and clear errors
585
+ 6. **Testing thoroughly** before deployment
586
+
587
+ Follow these patterns for robust MCP tool integration in your plugin commands and agents.
588
+
589
+ ## MCP Prompts as Commands
590
+
591
+ Beyond tools and resources, MCP servers can expose **prompts** — pre-defined instruction templates that appear as slash commands in Claude Code.
592
+
593
+ ### How Prompts Work
594
+
595
+ When an MCP server declares prompts via the MCP protocol, Claude Code automatically registers them as slash commands:
596
+
597
+ - **Format:** `/mcp__servername__promptname`
598
+ - **Discovery:** Prompts appear in the `/` autocomplete menu alongside regular commands
599
+ - **Arguments:** Prompts can accept arguments defined by the server's prompt schema
600
+
601
+ ### Integration with Plugin Commands
602
+
603
+ If your plugin bundles an MCP server that exposes prompts, those prompts become available when the plugin is installed. This provides another mechanism for guided workflows:
604
+
605
+ ```markdown
606
+ # Example: Plugin README documenting MCP prompts
607
+
608
+ ## Available MCP Prompts
609
+
610
+ After installing this plugin, the following MCP prompts are available:
611
+
612
+ - `/mcp__myserver__create-report` - Generate a structured report
613
+ - `/mcp__myserver__analyze-data` - Run data analysis with guided inputs
614
+ ```
615
+
616
+ ### When to Use MCP Prompts vs Plugin Commands
617
+
618
+ | Approach | Best For |
619
+ | --- | --- |
620
+ | MCP prompts | Server-defined workflows, dynamic templates from external services |
621
+ | Plugin commands | Static workflows, plugin-specific logic, complex prompt composition |
622
+
623
+ **Tip:** MCP prompts are ideal when the workflow logic lives on the server side and may change independently of the plugin. Plugin commands are better when you want full control over the prompt content.