sumulige-claude 1.5.1 → 1.6.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 (223) hide show
  1. package/.claude/hooks/hook-registry.json +0 -15
  2. package/.claude/rules/coding-style.md +18 -7
  3. package/.claude/rules/hooks.md +15 -4
  4. package/.claude/rules/performance.md +15 -5
  5. package/.claude/rules/security.md +140 -4
  6. package/.claude/rules/testing.md +138 -9
  7. package/.claude/rules/web-design-standard.md +16 -5
  8. package/.claude/skills/algorithmic-art/metadata.yaml +28 -0
  9. package/.claude/skills/api-tester/SKILL.md +61 -0
  10. package/.claude/skills/api-tester/examples/basic.md +3 -0
  11. package/.claude/skills/api-tester/metadata.yaml +30 -0
  12. package/.claude/skills/api-tester/templates/default.md +3 -0
  13. package/.claude/skills/brand-guidelines/metadata.yaml +26 -0
  14. package/.claude/skills/canvas-design/metadata.yaml +27 -0
  15. package/.claude/skills/code-reviewer-123/SKILL.md +61 -0
  16. package/.claude/skills/code-reviewer-123/examples/basic.md +3 -0
  17. package/.claude/skills/code-reviewer-123/metadata.yaml +30 -0
  18. package/.claude/skills/code-reviewer-123/templates/default.md +3 -0
  19. package/.claude/skills/doc-coauthoring/metadata.yaml +27 -0
  20. package/.claude/skills/docx/metadata.yaml +30 -0
  21. package/.claude/skills/frontend-design/metadata.yaml +28 -0
  22. package/.claude/skills/internal-comms/metadata.yaml +28 -0
  23. package/.claude/skills/mcp-builder/metadata.yaml +26 -0
  24. package/.claude/skills/my-skill/SKILL.md +61 -0
  25. package/.claude/skills/my-skill/examples/basic.md +3 -0
  26. package/.claude/skills/my-skill/metadata.yaml +30 -0
  27. package/.claude/skills/my-skill/templates/default.md +3 -0
  28. package/.claude/skills/pdf/metadata.yaml +29 -0
  29. package/.claude/skills/pptx/metadata.yaml +29 -0
  30. package/.claude/skills/react-best-practices/metadata.yaml +26 -0
  31. package/.claude/skills/react-node-practices/SKILL.md +409 -0
  32. package/.claude/skills/react-node-practices/metadata.yaml +56 -0
  33. package/.claude/skills/skill-creator/metadata.yaml +25 -0
  34. package/.claude/skills/slack-gif-creator/metadata.yaml +28 -0
  35. package/.claude/skills/test-skill-name/SKILL.md +61 -0
  36. package/.claude/skills/test-skill-name/examples/basic.md +3 -0
  37. package/.claude/skills/test-skill-name/metadata.yaml +30 -0
  38. package/.claude/skills/test-skill-name/templates/default.md +3 -0
  39. package/.claude/skills/test-workflow/metadata.yaml +32 -0
  40. package/.claude/skills/theme-factory/metadata.yaml +26 -0
  41. package/.claude/skills/threejs-fundamentals/metadata.yaml +27 -0
  42. package/.claude/skills/web-artifacts-builder/metadata.yaml +30 -0
  43. package/.claude/skills/web-design-guidelines/metadata.yaml +26 -0
  44. package/.claude/skills/webapp-testing/metadata.yaml +26 -0
  45. package/.claude/skills/xlsx/metadata.yaml +29 -0
  46. package/LICENSE +21 -0
  47. package/README.md +280 -529
  48. package/cli.js +19 -3
  49. package/package.json +29 -3
  50. package/template/.codex/README.md +69 -0
  51. package/template/.codex/config.toml +56 -0
  52. package/template/AGENTS.md +94 -0
  53. package/.claude/.kickoff-hint.txt +0 -52
  54. package/.claude/.sumulige-claude-version +0 -1
  55. package/.claude/.version +0 -1
  56. package/.claude/AGENTS.md +0 -42
  57. package/.claude/ANCHORS.md +0 -40
  58. package/.claude/CLAUDE.md +0 -138
  59. package/.claude/MEMORY.md +0 -69
  60. package/.claude/PROJECT_LOG.md +0 -101
  61. package/.claude/THINKING_CHAIN_GUIDE.md +0 -287
  62. package/.claude/USAGE.md +0 -175
  63. package/.claude/boris-optimizations.md +0 -167
  64. package/.claude/handoffs/INDEX.md +0 -21
  65. package/.claude/handoffs/LATEST.md +0 -76
  66. package/.claude/handoffs/handoff_2026-01-22T13-07-04-757Z.md +0 -76
  67. package/.claude/quality-gate.json +0 -82
  68. package/.claude/rag/skill-index.json +0 -135
  69. package/.claude/settings.json +0 -99
  70. package/.claude/settings.local.json +0 -175
  71. package/.claude/templates/PROJECT_KICKOFF.md +0 -89
  72. package/.claude/templates/PROJECT_PROPOSAL.md +0 -227
  73. package/.claude/templates/TASK_PLAN.md +0 -121
  74. package/.claude/templates/hooks/README.md +0 -302
  75. package/.claude/templates/hooks/hook.sh.template +0 -94
  76. package/.claude/templates/hooks/user-prompt-submit.cjs.template +0 -116
  77. package/.claude/templates/hooks/user-response-submit.cjs.template +0 -94
  78. package/.claude/templates/hooks/validate.js +0 -173
  79. package/.claude/templates/tasks/develop.md +0 -69
  80. package/.claude/templates/tasks/research.md +0 -64
  81. package/.claude/templates/tasks/test.md +0 -96
  82. package/.claude/thinking-routes/.last-sync +0 -1
  83. package/.claude/thinking-routes/QUICKREF.md +0 -98
  84. package/.claude/workflow/document-scanner.js +0 -426
  85. package/.claude/workflow/knowledge-engine.js +0 -941
  86. package/.claude/workflow/notebooklm/browser.js +0 -1028
  87. package/.claude/workflow/phases/phase1-research.js +0 -578
  88. package/.claude/workflow/phases/phase1-research.ts +0 -465
  89. package/.claude/workflow/phases/phase2-approve.js +0 -722
  90. package/.claude/workflow/phases/phase3-plan.js +0 -1200
  91. package/.claude/workflow/phases/phase4-develop.js +0 -894
  92. package/.claude/workflow/search-cache.js +0 -230
  93. package/.claude/workflow/templates/approval.md +0 -315
  94. package/.claude/workflow/templates/development.md +0 -377
  95. package/.claude/workflow/templates/planning.md +0 -328
  96. package/.claude/workflow/templates/research.md +0 -250
  97. package/.claude/workflow/types.js +0 -37
  98. package/.claude/workflow/web-search.js +0 -278
  99. package/.claude-plugin/marketplace.json +0 -71
  100. package/.github/workflows/sync-skills.yml +0 -74
  101. package/.versionrc +0 -25
  102. package/AGENTS.md +0 -580
  103. package/CHANGELOG.md +0 -481
  104. package/CLAUDE-template.md +0 -114
  105. package/DEV_TOOLS_GUIDE.md +0 -190
  106. package/PROJECT_STRUCTURE.md +0 -266
  107. package/Q&A.md +0 -325
  108. package/config/defaults.json +0 -34
  109. package/config/official-skills.json +0 -183
  110. package/config/quality-gate.json +0 -67
  111. package/config/skill-categories.json +0 -40
  112. package/config/version-manifest.json +0 -85
  113. package/demos/power-3d-scatter.html +0 -683
  114. package/development/cache/web-search/search_1193d605f8eb364651fc2f2041b58a31.json +0 -36
  115. package/development/cache/web-search/search_3798bf06960edc125f744a1abb5b72c5.json +0 -36
  116. package/development/cache/web-search/search_37c7d4843a53f0d83f1122a6f908a2a3.json +0 -36
  117. package/development/cache/web-search/search_44166fa0153709ee168485a22aa0ab40.json +0 -36
  118. package/development/cache/web-search/search_4deaebb1f77e86a8ca066dc5a49c59fd.json +0 -36
  119. package/development/cache/web-search/search_94da91789466070a7f545612e73c7372.json +0 -36
  120. package/development/cache/web-search/search_dd5de8491b8b803a3cb01339cd210fb0.json +0 -36
  121. package/development/knowledge-base/.index.clean.json +0 -1
  122. package/development/knowledge-base/.index.json +0 -486
  123. package/development/knowledge-base/test-best-practices.md +0 -29
  124. package/development/projects/proj_mkh1pazz_ixmt1/phase1/feasibility-report.md +0 -160
  125. package/development/projects/proj_mkh4jvnb_z7rwf/phase1/feasibility-report.md +0 -160
  126. package/development/projects/proj_mkh4jxkd_ewz5a/phase1/feasibility-report.md +0 -160
  127. package/development/projects/proj_mkh4k84n_ni73k/phase1/feasibility-report.md +0 -160
  128. package/development/projects/proj_mkh4wfyd_u9w88/phase1/feasibility-report.md +0 -160
  129. package/development/projects/proj_mkh4wsbo_iahvf/development/projects/proj_mkh4xbpg_4na5w/phase1/feasibility-report.md +0 -160
  130. package/development/projects/proj_mkh4wsbo_iahvf/phase1/feasibility-report.md +0 -160
  131. package/development/projects/proj_mkh4xulg_1ka8x/phase1/feasibility-report.md +0 -160
  132. package/development/projects/proj_mkh4xwhj_gch8j/phase1/feasibility-report.md +0 -160
  133. package/development/projects/proj_mkh4y2qk_9lm8z/phase1/feasibility-report.md +0 -160
  134. package/development/projects/proj_mkh4y2qk_9lm8z/phase2/requirements.md +0 -226
  135. package/development/projects/proj_mkh4y2qk_9lm8z/phase3/PRD.md +0 -345
  136. package/development/projects/proj_mkh4y2qk_9lm8z/phase3/TASK_PLAN.md +0 -284
  137. package/development/projects/proj_mkh4y2qk_9lm8z/phase3/prototype/README.md +0 -14
  138. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/DEVELOPMENT_LOG.md +0 -35
  139. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/TASKS.md +0 -34
  140. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/.env.example +0 -5
  141. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/README.md +0 -60
  142. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/package.json +0 -25
  143. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/src/index.js +0 -70
  144. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/src/routes/index.js +0 -48
  145. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/tests/health.test.js +0 -20
  146. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/tests/jest.config.js +0 -21
  147. package/development/projects/proj_mkh7veqg_3lypc/phase1/feasibility-report.md +0 -160
  148. package/development/projects/proj_mkh7veqg_3lypc/phase2/requirements.md +0 -226
  149. package/development/projects/proj_mkh7veqg_3lypc/phase3/PRD.md +0 -345
  150. package/development/projects/proj_mkh7veqg_3lypc/phase3/TASK_PLAN.md +0 -284
  151. package/development/projects/proj_mkh7veqg_3lypc/phase3/prototype/README.md +0 -14
  152. package/development/projects/proj_mkh8k8fo_rmqn5/phase1/feasibility-report.md +0 -160
  153. package/development/projects/proj_mkh8xyhy_1vshq/phase1/feasibility-report.md +0 -178
  154. package/development/projects/proj_mkh8zddd_dhamf/phase1/feasibility-report.md +0 -377
  155. package/development/projects/proj_mkh8zddd_dhamf/phase2/requirements.md +0 -442
  156. package/development/projects/proj_mkh8zddd_dhamf/phase3/api-design.md +0 -800
  157. package/development/projects/proj_mkh8zddd_dhamf/phase3/architecture.md +0 -625
  158. package/development/projects/proj_mkh8zddd_dhamf/phase3/data-model.md +0 -830
  159. package/development/projects/proj_mkh8zddd_dhamf/phase3/risks.md +0 -957
  160. package/development/projects/proj_mkh8zddd_dhamf/phase3/wbs.md +0 -381
  161. package/development/todos/.state.json +0 -19
  162. package/development/todos/INDEX.md +0 -63
  163. package/development/todos/active/_README.md +0 -49
  164. package/development/todos/archived/_README.md +0 -11
  165. package/development/todos/backlog/_README.md +0 -11
  166. package/development/todos/backlog/mcp-integration.md +0 -35
  167. package/development/todos/completed/_README.md +0 -11
  168. package/development/todos/completed/boris-optimizations.md +0 -39
  169. package/development/todos/completed/develop/local-knowledge-index.md +0 -85
  170. package/development/todos/completed/develop/todo-system.md +0 -47
  171. package/development/todos/completed/develop/web-search-integration.md +0 -83
  172. package/development/todos/completed/test/phase1-e2e-test.md +0 -103
  173. package/docs/DEVELOPMENT.md +0 -461
  174. package/docs/MARKETPLACE.md +0 -352
  175. package/docs/RELEASE.md +0 -93
  176. package/jest.config.js +0 -63
  177. package/lib/commands.js +0 -3588
  178. package/lib/config-manager.js +0 -441
  179. package/lib/config-schema.js +0 -408
  180. package/lib/config-validator.js +0 -330
  181. package/lib/config.js +0 -122
  182. package/lib/errors.js +0 -305
  183. package/lib/incremental-sync.js +0 -274
  184. package/lib/marketplace.js +0 -487
  185. package/lib/migrations.js +0 -154
  186. package/lib/permission-audit.js +0 -255
  187. package/lib/quality-gate.js +0 -431
  188. package/lib/quality-rules.js +0 -373
  189. package/lib/utils.js +0 -150
  190. package/lib/version-check.js +0 -169
  191. package/lib/version-manifest.js +0 -171
  192. package/project-paradigm.md +0 -313
  193. package/prompts/how-to-find.md +0 -163
  194. package/prompts/linus-architect.md +0 -71
  195. package/prompts/software-architect.md +0 -173
  196. package/prompts/web-designer.md +0 -249
  197. package/scripts/fix-hooks.mjs +0 -97
  198. package/scripts/sync-external.mjs +0 -298
  199. package/scripts/sync-to-home.sh +0 -108
  200. package/scripts/update-registry.mjs +0 -325
  201. package/sources.yaml +0 -83
  202. package/tests/README.md +0 -263
  203. package/tests/commands.test.js +0 -1086
  204. package/tests/config-manager.test.js +0 -677
  205. package/tests/config-schema.test.js +0 -425
  206. package/tests/config-validator.test.js +0 -436
  207. package/tests/config.test.js +0 -100
  208. package/tests/errors.test.js +0 -477
  209. package/tests/manual/phase1-e2e.sh +0 -389
  210. package/tests/manual/phase2-test-cases.md +0 -311
  211. package/tests/manual/phase3-test-cases.md +0 -309
  212. package/tests/manual/phase4-test-cases.md +0 -414
  213. package/tests/manual/test-cases.md +0 -417
  214. package/tests/marketplace.test.js +0 -420
  215. package/tests/migrations.test.js +0 -187
  216. package/tests/quality-gate.test.js +0 -679
  217. package/tests/quality-rules.test.js +0 -619
  218. package/tests/sync-external.test.js +0 -214
  219. package/tests/update-registry.test.js +0 -251
  220. package/tests/utils.test.js +0 -171
  221. package/tests/version-check.test.js +0 -75
  222. package/tests/web-search.test.js +0 -392
  223. package/thinkinglens-silent.md +0 -138
