claude-everything-workflow 0.1.8 → 0.2.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 (132) hide show
  1. package/AGENTS.md +19 -20
  2. package/README.md +112 -104
  3. package/agents/code-reviewer.md +15 -44
  4. package/agents/harness-optimizer.md +3 -2
  5. package/agents/planner.md +23 -107
  6. package/commands/code-review.md +25 -9
  7. package/commands/learn.md +97 -0
  8. package/commands/pr.md +4 -0
  9. package/commands/to-spec.md +11 -0
  10. package/hooks/check-code-size.js +33 -12
  11. package/hooks/check-console-log.js +72 -24
  12. package/package.json +5 -2
  13. package/rules/01-base.md +19 -42
  14. package/rules/02-code-size.md +6 -17
  15. package/rules/03-architecture.md +16 -54
  16. package/rules/04-error-handling.md +4 -25
  17. package/rules/05-git-workflow.md +9 -37
  18. package/rules/06-comments.md +3 -37
  19. package/rules/07-forbidden.md +6 -30
  20. package/rules/08-specialty-rules-index.md +18 -0
  21. package/rules/09-first-principles-adversarial-testing.md +6 -18
  22. package/rules/common/agent-orchestration.md +10 -47
  23. package/rules/common/context-hygiene.md +9 -72
  24. package/rules/common/harness-engineering.md +11 -38
  25. package/rules/common/hooks.md +11 -82
  26. package/rules/common/performance.md +8 -71
  27. package/rules/common/pr-automation.md +7 -68
  28. package/rules/common/skills-learning.md +12 -36
  29. package/rules/common/testing.md +15 -59
  30. package/scripts/cleanup-retired-skills.js +214 -0
  31. package/scripts/install.ps1 +73 -85
  32. package/scripts/install.sh +54 -77
  33. package/scripts/learning/review-confidence.js +1 -4
  34. package/scripts/merge-claude-settings.cjs +75 -0
  35. package/scripts/retired-skill-files.json +37 -0
  36. package/scripts/upstream-capability-baseline.json +27 -0
  37. package/scripts/upstream-capability-map.json +150 -0
  38. package/scripts/verify/core.js +91 -0
  39. package/scripts/verify/grilling-spec-gate-checks.js +260 -0
  40. package/scripts/verify/metadata-checks.js +724 -0
  41. package/scripts/verify/repository-checks.js +435 -0
  42. package/scripts/verify/runtime-checks.js +593 -0
  43. package/scripts/verify/workflow-checks.js +741 -0
  44. package/scripts/verify/workflow-ownership-fixtures.js +371 -0
  45. package/scripts/verify/workflow-ownership.js +780 -0
  46. package/scripts/verify-harness.js +16 -1075
  47. package/scripts/verify-upstream-capability-map.js +117 -0
  48. package/skills/README.md +24 -10
  49. package/skills/code-review/SKILL.md +50 -0
  50. package/skills/code-review/references/spec-reviewer-prompt.md +24 -0
  51. package/skills/code-review/references/standards-reviewer-prompt.md +35 -0
  52. package/skills/codebase-design/SKILL.md +63 -0
  53. package/skills/codebase-design/references/deepening.md +27 -0
  54. package/skills/codebase-design/references/design-it-twice.md +17 -0
  55. package/skills/continuous-learning-v2/SKILL.md +7 -7
  56. package/skills/continuous-learning-v2/config.json +0 -4
  57. package/skills/domain-modeling/SKILL.md +100 -0
  58. package/skills/feature-acceptance/SKILL.md +89 -0
  59. package/skills/grilling/SKILL.md +83 -0
  60. package/skills/handoff/SKILL.md +56 -0
  61. package/skills/implement/SKILL.md +97 -0
  62. package/skills/improve-codebase-architecture/SKILL.md +48 -0
  63. package/skills/iterative-retrieval/SKILL.md +10 -1
  64. package/skills/learn/README.md +2 -2
  65. package/skills/project-context/SKILL.md +94 -0
  66. package/skills/project-context/agents/openai.yaml +6 -0
  67. package/skills/project-context/references/project-context-template.md +61 -0
  68. package/skills/prototype/SKILL.md +50 -0
  69. package/skills/prototype/references/logic.md +28 -0
  70. package/skills/prototype/references/ui.md +30 -0
  71. package/skills/research/SKILL.md +48 -0
  72. package/skills/resolving-merge-conflicts/SKILL.md +27 -0
  73. package/skills/spec-gate/SKILL.md +149 -0
  74. package/skills/spec-gate/agents/openai.yaml +4 -0
  75. package/skills/spec-gate/references/spec-document-reviewer-prompt.md +31 -0
  76. package/skills/subagent-driven-development/SKILL.md +95 -414
  77. package/skills/systematic-debugging/SKILL.md +7 -51
  78. package/skills/systematic-debugging/references/diagnosing-bugs.upstream.md +129 -0
  79. package/skills/systematic-debugging/scripts/hitl-loop.template.js +75 -0
  80. package/skills/systematic-debugging/scripts/hitl-loop.template.sh +41 -0
  81. package/skills/test-driven-development/SKILL.md +18 -2
  82. package/skills/to-tickets/SKILL.md +94 -0
  83. package/skills/triage/SKILL.md +53 -0
  84. package/skills/triage/references/agent-brief.md +32 -0
  85. package/skills/triage/references/out-of-scope.md +14 -0
  86. package/skills/using-superpowers/SKILL.md +140 -40
  87. package/skills/visual-companion/SKILL.md +62 -0
  88. package/skills/visual-companion/agents/openai.yaml +4 -0
  89. package/skills/{brainstorming/visual-companion.md → visual-companion/references/guide.md} +1 -1
  90. package/skills/{brainstorming → visual-companion}/scripts/frame-template.html +42 -12
  91. package/skills/visual-companion/scripts/pages.cjs +28 -0
  92. package/skills/visual-companion/scripts/server-utils.cjs +82 -0
  93. package/skills/{brainstorming → visual-companion}/scripts/server.cjs +108 -248
  94. package/skills/{brainstorming → visual-companion}/scripts/start-server.sh +18 -4
  95. package/skills/visual-companion/scripts/websocket.cjs +86 -0
  96. package/skills/wayfinder/SKILL.md +57 -0
  97. package/commands/e2e.md +0 -28
  98. package/commands/evolve.md +0 -42
  99. package/commands/harness-audit.md +0 -27
  100. package/commands/instinct-status.md +0 -38
  101. package/commands/learn-eval.md +0 -91
  102. package/commands/projects.md +0 -27
  103. package/commands/promote.md +0 -29
  104. package/commands/prune.md +0 -46
  105. package/commands/tdd.md +0 -27
  106. package/homunculus/instincts/personal/always-test-first.md +0 -28
  107. package/homunculus/instincts/personal/pr-ci-quality-gate.md +0 -30
  108. package/rules/08-ecc-integration.md +0 -46
  109. package/rules/common/implementation.md +0 -25
  110. package/rules/common/security.md +0 -19
  111. package/skills/brainstorming/SKILL.md +0 -185
  112. package/skills/brainstorming/agents/openai.yaml +0 -3
  113. package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  114. package/skills/context-budget/SKILL.md +0 -59
  115. package/skills/documentation-lookup/SKILL.md +0 -90
  116. package/skills/executing-plans/SKILL.md +0 -66
  117. package/skills/skill-creator/LICENSE.txt +0 -202
  118. package/skills/skill-creator/SKILL.md +0 -356
  119. package/skills/skill-creator/references/output-patterns.md +0 -82
  120. package/skills/skill-creator/references/workflows.md +0 -28
  121. package/skills/skill-creator/scripts/init_skill.py +0 -303
  122. package/skills/skill-creator/scripts/package_skill.py +0 -110
  123. package/skills/skill-creator/scripts/quick_validate.py +0 -95
  124. package/skills/subagent-driven-development/implementer-prompt.md +0 -139
  125. package/skills/subagent-driven-development/scripts/review-package +0 -44
  126. package/skills/subagent-driven-development/scripts/sdd-workspace +0 -22
  127. package/skills/subagent-driven-development/scripts/task-brief +0 -40
  128. package/skills/subagent-driven-development/task-reviewer-prompt.md +0 -188
  129. package/skills/writing-plans/SKILL.md +0 -206
  130. package/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
  131. /package/skills/{brainstorming → visual-companion}/scripts/helper.js +0 -0
  132. /package/skills/{brainstorming → visual-companion}/scripts/stop-server.sh +0 -0
