@ema.co/mcp-toolkit 2026.1.25 → 2026.1.26-4
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.
Potentially problematic release.
This version of @ema.co/mcp-toolkit might be problematic. Click here for more details.
- package/README.md +10 -2
- package/dist/mcp/handlers/action/index.js +3 -18
- package/dist/mcp/handlers/data/index.js +385 -41
- package/dist/mcp/handlers/data/templates.js +107 -0
- package/dist/mcp/handlers/deprecation.js +50 -0
- package/dist/mcp/handlers/env/index.js +8 -4
- package/dist/mcp/handlers/knowledge/index.js +44 -237
- package/dist/mcp/handlers/persona/create.js +47 -18
- package/dist/mcp/handlers/persona/index.js +14 -11
- package/dist/mcp/handlers/persona/update.js +4 -2
- package/dist/mcp/handlers/persona/version.js +234 -0
- package/dist/mcp/handlers/sync/index.js +3 -18
- package/dist/mcp/handlers/template/index.js +75 -10
- package/dist/mcp/handlers/workflow/analyze.js +171 -0
- package/dist/mcp/handlers/workflow/compare.js +70 -0
- package/dist/mcp/handlers/workflow/deploy.js +73 -0
- package/dist/mcp/handlers/workflow/generate.js +350 -0
- package/dist/mcp/handlers/workflow/index.js +294 -0
- package/dist/mcp/handlers/workflow/modify.js +456 -0
- package/dist/mcp/handlers/workflow/optimize.js +136 -0
- package/dist/mcp/handlers/workflow/types.js +4 -0
- package/dist/mcp/handlers/workflow/utils.js +30 -0
- package/dist/mcp/handlers-consolidated.js +73 -2696
- package/dist/mcp/prompts.js +83 -43
- package/dist/mcp/resources.js +382 -57
- package/dist/mcp/server.js +199 -391
- package/dist/mcp/{tools-v2.js → tools.js} +20 -54
- package/dist/mcp/workflow-operations.js +2 -2
- package/dist/sdk/client-adapter.js +267 -32
- package/dist/sdk/client.js +45 -16
- package/dist/sdk/ema-client.js +183 -0
- package/dist/sdk/generated/deprecated-actions.js +171 -0
- package/dist/sdk/generated/template-fallbacks.js +123 -0
- package/dist/sdk/guidance.js +65 -11
- package/dist/sdk/index.js +3 -1
- package/dist/sdk/knowledge.js +139 -86
- package/dist/sdk/workflow-intent.js +27 -0
- package/dist/sdk/workflow-transformer.js +0 -342
- package/docs/mcp-tools-guide.md +37 -45
- package/package.json +10 -4
- package/dist/mcp/handlers/persona/analyze.js +0 -275
- package/dist/mcp/handlers/persona/compare.js +0 -32
- package/dist/mcp/tools-consolidated.js +0 -875
- package/dist/mcp/tools-legacy.js +0 -736
- package/docs/CODEBASE-ANALYSIS-2026-01-23.md +0 -936
- package/docs/CODEBASE-ANALYSIS-PRIORITIZED.md +0 -774
- package/docs/api-contracts.md +0 -216
- package/docs/auto-builder-analysis.md +0 -271
- package/docs/blog/mcp-tool-design-lessons.md +0 -309
- package/docs/data-architecture.md +0 -166
- package/docs/demos/ap-invoice-generation.md +0 -347
- package/docs/demos/ap-invoice-processing.md +0 -271
- package/docs/ema-auto-builder-guide.html +0 -394
- package/docs/lessons-learned.md +0 -209
- package/docs/llm-native-workflow-design.md +0 -252
- package/docs/local-generation.md +0 -508
- package/docs/mcp-flow-diagram.md +0 -135
- package/docs/migration/action-composition-migration.md +0 -270
- package/docs/naming-conventions.md +0 -278
- package/docs/proposals/HANDOFF-tool-restructure.md +0 -526
- package/docs/proposals/action-composition.md +0 -490
- package/docs/proposals/explicit-method-restructure.md +0 -328
- package/docs/proposals/mcp-tool-restructure-2026-01.md +0 -366
- package/docs/proposals/self-contained-guidance.md +0 -427
- package/docs/proto-sdk-generation.md +0 -242
- package/docs/release-impact.md +0 -102
- package/docs/release-process.md +0 -157
- package/docs/staging.RULE.md +0 -142
- package/docs/test-persona-creation.md +0 -196
- package/docs/tool-consolidation-v2.md +0 -225
- package/docs/tool-response-standards.md +0 -256
- package/resources/demo-kits/README.md +0 -175
- package/resources/demo-kits/finance-ap/manifest.json +0 -150
- package/resources/demo-kits/tags.json +0 -91
- package/resources/docs/getting-started.md +0 -97
- package/resources/templates/auto-builder-rules.md +0 -224
- package/resources/templates/chat-ai/README.md +0 -119
- package/resources/templates/chat-ai/persona-config.json +0 -111
- package/resources/templates/dashboard-ai/README.md +0 -156
- package/resources/templates/dashboard-ai/persona-config.json +0 -180
- package/resources/templates/demo-scenarios/README.md +0 -63
- package/resources/templates/demo-scenarios/test-published-package.md +0 -116
- package/resources/templates/document-gen-ai/README.md +0 -132
- package/resources/templates/document-gen-ai/persona-config.json +0 -316
- package/resources/templates/voice-ai/README.md +0 -123
- package/resources/templates/voice-ai/persona-config.json +0 -74
- package/resources/templates/voice-ai/workflow-prompt.md +0 -121
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
# Migration Guide: Action Composition
|
|
2
|
-
|
|
3
|
-
> **Version**: Introduced in 2026.01.19
|
|
4
|
-
> **Status**: Optional (backward compatible)
|
|
5
|
-
> **Breaking Changes**: None - legacy flag syntax still works
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
This release introduces **action composition** as an alternative to flag-based parameters for multi-step operations. The old syntax continues to work but the new syntax is recommended for new code.
|
|
10
|
-
|
|
11
|
-
## What Changed
|
|
12
|
-
|
|
13
|
-
### Old Way (Flag-Based)
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
// Clone with data copy and sanitization
|
|
17
|
-
persona(
|
|
18
|
-
method="create",
|
|
19
|
-
from="source-persona",
|
|
20
|
-
name="Demo Clone",
|
|
21
|
-
include_data=true,
|
|
22
|
-
sanitize=true,
|
|
23
|
-
sanitize_examples=["Acme Corp", "john@example.com"]
|
|
24
|
-
)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### New Way (Action-Based)
|
|
28
|
-
|
|
29
|
-
```typescript
|
|
30
|
-
// Same operation with explicit actions
|
|
31
|
-
persona(
|
|
32
|
-
method="create",
|
|
33
|
-
from="source-persona",
|
|
34
|
-
name="Demo Clone",
|
|
35
|
-
actions=[
|
|
36
|
-
{tool:"data", args:{method:"copy", from:"$source"}},
|
|
37
|
-
{tool:"data", args:{method:"sanitize", examples:["Acme Corp", "john@example.com"]}},
|
|
38
|
-
{tool:"snapshot", args:{message:"Demo clone ready"}},
|
|
39
|
-
]
|
|
40
|
-
)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Why Change?
|
|
44
|
-
|
|
45
|
-
| Issue with Flags | Benefit of Actions |
|
|
46
|
-
|------------------|-------------------|
|
|
47
|
-
| Semantics encoded in names (`include_data`) | Operations explicit (`method:"copy"`) |
|
|
48
|
-
| Coupled parameters (`sanitize_examples` requires `sanitize=true`) | Each action self-contained |
|
|
49
|
-
| Hidden execution order | Array order = execution order |
|
|
50
|
-
| Schema grows with features | Schema stable |
|
|
51
|
-
| Hard to add new capabilities | Add new action tools freely |
|
|
52
|
-
|
|
53
|
-
## Migration Guide
|
|
54
|
-
|
|
55
|
-
### For MCP Clients (LLMs/Agents)
|
|
56
|
-
|
|
57
|
-
**No action required.** The old flag syntax continues to work:
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// This still works (backward compatible)
|
|
61
|
-
persona(method="create", from="src", name="Clone", include_data=true, sanitize=true)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**To use the new syntax** (recommended for new code):
|
|
65
|
-
|
|
66
|
-
```typescript
|
|
67
|
-
// New syntax with explicit actions
|
|
68
|
-
persona(method="create", from="src", name="Clone", actions=[
|
|
69
|
-
{tool:"data", args:{method:"copy", from:"$source"}},
|
|
70
|
-
{tool:"data", args:{method:"sanitize"}},
|
|
71
|
-
])
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### For Cursor Rules / Agent Instructions
|
|
75
|
-
|
|
76
|
-
Update any rules that hardcode the old flag syntax:
|
|
77
|
-
|
|
78
|
-
```diff
|
|
79
|
-
# Before
|
|
80
|
-
- persona(method="create", from="src", name="Clone", include_data=true, sanitize=true)
|
|
81
|
-
|
|
82
|
-
# After (recommended)
|
|
83
|
-
+ persona(method="create", from="src", name="Clone", actions=[
|
|
84
|
-
+ {tool:"data", args:{method:"copy", from:"$source"}},
|
|
85
|
-
+ {tool:"data", args:{method:"sanitize"}},
|
|
86
|
-
+ ])
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### For TypeScript SDK Users
|
|
90
|
-
|
|
91
|
-
The SDK automatically handles both syntaxes. No code changes required.
|
|
92
|
-
|
|
93
|
-
## Syntax Reference
|
|
94
|
-
|
|
95
|
-
### Action Spec Format
|
|
96
|
-
|
|
97
|
-
```typescript
|
|
98
|
-
{
|
|
99
|
-
tool: "data" | "snapshot" | "validate", // Tool to invoke
|
|
100
|
-
args: { ... } // Arguments (same as direct tool call)
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Context Variables
|
|
105
|
-
|
|
106
|
-
| Variable | Description |
|
|
107
|
-
|----------|-------------|
|
|
108
|
-
| `$source` | The `from` parameter (template/persona being cloned) |
|
|
109
|
-
| `$target` | ID of the created/modified persona |
|
|
110
|
-
| `$env` | Current environment name |
|
|
111
|
-
|
|
112
|
-
### Built-in Aliases
|
|
113
|
-
|
|
114
|
-
Instead of writing full action specs, you can use aliases:
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
// Using alias
|
|
118
|
-
persona(method="create", from="src", name="Clone", actions=["copy-and-sanitize"])
|
|
119
|
-
|
|
120
|
-
// Equivalent to
|
|
121
|
-
persona(method="create", from="src", name="Clone", actions=[
|
|
122
|
-
{tool:"data", args:{method:"copy", from:"$source"}},
|
|
123
|
-
{tool:"data", args:{method:"sanitize"}},
|
|
124
|
-
])
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
| Alias | Expands To |
|
|
128
|
-
|-------|-----------|
|
|
129
|
-
| `"copy-data"` | Copy data from source |
|
|
130
|
-
| `"copy-and-sanitize"` | Copy data, then sanitize |
|
|
131
|
-
| `"standard-demo-setup"` | Copy, sanitize, create snapshot |
|
|
132
|
-
| `"validate-workflow"` | Run workflow validation |
|
|
133
|
-
|
|
134
|
-
### Available Action Tools
|
|
135
|
-
|
|
136
|
-
| Tool | Methods | Purpose |
|
|
137
|
-
|------|---------|---------|
|
|
138
|
-
| `data` | copy, sanitize, upload | Data operations |
|
|
139
|
-
| `snapshot` | (message) | Create version checkpoint |
|
|
140
|
-
| `validate` | (checks) | Run validation checks |
|
|
141
|
-
|
|
142
|
-
## Examples
|
|
143
|
-
|
|
144
|
-
### Clone with Data Copy
|
|
145
|
-
|
|
146
|
-
```typescript
|
|
147
|
-
// Old
|
|
148
|
-
persona(method="create", from="src", name="Clone", include_data=true)
|
|
149
|
-
|
|
150
|
-
// New
|
|
151
|
-
persona(method="create", from="src", name="Clone", actions=[
|
|
152
|
-
{tool:"data", args:{method:"copy", from:"$source"}}
|
|
153
|
-
])
|
|
154
|
-
|
|
155
|
-
// New (with alias)
|
|
156
|
-
persona(method="create", from="src", name="Clone", actions=["copy-data"])
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Clone with Sanitization
|
|
160
|
-
|
|
161
|
-
```typescript
|
|
162
|
-
// Old
|
|
163
|
-
persona(method="create", from="src", name="Clone", include_data=true, sanitize=true, sanitize_examples=["Acme"])
|
|
164
|
-
|
|
165
|
-
// New
|
|
166
|
-
persona(method="create", from="src", name="Clone", actions=[
|
|
167
|
-
{tool:"data", args:{method:"copy", from:"$source"}},
|
|
168
|
-
{tool:"data", args:{method:"sanitize", examples:["Acme"]}},
|
|
169
|
-
])
|
|
170
|
-
|
|
171
|
-
// New (with alias)
|
|
172
|
-
persona(method="create", from="src", name="Clone", actions=["copy-and-sanitize"])
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Clone with LLM-Generated Content
|
|
176
|
-
|
|
177
|
-
```typescript
|
|
178
|
-
// No old equivalent - this is new functionality
|
|
179
|
-
persona(method="create", from="template-id", name="Test Dashboard", actions=[
|
|
180
|
-
{tool:"data", args:{
|
|
181
|
-
method:"upload",
|
|
182
|
-
content:[
|
|
183
|
-
{document:{text:"Contract 1..."}, title:"Contract A", value:50000},
|
|
184
|
-
{document:{text:"Contract 2..."}, title:"Contract B", value:75000},
|
|
185
|
-
]
|
|
186
|
-
}},
|
|
187
|
-
{tool:"snapshot", args:{message:"Test data loaded"}},
|
|
188
|
-
])
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Multiple Operations with Checkpoint
|
|
192
|
-
|
|
193
|
-
```typescript
|
|
194
|
-
persona(method="create", from="prod-persona", name="Demo", actions=[
|
|
195
|
-
{tool:"data", args:{method:"copy", from:"$source"}},
|
|
196
|
-
{tool:"data", args:{method:"sanitize", examples:["Acme Corp", "john@acme.com"]}},
|
|
197
|
-
{tool:"validate", args:{checks:["workflow", "config"]}},
|
|
198
|
-
{tool:"snapshot", args:{message:"Demo environment ready"}},
|
|
199
|
-
])
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Response Format
|
|
203
|
-
|
|
204
|
-
When using actions, the response includes an `actions` field:
|
|
205
|
-
|
|
206
|
-
```json
|
|
207
|
-
{
|
|
208
|
-
"success": true,
|
|
209
|
-
"persona_id": "new-persona-123",
|
|
210
|
-
"name": "Demo Clone",
|
|
211
|
-
"actions": {
|
|
212
|
-
"executed": 3,
|
|
213
|
-
"succeeded": 3,
|
|
214
|
-
"failed": 0,
|
|
215
|
-
"results": [
|
|
216
|
-
{"tool": "data", "status": "success", "result": {...}, "duration_ms": 150},
|
|
217
|
-
{"tool": "data", "status": "success", "result": {...}, "duration_ms": 89},
|
|
218
|
-
{"tool": "snapshot", "status": "success", "result": {...}, "duration_ms": 12}
|
|
219
|
-
]
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
If an action fails, execution stops and the response includes details:
|
|
225
|
-
|
|
226
|
-
```json
|
|
227
|
-
{
|
|
228
|
-
"success": false,
|
|
229
|
-
"partial": true,
|
|
230
|
-
"persona_id": "new-persona-123",
|
|
231
|
-
"actions": {
|
|
232
|
-
"executed": 2,
|
|
233
|
-
"succeeded": 1,
|
|
234
|
-
"failed": 1,
|
|
235
|
-
"stopped_on_error": true,
|
|
236
|
-
"results": [
|
|
237
|
-
{"tool": "data", "status": "success", ...},
|
|
238
|
-
{"tool": "data", "status": "error", "error": "Source persona not found"}
|
|
239
|
-
]
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
## FAQ
|
|
245
|
-
|
|
246
|
-
### Do I have to migrate?
|
|
247
|
-
|
|
248
|
-
No. The old syntax works and will continue to work. Migration is optional but recommended for new code.
|
|
249
|
-
|
|
250
|
-
### Can I mix old and new syntax?
|
|
251
|
-
|
|
252
|
-
No. If you provide `actions`, the flag parameters (`include_data`, `sanitize`, etc.) are ignored. Choose one approach per call.
|
|
253
|
-
|
|
254
|
-
### What if an action fails?
|
|
255
|
-
|
|
256
|
-
Execution stops at the first error. The base operation (e.g., persona creation) is still completed, but subsequent actions are skipped. The response indicates `partial: true` and includes error details.
|
|
257
|
-
|
|
258
|
-
### How do I know what actions are available?
|
|
259
|
-
|
|
260
|
-
Use `catalog(method="list", type="concepts")` or check the tool description in your MCP client. The available actions are documented in the `persona` tool description.
|
|
261
|
-
|
|
262
|
-
### Can I create custom aliases?
|
|
263
|
-
|
|
264
|
-
Not yet. Currently only built-in aliases are supported. Custom aliases may be added in a future version.
|
|
265
|
-
|
|
266
|
-
## Related Documentation
|
|
267
|
-
|
|
268
|
-
- Design doc: `docs/proposals/action-composition.md`
|
|
269
|
-
- Naming conventions: `docs/naming-conventions.md`
|
|
270
|
-
- Full tools guide: `docs/mcp-tools-guide.md`
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
# MCP Naming Conventions (AUTHORITATIVE)
|
|
2
|
-
|
|
3
|
-
> **THIS IS THE SINGLE SOURCE OF TRUTH FOR ALL NAMING IN THIS PROJECT.**
|
|
4
|
-
> Any deviation from this document is a bug.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Core Principle
|
|
9
|
-
|
|
10
|
-
**ONE pattern for similar things. Tools and prompts that relate to the same domain MUST use the same naming structure.**
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 1. MCP Tools (Consolidated)
|
|
15
|
-
|
|
16
|
-
Tools use **noun-based naming with explicit `method` parameter**:
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
{noun}(method="{action}", ...)
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Key principle**: The LLM explicitly declares the operation via `method`. MCP does not infer operations from parameter presence.
|
|
23
|
-
|
|
24
|
-
### Current Consolidated Tools
|
|
25
|
-
|
|
26
|
-
| Tool | Methods | Pattern |
|
|
27
|
-
|------|---------|---------|
|
|
28
|
-
| `persona` | list, get, create, update, delete, analyze, sanitize, snapshot, history, restore, compare | `persona(method="create", ...)` |
|
|
29
|
-
| `catalog` | list, get, search, recommend | `catalog(method="list", type="actions")` |
|
|
30
|
-
| `sync` | preview, execute, status | `sync(method="preview", ...)` |
|
|
31
|
-
| `env` | (single operation) | `env()` |
|
|
32
|
-
|
|
33
|
-
### Data Sub-Resource (under persona)
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
persona(id="abc", data={method:"{action}", ...})
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
| Method | Purpose | Example |
|
|
40
|
-
|--------|---------|---------|
|
|
41
|
-
| `list` | List data items | `data={method:"list"}` |
|
|
42
|
-
| `schema` | Get input schema | `data={method:"schema"}` |
|
|
43
|
-
| `upload` | Upload file or content | `data={method:"upload", path:"..."}` |
|
|
44
|
-
| `copy` | Copy from another persona | `data={method:"copy", from:"..."}` |
|
|
45
|
-
| `delete` | Delete item | `data={method:"delete", id:"..."}` |
|
|
46
|
-
| `embed` | Toggle embeddings | `data={method:"embed", enabled:true}` |
|
|
47
|
-
| `search` | Search data | `data={method:"search", query:"..."}` |
|
|
48
|
-
|
|
49
|
-
### Action Composition (multi-step operations)
|
|
50
|
-
|
|
51
|
-
Instead of flag parameters (`include_data=true`, `sanitize=true`), use the `actions` array:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
persona(method="create", from="...", name="...", actions=[...])
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
| Pattern | Purpose | Example |
|
|
58
|
-
|---------|---------|---------|
|
|
59
|
-
| Action spec | Explicit tool + args | `{tool:"data", args:{method:"copy", from:"$source"}}` |
|
|
60
|
-
| Alias | Named pattern | `"copy-and-sanitize"`, `"standard-demo-setup"` |
|
|
61
|
-
|
|
62
|
-
**Context variables** (auto-substituted):
|
|
63
|
-
- `$source` - The `from` parameter (template/persona being cloned)
|
|
64
|
-
- `$target` - The ID of the created/modified persona
|
|
65
|
-
- `$env` - Current environment
|
|
66
|
-
|
|
67
|
-
**Available action tools:**
|
|
68
|
-
- `data` - Data operations (copy, sanitize, upload)
|
|
69
|
-
- `snapshot` - Create version checkpoint
|
|
70
|
-
- `validate` - Run validation checks
|
|
71
|
-
|
|
72
|
-
**Built-in aliases:**
|
|
73
|
-
- `copy-data` - Copy data from source
|
|
74
|
-
- `copy-and-sanitize` - Copy then sanitize
|
|
75
|
-
- `standard-demo-setup` - Copy, sanitize, snapshot
|
|
76
|
-
|
|
77
|
-
**Key principle**: Operations are explicit, not encoded in parameter names.
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
// ❌ BAD: Semantics encoded in names
|
|
81
|
-
persona(method="create", ..., include_data=true, sanitize=true, sanitize_examples=[...])
|
|
82
|
-
|
|
83
|
-
// ✅ GOOD: Explicit composable actions
|
|
84
|
-
persona(method="create", ..., actions=[
|
|
85
|
-
{tool:"data", args:{method:"copy", from:"$source"}},
|
|
86
|
-
{tool:"data", args:{method:"sanitize", examples:[...]}},
|
|
87
|
-
])
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Legacy Tool Aliases (DEPRECATED - for backwards compatibility only)
|
|
91
|
-
|
|
92
|
-
These exist ONLY for backwards compatibility and redirect to consolidated tools:
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
deploy_workflow → persona(method="update", ...)
|
|
96
|
-
workflow → persona(method="update", ...)
|
|
97
|
-
knowledge → persona(id="...", data={method:"..."})
|
|
98
|
-
demo → persona(id="...", data={method:"upload", ...})
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**DO NOT create new tools with `verb_noun` pattern.**
|
|
102
|
-
**DO NOT infer operations from parameter presence - always use explicit `method`.**
|
|
103
|
-
**DO NOT add flag parameters for operations - use `actions` array instead.**
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## 2. MCP Prompts
|
|
108
|
-
|
|
109
|
-
Prompts are **guided multi-step workflows**. They MUST follow the **same `{noun}_{action}` pattern** as tools:
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
{noun}_{action}
|
|
113
|
-
{noun}_{action}_{qualifier} # only when disambiguation needed
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Prompt Naming Rules
|
|
117
|
-
|
|
118
|
-
| Pattern | Example | Maps To Tool |
|
|
119
|
-
|---------|---------|--------------|
|
|
120
|
-
| `persona_create` | Create a persona | `persona(method="create", ...)` |
|
|
121
|
-
| `persona_update` | Update a persona | `persona(method="update", ...)` |
|
|
122
|
-
| `persona_analyze` | Analyze a persona | `persona(method="analyze", ...)` |
|
|
123
|
-
| `persona_sanitize` | Sanitize a persona | `persona(method="sanitize", ...)` |
|
|
124
|
-
| `persona_sync` | Sync a persona | `sync(method="execute", ...)` |
|
|
125
|
-
| `data_upload` | Upload data | `persona(id="...", data={method:"upload", ...})` |
|
|
126
|
-
| `data_copy` | Copy data | `persona(id="...", data={method:"copy", ...})` |
|
|
127
|
-
|
|
128
|
-
### FORBIDDEN Patterns
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
❌ deploy_workflow # verb_noun is WRONG
|
|
132
|
-
❌ explain_workflow # verb_noun is WRONG
|
|
133
|
-
❌ generate_workflow_direct # _direct suffix is unclear
|
|
134
|
-
❌ analyze_workflow_intent # should be workflow_analyze_intent
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Acceptable Legacy Exceptions (for backwards compat only)
|
|
138
|
-
|
|
139
|
-
These prompts exist and are grandfathered but should not be used as templates:
|
|
140
|
-
|
|
141
|
-
- `generate_ai_employee` - legacy, use `persona_create` for new
|
|
142
|
-
- `create_voice_ai` - legacy, use `persona_create` with `type="voice"`
|
|
143
|
-
- `create_chat_ai` - legacy, use `persona_create` with `type="chat"`
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## 3. Functions & Interfaces
|
|
148
|
-
|
|
149
|
-
### Functions
|
|
150
|
-
|
|
151
|
-
```typescript
|
|
152
|
-
// Pattern: {verb}{Noun} or {verb}{Noun}{Qualifier}
|
|
153
|
-
parseNaturalLanguage()
|
|
154
|
-
validateIntent()
|
|
155
|
-
detectActionChains()
|
|
156
|
-
calculateIntentConfidence()
|
|
157
|
-
generateOutputSemanticsPrompt()
|
|
158
|
-
applyExtractedSemantics()
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Interfaces/Types
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
// Pattern: {Noun}{Qualifier}
|
|
165
|
-
WorkflowIntent
|
|
166
|
-
OutputSemantics
|
|
167
|
-
IntentConfidence
|
|
168
|
-
ValidationResult
|
|
169
|
-
AgentDefinition
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Constants
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
// Pattern: SCREAMING_SNAKE_CASE
|
|
176
|
-
AGENT_CATALOG
|
|
177
|
-
WORKFLOW_PATTERNS
|
|
178
|
-
TYPE_COMPATIBILITY
|
|
179
|
-
ACTION_CHAIN_PATTERNS
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
## 4. Issue Types (Validation)
|
|
185
|
-
|
|
186
|
-
Issue types use **snake_case** with category prefix:
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
{category}_{specific_problem}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
| Category | Examples |
|
|
193
|
-
|----------|----------|
|
|
194
|
-
| `unused_` | `unused_output` |
|
|
195
|
-
| `missing_` | `missing_entity_extraction`, `missing_category_edge` |
|
|
196
|
-
| `wrong_` | `wrong_input_source` |
|
|
197
|
-
| `side_effect_` | `side_effect_without_hitl` |
|
|
198
|
-
| `redundant_` | `redundant_search` |
|
|
199
|
-
| `sequential_` | `sequential_search` |
|
|
200
|
-
| `duplicate_` | `duplicate_llm_processing` |
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
## 5. Resource URIs
|
|
205
|
-
|
|
206
|
-
Resource URIs use **path-like structure**:
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
ema://{category}/{subcategory}/{item}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
| Pattern | Example |
|
|
213
|
-
|---------|---------|
|
|
214
|
-
| Catalogs | `ema://catalog/agents`, `ema://catalog/agents/summary` |
|
|
215
|
-
| Patterns | `ema://patterns/workflows` |
|
|
216
|
-
| Templates | `ema://templates/voice-ai/config` |
|
|
217
|
-
| Validation | `ema://validation/input-sources`, `ema://validation/anti-patterns` |
|
|
218
|
-
| Index | `ema://index/all-resources` |
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
## 6. File Naming
|
|
223
|
-
|
|
224
|
-
| Type | Pattern | Example |
|
|
225
|
-
|------|---------|---------|
|
|
226
|
-
| TypeScript source | `kebab-case.ts` | `workflow-intent.ts`, `validation-rules.ts` |
|
|
227
|
-
| Test files | `{module}.test.ts` | `workflow-intent.test.ts` |
|
|
228
|
-
| Documentation | `kebab-case.md` | `naming-conventions.md` |
|
|
229
|
-
| Config | `kebab-case.yaml/json` | `config.example.yaml` |
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
## Enforcement Checklist
|
|
234
|
-
|
|
235
|
-
Before adding ANY new name:
|
|
236
|
-
|
|
237
|
-
- [ ] Does it follow `{noun}_{action}` for prompts?
|
|
238
|
-
- [ ] Does it follow `{noun}(method="{action}")` for tools?
|
|
239
|
-
- [ ] Does tool use explicit `method` parameter (not inferred from other params)?
|
|
240
|
-
- [ ] Does it follow `{verb}{Noun}` for functions?
|
|
241
|
-
- [ ] Does it follow `{Noun}{Qualifier}` for interfaces?
|
|
242
|
-
- [ ] Is there already a similar pattern established? If so, follow it exactly.
|
|
243
|
-
- [ ] Does it avoid hardcoded specific values?
|
|
244
|
-
- [ ] Is it clear what the name refers to?
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
## Migration Notes
|
|
249
|
-
|
|
250
|
-
### Renamed in this cleanup:
|
|
251
|
-
|
|
252
|
-
| Old (WRONG) | New (CORRECT) |
|
|
253
|
-
|-------------|---------------|
|
|
254
|
-
| `deploy_workflow` | `workflow_deploy` |
|
|
255
|
-
| `explain_workflow` | `workflow_explain` |
|
|
256
|
-
| `extend_workflow` | `workflow_extend` |
|
|
257
|
-
| `analyze_workflow_intent` | `workflow_analyze_intent` |
|
|
258
|
-
| `generate_workflow_direct` | `workflow_generate` |
|
|
259
|
-
| `generate_ai_employee` | `ai_employee_generate` |
|
|
260
|
-
| `review_workflow` | `workflow_review` |
|
|
261
|
-
| `debug_workflow` | `workflow_debug` |
|
|
262
|
-
| `create_voice_ai` | `persona_create_voice` |
|
|
263
|
-
| `create_chat_ai` | `persona_create_chat` |
|
|
264
|
-
| `sync_persona` | `persona_sync` |
|
|
265
|
-
| `compare_personas` | `persona_compare` |
|
|
266
|
-
| `validate_prompt` | `prompt_validate` |
|
|
267
|
-
| `onboard_toolkit` | `toolkit_onboard` |
|
|
268
|
-
| `clarify_requirements` | `requirements_clarify` |
|
|
269
|
-
|
|
270
|
-
---
|
|
271
|
-
|
|
272
|
-
## References
|
|
273
|
-
|
|
274
|
-
- Tools defined in: `src/mcp/tools-v2.ts`
|
|
275
|
-
- Prompts defined in: `src/mcp/prompts.ts`
|
|
276
|
-
- Legacy mappings in: `src/mcp/tools-legacy.ts`
|
|
277
|
-
- Design doc: `docs/proposals/explicit-method-restructure.md`
|
|
278
|
-
- Action composition: `docs/proposals/action-composition.md`
|