sillyspec 3.20.2 → 3.20.4

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 (133) hide show
  1. package/.claude/skills/sillyspec-archive/SKILL.md +21 -21
  2. package/.claude/skills/sillyspec-auto/SKILL.md +83 -83
  3. package/.claude/skills/sillyspec-brainstorm/SKILL.md +44 -44
  4. package/.claude/skills/sillyspec-commit/SKILL.md +106 -106
  5. package/.claude/skills/sillyspec-continue/SKILL.md +45 -45
  6. package/.claude/skills/sillyspec-doctor/SKILL.md +31 -31
  7. package/.claude/skills/sillyspec-execute/SKILL.md +30 -30
  8. package/.claude/skills/sillyspec-explore/SKILL.md +109 -109
  9. package/.claude/skills/sillyspec-knowledge/SKILL.md +269 -269
  10. package/.claude/skills/sillyspec-plan/SKILL.md +21 -21
  11. package/.claude/skills/sillyspec-propose/SKILL.md +21 -21
  12. package/.claude/skills/sillyspec-quick/SKILL.md +21 -21
  13. package/.claude/skills/sillyspec-resume/SKILL.md +68 -68
  14. package/.claude/skills/sillyspec-scan/SKILL.md +21 -21
  15. package/.claude/skills/sillyspec-state/SKILL.md +54 -54
  16. package/.claude/skills/sillyspec-status/SKILL.md +21 -21
  17. package/.claude/skills/sillyspec-verify/SKILL.md +21 -21
  18. package/.claude/skills/sillyspec-workspace/SKILL.md +157 -157
  19. package/.husky/pre-push +13 -13
  20. package/CLAUDE.md +18 -18
  21. package/README.md +198 -188
  22. package/SKILL.md +90 -91
  23. package/bin/sillyspec.js +2 -2
  24. package/docs/brainstorm-plan-contract.md +64 -64
  25. package/docs/plan-execute-contract.md +123 -123
  26. package/docs/platform-scan-protocol.md +298 -298
  27. package/docs/revision-mode.md +115 -115
  28. package/docs/sillyspec/file-lifecycle/known-implementation-gaps.md +99 -99
  29. package/docs/sillyspec/file-lifecycle/platform-workflows-sync.md +218 -218
  30. package/docs/sillyspec/file-lifecycle/stage-artifacts.md +167 -167
  31. package/docs/sillyspec/file-lifecycle/storage-and-state.md +148 -148
  32. package/docs/sillyspec/file-lifecycle/worktree-and-guard.md +211 -193
  33. package/docs/sillyspec/file-lifecycle.md +125 -125
  34. package/docs/workflow-contract-regression.md +106 -106
  35. package/docs/worktree-isolation.md +252 -252
  36. package/package.json +40 -40
  37. package/packages/dashboard/dist/assets/index-Bq_Z2hne.js +7446 -7446
  38. package/packages/dashboard/dist/assets/index-O2W5RV4z.css +1 -1
  39. package/packages/dashboard/dist/index.html +16 -16
  40. package/packages/dashboard/index.html +15 -15
  41. package/packages/dashboard/package-lock.json +2384 -2384
  42. package/packages/dashboard/package.json +25 -25
  43. package/packages/dashboard/server/executor.js +86 -86
  44. package/packages/dashboard/server/index.js +588 -588
  45. package/packages/dashboard/server/parser.js +526 -526
  46. package/packages/dashboard/server/watcher.js +344 -344
  47. package/packages/dashboard/src/App.vue +558 -558
  48. package/packages/dashboard/src/components/ActionBar.vue +93 -93
  49. package/packages/dashboard/src/components/CommandPalette.vue +96 -96
  50. package/packages/dashboard/src/components/DetailPanel.vue +137 -137
  51. package/packages/dashboard/src/components/LogStream.vue +65 -65
  52. package/packages/dashboard/src/components/PipelineStage.vue +95 -95
  53. package/packages/dashboard/src/components/PipelineView.vue +156 -156
  54. package/packages/dashboard/src/components/ProjectList.vue +210 -210
  55. package/packages/dashboard/src/components/StageBadge.vue +67 -67
  56. package/packages/dashboard/src/components/StepCard.vue +94 -94
  57. package/packages/dashboard/src/components/detail/DocsDetail.vue +48 -48
  58. package/packages/dashboard/src/components/detail/GitDetail.vue +61 -61
  59. package/packages/dashboard/src/components/detail/TechDetail.vue +43 -43
  60. package/packages/dashboard/src/composables/useDashboard.js +170 -170
  61. package/packages/dashboard/src/composables/useKeyboard.js +119 -119
  62. package/packages/dashboard/src/composables/useWebSocket.js +129 -129
  63. package/packages/dashboard/src/main.js +8 -8
  64. package/packages/dashboard/src/style.css +132 -132
  65. package/packages/dashboard/vite.config.js +18 -18
  66. package/src/brainstorm-postcheck.js +158 -158
  67. package/src/change-list.js +52 -52
  68. package/src/change-risk-profile.js +352 -352
  69. package/src/classify-change.js +73 -73
  70. package/src/constants.js +70 -70
  71. package/src/contract-matrix.js +278 -278
  72. package/src/db.js +201 -201
  73. package/src/endpoint-extractor.js +315 -315
  74. package/src/hooks/claude-pre-tool-use.cjs +125 -125
  75. package/src/hooks/worktree-guard.js +653 -653
  76. package/src/index.js +922 -900
  77. package/src/init.js +431 -431
  78. package/src/knowledge-match.js +130 -130
  79. package/src/migrate.js +117 -117
  80. package/src/modules.js +482 -482
  81. package/src/progress.js +1734 -1734
  82. package/src/run.js +3465 -3358
  83. package/src/scan-postcheck.js +387 -383
  84. package/src/setup.js +398 -398
  85. package/src/stage-contract.js +700 -700
  86. package/src/stages/archive.js +160 -160
  87. package/src/stages/brainstorm-auto.js +229 -229
  88. package/src/stages/brainstorm.js +645 -645
  89. package/src/stages/doctor.js +365 -365
  90. package/src/stages/execute.js +625 -625
  91. package/src/stages/explore.js +34 -34
  92. package/src/stages/index.js +29 -29
  93. package/src/stages/knowledge.js +498 -498
  94. package/src/stages/plan-postcheck.js +511 -513
  95. package/src/stages/plan.js +582 -582
  96. package/src/stages/propose.js +174 -174
  97. package/src/stages/quick.js +82 -82
  98. package/src/stages/scan.js +558 -558
  99. package/src/stages/status.js +65 -65
  100. package/src/stages/verify.js +322 -322
  101. package/src/sync.js +497 -497
  102. package/src/task-review.js +346 -346
  103. package/src/workflow.js +785 -785
  104. package/src/worktree-apply.js +549 -549
  105. package/src/worktree-deps.js +185 -0
  106. package/src/worktree.js +982 -932
  107. package/templates/workflows/archive-impact.yaml +79 -79
  108. package/templates/workflows/scan-docs.yaml +132 -132
  109. package/test/brainstorm-plan-contract.test.mjs +273 -273
  110. package/test/check-syntax.mjs +26 -26
  111. package/test/contract-artifacts.test.mjs +323 -323
  112. package/test/decision-supersede.test.mjs +277 -277
  113. package/test/knowledge-match.test.mjs +231 -231
  114. package/test/plan-execute-contract.test.mjs +330 -330
  115. package/test/plan-optimization.test.mjs +572 -572
  116. package/test/platform-artifacts.test.mjs +166 -166
  117. package/test/platform-failure-samples.test.mjs +199 -199
  118. package/test/platform-recovery-chain.test.mjs +167 -167
  119. package/test/platform-recovery.test.mjs +136 -136
  120. package/test/platform-scan-p0.test.mjs +168 -168
  121. package/test/revision-v1.test.mjs +1145 -1145
  122. package/test/run-scan-project-parse.test.mjs +200 -200
  123. package/test/run-tests.mjs +48 -48
  124. package/test/scan-knowledge.test.mjs +175 -175
  125. package/test/scan-paths.test.mjs +68 -68
  126. package/test/scan-postcheck.test.mjs +197 -197
  127. package/test/spec-dir.test.mjs +206 -206
  128. package/test/stage-contract.test.mjs +299 -299
  129. package/test/stage-definitions.test.mjs +39 -39
  130. package/test/wait-gates.test.mjs +496 -496
  131. package/test/worktree-deps-provision.test.mjs +148 -0
  132. package/test/worktree-guard.test.mjs +71 -71
  133. package/test/worktree-native-overlay.test.mjs +188 -188