@@ -74,90 +74,13 @@ function Copy-ClaudeSettings {
74
74
  Backup-IfChanged -Source $Source -Destination $Destination
75
75
 
76
76
  if ($DryRun) {
77
- Write-Host "[dry-run] Merge '$Source' into '$Destination' preserving existing env and mcpServers, purging legacy hook paths"
77
+ Write-Host "[dry-run] Merge '$Source' into '$Destination' preserving existing env and mcpServers"
78
+ Write-Host "[dry-run] Purge legacy hook paths while merging Claude settings"
78
79
  return
79
80
  }
80
81
 
81
- # 使用 Node 脚本合并 settings.json,同时清理旧版 Hook 路径
82
- $mergeScript = @'
83
- const fs = require('fs')
84
-
85
- const [, , sourcePath, destinationPath] = process.argv
86
- const source = JSON.parse(fs.readFileSync(sourcePath, 'utf8'))
87
- const existing = fs.existsSync(destinationPath)
88
- ? JSON.parse(fs.readFileSync(destinationPath, 'utf8'))
89
- : {}
90
-
91
- const LEGACY_HOOK_PATTERNS = [
92
- 'scripts/hooks/run-with-flags.js',
93
- 'scripts/hooks/commit-quality.js',
94
- 'scripts/hooks/session-start.js',
95
- 'scripts/hooks/session-end.js',
96
- 'scripts/lib/hook-flags.js',
97
- 'scripts/lib/utils.js',
98
- 'hooks/observe.js',
99
- 'hooks/review-confidence.js',
100
- 'hooks/session-start.js',
101
- 'hooks/session-end.js',
102
- 'hooks/evaluate-session.js',
103
- 'hooks/pre-compact.js',
104
- 'hooks/runtime/session-utils.js'
105
- ]
106
-
107
- function isLegacyHook(hookDef) {
108
- if (typeof hookDef !== 'object' || !hookDef.command) return false
109
- return LEGACY_HOOK_PATTERNS.some(p => hookDef.command.includes(p))
110
- }
111
-
112
- function filterHooks(hooksArray) {
113
- if (!Array.isArray(hooksArray)) return hooksArray
114
- return hooksArray.map(entry => {
115
- if (!entry || !Array.isArray(entry.hooks)) return entry
116
- const filtered = entry.hooks.filter(h => !isLegacyHook(h))
117
- return { ...entry, hooks: filtered }
118
- }).filter(entry => entry.hooks && entry.hooks.length > 0)
119
- }
120
-
121
- function cleanHooks(hooksObj) {
122
- if (!hooksObj || typeof hooksObj !== 'object') return hooksObj
123
- const cleaned = {}
124
- for (const [eventType, entries] of Object.entries(hooksObj)) {
125
- const filtered = filterHooks(entries)
126
- if (filtered.length > 0) {
127
- cleaned[eventType] = filtered
128
- }
129
- }
130
- return cleaned
131
- }
132
-
133
- const merged = {
134
- ...existing,
135
- ...source,
136
- env: {
137
- ...(source.env || {}),
138
- ...(existing.env || {})
139
- },
140
- mcpServers: {
141
- ...(source.mcpServers || {}),
142
- ...(existing.mcpServers || {})
143
- },
144
- hooks: cleanHooks({
145
- ...(existing.hooks || {}),
146
- ...(source.hooks || {})
147
- })
148
- }
149
-
150
- fs.writeFileSync(destinationPath, JSON.stringify(merged, null, 2) + '\n')
151
- '@
152
-
153
- $scriptFile = [System.IO.Path]::GetTempFileName()
154
- Set-Content -LiteralPath $scriptFile -Value $mergeScript -Encoding UTF8
155
-
156
- try {
157
- & node $scriptFile $Source $Destination
158
- } finally {
159
- Remove-Item -LiteralPath $scriptFile -Force -ErrorAction SilentlyContinue
160
- }
82
+ $mergeScript = Join-Path $RootDir "scripts\merge-claude-settings.cjs"
83
+ & node $mergeScript $Source $Destination
161
84
  }
