@monoes/monomindcli 2.9.7 → 2.9.9

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 (295) hide show
  1. package/.claude/agents/design/design-monodesign.md +1 -2
  2. package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +1 -2
  3. package/.claude/agents/engineering/engineering-ai-engineer.md +1 -2
  4. package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -1
  5. package/.claude/agents/engineering/engineering-backend-architect.md +1 -2
  6. package/.claude/agents/engineering/engineering-code-reviewer.md +1 -2
  7. package/.claude/agents/engineering/engineering-data-engineer.md +1 -2
  8. package/.claude/agents/engineering/engineering-database-optimizer.md +1 -2
  9. package/.claude/agents/engineering/engineering-devops-automator.md +1 -2
  10. package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +1 -2
  11. package/.claude/agents/engineering/engineering-feishu-integration-developer.md +1 -2
  12. package/.claude/agents/engineering/engineering-frontend-developer.md +1 -2
  13. package/.claude/agents/engineering/engineering-git-workflow-master.md +1 -2
  14. package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -1
  15. package/.claude/agents/engineering/engineering-mobile-app-builder.md +1 -2
  16. package/.claude/agents/engineering/engineering-rapid-prototyper.md +1 -2
  17. package/.claude/agents/engineering/engineering-security-engineer.md +1 -2
  18. package/.claude/agents/engineering/engineering-senior-developer.md +1 -2
  19. package/.claude/agents/engineering/engineering-software-architect.md +1 -2
  20. package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +1 -2
  21. package/.claude/agents/engineering/engineering-sre.md +0 -1
  22. package/.claude/agents/engineering/engineering-technical-writer.md +1 -2
  23. package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -1
  24. package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +1 -2
  25. package/.claude/agents/github/code-review-swarm.md +0 -1
  26. package/.claude/agents/github/github-modes.md +0 -1
  27. package/.claude/agents/github/issue-tracker.md +0 -1
  28. package/.claude/agents/github/multi-repo-swarm.md +0 -1
  29. package/.claude/agents/github/pr-manager.md +0 -1
  30. package/.claude/agents/github/project-board-sync.md +0 -1
  31. package/.claude/agents/github/release-manager.md +0 -1
  32. package/.claude/agents/github/repo-architect.md +0 -1
  33. package/.claude/agents/github/swarm-issue.md +0 -1
  34. package/.claude/agents/github/swarm-pr.md +0 -1
  35. package/.claude/agents/github/sync-coordinator.md +0 -1
  36. package/.claude/agents/github/workflow-automation.md +0 -1
  37. package/.claude/agents/marketing/marketing-competitive-content.md +1 -2
  38. package/.claude/agents/marketing/marketing-cro-specialist.md +1 -2
  39. package/.claude/agents/marketing/marketing-email-specialist.md +1 -2
  40. package/.claude/agents/marketing/marketing-launch-strategist.md +1 -2
  41. package/.claude/agents/marketing/marketing-pricing-strategist.md +1 -2
  42. package/.claude/agents/specialized/agentic-identity-trust.md +0 -1
  43. package/.claude/agents/specialized/agents-orchestrator.md +1 -2
  44. package/.claude/agents/specialized/automation-governance-architect.md +1 -2
  45. package/.claude/agents/specialized/blockchain-security-auditor.md +1 -2
  46. package/.claude/agents/specialized/compliance-auditor.md +1 -2
  47. package/.claude/agents/specialized/identity-graph-operator.md +0 -1
  48. package/.claude/agents/specialized/lsp-index-engineer.md +1 -2
  49. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -1
  50. package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -1
  51. package/.claude/agents/specialized/specialized-developer-advocate.md +1 -2
  52. package/.claude/agents/specialized/specialized-document-generator.md +1 -2
  53. package/.claude/agents/specialized/specialized-mcp-builder.md +1 -2
  54. package/.claude/agents/specialized/specialized-model-qa.md +0 -1
  55. package/.claude/agents/specialized/specialized-workflow-architect.md +1 -2
  56. package/.claude/agents/specialized/zk-steward.md +1 -2
  57. package/.claude/agents/testing/production-validator.md +0 -1
  58. package/.claude/agents/testing/tdd-london-swarm.md +0 -1
  59. package/.claude/agents/testing/testing-accessibility-auditor.md +0 -1
  60. package/.claude/agents/testing/testing-api-tester.md +1 -2
  61. package/.claude/agents/testing/testing-evidence-collector.md +1 -2
  62. package/.claude/agents/testing/testing-performance-benchmarker.md +1 -2
  63. package/.claude/agents/testing/testing-test-results-analyzer.md +1 -2
  64. package/.claude/agents/testing/testing-tool-evaluator.md +1 -2
  65. package/.claude/agents/testing/testing-workflow-optimizer.md +1 -2
  66. package/.claude/commands/hooks/README.md +1 -1
  67. package/.claude/commands/memory/README.md +6 -7
  68. package/.claude/commands/monitoring/README.md +1 -1
  69. package/.claude/helpers/control-start.cjs +37 -8
  70. package/.claude/helpers/handlers/route-handler.cjs +22 -3
  71. package/.claude/helpers/handlers/session-handler.cjs +43 -0
  72. package/.claude/helpers/intelligence.cjs +27 -6
  73. package/.claude/helpers/statusline.cjs +45 -11
  74. package/.claude/skills/agentic-jujutsu/SKILL.md +17 -15
  75. package/.claude/skills/hive-mind-advanced/SKILL.md +212 -559
  76. package/.claude/skills/hooks-automation/SKILL.md +1 -1
  77. package/.claude/skills/mastermind-adapters/SKILL.md +0 -11
  78. package/.claude/skills/mastermind-agents/SKILL.md +0 -11
  79. package/.claude/skills/mastermind-backup/SKILL.md +0 -11
  80. package/.claude/skills/mastermind-bootstrap/SKILL.md +0 -11
  81. package/.claude/skills/mastermind-delegation/SKILL.md +14 -12
  82. package/.claude/skills/mastermind-idea/SKILL.md +0 -5
  83. package/.claude/skills/mastermind-monitor/SKILL.md +0 -15
  84. package/.claude/skills/mastermind-org-settings/SKILL.md +0 -11
  85. package/.claude/skills/mastermind-plugins/SKILL.md +0 -11
  86. package/.claude/skills/mastermind-protocol/SKILL.md +6 -124
  87. package/.claude/skills/mastermind-repeat/SKILL.md +0 -25
  88. package/.claude/skills/mastermind-review/SKILL.md +1 -1
  89. package/.claude/skills/mastermind-stoporg/SKILL.md +0 -19
  90. package/.claude/skills/memory-toolkit/SKILL.md +12 -11
  91. package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +8 -1
  92. package/.claude/skills/pair-programming/SKILL.md +1 -1
  93. package/.claude/skills/performance-analysis/SKILL.md +228 -484
  94. package/.claude/skills/specialagent/SKILL.md +31 -133
  95. package/.claude/skills/swarm-advanced/SKILL.md +2 -2
  96. package/.claude/skills/swarm-orchestration/SKILL.md +220 -150
  97. package/.claude/skills/verification-quality/SKILL.md +247 -571
  98. package/README.md +3 -3
  99. package/dist/src/commands/agent-lifecycle.js +3 -3
  100. package/dist/src/commands/agent-lifecycle.js.map +1 -1
  101. package/dist/src/commands/autopilot.d.ts.map +1 -1
  102. package/dist/src/commands/autopilot.js +7 -1
  103. package/dist/src/commands/autopilot.js.map +1 -1
  104. package/dist/src/commands/doc.d.ts.map +1 -1
  105. package/dist/src/commands/doc.js +14 -3
  106. package/dist/src/commands/doc.js.map +1 -1
  107. package/dist/src/commands/doctor-env-checks.d.ts +1 -1
  108. package/dist/src/commands/doctor-env-checks.d.ts.map +1 -1
  109. package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
  110. package/dist/src/commands/doctor-project-checks.js +3 -37
  111. package/dist/src/commands/doctor-project-checks.js.map +1 -1
  112. package/dist/src/commands/doctor.d.ts.map +1 -1
  113. package/dist/src/commands/doctor.js +30 -1
  114. package/dist/src/commands/doctor.js.map +1 -1
  115. package/dist/src/commands/hooks-coverage-commands.d.ts.map +1 -1
  116. package/dist/src/commands/hooks-coverage-commands.js +75 -67
  117. package/dist/src/commands/hooks-coverage-commands.js.map +1 -1
  118. package/dist/src/commands/hooks-workers.d.ts.map +1 -1
  119. package/dist/src/commands/hooks-workers.js +41 -10
  120. package/dist/src/commands/hooks-workers.js.map +1 -1
  121. package/dist/src/commands/hooks.js +1 -1
  122. package/dist/src/commands/index.d.ts +1 -1
  123. package/dist/src/commands/index.d.ts.map +1 -1
  124. package/dist/src/commands/index.js +20 -4
  125. package/dist/src/commands/index.js.map +1 -1
  126. package/dist/src/commands/init.d.ts.map +1 -1
  127. package/dist/src/commands/init.js +80 -7
  128. package/dist/src/commands/init.js.map +1 -1
  129. package/dist/src/commands/mcp.d.ts.map +1 -1
  130. package/dist/src/commands/mcp.js +78 -2
  131. package/dist/src/commands/mcp.js.map +1 -1
  132. package/dist/src/commands/neural-optimize.d.ts.map +1 -1
  133. package/dist/src/commands/neural-optimize.js +27 -5
  134. package/dist/src/commands/neural-optimize.js.map +1 -1
  135. package/dist/src/commands/org-observe.d.ts.map +1 -1
  136. package/dist/src/commands/org-observe.js +37 -30
  137. package/dist/src/commands/org-observe.js.map +1 -1
  138. package/dist/src/commands/org.d.ts.map +1 -1
  139. package/dist/src/commands/org.js +129 -2
  140. package/dist/src/commands/org.js.map +1 -1
  141. package/dist/src/commands/performance.js +1 -1
  142. package/dist/src/commands/performance.js.map +1 -1
  143. package/dist/src/commands/security-cve.d.ts.map +1 -1
  144. package/dist/src/commands/security-cve.js +1 -11
  145. package/dist/src/commands/security-cve.js.map +1 -1
  146. package/dist/src/commands/security-misc.d.ts +0 -9
  147. package/dist/src/commands/security-misc.d.ts.map +1 -1
  148. package/dist/src/commands/security-misc.js +33 -54
  149. package/dist/src/commands/security-misc.js.map +1 -1
  150. package/dist/src/commands/security-scan.d.ts.map +1 -1
  151. package/dist/src/commands/security-scan.js +3 -11
  152. package/dist/src/commands/security-scan.js.map +1 -1
  153. package/dist/src/commands/swarm.d.ts.map +1 -1
  154. package/dist/src/commands/swarm.js +7 -2
  155. package/dist/src/commands/swarm.js.map +1 -1
  156. package/dist/src/commands/ui.d.ts +8 -0
  157. package/dist/src/commands/ui.d.ts.map +1 -0
  158. package/dist/src/commands/ui.js +94 -0
  159. package/dist/src/commands/ui.js.map +1 -0
  160. package/dist/src/init/claudemd-generator.d.ts.map +1 -1
  161. package/dist/src/init/claudemd-generator.js +7 -9
  162. package/dist/src/init/claudemd-generator.js.map +1 -1
  163. package/dist/src/init/executor.d.ts.map +1 -1
  164. package/dist/src/init/executor.js +13 -3
  165. package/dist/src/init/executor.js.map +1 -1
  166. package/dist/src/init/kimi-generator.d.ts +3 -2
  167. package/dist/src/init/kimi-generator.d.ts.map +1 -1
  168. package/dist/src/init/kimi-generator.js +45 -13
  169. package/dist/src/init/kimi-generator.js.map +1 -1
  170. package/dist/src/init/statusline-generator.d.ts +1 -1
  171. package/dist/src/init/statusline-generator.js +1 -1
  172. package/dist/src/init/write-capabilities.js +7 -7
  173. package/dist/src/init/write-capabilities.js.map +1 -1
  174. package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
  175. package/dist/src/knowledge/document-pipeline.js +1 -0
  176. package/dist/src/knowledge/document-pipeline.js.map +1 -1
  177. package/dist/src/knowledge/eval/golden-set.d.ts.map +1 -1
  178. package/dist/src/knowledge/eval/golden-set.js +21 -32
  179. package/dist/src/knowledge/eval/golden-set.js.map +1 -1
  180. package/dist/src/mcp-tools/embeddings-tools.js +2 -2
  181. package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
  182. package/dist/src/mcp-tools/hooks-intelligence.d.ts.map +1 -1
  183. package/dist/src/mcp-tools/hooks-intelligence.js +29 -3
  184. package/dist/src/mcp-tools/hooks-intelligence.js.map +1 -1
  185. package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
  186. package/dist/src/mcp-tools/hooks-routing.js +32 -19
  187. package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
  188. package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -1
  189. package/dist/src/mcp-tools/monograph/query-tools.js +48 -18
  190. package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -1
  191. package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -1
  192. package/dist/src/mcp-tools/performance-tools.js +15 -10
  193. package/dist/src/mcp-tools/performance-tools.js.map +1 -1
  194. package/dist/src/memory/embedding-operations.d.ts +4 -0
  195. package/dist/src/memory/embedding-operations.d.ts.map +1 -1
  196. package/dist/src/memory/embedding-operations.js +125 -32
  197. package/dist/src/memory/embedding-operations.js.map +1 -1
  198. package/dist/src/memory/hnsw-operations.d.ts +1 -1
  199. package/dist/src/memory/hnsw-operations.js +1 -1
  200. package/dist/src/memory/memory-bridge.d.ts +8 -0
  201. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  202. package/dist/src/memory/memory-bridge.js +37 -8
  203. package/dist/src/memory/memory-bridge.js.map +1 -1
  204. package/dist/src/memory/memory-read.d.ts +1 -1
  205. package/dist/src/memory/memory-read.js +2 -2
  206. package/dist/src/memory/memory-read.js.map +1 -1
  207. package/dist/src/orgrt/antigravity-runner.d.ts.map +1 -1
  208. package/dist/src/orgrt/antigravity-runner.js +6 -6
  209. package/dist/src/orgrt/antigravity-runner.js.map +1 -1
  210. package/dist/src/orgrt/checkpoint-ops.d.ts +11 -1
  211. package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -1
  212. package/dist/src/orgrt/checkpoint-ops.js +18 -86
  213. package/dist/src/orgrt/checkpoint-ops.js.map +1 -1
  214. package/dist/src/orgrt/checkpoint.d.ts +1 -1
  215. package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
  216. package/dist/src/orgrt/checkpoint.js +3 -3
  217. package/dist/src/orgrt/checkpoint.js.map +1 -1
  218. package/dist/src/orgrt/daemon.d.ts +9 -1
  219. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  220. package/dist/src/orgrt/daemon.js +267 -139
  221. package/dist/src/orgrt/daemon.js.map +1 -1
  222. package/dist/src/orgrt/decisions.d.ts +13 -0
  223. package/dist/src/orgrt/decisions.d.ts.map +1 -1
  224. package/dist/src/orgrt/decisions.js +95 -0
  225. package/dist/src/orgrt/decisions.js.map +1 -1
  226. package/dist/src/orgrt/forwarder.d.ts.map +1 -1
  227. package/dist/src/orgrt/forwarder.js +148 -15
  228. package/dist/src/orgrt/forwarder.js.map +1 -1
  229. package/dist/src/orgrt/kimicode-runner.js +1 -1
  230. package/dist/src/orgrt/kimicode-runner.js.map +1 -1
  231. package/dist/src/orgrt/opencode-runner.js +1 -1
  232. package/dist/src/orgrt/opencode-runner.js.map +1 -1
  233. package/dist/src/orgrt/session.d.ts +27 -1
  234. package/dist/src/orgrt/session.d.ts.map +1 -1
  235. package/dist/src/orgrt/session.js +67 -6
  236. package/dist/src/orgrt/session.js.map +1 -1
  237. package/dist/src/orgrt/task-dag.d.ts +11 -1
  238. package/dist/src/orgrt/task-dag.d.ts.map +1 -1
  239. package/dist/src/orgrt/task-dag.js +93 -2
  240. package/dist/src/orgrt/task-dag.js.map +1 -1
  241. package/dist/src/orgrt/templates.d.ts.map +1 -1
  242. package/dist/src/orgrt/templates.js +26 -2
  243. package/dist/src/orgrt/templates.js.map +1 -1
  244. package/dist/src/orgrt/types.d.ts +77 -1
  245. package/dist/src/orgrt/types.d.ts.map +1 -1
  246. package/dist/src/orgrt/types.js +28 -2
  247. package/dist/src/orgrt/types.js.map +1 -1
  248. package/dist/src/orgrt/vercel-providers.d.ts.map +1 -1
  249. package/dist/src/orgrt/vercel-providers.js +9 -4
  250. package/dist/src/orgrt/vercel-providers.js.map +1 -1
  251. package/dist/src/orgrt/vercel-runner.d.ts +0 -23
  252. package/dist/src/orgrt/vercel-runner.d.ts.map +1 -1
  253. package/dist/src/orgrt/vercel-runner.js +38 -7
  254. package/dist/src/orgrt/vercel-runner.js.map +1 -1
  255. package/dist/tsconfig.tsbuildinfo +1 -1
  256. package/package.json +3 -3
  257. package/.claude/commands/mastermind/approvev1.md +0 -94
  258. package/.claude/commands/mastermind/architect.md +0 -52
  259. package/.claude/commands/mastermind/autodev.md +0 -28
  260. package/.claude/commands/mastermind/build.md +0 -23
  261. package/.claude/commands/mastermind/finish.md +0 -17
  262. package/.claude/commands/mastermind/runorgv1.md +0 -159
  263. package/.claude/commands/mastermind/taskdev.md +0 -23
  264. package/.claude/commands/mastermind/tdd.md +0 -19
  265. package/.claude/commands/mastermind/verify.md +0 -19
  266. package/.claude/skills/mastermind-approvev1/SKILL.md +0 -191
  267. package/.claude/skills/mastermind-architect/SKILL.md +0 -862
  268. package/.claude/skills/mastermind-autodev/SKILL.md +0 -360
  269. package/.claude/skills/mastermind-build/SKILL.md +0 -169
  270. package/.claude/skills/mastermind-companies/SKILL.md +0 -256
  271. package/.claude/skills/mastermind-content/SKILL.md +0 -197
  272. package/.claude/skills/mastermind-costs/SKILL.md +0 -151
  273. package/.claude/skills/mastermind-finance/SKILL.md +0 -166
  274. package/.claude/skills/mastermind-finish/SKILL.md +0 -251
  275. package/.claude/skills/mastermind-heartbeatv1/SKILL.md +0 -167
  276. package/.claude/skills/mastermind-instance-settings/SKILL.md +0 -315
  277. package/.claude/skills/mastermind-marketing/SKILL.md +0 -228
  278. package/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +0 -181
  279. package/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +0 -158
  280. package/.claude/skills/mastermind-ops/SKILL.md +0 -168
  281. package/.claude/skills/mastermind-org-chart/SKILL.md +0 -209
  282. package/.claude/skills/mastermind-project-detail/SKILL.md +0 -249
  283. package/.claude/skills/mastermind-project-workspace/SKILL.md +0 -244
  284. package/.claude/skills/mastermind-projects/SKILL.md +0 -167
  285. package/.claude/skills/mastermind-runorgv1/SKILL.md +0 -731
  286. package/.claude/skills/mastermind-sales/SKILL.md +0 -170
  287. package/.claude/skills/mastermind-taskdev/SKILL.md +0 -377
  288. package/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +0 -60
  289. package/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +0 -144
  290. package/.claude/skills/mastermind-taskdev/implementer-prompt.md +0 -114
  291. package/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +0 -80
  292. package/.claude/skills/mastermind-tdd/SKILL.md +0 -424
  293. package/.claude/skills/mastermind-verify/SKILL.md +0 -196
  294. package/.claude/skills/mastermind-wiki/SKILL.md +0 -314
  295. package/.claude/skills/monolean-review/SKILL.md +0 -57