@@ -1,270 +1,270 @@
1
- ---
2
- name: sillyspec:knowledge
3
- description: Agent-safe knowledge base commands for SillySpec repositories. Search, inspect, validate, refresh, and propose knowledge entries.
4
- argument-hint: "search --query \"<text>\" --limit N | inspect --id \"<id>\" | validate | refresh | propose --title \"<title>\" --category <name>"
5
- version: "3.19.2"
6
- ---
7
-
8
- ## 交互规范
9
- 当需要用户从多个选项中做出选择时,必须使用 Claude Code 内置的 AskUserQuestion 工具,将选项以参数传入。
10
-
11
- ## 何时使用此技能
12
- Use this skill when working on a SillySpec repository and the task may depend on prior project knowledge, known issues, implementation patterns, scan-derived learnings, execute-stage knowledge hits, or `.sillyspec/knowledge`.
13
-
14
- Before implementing changes, **first search the knowledge base** to avoid repeating known work or running into known issues.
15
-
16
- ## 命令列表
17
-
18
- ### 1. knowledge search — 搜索知识库
19
- 在执行任务前搜索相关知识。
20
-
21
- ```bash
22
- sillyspec knowledge search --query "<task summary>" --limit 5
23
- ```
24
-
25
- **示例:**
26
- ```bash
27
- sillyspec knowledge search --query "worktree baseline apply conflict" --limit 5
28
- sillyspec knowledge search --query "postcheck validation error"
29
- sillyspec knowledge search --query "GLM usage metadata"
30
- ```
31
-
32
- **输出(JSON):**
33
- ```json
34
- {
35
- "ok": true,
36
- "query": "worktree baseline",
37
- "matches": [
38
- {
39
- "id": "patterns",
40
- "path": "knowledge/patterns.md",
41
- "title": "Patterns",
42
- "summary": "每个阶段对应 `src/stages/` 下的独立模块...",
43
- "score": 3,
44
- "tags": ["worktree", "git-worktree", "WorktreeManager"],
45
- "category": "Patterns"
46
- }
47
- ]
48
- }
49
- ```
50
-
51
- **使用场景:**
52
- - 实现新功能前,检查是否有现有模式可复用
53
- - 遇到报错前,搜索是否是已知问题
54
- - 修改特定模块前,了解约定和坑点
55
-
56
- ---
57
-
58
- ### 2. knowledge inspect — 读取知识条目详情
59
- 搜索命中后,读取完整条目内容。
60
-
61
- ```bash
62
- sillyspec knowledge inspect --id "<knowledge-id>"
63
- ```
64
-
65
- **示例:**
66
- ```bash
67
- sillyspec knowledge inspect --id "patterns"
68
- sillyspec knowledge inspect --id "known-issues/sqljs-wasm-only"
69
- sillyspec knowledge inspect --id "generated/worktree-baseline-conflict"
70
- ```
71
-
72
- **输出(JSON):**
73
- ```json
74
- {
75
- "ok": true,
76
- "entry": {
77
- "id": "patterns",
78
- "title": "Patterns",
79
- "summary": "每个阶段对应 `src/stages/` 下的独立模块...",
80
- "zone": "manual",
81
- "path": "knowledge/patterns.md",
82
- "meta": {
83
- "author": "qinyi",
84
- "created_at": "2026-06-19T12:40:00+08:00",
85
- "updated_at": "2026-06-24T10:00:00+08:00"
86
- },
87
- "body": "完整 markdown 内容..."
88
- }
89
- }
90
- ```
91
-
92
- **zone 说明:**
93
- - `manual` — 人工维护的知识(可直接信任)
94
- - `generated` — 自动提取的知识(scan 生成,需人工审核)
95
- - `proposed` — 提议待审核的知识(未合并)
96
-
97
- ---
98
-
99
- ### 3. knowledge validate — 校验知识库健康度
100
- 在 commit/archive 前检查知识库是否可用。
101
-
102
- ```bash
103
- sillyspec knowledge validate
104
- ```
105
-
106
- **输出(JSON):**
107
- ```json
108
- {
109
- "ok": false,
110
- "errors": [
111
- {
112
- "code": "broken_reference",
113
- "path": "knowledge/generated/foo.md",
114
- "referenced_in": "INDEX.md",
115
- "display": "Foo Pattern"
116
- },
117
- {
118
- "code": "empty_file",
119
- "path": "knowledge/bar.md"
120
- }
121
- ],
122
- "warnings": [
123
- {
124
- "code": "too_many_uncategorized",
125
- "count": 12,
126
- "path": "knowledge/uncategorized.md"
127
- },
128
- {
129
- "code": "unregistered_file",
130
- "path": "knowledge/new-file.md"
131
- }
132
- ]
133
- }
134
- ```
135
-
136
- **错误码说明:**
137
- | code | 说明 |
138
- |---|---|
139
- | `knowledge_dir_missing` | `.sillyspec/knowledge/` 目录不存在 |
140
- | `missing_index` | `INDEX.md` 不存在 |
141
- | `broken_reference` | INDEX.md 引用的文件不存在 |
142
- | `empty_file` | 知识文件为空 |
143
- | `too_many_uncategorized` | uncategorized.md 条目 ≥10,需清理 |
144
- | `unregistered_file` | 手动知识文件未在 INDEX.md 注册 |
145
-
146
- ---
147
-
148
- ### 4. knowledge refresh — 从 scan 文档刷新自动知识
149
- **仅写 generated/ 区,不覆盖 manual/。**
150
-
151
- ```bash
152
- sillyspec knowledge refresh
153
- ```
154
-
155
- **使用场景:**
156
- - scan 阶段完成后,自动提取可复用知识
157
- - archive 阶段完成后,沉淀长期有效的模式
158
-
159
- **行为:**
160
- 1. 扫描 `.sillyspec/docs/<project>/scan/*.md`
161
- 2. 提取每个 `## 章节`(至少 3 行)作为知识条目
162
- 3. 写入 `.sillyspec/knowledge/generated/<slug>.md`
163
- 4. 生成 `generated/INDEX.md`
164
-
165
- **输出(JSON):**
166
- ```json
167
- {
168
- "ok": true,
169
- "generated_count": 8,
170
- "new_count": 5,
171
- "overwritten_count": 3,
172
- "files": [
173
- { "file": "generated/worktree-isolation.md", "title": "...", "new": true },
174
- { "file": "generated/progress-management.md", "title": "...", "new": false }
175
- ]
176
- }
177
- ```
178
-
179
- **注意事项:**
180
- - generated/ 区知识是自动生成,不保证准确,需人工审核后合并到 manual/
181
- - 已有文件会被覆盖( overwrite_count)
182
-
183
- ---
184
-
185
- ### 5. knowledge propose — 提议新知识
186
- 不直接编辑 manual/,而是写入 proposed/ 供审核。
187
-
188
- ```bash
189
- sillyspec knowledge propose --title "<title>" --category <category> --body "<content>" --from "<source>"
190
- ```
191
-
192
- **参数说明:**
193
- | 参数 | 必填 | 说明 |
194
- |---|---|---|
195
- | `--title` | ✅ | 知识标题 |
196
- | `--category` | ❌ | 分类(默认 uncategorized),如 known-issues, patterns, conventions |
197
- | `--body` | ❌ | 知识正文 |
198
- | `--from` | ❌ | 来源标注(如 execute/quick/scan) |
199
-
200
- **示例:**
201
- ```bash
202
- sillyspec knowledge propose --title "GLM API 超时处理" --category known-issues --body "GLM 模型默认超时 30 秒..." --from "execute"
203
- ```
204
-
205
- **输出(JSON):**
206
- ```json
207
- {
208
- "ok": true,
209
- "id": "proposed/glm-api-timeout",
210
- "path": "knowledge/proposed/glm-api-timeout.md",
211
- "title": "GLM API 超时处理",
212
- "category": "known-issues",
213
- "new": true,
214
- "action": "created"
215
- }
216
- ```
217
-
218
- **后续流程:**
219
- - archive/commit 阶段审核 proposed/ 条目
220
- - 合格的合并到 manual/,不合格的删除
221
-
222
- ---
223
-
224
- ## Agent 使用指南
225
-
226
- ### 任务前必查
227
- 在开始实现新功能、修改现有代码、或遇到报错前:
228
- 1. `knowledge search --query "<任务关键词>"`
229
- 2. 命中则 `knowledge inspect --id "<id>"`
230
- 3. 遵循知识中的约定和避坑建议
231
-
232
- ### 发现新知识
233
- 执行任务中发现可复用模式或新坑:
234
- 1. `knowledge propose --title "<标题>" --category <分类> --body "<内容>"`
235
- 2. 不要直接编辑 `.sillyspec/knowledge/manual/*.md`
236
-
237
- ### 提交前校验
238
- commit/archive 前检查知识库状态:
239
- 1. `knowledge validate`
240
- 2. 如有 errors,先修复再提交
241
-
242
- ### 扫描后刷新
243
- scan 阶段完成后:
244
- 1. `knowledge refresh`
245
- 2. 审核生成的 `generated/*.md`,有用的合并到 manual/
246
-
247
- ---
248
-
249
- ## 禁止事项
250
-
251
- ❌ **不要直接编辑** `manual/` 或 `generated/` 中的知识文件
252
- - 使用 `knowledge propose` 提议新知识
253
- - 使用 `knowledge refresh` 刷新自动知识
254
-
255
- ❌ **不要使用 `grep` 或 `cat` 直接读取知识文件**
256
- - 使用 `knowledge search` 和 `knowledge inspect`
257
- - 它们使用与 execute 阶段相同的匹配引擎
258
-
259
- ❌ **不要让 agent 去审核 proposed/ 条目**
260
- - 提议供人工审核,不要自动合并
261
- - 只有用户明确要求才合并
262
-
263
- ---
264
-
265
- ## 设计原则
266
-
267
- - **Agent-safe:** 所有输出为 JSON,失败有明确错误码
268
- - **写保护:** refresh 仅写 generated/,propose 仅写 proposed/,不碰 manual/
269
- - **匹配引擎:** 使用 `knowledge-match.js`(与 execute 阶段一致)
1
+ ---
2
+ name: sillyspec:knowledge
3
+ description: Agent-safe knowledge base commands for SillySpec repositories. Search, inspect, validate, refresh, and propose knowledge entries.
4
+ argument-hint: "search --query \"<text>\" --limit N | inspect --id \"<id>\" | validate | refresh | propose --title \"<title>\" --category <name>"
5
+ version: "3.19.2"
6
+ ---
7
+
8
+ ## 交互规范
9
+ 当需要用户从多个选项中做出选择时,必须使用 Claude Code 内置的 AskUserQuestion 工具,将选项以参数传入。
10
+
11
+ ## 何时使用此技能
12
+ Use this skill when working on a SillySpec repository and the task may depend on prior project knowledge, known issues, implementation patterns, scan-derived learnings, execute-stage knowledge hits, or `.sillyspec/knowledge`.
13
+
14
+ Before implementing changes, **first search the knowledge base** to avoid repeating known work or running into known issues.
15
+
16
+ ## 命令列表
17
+
18
+ ### 1. knowledge search — 搜索知识库
19
+ 在执行任务前搜索相关知识。
20
+
21
+ ```bash
22
+ sillyspec knowledge search --query "<task summary>" --limit 5
23
+ ```
24
+
25
+ **示例:**
26
+ ```bash
27
+ sillyspec knowledge search --query "worktree baseline apply conflict" --limit 5
28
+ sillyspec knowledge search --query "postcheck validation error"
29
+ sillyspec knowledge search --query "GLM usage metadata"
30
+ ```
31
+
32
+ **输出(JSON):**
33
+ ```json
34
+ {
35
+ "ok": true,
36
+ "query": "worktree baseline",
37
+ "matches": [
38
+ {
39
+ "id": "patterns",
40
+ "path": "knowledge/patterns.md",
41
+ "title": "Patterns",
42
+ "summary": "每个阶段对应 `src/stages/` 下的独立模块...",
43
+ "score": 3,
44
+ "tags": ["worktree", "git-worktree", "WorktreeManager"],
45
+ "category": "Patterns"
46
+ }
47
+ ]
48
+ }
49
+ ```
50
+
51
+ **使用场景:**
52
+ - 实现新功能前,检查是否有现有模式可复用
53
+ - 遇到报错前,搜索是否是已知问题
54
+ - 修改特定模块前,了解约定和坑点
55
+
56
+ ---
57
+
58
+ ### 2. knowledge inspect — 读取知识条目详情
59
+ 搜索命中后,读取完整条目内容。
60
+
61
+ ```bash
62
+ sillyspec knowledge inspect --id "<knowledge-id>"
63
+ ```
64
+
65
+ **示例:**
66
+ ```bash
67
+ sillyspec knowledge inspect --id "patterns"
68
+ sillyspec knowledge inspect --id "known-issues/sqljs-wasm-only"
69
+ sillyspec knowledge inspect --id "generated/worktree-baseline-conflict"
70
+ ```
71
+
72
+ **输出(JSON):**
73
+ ```json
74
+ {
75
+ "ok": true,
76
+ "entry": {
77
+ "id": "patterns",
78
+ "title": "Patterns",
79
+ "summary": "每个阶段对应 `src/stages/` 下的独立模块...",
80
+ "zone": "manual",
81
+ "path": "knowledge/patterns.md",
82
+ "meta": {
83
+ "author": "qinyi",
84
+ "created_at": "2026-06-19T12:40:00+08:00",
85
+ "updated_at": "2026-06-24T10:00:00+08:00"
86
+ },
87
+ "body": "完整 markdown 内容..."
88
+ }
89
+ }
90
+ ```
91
+
92
+ **zone 说明:**
93
+ - `manual` — 人工维护的知识(可直接信任)
94
+ - `generated` — 自动提取的知识(scan 生成,需人工审核)
95
+ - `proposed` — 提议待审核的知识(未合并)
96
+
97
+ ---
98
+
99
+ ### 3. knowledge validate — 校验知识库健康度
100
+ 在 commit/archive 前检查知识库是否可用。
101
+
102
+ ```bash
103
+ sillyspec knowledge validate
104
+ ```
105
+
106
+ **输出(JSON):**
107
+ ```json
108
+ {
109
+ "ok": false,
110
+ "errors": [
111
+ {
112
+ "code": "broken_reference",
113
+ "path": "knowledge/generated/foo.md",
114
+ "referenced_in": "INDEX.md",
115
+ "display": "Foo Pattern"
116
+ },
117
+ {
118
+ "code": "empty_file",
119
+ "path": "knowledge/bar.md"
120
+ }
121
+ ],
122
+ "warnings": [
123
+ {
124
+ "code": "too_many_uncategorized",
125
+ "count": 12,
126
+ "path": "knowledge/uncategorized.md"
127
+ },
128
+ {
129
+ "code": "unregistered_file",
130
+ "path": "knowledge/new-file.md"
131
+ }
132
+ ]
133
+ }
134
+ ```
135
+
136
+ **错误码说明:**
137
+ | code | 说明 |
138
+ |---|---|
139
+ | `knowledge_dir_missing` | `.sillyspec/knowledge/` 目录不存在 |
140
+ | `missing_index` | `INDEX.md` 不存在 |
141
+ | `broken_reference` | INDEX.md 引用的文件不存在 |
142
+ | `empty_file` | 知识文件为空 |
143
+ | `too_many_uncategorized` | uncategorized.md 条目 ≥10,需清理 |
144
+ | `unregistered_file` | 手动知识文件未在 INDEX.md 注册 |
145
+
146
+ ---
147
+
148
+ ### 4. knowledge refresh — 从 scan 文档刷新自动知识
149
+ **仅写 generated/ 区,不覆盖 manual/。**
150
+
151
+ ```bash
152
+ sillyspec knowledge refresh
153
+ ```
154
+
155
+ **使用场景:**
156
+ - scan 阶段完成后,自动提取可复用知识
157
+ - archive 阶段完成后,沉淀长期有效的模式
158
+
159
+ **行为:**
160
+ 1. 扫描 `.sillyspec/docs/<project>/scan/*.md`
161
+ 2. 提取每个 `## 章节`(至少 3 行)作为知识条目
162
+ 3. 写入 `.sillyspec/knowledge/generated/<slug>.md`
163
+ 4. 生成 `generated/INDEX.md`
164
+
165
+ **输出(JSON):**
166
+ ```json
167
+ {
168
+ "ok": true,
169
+ "generated_count": 8,
170
+ "new_count": 5,
171
+ "overwritten_count": 3,
172
+ "files": [
173
+ { "file": "generated/worktree-isolation.md", "title": "...", "new": true },
174
+ { "file": "generated/progress-management.md", "title": "...", "new": false }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ **注意事项:**
180
+ - generated/ 区知识是自动生成,不保证准确,需人工审核后合并到 manual/
181
+ - 已有文件会被覆盖( overwrite_count)
182
+
183
+ ---
184
+
185
+ ### 5. knowledge propose — 提议新知识
186
+ 不直接编辑 manual/,而是写入 proposed/ 供审核。
187
+
188
+ ```bash
189
+ sillyspec knowledge propose --title "<title>" --category <category> --body "<content>" --from "<source>"
190
+ ```
191
+
192
+ **参数说明:**
193
+ | 参数 | 必填 | 说明 |
194
+ |---|---|---|
195
+ | `--title` | ✅ | 知识标题 |
196
+ | `--category` | ❌ | 分类(默认 uncategorized),如 known-issues, patterns, conventions |
197
+ | `--body` | ❌ | 知识正文 |
198
+ | `--from` | ❌ | 来源标注(如 execute/quick/scan) |
199
+
200
+ **示例:**
201
+ ```bash
202
+ sillyspec knowledge propose --title "GLM API 超时处理" --category known-issues --body "GLM 模型默认超时 30 秒..." --from "execute"
203
+ ```
204
+
205
+ **输出(JSON):**
206
+ ```json
207
+ {
208
+ "ok": true,
209
+ "id": "proposed/glm-api-timeout",
210
+ "path": "knowledge/proposed/glm-api-timeout.md",
211
+ "title": "GLM API 超时处理",
212
+ "category": "known-issues",
213
+ "new": true,
214
+ "action": "created"
215
+ }
216
+ ```
217
+
218
+ **后续流程:**
219
+ - archive/commit 阶段审核 proposed/ 条目
220
+ - 合格的合并到 manual/,不合格的删除
221
+
222
+ ---
223
+
224
+ ## Agent 使用指南
225
+
226
+ ### 任务前必查
227
+ 在开始实现新功能、修改现有代码、或遇到报错前:
228
+ 1. `knowledge search --query "<任务关键词>"`
229
+ 2. 命中则 `knowledge inspect --id "<id>"`
230
+ 3. 遵循知识中的约定和避坑建议
231
+
232
+ ### 发现新知识
233
+ 执行任务中发现可复用模式或新坑:
234
+ 1. `knowledge propose --title "<标题>" --category <分类> --body "<内容>"`
235
+ 2. 不要直接编辑 `.sillyspec/knowledge/manual/*.md`
236
+
237
+ ### 提交前校验
238
+ commit/archive 前检查知识库状态:
239
+ 1. `knowledge validate`
240
+ 2. 如有 errors,先修复再提交
241
+
242
+ ### 扫描后刷新
243
+ scan 阶段完成后:
244
+ 1. `knowledge refresh`
245
+ 2. 审核生成的 `generated/*.md`,有用的合并到 manual/
246
+
247
+ ---
248
+
249
+ ## 禁止事项
250
+
251
+ ❌ **不要直接编辑** `manual/` 或 `generated/` 中的知识文件
252
+ - 使用 `knowledge propose` 提议新知识
253
+ - 使用 `knowledge refresh` 刷新自动知识
254
+
255
+ ❌ **不要使用 `grep` 或 `cat` 直接读取知识文件**
256
+ - 使用 `knowledge search` 和 `knowledge inspect`
257
+ - 它们使用与 execute 阶段相同的匹配引擎
258
+
259
+ ❌ **不要让 agent 去审核 proposed/ 条目**
260
+ - 提议供人工审核,不要自动合并
261
+ - 只有用户明确要求才合并
262
+
263
+ ---
264
+
265
+ ## 设计原则
266
+
267
+ - **Agent-safe:** 所有输出为 JSON,失败有明确错误码
268
+ - **写保护:** refresh 仅写 generated/,propose 仅写 proposed/,不碰 manual/
269
+ - **匹配引擎:** 使用 `knowledge-match.js`(与 execute 阶段一致)
270
270
  - **审计友好:** 每个条目记录来源、创建/更新时间
@@ -1,21 +1,21 @@
1
- ---
2
- name: sillyspec:plan
3
- description: 用于把 design 拆解为可执行的实现计划。适合用户说"拆任务、做计划、排 wave、规划实现步骤"。产出 plan.md(Wave 分组 + Task 列表 + 依赖关系)。
4
- ---
5
-
6
- ## 多变更说明
7
-
8
- 如果项目有多个活跃变更(`.sillyspec/changes/` 下有多个目录),所有 `sillyspec run` 命令需要加 `--change <变更名>`。只有一个变更时可省略(CLI 自动检测)。
9
-
10
- ## 执行
11
-
12
- **你必须使用 exec 工具(shell)执行以下命令,不要自己编造流程:**
13
-
14
- 1. 运行 `sillyspec run plan` — 读取输出的步骤 prompt
15
- 2. 按照输出的 prompt **严格执行**,不要跳过或自行添加步骤
16
- 3. 步骤完成后,运行 `sillyspec run plan --done --output "你的摘要"`
17
- 4. 重复 2-3 直到阶段完成
18
- 5. **禁止**在没有运行 CLI 的情况下自行决定流程
19
-
20
- ## 用户指令
21
- $ARGUMENTS
1
+ ---
2
+ name: sillyspec:plan
3
+ description: 用于把 design 拆解为可执行的实现计划。适合用户说"拆任务、做计划、排 wave、规划实现步骤"。产出 plan.md(Wave 分组 + Task 列表 + 依赖关系)。
4
+ ---
5
+
6
+ ## 多变更说明
7
+
8
+ 如果项目有多个活跃变更(`.sillyspec/changes/` 下有多个目录),所有 `sillyspec run` 命令需要加 `--change <变更名>`。只有一个变更时可省略(CLI 自动检测)。
9
+
10
+ ## 执行
11
+
12
+ **你必须使用 exec 工具(shell)执行以下命令,不要自己编造流程:**
13
+
14
+ 1. 运行 `sillyspec run plan` — 读取输出的步骤 prompt
15
+ 2. 按照输出的 prompt **严格执行**,不要跳过或自行添加步骤
16
+ 3. 步骤完成后,运行 `sillyspec run plan --done --output "你的摘要"`
17
+ 4. 重复 2-3 直到阶段完成
18
+ 5. **禁止**在没有运行 CLI 的情况下自行决定流程
19
+
20
+ ## 用户指令
21
+ $ARGUMENTS
@@ -1,21 +1,21 @@
1
- ---
2
- name: sillyspec:propose
3
- description: 生成结构化规范 — proposal + design + tasks
4
- ---
5
-
6
- ## 多变更说明
7
-
8
- 如果项目有多个活跃变更(`.sillyspec/changes/` 下有多个目录),所有 `sillyspec run` 命令需要加 `--change <变更名>`。只有一个变更时可省略(CLI 自动检测)。
9
-
10
- ## 执行
11
-
12
- **你必须使用 exec 工具(shell)执行以下命令,不要自己编造流程:**
13
-
14
- 1. 运行 `sillyspec run propose` — 读取输出的步骤 prompt
15
- 2. 按照输出的 prompt **严格执行**,不要跳过或自行添加步骤
16
- 3. 步骤完成后,运行 `sillyspec run propose --done --output "你的摘要"`
17
- 4. 重复 2-3 直到阶段完成
18
- 5. **禁止**在没有运行 CLI 的情况下自行决定流程
19
-
20
- ## 用户指令
21
- $ARGUMENTS
1
+ ---
2
+ name: sillyspec:propose
3
+ description: 生成结构化规范 — proposal + design + tasks
4
+ ---
5
+
6
+ ## 多变更说明
7
+
8
+ 如果项目有多个活跃变更(`.sillyspec/changes/` 下有多个目录),所有 `sillyspec run` 命令需要加 `--change <变更名>`。只有一个变更时可省略(CLI 自动检测)。
9
+
10
+ ## 执行
11
+
12
+ **你必须使用 exec 工具(shell)执行以下命令,不要自己编造流程:**
13
+
14
+ 1. 运行 `sillyspec run propose` — 读取输出的步骤 prompt
15
+ 2. 按照输出的 prompt **严格执行**,不要跳过或自行添加步骤
16
+ 3. 步骤完成后,运行 `sillyspec run propose --done --output "你的摘要"`
17
+ 4. 重复 2-3 直到阶段完成
18
+ 5. **禁止**在没有运行 CLI 的情况下自行决定流程
19
+
20
+ ## 用户指令
21
+ $ARGUMENTS
@@ -1,21 +1,21 @@
1
- ---
2
- name: sillyspec:quick
3
- description: 用于明确、低风险、范围很小的直接任务。适合用户说"直接改、快速修、顺手调整、改个文案、修个小 bug、更新一个文件、不要完整流程"。跳过 brainstorm/plan,但仍按 sillyspec quick 流程执行。
4
- ---
5
-
6
- ## 多变更说明
7
-
8
- 如果项目有多个活跃变更(`.sillyspec/changes/` 下有多个目录),所有 `sillyspec run` 命令需要加 `--change <变更名>`。只有一个变更时可省略(CLI 自动检测)。
9
-
10
- ## 执行
11
-
12
- **你必须使用 exec 工具(shell)执行以下命令,不要自己编造流程:**
13
-
14
- 1. 运行 `sillyspec run quick` — 读取输出的步骤 prompt
15
- 2. 按照输出的 prompt **严格执行**,不要跳过或自行添加步骤
16
- 3. 步骤完成后,运行 `sillyspec run quick --done --output "你的摘要"`
17
- 4. 重复 2-3 直到阶段完成
18
- 5. **禁止**在没有运行 CLI 的情况下自行决定流程
19
-
20
- ## 用户指令
21
- $ARGUMENTS
1
+ ---
2
+ name: sillyspec:quick
3
+ description: 用于明确、低风险、范围很小的直接任务。适合用户说"直接改、快速修、顺手调整、改个文案、修个小 bug、更新一个文件、不要完整流程"。跳过 brainstorm/plan,但仍按 sillyspec quick 流程执行。
4
+ ---
5
+
6
+ ## 多变更说明
7
+
8
+ 如果项目有多个活跃变更(`.sillyspec/changes/` 下有多个目录),所有 `sillyspec run` 命令需要加 `--change <变更名>`。只有一个变更时可省略(CLI 自动检测)。
9
+
10
+ ## 执行
11
+
12
+ **你必须使用 exec 工具(shell)执行以下命令,不要自己编造流程:**
13
+
14
+ 1. 运行 `sillyspec run quick` — 读取输出的步骤 prompt
15
+ 2. 按照输出的 prompt **严格执行**,不要跳过或自行添加步骤
16
+ 3. 步骤完成后,运行 `sillyspec run quick --done --output "你的摘要"`
17
+ 4. 重复 2-3 直到阶段完成
18
+ 5. **禁止**在没有运行 CLI 的情况下自行决定流程
19
+
20
+ ## 用户指令
21
+ $ARGUMENTS