mustard-claude 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -153
- package/dist/generators/index.js +6 -51
- package/dist/generators/index.js.map +1 -1
- package/package.json +61 -56
- package/templates/CLAUDE.md +552 -0
- package/templates/commands/README.md +55 -0
- package/templates/commands/mustard/approve.md +161 -0
- package/templates/commands/mustard/bugfix.md +240 -0
- package/templates/commands/mustard/commit-push.md +64 -0
- package/templates/commands/mustard/commit.md +102 -0
- package/templates/commands/mustard/complete.md +171 -0
- package/templates/commands/mustard/feature.md +277 -0
- package/templates/commands/mustard/install-deps.md +144 -0
- package/templates/commands/mustard/merge-main.md +91 -0
- package/templates/commands/mustard/report-daily.md +70 -0
- package/templates/commands/mustard/report-weekly.md +95 -0
- package/templates/commands/mustard/resume.md +220 -0
- package/templates/commands/mustard/scan.md +144 -0
- package/templates/commands/mustard/status.md +81 -0
- package/templates/commands/mustard/sync-context.md +317 -0
- package/templates/commands/mustard/sync-registry.md +48 -0
- package/templates/commands/mustard/task-analyze.md +138 -0
- package/templates/commands/mustard/task-docs.md +194 -0
- package/templates/commands/mustard/task-refactor.md +233 -0
- package/templates/commands/mustard/task-review.md +163 -0
- package/templates/commands/mustard/validate.md +160 -0
- package/templates/context/.gitkeep +0 -0
- package/templates/context/README.md +117 -0
- package/templates/core/enforcement.md +275 -0
- package/templates/core/entity-registry-spec.md +296 -0
- package/templates/core/pipeline.md +360 -0
- package/templates/hooks/enforce-grepai.js +44 -0
- package/templates/hooks/enforce-pipeline.js +88 -0
- package/templates/hooks/l0-enforcement.md +133 -0
- package/templates/prompts/_index.md +148 -0
- package/templates/prompts/backend.md +542 -0
- package/templates/prompts/bugfix.md +188 -0
- package/templates/prompts/database.md +297 -0
- package/templates/prompts/frontend.md +214 -0
- package/templates/prompts/naming.md +225 -0
- package/templates/prompts/orchestrator.md +293 -0
- package/templates/prompts/report.md +165 -0
- package/templates/prompts/review.md +222 -0
- package/templates/scripts/statusline.js +83 -0
- package/templates/settings.json +33 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
# Mustard - Instructions for Claude
|
|
2
|
+
|
|
3
|
+
> Agent framework and pipeline for Claude Code.
|
|
4
|
+
> **Version 2.4** - Auto-generated context, Memory MCP search in agents, improved CLI.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 0. PIPELINE - ALWAYS CHECK
|
|
9
|
+
|
|
10
|
+
> **BEFORE ANY RESPONSE:** Check if there is an active pipeline.
|
|
11
|
+
|
|
12
|
+
### When Starting an Interaction
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
// ALWAYS execute at the start
|
|
16
|
+
mcp__memory__search_nodes({ query: "pipeline phase" })
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
| Result | Action |
|
|
20
|
+
|--------|--------|
|
|
21
|
+
| No pipeline | Free analysis, but code edits require /feature or /bugfix |
|
|
22
|
+
| Pipeline in "explore" | Continue exploration or present spec for approval |
|
|
23
|
+
| Pipeline in "implement" | Edits allowed, follow spec |
|
|
24
|
+
|
|
25
|
+
### Automatic Intent Detection
|
|
26
|
+
|
|
27
|
+
| Request Type | Pipeline Required? |
|
|
28
|
+
|--------------|-------------------|
|
|
29
|
+
| "How does X work?" | NO - free analysis |
|
|
30
|
+
| "Where is Y?" | NO - free analysis |
|
|
31
|
+
| "Explain Z" | NO - free analysis |
|
|
32
|
+
| "Add field X" | YES - /feature |
|
|
33
|
+
| "Fix error Y" | YES - /bugfix |
|
|
34
|
+
| "Refactor Z" | YES - /feature |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 1. ENFORCEMENT L0 - READ FIRST
|
|
39
|
+
|
|
40
|
+
> **ABSOLUTE RULE:** Main Claude does NOT implement code. ALWAYS delegates.
|
|
41
|
+
|
|
42
|
+
### When Receiving a Request:
|
|
43
|
+
|
|
44
|
+
1. **IDENTIFY** task type
|
|
45
|
+
2. **SELECT** appropriate agent/prompt
|
|
46
|
+
3. **DELEGATE** via Task tool with native `subagent_type`
|
|
47
|
+
4. **NEVER** start writing code directly
|
|
48
|
+
|
|
49
|
+
### Delegation Map
|
|
50
|
+
|
|
51
|
+
| Request | subagent_type | model | Prompt |
|
|
52
|
+
|---------|---------------|-------|--------|
|
|
53
|
+
| Bug fix | `general-purpose` | opus | `prompts/bugfix.md` |
|
|
54
|
+
| New feature | `general-purpose` | opus | `prompts/orchestrator.md` |
|
|
55
|
+
| Backend | `general-purpose` | opus | `prompts/backend.md` |
|
|
56
|
+
| Frontend | `general-purpose` | opus | `prompts/frontend.md` |
|
|
57
|
+
| Database | `general-purpose` | opus | `prompts/database.md` |
|
|
58
|
+
| QA/Review | `general-purpose` | opus | `prompts/review.md` |
|
|
59
|
+
| Explore | `Explore` | haiku | (native) |
|
|
60
|
+
| Reports | `general-purpose` | sonnet | `prompts/report.md` |
|
|
61
|
+
|
|
62
|
+
### Self-Check
|
|
63
|
+
|
|
64
|
+
**Before using Write, Edit, or Bash (to create code):**
|
|
65
|
+
|
|
66
|
+
> Am I inside an agent (Task)?
|
|
67
|
+
> If NO → STOP and delegate.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 2. Claude Code Native Types
|
|
72
|
+
|
|
73
|
+
Claude Code accepts **only 4 types** of subagent_type:
|
|
74
|
+
|
|
75
|
+
| Native Type | Description | Mustard Usage |
|
|
76
|
+
|-------------|-------------|---------------|
|
|
77
|
+
| `Explore` | Quick codebase exploration | Analysis phase |
|
|
78
|
+
| `Plan` | Implementation planning | Complex specs |
|
|
79
|
+
| `general-purpose` | Implementation, bug fixes, reviews | **MAIN** |
|
|
80
|
+
| `Bash` | Terminal commands | Git, builds |
|
|
81
|
+
|
|
82
|
+
### How It Works
|
|
83
|
+
|
|
84
|
+
Mustard "agents" are **prompts** that load specialized instructions inside a `Task(general-purpose)`:
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
// BEFORE (doesn't work)
|
|
88
|
+
Task({ subagent_type: "orchestrator", ... }) // X
|
|
89
|
+
|
|
90
|
+
// AFTER (works)
|
|
91
|
+
Task({
|
|
92
|
+
subagent_type: "general-purpose",
|
|
93
|
+
model: "opus",
|
|
94
|
+
prompt: `
|
|
95
|
+
# You are the ORCHESTRATOR
|
|
96
|
+
[content from prompts/orchestrator.md]
|
|
97
|
+
|
|
98
|
+
# TASK
|
|
99
|
+
${description}
|
|
100
|
+
`
|
|
101
|
+
}) // OK
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 3. Agents as Prompts
|
|
107
|
+
|
|
108
|
+
| Role | subagent_type | Model | Prompt File |
|
|
109
|
+
|------|---------------|-------|-------------|
|
|
110
|
+
| Orchestrator | `general-purpose` | opus | `prompts/orchestrator.md` |
|
|
111
|
+
| Explorer | `Explore` | haiku | (native - no prompt) |
|
|
112
|
+
| Backend | `general-purpose` | opus | `prompts/backend.md` |
|
|
113
|
+
| Frontend | `general-purpose` | opus | `prompts/frontend.md` |
|
|
114
|
+
| Database | `general-purpose` | opus | `prompts/database.md` |
|
|
115
|
+
| Bugfix | `general-purpose` | opus | `prompts/bugfix.md` |
|
|
116
|
+
| Review | `general-purpose` | opus | `prompts/review.md` |
|
|
117
|
+
| Report | `general-purpose` | sonnet | `prompts/report.md` |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 4. Available Commands
|
|
122
|
+
|
|
123
|
+
### Pipeline
|
|
124
|
+
|
|
125
|
+
| Command | Description |
|
|
126
|
+
|---------|-------------|
|
|
127
|
+
| `/feature <name>` | Single entry point for features |
|
|
128
|
+
| `/bugfix <error>` | Single entry point for bugs |
|
|
129
|
+
| `/approve` | Approve spec and enable implementation |
|
|
130
|
+
| `/complete` | Finalize pipeline (after validation) |
|
|
131
|
+
| `/resume` | Resume active pipeline |
|
|
132
|
+
|
|
133
|
+
### Git
|
|
134
|
+
|
|
135
|
+
| Command | Description |
|
|
136
|
+
|---------|-------------|
|
|
137
|
+
| `/commit` | Simple commit |
|
|
138
|
+
| `/commit-push` | Commit and push |
|
|
139
|
+
| `/merge-main` | Merge to main |
|
|
140
|
+
|
|
141
|
+
### Validation
|
|
142
|
+
|
|
143
|
+
| Command | Description |
|
|
144
|
+
|---------|-------------|
|
|
145
|
+
| `/validate` | Build + type-check |
|
|
146
|
+
| `/status` | Consolidated status |
|
|
147
|
+
| `/scan` | Project reconnaissance |
|
|
148
|
+
|
|
149
|
+
### Sync
|
|
150
|
+
|
|
151
|
+
| Command | Description |
|
|
152
|
+
|---------|-------------|
|
|
153
|
+
| `/sync-registry` | Update Entity Registry |
|
|
154
|
+
| `/sync-types` | Regenerate TypeScript types |
|
|
155
|
+
| `/install-deps` | Install dependencies |
|
|
156
|
+
| `/sync-context` | Load project context |
|
|
157
|
+
|
|
158
|
+
### Reports
|
|
159
|
+
|
|
160
|
+
| Command | Description |
|
|
161
|
+
|---------|-------------|
|
|
162
|
+
| `/report-daily` | Daily commit report |
|
|
163
|
+
| `/report-weekly` | Weekly consolidated report |
|
|
164
|
+
|
|
165
|
+
### Task Commands (L0 Universal Delegation)
|
|
166
|
+
|
|
167
|
+
| Command | Emoji | Description |
|
|
168
|
+
|---------|-------|-------------|
|
|
169
|
+
| `/task-analyze <scope>` | 🔍 | Code analysis via Task(Explore) |
|
|
170
|
+
| `/task-review <scope>` | 🔎 | Code review via Task(general-purpose) |
|
|
171
|
+
| `/task-refactor <scope>` | 📋⚙️ | Refactoring via Task(Plan) → Task(general-purpose) |
|
|
172
|
+
| `/task-docs <scope>` | 📊 | Documentation via Task(general-purpose) |
|
|
173
|
+
|
|
174
|
+
> **IMPORTANT:** These commands ensure that ALL code activity is delegated to a separate context (Task), keeping the main (parent) context clean.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 5. Required Single Pipeline
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
┌─────────────────────────────────────────────────────────┐
|
|
182
|
+
│ /feature or /bugfix │
|
|
183
|
+
└───────────────────────────┬─────────────────────────────┘
|
|
184
|
+
▼
|
|
185
|
+
┌─────────────────────────────────────────────────────────┐
|
|
186
|
+
│ PHASE 0: LOAD CONTEXT (auto, if > 24h) │
|
|
187
|
+
│ Glob context/*.md, grepai patterns → memory MCP │
|
|
188
|
+
└───────────────────────────┬─────────────────────────────┘
|
|
189
|
+
▼
|
|
190
|
+
┌─────────────────────────────────────────────────────────┐
|
|
191
|
+
│ PHASE 1: EXPLORE │
|
|
192
|
+
│ Task(Explore) → Analyzes requirements, maps files │
|
|
193
|
+
└───────────────────────────┬─────────────────────────────┘
|
|
194
|
+
▼
|
|
195
|
+
┌─────────────────────────────────────────────────────────┐
|
|
196
|
+
│ PHASE 2: SPEC │
|
|
197
|
+
│ Saves plan to spec/active/{name}/spec.md │
|
|
198
|
+
│ Presents to user for approval │
|
|
199
|
+
└───────────────────────────┬─────────────────────────────┘
|
|
200
|
+
│
|
|
201
|
+
┌─────────────┴─────────────┐
|
|
202
|
+
▼ ▼
|
|
203
|
+
[APPROVED] [ITERATE]
|
|
204
|
+
│ │
|
|
205
|
+
▼ (back to PHASE 1)
|
|
206
|
+
┌─────────────────────────────────────────────────────────┐
|
|
207
|
+
│ PHASE 3: IMPLEMENT (parallel when possible) │
|
|
208
|
+
│ Task(general-purpose) with specialized prompts │
|
|
209
|
+
│ database → backend → frontend │
|
|
210
|
+
└─────────────────────────────────────────────────────────┘
|
|
211
|
+
▼
|
|
212
|
+
┌─────────────────────────────────────────────────────────┐
|
|
213
|
+
│ PHASE 4: REVIEW │
|
|
214
|
+
│ Task(general-purpose) + prompts/review.md │
|
|
215
|
+
└───────────────────────────┬─────────────────────────────┘
|
|
216
|
+
│
|
|
217
|
+
┌─────────────┴─────────────┐
|
|
218
|
+
▼ ▼
|
|
219
|
+
[APPROVED] [RETURN]
|
|
220
|
+
│ │
|
|
221
|
+
▼ (back to PHASE 3)
|
|
222
|
+
┌─────────────────────────────────────────────────────────┐
|
|
223
|
+
│ PHASE 5: COMPLETE │
|
|
224
|
+
│ Updates registry, moves spec to completed/ │
|
|
225
|
+
└─────────────────────────────────────────────────────────┘
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 6. Decision Tree
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
Request
|
|
234
|
+
↓
|
|
235
|
+
Is it a bug? ──YES──→ /bugfix
|
|
236
|
+
│
|
|
237
|
+
NO
|
|
238
|
+
↓
|
|
239
|
+
Is it a new feature? ──YES──→ /feature
|
|
240
|
+
│
|
|
241
|
+
NO
|
|
242
|
+
↓
|
|
243
|
+
Task(general-purpose) with specific prompt
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## 7. Complete Enforcement (L0-L9)
|
|
249
|
+
|
|
250
|
+
| Level | Rule | Description |
|
|
251
|
+
|-------|------|-------------|
|
|
252
|
+
| L0 | Universal Delegation | ALL code activity MUST be delegated via Task (separate context) |
|
|
253
|
+
| L1 | grepai | Prefer grepai for semantic search |
|
|
254
|
+
| L2 | Pipeline | Pipeline required for features/bugs |
|
|
255
|
+
| L3 | Patterns | Naming, soft delete, multi-tenancy |
|
|
256
|
+
| L4 | Type-check | Frontend must pass type-check |
|
|
257
|
+
| L5 | Build | Backend must compile |
|
|
258
|
+
| L6 | Registry | Sync registry after creating entities |
|
|
259
|
+
| L7 | DbContext | Service does NOT access DbContext directly |
|
|
260
|
+
| L8 | Repository | Service only injects OWN Repository |
|
|
261
|
+
| L9 | ISP | Prefer segregated interfaces (SOLID) |
|
|
262
|
+
|
|
263
|
+
See details in [core/enforcement.md](./core/enforcement.md).
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 8. Search Rules
|
|
268
|
+
|
|
269
|
+
**ALWAYS use grepai** for semantic search:
|
|
270
|
+
```javascript
|
|
271
|
+
grepai_search({ query: "..." })
|
|
272
|
+
grepai_trace_callers({ symbol: "..." })
|
|
273
|
+
grepai_trace_callees({ symbol: "..." })
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**ALWAYS use memory MCP** for pipeline context:
|
|
277
|
+
```javascript
|
|
278
|
+
mcp__memory__search_nodes({ query: "pipeline phase" })
|
|
279
|
+
mcp__memory__open_nodes({ names: ["Pipeline:name"] })
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**FORBIDDEN** to use Grep/Glob - hook `enforce-grepai.js` blocks automatically.
|
|
283
|
+
|
|
284
|
+
### Why grepai?
|
|
285
|
+
|
|
286
|
+
| Tool | Problem |
|
|
287
|
+
|------|---------|
|
|
288
|
+
| Grep | Simple text search, many false positives |
|
|
289
|
+
| Glob | Only finds by file name |
|
|
290
|
+
| grepai | Semantic search, understands context and intent |
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 9. Correct Usage Example
|
|
295
|
+
|
|
296
|
+
### Calling Orchestrator for a Feature
|
|
297
|
+
|
|
298
|
+
```javascript
|
|
299
|
+
Task({
|
|
300
|
+
subagent_type: "general-purpose",
|
|
301
|
+
model: "opus",
|
|
302
|
+
description: "Orchestrate Invoice feature",
|
|
303
|
+
prompt: `
|
|
304
|
+
# You are the ORCHESTRATOR
|
|
305
|
+
|
|
306
|
+
## Identity
|
|
307
|
+
You coordinate the development pipeline. You do NOT implement code - you delegate.
|
|
308
|
+
|
|
309
|
+
## Required Pipeline
|
|
310
|
+
1. EXPLORE: Use Task(subagent_type="Explore") to analyze
|
|
311
|
+
2. SPEC: Create spec in spec/active/{name}/spec.md
|
|
312
|
+
3. IMPLEMENT: Use Task(general-purpose) for each layer
|
|
313
|
+
4. REVIEW: Use Task(general-purpose) with review prompt
|
|
314
|
+
5. COMPLETE: Update registry
|
|
315
|
+
|
|
316
|
+
## TASK
|
|
317
|
+
Implement feature: Invoice
|
|
318
|
+
`
|
|
319
|
+
})
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Calling Explorer (native)
|
|
323
|
+
|
|
324
|
+
```javascript
|
|
325
|
+
Task({
|
|
326
|
+
subagent_type: "Explore",
|
|
327
|
+
model: "haiku",
|
|
328
|
+
description: "Explore Invoice requirements",
|
|
329
|
+
prompt: "Analyze requirements to implement Invoice entity. Map existing similar files."
|
|
330
|
+
})
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Calling Backend Specialist
|
|
334
|
+
|
|
335
|
+
```javascript
|
|
336
|
+
Task({
|
|
337
|
+
subagent_type: "general-purpose",
|
|
338
|
+
model: "opus",
|
|
339
|
+
description: "Backend Invoice implementation",
|
|
340
|
+
prompt: `
|
|
341
|
+
# You are the BACKEND SPECIALIST
|
|
342
|
+
|
|
343
|
+
## Responsibilities
|
|
344
|
+
- Implement endpoints/APIs
|
|
345
|
+
- Create services and business logic
|
|
346
|
+
- Follow project patterns
|
|
347
|
+
|
|
348
|
+
## Rules
|
|
349
|
+
- L7: Service does NOT access DbContext directly
|
|
350
|
+
- L8: Service only injects OWN Repository
|
|
351
|
+
|
|
352
|
+
## TASK
|
|
353
|
+
Implement backend module for Invoice according to spec.
|
|
354
|
+
`
|
|
355
|
+
})
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 10. Project Context (v2.4)
|
|
361
|
+
|
|
362
|
+
### Auto-Generated Context by CLI
|
|
363
|
+
|
|
364
|
+
The CLI automatically generates context files in `.claude/context/`:
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
.claude/context/
|
|
368
|
+
├── README.md # Folder documentation
|
|
369
|
+
├── architecture.md # AUTO: Type, stacks, layers
|
|
370
|
+
├── patterns.md # AUTO: Detected patterns
|
|
371
|
+
└── naming.md # AUTO: Naming conventions
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### User Files (Optional)
|
|
375
|
+
|
|
376
|
+
You can add custom files (flat, no subfolders):
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
.claude/context/
|
|
380
|
+
├── project-spec.md # Project specification
|
|
381
|
+
├── business-rules.md # Business rules
|
|
382
|
+
├── tips.md # Tips for Claude
|
|
383
|
+
├── service-example.md # Service example
|
|
384
|
+
├── component-example.md # Component example
|
|
385
|
+
└── hook-example.md # Hook example
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Rules
|
|
389
|
+
|
|
390
|
+
| Rule | Description |
|
|
391
|
+
|------|-------------|
|
|
392
|
+
| Markdown only | Only `.md` files are loaded |
|
|
393
|
+
| Max 500 lines | Larger files are truncated |
|
|
394
|
+
| Max 20 files | Total file limit |
|
|
395
|
+
| Refresh 24h | Auto-refresh if context > 24h |
|
|
396
|
+
|
|
397
|
+
### Entity Types in Memory MCP
|
|
398
|
+
|
|
399
|
+
| Entity | Description |
|
|
400
|
+
|--------|-------------|
|
|
401
|
+
| `ProjectContext:current` | Project metadata |
|
|
402
|
+
| `UserContext:{filename}` | Files from context/ |
|
|
403
|
+
| `EntityRegistry:current` | Cache of entity-registry.json |
|
|
404
|
+
| `EnforcementRules:current` | Rules L0-L9 |
|
|
405
|
+
| `CodePattern:{type}` | Patterns discovered via grepai |
|
|
406
|
+
|
|
407
|
+
### Using Context (Agents)
|
|
408
|
+
|
|
409
|
+
All agent prompts now automatically search for context:
|
|
410
|
+
|
|
411
|
+
```javascript
|
|
412
|
+
// Search context before implementing
|
|
413
|
+
const context = await mcp__memory__search_nodes({
|
|
414
|
+
query: "UserContext architecture CodePattern service"
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
// Open specific entities
|
|
418
|
+
if (context.entities?.length) {
|
|
419
|
+
const details = await mcp__memory__open_nodes({
|
|
420
|
+
names: context.entities.map(e => e.name)
|
|
421
|
+
});
|
|
422
|
+
// Use found examples and patterns
|
|
423
|
+
}
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Benefits
|
|
427
|
+
|
|
428
|
+
| Metric | Impact |
|
|
429
|
+
|--------|--------|
|
|
430
|
+
| Tokens per feature | ~60% less (less exploration) |
|
|
431
|
+
| Rework | Reduces (follows patterns) |
|
|
432
|
+
| Quality | Improves (real examples) |
|
|
433
|
+
| Consistency | Uniform code |
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## 11. Memory MCP - Pipeline Persistence
|
|
438
|
+
|
|
439
|
+
Pipeline state is persisted via **memory MCP**, not via files.
|
|
440
|
+
|
|
441
|
+
### Structure in Knowledge Graph
|
|
442
|
+
|
|
443
|
+
```
|
|
444
|
+
Pipeline:{name}
|
|
445
|
+
├── type: "pipeline"
|
|
446
|
+
├── observations:
|
|
447
|
+
│ ├── "phase: explore|implement|completed"
|
|
448
|
+
│ ├── "started: {ISO_DATE}"
|
|
449
|
+
│ ├── "objective: {description}"
|
|
450
|
+
│ └── "files: {list}"
|
|
451
|
+
└── relations:
|
|
452
|
+
└── has_spec → Spec:{name}
|
|
453
|
+
|
|
454
|
+
Spec:{name}
|
|
455
|
+
├── type: "spec"
|
|
456
|
+
└── observations:
|
|
457
|
+
├── "## Objective\n..."
|
|
458
|
+
├── "## Files\n..."
|
|
459
|
+
└── "## Checklist\n☐ Backend ☐ Frontend"
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Common Operations
|
|
463
|
+
|
|
464
|
+
```javascript
|
|
465
|
+
// Create pipeline (/feature)
|
|
466
|
+
mcp__memory__create_entities({
|
|
467
|
+
entities: [{
|
|
468
|
+
name: "Pipeline:add-email",
|
|
469
|
+
entityType: "pipeline",
|
|
470
|
+
observations: [
|
|
471
|
+
"phase: explore",
|
|
472
|
+
"started: 2026-02-05",
|
|
473
|
+
"objective: Add email to Customer"
|
|
474
|
+
]
|
|
475
|
+
}]
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
// Approve (/approve)
|
|
479
|
+
mcp__memory__add_observations({
|
|
480
|
+
observations: [{
|
|
481
|
+
entityName: "Pipeline:add-email",
|
|
482
|
+
contents: ["phase: implement", "approved: 2026-02-05"]
|
|
483
|
+
}]
|
|
484
|
+
})
|
|
485
|
+
|
|
486
|
+
// Search for active
|
|
487
|
+
mcp__memory__search_nodes({ query: "pipeline phase explore implement" })
|
|
488
|
+
|
|
489
|
+
// Finalize (/complete)
|
|
490
|
+
mcp__memory__delete_entities({
|
|
491
|
+
entityNames: ["Pipeline:add-email", "Spec:add-email"]
|
|
492
|
+
})
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## 12. Enforcement Hooks
|
|
498
|
+
|
|
499
|
+
### enforce-pipeline.js (L0+L2)
|
|
500
|
+
|
|
501
|
+
- **Trigger:** Edit/Write on code files
|
|
502
|
+
- **Action:** Asks for confirmation, Claude checks memory MCP
|
|
503
|
+
- **Exceptions:** .md, .json, .yaml, .claude/, mustard/, spec/
|
|
504
|
+
|
|
505
|
+
### enforce-grepai.js (L1)
|
|
506
|
+
|
|
507
|
+
- **Trigger:** Grep/Glob
|
|
508
|
+
- **Action:** BLOCKS with message to use grepai
|
|
509
|
+
- **No exceptions**
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## 13. Links
|
|
514
|
+
|
|
515
|
+
### Core
|
|
516
|
+
|
|
517
|
+
- [Enforcement L0-L9](./core/enforcement.md)
|
|
518
|
+
- [Naming Conventions](./core/naming-conventions.md)
|
|
519
|
+
- [Entity Registry Spec](./core/entity-registry-spec.md)
|
|
520
|
+
- [Pipeline](./core/pipeline.md)
|
|
521
|
+
|
|
522
|
+
### Prompts
|
|
523
|
+
|
|
524
|
+
- [Prompts Index](./prompts/_index.md)
|
|
525
|
+
- [Backend](./prompts/backend.md)
|
|
526
|
+
- [Frontend](./prompts/frontend.md)
|
|
527
|
+
- [Database](./prompts/database.md)
|
|
528
|
+
|
|
529
|
+
### Commands - Pipeline
|
|
530
|
+
|
|
531
|
+
- [feature](./commands/mustard/feature.md)
|
|
532
|
+
- [bugfix](./commands/mustard/bugfix.md)
|
|
533
|
+
- [approve](./commands/mustard/approve.md)
|
|
534
|
+
- [complete](./commands/mustard/complete.md)
|
|
535
|
+
- [resume](./commands/mustard/resume.md)
|
|
536
|
+
|
|
537
|
+
### Commands - Other
|
|
538
|
+
|
|
539
|
+
- [sync-registry](./commands/mustard/sync-registry.md)
|
|
540
|
+
- [install-deps](./commands/mustard/install-deps.md)
|
|
541
|
+
- [sync-context](./commands/mustard/sync-context.md)
|
|
542
|
+
- [report-daily](./commands/mustard/report-daily.md)
|
|
543
|
+
- [report-weekly](./commands/mustard/report-weekly.md)
|
|
544
|
+
|
|
545
|
+
### Context
|
|
546
|
+
|
|
547
|
+
- [context/README.md](./context/README.md)
|
|
548
|
+
|
|
549
|
+
### Hooks
|
|
550
|
+
|
|
551
|
+
- [enforce-pipeline.js](./hooks/enforce-pipeline.js)
|
|
552
|
+
- [enforce-grepai.js](./hooks/enforce-grepai.js)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Commands
|
|
2
|
+
|
|
3
|
+
This folder contains Claude Code slash commands.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
commands/
|
|
9
|
+
├── mustard/ # Mustard core commands (managed by Mustard CLI)
|
|
10
|
+
│ ├── feature.md
|
|
11
|
+
│ ├── bugfix.md
|
|
12
|
+
│ ├── commit.md
|
|
13
|
+
│ └── ...
|
|
14
|
+
├── README.md # This file
|
|
15
|
+
└── my-command.md # Your custom commands (preserved on updates)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Mustard Commands (`mustard/`)
|
|
19
|
+
|
|
20
|
+
Commands in the `mustard/` subfolder are managed by the Mustard CLI:
|
|
21
|
+
- **Created** during `mustard init`
|
|
22
|
+
- **Overwritten** during `mustard update`
|
|
23
|
+
- Do NOT edit these files - your changes will be lost on update
|
|
24
|
+
|
|
25
|
+
## User Commands (root folder)
|
|
26
|
+
|
|
27
|
+
Create your own commands directly in this folder (not in `mustard/`):
|
|
28
|
+
- **Preserved** during `mustard update`
|
|
29
|
+
- Full control over content
|
|
30
|
+
- Example: `my-deploy.md`, `run-tests.md`
|
|
31
|
+
|
|
32
|
+
## Creating a Custom Command
|
|
33
|
+
|
|
34
|
+
1. Create a `.md` file in this folder (e.g., `my-command.md`)
|
|
35
|
+
2. Use the following format:
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
# /my-command - Description
|
|
39
|
+
|
|
40
|
+
## Trigger
|
|
41
|
+
|
|
42
|
+
`/my-command [args]`
|
|
43
|
+
|
|
44
|
+
## Description
|
|
45
|
+
|
|
46
|
+
What this command does.
|
|
47
|
+
|
|
48
|
+
## Actions
|
|
49
|
+
|
|
50
|
+
1. Step one
|
|
51
|
+
2. Step two
|
|
52
|
+
3. ...
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
3. The command will be available as `/my-command` in Claude Code
|