mustard-claude 2.0.13 โ†’ 3.0.1

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.
Files changed (262) hide show
  1. package/README.md +169 -296
  2. package/dist/cli.js +4 -11
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/init.d.ts +5 -2
  5. package/dist/commands/init.js +91 -353
  6. package/dist/commands/init.js.map +1 -1
  7. package/dist/commands/update.d.ts +4 -4
  8. package/dist/commands/update.js +65 -224
  9. package/dist/commands/update.js.map +1 -1
  10. package/package.json +1 -3
  11. package/templates/CLAUDE.md +23 -344
  12. package/templates/commands/mustard/approve/SKILL.md +58 -0
  13. package/templates/commands/mustard/bugfix/SKILL.md +56 -0
  14. package/templates/commands/mustard/complete/SKILL.md +66 -0
  15. package/templates/commands/mustard/feature/SKILL.md +132 -0
  16. package/templates/commands/mustard/git/SKILL.md +137 -0
  17. package/templates/commands/mustard/knowledge/SKILL.md +112 -0
  18. package/templates/commands/mustard/maint/SKILL.md +70 -0
  19. package/templates/commands/mustard/resume/SKILL.md +124 -0
  20. package/templates/commands/mustard/scan/SKILL.md +352 -0
  21. package/templates/commands/mustard/scan-format/SKILL.md +261 -0
  22. package/templates/commands/mustard/skill/SKILL.md +151 -0
  23. package/templates/commands/mustard/status/SKILL.md +29 -0
  24. package/templates/commands/mustard/task/SKILL.md +203 -0
  25. package/templates/commands/mustard/templates/agent-prompt/SKILL.md +112 -0
  26. package/templates/hooks/__tests__/hooks.test.js +241 -0
  27. package/templates/hooks/auto-format.js +124 -0
  28. package/templates/hooks/bash-safety.js +60 -0
  29. package/templates/hooks/enforce-registry.js +21 -36
  30. package/templates/hooks/file-guard.js +61 -0
  31. package/templates/hooks/guard-verify.js +147 -0
  32. package/templates/hooks/pre-compact.js +119 -0
  33. package/templates/hooks/session-cleanup.js +159 -0
  34. package/templates/hooks/subagent-tracker.js +219 -0
  35. package/templates/pipeline-config.md +68 -0
  36. package/templates/scripts/statusline.js +346 -63
  37. package/templates/scripts/sync-detect.js +946 -0
  38. package/templates/scripts/sync-registry.js +452 -0
  39. package/templates/settings.json +135 -11
  40. package/templates/skills/commit-workflow/SKILL.md +39 -0
  41. package/templates/skills/design-craft/SKILL.md +197 -0
  42. package/templates/skills/design-craft/references/critique.md +67 -0
  43. package/templates/skills/design-craft/references/example.md +86 -0
  44. package/templates/skills/design-craft/references/palettes-catalog.md +85 -0
  45. package/templates/skills/design-craft/references/principles.md +235 -0
  46. package/templates/skills/design-craft/references/styles-catalog.md +93 -0
  47. package/templates/skills/design-craft/references/typography-catalog.md +70 -0
  48. package/templates/skills/design-craft/references/ux-guidelines.md +79 -0
  49. package/templates/skills/design-craft/references/validation.md +48 -0
  50. package/templates/skills/pipeline-execution/SKILL.md +131 -0
  51. package/templates/skills/react-best-practices/SKILL.md +44 -0
  52. package/templates/skills/react-best-practices/references/rules/_sections.md +46 -0
  53. package/templates/skills/react-best-practices/references/rules/_template.md +28 -0
  54. package/templates/skills/react-best-practices/references/rules/advanced-event-handler-refs.md +38 -0
  55. package/templates/skills/react-best-practices/references/rules/advanced-use-latest.md +49 -0
  56. package/templates/skills/react-best-practices/references/rules/async-api-routes.md +38 -0
  57. package/templates/skills/react-best-practices/references/rules/async-defer-await.md +80 -0
  58. package/templates/skills/react-best-practices/references/rules/async-dependencies.md +36 -0
  59. package/templates/skills/react-best-practices/references/rules/async-parallel.md +28 -0
  60. package/templates/skills/react-best-practices/references/rules/async-suspense-boundaries.md +66 -0
  61. package/templates/skills/react-best-practices/references/rules/bundle-barrel-imports.md +59 -0
  62. package/templates/skills/react-best-practices/references/rules/bundle-conditional.md +31 -0
  63. package/templates/skills/react-best-practices/references/rules/bundle-defer-third-party.md +49 -0
  64. package/templates/skills/react-best-practices/references/rules/bundle-dynamic-imports.md +35 -0
  65. package/templates/skills/react-best-practices/references/rules/bundle-preload.md +50 -0
  66. package/templates/skills/react-best-practices/references/rules/client-event-listeners.md +74 -0
  67. package/templates/skills/react-best-practices/references/rules/client-swr-dedup.md +56 -0
  68. package/templates/skills/react-best-practices/references/rules/js-batch-dom-css.md +82 -0
  69. package/templates/skills/react-best-practices/references/rules/js-cache-function-results.md +80 -0
  70. package/templates/skills/react-best-practices/references/rules/js-cache-property-access.md +28 -0
  71. package/templates/skills/react-best-practices/references/rules/js-cache-storage.md +68 -0
  72. package/templates/skills/react-best-practices/references/rules/js-combine-iterations.md +32 -0
  73. package/templates/skills/react-best-practices/references/rules/js-early-exit.md +50 -0
  74. package/templates/skills/react-best-practices/references/rules/js-hoist-regexp.md +43 -0
  75. package/templates/skills/react-best-practices/references/rules/js-index-maps.md +37 -0
  76. package/templates/skills/react-best-practices/references/rules/js-length-check-first.md +49 -0
  77. package/templates/skills/react-best-practices/references/rules/js-min-max-loop.md +82 -0
  78. package/templates/skills/react-best-practices/references/rules/js-set-map-lookups.md +24 -0
  79. package/templates/skills/react-best-practices/references/rules/js-tosorted-immutable.md +57 -0
  80. package/templates/skills/react-best-practices/references/rules/rendering-activity.md +26 -0
  81. package/templates/skills/react-best-practices/references/rules/rendering-animate-svg-wrapper.md +47 -0
  82. package/templates/skills/react-best-practices/references/rules/rendering-conditional-render.md +40 -0
  83. package/templates/skills/react-best-practices/references/rules/rendering-content-visibility.md +38 -0
  84. package/templates/skills/react-best-practices/references/rules/rendering-hoist-jsx.md +44 -0
  85. package/templates/skills/react-best-practices/references/rules/rendering-hydration-no-flicker.md +82 -0
  86. package/templates/skills/react-best-practices/references/rules/rendering-svg-precision.md +28 -0
  87. package/templates/skills/react-best-practices/references/rules/rerender-defer-reads.md +39 -0
  88. package/templates/skills/react-best-practices/references/rules/rerender-dependencies.md +45 -0
  89. package/templates/skills/react-best-practices/references/rules/rerender-derived-state.md +29 -0
  90. package/templates/skills/react-best-practices/references/rules/rerender-lazy-state-init.md +58 -0
  91. package/templates/skills/react-best-practices/references/rules/rerender-memo.md +42 -0
  92. package/templates/skills/react-best-practices/references/rules/rerender-transitions.md +40 -0
  93. package/templates/skills/react-best-practices/references/rules/server-cache-lru.md +37 -0
  94. package/templates/skills/react-best-practices/references/rules/server-cache-react.md +26 -0
  95. package/templates/skills/react-best-practices/references/rules/server-parallel-fetching.md +79 -0
  96. package/templates/skills/react-best-practices/references/rules/server-serialization.md +38 -0
  97. package/templates/skills/senior-architect/SKILL.md +209 -0
  98. package/templates/skills/senior-architect/references/architecture_patterns.md +103 -0
  99. package/templates/skills/senior-architect/references/system_design_workflows.md +103 -0
  100. package/templates/skills/senior-architect/references/tech_decision_guide.md +103 -0
  101. package/templates/skills/senior-architect/scripts/architecture_diagram_generator.py +114 -0
  102. package/templates/skills/senior-architect/scripts/dependency_analyzer.py +114 -0
  103. package/templates/skills/senior-architect/scripts/project_architect.py +114 -0
  104. package/templates/skills/skill-creator/LICENSE.txt +202 -0
  105. package/templates/skills/skill-creator/SKILL.md +485 -0
  106. package/templates/skills/skill-creator/agents/analyzer.md +274 -0
  107. package/templates/skills/skill-creator/agents/comparator.md +202 -0
  108. package/templates/skills/skill-creator/agents/grader.md +223 -0
  109. package/templates/skills/skill-creator/assets/eval_review.html +146 -0
  110. package/templates/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  111. package/templates/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  112. package/templates/skills/skill-creator/references/schemas.md +430 -0
  113. package/templates/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  114. package/templates/skills/skill-creator/scripts/generate_report.py +326 -0
  115. package/templates/skills/skill-creator/scripts/improve_description.py +247 -0
  116. package/templates/skills/skill-creator/scripts/package_skill.py +136 -0
  117. package/templates/skills/skill-creator/scripts/quick_validate.py +103 -0
  118. package/templates/skills/skill-creator/scripts/run_eval.py +310 -0
  119. package/templates/skills/skill-creator/scripts/run_loop.py +328 -0
  120. package/templates/skills/skill-creator/scripts/utils.py +47 -0
  121. package/dist/analyzers/llm.d.ts +0 -9
  122. package/dist/analyzers/llm.js +0 -116
  123. package/dist/analyzers/llm.js.map +0 -1
  124. package/dist/analyzers/semantic.d.ts +0 -13
  125. package/dist/analyzers/semantic.js +0 -215
  126. package/dist/analyzers/semantic.js.map +0 -1
  127. package/dist/commands/sync.d.ts +0 -5
  128. package/dist/commands/sync.js +0 -354
  129. package/dist/commands/sync.js.map +0 -1
  130. package/dist/generators/claude-md-llm.d.ts +0 -5
  131. package/dist/generators/claude-md-llm.js +0 -101
  132. package/dist/generators/claude-md-llm.js.map +0 -1
  133. package/dist/generators/claude-md-template.d.ts +0 -5
  134. package/dist/generators/claude-md-template.js +0 -257
  135. package/dist/generators/claude-md-template.js.map +0 -1
  136. package/dist/generators/commands.d.ts +0 -12
  137. package/dist/generators/commands.js +0 -840
  138. package/dist/generators/commands.js.map +0 -1
  139. package/dist/generators/context.d.ts +0 -16
  140. package/dist/generators/context.js +0 -15
  141. package/dist/generators/context.js.map +0 -1
  142. package/dist/generators/hooks.d.ts +0 -5
  143. package/dist/generators/hooks.js +0 -393
  144. package/dist/generators/hooks.js.map +0 -1
  145. package/dist/generators/index.d.ts +0 -11
  146. package/dist/generators/index.js +0 -673
  147. package/dist/generators/index.js.map +0 -1
  148. package/dist/generators/prompts.d.ts +0 -13
  149. package/dist/generators/prompts.js +0 -276
  150. package/dist/generators/prompts.js.map +0 -1
  151. package/dist/generators/registry.d.ts +0 -8
  152. package/dist/generators/registry.js +0 -50
  153. package/dist/generators/registry.js.map +0 -1
  154. package/dist/scanners/dependencies.d.ts +0 -7
  155. package/dist/scanners/dependencies.js +0 -195
  156. package/dist/scanners/dependencies.js.map +0 -1
  157. package/dist/scanners/index.d.ts +0 -6
  158. package/dist/scanners/index.js +0 -37
  159. package/dist/scanners/index.js.map +0 -1
  160. package/dist/scanners/samples.d.ts +0 -8
  161. package/dist/scanners/samples.js +0 -193
  162. package/dist/scanners/samples.js.map +0 -1
  163. package/dist/scanners/stack.d.ts +0 -5
  164. package/dist/scanners/stack.js +0 -294
  165. package/dist/scanners/stack.js.map +0 -1
  166. package/dist/scanners/structure.d.ts +0 -5
  167. package/dist/scanners/structure.js +0 -274
  168. package/dist/scanners/structure.js.map +0 -1
  169. package/dist/services/grepai.d.ts +0 -25
  170. package/dist/services/grepai.js +0 -89
  171. package/dist/services/grepai.js.map +0 -1
  172. package/dist/services/ollama.d.ts +0 -22
  173. package/dist/services/ollama.js +0 -86
  174. package/dist/services/ollama.js.map +0 -1
  175. package/dist/services/package-manager.d.ts +0 -95
  176. package/dist/services/package-manager.js +0 -164
  177. package/dist/services/package-manager.js.map +0 -1
  178. package/dist/types.d.ts +0 -239
  179. package/dist/types.js +0 -5
  180. package/dist/types.js.map +0 -1
  181. package/templates/_backup_20260206/CLAUDE.md +0 -633
  182. package/templates/_backup_20260206/enforcement.md +0 -320
  183. package/templates/_backup_20260206/mustard/approve.md +0 -245
  184. package/templates/_backup_20260206/mustard/bugfix-team.md +0 -325
  185. package/templates/_backup_20260206/mustard/bugfix.md +0 -225
  186. package/templates/_backup_20260206/mustard/checkpoint.md +0 -287
  187. package/templates/_backup_20260206/mustard/commit-push.md +0 -64
  188. package/templates/_backup_20260206/mustard/commit.md +0 -102
  189. package/templates/_backup_20260206/mustard/compile-context.md +0 -160
  190. package/templates/_backup_20260206/mustard/complete.md +0 -374
  191. package/templates/_backup_20260206/mustard/feature-team.md +0 -285
  192. package/templates/_backup_20260206/mustard/feature.md +0 -258
  193. package/templates/_backup_20260206/mustard/install-deps.md +0 -144
  194. package/templates/_backup_20260206/mustard/merge-main.md +0 -91
  195. package/templates/_backup_20260206/mustard/report-daily.md +0 -70
  196. package/templates/_backup_20260206/mustard/report-weekly.md +0 -95
  197. package/templates/_backup_20260206/mustard/resume.md +0 -316
  198. package/templates/_backup_20260206/mustard/scan.md +0 -144
  199. package/templates/_backup_20260206/mustard/status.md +0 -81
  200. package/templates/_backup_20260206/mustard/sync-context.md +0 -317
  201. package/templates/_backup_20260206/mustard/sync-registry.md +0 -112
  202. package/templates/_backup_20260206/mustard/task-analyze.md +0 -138
  203. package/templates/_backup_20260206/mustard/task-docs.md +0 -194
  204. package/templates/_backup_20260206/mustard/task-refactor.md +0 -233
  205. package/templates/_backup_20260206/mustard/task-review.md +0 -163
  206. package/templates/_backup_20260206/mustard/validate.md +0 -160
  207. package/templates/_backup_20260206/pipeline.md +0 -482
  208. package/templates/commands/README.md +0 -55
  209. package/templates/commands/mustard/approve.md +0 -150
  210. package/templates/commands/mustard/bugfix-team.md +0 -325
  211. package/templates/commands/mustard/bugfix.md +0 -225
  212. package/templates/commands/mustard/checkpoint.md +0 -207
  213. package/templates/commands/mustard/commit-push.md +0 -64
  214. package/templates/commands/mustard/commit.md +0 -102
  215. package/templates/commands/mustard/compile-context.md +0 -234
  216. package/templates/commands/mustard/complete.md +0 -374
  217. package/templates/commands/mustard/feature-team.md +0 -285
  218. package/templates/commands/mustard/feature.md +0 -190
  219. package/templates/commands/mustard/install-deps.md +0 -144
  220. package/templates/commands/mustard/merge-main.md +0 -91
  221. package/templates/commands/mustard/report-daily.md +0 -70
  222. package/templates/commands/mustard/report-weekly.md +0 -95
  223. package/templates/commands/mustard/resume.md +0 -316
  224. package/templates/commands/mustard/scan.md +0 -144
  225. package/templates/commands/mustard/status.md +0 -81
  226. package/templates/commands/mustard/sync-context.md +0 -317
  227. package/templates/commands/mustard/sync-registry.md +0 -112
  228. package/templates/commands/mustard/task-analyze.md +0 -138
  229. package/templates/commands/mustard/task-docs.md +0 -194
  230. package/templates/commands/mustard/task-refactor.md +0 -233
  231. package/templates/commands/mustard/task-review.md +0 -163
  232. package/templates/commands/mustard/validate.md +0 -160
  233. package/templates/context/README.md +0 -97
  234. package/templates/context/backend/patterns.md +0 -136
  235. package/templates/context/bugfix/.gitkeep +0 -0
  236. package/templates/context/database/patterns.md +0 -117
  237. package/templates/context/frontend/patterns.md +0 -79
  238. package/templates/context/orchestrator/.gitkeep +0 -0
  239. package/templates/context/review/.gitkeep +0 -0
  240. package/templates/context/shared/conventions.md +0 -52
  241. package/templates/context/team-lead/README.md +0 -39
  242. package/templates/context/team-lead/coordination.md +0 -103
  243. package/templates/context/team-lead/task-list.md +0 -126
  244. package/templates/core/enforcement.md +0 -290
  245. package/templates/core/entity-registry-spec.md +0 -193
  246. package/templates/core/pipeline.md +0 -482
  247. package/templates/hooks/enforce-context.js +0 -202
  248. package/templates/hooks/enforce-grepai.js +0 -30
  249. package/templates/hooks/enforce-pipeline.js +0 -89
  250. package/templates/hooks/l0-enforcement.md +0 -133
  251. package/templates/prompts/_index.md +0 -148
  252. package/templates/prompts/backend.md +0 -141
  253. package/templates/prompts/bugfix.md +0 -163
  254. package/templates/prompts/database.md +0 -148
  255. package/templates/prompts/frontend.md +0 -151
  256. package/templates/prompts/naming.md +0 -225
  257. package/templates/prompts/orchestrator.md +0 -248
  258. package/templates/prompts/report.md +0 -165
  259. package/templates/prompts/review.md +0 -208
  260. package/templates/prompts/team-lead.md +0 -240
  261. package/templates/skills/design-principles.md +0 -237
  262. /package/templates/{context/.gitkeep โ†’ skills/skill-creator/scripts/__init__.py} +0 -0
