@xcraftmind/mastermind 0.25.0 → 0.27.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/README.md +3 -3
- package/package.json +8 -8
- package/share/agents/mastermind-auditor.md +10 -6
- package/share/agents/mastermind-critic.md +1 -1
- package/share/agents/mastermind-release.md +12 -12
- package/share/agents/mastermind-task-executor.md +7 -5
- package/share/commands/api-shape-explorer.md +107 -0
- package/share/skills/mastermind-incident-response/SKILL.md +2 -2
- package/share/skills/mastermind-incident-response/references/investigation-playbook.md +6 -5
- package/share/skills/mastermind-incident-response/references/postmortem-template.md +3 -3
- package/share/skills/mastermind-incident-response/references/triage-checklist.md +2 -1
- package/share/skills/mastermind-task-executor/SKILL.md +7 -5
- package/share/skills/mastermind-task-planning/SKILL.md +24 -7
- package/share/skills/mastermind-task-planning/references/spec-template.md +2 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ mastermind init # scaffold .mastermind/, build the index, d
|
|
|
30
30
|
echo ".mastermind/" >> .gitignore # index + local specs are local state
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
`init` builds the index and drafts `CONTEXT.md` from your code via `claude -p` (pass `--no-claude` or `--no-index` to skip). It also installs the workflow subagents
|
|
33
|
+
`init` builds the index and drafts `CONTEXT.md` from your code via `claude -p` (pass `--no-claude` or `--no-index` to skip). It also installs the workflow subagents, skills, and slash commands into `~/.claude/` so the full pipeline (planner / critic / executor / auditor) is available, not just the codegraph (`--no-global` to skip). Re-run `mastermind index .` to refresh, or `mastermind watch` to keep it live.
|
|
34
34
|
|
|
35
35
|
**3. Register with Claude Code** — once, globally:
|
|
36
36
|
|
|
@@ -53,11 +53,11 @@ Three pieces — the split is the part that trips people up:
|
|
|
53
53
|
| | Scope | Lives in | How often |
|
|
54
54
|
|---|---|---|---|
|
|
55
55
|
| **Index** — `init` + `index` | **per project** | `.mastermind/mmcg.db` in each repo | once per repo, refresh with `index` / `watch` |
|
|
56
|
-
| **Workflow** — subagents
|
|
56
|
+
| **Workflow** — subagents, skills, commands | global | `~/.claude/{agents,skills,commands}/` | installed + refreshed by `init` |
|
|
57
57
|
| **MCP registration** — `setup claude` | once | `~/.claude/.mcp.json` | once for all projects |
|
|
58
58
|
|
|
59
59
|
- **The index is always per-project.** Run `mastermind init` in *every* repo you want indexed. `doctor` reporting `index database not found` just means you haven't done this in the current directory yet (the exact situation if you run `doctor` from `/tmp` or a fresh shell).
|
|
60
|
-
- **The workflow installs globally on `init`** — subagents +
|
|
60
|
+
- **The workflow installs globally on `init`** — subagents, skills + slash commands land in `~/.claude/{agents,skills,commands}/`, overwriting Mastermind's own files to keep them current (`--no-global` to skip). Ships with the npm package; cargo installs use the plugin marketplace instead.
|
|
61
61
|
- **The MCP registration is usually once, globally.** The global entry launches `mastermind serve` from whichever project you open in Claude Code, so it picks up *that* project's `.mastermind/mmcg.db` automatically. You do **not** re-run `setup claude` per repo.
|
|
62
62
|
- Use **per-project registration** only if you want the MCP config committed with the repo and version-pinned: `mastermind setup claude --project . --write-mcp` writes `./.mcp.json` with `command: "./node_modules/.bin/mastermind"` (pair it with a project-local install — see below).
|
|
63
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcraftmind/mastermind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Mastermind workflow CLI + mmcg codegraph for AI coding agents — verify-spec / audit-spec gates, MCP server, multi-language tree-sitter indexer (Python, TypeScript, JavaScript, Rust, C#, Go, Java, PHP, C/C++). Prebuilt native binaries via optional platform packages — no Rust toolchain required.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "xcraftmind",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"mastermind"
|
|
39
39
|
],
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@xcraftmind/mmcg-darwin-arm64": "0.
|
|
42
|
-
"@xcraftmind/mmcg-darwin-x64": "0.
|
|
43
|
-
"@xcraftmind/mmcg-linux-x64-gnu": "0.
|
|
44
|
-
"@xcraftmind/mmcg-linux-arm64-gnu": "0.
|
|
45
|
-
"@xcraftmind/mmcg-linux-x64-musl": "0.
|
|
46
|
-
"@xcraftmind/mmcg-linux-arm64-musl": "0.
|
|
47
|
-
"@xcraftmind/mmcg-win32-x64-msvc": "0.
|
|
41
|
+
"@xcraftmind/mmcg-darwin-arm64": "0.27.0",
|
|
42
|
+
"@xcraftmind/mmcg-darwin-x64": "0.27.0",
|
|
43
|
+
"@xcraftmind/mmcg-linux-x64-gnu": "0.27.0",
|
|
44
|
+
"@xcraftmind/mmcg-linux-arm64-gnu": "0.27.0",
|
|
45
|
+
"@xcraftmind/mmcg-linux-x64-musl": "0.27.0",
|
|
46
|
+
"@xcraftmind/mmcg-linux-arm64-musl": "0.27.0",
|
|
47
|
+
"@xcraftmind/mmcg-win32-x64-msvc": "0.27.0"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -46,7 +46,7 @@ You do NOT:
|
|
|
46
46
|
## Inputs
|
|
47
47
|
|
|
48
48
|
The spawner passes:
|
|
49
|
-
- **Spec path** — `.mastermind/tasks
|
|
49
|
+
- **Spec path** — `.mastermind/tasks/<NNN>-<name>/spec.md` that was supposed to be implemented
|
|
50
50
|
- **Execution report** — the markdown the executor produced
|
|
51
51
|
- **Optional: baseline ref** — a git ref representing state BEFORE the executor ran. Defaults to the most recent commit on the current branch's parent (or `HEAD` minus the executor's commits, if discoverable).
|
|
52
52
|
|
|
@@ -120,7 +120,7 @@ A markdown audit report:
|
|
|
120
120
|
```markdown
|
|
121
121
|
## Audit verdict: ✅ contract held | ⚠️ partial drift | ❌ contract broken
|
|
122
122
|
|
|
123
|
-
**Spec:** `.mastermind/tasks
|
|
123
|
+
**Spec:** `.mastermind/tasks/<NNN>-<name>/spec.md`
|
|
124
124
|
**Report audited:** <one-line identifier>
|
|
125
125
|
**Baseline ref:** <git ref or "HEAD~N">
|
|
126
126
|
|
|
@@ -159,7 +159,11 @@ If verdict is anything other than `contract held`, the planner must address each
|
|
|
159
159
|
|
|
160
160
|
## Capture the lesson (institutional memory)
|
|
161
161
|
|
|
162
|
-
When the verdict is `⚠️ partial drift` or `❌ contract broken`, append a **one-line lesson** to `.mastermind/tasks/_lessons.md` so the next planner can learn from this audit. Skip on clean `✅ contract held` verdicts — that's just normal operation, not a lesson.
|
|
162
|
+
When the verdict is `⚠️ partial drift` or `❌ contract broken`, append a **one-line lesson** to `.mastermind/tasks/_lessons.md` (shared file at the top of `tasks/`, not inside any task folder) so the next planner can learn from this audit. Skip on clean `✅ contract held` verdicts — that's just normal operation, not a lesson.
|
|
163
|
+
|
|
164
|
+
**Note on the `[auto]` entries already in the file.** As of mmcg 0.7.0, `mmcg audit-spec` and `mmcg run-task`'s post-phase deterministically append a `[auto]`-prefixed line summarizing the mechanical findings (counts of scope creep / caller drift / etc.) whenever they encounter a drift or broken verdict. Your job is to add a richer, root-cause-level lesson on top — what *caused* the drift, not just what the finding type was. Do not skip writing because an `[auto]` line already exists; the auto line is signal, your line is judgment.
|
|
165
|
+
|
|
166
|
+
You may also drop the full audit report itself as `audit.md` inside the task folder (alongside `spec.md`) when it's worth preserving for later reference. The lesson is the one-line takeaway across all tasks; the audit report is the per-task record.
|
|
163
167
|
|
|
164
168
|
Create the file if it doesn't exist with a header:
|
|
165
169
|
|
|
@@ -178,8 +182,8 @@ Each entry:
|
|
|
178
182
|
|
|
179
183
|
Examples of good lessons (root cause, actionable):
|
|
180
184
|
|
|
181
|
-
- `- 2026-05-12 042-session-refactor
|
|
182
|
-
- `- 2026-05-19 058-rate-limiter
|
|
185
|
+
- `- 2026-05-12 042-session-refactor — partial drift — pre-edit snapshot was stale; planner had not re-indexed mmcg after a rebase, so caller counts were already wrong before the executor ran.`
|
|
186
|
+
- `- 2026-05-19 058-rate-limiter — contract broken — tests passed locally but failed under concurrent load; Tests Plan didn't include a concurrency case and the critic didn't flag it.`
|
|
183
187
|
|
|
184
188
|
Bad lessons (symptom, not actionable):
|
|
185
189
|
|
|
@@ -193,7 +197,7 @@ The lessons file is plain markdown and intentionally NOT indexed by `mmcg_tasks`
|
|
|
193
197
|
## What you do NOT do
|
|
194
198
|
|
|
195
199
|
- Run commands that modify state (no `git commit`, no `git push`, no destructive ops)
|
|
196
|
-
- Open files in editors — only `Read` and `Write`/`Edit` for `_lessons.md` appends
|
|
200
|
+
- Open files in editors — only `Read` and `Write`/`Edit` for `_lessons.md` appends (and optionally the task folder's `audit.md`)
|
|
197
201
|
- Make recommendations about how to fix discrepancies — the planner decides
|
|
198
202
|
- Apologize for finding problems — your job is to find them
|
|
199
203
|
|
|
@@ -19,7 +19,7 @@ metadata:
|
|
|
19
19
|
|
|
20
20
|
# Critic — design-time challenger
|
|
21
21
|
|
|
22
|
-
Independent subagent that stress-tests a proposed design **before** it becomes a `.mastermind/tasks
|
|
22
|
+
Independent subagent that stress-tests a proposed design **before** it becomes a `.mastermind/tasks/<NNN>-<name>/spec.md` file. Spawned with no prior conversation context so the critique isn't anchored on the spawner's reasoning.
|
|
23
23
|
|
|
24
24
|
**Output is structured by 7 engineering dimensions** — not a free-form list of weaknesses. Each dimension gets a verdict + concrete evidence. The planner can disagree but the disagreement must be logged in the spec's Notes section.
|
|
25
25
|
|
|
@@ -60,7 +60,7 @@ You translate completed work into a clean release artifact. You do not embellish
|
|
|
60
60
|
## Inputs
|
|
61
61
|
|
|
62
62
|
The spawner passes:
|
|
63
|
-
- **Spec path(s)** — `.mastermind/tasks
|
|
63
|
+
- **Spec path(s)** — `.mastermind/tasks/<NNN>-<name>/spec.md` for the work being shipped (one or more if bundled).
|
|
64
64
|
- **Auditor report** — the markdown verdict from `mastermind-auditor`. You will quote the verdict and propagate any `concern` items as caveats in the PR body.
|
|
65
65
|
- **Critic verdict (optional)** — if any dimension was `ship with caveats`, propagate the caveat into a "Known caveats" section in the PR.
|
|
66
66
|
- **Base branch** — typically `main`; defaults from `git symbolic-ref refs/remotes/origin/HEAD` if unset.
|
|
@@ -113,13 +113,13 @@ If a Tests Plan / Docs Plan item from the spec is NOT in the diff, surface it as
|
|
|
113
113
|
- Paragraph 1: **why** — the user-visible motivation or problem.
|
|
114
114
|
- Paragraph 2: **what** — at a high level (one line per real change).
|
|
115
115
|
- Paragraph 3: **how to verify** — the specific commands or checks a reviewer can run.
|
|
116
|
-
- Optional final line: spec reference `Spec: .mastermind/tasks/
|
|
116
|
+
- Optional final line: spec reference `Spec: .mastermind/tasks/<NNN>-name/spec.md`.
|
|
117
117
|
|
|
118
118
|
### 6. Draft the PR description
|
|
119
119
|
Structured sections (see the example in "Output" below for the shape):
|
|
120
120
|
- **Why** — motivation, 1-3 sentences.
|
|
121
121
|
- **What changed** — bullets, one per coherent change. Cite file paths.
|
|
122
|
-
- **Spec** — link to `.mastermind/tasks
|
|
122
|
+
- **Spec** — link to `.mastermind/tasks/<NNN>-<name>/spec.md`.
|
|
123
123
|
- **Tests** — what tests are new / changed, cross-referenced against diff.
|
|
124
124
|
- **Documentation** — what docs touched.
|
|
125
125
|
- **Observability** — logs / metrics / probes added (or "n/a" with reason).
|
|
@@ -136,7 +136,7 @@ Structured sections (see the example in "Output" below for the shape):
|
|
|
136
136
|
```markdown
|
|
137
137
|
## Release draft
|
|
138
138
|
|
|
139
|
-
**Spec(s):** `.mastermind/tasks
|
|
139
|
+
**Spec(s):** `.mastermind/tasks/<NNN>-<name>/spec.md`
|
|
140
140
|
**Branch:** `<branch-name>` → `<base>`
|
|
141
141
|
**Auditor verdict:** contract held
|
|
142
142
|
**Style match:** Conventional Commits / plain imperative / <whatever was detected> — sample subjects from last 10 commits:
|
|
@@ -157,7 +157,7 @@ Structured sections (see the example in "Output" below for the shape):
|
|
|
157
157
|
|
|
158
158
|
<body paragraph 3 — how to verify>
|
|
159
159
|
|
|
160
|
-
Spec: .mastermind/tasks/
|
|
160
|
+
Spec: .mastermind/tasks/<NNN>-name/spec.md
|
|
161
161
|
```
|
|
162
162
|
|
|
163
163
|
---
|
|
@@ -176,7 +176,7 @@ Spec: .mastermind/tasks/XXX-name.md
|
|
|
176
176
|
- `<file>` — <one line>
|
|
177
177
|
|
|
178
178
|
## Spec
|
|
179
|
-
- `.mastermind/tasks/
|
|
179
|
+
- `.mastermind/tasks/<NNN>-name/spec.md`
|
|
180
180
|
|
|
181
181
|
## Tests
|
|
182
182
|
- <test name> — <what it covers>
|
|
@@ -226,7 +226,7 @@ git commit -m "$(cat <<'EOF'
|
|
|
226
226
|
|
|
227
227
|
<commit body>
|
|
228
228
|
|
|
229
|
-
Spec: .mastermind/tasks/
|
|
229
|
+
Spec: .mastermind/tasks/<NNN>-name/spec.md
|
|
230
230
|
EOF
|
|
231
231
|
)"
|
|
232
232
|
|
|
@@ -278,7 +278,7 @@ If any check fails, fix the draft before returning it.
|
|
|
278
278
|
### Clean release — Conventional Commits style
|
|
279
279
|
|
|
280
280
|
**Spawner sends:**
|
|
281
|
-
- Spec: `.mastermind/tasks/042-session-count-getter.md` (add `session_count()` accessor)
|
|
281
|
+
- Spec: `.mastermind/tasks/042-session-count-getter/spec.md` (add `session_count()` accessor)
|
|
282
282
|
- Auditor: `contract held`. 1 file changed, 1 test added.
|
|
283
283
|
- Critic prior verdict: `ship with caveats` (concern: lock contention if called in hot path; mitigation noted in spec).
|
|
284
284
|
|
|
@@ -286,7 +286,7 @@ If any check fails, fix the draft before returning it.
|
|
|
286
286
|
```markdown
|
|
287
287
|
## Release draft
|
|
288
288
|
|
|
289
|
-
**Spec(s):** `.mastermind/tasks/042-session-count-getter.md`
|
|
289
|
+
**Spec(s):** `.mastermind/tasks/042-session-count-getter/spec.md`
|
|
290
290
|
**Branch:** `feat/session-count` → `main`
|
|
291
291
|
**Auditor verdict:** contract held
|
|
292
292
|
**Style match:** Conventional Commits — sample subjects:
|
|
@@ -309,7 +309,7 @@ matching test for empty / populated / post-removal cases.
|
|
|
309
309
|
|
|
310
310
|
Verify: cargo test session_count_returns_current_size
|
|
311
311
|
|
|
312
|
-
Spec: .mastermind/tasks/042-session-count-getter.md
|
|
312
|
+
Spec: .mastermind/tasks/042-session-count-getter/spec.md
|
|
313
313
|
```
|
|
314
314
|
|
|
315
315
|
---
|
|
@@ -329,7 +329,7 @@ the map. Mirrors the existing `turn_count` pattern.
|
|
|
329
329
|
- `sdk/edge-ai-core/src/runtime/session.rs` — unit test `session_count_returns_current_size`
|
|
330
330
|
|
|
331
331
|
## Spec
|
|
332
|
-
- `.mastermind/tasks/042-session-count-getter.md`
|
|
332
|
+
- `.mastermind/tasks/042-session-count-getter/spec.md`
|
|
333
333
|
|
|
334
334
|
## Tests
|
|
335
335
|
- `session_count_returns_current_size` — covers empty, after-insert, after-delete
|
|
@@ -382,7 +382,7 @@ matching test for empty / populated / post-removal cases.
|
|
|
382
382
|
|
|
383
383
|
Verify: cargo test session_count_returns_current_size
|
|
384
384
|
|
|
385
|
-
Spec: .mastermind/tasks/042-session-count-getter.md
|
|
385
|
+
Spec: .mastermind/tasks/042-session-count-getter/spec.md
|
|
386
386
|
EOF
|
|
387
387
|
)"
|
|
388
388
|
git push -u origin feat/session-count
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mastermind-task-executor
|
|
3
|
-
description: Subagent that executes a `.mastermind/tasks
|
|
3
|
+
description: Subagent that executes a `.mastermind/tasks/<NNN>-<name>/spec.md` file phase-by-phase — applies edits, runs verification, marks the checklist, stops on first failure. Spawn this from a planner agent (using the [[mastermind-task-planning]] skill) to implement a delegated task.
|
|
4
4
|
metadata:
|
|
5
5
|
version: 0.1.0
|
|
6
6
|
authors:
|
|
@@ -20,11 +20,11 @@ metadata:
|
|
|
20
20
|
|
|
21
21
|
# Mastermind Task Executor
|
|
22
22
|
|
|
23
|
-
A subagent purpose-built to consume a task spec produced by the Mastermind planning workflow and execute it deterministically. It is invoked with a path to a spec (e.g., `.mastermind/tasks/003-add-rate-limiter.md`) and returns an execution report.
|
|
23
|
+
A subagent purpose-built to consume a task spec produced by the Mastermind planning workflow and execute it deterministically. It is invoked with a path to a spec (e.g., `.mastermind/tasks/003-add-rate-limiter/spec.md`) and returns an execution report.
|
|
24
24
|
|
|
25
25
|
## Role
|
|
26
26
|
|
|
27
|
-
You execute a `.mastermind/tasks
|
|
27
|
+
You execute a `.mastermind/tasks/<NNN>-<name>/spec.md` file **exactly as written**. The spec was produced by a planner who already brainstormed alternatives, weighed tradeoffs, and committed to an approach. Your job is implementation discipline:
|
|
28
28
|
|
|
29
29
|
- Read the spec end-to-end first
|
|
30
30
|
- Execute phases in order
|
|
@@ -38,9 +38,11 @@ Treat the spec as a contract. If it's wrong, surface it; don't paper over it.
|
|
|
38
38
|
## Inputs
|
|
39
39
|
|
|
40
40
|
The spawner passes:
|
|
41
|
-
- **Task path** — `.mastermind/tasks/<spec
|
|
41
|
+
- **Task path** — `.mastermind/tasks/<NNN>-<name>/spec.md` (or a folder path — resolve `spec.md` inside it)
|
|
42
42
|
- **Optional**: any clarifying context the planner wants you to know before starting
|
|
43
43
|
|
|
44
|
+
The task folder may contain sibling files beside `spec.md` (audit notes, screenshots, prior versions, scratchpad). Treat them as context — read only those that the spec references. The contract is `spec.md`.
|
|
45
|
+
|
|
44
46
|
## Process
|
|
45
47
|
|
|
46
48
|
1. Open the spec. Read it completely before touching code.
|
|
@@ -60,7 +62,7 @@ A markdown execution report:
|
|
|
60
62
|
```markdown
|
|
61
63
|
## Task <XXX> — execution report
|
|
62
64
|
|
|
63
|
-
**Spec:** `.mastermind/tasks/<spec
|
|
65
|
+
**Spec:** `.mastermind/tasks/<NNN>-<name>/spec.md`
|
|
64
66
|
**Status:** ✅ complete | ⚠️ partial | ❌ failed
|
|
65
67
|
|
|
66
68
|
### Phases completed
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-shape-explorer
|
|
3
|
+
description: Generate three radically different API/interface shapes for the same problem so you can compare tradeoffs before committing. Use when you're about to design a new module, service boundary, or public API and want to avoid anchoring on the first idea.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 0.1.0
|
|
6
|
+
authors:
|
|
7
|
+
- mastermind
|
|
8
|
+
tags:
|
|
9
|
+
- workflow
|
|
10
|
+
- design
|
|
11
|
+
role: user
|
|
12
|
+
variables:
|
|
13
|
+
- name: PROBLEM
|
|
14
|
+
required: true
|
|
15
|
+
description: What the API needs to do. Concrete use cases, not abstract goals.
|
|
16
|
+
- name: CONSTRAINTS
|
|
17
|
+
required: false
|
|
18
|
+
description: Hard constraints — language, framework, latency, compatibility.
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# API Shape Explorer
|
|
22
|
+
|
|
23
|
+
A user prompt that asks the model to generate three meaningfully different interface designs for the same problem, with tradeoffs. The goal is to force a comparison before you anchor on the first shape that comes to mind.
|
|
24
|
+
|
|
25
|
+
## When to use
|
|
26
|
+
|
|
27
|
+
- Designing a new module's public API
|
|
28
|
+
- Choosing between an SDK shape, a CLI shape, and a config-file shape
|
|
29
|
+
- Service boundary discussions — "should this be one endpoint or three?"
|
|
30
|
+
- Before writing a design doc, to populate the "alternatives considered" section
|
|
31
|
+
- Do NOT use this for implementation — use it only at the interface-design stage
|
|
32
|
+
|
|
33
|
+
## Variables
|
|
34
|
+
|
|
35
|
+
| Name | Required | Description |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `PROBLEM` | yes | What the API needs to do. Concrete use cases beat abstract goals. |
|
|
38
|
+
| `CONSTRAINTS` | no | Hard constraints — language, framework, latency targets, compatibility requirements. |
|
|
39
|
+
|
|
40
|
+
## Prompt
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
I'm designing an API/interface for the following problem. Before I commit to one shape, I want to see three meaningfully different options.
|
|
44
|
+
|
|
45
|
+
PROBLEM:
|
|
46
|
+
{{PROBLEM}}
|
|
47
|
+
|
|
48
|
+
{{#if CONSTRAINTS}}
|
|
49
|
+
CONSTRAINTS:
|
|
50
|
+
{{CONSTRAINTS}}
|
|
51
|
+
{{/if}}
|
|
52
|
+
|
|
53
|
+
Generate exactly three interface designs. They must be *qualitatively* different — not three variations of the same idea. Examples of "qualitatively different": object-oriented vs. functional vs. data-pipeline; sync vs. async vs. streaming; one big call vs. many small calls vs. configuration-driven.
|
|
54
|
+
|
|
55
|
+
For each, give me:
|
|
56
|
+
|
|
57
|
+
## Option <N>: <short name>
|
|
58
|
+
|
|
59
|
+
**Shape:** A code snippet showing how a caller would actually use it. 10-20 lines, realistic.
|
|
60
|
+
|
|
61
|
+
**Mental model:** One sentence describing how a user has to think about this API to use it correctly.
|
|
62
|
+
|
|
63
|
+
**Strengths:**
|
|
64
|
+
- <thing 1>
|
|
65
|
+
- <thing 2>
|
|
66
|
+
|
|
67
|
+
**Weaknesses:**
|
|
68
|
+
- <thing 1>
|
|
69
|
+
- <thing 2>
|
|
70
|
+
|
|
71
|
+
**Best when:** <one sentence on the situation this is the right shape for>
|
|
72
|
+
|
|
73
|
+
After the three options, give me a short comparison:
|
|
74
|
+
|
|
75
|
+
## Comparison
|
|
76
|
+
|
|
77
|
+
| Dimension | Option 1 | Option 2 | Option 3 |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| Learning curve | low / medium / high | … | … |
|
|
80
|
+
| Composability | … | … | … |
|
|
81
|
+
| Testability | … | … | … |
|
|
82
|
+
| Extensibility | … | … | … |
|
|
83
|
+
|
|
84
|
+
End with one paragraph: "If forced to pick one without more information, I'd choose Option X because…"
|
|
85
|
+
|
|
86
|
+
Do not hedge. Do not say "all three have merit." Pick one and defend it.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Example invocation
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
I'm designing an API/interface for the following problem. Before I commit to one shape, I want to see three meaningfully different options.
|
|
93
|
+
|
|
94
|
+
PROBLEM:
|
|
95
|
+
A library that retries flaky operations. Used in Python services. Needs to support: exponential backoff, max attempts, retry only on specific exception types, callback on retry, async and sync code paths. Typical caller wraps a single function call.
|
|
96
|
+
|
|
97
|
+
CONSTRAINTS:
|
|
98
|
+
- Python 3.11+, no external runtime deps
|
|
99
|
+
- Must work in both sync and async code (one library, not two)
|
|
100
|
+
- Should be debuggable — users have to be able to see *why* a retry happened
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Notes
|
|
104
|
+
|
|
105
|
+
- The prompt deliberately forbids "all three are good" answers. Forcing a pick exposes which dimensions matter most to the model.
|
|
106
|
+
- Re-run with the same `PROBLEM` and a slightly different `CONSTRAINTS` to see how the recommendation shifts. That's often where the real insight is.
|
|
107
|
+
- Works well with Opus. Sonnet tends to make the three options closer to each other than they should be.
|
|
@@ -65,7 +65,7 @@ While asking, parallel-research with `mastermind-researcher` subagent:
|
|
|
65
65
|
```
|
|
66
66
|
git log --since='2 hours ago' --oneline → what changed recently
|
|
67
67
|
git log -10 --oneline → most recent commits
|
|
68
|
-
ls -lt .mastermind/tasks/ | head -10
|
|
68
|
+
ls -lt .mastermind/tasks/*/spec.md 2>/dev/null | head -10 → most recent specs (folder-per-task)
|
|
69
69
|
mmcg_status → index health
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -100,7 +100,7 @@ With pressure off, find **root cause** — not just the symptom. Five-whys disci
|
|
|
100
100
|
- **Did observability fire?** If yes, why didn't it page sooner? If no, why wasn't it instrumented?
|
|
101
101
|
- **Is this a recurrence?** Grep `CONTEXT.md` for the symptom — known gotcha?
|
|
102
102
|
|
|
103
|
-
If a fix is needed, **don't write it inline in this incident flow** — open a `.mastermind/tasks/<NNN>-<short-name
|
|
103
|
+
If a fix is needed, **don't write it inline in this incident flow** — open a `.mastermind/tasks/<NNN>-<short-name>/spec.md` via the main workflow. The fix goes through the normal critic/auditor gates. Incident response identifies the need; planner designs the response.
|
|
104
104
|
|
|
105
105
|
### Phase 4 — Postmortem (within 24h of resolution)
|
|
106
106
|
|
|
@@ -61,17 +61,18 @@ If the blast radius DOES include the symptom's component → strong candidate. R
|
|
|
61
61
|
Spec for any recent change should have had Tests Plan + Observability Plan + Performance Considerations sections (per spec template).
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
# Find the spec for this work (look in .mastermind/tasks/ for matching
|
|
65
|
-
ls -lt .mastermind/tasks/
|
|
64
|
+
# Find the spec for this work (look in .mastermind/tasks/ for matching folder or timestamp)
|
|
65
|
+
ls -lt .mastermind/tasks/ # task folders, newest first
|
|
66
|
+
ls -lt .mastermind/tasks/*/spec.md 2>/dev/null # direct list of spec files by mtime
|
|
66
67
|
|
|
67
68
|
# Read its Tests Plan
|
|
68
|
-
grep -A 20 "Tests Plan" .mastermind/tasks/<NNN>-<name
|
|
69
|
+
grep -A 20 "Tests Plan" .mastermind/tasks/<NNN>-<name>/spec.md
|
|
69
70
|
|
|
70
71
|
# Read its Observability Plan
|
|
71
|
-
grep -A 10 "Observability Plan" .mastermind/tasks/<NNN>-<name
|
|
72
|
+
grep -A 10 "Observability Plan" .mastermind/tasks/<NNN>-<name>/spec.md
|
|
72
73
|
|
|
73
74
|
# Read its Performance Considerations
|
|
74
|
-
grep -A 10 "Performance Considerations" .mastermind/tasks/<NNN>-<name
|
|
75
|
+
grep -A 10 "Performance Considerations" .mastermind/tasks/<NNN>-<name>/spec.md
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
Then ask:
|
|
@@ -138,7 +138,7 @@ Each action item gets owned, dated, and either (a) becomes a `.mastermind/tasks/
|
|
|
138
138
|
|
|
139
139
|
| # | Action | Type | Owner | Due | Spec / CONTEXT entry |
|
|
140
140
|
|---|---|---|---|---|---|
|
|
141
|
-
| 1 | <Specific change — code, config, process, doc> | <code-fix \| context-md \| workflow-improvement \| process> | <person> | <YYYY-MM-DD> | <`.mastermind/tasks/NNN
|
|
141
|
+
| 1 | <Specific change — code, config, process, doc> | <code-fix \| context-md \| workflow-improvement \| process> | <person> | <YYYY-MM-DD> | <`.mastermind/tasks/NNN-name/spec.md` or "CONTEXT.md → Known gotchas">|
|
|
142
142
|
| 2 | <…> | <…> | <…> | <…> | <…> |
|
|
143
143
|
|
|
144
144
|
**Avoid action items like:**
|
|
@@ -147,8 +147,8 @@ Each action item gets owned, dated, and either (a) becomes a `.mastermind/tasks/
|
|
|
147
147
|
- ❌ "Train the team on X" — training without process change rarely sticks
|
|
148
148
|
|
|
149
149
|
**Prefer action items like:**
|
|
150
|
-
- ✓ "Add P99 latency alert on /api/messages at 200ms threshold via Datadog monitor — `.mastermind/tasks/NNN-add-messages-latency-alert.md`"
|
|
151
|
-
- ✓ "Add 'capacity test' as mandatory line in Performance Considerations section of spec-template — `.mastermind/tasks/NNN-spec-template-capacity.md`"
|
|
150
|
+
- ✓ "Add P99 latency alert on /api/messages at 200ms threshold via Datadog monitor — `.mastermind/tasks/NNN-add-messages-latency-alert/spec.md`"
|
|
151
|
+
- ✓ "Add 'capacity test' as mandatory line in Performance Considerations section of spec-template — `.mastermind/tasks/NNN-spec-template-capacity/spec.md`"
|
|
152
152
|
- ✓ "Add CONTEXT.md known-gotcha: 'Redis cluster mode silently drops MULTI on key migrations during rebalance'"
|
|
153
153
|
|
|
154
154
|
---
|
|
@@ -48,8 +48,9 @@ git log --since='2 hours ago' --oneline
|
|
|
48
48
|
git tag --sort=-creatordate | head -5
|
|
49
49
|
git log -10 --oneline
|
|
50
50
|
|
|
51
|
-
# What specs were finished recently
|
|
51
|
+
# What specs were finished recently (each task is a folder containing spec.md)
|
|
52
52
|
ls -lt .mastermind/tasks/ | head -10
|
|
53
|
+
ls -lt .mastermind/tasks/*/spec.md 2>/dev/null | head -10
|
|
53
54
|
|
|
54
55
|
# Are there in-progress specs that might be related?
|
|
55
56
|
git status -s
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mastermind-task-executor
|
|
3
|
-
description: Executes a task spec from `.mastermind/tasks
|
|
3
|
+
description: Executes a task spec from `.mastermind/tasks/<NNN>-<name>/spec.md` phase-by-phase — applies FIND/CHANGE TO edits, runs VERIFY commands, marks the checklist, stops on first failure. Use when the user says "execute task X", "run .mastermind/tasks/NNN", or hands off a delegation spec.
|
|
4
4
|
metadata:
|
|
5
5
|
version: 0.2.0
|
|
6
6
|
authors:
|
|
@@ -15,12 +15,14 @@ metadata:
|
|
|
15
15
|
|
|
16
16
|
# Mastermind - Task Executor Skill
|
|
17
17
|
|
|
18
|
-
You are in Executor mode. Someone (the planner — see [[mastermind-task-planning]]) wrote a spec
|
|
18
|
+
You are in Executor mode. Someone (the planner — see [[mastermind-task-planning]]) wrote a spec at `.mastermind/tasks/<NNN>-<name>/spec.md`. Your job is to execute it exactly as written. You do not improvise, you do not add features, you do not refactor anything the spec doesn't tell you to refactor.
|
|
19
|
+
|
|
20
|
+
The task folder may also contain related artifacts beside `spec.md` (audit notes, screenshots, prior versions, scratchpad). Treat anything other than `spec.md` as context — read it only if the spec references it explicitly. The contract is `spec.md`.
|
|
19
21
|
|
|
20
22
|
## When to Activate
|
|
21
23
|
|
|
22
24
|
- User says "execute task X" or "run task X"
|
|
23
|
-
- User says "execute .mastermind/tasks/NNN
|
|
25
|
+
- User says "execute .mastermind/tasks/NNN-name" or hands off a path to a folder / `spec.md`
|
|
24
26
|
- User hands off a task spec for implementation
|
|
25
27
|
- A planner subagent spawned you with a task path
|
|
26
28
|
|
|
@@ -44,7 +46,7 @@ You are in Executor mode. Someone (the planner — see [[mastermind-task-plannin
|
|
|
44
46
|
|
|
45
47
|
### Step 1 — Read the whole spec first
|
|
46
48
|
|
|
47
|
-
Open `.mastermind/tasks/<spec
|
|
49
|
+
Open `.mastermind/tasks/<NNN>-<name>/spec.md` and read it top to bottom **before editing anything**. Pay attention to:
|
|
48
50
|
|
|
49
51
|
- **LLM Agent Directives** — the framing. What are you doing, why, with what rules?
|
|
50
52
|
- **Goals** — what counts as done
|
|
@@ -90,7 +92,7 @@ Output a report in this exact shape:
|
|
|
90
92
|
```markdown
|
|
91
93
|
## Task <XXX> — execution report
|
|
92
94
|
|
|
93
|
-
**Spec:** `.mastermind/tasks/<spec
|
|
95
|
+
**Spec:** `.mastermind/tasks/<NNN>-<name>/spec.md`
|
|
94
96
|
**Status:** ✅ complete | ⚠️ partial | ❌ failed
|
|
95
97
|
|
|
96
98
|
### Phases completed
|
|
@@ -200,7 +200,8 @@ You do not have to agree with the critic on every dimension. But if you disagree
|
|
|
200
200
|
**Do not write the spec from scratch.** Copy the canonical template:
|
|
201
201
|
|
|
202
202
|
```bash
|
|
203
|
-
|
|
203
|
+
mkdir -p .mastermind/tasks/<NNN>-<kebab-feature>
|
|
204
|
+
cp <path-to-skill>/references/spec-template.md .mastermind/tasks/<NNN>-<kebab-feature>/spec.md
|
|
204
205
|
```
|
|
205
206
|
|
|
206
207
|
Then fill in every `<placeholder>` and delete sections that don't apply. See [`references/spec-template.md`](references/spec-template.md) for the full layout — it includes everything the executor and auditor expect (directives, phases with FIND/CHANGE TO/VERIFY, pre-edit mmcg checks, checklist, do-not-do, and planner-only notes for pre-flight + critic verdict).
|
|
@@ -298,7 +299,7 @@ Append to `CONTEXT.md` ONLY when the discovery is worth preserving across sessio
|
|
|
298
299
|
| Discovery from this task | CONTEXT.md section to update |
|
|
299
300
|
|---|---|
|
|
300
301
|
| Non-trivial design decision the critic agreed with | **Decision log** — date, decision, why, alternatives rejected |
|
|
301
|
-
| Workflow surprised by something — "almost broke X because Y" | **Known gotchas** — one-line summary + `.mastermind/tasks/NNN
|
|
302
|
+
| Workflow surprised by something — "almost broke X because Y" | **Known gotchas** — one-line summary + `.mastermind/tasks/NNN-name/` reference |
|
|
302
303
|
| New term that took explaining during brainstorming | **Domain glossary** — term + local meaning |
|
|
303
304
|
| New external dependency added (service, API, vendor) | **External dependencies** — what for + auth mechanism |
|
|
304
305
|
| Code area found to have hidden constraints | **Don't-touch list** — path + constraint |
|
|
@@ -322,15 +323,31 @@ If both audit and semantic review pass, report to the user with:
|
|
|
322
323
|
|
|
323
324
|
The user sees what was mechanically verified, your judgment on the work, and what was added to the project's institutional memory.
|
|
324
325
|
|
|
325
|
-
## Task
|
|
326
|
+
## Task Layout
|
|
326
327
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
328
|
+
Each task lives in its own folder under `.mastermind/tasks/`:
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
.mastermind/tasks/
|
|
332
|
+
├── _lessons.md # shared audit lessons (underscore-prefixed, not indexed; auditor appends to it)
|
|
333
|
+
├── 001-rate-limiter/
|
|
334
|
+
│ └── spec.md # the spec itself
|
|
335
|
+
├── 002-cache-eviction/
|
|
336
|
+
│ ├── spec.md
|
|
337
|
+
│ ├── audit.md # auditor's verdict, kept beside the spec
|
|
338
|
+
│ ├── notes.md # ad-hoc planning notes
|
|
339
|
+
│ └── screenshots/ # any related artifacts
|
|
340
|
+
└── 003-…/
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
- Check existing task folders for the next sequential number: 001, 002, 003…
|
|
344
|
+
- Folder name: `<NNN>-<kebab-case-name>` (e.g. `042-add-rate-limiter`)
|
|
345
|
+
- Spec file inside: always `spec.md`
|
|
346
|
+
- Anything else related to the task (audit notes, screenshots, critic verdicts, scratchpad) goes into the same folder
|
|
330
347
|
|
|
331
348
|
## First Time Setup
|
|
332
349
|
|
|
333
|
-
If `.mastermind/tasks/`
|
|
350
|
+
If `.mastermind/tasks/` doesn't exist, create it and optionally create `CONTEXT.md` with project info. `mmcg init` does this for you.
|
|
334
351
|
|
|
335
352
|
## Pair Skill
|
|
336
353
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Canonical Mastermind task spec template.
|
|
3
3
|
|
|
4
4
|
HOW TO USE
|
|
5
|
-
- The planner ([../SKILL.md](../SKILL.md))
|
|
5
|
+
- The planner ([../SKILL.md](../SKILL.md)) creates the folder .mastermind/tasks/XXX-kebab-feature-name/
|
|
6
|
+
and copies this whole file to .mastermind/tasks/XXX-kebab-feature-name/spec.md
|
|
6
7
|
- Replace every <placeholder> with concrete content
|
|
7
8
|
- Delete sections that don't apply (e.g., drop the Critic Verdict block if no critic was spawned)
|
|
8
9
|
- Do NOT show this file to the executor — show the filled-in spec only
|