sillyspec 3.26.10 → 3.26.13

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 (101) hide show
  1. package/.claude/skills/sillyspec-archive/SKILL.md +85 -85
  2. package/.claude/skills/sillyspec-brainstorm/SKILL.md +114 -114
  3. package/.claude/skills/sillyspec-commit/SKILL.md +109 -109
  4. package/.claude/skills/sillyspec-continue/SKILL.md +45 -45
  5. package/.claude/skills/sillyspec-doctor/SKILL.md +76 -76
  6. package/.claude/skills/sillyspec-execute/SKILL.md +200 -200
  7. package/.claude/skills/sillyspec-explore/SKILL.md +95 -95
  8. package/.claude/skills/sillyspec-knowledge/SKILL.md +269 -269
  9. package/.claude/skills/sillyspec-plan/SKILL.md +148 -148
  10. package/.claude/skills/sillyspec-quick/SKILL.md +115 -111
  11. package/.claude/skills/sillyspec-resume/SKILL.md +68 -68
  12. package/.claude/skills/sillyspec-scan/SKILL.md +79 -79
  13. package/.claude/skills/sillyspec-state/SKILL.md +64 -64
  14. package/.claude/skills/sillyspec-status/SKILL.md +54 -54
  15. package/.claude/skills/sillyspec-verify/SKILL.md +83 -83
  16. package/.claude/skills/sillyspec-workspace/SKILL.md +169 -169
  17. package/.gitattributes +2 -0
  18. package/.husky/pre-push +20 -20
  19. package/README.md +203 -201
  20. package/SKILL.md +91 -90
  21. package/package.json +39 -39
  22. package/packages/dashboard/dist/assets/index-Bq_Z2hne.js +7446 -7446
  23. package/packages/dashboard/dist/assets/index-O2W5RV4z.css +1 -1
  24. package/packages/dashboard/dist/index.html +16 -16
  25. package/packages/dashboard/package.json +25 -25
  26. package/packages/dashboard/server/executor.js +95 -86
  27. package/packages/dashboard/server/index.js +663 -601
  28. package/packages/dashboard/server/parser.js +526 -526
  29. package/src/change-risk-profile.js +254 -254
  30. package/src/classify-change.js +109 -109
  31. package/src/config-schema.js +313 -310
  32. package/src/contract-matrix.js +388 -379
  33. package/src/db.js +370 -350
  34. package/src/dispatch/backends/local-agent.js +155 -155
  35. package/src/dispatch/backends/sillyhub-mcp.js +245 -245
  36. package/src/dispatch/probe.js +246 -210
  37. package/src/dispatch/strategy.js +121 -121
  38. package/src/docs-check.js +188 -16
  39. package/src/docs-debt.js +6 -2
  40. package/src/docs-gate.js +1 -0
  41. package/src/doctor-diagnostics.js +898 -711
  42. package/src/endpoint-extractor.js +401 -401
  43. package/src/fs-atomic.js +71 -69
  44. package/src/git-helper.js +82 -79
  45. package/src/hooks/claude-pre-tool-use.cjs +125 -125
  46. package/src/hooks/worktree-guard.js +854 -848
  47. package/src/index.js +251 -20
  48. package/src/init.js +624 -623
  49. package/src/knowledge-match.js +130 -130
  50. package/src/local-detect.js +128 -120
  51. package/src/machine-interface.js +543 -543
  52. package/src/migrate.js +127 -127
  53. package/src/modules.js +7 -5
  54. package/src/progress/change-registry.js +297 -260
  55. package/src/progress/consistency-doctor.js +355 -355
  56. package/src/progress/shared.js +36 -36
  57. package/src/progress/stage-machine.js +589 -550
  58. package/src/progress/step-store.js +261 -261
  59. package/src/progress.js +1285 -1127
  60. package/src/quicklog.js +724 -693
  61. package/src/review-tier.js +77 -77
  62. package/src/run/command.js +1408 -1364
  63. package/src/run/complete-handlers.js +1450 -1399
  64. package/src/run/complete.js +1181 -920
  65. package/src/run/gates.js +878 -755
  66. package/src/run/prompt.js +765 -761
  67. package/src/run/quick-audit.js +155 -146
  68. package/src/run/shared.js +1348 -1215
  69. package/src/run/stage.js +527 -479
  70. package/src/scan-postcheck.js +371 -371
  71. package/src/setup.js +414 -416
  72. package/src/sillyhub-mcp/client.js +597 -529
  73. package/src/spec-dir-typo.js +3 -24
  74. package/src/spec-sync.js +358 -319
  75. package/src/stage-contract.js +871 -897
  76. package/src/stage-review.js +549 -549
  77. package/src/stages/archive.js +156 -155
  78. package/src/stages/brainstorm-auto.js +236 -236
  79. package/src/stages/brainstorm.js +597 -597
  80. package/src/stages/cmd-existence.js +145 -145
  81. package/src/stages/doctor.js +386 -371
  82. package/src/stages/execute.js +1014 -1003
  83. package/src/stages/explore.js +34 -34
  84. package/src/stages/index.js +29 -29
  85. package/src/stages/knowledge.js +498 -498
  86. package/src/stages/plan-postcheck.js +1323 -1302
  87. package/src/stages/plan.js +642 -623
  88. package/src/stages/quick.js +153 -151
  89. package/src/stages/scan.js +607 -607
  90. package/src/stages/status.js +64 -64
  91. package/src/stages/verify.js +264 -264
  92. package/src/sync.js +1325 -1135
  93. package/src/task-review.js +1204 -1019
  94. package/src/taskcard.js +178 -0
  95. package/src/verify-postcheck.js +1199 -1186
  96. package/src/workflow.js +600 -600
  97. package/src/worktree-apply.js +1237 -1136
  98. package/src/worktree-deps.js +453 -353
  99. package/src/worktree.js +1527 -1481
  100. package/templates/workflows/archive-impact.yaml +79 -79
  101. package/templates/workflows/scan-docs.yaml +132 -132
