mindsystem-cc 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +501 -0
  3. package/agents/ms-codebase-mapper.md +739 -0
  4. package/agents/ms-debugger.md +1184 -0
  5. package/agents/ms-designer.md +414 -0
  6. package/agents/ms-executor.md +760 -0
  7. package/agents/ms-integration-checker.md +423 -0
  8. package/agents/ms-milestone-auditor.md +448 -0
  9. package/agents/ms-mock-generator.md +182 -0
  10. package/agents/ms-plan-checker.md +746 -0
  11. package/agents/ms-research-synthesizer.md +248 -0
  12. package/agents/ms-researcher.md +962 -0
  13. package/agents/ms-roadmapper.md +606 -0
  14. package/agents/ms-verifier.md +779 -0
  15. package/agents/ms-verify-fixer.md +124 -0
  16. package/bin/install.js +296 -0
  17. package/commands/ms/add-phase.md +207 -0
  18. package/commands/ms/add-todo.md +182 -0
  19. package/commands/ms/audit-milestone.md +318 -0
  20. package/commands/ms/check-phase.md +162 -0
  21. package/commands/ms/check-todos.md +217 -0
  22. package/commands/ms/complete-milestone.md +137 -0
  23. package/commands/ms/create-roadmap.md +273 -0
  24. package/commands/ms/debug.md +149 -0
  25. package/commands/ms/define-requirements.md +121 -0
  26. package/commands/ms/design-phase.md +341 -0
  27. package/commands/ms/discuss-milestone.md +48 -0
  28. package/commands/ms/discuss-phase.md +60 -0
  29. package/commands/ms/do-work.md +90 -0
  30. package/commands/ms/execute-phase.md +289 -0
  31. package/commands/ms/help.md +623 -0
  32. package/commands/ms/insert-phase.md +227 -0
  33. package/commands/ms/list-phase-assumptions.md +50 -0
  34. package/commands/ms/map-codebase.md +71 -0
  35. package/commands/ms/new-milestone.md +193 -0
  36. package/commands/ms/new-project.md +338 -0
  37. package/commands/ms/pause-work.md +123 -0
  38. package/commands/ms/plan-milestone-gaps.md +285 -0
  39. package/commands/ms/plan-phase.md +105 -0
  40. package/commands/ms/progress.md +370 -0
  41. package/commands/ms/remove-phase.md +338 -0
  42. package/commands/ms/research-phase.md +175 -0
  43. package/commands/ms/research-project.md +339 -0
  44. package/commands/ms/resume-work.md +40 -0
  45. package/commands/ms/review-design.md +484 -0
  46. package/commands/ms/simplify-flutter.md +193 -0
  47. package/commands/ms/update.md +159 -0
  48. package/commands/ms/verify-work.md +92 -0
  49. package/commands/ms/whats-new.md +124 -0
  50. package/mindsystem/references/checkpoints.md +788 -0
  51. package/mindsystem/references/continuation-format.md +255 -0
  52. package/mindsystem/references/debugging/debugging-mindset.md +11 -0
  53. package/mindsystem/references/debugging/hypothesis-testing.md +11 -0
  54. package/mindsystem/references/debugging/investigation-techniques.md +11 -0
  55. package/mindsystem/references/debugging/verification-patterns.md +11 -0
  56. package/mindsystem/references/debugging/when-to-research.md +11 -0
  57. package/mindsystem/references/git-integration.md +254 -0
  58. package/mindsystem/references/goal-backward.md +286 -0
  59. package/mindsystem/references/mock-patterns.md +294 -0
  60. package/mindsystem/references/plan-format.md +473 -0
  61. package/mindsystem/references/principles.md +73 -0
  62. package/mindsystem/references/questioning.md +140 -0
  63. package/mindsystem/references/research-pitfalls.md +233 -0
  64. package/mindsystem/references/scope-estimation.md +256 -0
  65. package/mindsystem/references/tdd.md +263 -0
  66. package/mindsystem/references/verification-patterns.md +595 -0
  67. package/mindsystem/templates/DEBUG.md +159 -0
  68. package/mindsystem/templates/UAT.md +403 -0
  69. package/mindsystem/templates/adhoc-summary.md +153 -0
  70. package/mindsystem/templates/codebase/architecture.md +255 -0
  71. package/mindsystem/templates/codebase/concerns.md +310 -0
  72. package/mindsystem/templates/codebase/conventions.md +307 -0
  73. package/mindsystem/templates/codebase/integrations.md +280 -0
  74. package/mindsystem/templates/codebase/stack.md +186 -0
  75. package/mindsystem/templates/codebase/structure.md +285 -0
  76. package/mindsystem/templates/codebase/testing.md +480 -0
  77. package/mindsystem/templates/config.json +26 -0
  78. package/mindsystem/templates/context.md +140 -0
  79. package/mindsystem/templates/continue-here.md +78 -0
  80. package/mindsystem/templates/debug-subagent-prompt.md +91 -0
  81. package/mindsystem/templates/design-iteration.md +208 -0
  82. package/mindsystem/templates/design.md +417 -0
  83. package/mindsystem/templates/discovery.md +146 -0
  84. package/mindsystem/templates/milestone-archive.md +123 -0
  85. package/mindsystem/templates/milestone-context.md +93 -0
  86. package/mindsystem/templates/milestone.md +115 -0
  87. package/mindsystem/templates/phase-prompt.md +574 -0
  88. package/mindsystem/templates/project.md +184 -0
  89. package/mindsystem/templates/requirements.md +231 -0
  90. package/mindsystem/templates/research-project/ARCHITECTURE.md +204 -0
  91. package/mindsystem/templates/research-project/FEATURES.md +147 -0
  92. package/mindsystem/templates/research-project/PITFALLS.md +200 -0
  93. package/mindsystem/templates/research-project/STACK.md +120 -0
  94. package/mindsystem/templates/research-project/SUMMARY.md +170 -0
  95. package/mindsystem/templates/research-subagent-prompt.md +92 -0
  96. package/mindsystem/templates/research.md +529 -0
  97. package/mindsystem/templates/roadmap.md +214 -0
  98. package/mindsystem/templates/state.md +224 -0
  99. package/mindsystem/templates/summary.md +269 -0
  100. package/mindsystem/templates/user-setup.md +323 -0
  101. package/mindsystem/templates/verification-report.md +322 -0
  102. package/mindsystem/workflows/complete-milestone.md +759 -0
  103. package/mindsystem/workflows/create-milestone.md +203 -0
  104. package/mindsystem/workflows/debug.md +14 -0
  105. package/mindsystem/workflows/define-requirements.md +330 -0
  106. package/mindsystem/workflows/diagnose-issues.md +241 -0
  107. package/mindsystem/workflows/discovery-phase.md +293 -0
  108. package/mindsystem/workflows/discuss-milestone.md +310 -0
  109. package/mindsystem/workflows/discuss-phase.md +237 -0
  110. package/mindsystem/workflows/do-work.md +359 -0
  111. package/mindsystem/workflows/execute-phase.md +644 -0
  112. package/mindsystem/workflows/execute-plan.md +1828 -0
  113. package/mindsystem/workflows/generate-mocks.md +187 -0
  114. package/mindsystem/workflows/list-phase-assumptions.md +178 -0
  115. package/mindsystem/workflows/map-codebase.md +289 -0
  116. package/mindsystem/workflows/plan-phase.md +876 -0
  117. package/mindsystem/workflows/research-phase.md +17 -0
  118. package/mindsystem/workflows/research-project.md +23 -0
  119. package/mindsystem/workflows/resume-project.md +311 -0
  120. package/mindsystem/workflows/transition.md +564 -0
  121. package/mindsystem/workflows/verify-phase.md +629 -0
  122. package/mindsystem/workflows/verify-work.md +823 -0
  123. package/package.json +32 -0
  124. package/scripts/generate-phase-patch.sh +169 -0
  125. package/scripts/ms-lookup/README.md +112 -0
  126. package/scripts/ms-lookup/ms_lookup/__init__.py +3 -0
  127. package/scripts/ms-lookup/ms_lookup/__main__.py +6 -0
  128. package/scripts/ms-lookup/ms_lookup/backends/__init__.py +6 -0
  129. package/scripts/ms-lookup/ms_lookup/backends/context7.py +219 -0
  130. package/scripts/ms-lookup/ms_lookup/backends/perplexity.py +145 -0
  131. package/scripts/ms-lookup/ms_lookup/cache.py +48 -0
  132. package/scripts/ms-lookup/ms_lookup/cli.py +219 -0
  133. package/scripts/ms-lookup/ms_lookup/config.py +23 -0
  134. package/scripts/ms-lookup/ms_lookup/errors.py +24 -0
  135. package/scripts/ms-lookup/ms_lookup/output.py +49 -0
  136. package/scripts/ms-lookup/ms_lookup/tokens.py +56 -0
  137. package/scripts/ms-lookup/pyproject.toml +17 -0
  138. package/scripts/ms-lookup/uv.lock +207 -0
  139. package/scripts/ms-lookup-wrapper.sh +21 -0
