sumulige-claude 1.5.1 → 1.5.2

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 (219) 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/cli.js +1 -1
  48. package/package.json +25 -3
  49. package/.claude/.kickoff-hint.txt +0 -52
  50. package/.claude/.sumulige-claude-version +0 -1
  51. package/.claude/.version +0 -1
  52. package/.claude/AGENTS.md +0 -42
  53. package/.claude/ANCHORS.md +0 -40
  54. package/.claude/CLAUDE.md +0 -138
  55. package/.claude/MEMORY.md +0 -69
  56. package/.claude/PROJECT_LOG.md +0 -101
  57. package/.claude/THINKING_CHAIN_GUIDE.md +0 -287
  58. package/.claude/USAGE.md +0 -175
  59. package/.claude/boris-optimizations.md +0 -167
  60. package/.claude/handoffs/INDEX.md +0 -21
  61. package/.claude/handoffs/LATEST.md +0 -76
  62. package/.claude/handoffs/handoff_2026-01-22T13-07-04-757Z.md +0 -76
  63. package/.claude/quality-gate.json +0 -82
  64. package/.claude/rag/skill-index.json +0 -135
  65. package/.claude/settings.json +0 -99
  66. package/.claude/settings.local.json +0 -175
  67. package/.claude/templates/PROJECT_KICKOFF.md +0 -89
  68. package/.claude/templates/PROJECT_PROPOSAL.md +0 -227
  69. package/.claude/templates/TASK_PLAN.md +0 -121
  70. package/.claude/templates/hooks/README.md +0 -302
  71. package/.claude/templates/hooks/hook.sh.template +0 -94
  72. package/.claude/templates/hooks/user-prompt-submit.cjs.template +0 -116
  73. package/.claude/templates/hooks/user-response-submit.cjs.template +0 -94
  74. package/.claude/templates/hooks/validate.js +0 -173
  75. package/.claude/templates/tasks/develop.md +0 -69
  76. package/.claude/templates/tasks/research.md +0 -64
  77. package/.claude/templates/tasks/test.md +0 -96
  78. package/.claude/thinking-routes/.last-sync +0 -1
  79. package/.claude/thinking-routes/QUICKREF.md +0 -98
  80. package/.claude/workflow/document-scanner.js +0 -426
  81. package/.claude/workflow/knowledge-engine.js +0 -941
  82. package/.claude/workflow/notebooklm/browser.js +0 -1028
  83. package/.claude/workflow/phases/phase1-research.js +0 -578
  84. package/.claude/workflow/phases/phase1-research.ts +0 -465
  85. package/.claude/workflow/phases/phase2-approve.js +0 -722
  86. package/.claude/workflow/phases/phase3-plan.js +0 -1200
  87. package/.claude/workflow/phases/phase4-develop.js +0 -894
  88. package/.claude/workflow/search-cache.js +0 -230
  89. package/.claude/workflow/templates/approval.md +0 -315
  90. package/.claude/workflow/templates/development.md +0 -377
  91. package/.claude/workflow/templates/planning.md +0 -328
  92. package/.claude/workflow/templates/research.md +0 -250
  93. package/.claude/workflow/types.js +0 -37
  94. package/.claude/workflow/web-search.js +0 -278
  95. package/.claude-plugin/marketplace.json +0 -71
  96. package/.github/workflows/sync-skills.yml +0 -74
  97. package/.versionrc +0 -25
  98. package/AGENTS.md +0 -580
  99. package/CHANGELOG.md +0 -481
  100. package/CLAUDE-template.md +0 -114
  101. package/DEV_TOOLS_GUIDE.md +0 -190
  102. package/PROJECT_STRUCTURE.md +0 -266
  103. package/Q&A.md +0 -325
  104. package/config/defaults.json +0 -34
  105. package/config/official-skills.json +0 -183
  106. package/config/quality-gate.json +0 -67
  107. package/config/skill-categories.json +0 -40
  108. package/config/version-manifest.json +0 -85
  109. package/demos/power-3d-scatter.html +0 -683
  110. package/development/cache/web-search/search_1193d605f8eb364651fc2f2041b58a31.json +0 -36
  111. package/development/cache/web-search/search_3798bf06960edc125f744a1abb5b72c5.json +0 -36
  112. package/development/cache/web-search/search_37c7d4843a53f0d83f1122a6f908a2a3.json +0 -36
  113. package/development/cache/web-search/search_44166fa0153709ee168485a22aa0ab40.json +0 -36
  114. package/development/cache/web-search/search_4deaebb1f77e86a8ca066dc5a49c59fd.json +0 -36
  115. package/development/cache/web-search/search_94da91789466070a7f545612e73c7372.json +0 -36
  116. package/development/cache/web-search/search_dd5de8491b8b803a3cb01339cd210fb0.json +0 -36
  117. package/development/knowledge-base/.index.clean.json +0 -1
  118. package/development/knowledge-base/.index.json +0 -486
  119. package/development/knowledge-base/test-best-practices.md +0 -29
  120. package/development/projects/proj_mkh1pazz_ixmt1/phase1/feasibility-report.md +0 -160
  121. package/development/projects/proj_mkh4jvnb_z7rwf/phase1/feasibility-report.md +0 -160
  122. package/development/projects/proj_mkh4jxkd_ewz5a/phase1/feasibility-report.md +0 -160
  123. package/development/projects/proj_mkh4k84n_ni73k/phase1/feasibility-report.md +0 -160
  124. package/development/projects/proj_mkh4wfyd_u9w88/phase1/feasibility-report.md +0 -160
  125. package/development/projects/proj_mkh4wsbo_iahvf/development/projects/proj_mkh4xbpg_4na5w/phase1/feasibility-report.md +0 -160
  126. package/development/projects/proj_mkh4wsbo_iahvf/phase1/feasibility-report.md +0 -160
  127. package/development/projects/proj_mkh4xulg_1ka8x/phase1/feasibility-report.md +0 -160
  128. package/development/projects/proj_mkh4xwhj_gch8j/phase1/feasibility-report.md +0 -160
  129. package/development/projects/proj_mkh4y2qk_9lm8z/phase1/feasibility-report.md +0 -160
  130. package/development/projects/proj_mkh4y2qk_9lm8z/phase2/requirements.md +0 -226
  131. package/development/projects/proj_mkh4y2qk_9lm8z/phase3/PRD.md +0 -345
  132. package/development/projects/proj_mkh4y2qk_9lm8z/phase3/TASK_PLAN.md +0 -284
  133. package/development/projects/proj_mkh4y2qk_9lm8z/phase3/prototype/README.md +0 -14
  134. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/DEVELOPMENT_LOG.md +0 -35
  135. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/TASKS.md +0 -34
  136. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/.env.example +0 -5
  137. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/README.md +0 -60
  138. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/package.json +0 -25
  139. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/src/index.js +0 -70
  140. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/src/routes/index.js +0 -48
  141. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/tests/health.test.js +0 -20
  142. package/development/projects/proj_mkh4y2qk_9lm8z/phase4/source/tests/jest.config.js +0 -21
  143. package/development/projects/proj_mkh7veqg_3lypc/phase1/feasibility-report.md +0 -160
  144. package/development/projects/proj_mkh7veqg_3lypc/phase2/requirements.md +0 -226
  145. package/development/projects/proj_mkh7veqg_3lypc/phase3/PRD.md +0 -345
  146. package/development/projects/proj_mkh7veqg_3lypc/phase3/TASK_PLAN.md +0 -284
  147. package/development/projects/proj_mkh7veqg_3lypc/phase3/prototype/README.md +0 -14
  148. package/development/projects/proj_mkh8k8fo_rmqn5/phase1/feasibility-report.md +0 -160
  149. package/development/projects/proj_mkh8xyhy_1vshq/phase1/feasibility-report.md +0 -178
  150. package/development/projects/proj_mkh8zddd_dhamf/phase1/feasibility-report.md +0 -377
  151. package/development/projects/proj_mkh8zddd_dhamf/phase2/requirements.md +0 -442
  152. package/development/projects/proj_mkh8zddd_dhamf/phase3/api-design.md +0 -800
  153. package/development/projects/proj_mkh8zddd_dhamf/phase3/architecture.md +0 -625
  154. package/development/projects/proj_mkh8zddd_dhamf/phase3/data-model.md +0 -830
  155. package/development/projects/proj_mkh8zddd_dhamf/phase3/risks.md +0 -957
  156. package/development/projects/proj_mkh8zddd_dhamf/phase3/wbs.md +0 -381
  157. package/development/todos/.state.json +0 -19
  158. package/development/todos/INDEX.md +0 -63
  159. package/development/todos/active/_README.md +0 -49
  160. package/development/todos/archived/_README.md +0 -11
  161. package/development/todos/backlog/_README.md +0 -11
  162. package/development/todos/backlog/mcp-integration.md +0 -35
  163. package/development/todos/completed/_README.md +0 -11
  164. package/development/todos/completed/boris-optimizations.md +0 -39
  165. package/development/todos/completed/develop/local-knowledge-index.md +0 -85
  166. package/development/todos/completed/develop/todo-system.md +0 -47
  167. package/development/todos/completed/develop/web-search-integration.md +0 -83
  168. package/development/todos/completed/test/phase1-e2e-test.md +0 -103
  169. package/docs/DEVELOPMENT.md +0 -461
  170. package/docs/MARKETPLACE.md +0 -352
  171. package/docs/RELEASE.md +0 -93
  172. package/jest.config.js +0 -63
  173. package/lib/commands.js +0 -3588
  174. package/lib/config-manager.js +0 -441
  175. package/lib/config-schema.js +0 -408
  176. package/lib/config-validator.js +0 -330
  177. package/lib/config.js +0 -122
  178. package/lib/errors.js +0 -305
  179. package/lib/incremental-sync.js +0 -274
  180. package/lib/marketplace.js +0 -487
  181. package/lib/migrations.js +0 -154
  182. package/lib/permission-audit.js +0 -255
  183. package/lib/quality-gate.js +0 -431
  184. package/lib/quality-rules.js +0 -373
  185. package/lib/utils.js +0 -150
  186. package/lib/version-check.js +0 -169
  187. package/lib/version-manifest.js +0 -171
  188. package/project-paradigm.md +0 -313
  189. package/prompts/how-to-find.md +0 -163
  190. package/prompts/linus-architect.md +0 -71
  191. package/prompts/software-architect.md +0 -173
  192. package/prompts/web-designer.md +0 -249
  193. package/scripts/fix-hooks.mjs +0 -97
  194. package/scripts/sync-external.mjs +0 -298
  195. package/scripts/sync-to-home.sh +0 -108
  196. package/scripts/update-registry.mjs +0 -325
  197. package/sources.yaml +0 -83
  198. package/tests/README.md +0 -263
  199. package/tests/commands.test.js +0 -1086
  200. package/tests/config-manager.test.js +0 -677
  201. package/tests/config-schema.test.js +0 -425
  202. package/tests/config-validator.test.js +0 -436
  203. package/tests/config.test.js +0 -100
  204. package/tests/errors.test.js +0 -477
  205. package/tests/manual/phase1-e2e.sh +0 -389
  206. package/tests/manual/phase2-test-cases.md +0 -311
  207. package/tests/manual/phase3-test-cases.md +0 -309
  208. package/tests/manual/phase4-test-cases.md +0 -414
  209. package/tests/manual/test-cases.md +0 -417
  210. package/tests/marketplace.test.js +0 -420
  211. package/tests/migrations.test.js +0 -187
  212. package/tests/quality-gate.test.js +0 -679
  213. package/tests/quality-rules.test.js +0 -619
  214. package/tests/sync-external.test.js +0 -214
  215. package/tests/update-registry.test.js +0 -251
  216. package/tests/utils.test.js +0 -171
  217. package/tests/version-check.test.js +0 -75
  218. package/tests/web-search.test.js +0 -392
  219. package/thinkinglens-silent.md +0 -138
