sillyspec 3.6.0 → 3.6.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/init.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "type": "module",
6
6
  "bin": {
package/src/init.js CHANGED
@@ -215,6 +215,18 @@ async function doInstall(projectDir, tools, isWorkspace, subprojects = []) {
215
215
  mkdirSync(join(projectDir, '.sillyspec', 'workspace'), { recursive: true });
216
216
  }
217
217
 
218
+ // 创建知识库骨架(所有模式)
219
+ const knowledgeDir = join(projectDir, '.sillyspec', 'knowledge');
220
+ mkdirSync(knowledgeDir, { recursive: true });
221
+ const indexPath = join(knowledgeDir, 'INDEX.md');
222
+ if (!existsSync(indexPath)) {
223
+ writeFileSync(indexPath, `# Knowledge Index\n\n> 子代理任务开始前查询此文件,按关键词匹配,只读命中的知识文件。\n> execute/quick 执行中发现的坑自动追加到 uncategorized.md,经用户确认后归类到对应文件。\n\n<!-- 格式:关键词1|关键词2|关键词3 → 文件路径 -->\n<!-- 示例:mybatis-plus|分页|Page → pagination.md -->\n<!-- 示例:跨域|CORS|preflight → cors.md -->\n`);
224
+ }
225
+ const uncatPath = join(knowledgeDir, 'uncategorized.md');
226
+ if (!existsSync(uncatPath)) {
227
+ writeFileSync(uncatPath, `# 未分类知识\n\n> execute/quick 执行中发现的坑暂存于此,用户审阅后归类到对应文件并更新 INDEX.md。\n`);
228
+ }
229
+
218
230
  const gitignorePath = join(projectDir, '.gitignore');
219
231
  const ignoreRules = ['.sillyspec/STATE.md', '.sillyspec/codebase/SCAN-RAW.md', '.sillyspec/local.yaml'];
220
232
  if (existsSync(gitignorePath)) {