create-merlin-brain 3.10.0 → 3.11.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/files/agents/code-organization-supervisor.md +8 -0
- package/files/agents/context-guardian.md +8 -0
- package/files/agents/docs-keeper.md +10 -1
- package/files/agents/dry-refactor.md +11 -1
- package/files/agents/elite-code-refactorer.md +9 -0
- package/files/agents/hardening-guard.md +12 -1
- package/files/agents/implementation-dev.md +11 -1
- package/files/agents/merlin-api-designer.md +9 -0
- package/files/agents/merlin-codebase-mapper.md +8 -0
- package/files/agents/merlin-debugger.md +10 -0
- package/files/agents/merlin-executor.md +11 -1
- package/files/agents/merlin-frontend.md +9 -0
- package/files/agents/merlin-integration-checker.md +9 -1
- package/files/agents/merlin-migrator.md +9 -0
- package/files/agents/merlin-milestone-auditor.md +8 -0
- package/files/agents/merlin-performance.md +8 -0
- package/files/agents/merlin-planner.md +10 -0
- package/files/agents/merlin-researcher.md +10 -0
- package/files/agents/merlin-reviewer.md +41 -7
- package/files/agents/merlin-security.md +9 -0
- package/files/agents/merlin-verifier.md +9 -0
- package/files/agents/merlin-work-verifier.md +9 -0
- package/files/agents/merlin.md +10 -0
- package/files/agents/ops-railway.md +11 -1
- package/files/agents/orchestrator-retrofit.md +9 -1
- package/files/agents/product-spec.md +11 -1
- package/files/agents/remotion.md +8 -0
- package/files/agents/system-architect.md +11 -1
- package/files/agents/tests-qa.md +11 -1
- package/files/commands/merlin/course-correct.md +219 -0
- package/files/commands/merlin/debug.md +2 -2
- package/files/commands/merlin/execute-phase.md +4 -4
- package/files/commands/merlin/execute-plan.md +2 -2
- package/files/commands/merlin/map-codebase.md +4 -4
- package/files/commands/merlin/next.md +240 -0
- package/files/commands/merlin/plan-phase.md +1 -1
- package/files/commands/merlin/readiness-gate.md +208 -0
- package/files/commands/merlin/research-phase.md +2 -2
- package/files/commands/merlin/research-project.md +4 -4
- package/files/commands/merlin/verify-work.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: merlin:readiness-gate
|
|
3
|
+
description: Validate planning completeness before implementation begins
|
|
4
|
+
argument-hint: "<phase-number>"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
- Grep
|
|
9
|
+
- Glob
|
|
10
|
+
- mcp__merlin__merlin_get_context
|
|
11
|
+
- mcp__merlin__merlin_get_project_status
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<objective>
|
|
15
|
+
Validate that planning artifacts are complete and coherent before any implementation begins.
|
|
16
|
+
|
|
17
|
+
Prevents the #1 failure mode: starting to code with incomplete, ambiguous, or uncovered specs.
|
|
18
|
+
|
|
19
|
+
Runs 6 checks and returns a READY / NEEDS WORK / NOT READY verdict with specific issues to fix.
|
|
20
|
+
</objective>
|
|
21
|
+
|
|
22
|
+
<process>
|
|
23
|
+
|
|
24
|
+
## Step 1: Parse Arguments
|
|
25
|
+
|
|
26
|
+
Extract from $ARGUMENTS:
|
|
27
|
+
- **phase**: Phase number (e.g., "4", "2.1") — or "current" to auto-detect from STATE.md
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# If "current" or empty, read current phase from STATE
|
|
31
|
+
head -30 .planning/STATE.md 2>/dev/null
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Resolve phase name from ROADMAP.md:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
grep -A 5 "Phase ${PHASE_NUM}" .planning/ROADMAP.md 2>/dev/null | head -6
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Step 2: Document Discovery
|
|
41
|
+
|
|
42
|
+
Check that required planning documents exist. Record each as present (✅) or missing (❌).
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
ls .planning/PROJECT.md 2>/dev/null
|
|
46
|
+
ls .planning/ROADMAP.md 2>/dev/null
|
|
47
|
+
ls .planning/REQUIREMENTS.md 2>/dev/null
|
|
48
|
+
ls .planning/phases/${PHASE_DIR}/*-PLAN.md 2>/dev/null
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Track:
|
|
52
|
+
- `doc_project`: present or missing
|
|
53
|
+
- `doc_roadmap`: present or missing
|
|
54
|
+
- `doc_requirements`: present or missing
|
|
55
|
+
- `plan_count`: number of PLAN.md files found for the phase
|
|
56
|
+
|
|
57
|
+
If `doc_project`, `doc_roadmap`, and `doc_requirements` are all missing: emit **NOT READY** immediately — planning has not started. Skip remaining steps.
|
|
58
|
+
|
|
59
|
+
## Step 3: Requirements Analysis
|
|
60
|
+
|
|
61
|
+
Read `.planning/REQUIREMENTS.md`. For each requirement, check:
|
|
62
|
+
|
|
63
|
+
1. Has at least one explicit acceptance criterion (a testable condition — not a vague goal)
|
|
64
|
+
2. Does not contain ambiguous modal verbs: "should", "might", "could", "may"
|
|
65
|
+
3. Is expressed as a testable condition (something that can pass or fail a test)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
grep -n "should\|might\|could\| may " .planning/REQUIREMENTS.md 2>/dev/null
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Track:
|
|
72
|
+
- `req_total`: total requirements found
|
|
73
|
+
- `req_testable`: requirements that meet all three conditions
|
|
74
|
+
- `req_ambiguous`: list of requirement IDs / lines with vague language
|
|
75
|
+
|
|
76
|
+
Result label: `{req_testable}/{req_total} requirements are testable`
|
|
77
|
+
|
|
78
|
+
## Step 4: Plan Coverage
|
|
79
|
+
|
|
80
|
+
Cross-reference PLAN.md task descriptions against requirement IDs in REQUIREMENTS.md.
|
|
81
|
+
|
|
82
|
+
For each requirement ID (e.g., R-4.1, R-4.2), check whether at least one PLAN.md file references or addresses it — either by ID or by matching keyword.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# List requirement IDs
|
|
86
|
+
grep -E "^R-[0-9]" .planning/REQUIREMENTS.md 2>/dev/null
|
|
87
|
+
|
|
88
|
+
# Check plan files for coverage
|
|
89
|
+
grep -l "${REQ_ID}" .planning/phases/${PHASE_DIR}/*-PLAN.md 2>/dev/null
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Track:
|
|
93
|
+
- `covered_reqs`: requirements mentioned in at least one plan
|
|
94
|
+
- `uncovered_reqs`: requirements with no matching plan task (list them)
|
|
95
|
+
|
|
96
|
+
Result label: flag each uncovered requirement by ID.
|
|
97
|
+
|
|
98
|
+
## Step 5: Dependency Check
|
|
99
|
+
|
|
100
|
+
Verify upstream phases are complete and external dependencies are documented.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Check that all prior phases have SUMMARY.md
|
|
104
|
+
for prev_phase in all phases numbered below current; do
|
|
105
|
+
ls .planning/phases/${prev_phase_dir}/*-SUMMARY.md 2>/dev/null
|
|
106
|
+
done
|
|
107
|
+
|
|
108
|
+
# Check STATE.md for documented external dependencies
|
|
109
|
+
grep -i "depend\|external\|blocker\|prerequisite" .planning/STATE.md 2>/dev/null
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Track:
|
|
113
|
+
- `prior_phases_complete`: all prior phases have at least one SUMMARY.md (true/false)
|
|
114
|
+
- `missing_summaries`: list of prior phase directories with no SUMMARY.md
|
|
115
|
+
- `external_deps_noted`: whether dependencies section exists in STATE.md
|
|
116
|
+
|
|
117
|
+
## Step 6: Plan Quality
|
|
118
|
+
|
|
119
|
+
For each PLAN.md in the phase, check:
|
|
120
|
+
|
|
121
|
+
1. Has a non-empty `<objective>` section
|
|
122
|
+
2. Has at least one explicit success criterion
|
|
123
|
+
3. References specific file paths (not just vague descriptions like "update the code")
|
|
124
|
+
4. Scope is reasonable — fewer than 15 distinct tasks in one plan
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Read each PLAN.md for the phase
|
|
128
|
+
for plan in .planning/phases/${PHASE_DIR}/*-PLAN.md; do
|
|
129
|
+
grep -c "<objective>" "$plan" 2>/dev/null
|
|
130
|
+
grep -i "success.criteria\|acceptance\|done when" "$plan" 2>/dev/null
|
|
131
|
+
grep -E "\.(ts|js|py|go|md|json|yaml|sh)" "$plan" 2>/dev/null | wc -l
|
|
132
|
+
done
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Track per plan:
|
|
136
|
+
- `has_objective`: true/false
|
|
137
|
+
- `has_success_criteria`: true/false
|
|
138
|
+
- `has_file_refs`: true/false
|
|
139
|
+
- `quality_issues`: list of specific deficiencies per plan name
|
|
140
|
+
|
|
141
|
+
## Step 7: Final Assessment
|
|
142
|
+
|
|
143
|
+
Compute verdict:
|
|
144
|
+
|
|
145
|
+
| Condition | Verdict |
|
|
146
|
+
|-----------|---------|
|
|
147
|
+
| Any required doc missing | NOT READY |
|
|
148
|
+
| Prior phases incomplete | NOT READY |
|
|
149
|
+
| req_testable < 50% of req_total | NOT READY |
|
|
150
|
+
| 1–2 uncovered requirements OR plan quality issues | NEEDS WORK |
|
|
151
|
+
| All checks pass | READY |
|
|
152
|
+
|
|
153
|
+
Collect all issues into a numbered list.
|
|
154
|
+
|
|
155
|
+
Present the full report:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
🔮 **Readiness Gate** · Phase {N}: {Phase Name}
|
|
159
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
160
|
+
|
|
161
|
+
{icon} Document Discovery — {summary}
|
|
162
|
+
{icon} Requirements Analysis — {req_testable}/{req_total} requirements are testable
|
|
163
|
+
{icon} Plan Coverage — {covered}/{total} requirements addressed
|
|
164
|
+
{icon} Dependency Check — {prior phases summary}
|
|
165
|
+
{icon} Plan Quality — {plan_count} plans, {quality_summary}
|
|
166
|
+
{icon} Final Assessment — {READY | NEEDS WORK | NOT READY}
|
|
167
|
+
|
|
168
|
+
### Issues to Address:
|
|
169
|
+
{numbered list of specific issues — omit if READY}
|
|
170
|
+
|
|
171
|
+
### Verdict: {icon} {READY | NEEDS WORK | NOT READY}
|
|
172
|
+
{one-line action — e.g., "Fix 2 issues before executing." or "You're clear to start."}
|
|
173
|
+
|
|
174
|
+
[1] Fix issues and re-check
|
|
175
|
+
[2] Execute anyway (not recommended — only shown for NEEDS WORK)
|
|
176
|
+
[3] See per-plan detail
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Icons: ✅ pass · ⚠️ warn · ❌ fail
|
|
180
|
+
|
|
181
|
+
For READY: do not show options [1] and [2]. Offer only:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
[1] Execute phase: /merlin:execute-phase {N}
|
|
185
|
+
[2] See per-plan detail
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</process>
|
|
189
|
+
|
|
190
|
+
<critical_rules>
|
|
191
|
+
|
|
192
|
+
**READ, DO NOT MODIFY.** This command never writes or edits planning files. It reports only.
|
|
193
|
+
|
|
194
|
+
**BE SPECIFIC.** Every issue in the Issues list must name the exact file, requirement ID, or plan that needs attention.
|
|
195
|
+
|
|
196
|
+
**FAIL FAST.** If all required docs are missing, emit NOT READY after Step 2 and stop.
|
|
197
|
+
|
|
198
|
+
**DO NOT BLOCK UNCONDITIONALLY.** NEEDS WORK means improvable — still offer an override path. Only NOT READY hard-stops execution.
|
|
199
|
+
|
|
200
|
+
</critical_rules>
|
|
201
|
+
|
|
202
|
+
<success_criteria>
|
|
203
|
+
- [ ] Phase resolved from args or STATE.md
|
|
204
|
+
- [ ] All 6 checks executed and reported
|
|
205
|
+
- [ ] Specific issues listed by file/ID (no vague feedback)
|
|
206
|
+
- [ ] Correct verdict emitted (READY / NEEDS WORK / NOT READY)
|
|
207
|
+
- [ ] Next steps offered based on verdict
|
|
208
|
+
</success_criteria>
|
|
@@ -117,7 +117,7 @@ Write to: .planning/phases/{phase}-{slug}/{phase}-RESEARCH.md
|
|
|
117
117
|
|
|
118
118
|
```
|
|
119
119
|
## Spawn fresh researcher process via Bash:
|
|
120
|
-
cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
120
|
+
unset CLAUDECODE && cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
121
121
|
--agent merlin-researcher \
|
|
122
122
|
-p \
|
|
123
123
|
--permission-mode acceptEdits \
|
|
@@ -152,7 +152,7 @@ Research file: @.planning/phases/{phase}-{slug}/{phase}-RESEARCH.md
|
|
|
152
152
|
|
|
153
153
|
```
|
|
154
154
|
## Spawn fresh continuation process via Bash:
|
|
155
|
-
cat "$HANDOFF_DIR/continuation.md" | claude \
|
|
155
|
+
unset CLAUDECODE && cat "$HANDOFF_DIR/continuation.md" | claude \
|
|
156
156
|
--agent merlin-researcher \
|
|
157
157
|
-p \
|
|
158
158
|
--permission-mode acceptEdits \
|
|
@@ -71,7 +71,7 @@ Spawn all 4 in parallel with rich context:
|
|
|
71
71
|
|
|
72
72
|
```
|
|
73
73
|
## Spawn fresh researcher via Bash:
|
|
74
|
-
## Write the following to a handoff file, then: cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
74
|
+
## Write the following to a handoff file, then: unset CLAUDECODE && cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
75
75
|
## Handoff content:
|
|
76
76
|
# "
|
|
77
77
|
<research_type>
|
|
@@ -113,7 +113,7 @@ Use template: ~/.claude/merlin/templates/research-project/STACK.md
|
|
|
113
113
|
## End of Stack research handoff
|
|
114
114
|
|
|
115
115
|
## Spawn fresh researcher via Bash:
|
|
116
|
-
## Write the following to a handoff file, then: cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
116
|
+
## Write the following to a handoff file, then: unset CLAUDECODE && cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
117
117
|
## Handoff content:
|
|
118
118
|
# "
|
|
119
119
|
<research_type>
|
|
@@ -155,7 +155,7 @@ Use template: ~/.claude/merlin/templates/research-project/FEATURES.md
|
|
|
155
155
|
## End of Features research handoff
|
|
156
156
|
|
|
157
157
|
## Spawn fresh researcher via Bash:
|
|
158
|
-
## Write the following to a handoff file, then: cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
158
|
+
## Write the following to a handoff file, then: unset CLAUDECODE && cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
159
159
|
## Handoff content:
|
|
160
160
|
# "
|
|
161
161
|
<research_type>
|
|
@@ -197,7 +197,7 @@ Use template: ~/.claude/merlin/templates/research-project/ARCHITECTURE.md
|
|
|
197
197
|
## End of Architecture research handoff
|
|
198
198
|
|
|
199
199
|
## Spawn fresh researcher via Bash:
|
|
200
|
-
## Write the following to a handoff file, then: cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
200
|
+
## Write the following to a handoff file, then: unset CLAUDECODE && cat handoff.md | claude --agent merlin-researcher -p --permission-mode acceptEdits --output-format text
|
|
201
201
|
## Handoff content:
|
|
202
202
|
# "
|
|
203
203
|
<research_type>
|
|
@@ -83,7 +83,7 @@ Summary: <verification summary>
|
|
|
83
83
|
---END_VERIFY_RESULT---
|
|
84
84
|
EOF
|
|
85
85
|
|
|
86
|
-
RESULT=$(cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
86
|
+
RESULT=$(unset CLAUDECODE && cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
87
87
|
--agent merlin-work-verifier \
|
|
88
88
|
-p \
|
|
89
89
|
--permission-mode acceptEdits \
|
package/package.json
CHANGED