@@ -1,320 +0,0 @@
1
- # Enforcement Rules
2
-
3
- > Mandatory rules for Mustard v3.0 (stack-agnostic).
4
- > Pipeline enforcement via memory MCP.
5
-
6
- ## Enforcement Matrix
7
-
8
- | Level | Rule | Description | Details in |
9
- |-------|------|-------------|------------|
10
- | L0 | Delegation | Main Claude does NOT implement code | This file |
11
- | L1 | grepai | Prefer grepai for semantic search | This file |
12
- | L2 | Pipeline | Pipeline mandatory for features/bugs | This file |
13
- | L3 | Naming | Follow naming conventions | `prompts/naming.md` |
14
- | L4 | Validation | Code must pass static validation | `prompts/review.md` |
15
- | L5 | Build | Project must compile/run | `prompts/review.md` |
16
- | L6 | Registry | Sync registry after creating entities | `commands/sync-registry.md` |
17
-
18
- ---
19
-
20
- ## L0 - Mandatory Delegation
21
-
22
- ### Rule L0
23
-
24
- > โ›” Main Claude does NOT implement code. ALWAYS delegate via Task.
25
-
26
- ### Self-Check
27
-
28
- Before using **Write**, **Edit**, or **Bash** (for code):
29
-
30
- ```text
31
- Question: "Am I inside an agent (Task)?"
32
-
33
- If YES โ†’ Continue
34
- If NO โ†’ STOP and DELEGATE
35
- ```
36
-
37
- ### Delegation Map
38
-
39
- | Request | subagent_type | model | Prompt |
40
- |---------|---------------|-------|--------|
41
- | Bug fix | `general-purpose` | opus | `prompts/bugfix.md` |
42
- | New feature | `general-purpose` | opus | `prompts/orchestrator.md` |
43
- | Backend | `general-purpose` | opus | `prompts/backend.md` |
44
- | Frontend | `general-purpose` | opus | `prompts/frontend.md` |
45
- | Database | `general-purpose` | opus | `prompts/database.md` |
46
- | QA/Review | `general-purpose` | opus | `prompts/review.md` |
47
- | Explore | `Explore` | haiku | (native) |
48
-
49
- ### Correct L0 Example
50
-
51
- ```text
52
- User: "Add email field to Person"
53
-
54
- Main Claude:
55
- 1. Identify: It's an entity modification (feature)
56
- 2. Delegate: Task(subagent_type="general-purpose", model="opus", prompt="[orchestrator]...")
57
- 3. Return: Result to user
58
- ```
59
-
60
- ### Incorrect L0 Example
61
-
62
- ```text
63
- User: "Add email field to Person"
64
-
65
- Main Claude:
66
- 1. Read Person.cs
67
- 2. START EDITING โ† โ›” L0 VIOLATION
68
- ```
69
-
70
- ---
71
-
72
- ## L1 - Mandatory grepai
73
-
74
- ### Rule L1
75
-
76
- > โ›” **Grep and Glob are BLOCKED by the `enforce-grepai.js` hook.**
77
- > Use ONLY grepai for ALL code searches.
78
-
79
- ### Hook L1
80
-
81
- ```text
82
- mustard/cli/templates/hooks/enforce-grepai.js
83
- ```
84
-
85
- - **Trigger:** Attempt to use Grep or Glob
86
- - **Action:** BLOCKS with permissionDecision: "deny"
87
- - **No exceptions**
88
-
89
- ### Correct L1 Usage
90
-
91
- ```javascript
92
- // Semantic search
93
- grepai_search({ query: "authentication flow" })
94
-
95
- // Call tracing
96
- grepai_trace_callers({ symbol: "SaveContract" })
97
- grepai_trace_callees({ symbol: "ValidateUser" })
98
- grepai_trace_graph({ symbol: "ProcessPayment", depth: 2 })
99
- ```
100
-
101
- ### BLOCKED L1 Usage
102
-
103
- ```bash
104
- # โ›” AUTOMATICALLY BLOCKED by hook
105
- grep -r "authentication" . # โ›” BLOCKED
106
- Glob("**/*.tsx") # โ›” BLOCKED
107
- ```
108
-
109
- ### Why grepai?
110
-
111
- | Tool | Problem |
112
- |------|---------|
113
- | Grep | Simple text search, many false positives |
114
- | Glob | Only finds by filename |
115
- | grepai | Semantic search, understands context and intent |
116
-
117
- ---
118
-
119
- ## L2 - Mandatory Pipeline (Memory MCP)
120
-
121
- ### Rule L2
122
-
123
- > Every feature/bugfix goes through the pipeline, with state persisted via memory MCP.
124
-
125
- ### Hook L2
126
-
127
- ```text
128
- mustard/cli/templates/hooks/enforce-pipeline.js
129
- ```
130
-
131
- - **Trigger:** Edit/Write on code files
132
- - **Action:** Asks for confirmation (ask), Claude checks memory MCP
133
- - **Exceptions:** .md, .json, .yaml, .claude/, mustard/, spec/
134
-
135
- ### Pipeline Phases
136
-
137
- ```text
138
- explore โ†’ (spec approved) โ†’ implement โ†’ (validation) โ†’ completed
139
- ```
140
-
141
- | Phase | Action | Edits Allowed |
142
- |-------|--------|---------------|
143
- | explore | Analysis, create spec | โŒ Code blocked |
144
- | implement | Implementation | โœ… Code allowed |
145
- | completed | Pipeline finished | (new pipeline needed) |
146
-
147
- ### Verification via Memory MCP
148
-
149
- ```javascript
150
- // When receiving message
151
- const result = await mcp__memory__search_nodes({
152
- query: "pipeline phase"
153
- });
154
-
155
- // Check phase
156
- if (result.entities.length === 0) {
157
- // No pipeline โ†’ free analysis, edits blocked
158
- }
159
- if (result.entities[0].observations.includes("phase: implement")) {
160
- // Edits allowed
161
- }
162
- ```
163
-
164
- ### Pipeline Commands
165
-
166
- | Command | Phase | Action |
167
- |---------|-------|--------|
168
- | `/feature` | โ†’ explore | Creates pipeline in memory |
169
- | `/approve` | explore โ†’ implement | Enables edits |
170
- | `/validate` | implement | Checks build/type-check |
171
- | `/complete` | implement โ†’ done | Cleans pipeline |
172
- | `/resume` | (any) | Loads context |
173
-
174
- ### Forbidden in L2
175
-
176
- - Edit code without active pipeline
177
- - Edit code in "explore" phase
178
- - Skip spec approval
179
-
180
- ---
181
-
182
- ## L3 - Naming Conventions
183
-
184
- ### Rule L3
185
-
186
- > Every implementation MUST follow project naming conventions.
187
-
188
- **Full details in:** [prompts/naming.md](../prompts/naming.md)
189
-
190
- ### Quick Summary
191
-
192
- | Type | Pattern | Example |
193
- |------|---------|---------|
194
- | Entity | PascalCase singular | `Contract` |
195
- | DB Table | snake_case plural | `contracts` |
196
- | Endpoint | kebab-case | `/api/contracts` |
197
- | Hook | use + camelCase | `useContracts` |
198
-
199
- ---
200
-
201
- ## L4 - Validation
202
-
203
- ### Rule L4
204
-
205
- > Code must pass static validation (lint, type-check).
206
-
207
- **Details in:** [prompts/review.md](../prompts/review.md)
208
-
209
- Validation command depends on project stack:
210
-
211
- | Stack | Command |
212
- |-------|---------|
213
- | TypeScript | `tsc --noEmit` or `pnpm type-check` |
214
- | Python | `mypy` or `pyright` |
215
- | Go | `go vet` |
216
- | Rust | `cargo check` |
217
-
218
- ---
219
-
220
- ## L5 - Build
221
-
222
- ### Rule L5
223
-
224
- > Project must compile/run without errors.
225
-
226
- **Details in:** [prompts/review.md](../prompts/review.md)
227
-
228
- Build command depends on stack:
229
-
230
- | Stack | Command |
231
- |-------|---------|
232
- | .NET | `dotnet build` |
233
- | Node.js | `npm run build` or `pnpm build` |
234
- | Python | `python -m py_compile` |
235
- | Go | `go build` |
236
- | Rust | `cargo build` |
237
-
238
- ---
239
-
240
- ## L6 - Entity Registry
241
-
242
- ### Rule L6
243
-
244
- > After creating/modifying entities, update the registry.
245
-
246
- ```bash
247
- /sync-registry
248
- ```
249
-
250
- **Details in:** [entity-registry-spec.md](./entity-registry-spec.md)
251
-
252
- ---
253
-
254
- ## L7-L9 - SOLID Architecture (.NET)
255
-
256
- > These rules apply to .NET projects with Entity Framework.
257
- > Adapt according to your project's stack.
258
-
259
- ### L7 - Service Does NOT Access DbContext
260
-
261
- > Service does NOT inject DbContext directly. Uses Repository + UnitOfWork.
262
-
263
- ```csharp
264
- // CORRECT
265
- public class ContractService(IContractRepository repository, IUnitOfWork unitOfWork) { }
266
-
267
- // WRONG - L7 VIOLATION
268
- public class ContractService(AppDbContext dbContext) { }
269
- ```
270
-
271
- **Exception:** GraphQL Resolvers can access DbContext directly (HotChocolate pattern).
272
-
273
- ### L8 - Service Only Injects Its OWN Repository
274
-
275
- > Service should only inject its own Repository. Use Services for cross-entity access.
276
-
277
- ```csharp
278
- // CORRECT
279
- public class ContractService(IContractRepository repository, IPartnerService partnerService) { }
280
-
281
- // WRONG - L8 VIOLATION
282
- public class ContractService(IContractRepository repository, IPartnerRepository partnerRepo) { }
283
- ```
284
-
285
- ### L9 - Prefer Segregated Interfaces (ISP)
286
-
287
- > Use specific interfaces when possible for better decoupling.
288
-
289
- ```csharp
290
- // RECOMMENDED - Specific interface
291
- public static Task<IResult> GetContract(Guid id, IContractQueryService service) { }
292
-
293
- // Interface composition
294
- public interface IContractService : IContractQueryService, IContractApprovalService { }
295
- ```
296
-
297
- ---
298
-
299
- ## Visual Summary
300
-
301
- ```text
302
- L0: Delegation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
303
- L1: grepai โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค ENGINE
304
- L2: Pipeline โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค (core/)
305
- โ”‚
306
- L3: Naming โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
307
- L4: Validation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค CONVENTIONS
308
- L5: Build โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค (prompts/)
309
- L6: Registry โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
310
- ```
311
-
312
- ---
313
-
314
- ## See Also
315
-
316
- - [prompts/naming.md](../prompts/naming.md) - Naming conventions (L3)
317
- - [prompts/review.md](../prompts/review.md) - Validation and build (L4/L5)
318
- - [prompts/backend.md](../prompts/backend.md) - Backend architecture patterns
319
- - [pipeline.md](./pipeline.md) - Complete pipeline
320
- - [entity-registry-spec.md](./entity-registry-spec.md) - Registry spec (L6)
@@ -1,245 +0,0 @@
1
- # /approve - Approve Spec
2
-
3
- > Approves the current spec and enables the implementation phase.
4
- > **v2.6** - Context Reset integration
5
-
6
- ## Usage
7
-
8
- ```
9
- /approve
10
- /approve [comment]
11
- /approve --no-reset # Skip context reset suggestion
12
- ```
13
-
14
- ## What It Does
15
-
16
- 1. **Searches** for active pipeline via memory MCP
17
- 2. **Validates** that there is a spec pending approval
18
- 3. **Saves** exploration checkpoint to memory (auto)
19
- 4. **Updates** phase to "implement"
20
- 5. **Suggests** context reset for clean implementation
21
- 6. **Enables** code edits
22
-
23
- ## Implementation (Memory MCP)
24
-
25
- ```javascript
26
- // 1. Search for active pipeline
27
- const result = await mcp__memory__search_nodes({
28
- query: "pipeline phase explore"
29
- });
30
-
31
- if (!result.entities.length) {
32
- return "โš ๏ธ No active pipeline found. Use /feature or /bugfix first.";
33
- }
34
-
35
- const pipeline = result.entities[0];
36
-
37
- // 2. Check phase
38
- if (!pipeline.observations.includes("phase: explore")) {
39
- return "โš ๏ธ Pipeline is not in explore phase. Use /resume to check status.";
40
- }
41
-
42
- // 3. AUTO: Save exploration checkpoint
43
- const checkpointEntity = `Checkpoint:${pipeline.name}:explore:${Date.now()}`;
44
-
45
- await mcp__memory__create_entities({
46
- entities: [{
47
- name: checkpointEntity,
48
- entityType: "Checkpoint",
49
- observations: [
50
- `pipeline: ${pipeline.name}`,
51
- `phase: explore`,
52
- `created: ${new Date().toISOString()}`,
53
- `type: auto-approve`,
54
- // Extract key insights from exploration:
55
- `discovered_files: ${explorationFindings.files.join(', ')}`,
56
- `patterns: ${explorationFindings.patterns.join('; ')}`,
57
- `dependencies: ${explorationFindings.dependencies.join('; ')}`
58
- ]
59
- }]
60
- });
61
-
62
- await mcp__memory__create_relations({
63
- relations: [{
64
- from: pipeline.name,
65
- to: checkpointEntity,
66
- relationType: "has_checkpoint"
67
- }]
68
- });
69
-
70
- // 4. Update to implement
71
- await mcp__memory__add_observations({
72
- observations: [{
73
- entityName: pipeline.name,
74
- contents: [
75
- `phase: implement`,
76
- `approved: ${new Date().toISOString()}`,
77
- `approved_by: user`,
78
- `exploration_checkpoint: ${checkpointEntity}`
79
- ]
80
- }]
81
- });
82
- ```
83
-
84
- ### Return Message
85
-
86
- ```javascript
87
- return `โœ… Spec approved!
88
-
89
- Pipeline: ${pipeline.name}
90
- Phase: implement (edits enabled)
91
-
92
- ## ๐Ÿ’พ Exploration Checkpoint Saved
93
-
94
- Your exploration findings have been saved to memory:
95
- - Discovered files: ${explorationFindings.files.length}
96
- - Patterns identified: ${explorationFindings.patterns.length}
97
- - Dependencies mapped: ${explorationFindings.dependencies.length}
98
-
99
- Checkpoint: ${checkpointEntity}
100
-
101
- ---
102
-
103
- ## ๐Ÿงน CONTEXT RESET RECOMMENDED
104
-
105
- The exploration phase accumulated context in this conversation.
106
- For optimal implementation performance, consider resetting:
107
-
108
- **Option 1: Reset now (recommended)**
109
- Reply with: "reset" or use \`/checkpoint --reset\`
110
-
111
- **Option 2: Continue in current context**
112
- Reply with: "continue"
113
-
114
- ---
115
-
116
- ## โš ๏ธ CRITICAL: Delegation Required
117
-
118
- You MUST delegate implementation via Task tool. DO NOT implement in this context.
119
-
120
- ### Analyze Spec Dependencies
121
-
122
- 1. Read the spec file to identify layers: Backend, Frontend, Database
123
- 2. Check if Frontend depends on NEW Backend types (sequential) or existing (parallel)
124
-
125
- ### Execute Implementation
126
-
127
- **If NO dependencies between layers (parallel):**
128
- Call MULTIPLE Tasks in ONE message:
129
- - Task({ description: "โš™๏ธ Backend {name}" })
130
- - Task({ description: "๐ŸŽจ Frontend {name}" })
131
-
132
- **If Frontend needs NEW Backend types (sequential):**
133
- 1. Task({ description: "โš™๏ธ Backend {name}" }) โ†’ WAIT for completion
134
- 2. Task({ description: "๐ŸŽจ Frontend {name}" }) โ†’ After backend done
135
-
136
- ### After All Tasks Complete
137
- 1. Use /validate to verify
138
- 2. Use /complete to finalize`;
139
- ```
140
-
141
- ## Flow
142
-
143
- ```text
144
- /feature name
145
- โ†“
146
- EXPLORE (grepai + analysis)
147
- โ†“
148
- SPEC (create spec.md)
149
- โ†“
150
- "Spec ready. Approve?"
151
- โ†“
152
- /approve โ† YOU ARE HERE
153
- โ”‚
154
- โ”œโ”€โ”€ AUTO: Save exploration checkpoint
155
- โ”œโ”€โ”€ SUGGEST: Context reset
156
- โ”‚
157
- โ†“
158
- IMPLEMENT (clean context)
159
- โ†“
160
- /validate
161
- โ†“
162
- /complete
163
- ```
164
-
165
- ## Checks
166
-
167
- | Condition | Result |
168
- | --------- | ------ |
169
- | No active pipeline | โš ๏ธ Error - use /feature |
170
- | Pipeline in "implement" | โš ๏ธ Already approved |
171
- | Pipeline in "explore" | โœ… Approve + checkpoint |
172
-
173
- ## Output
174
-
175
- ### Success
176
-
177
- ```text
178
- โœ… Spec approved!
179
-
180
- Pipeline: add-email-partner
181
- Phase: implement (edits enabled)
182
-
183
- ๐Ÿ’พ Exploration Checkpoint Saved
184
- - Discovered files: 12
185
- - Patterns identified: 3
186
- - Dependencies mapped: 5
187
-
188
- ๐Ÿงน CONTEXT RESET RECOMMENDED
189
- Reply "reset" to clear context, or "continue" to proceed.
190
-
191
- โš ๏ธ CRITICAL: Delegation Required
192
- You MUST delegate via Task tool. DO NOT implement in this context.
193
- ```
194
-
195
- ### Error - No Pipeline
196
-
197
- ```text
198
- โš ๏ธ No active pipeline found.
199
-
200
- Use /feature <name> or /bugfix <error> to start.
201
- ```
202
-
203
- ### Error - Already Approved
204
-
205
- ```text
206
- โš ๏ธ Pipeline already in implement phase.
207
-
208
- Use /resume to check current status.
209
- Use /validate to validate implementation.
210
- Use /complete to finalize.
211
- ```
212
-
213
- ## Context Reset Behavior
214
-
215
- When user replies "reset" after approval:
216
-
217
- 1. **Saves** final exploration summary to checkpoint
218
- 2. **Clears** conversation context (new turn starts fresh)
219
- 3. **User types** `/resume` to continue with clean context
220
- 4. **Resume loads** checkpoint + spec + checklist
221
-
222
- ### Why Reset?
223
-
224
- | Benefit | Description |
225
- | ------- | ----------- |
226
- | Clean context | Implementation starts without exploration noise |
227
- | Better focus | Agent sees only spec + patterns, not exploration history |
228
- | Token efficiency | More room for implementation details |
229
- | Reduced confusion | No old exploration paths to confuse implementation |
230
-
231
- ## Notes
232
-
233
- - Only **one active pipeline** at a time
234
- - After approval, code edits are allowed
235
- - The `enforce-pipeline.js` hook checks phase via memory MCP
236
- - To reject spec and return to exploration, use a negative comment
237
- - **NEW**: Exploration checkpoint saved automatically
238
- - **NEW**: Context reset recommended for clean implementation
239
-
240
- ## See Also
241
-
242
- - [/feature](./feature.md) - Start feature pipeline
243
- - [/resume](./resume.md) - Resume pipeline (loads from checkpoint)
244
- - [/complete](./complete.md) - Finalize pipeline
245
- - [/checkpoint](./checkpoint.md) - Manual checkpoint (optional)