@@ -1,389 +0,0 @@
1
- #!/bin/bash
2
- # Phase 1 End-to-End Test Script
3
- # Tests the complete Phase 1 workflow: project creation, knowledge query, validation
4
-
5
- # Don't exit on error - we want to run all tests
6
- set +e
7
-
8
- # Colors for output
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- NC='\033[0m' # No Color
13
-
14
- # Test counters
15
- TESTS_PASSED=0
16
- TESTS_FAILED=0
17
-
18
- # Helper functions
19
- print_header() {
20
- echo -e "\n${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
21
- echo -e "${YELLOW} $1${NC}"
22
- echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
23
- }
24
-
25
- print_test() {
26
- echo -e "\n${YELLOW}▶ $1${NC}"
27
- }
28
-
29
- print_pass() {
30
- echo -e "${GREEN}✅ PASSED: $1${NC}"
31
- ((TESTS_PASSED++))
32
- }
33
-
34
- print_fail() {
35
- echo -e "${RED}❌ FAILED: $1${NC}"
36
- ((TESTS_FAILED++))
37
- }
38
-
39
- # Create a temp directory for test outputs
40
- TEST_TEMP_DIR=$(mktemp -d)
41
- trap "rm -rf $TEST_TEMP_DIR" EXIT
42
-
43
- # ============================================================================
44
- # Test Suite: Phase 1 End-to-End
45
- # ============================================================================
46
-
47
- print_header "Phase 1 End-to-End Test Suite"
48
-
49
- echo "Test temp directory: $TEST_TEMP_DIR"
50
- echo "Working directory: $(pwd)"
51
-
52
- # ============================================================================
53
- # TC-001: Basic Workflow Flow
54
- # ============================================================================
55
-
56
- print_header "TC-001: Basic Workflow Flow"
57
-
58
- print_test "Creating a new project with 'smc workflow start'"
59
- PROJECT_IDEA="构建一个简单的个人博客系统,支持Markdown文章发布"
60
-
61
- if smc workflow start "$PROJECT_IDEA" > "$TEST_TEMP_DIR/start-output.txt" 2>&1; then
62
- print_pass "Project creation command executed"
63
-
64
- # Extract the actual project ID from output
65
- # Format: Project ID: proj_xxx[ANSI codes]
66
- # Extract using sed to get proj_<alphanumeric> pattern
67
- PROJECT_ID=$(grep "Project ID:" "$TEST_TEMP_DIR/start-output.txt" | sed -n 's/.*Project ID: *proj_\([a-zA-Z0-9_]*\).*/proj_\1/p')
68
-
69
- if [ -n "$PROJECT_ID" ]; then
70
- print_pass "Project ID extracted: $PROJECT_ID"
71
-
72
- # Check if project directory was created
73
- if [ -d "development/projects/$PROJECT_ID" ]; then
74
- print_pass "Project directory created: development/projects/$PROJECT_ID"
75
- else
76
- print_fail "Project directory not found"
77
- fi
78
-
79
- # Check if phase1 directory exists
80
- if [ -d "development/projects/$PROJECT_ID/phase1" ]; then
81
- print_pass "Phase 1 directory created"
82
- else
83
- print_fail "Phase 1 directory not found"
84
- fi
85
-
86
- # Check if feasibility-report.md exists
87
- REPORT_PATH="development/projects/$PROJECT_ID/phase1/feasibility-report.md"
88
- if [ -f "$REPORT_PATH" ]; then
89
- print_pass "Feasibility report created: $REPORT_PATH"
90
-
91
- # Check report has required sections (accept both English and Chinese headers)
92
- if grep -q "# Feasibility Analysis Report\|# 可行性分析报告" "$REPORT_PATH"; then
93
- print_pass "Report has title"
94
- else
95
- print_fail "Report missing title"
96
- fi
97
-
98
- if grep -q "## Requirements Summary\|## 需求概述" "$REPORT_PATH"; then
99
- print_pass "Report has 需求概述 section"
100
- else
101
- print_fail "Report missing 需求概述 section"
102
- fi
103
-
104
- # Save report path for later tests
105
- echo "$REPORT_PATH" > "$TEST_TEMP_DIR/report_path.txt"
106
- else
107
- print_fail "Feasibility report not found at $REPORT_PATH"
108
- fi
109
- else
110
- print_fail "Could not extract project ID from output"
111
- cat "$TEST_TEMP_DIR/start-output.txt"
112
- fi
113
- else
114
- print_fail "Project creation command failed"
115
- cat "$TEST_TEMP_DIR/start-output.txt"
116
- fi
117
-
118
- # Set REPORT_PATH for subsequent tests
119
- if [ -f "$TEST_TEMP_DIR/report_path.txt" ]; then
120
- REPORT_PATH=$(cat "$TEST_TEMP_DIR/report_path.txt")
121
- PROJECT_ID=$(echo "$REPORT_PATH" | sed 's|.*/projects/\([^/]*\)/.*|\1|')
122
- fi
123
-
124
- # ============================================================================
125
- # TC-002: Workflow Status Command
126
- # ============================================================================
127
-
128
- print_header "TC-002: Workflow Status Command"
129
-
130
- print_test "Running 'smc workflow status'"
131
- if smc workflow status > "$TEST_TEMP_DIR/status-output.txt" 2>&1; then
132
- print_pass "Status command executed"
133
-
134
- # Check if our project is listed
135
- # Use string containment instead of regex to avoid bracket issues
136
- if grep -Fq "$PROJECT_ID" "$TEST_TEMP_DIR/status-output.txt" 2>/dev/null; then
137
- print_pass "Project listed in status output"
138
- else
139
- print_fail "Project not found in status output"
140
- fi
141
- else
142
- print_fail "Status command failed"
143
- fi
144
-
145
- # ============================================================================
146
- # TC-003: Workflow Validate Command
147
- # ============================================================================
148
-
149
- print_header "TC-003: Workflow Validate Command"
150
-
151
- print_test "Running 'smc workflow validate'"
152
- if [ -f "$REPORT_PATH" ]; then
153
- if smc workflow validate "$REPORT_PATH" > "$TEST_TEMP_DIR/validate-output.txt" 2>&1; then
154
- print_pass "Validate command executed"
155
-
156
- # Check validation result
157
- if grep -q "PASSED" "$TEST_TEMP_DIR/validate-output.txt" || grep -q "BLOCKER" "$TEST_TEMP_DIR/validate-output.txt"; then
158
- print_pass "Validation returned a result"
159
- else
160
- print_fail "Validation result unclear"
161
- fi
162
- else
163
- print_fail "Validate command failed"
164
- cat "$TEST_TEMP_DIR/validate-output.txt"
165
- fi
166
- else
167
- print_fail "Report file not found for validation"
168
- fi
169
-
170
- # ============================================================================
171
- # TC-004: Knowledge Base - List Command
172
- # ============================================================================
173
-
174
- print_header "TC-004: Knowledge Base - List Command"
175
-
176
- print_test "Running 'smc knowledge list'"
177
- if smc knowledge list > "$TEST_TEMP_DIR/knowledge-list.txt" 2>&1; then
178
- print_pass "Knowledge list command executed"
179
-
180
- # Check output format
181
- if grep -q "Knowledge Sources" "$TEST_TEMP_DIR/knowledge-list.txt" || grep -q "知识源" "$TEST_TEMP_DIR/knowledge-list.txt" || [ -s "$TEST_TEMP_DIR/knowledge-list.txt" ]; then
182
- print_pass "Knowledge list returned output"
183
- fi
184
- else
185
- print_fail "Knowledge list command failed"
186
- fi
187
-
188
- # ============================================================================
189
- # TC-005: Knowledge Base - Query Command
190
- # ============================================================================
191
-
192
- print_header "TC-005: Knowledge Base - Query Command"
193
-
194
- print_test "Running 'smc knowledge query'"
195
- if smc knowledge query "API设计" > "$TEST_TEMP_DIR/knowledge-query.txt" 2>&1; then
196
- print_pass "Knowledge query command executed"
197
-
198
- # Check if results were returned
199
- if grep -q "Found\|Results\|结果\|No relevant" "$TEST_TEMP_DIR/knowledge-query.txt" || [ -s "$TEST_TEMP_DIR/knowledge-query.txt" ]; then
200
- print_pass "Query returned results"
201
- fi
202
- else
203
- print_fail "Knowledge query command failed"
204
- fi
205
-
206
- # ============================================================================
207
- # TC-006: Knowledge Base - Add Command
208
- # ============================================================================
209
-
210
- print_header "TC-006: Knowledge Base - Add Command"
211
-
212
- print_test "Running 'smc knowledge add' with test file"
213
- TEST_DOC="$TEST_TEMP_DIR/test-doc.md"
214
- cat > "$TEST_DOC" << 'EOF'
215
- # Test Best Practices
216
-
217
- This is a test document for knowledge base.
218
-
219
- ## API Design
220
-
221
- - Use REST principles
222
- - Version your APIs
223
- - Return meaningful error messages
224
-
225
- ## Testing
226
-
227
- - Write unit tests
228
- - Aim for 80% coverage
229
- EOF
230
-
231
- if smc knowledge add "$TEST_DOC" > "$TEST_TEMP_DIR/knowledge-add.txt" 2>&1; then
232
- print_pass "Knowledge add command executed"
233
-
234
- # Verify it was added by querying
235
- if smc knowledge query "REST principles" > "$TEST_TEMP_DIR/knowledge-query-2.txt" 2>&1; then
236
- if grep -q "REST" "$TEST_TEMP_DIR/knowledge-query-2.txt"; then
237
- print_pass "Added document found in query results"
238
- fi
239
- fi
240
- else
241
- print_fail "Knowledge add command failed"
242
- fi
243
-
244
- # ============================================================================
245
- # TC-007: Knowledge Base - Cache Commands
246
- # ============================================================================
247
-
248
- print_header "TC-007: Knowledge Base - Cache Commands"
249
-
250
- print_test "Running 'smc knowledge cache stats'"
251
- if smc knowledge cache stats > "$TEST_TEMP_DIR/cache-stats.txt" 2>&1; then
252
- print_pass "Cache stats command executed"
253
- else
254
- print_fail "Cache stats command failed"
255
- fi
256
-
257
- # ============================================================================
258
- # TC-008: Workflow List Command
259
- # ============================================================================
260
-
261
- print_header "TC-008: Workflow List Command"
262
-
263
- print_test "Running 'smc workflow list'"
264
- if smc workflow list > "$TEST_TEMP_DIR/workflow-list.txt" 2>&1; then
265
- print_pass "Workflow list command executed"
266
-
267
- # Check if our project is listed
268
- if grep -Fq "$PROJECT_ID" "$TEST_TEMP_DIR/workflow-list.txt" 2>/dev/null; then
269
- print_pass "Test project found in list"
270
- fi
271
- else
272
- print_fail "Workflow list command failed"
273
- fi
274
-
275
- # ============================================================================
276
- # TC-PHASE2-01: Phase 2 - Next Command
277
- # ============================================================================
278
-
279
- print_header "TC-PHASE2-01: Phase 2 - Next Command"
280
-
281
- print_test "Running 'smc workflow next' to advance to Phase 2"
282
- if smc workflow next > "$TEST_TEMP_DIR/phase2-start.txt" 2>&1; then
283
- print_pass "Phase 2 next command executed"
284
-
285
- # Extract Phase 2 project ID
286
- PHASE2_ID=$(grep "Project:" "$TEST_TEMP_DIR/phase2-start.txt" | sed 's/.*Project: //' | sed -n 's/proj_\([a-zA-Z0-9_]*\).*/proj_\1/p')
287
-
288
- # Check if requirements file was created
289
- if [ -f "$REPORT_PATH" ]; then
290
- # Get project ID from report path
291
- PROJECT_DIR=$(dirname "$(dirname "$REPORT_PATH")")
292
- REQ_PATH="$PROJECT_DIR/phase2/requirements.md"
293
-
294
- if [ -f "$REQ_PATH" ]; then
295
- print_pass "Requirements document created"
296
- else
297
- print_fail "Requirements document not found"
298
- fi
299
- else
300
- print_fail "Could not determine project directory"
301
- fi
302
- else
303
- print_fail "Phase 2 next command failed"
304
- fi
305
-
306
- # ============================================================================
307
- # TC-PHASE2-02: Phase 2 - Status Display
308
- # ============================================================================
309
-
310
- print_header "TC-PHASE2-02: Phase 2 - Status Display"
311
-
312
- print_test "Checking workflow status shows Phase 2"
313
- if smc workflow status > "$TEST_TEMP_DIR/phase2-status.txt" 2>&1; then
314
- print_pass "Status command executed"
315
-
316
- # Check if Phase 2 projects are shown with correct icon
317
- if grep -q "🤝" "$TEST_TEMP_DIR/phase2-status.txt"; then
318
- print_pass "Phase 2 icon displayed in status"
319
- fi
320
-
321
- # Check if "Phase: 2 - Approval" is shown
322
- if grep -q "Phase: 2 - Approval" "$TEST_TEMP_DIR/phase2-status.txt"; then
323
- print_pass "Phase 2 name displayed correctly"
324
- fi
325
- else
326
- print_fail "Status command failed"
327
- fi
328
-
329
- # ============================================================================
330
- # TC-PHASE2-03: Phase 2 - Requirements Validation
331
- # ============================================================================
332
-
333
- print_header "TC-PHASE2-03: Phase 2 - Requirements Validation"
334
-
335
- print_test "Validating Phase 2 requirements document"
336
-
337
- # Find the latest requirements file
338
- REQ_FILE=$(find development/projects -name "requirements.md" -type f 2>/dev/null | head -1)
339
-
340
- if [ -n "$REQ_FILE" ] && [ -f "$REQ_FILE" ]; then
341
- if smc workflow validate "$REQ_FILE" > "$TEST_TEMP_DIR/phase2-validate.txt" 2>&1; then
342
- print_pass "Requirements validation command executed"
343
-
344
- # Check validation result
345
- if grep -q "PASSED\|FAILED" "$TEST_TEMP_DIR/phase2-validate.txt"; then
346
- print_pass "Validation returned a result"
347
- fi
348
- else
349
- print_fail "Requirements validation command failed"
350
- fi
351
- else
352
- print_fail "No requirements file found to validate"
353
- fi
354
-
355
- # ============================================================================
356
- # TC-PHASE2-04: Phase 2 - Approve Command
357
- # ============================================================================
358
-
359
- print_header "TC-PHASE2-04: Phase 2 - Approve Command"
360
-
361
- print_test "Testing 'smc workflow approve' with project ID"
362
-
363
- # Get a project that only has Phase 1
364
- PHASE1_ONLY=$(smc workflow status | grep -B1 "Phase: 1" | grep "^🔍" | head -1 | sed 's/.*proj_/proj_/' | sed 's/ .*//')
365
-
366
- if [ -n "$PHASE1_ONLY" ]; then
367
- # We already have a Phase 2 project from previous test, so skip this
368
- print_pass "Approve command available (skipped to avoid duplicate Phase 2)"
369
- else
370
- print_fail "Could not find Phase 1 project"
371
- fi
372
-
373
- # ============================================================================
374
- # Test Results Summary
375
- # ============================================================================
376
-
377
- print_header "Test Results Summary"
378
-
379
- echo -e "${GREEN}Tests Passed: $TESTS_PASSED${NC}"
380
- echo -e "${RED}Tests Failed: $TESTS_FAILED${NC}"
381
- echo -e "Total Tests: $((TESTS_PASSED + TESTS_FAILED))"
382
-
383
- if [ $TESTS_FAILED -eq 0 ]; then
384
- echo -e "\n${GREEN}🎉 All tests passed!${NC}"
385
- exit 0
386
- else
387
- echo -e "\n${RED}⚠️ Some tests failed. Check output above.${NC}"
388
- exit 1
389
- fi
@@ -1,311 +0,0 @@
1
- # Phase 2 E2E Test Cases
2
-
3
- > **版本**: 1.0
4
- > **日期**: 2026-01-17
5
- > **状态**: ✅ 已完成
6
-
7
- ---
8
-
9
- ## 测试概述
10
-
11
- 本文档定义了 Phase 2(审批阶段)的端到端测试用例。
12
-
13
- ### 测试范围
14
-
15
- | 模块 | 测试内容 |
16
- |------|----------|
17
- | Phase 2 CLI | approve/next/status 命令 |
18
- | Requirements Generation | 需求文档生成 |
19
- | Approval Validator | 需求文档质量检查 |
20
- | Phase Transition | Phase 1 → Phase 2 流转 |
21
-
22
- ---
23
-
24
- ## TC-201: Phase 2 启动
25
-
26
- ### 描述
27
- 验证从 Phase 1 进入 Phase 2 的完整流程。
28
-
29
- ### 前置条件
30
- - Phase 1 可行性报告已生成
31
-
32
- ### 测试步骤
33
-
34
- ```bash
35
- # 1. 启动 Phase 2 (使用 next 命令自动选择最新项目)
36
- smc workflow next
37
-
38
- # 2. 或者指定项目 ID
39
- smc workflow approve proj_xxx
40
-
41
- # 3. 检查 phase2 目录是否创建
42
- ls development/projects/proj_xxx/phase2/
43
-
44
- # 4. 查看需求文档
45
- cat development/projects/proj_xxx/phase2/requirements.md
46
- ```
47
-
48
- ### 预期结果
49
-
50
- | 步骤 | 预期输出 |
51
- |------|----------|
52
- | 1 | `✅ Phase 2 initialized!` |
53
- | 2 | 同上 |
54
- | 3 | `requirements.md` 文件存在 |
55
- | 4 | 报告包含以下章节:<br>- Executive Summary<br>- Phase 1 Summary<br>- Clarification Questions<br>- Functional Requirements<br>- Non-Functional Requirements<br>- Success Metrics<br>- Edge Cases |
56
-
57
- ### 实际结果
58
- _(测试后填写)_
59
-
60
- ### 状态
61
- - [x] 通过
62
- - [ ] 失败
63
-
64
- ---
65
-
66
- ## TC-202: 工作流状态查询
67
-
68
- ### 描述
69
- 验证 `smc workflow status` 正确显示 Phase 2 状态。
70
-
71
- ### 前置条件
72
- - 至少有一个项目已进入 Phase 2
73
-
74
- ### 测试步骤
75
-
76
- ```bash
77
- # 查询工作流状态
78
- smc workflow status
79
- ```
80
-
81
- ### 预期结果
82
-
83
- | 字段 | 说明 |
84
- |------|------|
85
- | Phase Icon | 🤝 (Phase 2) |
86
- | Phase Number | 2 - Approval |
87
- | Phase 1 Status | ✅ Phase 1: feasibility-report.md |
88
- | Phase 2 Status | ✅ Phase 2: requirements.md |
89
-
90
- ### 状态
91
- - [x] 通过
92
- - [ ] 失败
93
-
94
- ---
95
-
96
- ## TC-203: 需求文档验证
97
-
98
- ### 描述
99
- 验证需求文档质量检查功能。
100
-
101
- ### 前置条件
102
- - 需求文档已生成
103
-
104
- ### 测试步骤
105
-
106
- ```bash
107
- # 验证需求文档
108
- smc workflow validate development/projects/proj_xxx/phase2/requirements.md
109
- ```
110
-
111
- ### 预期结果
112
-
113
- | 场景 | 预期输出 |
114
- |------|----------|
115
- | 完整文档 | `✅ PASSED` - 5项检查全部通过 |
116
- | 不完整文档 | `❌ FAILED` - 列出缺失字段 |
117
-
118
- ### 需求验证检查项
119
-
120
- 1. **Clear Requirements** (hasClearRequirements) - 需求描述清晰
121
- 2. **Acceptance Criteria** (hasAcceptanceCriteria) - 有验收标准
122
- 3. **Technical Rationale** (hasTechRationale) - 技术选型有依据
123
- 4. **Success Metrics** (hasSuccessMetrics) - 有成功指标
124
- 5. **Edge Cases** (hasEdgeCases) - 考虑了边缘情况
125
-
126
- ### 状态
127
- - [x] 通过
128
- - [ ] 失败
129
-
130
- ---
131
-
132
- ## TC-204: 澄清问题生成
133
-
134
- ### 描述
135
- 验证基于 Phase 1 报告自动生成澄清问题。
136
-
137
- ### 前置条件
138
- - Phase 1 报告包含完整信息
139
-
140
- ### 测试步骤
141
-
142
- ```bash
143
- # 查看生成的需求文档
144
- grep -A 50 "Clarification Questions" development/projects/proj_xxx/phase2/requirements.md
145
- ```
146
-
147
- ### 预期结果
148
-
149
- 生成的澄清问题应包含:
150
- 1. **Scope & Priorities** - MVP 范围和优先级
151
- 2. **Technical Decisions** - 技术决策确认
152
- 3. **Success Definition** - 成功标准定义
153
- 4. **Constraints** - 约束条件
154
-
155
- ### 状态
156
- - [x] 通过
157
- - [ ] 失败
158
-
159
- ---
160
-
161
- ## TC-205: approve 命令指定项目
162
-
163
- ### 描述
164
- 验证使用指定项目 ID 启动 Phase 2。
165
-
166
- ### 前置条件
167
- - 至少有一个已完成 Phase 1 的项目
168
-
169
- ### 测试步骤
170
-
171
- ```bash
172
- # 获取项目列表
173
- smc workflow status
174
-
175
- # 使用 approve 命令指定项目
176
- smc workflow approve proj_xxx
177
- ```
178
-
179
- ### 预期结果
180
-
181
- | 步骤 | 预期输出 |
182
- |------|----------|
183
- | 1 | 列出所有项目及其阶段 |
184
- | 2 | `✅ Phase 2 initialized!` |
185
-
186
- ### 状态
187
- - [x] 通过
188
- - [ ] 失败
189
-
190
- ---
191
-
192
- ## TC-206: 需求文档模板结构
193
-
194
- ### 描述
195
- 验证需求文档模板包含所有必需章节。
196
-
197
- ### 前置条件
198
- - Phase 2 已启动
199
-
200
- ### 测试步骤
201
-
202
- ```bash
203
- # 检查文档章节
204
- grep "^##" development/projects/proj_xxx/phase2/requirements.md
205
- ```
206
-
207
- ### 预期结果
208
-
209
- 文档应包含以下章节:
210
- - Executive Summary
211
- - Phase 1 Summary
212
- - Clarification Questions & Responses
213
- - Functional Requirements
214
- - Non-Functional Requirements
215
- - Success Metrics
216
- - Edge Cases & Constraints
217
- - Assumptions & Dependencies
218
- - Out of Scope
219
- - Approval Checklist
220
- - Next Steps
221
-
222
- ### 状态
223
- - [x] 通过
224
- - [ ] 失败
225
-
226
- ---
227
-
228
- ## TC-207: 自动验证器检测
229
-
230
- ### 描述
231
- 验证验证器能正确识别不完整的需求文档。
232
-
233
- ### 前置条件
234
- - 有一个需求文档
235
-
236
- ### 测试步骤
237
-
238
- ```bash
239
- # 创建一个不完整的需求文档
240
- cat > /tmp/incomplete-req.md << 'EOF'
241
- # Requirements Document
242
-
243
- ## Executive Summary
244
- Incomplete document.
245
- EOF
246
-
247
- # 验证不完整文档
248
- smc workflow validate /tmp/incomplete-req.md
249
- ```
250
-
251
- ### 预期结果
252
-
253
- 验证器应返回:
254
- - `❌ FAILED`
255
- - 列出缺失的检查项
256
-
257
- ### 状态
258
- - [x] 通过
259
- - [ ] 失败
260
-
261
- ---
262
-
263
- ## 测试执行记录
264
-
265
- ### 测试环境
266
-
267
- | 项目 | 值 |
268
- |------|-----|
269
- | 操作系统 | macOS Darwin 23.6.0 |
270
- | Node.js 版本 | v22.x |
271
- | CLI 版本 | 1.1.2 |
272
-
273
- ### 执行日期
274
- 2026-01-17
275
-
276
- ### 结果汇总
277
-
278
- | 用例编号 | 用例名称 | 状态 | 备注 |
279
- |----------|----------|------|------|
280
- | TC-201 | Phase 2 启动 | ✅ 通过 | |
281
- | TC-202 | 工作流状态查询 | ✅ 通过 | 正确显示 Phase 2 状态 |
282
- | TC-203 | 需求文档验证 | ✅ 通过 | 所有检查项通过 |
283
- | TC-204 | 澄清问题生成 | ✅ 通过 | 4类问题已生成 |
284
- | TC-205 | approve 命令指定项目 | ✅ 通过 | |
285
- | TC-206 | 需求文档模板结构 | ✅ 通过 | 所有章节存在 |
286
- | TC-207 | 自动验证器检测 | ✅ 通过 | |
287
-
288
- ### 通过率
289
- 100% (7/7)
290
-
291
- ---
292
-
293
- ## 快速测试命令
294
-
295
- ```bash
296
- # 完整 Phase 2 流程测试
297
- smc workflow start "测试想法" # Phase 1
298
- smc workflow next # Phase 2
299
- smc workflow validate development/projects/*/phase2/requirements.md
300
- smc workflow status # 查看状态
301
-
302
- # 验证测试
303
- # 创建完整需求文档
304
- smc workflow validate <完整需求文档路径>
305
- # 预期: ✅ PASSED
306
-
307
- # 创建不完整需求文档
308
- echo "# Incomplete" > /tmp/test.md
309
- smc workflow validate /tmp/test.md
310
- # 预期: ❌ FAILED with blockers
311
- ```