@zhixuan92/multi-model-agent 4.9.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mmagent.mjs +47 -0
- package/package.json +19 -57
- package/postinstall.mjs +8 -0
- package/LICENSE +0 -21
- package/README.md +0 -306
- package/dist/cli/index.d.ts +0 -62
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -345
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/info.d.ts +0 -22
- package/dist/cli/info.d.ts.map +0 -1
- package/dist/cli/info.js +0 -100
- package/dist/cli/info.js.map +0 -1
- package/dist/cli/logs.d.ts +0 -15
- package/dist/cli/logs.d.ts.map +0 -1
- package/dist/cli/logs.js +0 -102
- package/dist/cli/logs.js.map +0 -1
- package/dist/cli/print-token.d.ts +0 -18
- package/dist/cli/print-token.d.ts.map +0 -1
- package/dist/cli/print-token.js +0 -60
- package/dist/cli/print-token.js.map +0 -1
- package/dist/cli/serve.d.ts +0 -28
- package/dist/cli/serve.d.ts.map +0 -1
- package/dist/cli/serve.js +0 -405
- package/dist/cli/serve.js.map +0 -1
- package/dist/cli/status.d.ts +0 -49
- package/dist/cli/status.d.ts.map +0 -1
- package/dist/cli/status.js +0 -155
- package/dist/cli/status.js.map +0 -1
- package/dist/cli/sync-skills.d.ts +0 -58
- package/dist/cli/sync-skills.d.ts.map +0 -1
- package/dist/cli/sync-skills.js +0 -266
- package/dist/cli/sync-skills.js.map +0 -1
- package/dist/cli/telemetry.d.ts +0 -10
- package/dist/cli/telemetry.d.ts.map +0 -1
- package/dist/cli/telemetry.js +0 -161
- package/dist/cli/telemetry.js.map +0 -1
- package/dist/cli/toggle.d.ts +0 -26
- package/dist/cli/toggle.d.ts.map +0 -1
- package/dist/cli/toggle.js +0 -185
- package/dist/cli/toggle.js.map +0 -1
- package/dist/http/async-dispatch.d.ts +0 -44
- package/dist/http/async-dispatch.d.ts.map +0 -1
- package/dist/http/async-dispatch.js +0 -175
- package/dist/http/async-dispatch.js.map +0 -1
- package/dist/http/auth.d.ts +0 -20
- package/dist/http/auth.d.ts.map +0 -1
- package/dist/http/auth.js +0 -56
- package/dist/http/auth.js.map +0 -1
- package/dist/http/canonicalize-file-paths.d.ts +0 -8
- package/dist/http/canonicalize-file-paths.d.ts.map +0 -1
- package/dist/http/canonicalize-file-paths.js +0 -43
- package/dist/http/canonicalize-file-paths.js.map +0 -1
- package/dist/http/cwd-validator.d.ts +0 -11
- package/dist/http/cwd-validator.d.ts.map +0 -1
- package/dist/http/cwd-validator.js +0 -130
- package/dist/http/cwd-validator.js.map +0 -1
- package/dist/http/errors.d.ts +0 -4
- package/dist/http/errors.d.ts.map +0 -1
- package/dist/http/errors.js +0 -9
- package/dist/http/errors.js.map +0 -1
- package/dist/http/execution-context.d.ts +0 -18
- package/dist/http/execution-context.d.ts.map +0 -1
- package/dist/http/execution-context.js +0 -61
- package/dist/http/execution-context.js.map +0 -1
- package/dist/http/handler-deps.d.ts +0 -19
- package/dist/http/handler-deps.d.ts.map +0 -1
- package/dist/http/handler-deps.js +0 -2
- package/dist/http/handler-deps.js.map +0 -1
- package/dist/http/handlers/control/batch-slice.d.ts +0 -4
- package/dist/http/handlers/control/batch-slice.d.ts.map +0 -1
- package/dist/http/handlers/control/batch-slice.js +0 -40
- package/dist/http/handlers/control/batch-slice.js.map +0 -1
- package/dist/http/handlers/control/batch.d.ts +0 -23
- package/dist/http/handlers/control/batch.d.ts.map +0 -1
- package/dist/http/handlers/control/batch.js +0 -332
- package/dist/http/handlers/control/batch.js.map +0 -1
- package/dist/http/handlers/control/context-blocks.d.ts +0 -22
- package/dist/http/handlers/control/context-blocks.d.ts.map +0 -1
- package/dist/http/handlers/control/context-blocks.js +0 -111
- package/dist/http/handlers/control/context-blocks.js.map +0 -1
- package/dist/http/handlers/introspection/health.d.ts +0 -20
- package/dist/http/handlers/introspection/health.d.ts.map +0 -1
- package/dist/http/handlers/introspection/health.js +0 -18
- package/dist/http/handlers/introspection/health.js.map +0 -1
- package/dist/http/handlers/introspection/status.d.ts +0 -26
- package/dist/http/handlers/introspection/status.d.ts.map +0 -1
- package/dist/http/handlers/introspection/status.js +0 -136
- package/dist/http/handlers/introspection/status.js.map +0 -1
- package/dist/http/handlers/tools/audit.d.ts +0 -4
- package/dist/http/handlers/tools/audit.d.ts.map +0 -1
- package/dist/http/handlers/tools/audit.js +0 -43
- package/dist/http/handlers/tools/audit.js.map +0 -1
- package/dist/http/handlers/tools/debug.d.ts +0 -4
- package/dist/http/handlers/tools/debug.d.ts.map +0 -1
- package/dist/http/handlers/tools/debug.js +0 -43
- package/dist/http/handlers/tools/debug.js.map +0 -1
- package/dist/http/handlers/tools/delegate.d.ts +0 -4
- package/dist/http/handlers/tools/delegate.d.ts.map +0 -1
- package/dist/http/handlers/tools/delegate.js +0 -43
- package/dist/http/handlers/tools/delegate.js.map +0 -1
- package/dist/http/handlers/tools/execute-plan.d.ts +0 -4
- package/dist/http/handlers/tools/execute-plan.d.ts.map +0 -1
- package/dist/http/handlers/tools/execute-plan.js +0 -45
- package/dist/http/handlers/tools/execute-plan.js.map +0 -1
- package/dist/http/handlers/tools/investigate.d.ts +0 -4
- package/dist/http/handlers/tools/investigate.d.ts.map +0 -1
- package/dist/http/handlers/tools/investigate.js +0 -64
- package/dist/http/handlers/tools/investigate.js.map +0 -1
- package/dist/http/handlers/tools/journal-recall.d.ts +0 -4
- package/dist/http/handlers/tools/journal-recall.d.ts.map +0 -1
- package/dist/http/handlers/tools/journal-recall.js +0 -40
- package/dist/http/handlers/tools/journal-recall.js.map +0 -1
- package/dist/http/handlers/tools/journal-record.d.ts +0 -4
- package/dist/http/handlers/tools/journal-record.d.ts.map +0 -1
- package/dist/http/handlers/tools/journal-record.js +0 -35
- package/dist/http/handlers/tools/journal-record.js.map +0 -1
- package/dist/http/handlers/tools/research.d.ts +0 -4
- package/dist/http/handlers/tools/research.d.ts.map +0 -1
- package/dist/http/handlers/tools/research.js +0 -64
- package/dist/http/handlers/tools/research.js.map +0 -1
- package/dist/http/handlers/tools/retry.d.ts +0 -4
- package/dist/http/handlers/tools/retry.d.ts.map +0 -1
- package/dist/http/handlers/tools/retry.js +0 -73
- package/dist/http/handlers/tools/retry.js.map +0 -1
- package/dist/http/handlers/tools/review.d.ts +0 -4
- package/dist/http/handlers/tools/review.d.ts.map +0 -1
- package/dist/http/handlers/tools/review.js +0 -43
- package/dist/http/handlers/tools/review.js.map +0 -1
- package/dist/http/middleware/body-reader.d.ts +0 -16
- package/dist/http/middleware/body-reader.d.ts.map +0 -1
- package/dist/http/middleware/body-reader.js +0 -44
- package/dist/http/middleware/body-reader.js.map +0 -1
- package/dist/http/middleware/caller-identity.d.ts +0 -16
- package/dist/http/middleware/caller-identity.d.ts.map +0 -1
- package/dist/http/middleware/caller-identity.js +0 -16
- package/dist/http/middleware/caller-identity.js.map +0 -1
- package/dist/http/middleware/decompress.d.ts +0 -14
- package/dist/http/middleware/decompress.d.ts.map +0 -1
- package/dist/http/middleware/decompress.js +0 -51
- package/dist/http/middleware/decompress.js.map +0 -1
- package/dist/http/project-registry.d.ts +0 -54
- package/dist/http/project-registry.d.ts.map +0 -1
- package/dist/http/project-registry.js +0 -130
- package/dist/http/project-registry.js.map +0 -1
- package/dist/http/request-observability.d.ts +0 -8
- package/dist/http/request-observability.d.ts.map +0 -1
- package/dist/http/request-observability.js +0 -20
- package/dist/http/request-observability.js.map +0 -1
- package/dist/http/request-pipeline.d.ts +0 -16
- package/dist/http/request-pipeline.d.ts.map +0 -1
- package/dist/http/request-pipeline.js +0 -144
- package/dist/http/request-pipeline.js.map +0 -1
- package/dist/http/server.d.ts +0 -17
- package/dist/http/server.d.ts.map +0 -1
- package/dist/http/server.js +0 -300
- package/dist/http/server.js.map +0 -1
- package/dist/http/types.d.ts +0 -20
- package/dist/http/types.d.ts.map +0 -1
- package/dist/http/types.js +0 -2
- package/dist/http/types.js.map +0 -1
- package/dist/skill-install/disabled-state.d.ts +0 -35
- package/dist/skill-install/disabled-state.d.ts.map +0 -1
- package/dist/skill-install/disabled-state.js +0 -96
- package/dist/skill-install/disabled-state.js.map +0 -1
- package/dist/skill-install/discover.d.ts +0 -29
- package/dist/skill-install/discover.d.ts.map +0 -1
- package/dist/skill-install/discover.js +0 -104
- package/dist/skill-install/discover.js.map +0 -1
- package/dist/skill-install/include-utils.d.ts +0 -27
- package/dist/skill-install/include-utils.d.ts.map +0 -1
- package/dist/skill-install/include-utils.js +0 -90
- package/dist/skill-install/include-utils.js.map +0 -1
- package/dist/skill-install/manifest.d.ts +0 -82
- package/dist/skill-install/manifest.d.ts.map +0 -1
- package/dist/skill-install/manifest.js +0 -215
- package/dist/skill-install/manifest.js.map +0 -1
- package/dist/skill-install/skill-installer-common.d.ts +0 -26
- package/dist/skill-install/skill-installer-common.d.ts.map +0 -1
- package/dist/skill-install/skill-installer-common.js +0 -139
- package/dist/skill-install/skill-installer-common.js.map +0 -1
- package/dist/skill-install/skill-installers/claude-code.d.ts +0 -43
- package/dist/skill-install/skill-installers/claude-code.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/claude-code.js +0 -65
- package/dist/skill-install/skill-installers/claude-code.js.map +0 -1
- package/dist/skill-install/skill-installers/codex-cli.d.ts +0 -27
- package/dist/skill-install/skill-installers/codex-cli.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/codex-cli.js +0 -84
- package/dist/skill-install/skill-installers/codex-cli.js.map +0 -1
- package/dist/skill-install/skill-installers/cursor.d.ts +0 -72
- package/dist/skill-install/skill-installers/cursor.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/cursor.js +0 -81
- package/dist/skill-install/skill-installers/cursor.js.map +0 -1
- package/dist/skill-install/skill-installers/gemini-cli.d.ts +0 -50
- package/dist/skill-install/skill-installers/gemini-cli.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/gemini-cli.js +0 -72
- package/dist/skill-install/skill-installers/gemini-cli.js.map +0 -1
- package/dist/skill-install/skill-manifest-sync.d.ts +0 -11
- package/dist/skill-install/skill-manifest-sync.d.ts.map +0 -1
- package/dist/skill-install/skill-manifest-sync.js +0 -65
- package/dist/skill-install/skill-manifest-sync.js.map +0 -1
- package/dist/skills/_shared/auth.md +0 -41
- package/dist/skills/_shared/error-handling.md +0 -31
- package/dist/skills/_shared/polling.md +0 -88
- package/dist/skills/_shared/response-shape.md +0 -55
- package/dist/skills/_shared/review-policy.md +0 -15
- package/dist/skills/mma-audit/SKILL.md +0 -270
- package/dist/skills/mma-context-blocks/SKILL.md +0 -148
- package/dist/skills/mma-debug/SKILL.md +0 -208
- package/dist/skills/mma-delegate/SKILL.md +0 -216
- package/dist/skills/mma-execute-plan/SKILL.md +0 -214
- package/dist/skills/mma-explore/SKILL.md +0 -190
- package/dist/skills/mma-investigate/SKILL.md +0 -258
- package/dist/skills/mma-journal-recall/SKILL.md +0 -242
- package/dist/skills/mma-journal-record/SKILL.md +0 -189
- package/dist/skills/mma-research/SKILL.md +0 -223
- package/dist/skills/mma-retry/SKILL.md +0 -221
- package/dist/skills/mma-review/SKILL.md +0 -209
- package/dist/skills/multi-model-agent/SKILL.md +0 -206
- package/dist/telemetry/consent.d.ts +0 -4
- package/dist/telemetry/consent.d.ts.map +0 -1
- package/dist/telemetry/consent.js +0 -40
- package/dist/telemetry/consent.js.map +0 -1
- package/dist/telemetry/flusher.d.ts +0 -19
- package/dist/telemetry/flusher.d.ts.map +0 -1
- package/dist/telemetry/flusher.js +0 -277
- package/dist/telemetry/flusher.js.map +0 -1
- package/dist/telemetry/generation.d.ts +0 -9
- package/dist/telemetry/generation.d.ts.map +0 -1
- package/dist/telemetry/generation.js +0 -33
- package/dist/telemetry/generation.js.map +0 -1
- package/dist/telemetry/identity.d.ts +0 -9
- package/dist/telemetry/identity.d.ts.map +0 -1
- package/dist/telemetry/identity.js +0 -35
- package/dist/telemetry/identity.js.map +0 -1
- package/dist/telemetry/install-id.d.ts +0 -13
- package/dist/telemetry/install-id.d.ts.map +0 -1
- package/dist/telemetry/install-id.js +0 -49
- package/dist/telemetry/install-id.js.map +0 -1
- package/dist/telemetry/install-meta.d.ts +0 -10
- package/dist/telemetry/install-meta.d.ts.map +0 -1
- package/dist/telemetry/install-meta.js +0 -15
- package/dist/telemetry/install-meta.js.map +0 -1
- package/dist/telemetry/queue.d.ts +0 -35
- package/dist/telemetry/queue.d.ts.map +0 -1
- package/dist/telemetry/queue.js +0 -287
- package/dist/telemetry/queue.js.map +0 -1
- package/dist/telemetry/recorder.d.ts +0 -39
- package/dist/telemetry/recorder.d.ts.map +0 -1
- package/dist/telemetry/recorder.js +0 -173
- package/dist/telemetry/recorder.js.map +0 -1
- package/scripts/postinstall.js +0 -36
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mma-delegate
|
|
3
|
-
description: >-
|
|
4
|
-
Use when you have one or more ad-hoc implementation or research tasks WITHOUT
|
|
5
|
-
a plan file on disk and you want them to run on cheap workers in parallel
|
|
6
|
-
instead of consuming main-context tokens
|
|
7
|
-
when_to_use: >-
|
|
8
|
-
You have ad-hoc implementation or research tasks (no plan file on disk) AND
|
|
9
|
-
mmagent is running. Prefer this over inline Agent dispatches or
|
|
10
|
-
superpowers:dispatching-parallel-agents — workers are cheaper, parallel-safe,
|
|
11
|
-
and keep main context free. If a plan file exists → use mma-execute-plan. If
|
|
12
|
-
the task is audit / review / verify / debug / investigate → use the matching
|
|
13
|
-
specialized skill.
|
|
14
|
-
version: 4.9.0
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# mma-delegate
|
|
18
|
-
|
|
19
|
-
## Overview
|
|
20
|
-
|
|
21
|
-
Dispatch one or more ad-hoc tasks to workers concurrently. Each task is an independent instruction with optional file scope, acceptance criteria, and context blocks.
|
|
22
|
-
|
|
23
|
-
**Core principle:** Workers run on cheap providers; the main agent consumes only the structured per-task report. Parallelize freely as long as tasks don't write the same files.
|
|
24
|
-
|
|
25
|
-
## When to Use
|
|
26
|
-
|
|
27
|
-
**Use when:**
|
|
28
|
-
- 2+ unrelated implementation tasks (parallel speedup)
|
|
29
|
-
- A research task you'd otherwise spend tokens reading and grepping
|
|
30
|
-
- A focused refactor that fits in one prompt
|
|
31
|
-
- The task does NOT match audit / review / verify / debug / investigate (those have specialized skills)
|
|
32
|
-
|
|
33
|
-
**Don't use when:**
|
|
34
|
-
- A plan file exists on disk → `mma-execute-plan` (descriptors auto-match plan headings)
|
|
35
|
-
- Two tasks write the same file → dispatch sequentially, not in one batch (workers race)
|
|
36
|
-
- The work needs to read across many files for synthesis only → `mma-investigate` is cheaper (read-only)
|
|
37
|
-
|
|
38
|
-
## Endpoint
|
|
39
|
-
|
|
40
|
-
`POST /delegate?cwd=<abs-path>`
|
|
41
|
-
|
|
42
|
-
@include _shared/auth.md
|
|
43
|
-
|
|
44
|
-
## Request body
|
|
45
|
-
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"tasks": [
|
|
49
|
-
{
|
|
50
|
-
"prompt": "Add input validation to the login handler",
|
|
51
|
-
"agentType": "standard",
|
|
52
|
-
"filePaths": ["/project/src/auth/login.ts"],
|
|
53
|
-
"done": "All inputs validated; unit tests pass",
|
|
54
|
-
"contextBlockIds": ["cb_abc123"]
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
| Field | Type | Required | Notes |
|
|
61
|
-
|---|---|---|---|
|
|
62
|
-
| `tasks` | array | yes | At least one task |
|
|
63
|
-
| `tasks[].prompt` | string | yes | The task instruction |
|
|
64
|
-
| `tasks[].agentType` | `"standard"` / `"complex"` | no | Worker tier. Default `"standard"`. Pick `"complex"` when the task is ambiguous, security-sensitive, touches many files, or a prior standard run came back with `filesWritten: 0` / hit `incompleteReason: "turn_cap"`. |
|
|
65
|
-
| `tasks[].filePaths` | string[] | no | Files the worker focuses on |
|
|
66
|
-
| `tasks[].done` | string | no | Acceptance criteria |
|
|
67
|
-
| `tasks[].contextBlockIds` | string[] | no | IDs from `mma-context-blocks` |
|
|
68
|
-
| `tasks[].reviewPolicy` | `"full"` / `"quality_only"` / `"diff_only"` / `"none"` | no | See review-policy snippet below. Default `"full"` |
|
|
69
|
-
|
|
70
|
-
@include _shared/review-policy.md
|
|
71
|
-
|
|
72
|
-
## Full example
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
BATCH=$(curl -f --show-error -s -X POST \
|
|
76
|
-
-H "X-MMA-Client: $MMA_CLIENT" \
|
|
77
|
-
-H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
|
|
78
|
-
-H "Authorization: Bearer $TOKEN" \
|
|
79
|
-
-H "Content-Type: application/json" \
|
|
80
|
-
-d '{"tasks":[{"prompt":"Refactor utils.ts to remove dead code","filePaths":["/project/src/utils.ts"]}]}' \
|
|
81
|
-
"http://localhost:$PORT/delegate?cwd=/project")
|
|
82
|
-
BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
@include _shared/polling.md
|
|
86
|
-
|
|
87
|
-
## Response shapes
|
|
88
|
-
|
|
89
|
-
### POST /delegate?cwd=<abs> — dispatch response (202)
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{ "batchId": "<uuid>", "statusUrl": "/batch/<uuid>" }
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Use `batchId` to poll. `statusUrl` is a convenience pointer.
|
|
96
|
-
|
|
97
|
-
### GET /batch/:id — polling response
|
|
98
|
-
|
|
99
|
-
The HTTP status is the state discriminator:
|
|
100
|
-
|
|
101
|
-
| Status | Meaning |
|
|
102
|
-
|---|---|
|
|
103
|
-
| `202 text/plain` | Still pending — body is the running headline string |
|
|
104
|
-
| `200 application/json` | Terminal — body is the batch envelope below |
|
|
105
|
-
| `404` / `401` / `5xx` | Error — see Error response below; stop polling |
|
|
106
|
-
|
|
107
|
-
### GET /batch/:id?taskIndex=N — single task slice
|
|
108
|
-
|
|
109
|
-
Same envelope. `results` contains exactly the task at index `N`. Returns `404 unknown_task_index` if `N` is out of range.
|
|
110
|
-
|
|
111
|
-
### Reading the task result
|
|
112
|
-
|
|
113
|
-
Each task result is the per-task wire object (`ComposePayload`):
|
|
114
|
-
|
|
115
|
-
```json
|
|
116
|
-
{
|
|
117
|
-
"completed": true,
|
|
118
|
-
"message": "Task completed; tests passed; one file changed.",
|
|
119
|
-
"findings": [
|
|
120
|
-
{
|
|
121
|
-
"id": "F1",
|
|
122
|
-
"severity": "high",
|
|
123
|
-
"category": "correctness",
|
|
124
|
-
"claim": "The function does not handle empty input",
|
|
125
|
-
"evidence": "function foo() { ... } // no null check",
|
|
126
|
-
"suggestion": "Add an explicit null guard at the top",
|
|
127
|
-
"source": "reviewer"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"summary": "Refactored utils.ts — removed 3 dead branches, added JSDoc",
|
|
131
|
-
"filesChanged": ["/project/src/utils.ts"],
|
|
132
|
-
"commitSha": "abc123def",
|
|
133
|
-
"blockId": null,
|
|
134
|
-
"telemetry": {
|
|
135
|
-
"totalDurationMs": 12400,
|
|
136
|
-
"totalCostUSD": 0.08,
|
|
137
|
-
"workerSelfAssessment": "done",
|
|
138
|
-
"reviewVerdict": "approved",
|
|
139
|
-
"commitOutcome": "committed",
|
|
140
|
-
"stopReason": "normal",
|
|
141
|
-
"haltedStage": null,
|
|
142
|
-
"stages": [
|
|
143
|
-
{ "name": "prepare", "outcome": "advance", "durationMs": 2, "costUSD": 0 },
|
|
144
|
-
{ "name": "register-block", "outcome": "skip", "comment": "register-block does not apply to route=delegate", "durationMs": 0, "costUSD": 0 },
|
|
145
|
-
{ "name": "implement", "outcome": "advance", "durationMs": 8900, "costUSD": 0.05 },
|
|
146
|
-
{ "name": "review", "outcome": "advance", "durationMs": 2100, "costUSD": 0.02 },
|
|
147
|
-
{ "name": "rework", "outcome": "skip", "comment": "rework skipped because review approved", "durationMs": 0, "costUSD": 0 },
|
|
148
|
-
{ "name": "commit", "outcome": "advance", "durationMs": 340, "costUSD": 0 },
|
|
149
|
-
{ "name": "annotate", "outcome": "advance", "durationMs": 890, "costUSD": 0.01 },
|
|
150
|
-
{ "name": "compose", "outcome": "advance", "durationMs": 68, "costUSD": 0 },
|
|
151
|
-
{ "name": "terminal", "outcome": "advance", "durationMs": 100, "costUSD": 0 }
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
**Top-level fields to read for the main-agent verdict:**
|
|
158
|
-
|
|
159
|
-
| Field | When `true` / populated |
|
|
160
|
-
|---|---|
|
|
161
|
-
| `completed: true` | Task succeeded. `message` is the summary; `findings` are post-review issues (if any). |
|
|
162
|
-
| `completed: false` | Task did not complete. `message` names the blocking gate or finding; `findings` carry any discovered issues. |
|
|
163
|
-
| `findings` | Issues surfaced by the worker or reviewer. `severity` = `critical` \| `high` \| `medium` \| `low`. `source` = `implementer` \| `reviewer`. |
|
|
164
|
-
| `filesChanged` | File paths modified (empty for read-only routes). |
|
|
165
|
-
| `commitSha` | Git SHA of the committed diff; `null` for read-only routes or when commit was skipped. |
|
|
166
|
-
|
|
167
|
-
`blockId` is not used for the delegate route — it is always `null`, as is `contextBlockId` (write routes register no terminal block). To carry inputs forward, register them explicitly via `mma-context-blocks` and pass `contextBlockIds`.
|
|
168
|
-
|
|
169
|
-
**The stages array** (always 9 rows) is the canonical telemetry log. `outcome` is one of:
|
|
170
|
-
- `advance` — stage ran and produced its payload
|
|
171
|
-
- `skip` — stage did not run; `comment` explains why
|
|
172
|
-
- `halt` — stage stopped the chain; `comment` is the failure message
|
|
173
|
-
- `not_run` — stage was not reached because a prior stage halted
|
|
174
|
-
|
|
175
|
-
Use `telemetry.haltedStage` to find the first halt; `telemetry.stopReason` to find why.
|
|
176
|
-
|
|
177
|
-
### Error response (4xx / 5xx)
|
|
178
|
-
|
|
179
|
-
```json
|
|
180
|
-
{
|
|
181
|
-
"error": "<code>",
|
|
182
|
-
"message": "<human-readable>",
|
|
183
|
-
"details": { /* optional structured context, e.g. fieldErrors for 400 */ }
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
`details` is optional and present only when the server has structured additional context.
|
|
188
|
-
|
|
189
|
-
## Best practices
|
|
190
|
-
|
|
191
|
-
This skill is one step in the larger flow described in `multi-model-agent` → "Best practices". Recipes that involve `mma-delegate`:
|
|
192
|
-
|
|
193
|
-
- **Recipe A (the fix step).** Between audit rounds, `mma-delegate` applies the fix when the change is more than 1-2 lines. Register the spec/audit findings as a context block; pass via `contextBlockIds`.
|
|
194
|
-
- **Recipe B (the apply-fix step).** After `mma-debug` returns a hypothesis, `mma-delegate` applies the fix. Same context block carries forward to a follow-up `mma-review` if you want acceptance-criteria checking.
|
|
195
|
-
|
|
196
|
-
Anti-pattern alert: **`inline-labor-leakage`** (AP2). If you're reading 3+ files or grepping in main context before dispatching, you're paying flagship-model tokens for labor. Pass the file paths to `mma-delegate` and let the worker read.
|
|
197
|
-
|
|
198
|
-
## Common pitfalls
|
|
199
|
-
|
|
200
|
-
❌ **Two tasks writing the same file in one batch**
|
|
201
|
-
> tasks: [{prompt:"add JWT to login.ts"}, {prompt:"add logging to login.ts"}]
|
|
202
|
-
|
|
203
|
-
Workers run concurrently and race on the file. **Fix:** dispatch sequentially, or merge into one prompt.
|
|
204
|
-
|
|
205
|
-
❌ **Two tasks writing the same file in one batch**
|
|
206
|
-
N tasks × 50KB = N transmissions. **Fix:** register the doc once via `mma-context-blocks`, pass the `contextBlockIds` to each task.
|
|
207
|
-
|
|
208
|
-
❌ **Reading the worker's diff inline before review**
|
|
209
|
-
The reviewer sees the full diff with the original prompt as context. Reading inline burns main-context tokens for no quality gain.
|
|
210
|
-
|
|
211
|
-
## Terminal context block
|
|
212
|
-
|
|
213
|
-
Write-route tasks (delegate / execute-plan / retry) do NOT register a terminal context block — their durable record is the commit (`commitSha` + changed files). The per-task result's `contextBlockId` is always `null` for these routes. Read routes (audit / review / debug / investigate / research) return a non-null `contextBlockId`; see those skills for the delta-follow-up recipe.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
@include _shared/error-handling.md
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mma-execute-plan
|
|
3
|
-
description: >-
|
|
4
|
-
Use when a plan or spec file exists on disk (any markdown with numbered task
|
|
5
|
-
headings — docs/superpowers/plans/*.md, a TODO list, a spec doc) and you need
|
|
6
|
-
to implement one or more tasks from it on cheap workers in parallel
|
|
7
|
-
when_to_use: >-
|
|
8
|
-
A plan file exists on disk AND you need to implement one or more tasks from it
|
|
9
|
-
AND mmagent is running. Prefer this over inline Agent dispatches or
|
|
10
|
-
superpowers:subagent-driven-development / superpowers:executing-plans —
|
|
11
|
-
workers are cheaper and don't pollute main context. Task descriptors must
|
|
12
|
-
match plan headings verbatim.
|
|
13
|
-
version: 4.9.0
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# mma-execute-plan
|
|
17
|
-
|
|
18
|
-
## Overview
|
|
19
|
-
|
|
20
|
-
Dispatch named tasks from a plan file to workers. Each `taskDescriptors` string must match a heading in the plan verbatim (e.g. `"1. Setup database schema"`). All tasks run in parallel; duplicate descriptors are rejected.
|
|
21
|
-
|
|
22
|
-
**Core principle:** The plan IS the prompt. Workers re-read the plan file in-process and find their named task — you don't need to inline the task body.
|
|
23
|
-
|
|
24
|
-
## When to Use
|
|
25
|
-
|
|
26
|
-
**Use when:**
|
|
27
|
-
- A plan/spec markdown exists with numbered task headings
|
|
28
|
-
- You want to dispatch a subset (or all) of those tasks
|
|
29
|
-
- Tasks are mostly independent (parallel-safe)
|
|
30
|
-
|
|
31
|
-
**Don't use when:**
|
|
32
|
-
- No plan file → `mma-delegate` (pass the prompt directly)
|
|
33
|
-
- Tasks form a hard linear sequence (later tasks depend on earlier ones' outputs) → dispatch in order, one batch each
|
|
34
|
-
- The "plan" is in conversation only, not on disk → write it to disk first, or use `mma-delegate`
|
|
35
|
-
|
|
36
|
-
## Endpoint
|
|
37
|
-
|
|
38
|
-
`POST /execute-plan?cwd=<abs-path>`
|
|
39
|
-
|
|
40
|
-
@include _shared/auth.md
|
|
41
|
-
|
|
42
|
-
## Request body
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"taskDescriptors": [
|
|
47
|
-
"1. Add input validation to login handler",
|
|
48
|
-
"2. Write unit tests for the auth module"
|
|
49
|
-
],
|
|
50
|
-
"filePaths": [
|
|
51
|
-
"/project/docs/plan.md"
|
|
52
|
-
],
|
|
53
|
-
"contextBlockIds": []
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
| Field | Type | Required | Notes |
|
|
58
|
-
|---|---|---|---|
|
|
59
|
-
| `taskDescriptors` | string[] | yes | At least one; must be unique; each string matches a plan heading verbatim |
|
|
60
|
-
| `filePaths` | string[] | yes | EXACTLY one entry: the plan markdown file. Source files belong in `contextBlockIds` (registered via `mma-context-blocks`) so workers can grep them on demand without re-inlining into every worker prompt |
|
|
61
|
-
| `contextBlockIds` | string[] | no | IDs from `mma-context-blocks` — the right place for source files referenced by the plan |
|
|
62
|
-
| `perTaskReviewPolicy` | `Record<string, 'full'\|'quality_only'\|'diff_only'\|'none'>` | no | Per-task-index review policy override. Key = task index as string (`"0"`, `"1"`, ...). Default per task: `"full"` |
|
|
63
|
-
| `cwd` | string | no | Override the `?cwd=` query param value at the body level (rare; usually pass via query) |
|
|
64
|
-
|
|
65
|
-
@include _shared/review-policy.md
|
|
66
|
-
|
|
67
|
-
> **No `agentType` here.** Worker tier is hardcoded to `standard` for every plan task; sending `agentType` (top-level or per-task) is rejected with HTTP 400. For tasks that need `complex` tier, dispatch via `mma-delegate` with the plan task as the prompt and `agentType: "complex"`.
|
|
68
|
-
|
|
69
|
-
## Full example
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
BATCH=$(curl -f --show-error -s -X POST \
|
|
73
|
-
-H "X-MMA-Client: $MMA_CLIENT" \
|
|
74
|
-
-H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
|
|
75
|
-
-H "Authorization: Bearer $TOKEN" \
|
|
76
|
-
-H "Content-Type: application/json" \
|
|
77
|
-
-d '{"taskDescriptors":["3. Migrate database schema"],"filePaths":["/project/docs/plan.md"]}' \
|
|
78
|
-
"http://localhost:$PORT/execute-plan?cwd=/project")
|
|
79
|
-
BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
@include _shared/polling.md
|
|
83
|
-
|
|
84
|
-
## Response shapes
|
|
85
|
-
|
|
86
|
-
### POST /execute-plan?cwd=<abs> — dispatch response (202)
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{ "batchId": "<uuid>", "statusUrl": "/batch/<uuid>" }
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Use `batchId` to poll. `statusUrl` is a convenience pointer.
|
|
93
|
-
|
|
94
|
-
### GET /batch/:id — polling response
|
|
95
|
-
|
|
96
|
-
The HTTP status is the state discriminator:
|
|
97
|
-
|
|
98
|
-
| Status | Meaning |
|
|
99
|
-
|---|---|
|
|
100
|
-
| `202 text/plain` | Still pending — body is the running headline string |
|
|
101
|
-
| `200 application/json` | Terminal — body is the batch envelope below |
|
|
102
|
-
| `404` / `401` / `5xx` | Error — see Error response below; stop polling |
|
|
103
|
-
|
|
104
|
-
### GET /batch/:id?taskIndex=N — single task slice
|
|
105
|
-
|
|
106
|
-
Same envelope. `results` contains exactly the task at index `N`. Returns `404 unknown_task_index` if `N` is out of range.
|
|
107
|
-
|
|
108
|
-
### Reading the task result
|
|
109
|
-
|
|
110
|
-
Each task result is the per-task wire object (`ComposePayload`):
|
|
111
|
-
|
|
112
|
-
```json
|
|
113
|
-
{
|
|
114
|
-
"completed": true,
|
|
115
|
-
"message": "Task completed; tests passed; one file changed.",
|
|
116
|
-
"findings": [
|
|
117
|
-
{
|
|
118
|
-
"id": "F1",
|
|
119
|
-
"severity": "high",
|
|
120
|
-
"category": "correctness",
|
|
121
|
-
"claim": "The function does not handle empty input",
|
|
122
|
-
"evidence": "function foo() { ... } // no null check",
|
|
123
|
-
"suggestion": "Add an explicit null guard at the top",
|
|
124
|
-
"source": "reviewer"
|
|
125
|
-
}
|
|
126
|
-
],
|
|
127
|
-
"summary": "Refactored utils.ts — removed 3 dead branches, added JSDoc",
|
|
128
|
-
"filesChanged": ["/project/src/utils.ts"],
|
|
129
|
-
"commitSha": "abc123def",
|
|
130
|
-
"blockId": null,
|
|
131
|
-
"telemetry": {
|
|
132
|
-
"totalDurationMs": 12400,
|
|
133
|
-
"totalCostUSD": 0.08,
|
|
134
|
-
"workerSelfAssessment": "done",
|
|
135
|
-
"reviewVerdict": "approved",
|
|
136
|
-
"commitOutcome": "committed",
|
|
137
|
-
"stopReason": "normal",
|
|
138
|
-
"haltedStage": null,
|
|
139
|
-
"stages": [
|
|
140
|
-
{ "name": "prepare", "outcome": "advance", "durationMs": 2, "costUSD": 0 },
|
|
141
|
-
{ "name": "register-block", "outcome": "skip", "comment": "register-block does not apply to route=execute-plan", "durationMs": 0, "costUSD": 0 },
|
|
142
|
-
{ "name": "implement", "outcome": "advance", "durationMs": 8900, "costUSD": 0.05 },
|
|
143
|
-
{ "name": "review", "outcome": "advance", "durationMs": 2100, "costUSD": 0.02 },
|
|
144
|
-
{ "name": "rework", "outcome": "skip", "comment": "rework skipped because review approved", "durationMs": 0, "costUSD": 0 },
|
|
145
|
-
{ "name": "commit", "outcome": "advance", "durationMs": 340, "costUSD": 0 },
|
|
146
|
-
{ "name": "annotate", "outcome": "advance", "durationMs": 890, "costUSD": 0.01 },
|
|
147
|
-
{ "name": "compose", "outcome": "advance", "durationMs": 68, "costUSD": 0 },
|
|
148
|
-
{ "name": "terminal", "outcome": "advance", "durationMs": 100, "costUSD": 0 }
|
|
149
|
-
]
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**Top-level fields to read for the main-agent verdict:**
|
|
155
|
-
|
|
156
|
-
| Field | When `true` / populated |
|
|
157
|
-
|---|---|
|
|
158
|
-
| `completed: true` | Task succeeded. `message` is the summary; `findings` are post-review issues (if any). |
|
|
159
|
-
| `completed: false` | Task did not complete. `message` names the blocking gate or finding; `findings` carry any discovered issues. |
|
|
160
|
-
| `findings` | Issues surfaced by the worker or reviewer. `severity` = `critical` \| `high` \| `medium` \| `low`. `source` = `implementer` \| `reviewer`. |
|
|
161
|
-
| `filesChanged` | File paths modified (empty for read-only routes). |
|
|
162
|
-
| `commitSha` | Git SHA of the committed diff; `null` for read-only routes or when commit was skipped. |
|
|
163
|
-
| `blockId` | Always `null` (execute-plan is a write route; `contextBlockId` is `null` too — no terminal block). |
|
|
164
|
-
|
|
165
|
-
**The stages array** (always 9 rows) is the canonical telemetry log. `outcome` is one of:
|
|
166
|
-
- `advance` — stage ran and produced its payload
|
|
167
|
-
- `skip` — stage did not run; `comment` explains why
|
|
168
|
-
- `halt` — stage stopped the chain; `comment` is the failure message
|
|
169
|
-
- `not_run` — stage was not reached because a prior stage halted
|
|
170
|
-
|
|
171
|
-
Use `telemetry.haltedStage` to find the first halt; `telemetry.stopReason` to find why.
|
|
172
|
-
|
|
173
|
-
### Error response (4xx / 5xx)
|
|
174
|
-
|
|
175
|
-
```json
|
|
176
|
-
{
|
|
177
|
-
"error": "<code>",
|
|
178
|
-
"message": "<human-readable>",
|
|
179
|
-
"details": { /* optional structured context, e.g. fieldErrors for 400 */ }
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
`details` is optional and present only when the server has structured additional context.
|
|
184
|
-
|
|
185
|
-
## Best practices
|
|
186
|
-
|
|
187
|
-
This skill is one step in the larger flow described in `multi-model-agent` → "Best practices". Recipes that involve `mma-execute-plan`:
|
|
188
|
-
|
|
189
|
-
- **Recipe C — Investigate-plan-execute.** `mma-investigate` → write the plan → `mma-execute-plan` → `mma-retry` on failed indices. Register the plan file as a context block before the execute-plan call so it isn't re-inlined into every worker's prompt; retry inherits the same configuration.
|
|
190
|
-
- **Recipe D — Plan-execute-retry (entry point).** `mma-execute-plan` is the producer of the `batchId` that `mma-retry` consumes. When this batch returns mixed `done` / `failed`, the next call is `mma-retry` with failed indices, NOT a re-dispatch.
|
|
191
|
-
|
|
192
|
-
Anti-pattern alert: **`full-batch-redispatch`** (AP4). When the batch returns mixed `done` / `failed`, do NOT re-run the whole task list — use `mma-retry` with the failed indices only. Re-running the whole list re-charges every successful task.
|
|
193
|
-
|
|
194
|
-
## Common pitfalls
|
|
195
|
-
|
|
196
|
-
❌ **Task descriptor doesn't match plan heading verbatim**
|
|
197
|
-
> taskDescriptors: ["Migrate db schema"] ← plan heading is "3. Migrate database schema"
|
|
198
|
-
|
|
199
|
-
Worker rejects with "no matching task" or matches the wrong one. **Fix:** copy the heading from the plan, including the leading number.
|
|
200
|
-
|
|
201
|
-
❌ **Forgetting the plan file in `filePaths`**
|
|
202
|
-
> filePaths: ["/project/src/db/schema.sql"] ← no plan file
|
|
203
|
-
|
|
204
|
-
Worker can't read the task body. **Fix:** always include the plan path: `filePaths: ["/project/docs/plan.md", "/project/src/db/schema.sql"]`.
|
|
205
|
-
|
|
206
|
-
❌ **Dispatching dependent tasks in one batch**
|
|
207
|
-
Task 5 depends on Task 4's output → workers race; Task 5 might run before Task 4 finishes. **Fix:** dispatch Task 4, wait for terminal, then dispatch Task 5.
|
|
208
|
-
|
|
209
|
-
## Terminal context block
|
|
210
|
-
|
|
211
|
-
Write-route tasks (delegate / execute-plan / retry) do NOT register a terminal context block — their durable record is the commit (`commitSha` + changed files). The per-task result's `contextBlockId` is always `null` for these routes. Read routes (audit / review / debug / investigate / research) return a non-null `contextBlockId`; see those skills for the delta-follow-up recipe.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
@include _shared/error-handling.md
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mma-explore
|
|
3
|
-
description: >-
|
|
4
|
-
Use when about to brainstorm or plan and need a divergent landscape scan —
|
|
5
|
-
orchestrates parallel internal-codebase investigation + external multi-source
|
|
6
|
-
research + prior-learnings recall from the project journal, then synthesises
|
|
7
|
-
3–5 distinct directions. Not for "where is X" single-answer questions (use
|
|
8
|
-
mma-investigate).
|
|
9
|
-
when_to_use: >-
|
|
10
|
-
You are about to brainstorm or plan and need a broad landscape scan before
|
|
11
|
-
narrowing. The question is exploratory ("what are our options", "what
|
|
12
|
-
approaches exist", "survey how others handle"). The skill instructs you to fan
|
|
13
|
-
out mma-investigate (internal), mma-research (external), and
|
|
14
|
-
mma-journal-recall (prior learnings/decisions) in parallel and synthesise the
|
|
15
|
-
results yourself. DO NOT use for convergent single-answer questions — those
|
|
16
|
-
are mma-investigate.
|
|
17
|
-
version: 4.9.0
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
# mma-explore
|
|
21
|
-
|
|
22
|
-
## Overview
|
|
23
|
-
|
|
24
|
-
Codebase + external sources + prior learnings, synthesised into 3–5 distinct
|
|
25
|
-
directions. Three delegated calls run in parallel — `mma-investigate` (internal
|
|
26
|
-
codebase), `mma-research` (external sources), and `mma-journal-recall` (what
|
|
27
|
-
this project already learned/decided, from the `.mmagent/journal/` graph) —
|
|
28
|
-
and **you** synthesise their results into the final output.
|
|
29
|
-
|
|
30
|
-
**Core principle:** Exploration is divergent (survey, enumerate, compare).
|
|
31
|
-
Synthesis turns raw threads into ranked, citable directions. The three legs
|
|
32
|
-
are delegated; the synthesis is your judgment work and stays in main context.
|
|
33
|
-
The journal leg is what keeps you from re-proposing a direction the project
|
|
34
|
-
already tried and dropped — it grounds the scan in your own history, not just
|
|
35
|
-
the code and the outside world.
|
|
36
|
-
|
|
37
|
-
## When to Use
|
|
38
|
-
|
|
39
|
-
First decision — output shape:
|
|
40
|
-
- Want **one** synthesised answer with citations? → use `mma-investigate` (don't continue here)
|
|
41
|
-
- Want **multiple** distinct directions to weigh (3–5 threads + cross-thread synthesis)? → continue here
|
|
42
|
-
|
|
43
|
-
Internal-vs-external is not your decision; explore always runs both.
|
|
44
|
-
|
|
45
|
-
```dot
|
|
46
|
-
digraph when_to_use {
|
|
47
|
-
"Exploratory question?" [shape=diamond];
|
|
48
|
-
"Convergent single-answer?" [shape=diamond];
|
|
49
|
-
"About to brainstorm/plan?" [shape=diamond];
|
|
50
|
-
"mma-explore" [shape=box];
|
|
51
|
-
"mma-investigate" [shape=box];
|
|
52
|
-
"Inline search (1–2 queries)" [shape=box];
|
|
53
|
-
|
|
54
|
-
"Exploratory question?" -> "Convergent single-answer?";
|
|
55
|
-
"Convergent single-answer?" -> "mma-investigate" [label="yes"];
|
|
56
|
-
"Convergent single-answer?" -> "About to brainstorm/plan?";
|
|
57
|
-
"About to brainstorm/plan?" -> "mma-explore" [label="yes"];
|
|
58
|
-
"About to brainstorm/plan?" -> "Inline search (1–2 queries)" [label="no — narrow enough"];
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## How to run
|
|
63
|
-
|
|
64
|
-
Dispatch ALL THREE in ONE message (parallel tool use):
|
|
65
|
-
|
|
66
|
-
1. `mma-investigate` — internal codebase research
|
|
67
|
-
- You MAY skip this only if the question is unambiguously greenfield (no
|
|
68
|
-
codebase touch-points exist). When in doubt, run it.
|
|
69
|
-
2. `mma-research` — external multi-source research
|
|
70
|
-
3. `mma-journal-recall` — prior learnings/decisions from the project journal
|
|
71
|
-
- Always run it. If the project has no journal yet (or nothing relevant),
|
|
72
|
-
it returns zero findings — a valid result you handle with the
|
|
73
|
-
`(no prior learning)` sentinel. Never skip it to "save a call": a
|
|
74
|
-
superseded prior decision is exactly the signal you most want before
|
|
75
|
-
brainstorming.
|
|
76
|
-
|
|
77
|
-
Wait for all legs to return. Do NOT proceed to synthesis until you have every
|
|
78
|
-
result (or have decided to skip investigate as greenfield).
|
|
79
|
-
|
|
80
|
-
## Endpoint
|
|
81
|
-
|
|
82
|
-
This is a main-agent skill — there is no dedicated `/explore` HTTP endpoint.
|
|
83
|
-
Behind the scenes, you dispatch the three delegated tools `mma-investigate`
|
|
84
|
-
(`POST /investigate`), `mma-research` (`POST /research`), and
|
|
85
|
-
`mma-journal-recall` (`POST /journal-recall`) yourself.
|
|
86
|
-
|
|
87
|
-
## Request body
|
|
88
|
-
|
|
89
|
-
(Not applicable — this skill orchestrates three other skills.) See
|
|
90
|
-
[`mma-investigate`](../mma-investigate/SKILL.md),
|
|
91
|
-
[`mma-research`](../mma-research/SKILL.md), and
|
|
92
|
-
[`mma-journal-recall`](../mma-journal-recall/SKILL.md) for their request bodies.
|
|
93
|
-
|
|
94
|
-
## Full example
|
|
95
|
-
|
|
96
|
-
The main agent (you) issues a single message with three parallel tool calls:
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
[parallel tool use]
|
|
100
|
-
mma-investigate { question: "How does our streaming JSON parser handle backpressure?", filePaths: ["src/parsers/"] }
|
|
101
|
-
mma-research { researchQuestion: "State-of-the-art streaming JSON parsers with backpressure?", background: "We use a single-pass push parser." }
|
|
102
|
-
mma-journal-recall { query: "what have we learned about streaming-parser backpressure or buffering tradeoffs?" }
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Reading the leg results
|
|
106
|
-
|
|
107
|
-
All three legs (`mma-investigate`, `mma-research`, `mma-journal-recall`) return the v5 wire envelope (see `mma-investigate/SKILL.md` → "v5 wire shape"). Each sub-task result is a `ComposePayload` with the standard seven fields. The authoritative citation source is **`results[0].findings`** — an array of `{ id, severity, category, claim, evidence, suggestion, source }`.
|
|
108
|
-
|
|
109
|
-
Explore top-level orchestration aggregates sub-task results into a valid `ImplementPayload` (read-route shape) before the final `annotate` stage runs. Each sub-task follows the same v5 wire shape; the top-level result is a composition of those sub-tasks.
|
|
110
|
-
|
|
111
|
-
| Check | How |
|
|
112
|
-
|---|---|
|
|
113
|
-
| Did the leg succeed? | `results[0].completed === true` — findings may be zero on a read route; finding nothing wrong is a valid completion |
|
|
114
|
-
| Internal citation source | `results[0].findings[i].claim` plus a `file:LINE` token from `results[0].findings[i].evidence` (workers style them as `` `path:LINE` `` markdown-linked refs) |
|
|
115
|
-
| External citation source | `results[0].findings[i].claim` plus a source name / URL from `results[0].findings[i].evidence` |
|
|
116
|
-
| Prior-learning source | `results[0].findings[i].claim` plus a journal node id from `results[0].findings[i].evidence` (recall cites `` `.mmagent/journal/nodes/NNNN-…` `` or `node NNNN`). Watch the node's status: a **superseded** learning is a "we tried this and moved on" signal — surface it, don't bury it |
|
|
117
|
-
| Divergence axis | `results[0].findings[i].category` groups findings by criterion — pick across categories so threads don't collapse onto one axis |
|
|
118
|
-
|
|
119
|
-
Apply a sentinel only when `findings` is empty AND `results[0].message` contains no finding-level content — i.e., the worker genuinely returned nothing. Do NOT apply a sentinel just because `results[0].message` reads tersely or `results[0].telemetry.workerSelfAssessment === 'failed'` — a worker can say `'failed'` with usable partial findings.
|
|
120
|
-
|
|
121
|
-
## Per-task report shape
|
|
122
|
-
|
|
123
|
-
Synthesis output (REQUIRED — your reply MUST contain these):
|
|
124
|
-
|
|
125
|
-
Produce **3–5 threads**. Each thread MUST have:
|
|
126
|
-
|
|
127
|
-
- A **title** and **one-paragraph summary**.
|
|
128
|
-
- One **internal citation** (from investigate) — `file/path.ts:LINE — claim`.
|
|
129
|
-
- Pick from `results[0].findings`: take `claim` as the citation claim and pull a `file:LINE` token out of `evidence`.
|
|
130
|
-
- Use the sentinel `(no internal anchor — fully greenfield)` ONLY when investigate was skipped, or `results[0].findings` is empty AND `results[0].message` contains no finding-level content. The top-level `message` alone is not evidence — see "Reading the leg results" above.
|
|
131
|
-
- One **external citation** (from research) — `<source> — claim`.
|
|
132
|
-
- Pick from `results[0].findings`: take `claim` as the citation claim and pull a source name / URL out of `evidence`.
|
|
133
|
-
- Use the sentinel `(no external source found)` only when `results[0].findings` is empty for the research leg.
|
|
134
|
-
- One **prior-learning citation** (from journal-recall) WHEN a relevant node exists — `(journal) node NNNN — claim`.
|
|
135
|
-
- Pick from the recall leg's `results[0].findings`: take `claim` as the citation and pull the node id out of `evidence`.
|
|
136
|
-
- If the cited node is **superseded**, say so inline (e.g. `(journal) node 0012 [superseded by 0013] — …`) so the thread carries the "we already moved past this" signal.
|
|
137
|
-
- Use the sentinel `(no prior learning)` when the recall leg returned no relevant node — most threads on a young project will use this, and that's fine.
|
|
138
|
-
- A **one-line divergence reason** — what makes this thread different from
|
|
139
|
-
the others. No two threads may share the same divergence axis.
|
|
140
|
-
|
|
141
|
-
If the recall leg surfaced a learning that **invalidates** a direction (a
|
|
142
|
-
superseded or dropped decision that maps onto a thread you'd otherwise
|
|
143
|
-
propose), do not silently omit it — keep the thread but mark it
|
|
144
|
-
`⚠ already explored — see (journal) node NNNN` and weight it down in the
|
|
145
|
-
recommendation. Prior learnings prune the search; they don't just decorate it.
|
|
146
|
-
|
|
147
|
-
End with `## Recommended next step` — one paragraph naming which thread to
|
|
148
|
-
pursue first and why. If a prior learning rules a thread in or out, cite it here.
|
|
149
|
-
|
|
150
|
-
## Best practices
|
|
151
|
-
|
|
152
|
-
This skill is one step in the larger flow described in `multi-model-agent` →
|
|
153
|
-
"Best practices". Use this BEFORE `superpowers:brainstorming` when the
|
|
154
|
-
brainstorming would otherwise start cold — divergent threads ground the
|
|
155
|
-
brainstorming in real code + real prior art.
|
|
156
|
-
|
|
157
|
-
## Common pitfalls
|
|
158
|
-
|
|
159
|
-
❌ **Do not dump the two raw reports back to the user.** The synthesis IS the
|
|
160
|
-
output; the raw reports are inputs you reason over. **Fix:** synthesise into
|
|
161
|
-
3–5 threads with citations from BOTH legs (or sentinels) and a recommended
|
|
162
|
-
next step.
|
|
163
|
-
|
|
164
|
-
❌ **Skipping `mma-investigate` for convenience.** "Greenfield" must be
|
|
165
|
-
unambiguous. When in doubt, run it. **Fix:** only skip if the question is
|
|
166
|
-
unambiguously greenfield (no codebase touch-points).
|
|
167
|
-
|
|
168
|
-
❌ **Inventing citations.** Every citation must trace back to one of the two
|
|
169
|
-
delegated reports or to a sentinel. **Fix:** if a thread has no usable
|
|
170
|
-
citation from a leg, use the sentinel — do not fabricate.
|
|
171
|
-
|
|
172
|
-
❌ **Padding to hit 5 threads.** ONE thread with high-confidence citations is
|
|
173
|
-
better than 5 watery ones. **Fix:** stop at the natural number of distinct
|
|
174
|
-
directions in the data.
|
|
175
|
-
|
|
176
|
-
## Failure handling
|
|
177
|
-
|
|
178
|
-
| Scenario | What to do |
|
|
179
|
-
|---|---|
|
|
180
|
-
| `mma-research` failed | Use `(no external source found)` sentinel on every external line. If `mma-investigate` also failed, do NOT synthesise — surface both errors to the user. |
|
|
181
|
-
| `mma-investigate` failed | Treat as greenfield — use `(no internal anchor — fully greenfield)` sentinel. |
|
|
182
|
-
| `mma-journal-recall` failed OR returned 0 findings | Use the `(no prior learning)` sentinel on every prior-learning line and continue — the journal leg is additive, never blocking. A young project with an empty journal hits this every time; it is not an error. |
|
|
183
|
-
| All three failed | Report all errors to the user. Do NOT fabricate threads. |
|
|
184
|
-
| Both investigate and research failed | Report both errors to the user. Do NOT fabricate threads. |
|
|
185
|
-
| Investigate returned `needsCallerClarification: true` | Pause — surface the clarification need to the user. Do NOT synthesise over an unfinished investigation. |
|
|
186
|
-
| Research returned 0 usable sources | Sentinel on external lines. Add a one-line note in synthesis preamble: *"External research returned no usable sources — threads anchor on internal findings only."* |
|
|
187
|
-
| Investigate headline reads "0 citations" / "confidence unparseable" but `results[0].findings.length > 0` | Known stage-sync noise — IGNORE the headline. The leg succeeded; read `results[0].findings` directly. |
|
|
188
|
-
|
|
189
|
-
See `superpowers:brainstorming` as the natural follow-up — convergent narrowing
|
|
190
|
-
on a chosen thread.
|