@@ -0,0 +1,263 @@
1
+ <overview>
2
+ TDD is about design quality, not coverage metrics. The red-green-refactor cycle forces you to think about behavior before implementation, producing cleaner interfaces and more testable code.
3
+
4
+ **Principle:** If you can describe the behavior as `expect(fn(input)).toBe(output)` before writing `fn`, TDD improves the result.
5
+
6
+ **Key insight:** TDD work is fundamentally heavier than standard tasks—it requires 2-3 execution cycles (RED → GREEN → REFACTOR), each with file reads, test runs, and potential debugging. TDD features get dedicated plans to ensure full context is available throughout the cycle.
7
+ </overview>
8
+
9
+ <when_to_use_tdd>
10
+ ## When TDD Improves Quality
11
+
12
+ **TDD candidates (create a TDD plan):**
13
+ - Business logic with defined inputs/outputs
14
+ - API endpoints with request/response contracts
15
+ - Data transformations, parsing, formatting
16
+ - Validation rules and constraints
17
+ - Algorithms with testable behavior
18
+ - State machines and workflows
19
+ - Utility functions with clear specifications
20
+
21
+ **Skip TDD (use standard plan with `type="auto"` tasks):**
22
+ - UI layout, styling, visual components
23
+ - Configuration changes
24
+ - Glue code connecting existing components
25
+ - One-off scripts and migrations
26
+ - Simple CRUD with no business logic
27
+ - Exploratory prototyping
28
+
29
+ **Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
30
+ → Yes: Create a TDD plan
31
+ → No: Use standard plan, add tests after if needed
32
+ </when_to_use_tdd>
33
+
34
+ <tdd_plan_structure>
35
+ ## TDD Plan Structure
36
+
37
+ Each TDD plan implements **one feature** through the full RED-GREEN-REFACTOR cycle.
38
+
39
+ ```markdown
40
+ ---
41
+ phase: XX-name
42
+ plan: NN
43
+ type: tdd
44
+ ---
45
+
46
+ <objective>
47
+ [What feature and why]
48
+ Purpose: [Design benefit of TDD for this feature]
49
+ Output: [Working, tested feature]
50
+ </objective>
51
+
52
+ <context>
53
+ @.planning/PROJECT.md
54
+ @.planning/ROADMAP.md
55
+ @relevant/source/files.ts
56
+ </context>
57
+
58
+ <feature>
59
+ <name>[Feature name]</name>
60
+ <files>[source file, test file]</files>
61
+ <behavior>
62
+ [Expected behavior in testable terms]
63
+ Cases: input → expected output
64
+ </behavior>
65
+ <implementation>[How to implement once tests pass]</implementation>
66
+ </feature>
67
+
68
+ <verification>
69
+ [Test command that proves feature works]
70
+ </verification>
71
+
72
+ <success_criteria>
73
+ - Failing test written and committed
74
+ - Implementation passes test
75
+ - Refactor complete (if needed)
76
+ - All 2-3 commits present
77
+ </success_criteria>
78
+
79
+ <output>
80
+ After completion, create SUMMARY.md with:
81
+ - RED: What test was written, why it failed
82
+ - GREEN: What implementation made it pass
83
+ - REFACTOR: What cleanup was done (if any)
84
+ - Commits: List of commits produced
85
+ </output>
86
+ ```
87
+
88
+ **One feature per TDD plan.** If features are trivial enough to batch, they're trivial enough to skip TDD—use a standard plan and add tests after.
89
+ </tdd_plan_structure>
90
+
91
+ <execution_flow>
92
+ ## Red-Green-Refactor Cycle
93
+
94
+ **RED - Write failing test:**
95
+ 1. Create test file following project conventions
96
+ 2. Write test describing expected behavior (from `<behavior>` element)
97
+ 3. Run test - it MUST fail
98
+ 4. If test passes: feature exists or test is wrong. Investigate.
99
+ 5. Commit: `test({phase}-{plan}): add failing test for [feature]`
100
+
101
+ **GREEN - Implement to pass:**
102
+ 1. Write minimal code to make test pass
103
+ 2. No cleverness, no optimization - just make it work
104
+ 3. Run test - it MUST pass
105
+ 4. Commit: `feat({phase}-{plan}): implement [feature]`
106
+
107
+ **REFACTOR (if needed):**
108
+ 1. Clean up implementation if obvious improvements exist
109
+ 2. Run tests - MUST still pass
110
+ 3. Only commit if changes made: `refactor({phase}-{plan}): clean up [feature]`
111
+
112
+ **Result:** Each TDD plan produces 2-3 atomic commits.
113
+ </execution_flow>
114
+
115
+ <test_quality>
116
+ ## Good Tests vs Bad Tests
117
+
118
+ **Test behavior, not implementation:**
119
+ - Good: "returns formatted date string"
120
+ - Bad: "calls formatDate helper with correct params"
121
+ - Tests should survive refactors
122
+
123
+ **One concept per test:**
124
+ - Good: Separate tests for valid input, empty input, malformed input
125
+ - Bad: Single test checking all edge cases with multiple assertions
126
+
127
+ **Descriptive names:**
128
+ - Good: "should reject empty email", "returns null for invalid ID"
129
+ - Bad: "test1", "handles error", "works correctly"
130
+
131
+ **No implementation details:**
132
+ - Good: Test public API, observable behavior
133
+ - Bad: Mock internals, test private methods, assert on internal state
134
+ </test_quality>
135
+
136
+ <framework_setup>
137
+ ## Test Framework Setup (If None Exists)
138
+
139
+ When executing a TDD plan but no test framework is configured, set it up as part of the RED phase:
140
+
141
+ **1. Detect project type:**
142
+ ```bash
143
+ # JavaScript/TypeScript
144
+ if [ -f package.json ]; then echo "node"; fi
145
+
146
+ # Python
147
+ if [ -f requirements.txt ] || [ -f pyproject.toml ]; then echo "python"; fi
148
+
149
+ # Go
150
+ if [ -f go.mod ]; then echo "go"; fi
151
+
152
+ # Rust
153
+ if [ -f Cargo.toml ]; then echo "rust"; fi
154
+ ```
155
+
156
+ **2. Install minimal framework:**
157
+ | Project | Framework | Install |
158
+ |---------|-----------|---------|
159
+ | Node.js | Jest | `npm install -D jest @types/jest ts-jest` |
160
+ | Node.js (Vite) | Vitest | `npm install -D vitest` |
161
+ | Python | pytest | `pip install pytest` |
162
+ | Go | testing | Built-in |
163
+ | Rust | cargo test | Built-in |
164
+
165
+ **3. Create config if needed:**
166
+ - Jest: `jest.config.js` with ts-jest preset
167
+ - Vitest: `vitest.config.ts` with test globals
168
+ - pytest: `pytest.ini` or `pyproject.toml` section
169
+
170
+ **4. Verify setup:**
171
+ ```bash
172
+ # Run empty test suite - should pass with 0 tests
173
+ npm test # Node
174
+ pytest # Python
175
+ go test ./... # Go
176
+ cargo test # Rust
177
+ ```
178
+
179
+ **5. Create first test file:**
180
+ Follow project conventions for test location:
181
+ - `*.test.ts` / `*.spec.ts` next to source
182
+ - `__tests__/` directory
183
+ - `tests/` directory at root
184
+
185
+ Framework setup is a one-time cost included in the first TDD plan's RED phase.
186
+ </framework_setup>
187
+
188
+ <error_handling>
189
+ ## Error Handling
190
+
191
+ **Test doesn't fail in RED phase:**
192
+ - Feature may already exist - investigate
193
+ - Test may be wrong (not testing what you think)
194
+ - Fix before proceeding
195
+
196
+ **Test doesn't pass in GREEN phase:**
197
+ - Debug implementation
198
+ - Don't skip to refactor
199
+ - Keep iterating until green
200
+
201
+ **Tests fail in REFACTOR phase:**
202
+ - Undo refactor
203
+ - Commit was premature
204
+ - Refactor in smaller steps
205
+
206
+ **Unrelated tests break:**
207
+ - Stop and investigate
208
+ - May indicate coupling issue
209
+ - Fix before proceeding
210
+ </error_handling>
211
+
212
+ <commit_pattern>
213
+ ## Commit Pattern for TDD Plans
214
+
215
+ TDD plans produce 2-3 atomic commits (one per phase):
216
+
217
+ ```
218
+ test(08-02): add failing test for email validation
219
+
220
+ - Tests valid email formats accepted
221
+ - Tests invalid formats rejected
222
+ - Tests empty input handling
223
+
224
+ feat(08-02): implement email validation
225
+
226
+ - Regex pattern matches RFC 5322
227
+ - Returns boolean for validity
228
+ - Handles edge cases (empty, null)
229
+
230
+ refactor(08-02): extract regex to constant (optional)
231
+
232
+ - Moved pattern to EMAIL_REGEX constant
233
+ - No behavior changes
234
+ - Tests still pass
235
+ ```
236
+
237
+ **Comparison with standard plans:**
238
+ - Standard plans: 1 commit per task, 2-4 commits per plan
239
+ - TDD plans: 2-3 commits for single feature
240
+
241
+ Both follow same format: `{type}({phase}-{plan}): {description}`
242
+
243
+ **Benefits:**
244
+ - Each commit independently revertable
245
+ - Git bisect works at commit level
246
+ - Clear history showing TDD discipline
247
+ - Consistent with overall commit strategy
248
+ </commit_pattern>
249
+
250
+ <context_budget>
251
+ ## Context Budget
252
+
253
+ TDD plans target **~40% context usage** (lower than standard plans' ~50%).
254
+
255
+ Why lower:
256
+ - RED phase: write test, run test, potentially debug why it didn't fail
257
+ - GREEN phase: implement, run test, potentially iterate on failures
258
+ - REFACTOR phase: modify code, run tests, verify no regressions
259
+
260
+ Each phase involves reading files, running commands, analyzing output. The back-and-forth is inherently heavier than linear task execution.
261
+
262
+ Single feature focus ensures full quality throughout the cycle.
263
+ </context_budget>