162
85
 
163
86
  function Convert-ClaudeSettingsHookPaths {
@@ -233,7 +156,6 @@ function Install-SharedDirs {
233
156
  "scripts",
234
157
  "hooks",
235
158
  "skills",
236
- "homunculus",
237
159
  "references"
238
160
  )
239
161
 
@@ -247,7 +169,16 @@ function Remove-PackageOnlyPaths {
247
169
 
248
170
  $packageOnlyFiles = @(
249
171
  "scripts\install.sh",
250
- "scripts\install.ps1"
172
+ "scripts\install.ps1",
173
+ "scripts\verify-harness.js",
174
+ "scripts\verify\core.js",
175
+ "scripts\verify\grilling-spec-gate-checks.js",
176
+ "scripts\verify\metadata-checks.js",
177
+ "scripts\verify\repository-checks.js",
178
+ "scripts\verify\runtime-checks.js",
179
+ "scripts\verify\workflow-checks.js",
180
+ "scripts\verify\workflow-ownership-fixtures.js",
181
+ "scripts\verify\workflow-ownership.js"
251
182
  )
252
183
 
253
184
  foreach ($relative in $packageOnlyFiles) {
@@ -258,12 +189,33 @@ function Remove-PackageOnlyPaths {
258
189
  -Action { Remove-Item -LiteralPath $target -Force }
259
190
  }
260
191
  }
192
+
193
+ $verifyDirectory = Join-Path $Destination "scripts\verify"
194
+ if (Test-Path -LiteralPath $verifyDirectory -PathType Container) {
195
+ $children = Get-ChildItem -LiteralPath $verifyDirectory -Force
196
+ if ($children.Count -eq 0) {
197
+ Invoke-InstallCommand `
198
+ -Description "Remove-Item '$verifyDirectory'" `
199
+ -Action { Remove-Item -LiteralPath $verifyDirectory -Force }
200
+ }
201
+ }
261
202
  }
262
203
 
263
204
  function Remove-ObsoleteWorkflowPaths {
264
205
  param([string]$Destination)
265
206
 
266
207
  $obsoleteFiles = @(
208
+ "commands\e2e.md",
209
+ "commands\evolve.md",
210
+ "commands\grill.md",
211
+ "commands\harness-audit.md",
212
+ "commands\instinct-status.md",
213
+ "commands\learn-eval.md",
214
+ "commands\projects.md",
215
+ "commands\promote.md",
216
+ "commands\prune.md",
217
+ "commands\setup-workflow.md",
218
+ "commands\tdd.md",
267
219
  "scripts\hooks\run-with-flags.js",
268
220
  "scripts\hooks\commit-quality.js",
269
221
  "scripts\hooks\session-start.js",
@@ -275,7 +227,13 @@ function Remove-ObsoleteWorkflowPaths {
275
227
  "hooks\session-end.js",
276
228
  "hooks\evaluate-session.js",
277
229
  "hooks\pre-compact.js",
278
- "hooks\runtime\session-utils.js"
230
+ "hooks\runtime\session-utils.js",
231
+ "rules\08-ecc-integration.md",
232
+ "skills\subagent-driven-development\implementer-prompt.md",
233
+ "skills\subagent-driven-development\task-reviewer-prompt.md",
234
+ "skills\subagent-driven-development\scripts\sdd-workspace",
235
+ "skills\subagent-driven-development\scripts\task-brief",
236
+ "skills\subagent-driven-development\scripts\review-package"
279
237
  )
280
238
 
281
239
  foreach ($relative in $obsoleteFiles) {
@@ -287,7 +245,7 @@ function Remove-ObsoleteWorkflowPaths {
287
245
  }
288
246
  }
289
247
 
290
- foreach ($relative in @("scripts\hooks", "scripts\lib")) {
248
+ foreach ($relative in @("scripts\hooks", "scripts\lib", "skills\subagent-driven-development\scripts")) {
291
249
  $target = Join-Path $Destination $relative
292
250
  if (Test-Path -LiteralPath $target -PathType Container) {
293
251
  $children = Get-ChildItem -LiteralPath $target -Force
@@ -300,6 +258,32 @@ function Remove-ObsoleteWorkflowPaths {
300
258
  }
301
259
  }
302
260
 
261
+ function Remove-RetiredSkills {
262
+ param([string]$Destination)
263
+
264
+ $cleanupScript = Join-Path $RootDir "scripts\cleanup-retired-skills.js"
265
+ if ($DryRun) {
266
+ & node $cleanupScript $Destination --dry-run
267
+ if ($LASTEXITCODE -ne 0) {
268
+ throw "Retired skill cleanup dry-run failed with exit code $LASTEXITCODE"
269
+ }
270
+ return
271
+ }
272
+
273
+ & node $cleanupScript $Destination
274
+ if ($LASTEXITCODE -ne 0) {
275
+ throw "Retired skill cleanup failed with exit code $LASTEXITCODE"
276
+ }
277
+ }
278
+
279
+ function Test-RetiredSkillManifest {
280
+ $cleanupScript = Join-Path $RootDir "scripts\cleanup-retired-skills.js"
281
+ & node $cleanupScript --validate
282
+ if ($LASTEXITCODE -ne 0) {
283
+ throw "Retired skill manifest validation failed with exit code $LASTEXITCODE"
284
+ }
285
+ }
286
+
303
287
  function Install-ClaudeWorkflow {
304
288
  $dest = Join-Path $HomeDir ".claude"
305
289
 
@@ -315,6 +299,7 @@ function Install-ClaudeWorkflow {
315
299
  Copy-ClaudeSettings -Source (Join-Path $RootDir "settings.json") -Destination $settingsPath
316
300
  Convert-ClaudeSettingsHookPaths -SettingsPath $settingsPath
317
301
  Install-SharedDirs -Destination $dest
302
+ Remove-RetiredSkills -Destination $dest
318
303
  Remove-PackageOnlyPaths -Destination $dest
319
304
  }
320
305
 
@@ -329,9 +314,12 @@ function Install-CodexWorkflow {
329
314
  Remove-ObsoleteWorkflowPaths -Destination $dest
330
315
  Copy-ConfigFile -Source (Join-Path $RootDir "AGENTS.md") -Destination (Join-Path $dest "AGENTS.md")
331
316
  Install-SharedDirs -Destination $dest
317
+ Remove-RetiredSkills -Destination $dest
332
318
  Remove-PackageOnlyPaths -Destination $dest
333
319
  }
334
320
 
321
+ Test-RetiredSkillManifest
322
+
335
323
  if ($InstallClaude) {
336
324
  Install-ClaudeWorkflow
337
325
  }
@@ -86,82 +86,12 @@ copy_claude_settings() {
86
86
 
87
87
  backup_if_changed "$src" "$dest"
88
88
  if [ "$DRY_RUN" -eq 1 ]; then
89
- echo "[dry-run] merge '$src' into '$dest' preserving existing env and mcpServers, purging legacy hook paths"
89
+ echo "[dry-run] merge '$src' into '$dest' preserving existing env and mcpServers"
90
+ echo "[dry-run] purge legacy hook paths while merging Claude settings"
90
91
  return
91
92
  fi
92
93
 
93
- node - "$src" "$dest" <<'NODE'
94
- const fs = require('fs')
95
-
96
- const [, , sourcePath, destinationPath] = process.argv
97
- const source = JSON.parse(fs.readFileSync(sourcePath, 'utf8'))
98
- const existing = fs.existsSync(destinationPath)
99
- ? JSON.parse(fs.readFileSync(destinationPath, 'utf8'))
100
- : {}
101
-
102
- // 清理旧版 Hook 路径模式,避免合并后残留不存在的文件引用
103
- const LEGACY_HOOK_PATTERNS = [
104
- 'scripts/hooks/run-with-flags.js',
105
- 'scripts/hooks/commit-quality.js',
106
- 'scripts/hooks/session-start.js',
107
- 'scripts/hooks/session-end.js',
108
- 'scripts/lib/hook-flags.js',
109
- 'scripts/lib/utils.js',
110
- 'hooks/observe.js',
111
- 'hooks/review-confidence.js',
112
- 'hooks/session-start.js',
113
- 'hooks/session-end.js',
114
- 'hooks/evaluate-session.js',
115
- 'hooks/pre-compact.js',
116
- 'hooks/runtime/session-utils.js'
117
- ]
118
-
119
- function isLegacyHook(hookDef) {
120
- if (typeof hookDef !== 'object' || !hookDef.command) return false
121
- return LEGACY_HOOK_PATTERNS.some(p => hookDef.command.includes(p))
122
- }
123
-
124
- function filterHooks(hooksArray) {
125
- if (!Array.isArray(hooksArray)) return hooksArray
126
- return hooksArray.map(entry => {
127
- if (!entry || !Array.isArray(entry.hooks)) return entry
128
- const filtered = entry.hooks.filter(h => !isLegacyHook(h))
129
- return { ...entry, hooks: filtered }
130
- }).filter(entry => entry.hooks && entry.hooks.length > 0)
131
- }
132
-
133
- function cleanHooks(hooksObj) {
134
- if (!hooksObj || typeof hooksObj !== 'object') return hooksObj
135
- const cleaned = {}
136
- for (const [eventType, entries] of Object.entries(hooksObj)) {
137
- const filtered = filterHooks(entries)
138
- if (filtered.length > 0) {
139
- cleaned[eventType] = filtered
140
- }
141
- }
142
- return cleaned
143
- }
144
-
145
- const merged = {
146
- ...existing,
147
- ...source,
148
- env: {
149
- ...(source.env || {}),
150
- ...(existing.env || {})
151
- },
152
- mcpServers: {
153
- ...(source.mcpServers || {}),
154
- ...(existing.mcpServers || {})
155
- },
156
- // hooks 以 source 为权威,清理 existing 中的旧版残留
157
- hooks: cleanHooks({
158
- ...(existing.hooks || {}),
159
- ...(source.hooks || {})
160
- })
161
- }
162
-
163
- fs.writeFileSync(destinationPath, JSON.stringify(merged, null, 2) + '\n')
164
- NODE
94
+ node "$ROOT_DIR/scripts/merge-claude-settings.cjs" "$src" "$dest"
165
95
  chmod 600 "$dest"
166
96
  }
167
97
 
@@ -197,7 +127,6 @@ install_shared_dirs() {
197
127
  copy_dir scripts "$dest"
198
128
  copy_dir hooks "$dest"
199
129
  copy_dir skills "$dest"
200
- copy_dir homunculus "$dest"
201
130
  copy_dir references "$dest"
202
131
  }
203
132
 
@@ -206,12 +135,25 @@ remove_package_only_paths() {
206
135
 
207
136
  for file in \
208
137
  "scripts/install.sh" \
209
- "scripts/install.ps1"
138
+ "scripts/install.ps1" \
139
+ "scripts/verify-harness.js" \
140
+ "scripts/verify/core.js" \
141
+ "scripts/verify/grilling-spec-gate-checks.js" \
142
+ "scripts/verify/metadata-checks.js" \
143
+ "scripts/verify/repository-checks.js" \
144
+ "scripts/verify/runtime-checks.js" \
145
+ "scripts/verify/workflow-checks.js" \
146
+ "scripts/verify/workflow-ownership-fixtures.js" \
147
+ "scripts/verify/workflow-ownership.js"
210
148
  do
211
149
  if [ -f "$dest/$file" ]; then
212
150
  run rm -f "$dest/$file"
213
151
  fi
214
152
  done
153
+
154
+ if [ -d "$dest/scripts/verify" ] && [ -z "$(find "$dest/scripts/verify" -mindepth 1 -print -quit)" ]; then
155
+ run rmdir "$dest/scripts/verify"
156
+ fi
215
157
  }
216
158
 
217
159
  remove_obsolete_workflow_paths() {
@@ -220,6 +162,17 @@ remove_obsolete_workflow_paths() {
220
162
  local dir
221
163
 
222
164
  for file in \
165
+ "commands/e2e.md" \
166
+ "commands/evolve.md" \
167
+ "commands/grill.md" \
168
+ "commands/harness-audit.md" \
169
+ "commands/instinct-status.md" \
170
+ "commands/learn-eval.md" \
171
+ "commands/projects.md" \
172
+ "commands/promote.md" \
173
+ "commands/prune.md" \
174
+ "commands/setup-workflow.md" \
175
+ "commands/tdd.md" \
223
176
  "scripts/hooks/run-with-flags.js" \
224
177
  "scripts/hooks/commit-quality.js" \
225
178
  "scripts/hooks/session-start.js" \
@@ -231,20 +184,41 @@ remove_obsolete_workflow_paths() {
231
184
  "hooks/session-end.js" \
232
185
  "hooks/evaluate-session.js" \
233
186
  "hooks/pre-compact.js" \
234
- "hooks/runtime/session-utils.js"
187
+ "hooks/runtime/session-utils.js" \
188
+ "rules/08-ecc-integration.md" \
189
+ "skills/subagent-driven-development/implementer-prompt.md" \
190
+ "skills/subagent-driven-development/task-reviewer-prompt.md" \
191
+ "skills/subagent-driven-development/scripts/sdd-workspace" \
192
+ "skills/subagent-driven-development/scripts/task-brief" \
193
+ "skills/subagent-driven-development/scripts/review-package"
235
194
  do
236
195
  if [ -f "$dest/$file" ]; then
237
196
  run rm -f "$dest/$file"
238
197
  fi
239
198
  done
240
199
 
241
- for dir in "scripts/hooks" "scripts/lib"; do
200
+ for dir in "scripts/hooks" "scripts/lib" "skills/subagent-driven-development/scripts"; do
242
201
  if [ -d "$dest/$dir" ] && [ -z "$(find "$dest/$dir" -mindepth 1 -print -quit)" ]; then
243
202
  run rmdir "$dest/$dir"
244
203
  fi
245
204
  done
246
205
  }
247
206
 
207
+ cleanup_retired_skills() {
208
+ local dest="$1"
209
+
210
+ if [ "$DRY_RUN" -eq 1 ]; then
211
+ node "$ROOT_DIR/scripts/cleanup-retired-skills.js" "$dest" --dry-run
212
+ return
213
+ fi
214
+
215
+ node "$ROOT_DIR/scripts/cleanup-retired-skills.js" "$dest"
216
+ }
217
+
218
+ validate_retired_skill_manifest() {
219
+ node "$ROOT_DIR/scripts/cleanup-retired-skills.js" --validate
220
+ }
221
+
248
222
  install_claude() {
249
223
  local dest="$HOME_DIR/.claude"
250
224
 
@@ -255,6 +229,7 @@ install_claude() {
255
229
  copy_file "$ROOT_DIR/AGENTS.md" "$dest/AGENTS.md"
256
230
  copy_claude_settings "$ROOT_DIR/settings.json" "$dest/settings.json"
257
231
  install_shared_dirs "$dest"
232
+ cleanup_retired_skills "$dest"
258
233
  remove_package_only_paths "$dest"
259
234
  }
260
235
 
@@ -266,9 +241,11 @@ install_codex() {
266
241
  remove_obsolete_workflow_paths "$dest"
267
242
  copy_file "$ROOT_DIR/AGENTS.md" "$dest/AGENTS.md"
268
243
  install_shared_dirs "$dest"
244
+ cleanup_retired_skills "$dest"
269
245
  remove_package_only_paths "$dest"
270
246
  }
271
247
 
248
+ validate_retired_skill_manifest
272
249
  require_rsync
273
250
 
274
251
  if [ "$INSTALL_CLAUDE" -eq 1 ]; then
@@ -93,9 +93,6 @@ function findInstinctsPath(customPath) {
93
93
  if (fs.existsSync(resolved)) return resolved
94
94
  }
95
95
 
96
- const cwdPath = path.join(process.cwd(), 'homunculus', 'instincts')
97
- if (fs.existsSync(cwdPath)) return cwdPath
98
-
99
96
  return path.join(os.homedir(), '.claude', 'homunculus', 'instincts')
100
97
  }
101
98
 
@@ -348,7 +345,7 @@ function printTextReport(results, staleDays) {
348
345
  if (grouped.stale.length > 0 || grouped['low-evidence'].length > 0) {
349
346
  console.log('')
350
347
  console.log(
351
- '[Review] 提示: 使用 /instinct-status 查看详情,' +
348
+ '[Review] 提示: 使用 /learn status 查看详情,' +
352
349
  '手动决定是否保留、更新或移除'
353
350
  )
354
351
  }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ const fs = require("fs");
4
+
5
+ const LEGACY_HOOK_PATTERNS = [
6
+ "scripts/hooks/run-with-flags.js",
7
+ "scripts/hooks/commit-quality.js",
8
+ "scripts/hooks/session-start.js",
9
+ "scripts/hooks/session-end.js",
10
+ "scripts/lib/hook-flags.js",
11
+ "scripts/lib/utils.js",
12
+ "hooks/observe.js",
13
+ "hooks/review-confidence.js",
14
+ "hooks/session-start.js",
15
+ "hooks/session-end.js",
16
+ "hooks/evaluate-session.js",
17
+ "hooks/pre-compact.js",
18
+ "hooks/runtime/session-utils.js",
19
+ ];
20
+
21
+ function isLegacyHook(hookDefinition) {
22
+ if (typeof hookDefinition !== "object" || !hookDefinition.command) return false;
23
+ return LEGACY_HOOK_PATTERNS.some((pattern) => hookDefinition.command.includes(pattern));
24
+ }
25
+
26
+ function filterHooks(entries) {
27
+ if (!Array.isArray(entries)) return entries;
28
+ return entries
29
+ .map((entry) => {
30
+ if (!entry || !Array.isArray(entry.hooks)) return entry;
31
+ const hooks = entry.hooks.filter((hook) => !isLegacyHook(hook));
32
+ return { ...entry, hooks };
33
+ })
34
+ .filter((entry) => entry.hooks && entry.hooks.length > 0);
35
+ }
36
+
37
+ function cleanHooks(hooks) {
38
+ if (!hooks || typeof hooks !== "object") return hooks;
39
+ const cleaned = {};
40
+ for (const [eventType, entries] of Object.entries(hooks)) {
41
+ const filtered = filterHooks(entries);
42
+ if (filtered.length > 0) cleaned[eventType] = filtered;
43
+ }
44
+ return cleaned;
45
+ }
46
+
47
+ function mergeSettings(source, existing) {
48
+ return {
49
+ ...existing,
50
+ ...source,
51
+ env: { ...(source.env || {}), ...(existing.env || {}) },
52
+ mcpServers: { ...(source.mcpServers || {}), ...(existing.mcpServers || {}) },
53
+ hooks: cleanHooks({ ...(existing.hooks || {}), ...(source.hooks || {}) }),
54
+ };
55
+ }
56
+
57
+ function readJson(path) {
58
+ const raw = fs.readFileSync(path, "utf8");
59
+ // strip BOM () if present
60
+ return JSON.parse(raw.charCodeAt(0) === 0xfeff ? raw.slice(1) : raw);
61
+ }
62
+
63
+ function main() {
64
+ const [, , sourcePath, destinationPath] = process.argv;
65
+ const source = readJson(sourcePath);
66
+ const existing = fs.existsSync(destinationPath)
67
+ ? readJson(destinationPath)
68
+ : {};
69
+ const merged = mergeSettings(source, existing);
70
+ fs.writeFileSync(destinationPath, JSON.stringify(merged, null, 2) + "\n");
71
+ }
72
+
73
+ if (require.main === module) main();
74
+
75
+ module.exports = { cleanHooks, mergeSettings };
@@ -0,0 +1,37 @@
1
+ {
2
+ "version": 1,
3
+ "retired_skills": {
4
+ "brainstorming": [
5
+ "SKILL.md",
6
+ "spec-document-reviewer-prompt.md",
7
+ "visual-companion.md",
8
+ "agents/openai.yaml",
9
+ "scripts/frame-template.html",
10
+ "scripts/helper.js",
11
+ "scripts/server.cjs",
12
+ "scripts/start-server.sh",
13
+ "scripts/stop-server.sh"
14
+ ],
15
+ "discover-unknowns-zh": [
16
+ "SKILL.md",
17
+ "agents/openai.yaml",
18
+ "references/prompt-patterns.md"
19
+ ],
20
+ "skill-creator": [
21
+ "SKILL.md",
22
+ "LICENSE.txt",
23
+ "references/output-patterns.md",
24
+ "references/workflows.md",
25
+ "scripts/init_skill.py",
26
+ "scripts/package_skill.py",
27
+ "scripts/quick_validate.py"
28
+ ],
29
+ "writing-plans": [
30
+ "SKILL.md",
31
+ "plan-document-reviewer-prompt.md"
32
+ ],
33
+ "executing-plans": [
34
+ "SKILL.md"
35
+ ]
36
+ }
37
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "schema_version": 1,
3
+ "repository": "https://github.com/mattpocock/skills",
4
+ "commit": "2ab958093e83e0ec752e6c1c5932da465bf23e0c",
5
+ "engineering": {
6
+ "ask-matt": "b1a134ada29cbfded84bc9a7f93356ab7a3d7f800edf1f541a2a964118ad45a7",
7
+ "code-review": "6a65cc61114f96db07ec41e3920e67c9c5bf70dd6e0901eb9460ebcb2bdc209f",
8
+ "codebase-design": "a8d50abac5a4018f60e1d911d4b6f4e36454ca14d6c390c0695a578c7de65dad",
9
+ "diagnosing-bugs": "7a0779480f323a66d109404646bcc1a14bf0232b45b3e3ea93b652a035718acb",
10
+ "domain-modeling": "152e2c97239affb12a60c5f4a7e74ab546a49ae169688c81f4e2ccc42dafa579",
11
+ "grill-with-docs": "610d091047bcfb9db0f75c057d15538481a721111579fc5ec7f83ad9131a2165",
12
+ "implement": "6d3fd9e83b8f36e5213854779db49b256a457a7ebb4a503e53fa7dcff696adc3",
13
+ "improve-codebase-architecture": "4b4cb798c3863d5b6f5c0b4604af1ecb5beb6df82553c972898a91ba38bcf289",
14
+ "prototype": "03074862d4b6e4eaf472aa75146e1d193dd9e3bba0e4303a9b2425562d1d44cc",
15
+ "research": "af378829f015775a3bcd65ff466826722e99359017ae6bae227ca4c9bd14049c",
16
+ "resolving-merge-conflicts": "c7c9ba81362a786aac05d2223123bf1bd2f8a99c3243a72882ede9c68bedfb24",
17
+ "setup-matt-pocock-skills": "def265a8b15ffb8afc3f335d69e175ba9a7fe3991218984b0e49e8345cde3b20",
18
+ "tdd": "5363bb2775679fe9311fbb67947f95359169c6e7f1fac77c0f25e190bca6cf2f",
19
+ "to-spec": "267638edd513b5918de626ad5605d261952abb7428cb308869c663ca924e93e7",
20
+ "to-tickets": "5ecdf1d4df8a360ed39df21a2347f97ba177afd449a577da4f6b6ea8e1ebb808",
21
+ "triage": "d45827c299c021f77b0f146fefa3ee679b13f99e9a2ffdf48e8de2347adeefe1",
22
+ "wayfinder": "257e40665b28ae959ffdcb97d7a72b074360f4a3d201bd84786505308546e434"
23
+ },
24
+ "support_dependencies": {
25
+ "productivity/handoff": "57c9f1f392d7352cdc85b1e39ca49eddc70ce1dc278bd9653fb4f23dfc2560fc"
26
+ }
27
+ }