@@ -1,109 +1,109 @@
1
- /**
2
- * classify-change.js — 变更规模分类器
3
- *
4
- * 将用户需求描述分类为 quick / auto / full,
5
- * 供 auto 模式决定内部流程深度。
6
- */
7
-
8
- import { existsSync, readFileSync } from 'fs'
9
- import { join } from 'path'
10
- import jsYaml from 'js-yaml'
11
-
12
- /**
13
- * 用户显式指定的关键词 → 强制模式
14
- */
15
- const FORCE_FULL_PATTERNS = [
16
- /数据库|database|schema/i,
17
- /迁移|migration|migrate/i,
18
- /鉴权|权限|auth|permission|rbac/i,
19
- /支付|payment|billing/i,
20
- /重构|refactor.*architectur/i,
21
- /微服务|microserv/i,
22
- ]
23
-
24
- const FORCE_QUICK_PATTERNS = [
25
- /fix typo/i,
26
- /更新文案|改文案|文案修改/i,
27
- /样式调整|style.*tweak/i,
28
- /修复.*\s*\bbug\b.*\bfix\b/i,
29
- ]
30
-
31
- /**
32
- * 读 local.yaml 的 auto_mode 段(best-effort,绝不抛)。
33
- * 供 runCommand 接线:传给 classifyChange 的 localConfig,让 force_*_patterns 真生效。
34
- * @param {string} cwd - 主仓库根(local.yaml 在 <cwd>/.sillyspec/local.yaml)
35
- * @returns {{ force_full_patterns?: string[], force_quick_patterns?: string[] } | null}
36
- * auto_mode 段含至少一个 string pattern → 归一化数组;文件缺/解析失败/无段/空 → null(降级默认关键词)
37
- */
38
- export function readAutoModeFromLocalYaml(cwd) {
39
- try {
40
- const p = join(cwd, '.sillyspec', 'local.yaml')
41
- if (!existsSync(p)) return null
42
- const doc = jsYaml.load(readFileSync(p, 'utf8'))
43
- if (!doc || typeof doc !== 'object') return null
44
- const am = doc.auto_mode
45
- if (!am || typeof am !== 'object') return null
46
- const ffp = Array.isArray(am.force_full_patterns) ? am.force_full_patterns.filter(s => typeof s === 'string') : []
47
- const fqp = Array.isArray(am.force_quick_patterns) ? am.force_quick_patterns.filter(s => typeof s === 'string') : []
48
- if (ffp.length === 0 && fqp.length === 0) return null
49
- return { force_full_patterns: ffp, force_quick_patterns: fqp }
50
- } catch {
51
- return null
52
- }
53
- }
54
-
55
- /**
56
- * 分类变更规模
57
- * @param {object} opts
58
- * @param {string} opts.description - 用户需求描述
59
- * @param {string} [opts.explicitMode] - 用户显式指定的模式(auto/quick/full)
60
- * @param {object} [opts.localConfig] - local.yaml auto_mode 段(由 readAutoModeFromLocalYaml 读出)
61
- * @returns {{ mode: 'quick'|'auto'|'full', reason: string }}
62
- */
63
- export function classifyChange({ description = '', explicitMode, localConfig } = {}) {
64
- // 1. 用户显式指定优先级最高
65
- if (explicitMode && ['quick', 'auto', 'full'].includes(explicitMode)) {
66
- return { mode: explicitMode, reason: '用户显式指定' }
67
- }
68
-
69
- // 2. local.yaml force patterns
70
- if (localConfig) {
71
- const forceFullPatterns = localConfig.force_full_patterns || []
72
- const forceQuickPatterns = localConfig.force_quick_patterns || []
73
-
74
- for (const pattern of forceFullPatterns) {
75
- try {
76
- if (new RegExp(pattern, 'i').test(description)) {
77
- return { mode: 'full', reason: `local.yaml force_full_pattern 匹配: ${pattern}` }
78
- }
79
- } catch {
80
- // 非法正则跳过,不崩 auto 分类(review-2026-08-09 #30)
81
- }
82
- }
83
- for (const pattern of forceQuickPatterns) {
84
- try {
85
- if (new RegExp(pattern, 'i').test(description)) {
86
- return { mode: 'quick', reason: `local.yaml force_quick_pattern 匹配: ${pattern}` }
87
- }
88
- } catch {
89
- // 非法正则跳过
90
- }
91
- }
92
- }
93
-
94
- // 3. 默认关键词匹配
95
- for (const pattern of FORCE_QUICK_PATTERNS) {
96
- if (pattern.test(description)) {
97
- return { mode: 'quick', reason: `命中 quick 关键词: ${pattern.source}` }
98
- }
99
- }
100
-
101
- for (const pattern of FORCE_FULL_PATTERNS) {
102
- if (pattern.test(description)) {
103
- return { mode: 'full', reason: `命中 full 关键词: ${pattern.source}` }
104
- }
105
- }
106
-
107
- // 4. 默认 auto
108
- return { mode: 'auto', reason: '默认模式' }
109
- }
1
+ /**
2
+ * classify-change.js — 变更规模分类器
3
+ *
4
+ * 将用户需求描述分类为 quick / auto / full,
5
+ * 供 auto 模式决定内部流程深度。
6
+ */
7
+
8
+ import { existsSync, readFileSync } from 'fs'
9
+ import { join } from 'path'
10
+ import jsYaml from 'js-yaml'
11
+
12
+ /**
13
+ * 用户显式指定的关键词 → 强制模式
14
+ */
15
+ const FORCE_FULL_PATTERNS = [
16
+ /数据库|database|schema/i,
17
+ /迁移|migration|migrate/i,
18
+ /鉴权|权限|auth|permission|rbac/i,
19
+ /支付|payment|billing/i,
20
+ /重构|refactor.*architectur/i,
21
+ /微服务|microserv/i,
22
+ ]
23
+
24
+ const FORCE_QUICK_PATTERNS = [
25
+ /fix typo/i,
26
+ /更新文案|改文案|文案修改/i,
27
+ /样式调整|style.*tweak/i,
28
+ /修复.*\s*\bbug\b.*\bfix\b/i,
29
+ ]
30
+
31
+ /**
32
+ * 读 local.yaml 的 auto_mode 段(best-effort,绝不抛)。
33
+ * 供 runCommand 接线:传给 classifyChange 的 localConfig,让 force_*_patterns 真生效。
34
+ * @param {string} cwd - 主仓库根(local.yaml 在 <cwd>/.sillyspec/local.yaml)
35
+ * @returns {{ force_full_patterns?: string[], force_quick_patterns?: string[] } | null}
36
+ * auto_mode 段含至少一个 string pattern → 归一化数组;文件缺/解析失败/无段/空 → null(降级默认关键词)
37
+ */
38
+ export function readAutoModeFromLocalYaml(cwd) {
39
+ try {
40
+ const p = join(cwd, '.sillyspec', 'local.yaml')
41
+ if (!existsSync(p)) return null
42
+ const doc = jsYaml.load(readFileSync(p, 'utf8'))
43
+ if (!doc || typeof doc !== 'object') return null
44
+ const am = doc.auto_mode
45
+ if (!am || typeof am !== 'object') return null
46
+ const ffp = Array.isArray(am.force_full_patterns) ? am.force_full_patterns.filter(s => typeof s === 'string') : []
47
+ const fqp = Array.isArray(am.force_quick_patterns) ? am.force_quick_patterns.filter(s => typeof s === 'string') : []
48
+ if (ffp.length === 0 && fqp.length === 0) return null
49
+ return { force_full_patterns: ffp, force_quick_patterns: fqp }
50
+ } catch {
51
+ return null
52
+ }
53
+ }
54
+
55
+ /**
56
+ * 分类变更规模
57
+ * @param {object} opts
58
+ * @param {string} opts.description - 用户需求描述
59
+ * @param {string} [opts.explicitMode] - 用户显式指定的模式(auto/quick/full)
60
+ * @param {object} [opts.localConfig] - local.yaml auto_mode 段(由 readAutoModeFromLocalYaml 读出)
61
+ * @returns {{ mode: 'quick'|'auto'|'full', reason: string }}
62
+ */
63
+ export function classifyChange({ description = '', explicitMode, localConfig } = {}) {
64
+ // 1. 用户显式指定优先级最高
65
+ if (explicitMode && ['quick', 'auto', 'full'].includes(explicitMode)) {
66
+ return { mode: explicitMode, reason: '用户显式指定' }
67
+ }
68
+
69
+ // 2. local.yaml force patterns
70
+ if (localConfig) {
71
+ const forceFullPatterns = localConfig.force_full_patterns || []
72
+ const forceQuickPatterns = localConfig.force_quick_patterns || []
73
+
74
+ for (const pattern of forceFullPatterns) {
75
+ try {
76
+ if (new RegExp(pattern, 'i').test(description)) {
77
+ return { mode: 'full', reason: `local.yaml force_full_pattern 匹配: ${pattern}` }
78
+ }
79
+ } catch {
80
+ // 非法正则跳过,不崩 auto 分类(review-2026-08-09 #30)
81
+ }
82
+ }
83
+ for (const pattern of forceQuickPatterns) {
84
+ try {
85
+ if (new RegExp(pattern, 'i').test(description)) {
86
+ return { mode: 'quick', reason: `local.yaml force_quick_pattern 匹配: ${pattern}` }
87
+ }
88
+ } catch {
89
+ // 非法正则跳过
90
+ }
91
+ }
92
+ }
93
+
94
+ // 3. 默认关键词匹配
95
+ for (const pattern of FORCE_QUICK_PATTERNS) {
96
+ if (pattern.test(description)) {
97
+ return { mode: 'quick', reason: `命中 quick 关键词: ${pattern.source}` }
98
+ }
99
+ }
100
+
101
+ for (const pattern of FORCE_FULL_PATTERNS) {
102
+ if (pattern.test(description)) {
103
+ return { mode: 'full', reason: `命中 full 关键词: ${pattern.source}` }
104
+ }
105
+ }
106
+
107
+ // 4. 默认 auto
108
+ return { mode: 'auto', reason: '默认模式' }
109
+ }