@@ -1,578 +0,0 @@
1
- /**
2
- * Phase 1: Research - NotebookLM Feasibility Analysis (JavaScript version)
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
-
8
- // ============================================================================
9
- // Configuration
10
- // ============================================================================
11
-
12
- const PROJECTS_DIR = path.join(process.cwd(), 'development/projects');
13
-
14
- // ============================================================================
15
- // Feasibility Validator
16
- // ============================================================================
17
-
18
- class FeasibilityValidator {
19
- /**
20
- * Validate a feasibility report from markdown content
21
- */
22
- static validateFromMarkdown(content) {
23
- const checks = [];
24
- const blockers = [];
25
- const warnings = [];
26
-
27
- // Check 1: Has requirement summary
28
- const hasRequirementSummary =
29
- content.includes('## Requirements Summary') ||
30
- content.includes('## 需求概述') ||
31
- content.includes('# 需求') ||
32
- content.match(/需求|问题|目标|用户/);
33
-
34
- checks.push({
35
- name: 'Requirement Summary',
36
- passed: hasRequirementSummary,
37
- message: hasRequirementSummary
38
- ? 'Requirement summary found'
39
- : 'Missing requirement summary section'
40
- });
41
-
42
- if (!hasRequirementSummary) {
43
- blockers.push('Add a requirements summary section describing what we are building');
44
- }
45
-
46
- // Check 2: Has correlation analysis
47
- const hasCorrelationAnalysis =
48
- content.includes('## Correlation Analysis') ||
49
- content.includes('## 关联分析') ||
50
- content.includes('## 关联发现') ||
51
- content.includes('Related Projects') ||
52
- content.includes('相关项目') ||
53
- content.includes('reusable');
54
-
55
- checks.push({
56
- name: 'Correlation Analysis',
57
- passed: hasCorrelationAnalysis,
58
- message: hasCorrelationAnalysis
59
- ? 'Correlation analysis found'
60
- : 'Missing correlation analysis - connect the dots with related work'
61
- });
62
-
63
- if (!hasCorrelationAnalysis) {
64
- warnings.push('Add correlation analysis to find related work and reusable components');
65
- }
66
-
67
- // Check 3: Has best practices
68
- const hasBestPractices =
69
- content.includes('## Best Practices') ||
70
- content.includes('## 业界最佳实践') ||
71
- content.includes('## 最佳实践') ||
72
- content.includes('Industry') ||
73
- content.includes('sources') ||
74
- content.includes('参考');
75
-
76
- checks.push({
77
- name: 'Best Practices Research',
78
- passed: hasBestPractices,
79
- message: hasBestPractices
80
- ? 'Best practices research found'
81
- : 'Missing industry best practices research'
82
- });
83
-
84
- if (!hasBestPractices) {
85
- blockers.push('Add best practices research with cited sources');
86
- }
87
-
88
- // Check 4: Has feasibility conclusion
89
- const hasFeasibilityConclusion =
90
- content.includes('## Feasibility Assessment') ||
91
- content.includes('## 可行性评估') ||
92
- content.includes('feasibility') ||
93
- content.includes('可行性') ||
94
- content.match(/⭐\s*\d|难度|复杂度|Technical/);
95
-
96
- checks.push({
97
- name: 'Feasibility Conclusion',
98
- passed: hasFeasibilityConclusion,
99
- message: hasFeasibilityConclusion
100
- ? 'Feasibility assessment found'
101
- : 'Missing feasibility assessment with concrete ratings'
102
- });
103
-
104
- if (!hasFeasibilityConclusion) {
105
- blockers.push('Add feasibility assessment with technical complexity rating (⭐ 1-5)');
106
- }
107
-
108
- // Check 5: Has time estimate
109
- const hasTimeEstimate =
110
- content.includes('Time Estimate') ||
111
- content.includes('时间预估') ||
112
- content.includes('estimated') ||
113
- content.match(/\d+\s*(hour|h|小时|day|天)/);
114
-
115
- checks.push({
116
- name: 'Time Estimate',
117
- passed: hasTimeEstimate,
118
- message: hasTimeEstimate
119
- ? 'Time estimate found'
120
- : 'Missing time estimate for implementation'
121
- });
122
-
123
- if (!hasTimeEstimate) {
124
- warnings.push('Add concrete time estimate (e.g., "4 hours")');
125
- }
126
-
127
- // Check 6: Has risk assessment
128
- const hasRiskAssessment =
129
- content.includes('## Risk') ||
130
- content.includes('## 风险') ||
131
- content.includes('risk') ||
132
- content.includes('mitigation') ||
133
- content.includes('缓解') ||
134
- content.match(/挑战|问题|Risk/);
135
-
136
- checks.push({
137
- name: 'Risk Assessment',
138
- passed: hasRiskAssessment,
139
- message: hasRiskAssessment
140
- ? 'Risk assessment found'
141
- : 'Missing risk assessment with mitigation strategies'
142
- });
143
-
144
- if (!hasRiskAssessment) {
145
- blockers.push('Add risk assessment with identified risks and mitigation strategies');
146
- }
147
-
148
- // Calculate score
149
- const passedChecks = checks.filter(c => c.passed).length;
150
- const score = Math.round((passedChecks / checks.length) * 100);
151
-
152
- // Determine if passed (need at least 80% and no blockers)
153
- const passed = score >= 80 && blockers.length === 0;
154
-
155
- return {
156
- passed,
157
- score,
158
- checks,
159
- blockers,
160
- warnings
161
- };
162
- }
163
-
164
- /**
165
- * Validate a feasibility report file
166
- */
167
- static validateFile(filePath) {
168
- if (!fs.existsSync(filePath)) {
169
- return {
170
- passed: false,
171
- score: 0,
172
- checks: [],
173
- blockers: [`File not found: ${filePath}`],
174
- warnings: []
175
- };
176
- }
177
-
178
- try {
179
- const content = fs.readFileSync(filePath, 'utf-8');
180
- return this.validateFromMarkdown(content);
181
- } catch (error) {
182
- return {
183
- passed: false,
184
- score: 0,
185
- checks: [],
186
- blockers: [`Failed to read file: ${error.message}`],
187
- warnings: []
188
- };
189
- }
190
- }
191
-
192
- /**
193
- * Generate a validation report for display
194
- */
195
- static generateReport(result) {
196
- const lines = [];
197
-
198
- lines.push('═══════════════════════════════════════════════════════');
199
- lines.push(' Feasibility Report Validation');
200
- lines.push('═══════════════════════════════════════════════════════');
201
- lines.push('');
202
-
203
- // Status
204
- const status = result.passed ? '✅ PASSED' : '❌ FAILED';
205
- const statusColor = result.passed ? '🟢' : '🔴';
206
- lines.push(`Status: ${statusColor} ${status} (Score: ${result.score}/100)`);
207
- lines.push('');
208
-
209
- // Checks
210
- lines.push('Quality Checks:');
211
- lines.push('───────────────────────────────────────────────────────');
212
-
213
- result.checks.forEach(check => {
214
- const icon = check.passed ? '✅' : '❌';
215
- lines.push(` ${icon} ${check.name}: ${check.message || 'Failed'}`);
216
- });
217
-
218
- lines.push('');
219
-
220
- // Blockers
221
- if (result.blockers.length > 0) {
222
- lines.push('🚫 BLOCKERS (must fix before proceeding):');
223
- lines.push('───────────────────────────────────────────────────────');
224
- result.blockers.forEach((blocker, i) => {
225
- lines.push(` ${i + 1}. ${blocker}`);
226
- });
227
- lines.push('');
228
- }
229
-
230
- // Warnings
231
- if (result.warnings.length > 0) {
232
- lines.push('⚠️ WARNINGS (recommended improvements):');
233
- lines.push('───────────────────────────────────────────────────────');
234
- result.warnings.forEach((warning, i) => {
235
- lines.push(` ${i + 1}. ${warning}`);
236
- });
237
- lines.push('');
238
- }
239
-
240
- // Recommendation
241
- if (result.passed) {
242
- lines.push('🎉 Report meets quality standards! Ready for Phase 2 (Approval).');
243
- } else {
244
- lines.push('📝 Report needs improvements. Address blockers and re-validate.');
245
- }
246
-
247
- lines.push('');
248
- lines.push('═══════════════════════════════════════════════════════');
249
-
250
- return lines.join('\n');
251
- }
252
- }
253
-
254
- // ============================================================================
255
- // Phase 1 Research Executor
256
- // ============================================================================
257
-
258
- class Phase1ResearchExecutor {
259
- constructor(projectId) {
260
- this.projectId = projectId;
261
- this.projectDir = path.join(PROJECTS_DIR, projectId);
262
- this.phaseDir = path.join(this.projectDir, 'phase1');
263
- this.reportPath = path.join(this.phaseDir, 'feasibility-report.md');
264
- }
265
-
266
- /**
267
- * Ensure project directories exist
268
- */
269
- ensureDirectories() {
270
- if (!fs.existsSync(this.projectDir)) {
271
- fs.mkdirSync(this.projectDir, { recursive: true });
272
- }
273
- if (!fs.existsSync(this.phaseDir)) {
274
- fs.mkdirSync(this.phaseDir, { recursive: true });
275
- }
276
- }
277
-
278
- /**
279
- * Generate report template
280
- */
281
- generateReportTemplate(idea, context) {
282
- const date = new Date().toLocaleDateString();
283
- const time = new Date().toLocaleTimeString();
284
-
285
- return `# Feasibility Analysis Report
286
-
287
- **Project**: ${this.projectId}
288
- **Date**: ${date} ${time}
289
- **Phase**: 1 - Research
290
- **Status**: 🚧 In Progress
291
-
292
- ---
293
-
294
- ## Executive Summary
295
-
296
- > Brief overview of the project and feasibility assessment
297
-
298
- ---
299
-
300
- ## Requirements Summary
301
-
302
- ### Problem Statement
303
- [What problem are we solving?]
304
-
305
- ### Target Users
306
- [Who will use this? What are their pain points?]
307
-
308
- ### Key Features
309
- 1. [Feature 1]
310
- 2. [Feature 2]
311
- 3. [Feature 3]
312
-
313
- ### Constraints
314
- - [Constraint 1]
315
- - [Constraint 2]
316
-
317
- ### Assumptions
318
- - [Assumption 1]
319
- - [Assumption 2]
320
-
321
- ---
322
-
323
- ## Original Idea
324
-
325
- ${idea}
326
-
327
- ${context ? `### Additional Context\n${context}` : ''}
328
-
329
- ---
330
-
331
- ## Correlation Analysis (Connect The Dots)
332
-
333
- ### Research Plan (研究计划)
334
-
335
- **Key Objectives (关键目标)**:
336
- - [每个选项要回答的核心问题是什么?]
337
- - [评估需要哪些数据/信息?]
338
-
339
- **Research Methods (研究方法)**:
340
- - [如何收集和分析数据?]
341
- - [使用的工具或方法论是什么?]
342
-
343
- **Evaluation Criteria (评估标准)**:
344
- - [比较选项的指标/基准是什么?]
345
- - [可行性/成功的判断标准是什么?]
346
-
347
- **Expected Outcomes (预期成果)**:
348
- - [可能的研究发现或结果是什么?]
349
- - [研究后的下一步行动是什么?]
350
-
351
- ### Related Projects
352
- | Project | Similarity | Reusable Components |
353
- |---------|------------|---------------------|
354
- | [Project A] | 85% | [Component list] |
355
- | [Project B] | 60% | [Component list] |
356
-
357
- ### Overlapping Technology
358
- - [Tech stack overlap]
359
- - [Shared libraries]
360
- - [Common patterns]
361
-
362
- ### Lessons from History
363
- - [Lesson 1]: [Context and outcome]
364
- - [Lesson 2]: [Context and outcome]
365
-
366
- ---
367
-
368
- ## Industry Best Practices
369
-
370
- ### Architecture
371
- **Practice**: [Specific practice]
372
- **Rationale**: [Why this is recommended]
373
- **Sources**: [Citations]
374
-
375
- ### Security
376
- **Practice**: [Security best practice]
377
- **Rationale**: [Why this matters]
378
-
379
- ---
380
-
381
- ## Feasibility Assessment
382
-
383
- ### Technical Feasibility: ⭐⭐⭐☆☆ (3/5)
384
-
385
- **Strengths**:
386
- - [Strength 1]
387
- - [Strength 2]
388
-
389
- **Challenges**:
390
- - [Challenge 1]: [Mitigation strategy]
391
-
392
- ### Time Estimate: X hours
393
-
394
- **Breakdown**:
395
- - Research & Planning: Xh
396
- - Design: Xh
397
- - Implementation: Xh
398
- - Testing: Xh
399
-
400
- **Total**: X hours
401
-
402
- ### Complexity: Medium
403
-
404
- **Reasoning**: [Explain complexity assessment]
405
-
406
- ### Risk Assessment
407
-
408
- | Risk | Severity | Probability | Mitigation |
409
- |------|----------|-------------|------------|
410
- | [Risk 1] | High | Medium | [Mitigation strategy] |
411
- | [Risk 2] | Medium | Low | [Mitigation strategy] |
412
-
413
- ---
414
-
415
- ## Recommendations
416
-
417
- ### Recommended Tech Stack
418
-
419
- **Frontend**:
420
- - [Choice 1] - [Rationale]
421
-
422
- **Backend**:
423
- - [Choice 1] - [Rationale]
424
-
425
- ### Suggested Architecture
426
-
427
- [High-level architecture description]
428
-
429
- ### Potential Issues to Watch
430
-
431
- 1. **[Issue 1]**: [Monitoring approach]
432
- 2. **[Issue 2]**: [Monitoring approach]
433
-
434
- ### Next Steps (Phase 2: Approval)
435
-
436
- 1. [ ] Review this report and ensure all sections are complete
437
- 2. [ ] Run quality gate: \`smc workflow validate ${this.reportPath}\`
438
- 3. [ ] Address any blockers identified
439
- 4. [ ] Proceed to Phase 2 for Claude review and consensus
440
-
441
- ---
442
-
443
- ## Quality Checklist
444
-
445
- - [x] Requirement summary is clear and complete
446
- - [ ] Correlation analysis found related work/patterns
447
- - [ ] Best practices are cited with sources
448
- - [ ] Feasibility has concrete ratings (not vague)
449
- - [ ] Time estimate is justified
450
- - [ ] Risks have mitigation strategies
451
- - [ ] Recommendations are actionable
452
-
453
- ---
454
-
455
- ## Metadata
456
-
457
- - **Generated**: ${date} ${time}
458
- - **Confidence Level**: [To be filled by AI]
459
-
460
- ---
461
-
462
- *This report was generated by the Phase 1 Research Executor.*
463
- `;
464
- }
465
-
466
- /**
467
- * Execute Phase 1 research workflow
468
- */
469
- async execute(idea, context = '', progressCallback) {
470
- await progressCallback?.('Initializing Phase 1 research...', 0, 5);
471
-
472
- // Ensure directories exist
473
- this.ensureDirectories();
474
-
475
- // Step 1: Create directories
476
- await progressCallback?.('Setting up project structure...', 1, 5);
477
-
478
- // Step 2: Generate report template
479
- await progressCallback?.('Generating feasibility report template...', 2, 5);
480
-
481
- const reportTemplate = this.generateReportTemplate(idea, context);
482
- await fs.promises.writeFile(this.reportPath, reportTemplate, 'utf-8');
483
-
484
- await progressCallback?.('Phase 1 research context prepared. Ready for AI analysis.', 3, 5);
485
-
486
- return {
487
- projectId: this.projectId,
488
- reportPath: this.reportPath,
489
- nextSteps: [
490
- 'Complete the feasibility report',
491
- 'Validate with: smc workflow validate',
492
- 'Proceed to Phase 2'
493
- ]
494
- };
495
- }
496
-
497
- /**
498
- * Check if report exists
499
- */
500
- reportExists() {
501
- return fs.existsSync(this.reportPath);
502
- }
503
-
504
- /**
505
- * Read the existing report
506
- */
507
- readReport() {
508
- if (!this.reportExists()) return null;
509
- return fs.readFileSync(this.reportPath, 'utf-8');
510
- }
511
-
512
- /**
513
- * Validate the report
514
- */
515
- validateReport() {
516
- return FeasibilityValidator.validateFile(this.reportPath);
517
- }
518
-
519
- /**
520
- * Get the report path
521
- */
522
- getReportPath() {
523
- return this.reportPath;
524
- }
525
- }
526
-
527
- // ============================================================================
528
- // Project Management Helpers
529
- // ============================================================================
530
-
531
- function generateProjectId() {
532
- const timestamp = Date.now().toString(36);
533
- const random = Math.random().toString(36).substr(2, 5);
534
- return `proj_${timestamp}_${random}`;
535
- }
536
-
537
- async function createProject(idea, context = '') {
538
- const projectId = generateProjectId();
539
- const executor = new Phase1ResearchExecutor(projectId);
540
-
541
- await executor.execute(idea, context, (msg, current, total) => {
542
- const progress = Math.round((current / total) * 100);
543
- console.log(`[${progress}%] ${msg}`);
544
- });
545
-
546
- return projectId;
547
- }
548
-
549
- function listProjects() {
550
- if (!fs.existsSync(PROJECTS_DIR)) {
551
- return [];
552
- }
553
-
554
- const projects = [];
555
- const entries = fs.readdirSync(PROJECTS_DIR, { withFileTypes: true });
556
-
557
- for (const entry of entries) {
558
- if (entry.isDirectory() && entry.name.startsWith('proj_')) {
559
- const projectPath = path.join(PROJECTS_DIR, entry.name);
560
- const reportPath = path.join(projectPath, 'phase1', 'feasibility-report.md');
561
- projects.push({
562
- id: entry.name,
563
- path: projectPath,
564
- hasReport: fs.existsSync(reportPath)
565
- });
566
- }
567
- }
568
-
569
- return projects.sort((a, b) => b.id.localeCompare(a.id));
570
- }
571
-
572
- module.exports = {
573
- Phase1ResearchExecutor,
574
- FeasibilityValidator,
575
- generateProjectId,
576
- createProject,
577
- listProjects
578
- };