@@ -1,424 +0,0 @@
1
- ---
2
- name: mastermind-tdd
3
- description: Use when writing new code, fixing bugs, or adding any production logic — enforces test-first discipline before touching implementation. Use ESPECIALLY when under time pressure or when a fix seems obvious.
4
- type: domain-skill
5
- default_mode: auto
6
- ---
7
-
8
- # Mastermind TDD
9
-
10
- This skill is invoked by `mastermind:master` or directly via `/mastermind:tdd`.
11
-
12
- Write the test first. Watch it fail. Write minimal code to pass.
13
-
14
- **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
15
-
16
- **Violating the letter of the rules is violating the spirit of the rules.**
17
-
18
- ---
19
-
20
- ## Inputs
21
-
22
- - `brain_context`: BRAIN CONTEXT block (injected by master, or loaded standalone via mastermind-protocol/SKILL.md brain load)
23
- - `prompt`: what feature or bug to implement with TDD
24
- - `project_name`: monotask space name
25
- - `board_id`: monotask board ID (set by master, or created standalone)
26
- - `mode`: auto | confirm
27
-
28
- ---
29
-
30
- ## When to Use
31
-
32
- **Always:**
33
- - New features
34
- - Bug fixes
35
- - Refactoring
36
- - Behavior changes
37
-
38
- **Exceptions (ask your human partner):**
39
- - Throwaway prototypes
40
- - Generated code
41
- - Configuration files
42
-
43
- Thinking "skip TDD just this once"? Stop. That's rationalization.
44
-
45
- ---
46
-
47
- ## The Iron Law
48
-
49
- ```
50
- NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
51
- ```
52
-
53
- Write code before the test? Delete it. Start over.
54
-
55
- **No exceptions:**
56
- - Don't keep it as "reference"
57
- - Don't "adapt" it while writing tests
58
- - Don't look at it
59
- - Delete means delete
60
-
61
- Implement fresh from tests. Period.
62
-
63
- ---
64
-
65
- ## Red-Green-Refactor
66
-
67
- ```
68
- RED → Write failing test
69
- ↓
70
- Verify fails correctly
71
- ↓ (wrong failure → back to RED)
72
- GREEN → Minimal code
73
- ↓
74
- Verify passes — all green
75
- ↓ (no → fix code, not test)
76
- REFACTOR → Clean up
77
- ↓
78
- Verify still green
79
- ↓
80
- Next RED
81
- ```
82
-
83
- ### RED — Write Failing Test
84
-
85
- Write one minimal test showing what should happen.
86
-
87
- **Good:**
88
- ```typescript
89
- test('retries failed operations 3 times', async () => {
90
- let attempts = 0;
91
- const operation = () => {
92
- attempts++;
93
- if (attempts < 3) throw new Error('fail');
94
- return 'success';
95
- };
96
-
97
- const result = await retryOperation(operation);
98
-
99
- expect(result).toBe('success');
100
- expect(attempts).toBe(3);
101
- });
102
- ```
103
- Clear name, tests real behavior, one thing.
104
-
105
- **Bad:**
106
- ```typescript
107
- test('retry works', async () => {
108
- const mock = jest.fn()
109
- .mockRejectedValueOnce(new Error())
110
- .mockRejectedValueOnce(new Error())
111
- .mockResolvedValueOnce('success');
112
- await retryOperation(mock);
113
- expect(mock).toHaveBeenCalledTimes(3);
114
- });
115
- ```
116
- Vague name, tests mock not code.
117
-
118
- **Requirements:**
119
- - One behavior
120
- - Clear name
121
- - Real code (no mocks unless unavoidable)
122
-
123
- ### Verify RED — Watch It Fail
124
-
125
- **MANDATORY. Never skip.**
126
-
127
- ```bash
128
- npm test path/to/test.test.ts
129
- ```
130
-
131
- Confirm:
132
- - Test fails (not errors)
133
- - Failure message is expected
134
- - Fails because feature is missing (not typos)
135
-
136
- **Test passes?** You're testing existing behavior. Fix test.
137
-
138
- **Test errors?** Fix error, re-run until it fails correctly.
139
-
140
- Invoke `Skill("mastermind-verify")` to gate this step: the RED verification must confirm the test fails for the expected reason.
141
-
142
- ### GREEN — Minimal Code
143
-
144
- Write simplest code to pass the test.
145
-
146
- **Good:**
147
- ```typescript
148
- async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
149
- for (let i = 0; i < 3; i++) {
150
- try {
151
- return await fn();
152
- } catch (e) {
153
- if (i === 2) throw e;
154
- }
155
- }
156
- throw new Error('unreachable');
157
- }
158
- ```
159
- Just enough to pass.
160
-
161
- **Bad:**
162
- ```typescript
163
- async function retryOperation<T>(
164
- fn: () => Promise<T>,
165
- options?: {
166
- maxRetries?: number;
167
- backoff?: 'linear' | 'exponential';
168
- onRetry?: (attempt: number) => void;
169
- }
170
- ): Promise<T> {
171
- // YAGNI
172
- }
173
- ```
174
- Over-engineered.
175
-
176
- Don't add features, refactor other code, or "improve" beyond the test.
177
-
178
- ### Verify GREEN — Watch It Pass
179
-
180
- **MANDATORY.**
181
-
182
- ```bash
183
- npm test path/to/test.test.ts
184
- ```
185
-
186
- Confirm:
187
- - Test passes
188
- - Other tests still pass
189
- - Output pristine (no errors, warnings)
190
-
191
- **Test fails?** Fix code, not test.
192
-
193
- **Other tests fail?** Fix now.
194
-
195
- Invoke `Skill("mastermind-verify")` to gate this step.
196
-
197
- ### REFACTOR — Clean Up
198
-
199
- After green only:
200
- - Remove duplication
201
- - Improve names
202
- - Extract helpers
203
-
204
- Keep tests green. Don't add behavior.
205
-
206
- ### Repeat
207
-
208
- Next failing test for next feature.
209
-
210
- ---
211
-
212
- ## Good Tests
213
-
214
- | Quality | Good | Bad |
215
- |---------|------|-----|
216
- | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
217
- | **Clear** | Name describes behavior | `test('test1')` |
218
- | **Shows intent** | Demonstrates desired API | Obscures what code should do |
219
-
220
- ---
221
-
222
- ## Why Order Matters
223
-
224
- **"I'll write tests after to verify it works"**
225
-
226
- Tests written after code pass immediately. Passing immediately proves nothing:
227
- - Might test wrong thing
228
- - Might test implementation, not behavior
229
- - Might miss edge cases you forgot
230
- - You never saw it catch the bug
231
-
232
- Test-first forces you to see the test fail, proving it actually tests something.
233
-
234
- **"I already manually tested all the edge cases"**
235
-
236
- Manual testing is ad-hoc. You think you tested everything but:
237
- - No record of what you tested
238
- - Can't re-run when code changes
239
- - Easy to forget cases under pressure
240
- - "It worked when I tried it" ≠ comprehensive
241
-
242
- Automated tests are systematic. They run the same way every time.
243
-
244
- **"Deleting X hours of work is wasteful"**
245
-
246
- Sunk cost fallacy. The time is already gone. Your choice now:
247
- - Delete and rewrite with TDD (X more hours, high confidence)
248
- - Keep it and add tests after (30 min, low confidence, likely bugs)
249
-
250
- The "waste" is keeping code you can't trust. Working code without real tests is technical debt.
251
-
252
- **"TDD is dogmatic, being pragmatic means adapting"**
253
-
254
- TDD IS pragmatic:
255
- - Finds bugs before commit (faster than debugging after)
256
- - Prevents regressions (tests catch breaks immediately)
257
- - Documents behavior (tests show how to use code)
258
- - Enables refactoring (change freely, tests catch breaks)
259
-
260
- "Pragmatic" shortcuts = debugging in production = slower.
261
-
262
- **"Tests after achieve the same goals — it's spirit not ritual"**
263
-
264
- No. Tests-after answer "What does this do?" Tests-first answer "What should this do?"
265
-
266
- Tests-after are biased by your implementation. You test what you built, not what's required. You verify remembered edge cases, not discovered ones.
267
-
268
- Tests-first force edge case discovery before implementing. Tests-after verify you remembered everything (you didn't).
269
-
270
- 30 minutes of tests after ≠ TDD. You get coverage, lose proof tests work.
271
-
272
- ---
273
-
274
- ## Common Rationalizations
275
-
276
- | Excuse | Reality |
277
- |--------|---------|
278
- | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
279
- | "I'll test after" | Tests passing immediately prove nothing. |
280
- | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
281
- | "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
282
- | "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
283
- | "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
284
- | "Need to explore first" | Fine. Throw away exploration, start with TDD. |
285
- | "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
286
- | "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. |
287
- | "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
288
- | "Existing code has no tests" | You're improving it. Add tests for existing code. |
289
-
290
- ---
291
-
292
- ## Red Flags — STOP and Start Over
293
-
294
- - Code before test
295
- - Test after implementation
296
- - Test passes immediately
297
- - Can't explain why test failed
298
- - Tests added "later"
299
- - Rationalizing "just this once"
300
- - "I already manually tested it"
301
- - "Tests after achieve the same purpose"
302
- - "It's about spirit not ritual"
303
- - "Keep as reference" or "adapt existing code"
304
- - "Already spent X hours, deleting is wasteful"
305
- - "TDD is dogmatic, I'm being pragmatic"
306
- - "This is different because..."
307
-
308
- **All of these mean: Delete code. Start over with TDD.**
309
-
310
- ---
311
-
312
- ## Example: Bug Fix
313
-
314
- **Bug:** Empty email accepted
315
-
316
- **RED**
317
- ```typescript
318
- test('rejects empty email', async () => {
319
- const result = await submitForm({ email: '' });
320
- expect(result.error).toBe('Email required');
321
- });
322
- ```
323
-
324
- **Verify RED**
325
- ```bash
326
- $ npm test
327
- FAIL: expected 'Email required', got undefined
328
- ```
329
-
330
- **GREEN**
331
- ```typescript
332
- function submitForm(data: FormData) {
333
- if (!data.email?.trim()) {
334
- return { error: 'Email required' };
335
- }
336
- // ...
337
- }
338
- ```
339
-
340
- **Verify GREEN**
341
- ```bash
342
- $ npm test
343
- PASS
344
- ```
345
-
346
- **REFACTOR**
347
- Extract validation for multiple fields if needed.
348
-
349
- ---
350
-
351
- ## Verification Checklist
352
-
353
- Before marking work complete — invoke `Skill("mastermind-verify")` to run this gate:
354
-
355
- - [ ] Every new function/method has a test
356
- - [ ] Watched each test fail before implementing
357
- - [ ] Each test failed for expected reason (feature missing, not typo)
358
- - [ ] Wrote minimal code to pass each test
359
- - [ ] All tests pass
360
- - [ ] Output pristine (no errors, warnings)
361
- - [ ] Tests use real code (mocks only if unavoidable)
362
- - [ ] Edge cases and errors covered
363
-
364
- Can't check all boxes? You skipped TDD. Start over.
365
-
366
- ---
367
-
368
- ## When Stuck
369
-
370
- | Problem | Solution |
371
- |---------|----------|
372
- | Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
373
- | Test too complicated | Design too complicated. Simplify interface. |
374
- | Must mock everything | Code too coupled. Use dependency injection. |
375
- | Test setup huge | Extract helpers. Still complex? Simplify design. |
376
-
377
- ---
378
-
379
- ## Testing Anti-Patterns
380
-
381
- Tests must verify real behavior, not mock behavior. Mocks are a means to isolate, not the thing being tested. **Test what the code does, not what the mocks do.**
382
-
383
- **The Iron Laws of mocking:**
384
-
385
- ```
386
- 1. NEVER test mock behavior
387
- 2. NEVER add test-only methods to production classes
388
- 3. NEVER mock without understanding dependencies
389
- ```
390
-
391
- | Anti-pattern | The violation | The fix |
392
- |---|---|---|
393
- | **Testing mock behavior** | Asserting a `*-mock` element or mocked return exists — the test verifies the mock works, not the component | Test the real component, or don't assert on the mock at all |
394
- | **Test-only methods in production** | A method (e.g. `destroy()`) that only tests call, living on a production class | Move it to test utilities; production classes carry only production API |
395
- | **Mocking without understanding** | Mocking a method whose side effect the test depends on ("I'll mock this to be safe") — the test passes for the wrong reason or fails mysteriously | Run the test against the real implementation FIRST, observe what it needs, then mock minimally at the lowest slow/external level |
396
- | **Incomplete mocks** | Mocking only the fields your immediate test uses — downstream code reads omitted fields and fails silently in integration | Mirror the COMPLETE real data structure; if uncertain, include all documented fields |
397
- | **Tests as afterthought** | "Implementation complete, ready for testing" | Testing is part of implementation — TDD, tests first |
398
-
399
- **Gate before any mock:** What side effects does the real method have? Does this test depend on any of them? Do I fully understand what this test needs? If unsure — run against the real implementation first.
400
-
401
- **When mocks become too complex** (setup longer than test logic, mock missing methods real components have, test breaks when mock changes): ask "do we need a mock here at all?" — integration tests with real components are often simpler than complex mocks.
402
-
403
- **Red flags:** assertions on `*-mock` IDs · methods only called from test files · mock setup >50% of the test · test fails when you remove the mock · can't explain why the mock is needed · mocking "just to be safe".
404
-
405
- If TDD reveals you're testing mock behavior, you added mocks without watching the test fail against real code first — test real behavior or question why you're mocking at all.
406
-
407
- ---
408
-
409
- ## Debugging Integration
410
-
411
- Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.
412
-
413
- Never fix bugs without a test.
414
-
415
- ---
416
-
417
- ## Final Rule
418
-
419
- ```
420
- Production code → test exists and failed first
421
- Otherwise → not TDD
422
- ```
423
-
424
- No exceptions without your human partner's permission.
@@ -1,196 +0,0 @@
1
- ---
2
- name: mastermind-verify
3
- description: Mastermind verification gate — enforces evidence-before-claims before any completion, commit, PR, or agent-delegation step. The Iron Law of verification.
4
- type: domain-skill
5
- default_mode: auto
6
- ---
7
-
8
- # Mastermind Verify
9
-
10
- This skill is invoked by `mastermind:master` or directly via `/mastermind:verify`.
11
-
12
- Claiming work is complete without verification is dishonesty, not efficiency.
13
-
14
- **Core principle:** Evidence before claims, always.
15
-
16
- **Violating the letter of this rule is violating the spirit of this rule.**
17
-
18
- ---
19
-
20
- ## Inputs
21
-
22
- - `brain_context`: BRAIN CONTEXT block (injected by master, or loaded standalone via mastermind-protocol/SKILL.md brain load)
23
- - `prompt`: what to verify and what claim is being made
24
- - `project_name`: monotask space name
25
- - `board_id`: monotask board ID (set by master, or created standalone)
26
- - `mode`: auto | confirm
27
-
28
- ---
29
-
30
- ## The Iron Law
31
-
32
- ```
33
- NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
34
- ```
35
-
36
- If you haven't run the verification command in this message, you cannot claim it passes.
37
-
38
- ---
39
-
40
- ## The Gate Function
41
-
42
- ```
43
- BEFORE claiming any status or expressing satisfaction:
44
-
45
- 1. IDENTIFY: What command proves this claim?
46
- 2. RUN: Execute the FULL command (fresh, complete)
47
- 3. READ: Full output, check exit code, count failures
48
- 4. VERIFY: Does output confirm the claim?
49
- - If NO: State actual status with evidence
50
- - If YES: State claim WITH evidence
51
- 5. ONLY THEN: Make the claim
52
-
53
- Skip any step = lying, not verifying
54
- ```
55
-
56
- ---
57
-
58
- ## Common Failures
59
-
60
- | Claim | Requires | Not Sufficient |
61
- |-------|----------|----------------|
62
- | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
63
- | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
64
- | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
65
- | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
66
- | Regression test works | Red-green cycle verified | Test passes once |
67
- | Agent completed | VCS diff shows changes | Agent reports "success" |
68
- | Requirements met | Line-by-line checklist | Tests passing |
69
-
70
- ---
71
-
72
- ## Red Flags - STOP
73
-
74
- - Using "should", "probably", "seems to"
75
- - Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
76
- - About to commit/push/PR without verification
77
- - Trusting agent success reports
78
- - Relying on partial verification
79
- - Thinking "just this once"
80
- - Tired and wanting work over
81
- - **ANY wording implying success without having run verification**
82
-
83
- ---
84
-
85
- ## Rationalization Prevention
86
-
87
- | Excuse | Reality |
88
- |--------|---------|
89
- | "Should work now" | RUN the verification |
90
- | "I'm confident" | Confidence ≠ evidence |
91
- | "Just this once" | No exceptions |
92
- | "Linter passed" | Linter ≠ compiler |
93
- | "Agent said success" | Verify independently |
94
- | "I'm tired" | Exhaustion ≠ excuse |
95
- | "Partial check is enough" | Partial proves nothing |
96
- | "Different words so rule doesn't apply" | Spirit over letter |
97
-
98
- ---
99
-
100
- ## Key Patterns
101
-
102
- **Tests:**
103
- ```
104
- ✅ [Run test command] [See: 34/34 pass] "All tests pass"
105
- ❌ "Should pass now" / "Looks correct"
106
- ```
107
-
108
- **Regression tests (TDD Red-Green):**
109
- ```
110
- ✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
111
- ❌ "I've written a regression test" (without red-green verification)
112
- ```
113
-
114
- **Build:**
115
- ```
116
- ✅ [Run build] [See: exit 0] "Build passes"
117
- ❌ "Linter passed" (linter doesn't check compilation)
118
- ```
119
-
120
- **Requirements:**
121
- ```
122
- ✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
123
- ❌ "Tests pass, phase complete"
124
- ```
125
-
126
- **Agent delegation:**
127
- ```
128
- ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
129
- ❌ Trust agent report
130
- ```
131
-
132
- ---
133
-
134
- ## Execution
135
-
136
- ### Complexity Assessment
137
-
138
- **Simple (direct verification):** Single command, one claim:
139
- - "Do the tests pass?"
140
- - "Does the build succeed?"
141
- - Run the command, report the output.
142
-
143
- **Complex (multi-gate verification):** Multiple claims or multi-step requirements:
144
- - "Is this feature complete?" → decompose into requirement checklist, run each gate
145
- - Spawn a Verification Coordinator if needed
146
-
147
- ### Steps
148
-
149
- 1. **Parse the claim or task being verified.** If the prompt is empty or vague, ask: "What claim or task needs verification?"
150
-
151
- 2. **Identify all verification gates.** For each claim, determine the exact command that proves or disproves it.
152
-
153
- 3. **Run each gate fresh.** Execute commands in this session. Do not rely on prior output.
154
-
155
- 4. **Collect evidence.** Exit code, line counts, failure messages, diff output.
156
-
157
- 5. **Report findings with evidence.** Never summarize without quoting relevant output.
158
-
159
- ---
160
-
161
- ## When To Apply
162
-
163
- **ALWAYS before:**
164
- - ANY variation of success/completion claims
165
- - ANY expression of satisfaction
166
- - ANY positive statement about work state
167
- - Committing, PR creation, task completion
168
- - Moving to next task
169
- - Delegating to agents
170
-
171
- **Rule applies to:**
172
- - Exact phrases
173
- - Paraphrases and synonyms
174
- - Implications of success
175
- - ANY communication suggesting completion/correctness
176
-
177
- ---
178
-
179
- ## Why This Matters
180
-
181
- From failure patterns:
182
- - Trust broken when claiming done without checking
183
- - Undefined functions shipped — would crash
184
- - Missing requirements shipped — incomplete features
185
- - Time wasted on false completion → redirect → rework
186
- - Violates: "Honesty is a core value. If you lie, you'll be replaced."
187
-
188
- ---
189
-
190
- ## The Bottom Line
191
-
192
- **No shortcuts for verification.**
193
-
194
- Run the command. Read the output. THEN claim the result.
195
-
196
- This is non-negotiable.