@soleur/opencode 0.0.0-stage → 3.354.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 (832) hide show
  1. package/.claude-plugin/agents.manifest.json +476 -0
  2. package/.claude-plugin/plugin.json +42 -0
  3. package/README.md +44 -2
  4. package/agents/community/.gitkeep +0 -0
  5. package/agents/engineering/cto.md +87 -0
  6. package/agents/engineering/design/ddd-architect.md +95 -0
  7. package/agents/engineering/discovery/agent-finder.md +214 -0
  8. package/agents/engineering/discovery/functional-discovery.md +182 -0
  9. package/agents/engineering/infra/infra-security.md +151 -0
  10. package/agents/engineering/infra/platform-strategist.md +109 -0
  11. package/agents/engineering/infra/terraform-architect.md +171 -0
  12. package/agents/engineering/prompt-engineer.md +37 -0
  13. package/agents/engineering/research/best-practices-researcher.md +115 -0
  14. package/agents/engineering/research/framework-docs-researcher.md +93 -0
  15. package/agents/engineering/research/git-history-analyzer.md +53 -0
  16. package/agents/engineering/research/learnings-researcher.md +285 -0
  17. package/agents/engineering/research/repo-research-analyst.md +118 -0
  18. package/agents/engineering/review/agent-native-reviewer.md +279 -0
  19. package/agents/engineering/review/architecture-strategist.md +61 -0
  20. package/agents/engineering/review/code-quality-analyst.md +92 -0
  21. package/agents/engineering/review/code-simplicity-reviewer.md +109 -0
  22. package/agents/engineering/review/data-integrity-guardian.md +82 -0
  23. package/agents/engineering/review/data-migration-expert.md +98 -0
  24. package/agents/engineering/review/deployment-verification-agent.md +183 -0
  25. package/agents/engineering/review/dhh-rails-reviewer.md +46 -0
  26. package/agents/engineering/review/kieran-rails-reviewer.md +87 -0
  27. package/agents/engineering/review/legacy-code-expert.md +55 -0
  28. package/agents/engineering/review/observability-coverage-reviewer.md +147 -0
  29. package/agents/engineering/review/pattern-recognition-specialist.md +59 -0
  30. package/agents/engineering/review/performance-oracle.md +130 -0
  31. package/agents/engineering/review/security-sentinel.md +167 -0
  32. package/agents/engineering/review/semgrep-sast.md +36 -0
  33. package/agents/engineering/review/test-design-reviewer.md +150 -0
  34. package/agents/engineering/review/user-impact-reviewer.md +70 -0
  35. package/agents/engineering/workflow/pr-comment-resolver.md +69 -0
  36. package/agents/finance/budget-analyst.md +29 -0
  37. package/agents/finance/cfo.md +44 -0
  38. package/agents/finance/financial-reporter.md +30 -0
  39. package/agents/finance/revenue-analyst.md +30 -0
  40. package/agents/legal/clo.md +115 -0
  41. package/agents/legal/legal-compliance-auditor.md +110 -0
  42. package/agents/legal/legal-document-generator.md +134 -0
  43. package/agents/marketing/analytics-analyst.md +25 -0
  44. package/agents/marketing/brand-architect.md +181 -0
  45. package/agents/marketing/cmo.md +76 -0
  46. package/agents/marketing/conversion-optimizer.md +19 -0
  47. package/agents/marketing/copywriter.md +20 -0
  48. package/agents/marketing/fact-checker.md +70 -0
  49. package/agents/marketing/growth-strategist.md +145 -0
  50. package/agents/marketing/paid-media-strategist.md +28 -0
  51. package/agents/marketing/pricing-strategist.md +17 -0
  52. package/agents/marketing/programmatic-seo-specialist.md +25 -0
  53. package/agents/marketing/retention-strategist.md +23 -0
  54. package/agents/marketing/seo-aeo-analyst.md +164 -0
  55. package/agents/operations/coo.md +50 -0
  56. package/agents/operations/ops-advisor.md +78 -0
  57. package/agents/operations/ops-provisioner.md +101 -0
  58. package/agents/operations/ops-research.md +52 -0
  59. package/agents/operations/service-automator.md +278 -0
  60. package/agents/product/business-validator.md +206 -0
  61. package/agents/product/competitive-intelligence.md +89 -0
  62. package/agents/product/cpo.md +63 -0
  63. package/agents/product/design/ux-design-lead.md +209 -0
  64. package/agents/product/spec-flow-analyzer.md +122 -0
  65. package/agents/sales/cro.md +44 -0
  66. package/agents/sales/deal-architect.md +29 -0
  67. package/agents/sales/outbound-strategist.md +29 -0
  68. package/agents/sales/pipeline-analyst.md +29 -0
  69. package/agents/support/cco.md +48 -0
  70. package/agents/support/community-manager.md +570 -0
  71. package/agents/support/ticket-triage.md +70 -0
  72. package/bin/soleur-opencode.js +29 -0
  73. package/commands/go.md +660 -0
  74. package/commands/help.md +273 -0
  75. package/commands/sync.md +977 -0
  76. package/commands/version.md +103 -0
  77. package/hooks/antigravity-hooks.json +84 -0
  78. package/hooks/antigravity-session-start.sh +15 -0
  79. package/hooks/bare-root-cwd-guard.sh +131 -0
  80. package/hooks/browser-snapshot-credential-guard.sh +200 -0
  81. package/hooks/codex-session-start.sh +9 -0
  82. package/hooks/compaction-state.sh +525 -0
  83. package/hooks/destructive-command-guard.sh +1387 -0
  84. package/hooks/devin-session-start.sh +90 -0
  85. package/hooks/ext-filter-detect.sh +171 -0
  86. package/hooks/hooks.json +133 -0
  87. package/hooks/lib/hook-tool-kind.sh +24 -0
  88. package/hooks/lib/log-rotation.sh +176 -0
  89. package/hooks/lib/shell-argv.pl +576 -0
  90. package/hooks/memory-backstop.sh +1114 -0
  91. package/hooks/operator-stage-approval.sh +391 -0
  92. package/hooks/stop-hook.sh +367 -0
  93. package/hooks/unkept-promise-hook.sh +383 -0
  94. package/hooks/version-banner.sh +127 -0
  95. package/hooks/welcome-hook.sh +50 -0
  96. package/install.js +29 -0
  97. package/lib/agent-registry.ts +154 -0
  98. package/lib/c4-canonical-cli.mjs +34 -0
  99. package/lib/c4-canonical.mjs +46 -0
  100. package/lib/c4-from-components.ts +554 -0
  101. package/lib/go-routing.ts +81 -0
  102. package/lib/grok-inspect-contract.ts +311 -0
  103. package/lib/harness-model-map.ts +101 -0
  104. package/lib/harness-parity.ts +726 -0
  105. package/lib/harness-tool-map.ts +180 -0
  106. package/lib/harness.ts +716 -0
  107. package/lib/heartbeat-live-reconcile.ts +1153 -0
  108. package/lib/heartbeat-manifest.ts +361 -0
  109. package/lib/kb-coverage.ts +252 -0
  110. package/lib/pr-merge-poll.ts +103 -0
  111. package/lib/workflow-fidelity.ts +388 -0
  112. package/opencode/INSTRUCTIONS.md +171 -0
  113. package/opencode/agents/engineering/cto.md +10 -0
  114. package/opencode/agents/engineering/design/ddd-architect.md +10 -0
  115. package/opencode/agents/engineering/discovery/agent-finder.md +10 -0
  116. package/opencode/agents/engineering/discovery/functional-discovery.md +10 -0
  117. package/opencode/agents/engineering/infra/infra-security.md +10 -0
  118. package/opencode/agents/engineering/infra/platform-strategist.md +10 -0
  119. package/opencode/agents/engineering/infra/terraform-architect.md +10 -0
  120. package/opencode/agents/engineering/prompt-engineer.md +10 -0
  121. package/opencode/agents/engineering/research/best-practices-researcher.md +10 -0
  122. package/opencode/agents/engineering/research/framework-docs-researcher.md +10 -0
  123. package/opencode/agents/engineering/research/git-history-analyzer.md +10 -0
  124. package/opencode/agents/engineering/research/learnings-researcher.md +10 -0
  125. package/opencode/agents/engineering/research/repo-research-analyst.md +10 -0
  126. package/opencode/agents/engineering/review/agent-native-reviewer.md +10 -0
  127. package/opencode/agents/engineering/review/architecture-strategist.md +10 -0
  128. package/opencode/agents/engineering/review/code-quality-analyst.md +10 -0
  129. package/opencode/agents/engineering/review/code-simplicity-reviewer.md +10 -0
  130. package/opencode/agents/engineering/review/data-integrity-guardian.md +10 -0
  131. package/opencode/agents/engineering/review/data-migration-expert.md +10 -0
  132. package/opencode/agents/engineering/review/deployment-verification-agent.md +10 -0
  133. package/opencode/agents/engineering/review/dhh-rails-reviewer.md +10 -0
  134. package/opencode/agents/engineering/review/kieran-rails-reviewer.md +10 -0
  135. package/opencode/agents/engineering/review/legacy-code-expert.md +10 -0
  136. package/opencode/agents/engineering/review/observability-coverage-reviewer.md +10 -0
  137. package/opencode/agents/engineering/review/pattern-recognition-specialist.md +10 -0
  138. package/opencode/agents/engineering/review/performance-oracle.md +10 -0
  139. package/opencode/agents/engineering/review/security-sentinel.md +10 -0
  140. package/opencode/agents/engineering/review/semgrep-sast.md +10 -0
  141. package/opencode/agents/engineering/review/test-design-reviewer.md +10 -0
  142. package/opencode/agents/engineering/review/user-impact-reviewer.md +10 -0
  143. package/opencode/agents/engineering/workflow/pr-comment-resolver.md +10 -0
  144. package/opencode/agents/finance/budget-analyst.md +10 -0
  145. package/opencode/agents/finance/cfo.md +10 -0
  146. package/opencode/agents/finance/financial-reporter.md +10 -0
  147. package/opencode/agents/finance/revenue-analyst.md +10 -0
  148. package/opencode/agents/legal/clo.md +10 -0
  149. package/opencode/agents/legal/legal-compliance-auditor.md +10 -0
  150. package/opencode/agents/legal/legal-document-generator.md +10 -0
  151. package/opencode/agents/marketing/analytics-analyst.md +10 -0
  152. package/opencode/agents/marketing/brand-architect.md +10 -0
  153. package/opencode/agents/marketing/cmo.md +10 -0
  154. package/opencode/agents/marketing/conversion-optimizer.md +10 -0
  155. package/opencode/agents/marketing/copywriter.md +10 -0
  156. package/opencode/agents/marketing/fact-checker.md +10 -0
  157. package/opencode/agents/marketing/growth-strategist.md +10 -0
  158. package/opencode/agents/marketing/paid-media-strategist.md +10 -0
  159. package/opencode/agents/marketing/pricing-strategist.md +10 -0
  160. package/opencode/agents/marketing/programmatic-seo-specialist.md +10 -0
  161. package/opencode/agents/marketing/retention-strategist.md +10 -0
  162. package/opencode/agents/marketing/seo-aeo-analyst.md +10 -0
  163. package/opencode/agents/operations/coo.md +10 -0
  164. package/opencode/agents/operations/ops-advisor.md +10 -0
  165. package/opencode/agents/operations/ops-provisioner.md +10 -0
  166. package/opencode/agents/operations/ops-research.md +10 -0
  167. package/opencode/agents/operations/service-automator.md +10 -0
  168. package/opencode/agents/product/business-validator.md +10 -0
  169. package/opencode/agents/product/competitive-intelligence.md +10 -0
  170. package/opencode/agents/product/cpo.md +10 -0
  171. package/opencode/agents/product/design/ux-design-lead.md +10 -0
  172. package/opencode/agents/product/spec-flow-analyzer.md +10 -0
  173. package/opencode/agents/sales/cro.md +10 -0
  174. package/opencode/agents/sales/deal-architect.md +10 -0
  175. package/opencode/agents/sales/outbound-strategist.md +10 -0
  176. package/opencode/agents/sales/pipeline-analyst.md +10 -0
  177. package/opencode/agents/support/cco.md +10 -0
  178. package/opencode/agents/support/community-manager.md +10 -0
  179. package/opencode/agents/support/ticket-triage.md +10 -0
  180. package/opencode/commands/go.md +10 -0
  181. package/opencode/commands/help.md +10 -0
  182. package/opencode/commands/sync.md +10 -0
  183. package/opencode/commands/version.md +11 -0
  184. package/opencode/opencode.json +8 -0
  185. package/opencode/plugin.ts +818 -0
  186. package/package.json +36 -4
  187. package/scripts/admin-merge-ready.sh +545 -0
  188. package/scripts/admin-merge-ready.test.sh +753 -0
  189. package/scripts/affected-tests.sh +908 -0
  190. package/scripts/affected-tests.test.sh +1797 -0
  191. package/scripts/alpha-metrics.sh +78 -0
  192. package/scripts/alpha-metrics.test.sh +115 -0
  193. package/scripts/ancestor-signal-helpers.baseline.txt +16 -0
  194. package/scripts/audit-flag-flip.sh +107 -0
  195. package/scripts/check-red-on-main.sh +316 -0
  196. package/scripts/ci-head-verdict.sh +411 -0
  197. package/scripts/cloud-detect.sh +193 -0
  198. package/scripts/delegation-verify.sh +657 -0
  199. package/scripts/delegation-verify.test.sh +1424 -0
  200. package/scripts/deploy-arm.sh +475 -0
  201. package/scripts/domain-model-drift.sh +419 -0
  202. package/scripts/emit-decision.sh +144 -0
  203. package/scripts/emit-decision.test.sh +144 -0
  204. package/scripts/ext-filter-divergence-corpus.txt +15 -0
  205. package/scripts/ext-filter-divergence.sh +189 -0
  206. package/scripts/generate-c4-from-components.ts +442 -0
  207. package/scripts/grok-fidelity-gate.sh +68 -0
  208. package/scripts/grok-pre-push-gate.sh +232 -0
  209. package/scripts/harness-discovery-smoke.ts +906 -0
  210. package/scripts/harness-parity-census.ts +92 -0
  211. package/scripts/inngest-luks-alert-armed-probe.ts +29 -0
  212. package/scripts/install-opencode-adapter.ts +509 -0
  213. package/scripts/lib/affected-tests/common.sh +365 -0
  214. package/scripts/lib/affected-tests/go.sh +157 -0
  215. package/scripts/lib/affected-tests/js.sh +188 -0
  216. package/scripts/lib/affected-tests/nx-turbo.sh +98 -0
  217. package/scripts/lib/affected-tests/python.sh +185 -0
  218. package/scripts/lib/context-sanitize.sh +49 -0
  219. package/scripts/lib/domain-model-lib.sh +180 -0
  220. package/scripts/lib/ext-filter-grammar.tsv +34 -0
  221. package/scripts/lib/operator-script.sh +1236 -0
  222. package/scripts/lib/proc.sh +580 -0
  223. package/scripts/lib/session-state.sh +748 -0
  224. package/scripts/lib/tmp-classify.sh +843 -0
  225. package/scripts/lib/wrapper-boundary.sh +47 -0
  226. package/scripts/lint-ratchet.py +1547 -0
  227. package/scripts/monitor-pr-checks.sh +441 -0
  228. package/scripts/pipeline-tally.sh +756 -0
  229. package/scripts/pipeline-tally.test.sh +740 -0
  230. package/scripts/plugin-version.sh +528 -0
  231. package/scripts/precommit-guard.sh +115 -0
  232. package/scripts/precommit-guard.test.sh +254 -0
  233. package/scripts/reconcile-live-heartbeats.ts +705 -0
  234. package/scripts/render-c4-model.sh +217 -0
  235. package/scripts/resolve-git-root.sh +55 -0
  236. package/scripts/resolve-regenerable-conflicts.sh +363 -0
  237. package/scripts/resolve-regenerable-conflicts.test.sh +780 -0
  238. package/scripts/ruff-requirements.txt +22 -0
  239. package/scripts/run-in-pid-namespace.sh +98 -0
  240. package/scripts/run-in-pid-namespace.test.sh +290 -0
  241. package/scripts/scan-ancestor-signal-helpers.py +556 -0
  242. package/scripts/scan-ancestor-signal-helpers.test.sh +670 -0
  243. package/scripts/setup-ralph-loop.sh +238 -0
  244. package/scripts/sync-cursor-name-map.ts +316 -0
  245. package/scripts/sync-grok-agent-compat.ts +188 -0
  246. package/scripts/sync-npm-package.ts +165 -0
  247. package/scripts/sync-opencode-adapter.ts +498 -0
  248. package/scripts/sync-pr-behind.sh +647 -0
  249. package/scripts/sync-pr-behind.test.sh +252 -0
  250. package/scripts/taste-profile-update.sh +180 -0
  251. package/scripts/taste-profile-update.test.sh +167 -0
  252. package/scripts/write-budget-marker.sh +23 -0
  253. package/scripts/write-kb-coverage.ts +113 -0
  254. package/skills/admin-ip-refresh/SKILL.md +81 -0
  255. package/skills/admin-ip-refresh/references/admin-ip-refresh-procedure.md +201 -0
  256. package/skills/agent-browser/SKILL.md +698 -0
  257. package/skills/agent-browser/scripts/playwright-mcp-profile-slot.sh +304 -0
  258. package/skills/agent-browser/scripts/playwright-mcp-redact-proxy.py +964 -0
  259. package/skills/agent-browser/scripts/redact-a11y-snapshot.py +443 -0
  260. package/skills/agent-browser/test/fixtures/capture-playwright-mcp-fixtures.py +217 -0
  261. package/skills/agent-browser/test/fixtures/fake-passthrough-proxy.py +24 -0
  262. package/skills/agent-browser/test/fixtures/fake-playwright-mcp.py +131 -0
  263. package/skills/agent-browser/test/fixtures/make-proxy-mutant.py +48 -0
  264. package/skills/agent-browser/test/fixtures/odd-shapes/dialog-link-injection.json +10 -0
  265. package/skills/agent-browser/test/fixtures/odd-shapes/empty-content.json +5 -0
  266. package/skills/agent-browser/test/fixtures/odd-shapes/error-and-result.json +4 -0
  267. package/skills/agent-browser/test/fixtures/odd-shapes/error-code-bool.json +6 -0
  268. package/skills/agent-browser/test/fixtures/odd-shapes/error-code-string.json +6 -0
  269. package/skills/agent-browser/test/fixtures/odd-shapes/error-message-tree.json +6 -0
  270. package/skills/agent-browser/test/fixtures/odd-shapes/error-no-data.json +6 -0
  271. package/skills/agent-browser/test/fixtures/odd-shapes/error-string.json +4 -0
  272. package/skills/agent-browser/test/fixtures/odd-shapes/error-with-data.json +9 -0
  273. package/skills/agent-browser/test/fixtures/odd-shapes/evaluate-escaped-object.json +10 -0
  274. package/skills/agent-browser/test/fixtures/odd-shapes/invalid-utf8.json +4 -0
  275. package/skills/agent-browser/test/fixtures/odd-shapes/link-result.json +10 -0
  276. package/skills/agent-browser/test/fixtures/odd-shapes/list-two-results.json +6 -0
  277. package/skills/agent-browser/test/fixtures/odd-shapes/meta-in-result.json +13 -0
  278. package/skills/agent-browser/test/fixtures/odd-shapes/no-content.json +5 -0
  279. package/skills/agent-browser/test/fixtures/odd-shapes/quoted-key.json +10 -0
  280. package/skills/agent-browser/test/fixtures/odd-shapes/resource-block.json +18 -0
  281. package/skills/agent-browser/test/fixtures/odd-shapes/result-and-method.json +11 -0
  282. package/skills/agent-browser/test/fixtures/odd-shapes/result-string.json +3 -0
  283. package/skills/agent-browser/test/fixtures/odd-shapes/run-code-escaped-one-row.json +10 -0
  284. package/skills/agent-browser/test/fixtures/odd-shapes/run-code-escaped.json +10 -0
  285. package/skills/agent-browser/test/fixtures/odd-shapes/structured-content.json +13 -0
  286. package/skills/agent-browser/test/fixtures/odd-shapes/tools-list-no-tools.json +5 -0
  287. package/skills/agent-browser/test/fixtures/odd-shapes/tree-no-credential.json +10 -0
  288. package/skills/agent-browser/test/fixtures/odd-shapes/two-text-blocks.json +14 -0
  289. package/skills/agent-browser/test/fixtures/odd-shapes/unparsable-line.json +3 -0
  290. package/skills/agent-browser/test/fixtures/odd-shapes/value-contains-brace.json +10 -0
  291. package/skills/agent-browser/test/fixtures/odd-shapes/value-contains-link-substring.json +10 -0
  292. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/close.json +12 -0
  293. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/evaluate.json +12 -0
  294. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/find.json +12 -0
  295. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/framing.json +6 -0
  296. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/initialize.json +14 -0
  297. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/navigate-link.json +12 -0
  298. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/navigate.json +12 -0
  299. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/roots-list-request.json +5 -0
  300. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/screenshot.json +17 -0
  301. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/snapshot-filename.json +12 -0
  302. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/snapshot-meta-json.json +12 -0
  303. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/snapshot-meta-raw.json +12 -0
  304. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/snapshot.json +12 -0
  305. package/skills/agent-browser/test/fixtures/playwright-mcp-0.0.78/tools-list.json +827 -0
  306. package/skills/agent-browser/test/fixtures/proxy-session-driver.py +138 -0
  307. package/skills/agent-browser/test/fixtures/session-facts.py +102 -0
  308. package/skills/agent-browser/test/playwright-mcp-lifetime.test.sh +1620 -0
  309. package/skills/agent-browser/test/playwright-mcp-redact-proxy.test.sh +1599 -0
  310. package/skills/agent-browser/test/redact-a11y-snapshot.test.sh +527 -0
  311. package/skills/agent-native-architecture/SKILL.md +479 -0
  312. package/skills/agent-native-architecture/references/action-parity-discipline.md +430 -0
  313. package/skills/agent-native-architecture/references/agent-execution-patterns.md +483 -0
  314. package/skills/agent-native-architecture/references/agent-native-testing.md +605 -0
  315. package/skills/agent-native-architecture/references/architecture-patterns.md +493 -0
  316. package/skills/agent-native-architecture/references/dynamic-context-injection.md +358 -0
  317. package/skills/agent-native-architecture/references/files-universal-interface.md +314 -0
  318. package/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +381 -0
  319. package/skills/agent-native-architecture/references/mcp-tool-design.md +524 -0
  320. package/skills/agent-native-architecture/references/mobile-patterns.md +897 -0
  321. package/skills/agent-native-architecture/references/product-implications.md +478 -0
  322. package/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +342 -0
  323. package/skills/agent-native-architecture/references/self-modification.md +294 -0
  324. package/skills/agent-native-architecture/references/shared-workspace-architecture.md +700 -0
  325. package/skills/agent-native-architecture/references/system-prompt-design.md +263 -0
  326. package/skills/agent-native-audit/SKILL.md +300 -0
  327. package/skills/agent-native-audit/workflows/agent-native-audit.workflow.js +423 -0
  328. package/skills/andrew-kane-gem-writer/SKILL.md +189 -0
  329. package/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
  330. package/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
  331. package/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
  332. package/skills/andrew-kane-gem-writer/references/resources.md +126 -0
  333. package/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
  334. package/skills/architecture/SKILL.md +436 -0
  335. package/skills/architecture/references/adr-template.md +154 -0
  336. package/skills/architecture/references/likec4-reference.md +136 -0
  337. package/skills/architecture/references/nfr-reference.md +126 -0
  338. package/skills/archive-kb/SKILL.md +86 -0
  339. package/skills/archive-kb/scripts/archive-kb.sh +300 -0
  340. package/skills/archive-kb/test/archive-kb-partial-run.test.sh +276 -0
  341. package/skills/atdd-developer/SKILL.md +65 -0
  342. package/skills/brainstorm/SKILL.md +701 -0
  343. package/skills/brainstorm/references/brainstorm-brand-workshop.md +153 -0
  344. package/skills/brainstorm/references/brainstorm-domain-config.md +63 -0
  345. package/skills/brainstorm/references/brainstorm-validation-workshop.md +65 -0
  346. package/skills/brainstorm/references/ui-surface-terms.md +42 -0
  347. package/skills/brainstorm-techniques/SKILL.md +231 -0
  348. package/skills/brainstorm-techniques/references/decision-principles.md +150 -0
  349. package/skills/brainstorm-techniques/references/phase-boundaries.md +103 -0
  350. package/skills/brainstorm-techniques/references/standing-delegation.md +407 -0
  351. package/skills/brainstorm-techniques/references/technical-ruling-delegation.md +174 -0
  352. package/skills/campaign-calendar/SKILL.md +145 -0
  353. package/skills/cf-token-scope/SKILL.md +164 -0
  354. package/skills/cf-token-scope/references/widen-playbook.md +114 -0
  355. package/skills/cf-token-scope/scripts/cf-token-scope.sh +253 -0
  356. package/skills/changelog/SKILL.md +142 -0
  357. package/skills/code-to-prd/SKILL.md +66 -0
  358. package/skills/code-to-prd/references/banner-template.md +12 -0
  359. package/skills/code-to-prd/references/prd-template.md +41 -0
  360. package/skills/code-to-prd/scripts/code-to-prd.sh +634 -0
  361. package/skills/code-to-prd/test/code-to-prd.test.sh +447 -0
  362. package/skills/code-to-prd/test/fixture/.env.example +7 -0
  363. package/skills/code-to-prd/test/fixture/app/about/page.tsx +11 -0
  364. package/skills/code-to-prd/test/fixture/app/api/health/route.ts +10 -0
  365. package/skills/code-to-prd/test/fixture/app/page.tsx +14 -0
  366. package/skills/code-to-prd/test/fixture/next.config.mjs +3 -0
  367. package/skills/code-to-prd/test/fixture/package.json +6 -0
  368. package/skills/cohort-status/SKILL.md +62 -0
  369. package/skills/community/SKILL.md +210 -0
  370. package/skills/community/scripts/bsky-community.sh +644 -0
  371. package/skills/community/scripts/bsky-setup.sh +631 -0
  372. package/skills/community/scripts/community-router.sh +93 -0
  373. package/skills/community/scripts/discord-community.sh +487 -0
  374. package/skills/community/scripts/discord-setup.sh +784 -0
  375. package/skills/community/scripts/github-community.sh +706 -0
  376. package/skills/community/scripts/hn-community.sh +233 -0
  377. package/skills/community/scripts/lib/hmac-sha1-b64.sh +126 -0
  378. package/skills/community/scripts/linkedin-community.sh +750 -0
  379. package/skills/community/scripts/linkedin-setup.sh +758 -0
  380. package/skills/community/scripts/x-community.sh +890 -0
  381. package/skills/community/scripts/x-setup.sh +713 -0
  382. package/skills/community/test/community-argv.test.sh +2922 -0
  383. package/skills/community/test/github-community.test.sh +981 -0
  384. package/skills/competitive-analysis/SKILL.md +69 -0
  385. package/skills/competitive-analysis/references/peer-plugin-audit.md +218 -0
  386. package/skills/compound/SKILL.md +673 -0
  387. package/skills/compound/scripts/token-efficiency-report.sh +334 -0
  388. package/skills/compound/test/phase-16.test.sh +379 -0
  389. package/skills/compound-capture/SKILL.md +791 -0
  390. package/skills/compound-capture/assets/critical-pattern-template.md +37 -0
  391. package/skills/compound-capture/assets/resolution-template.md +116 -0
  392. package/skills/compound-capture/references/yaml-schema.md +67 -0
  393. package/skills/compound-capture/schema.yaml +181 -0
  394. package/skills/constraint-scaffold/SKILL.md +175 -0
  395. package/skills/constraint-scaffold/references/boundary-readme.template +35 -0
  396. package/skills/constraint-scaffold/references/constraint-gates-workflow.template +69 -0
  397. package/skills/constraint-scaffold/references/depcruise-config.template +230 -0
  398. package/skills/constraint-scaffold/references/fix-constraints-stage-a.template +240 -0
  399. package/skills/constraint-scaffold/references/fix-constraints-stage-b.template +313 -0
  400. package/skills/constraint-scaffold/references/shared-runner.template +135 -0
  401. package/skills/constraint-scaffold/scripts/constraint-scaffold.sh +589 -0
  402. package/skills/constraint-scaffold/test/bite-proof.test.sh +1338 -0
  403. package/skills/constraint-scaffold/test/boundary.test.sh +734 -0
  404. package/skills/constraint-scaffold/test/emit-fix-constraints.test.sh +193 -0
  405. package/skills/constraint-scaffold/test/generator.test.sh +93 -0
  406. package/skills/constraint-scaffold/test/parity.test.sh +285 -0
  407. package/skills/content-writer/SKILL.md +242 -0
  408. package/skills/content-writer/scripts/blog-jargon-scan.sh +42 -0
  409. package/skills/cron-delete/SKILL.md +56 -0
  410. package/skills/cron-list/SKILL.md +54 -0
  411. package/skills/deepen-plan/SKILL.md +937 -0
  412. package/skills/deepen-plan/workflows/deepen-plan.workflow.js +488 -0
  413. package/skills/deploy/SKILL.md +115 -0
  414. package/skills/deploy/references/hetzner-setup.md +67 -0
  415. package/skills/deploy/scripts/deploy.sh +37 -0
  416. package/skills/deploy-docs/SKILL.md +95 -0
  417. package/skills/dhh-rails-style/SKILL.md +203 -0
  418. package/skills/dhh-rails-style/references/architecture.md +717 -0
  419. package/skills/dhh-rails-style/references/controllers.md +323 -0
  420. package/skills/dhh-rails-style/references/frontend.md +556 -0
  421. package/skills/dhh-rails-style/references/gems.md +316 -0
  422. package/skills/dhh-rails-style/references/models.md +388 -0
  423. package/skills/dhh-rails-style/references/testing.md +354 -0
  424. package/skills/discord-content/SKILL.md +126 -0
  425. package/skills/docs-site/SKILL.md +214 -0
  426. package/skills/drain-labeled-backlog/SKILL.md +203 -0
  427. package/skills/drain-labeled-backlog/scripts/group-by-area.sh +208 -0
  428. package/skills/drain-labeled-backlog/workflows/drain-labeled-backlog.workflow.js +433 -0
  429. package/skills/drain-prs/SKILL.md +143 -0
  430. package/skills/drain-prs/scripts/triage-prs.sh +192 -0
  431. package/skills/drain-prs/test/argv-ceiling.test.sh +183 -0
  432. package/skills/dspy-ruby/SKILL.md +634 -0
  433. package/skills/dspy-ruby/assets/config-template.rb +359 -0
  434. package/skills/dspy-ruby/assets/module-template.rb +326 -0
  435. package/skills/dspy-ruby/assets/signature-template.rb +143 -0
  436. package/skills/dspy-ruby/references/core-concepts.md +268 -0
  437. package/skills/dspy-ruby/references/optimization.md +623 -0
  438. package/skills/dspy-ruby/references/providers.md +335 -0
  439. package/skills/eval-harness/README.md +194 -0
  440. package/skills/eval-harness/SKILL.md +157 -0
  441. package/skills/eval-harness/enums/go-routes.json +13 -0
  442. package/skills/eval-harness/enums/incident-threshold.json +5 -0
  443. package/skills/eval-harness/enums/lane.json +5 -0
  444. package/skills/eval-harness/enums/tool-selection.json +20 -0
  445. package/skills/eval-harness/enums/triage-levels.json +5 -0
  446. package/skills/eval-harness/gated-skills.json +34 -0
  447. package/skills/eval-harness/models.generated.json +5 -0
  448. package/skills/eval-harness/promptfooconfig-go-routing.yaml +35 -0
  449. package/skills/eval-harness/promptfooconfig-incident-threshold.yaml +32 -0
  450. package/skills/eval-harness/promptfooconfig-lane-inference.yaml +33 -0
  451. package/skills/eval-harness/promptfooconfig-ticket-triage.yaml +34 -0
  452. package/skills/eval-harness/promptfooconfig-tool-selection.yaml +33 -0
  453. package/skills/eval-harness/prompts/go-baseline.txt +6 -0
  454. package/skills/eval-harness/prompts/go-skill.txt +21 -0
  455. package/skills/eval-harness/prompts/incident-threshold-baseline.txt +6 -0
  456. package/skills/eval-harness/prompts/incident-threshold-skill.txt +12 -0
  457. package/skills/eval-harness/prompts/lane-inference-baseline.txt +6 -0
  458. package/skills/eval-harness/prompts/lane-inference-skill.txt +15 -0
  459. package/skills/eval-harness/prompts/tool-selection-baseline.txt +19 -0
  460. package/skills/eval-harness/prompts/tool-selection-skill.txt +22 -0
  461. package/skills/eval-harness/prompts/triage-baseline.txt +7 -0
  462. package/skills/eval-harness/prompts/triage-skill.txt +10 -0
  463. package/skills/eval-harness/scripts/eval-gate.cjs +318 -0
  464. package/skills/eval-harness/scripts/extract-block.cjs +87 -0
  465. package/skills/eval-harness/scripts/gate-classification.cjs +28 -0
  466. package/skills/eval-harness/scripts/gen-models.sh +41 -0
  467. package/skills/eval-harness/scripts/gen-skill-prompt.cjs +177 -0
  468. package/skills/eval-harness/scripts/measure-classification.cjs +30 -0
  469. package/skills/eval-harness/scripts/parse-label.cjs +93 -0
  470. package/skills/eval-harness/scripts/verdict.cjs +132 -0
  471. package/skills/eval-harness/tasks/go-routing.jsonl +8 -0
  472. package/skills/eval-harness/tasks/incident-threshold.jsonl +7 -0
  473. package/skills/eval-harness/tasks/lane-inference.jsonl +7 -0
  474. package/skills/eval-harness/tasks/ticket-triage.jsonl +6 -0
  475. package/skills/eval-harness/tasks/tool-selection.jsonl +15 -0
  476. package/skills/eval-harness/test/eval-gate.test.sh +132 -0
  477. package/skills/eval-harness/test/extract-block.test.sh +87 -0
  478. package/skills/eval-harness/test/gate-classification.test.sh +77 -0
  479. package/skills/eval-harness/test/gen-models.test.sh +75 -0
  480. package/skills/eval-harness/test/measure-classification.test.sh +74 -0
  481. package/skills/eval-harness/test/parse-label.test.sh +129 -0
  482. package/skills/eval-harness/test/registry-completeness.test.sh +109 -0
  483. package/skills/eval-harness/test/verdict.test.sh +123 -0
  484. package/skills/every-style-editor/SKILL.md +142 -0
  485. package/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
  486. package/skills/feature-tweet/SKILL.md +199 -0
  487. package/skills/feature-video/SKILL.md +412 -0
  488. package/skills/feature-video/scripts/check_deps.sh +281 -0
  489. package/skills/file-todos/SKILL.md +267 -0
  490. package/skills/file-todos/assets/todo-template.md +166 -0
  491. package/skills/fix-issue/SKILL.md +278 -0
  492. package/skills/fix-issue/references/agent-authored-exclusion.md +120 -0
  493. package/skills/fix-issue/references/exclude-label-jq-snippet.md +97 -0
  494. package/skills/flag-bootstrap/SETUP.md +142 -0
  495. package/skills/flag-create/SKILL.md +145 -0
  496. package/skills/flag-create/scripts/create.sh +273 -0
  497. package/skills/flag-delete/SKILL.md +167 -0
  498. package/skills/flag-delete/scripts/delete.sh +288 -0
  499. package/skills/flag-list/SKILL.md +99 -0
  500. package/skills/flag-list/scripts/list.sh +275 -0
  501. package/skills/flag-set-role/SKILL.md +229 -0
  502. package/skills/flag-set-role/scripts/flip.sh +774 -0
  503. package/skills/frontend-anti-slop/SKILL.md +106 -0
  504. package/skills/frontend-anti-slop/references/anti-patterns.md +199 -0
  505. package/skills/frontend-anti-slop/references/slop-rules.md +65 -0
  506. package/skills/frontend-anti-slop/scripts/tier1-scan.ts +525 -0
  507. package/skills/frontend-design/SKILL.md +77 -0
  508. package/skills/gdpr-gate/NOTICE +136 -0
  509. package/skills/gdpr-gate/SKILL.md +341 -0
  510. package/skills/gdpr-gate/references/fields.md +160 -0
  511. package/skills/gdpr-gate/references/layers/api-layer.md +355 -0
  512. package/skills/gdpr-gate/references/layers/auth-sessions.md +290 -0
  513. package/skills/gdpr-gate/references/layers/data-in-transit.md +331 -0
  514. package/skills/gdpr-gate/references/layers/data-lifecycle.md +341 -0
  515. package/skills/gdpr-gate/references/layers/frontend.md +249 -0
  516. package/skills/gdpr-gate/references/layers/testing-seeding.md +256 -0
  517. package/skills/gdpr-gate/references/leakage-vectors.md +248 -0
  518. package/skills/gdpr-gate/references/legacy/legal-consent-v1-prose.md +48 -0
  519. package/skills/gdpr-gate/references/legal-consent.md +140 -0
  520. package/skills/gdpr-gate/references/non-negotiables.md +60 -0
  521. package/skills/gdpr-gate/scripts/gdpr-gate.sh +271 -0
  522. package/skills/gdpr-gate/scripts/notice-frontmatter.sh +337 -0
  523. package/skills/gdpr-gate/scripts/path-denylist.txt +39 -0
  524. package/skills/gdpr-gate/scripts/repo-scan.sh +158 -0
  525. package/skills/gdpr-gate/scripts/vendor-drift-classify.sh +120 -0
  526. package/skills/gdpr-gate/scripts/vendor-pin-integrity.sh +237 -0
  527. package/skills/gemini-imagegen/SKILL.md +283 -0
  528. package/skills/gemini-imagegen/requirements.txt +5 -0
  529. package/skills/gemini-imagegen/scripts/_error_handling.py +146 -0
  530. package/skills/gemini-imagegen/scripts/compose_images.py +150 -0
  531. package/skills/gemini-imagegen/scripts/edit_image.py +137 -0
  532. package/skills/gemini-imagegen/scripts/gemini_images.py +256 -0
  533. package/skills/gemini-imagegen/scripts/generate_image.py +147 -0
  534. package/skills/gemini-imagegen/scripts/multi_turn_chat.py +223 -0
  535. package/skills/gemini-imagegen/scripts/test_error_handling.py +179 -0
  536. package/skills/git-worktree/SKILL.md +534 -0
  537. package/skills/git-worktree/scripts/git-repo-readiness-diag.sh +98 -0
  538. package/skills/git-worktree/scripts/worktree-manager.sh +4773 -0
  539. package/skills/git-worktree/test/create-from-origin-main.test.sh +116 -0
  540. package/skills/git-worktree/test/lease-protects-active.test.sh +1056 -0
  541. package/skills/git-worktree/test/no-repo-fail-loud.test.sh +88 -0
  542. package/skills/git-worktree/test/orphan-reaper-honest-count.test.sh +379 -0
  543. package/skills/git-worktree/test/reap-archive-persistence.test.sh +725 -0
  544. package/skills/git-worktree/test/stale-lock-sweep.test.sh +176 -0
  545. package/skills/go/SKILL.md +54 -0
  546. package/skills/growth/SKILL.md +164 -0
  547. package/skills/harvest-debt/SKILL.md +78 -0
  548. package/skills/harvest-debt/scripts/harvest-debt.sh +114 -0
  549. package/skills/heal-skill/SKILL.md +173 -0
  550. package/skills/help/SKILL.md +46 -0
  551. package/skills/incident/NOTICE +39 -0
  552. package/skills/incident/SKILL.md +395 -0
  553. package/skills/incident/scripts/dry-run.sh +448 -0
  554. package/skills/incident/scripts/redact-engine.py +412 -0
  555. package/skills/incident/scripts/redact-sentinel.sh +44 -0
  556. package/skills/incident/templates/pir.md +139 -0
  557. package/skills/incident/test/fixtures/dry-run-incident.json +26 -0
  558. package/skills/incident/test/fixtures/dry-run-secret-leak.json +26 -0
  559. package/skills/incident/test/fixtures/legacy-bash-scanner.sh +82 -0
  560. package/skills/incident/test/fixtures/positive-corpus.md +87 -0
  561. package/skills/incident/test/redact-sentinel.test.sh +1420 -0
  562. package/skills/invoice/SKILL.md +206 -0
  563. package/skills/kb-glossary/SKILL.md +71 -0
  564. package/skills/kb-glossary/references/glossary-format.md +111 -0
  565. package/skills/kb-glossary/references/rejected-request-register.md +115 -0
  566. package/skills/kb-search/SKILL.md +276 -0
  567. package/skills/kb-search/scripts/kb-search-cache.sh +123 -0
  568. package/skills/legal-audit/SKILL.md +161 -0
  569. package/skills/legal-generate/NOTICE +242 -0
  570. package/skills/legal-generate/SKILL.md +244 -0
  571. package/skills/legal-generate/references/templates/advisor-agreement/template.md +12 -0
  572. package/skills/legal-generate/references/templates/business-associate-agreement/template.md +112 -0
  573. package/skills/legal-generate/references/templates/cookie-notice/template.md +82 -0
  574. package/skills/legal-generate/references/templates/dpa-global/template.md +439 -0
  575. package/skills/legal-generate/references/templates/dpa-us/template.md +222 -0
  576. package/skills/legal-generate/references/templates/employee-offer-letter/template.md +75 -0
  577. package/skills/legal-generate/references/templates/master-services-agreement/template.md +252 -0
  578. package/skills/legal-generate/references/templates/mutual-nda/template.md +66 -0
  579. package/skills/legal-generate/references/templates/one-way-nda/template.md +38 -0
  580. package/skills/legal-generate/references/templates/privacy-policy-gdpr/template.md +427 -0
  581. package/skills/legal-generate/references/templates/privacy-policy-us/template.md +313 -0
  582. package/skills/legal-generate/references/templates/terms-of-use/template.md +75 -0
  583. package/skills/legal-generate/scripts/strip-vendor-credit.sh +96 -0
  584. package/skills/linear-fetch/SKILL.md +247 -0
  585. package/skills/linear-fetch/scripts/assert-no-linear-telemetry.sh +66 -0
  586. package/skills/linear-fetch/scripts/redact-linear-urls.sh +51 -0
  587. package/skills/linear-fetch/scripts/render-caller-template.sh +36 -0
  588. package/skills/linear-fetch/test/assert-no-linear-telemetry.test.sh +113 -0
  589. package/skills/linear-fetch/test/parity.test.sh +112 -0
  590. package/skills/linear-fetch/test/persist-safe-integration.test.sh +191 -0
  591. package/skills/linear-fetch/test/redact-linear-urls.test.sh +226 -0
  592. package/skills/merge-pr/SKILL.md +670 -0
  593. package/skills/model-launch-review/SKILL.md +255 -0
  594. package/skills/model-launch-review/scripts/audit-models.sh +501 -0
  595. package/skills/one-shot/SKILL.md +316 -0
  596. package/skills/one-shot/references/token-discipline.md +74 -0
  597. package/skills/operator-bootstrap/SKILL.md +412 -0
  598. package/skills/operator-bootstrap/template.sh +439 -0
  599. package/skills/operator-digest/SKILL.md +287 -0
  600. package/skills/operator-digest/assets/operator-digest.workflow.yml +175 -0
  601. package/skills/operator-digest/scripts/digest-scrub.sh +119 -0
  602. package/skills/operator-digest/scripts/provision-operator-digest-repo.sh +147 -0
  603. package/skills/operator-rephrase/SKILL.md +98 -0
  604. package/skills/pencil-setup/SKILL.md +201 -0
  605. package/skills/pencil-setup/scripts/check_deps.sh +556 -0
  606. package/skills/pencil-setup/scripts/copy_adapter.sh +80 -0
  607. package/skills/pencil-setup/scripts/package-lock.json +1172 -0
  608. package/skills/pencil-setup/scripts/package.json +14 -0
  609. package/skills/pencil-setup/scripts/pencil-error-enrichment.mjs +21 -0
  610. package/skills/pencil-setup/scripts/pencil-mcp-adapter.mjs +733 -0
  611. package/skills/pencil-setup/scripts/pencil-response-classify.mjs +38 -0
  612. package/skills/pencil-setup/scripts/pencil-save-gate.mjs +26 -0
  613. package/skills/pencil-setup/scripts/sanitize-filename.mjs +25 -0
  614. package/skills/plan/SKILL.md +1140 -0
  615. package/skills/plan/references/differential-migration-testing.md +185 -0
  616. package/skills/plan/references/plan-community-discovery.md +42 -0
  617. package/skills/plan/references/plan-founder-check.md +137 -0
  618. package/skills/plan/references/plan-functional-overlap.md +25 -0
  619. package/skills/plan/references/plan-host-fanout.md +51 -0
  620. package/skills/plan/references/plan-issue-templates.md +779 -0
  621. package/skills/plan/references/plan-network-outage-checklist.md +131 -0
  622. package/skills/plan/references/plan-scope-check.md +126 -0
  623. package/skills/plan/references/plan-sharp-edges.md +331 -0
  624. package/skills/plan/references/plan-signoff-lifecycle.md +12 -0
  625. package/skills/plan/references/webapp-cwv-observability.md +143 -0
  626. package/skills/plan-review/SKILL.md +91 -0
  627. package/skills/plan-review/lib/named-panel.mjs +58 -0
  628. package/skills/plan-review/workflows/plan-review.workflow.js +477 -0
  629. package/skills/postmerge/SKILL.md +642 -0
  630. package/skills/postmerge/references/deploy-status-debugging.md +141 -0
  631. package/skills/postmerge/references/graceful-degradation.md +20 -0
  632. package/skills/postmerge/references/sentry-error-count-delta.md +137 -0
  633. package/skills/preflight/SKILL.md +1553 -0
  634. package/skills/preflight/references/check-13-founder-check.md +286 -0
  635. package/skills/preflight/scripts/founder-check.py +1640 -0
  636. package/skills/preflight/scripts/parse-form-a.awk +107 -0
  637. package/skills/preflight/scripts/probe-verb-gate.sh +108 -0
  638. package/skills/product-roadmap/SKILL.md +357 -0
  639. package/skills/product-roadmap/scripts/roadmap-reconcile.sh +327 -0
  640. package/skills/provision-cloudflare/SKILL.md +67 -0
  641. package/skills/provision-cloudflare/scripts/provision-cloudflare.sh +271 -0
  642. package/skills/provision-doppler/SKILL.md +58 -0
  643. package/skills/provision-doppler/scripts/provision-doppler.sh +358 -0
  644. package/skills/provision-github/SKILL.md +59 -0
  645. package/skills/provision-github/scripts/provision-github.sh +300 -0
  646. package/skills/provision-hetzner/SKILL.md +76 -0
  647. package/skills/provision-hetzner/scripts/provision-hetzner.sh +262 -0
  648. package/skills/provision-hetzner/test/fixture/knowledge-base/legal/tenant-dpa-register.md +26 -0
  649. package/skills/provision-hetzner/test/fixture/provision-hetzner-dry-run.golden +34 -0
  650. package/skills/provision-hetzner/test/provision-hetzner-characterization.test.sh +227 -0
  651. package/skills/qa/SKILL.md +263 -0
  652. package/skills/qa/references/browser-preflight.md +22 -0
  653. package/skills/questionnaire-generate/SKILL.md +328 -0
  654. package/skills/questionnaire-generate/references/questionnaire.template +60 -0
  655. package/skills/rclone/SKILL.md +162 -0
  656. package/skills/rclone/scripts/check_setup.sh +63 -0
  657. package/skills/release-announce/SKILL.md +65 -0
  658. package/skills/release-docs/SKILL.md +92 -0
  659. package/skills/reproduce-bug/SKILL.md +358 -0
  660. package/skills/resolve-debt/SKILL.md +85 -0
  661. package/skills/resolve-debt/scripts/resolve-debt.py +584 -0
  662. package/skills/resolve-parallel/SKILL.md +45 -0
  663. package/skills/resolve-parallel/workflows/resolve-parallel.workflow.js +415 -0
  664. package/skills/resolve-pr-parallel/SKILL.md +68 -0
  665. package/skills/resolve-pr-parallel/workflows/resolve-pr-parallel.workflow.js +419 -0
  666. package/skills/resolve-todo-parallel/SKILL.md +57 -0
  667. package/skills/resolve-todo-parallel/workflows/resolve-todo-parallel.workflow.js +398 -0
  668. package/skills/review/SKILL.md +1620 -0
  669. package/skills/review/references/anti-slop-scanner-hook.md +40 -0
  670. package/skills/review/references/defect-classes-migrations.md +9 -0
  671. package/skills/review/references/generated-input-oracle-surfaces.md +15 -0
  672. package/skills/review/references/review-e2e-testing.md +116 -0
  673. package/skills/review/references/review-evidence-comment.md +36 -0
  674. package/skills/review/references/review-todo-structure.md +165 -0
  675. package/skills/review/references/risk-tier-and-fix-rounds.md +97 -0
  676. package/skills/review/references/semgrep-custom-rules.yaml +174 -0
  677. package/skills/review/references/ultrathink-phases.md +98 -0
  678. package/skills/review/references/wfs.md +6 -0
  679. package/skills/review/scripts/emit-review-trailer.sh +499 -0
  680. package/skills/review/scripts/ensure-semgrep.sh +99 -0
  681. package/skills/review/scripts/fix-round-seats.sh +197 -0
  682. package/skills/review/test/emit-review-trailer.test.sh +387 -0
  683. package/skills/review/test/ensure-semgrep.test.sh +111 -0
  684. package/skills/review/test/fix-round-seats.test.sh +237 -0
  685. package/skills/review/workflows/README.md +147 -0
  686. package/skills/review/workflows/review.workflow.js +667 -0
  687. package/skills/schedule/SKILL.md +796 -0
  688. package/skills/seo-aeo/SKILL.md +139 -0
  689. package/skills/seo-aeo/scripts/validate-csp.sh +233 -0
  690. package/skills/seo-aeo/scripts/validate-seo.sh +262 -0
  691. package/skills/ship/SKILL.md +3023 -0
  692. package/skills/ship/references/adr-ordinal-collision.md +47 -0
  693. package/skills/ship/references/affected-gate-contract.md +115 -0
  694. package/skills/ship/references/ci-run-diagnosis.md +29 -0
  695. package/skills/ship/references/ci-workflow-authoring.md +68 -0
  696. package/skills/ship/references/cleanup-merged-archival.md +39 -0
  697. package/skills/ship/references/counsel-review-clo-attestation.md +38 -0
  698. package/skills/ship/references/cto-ruling-armed-push.md +5 -0
  699. package/skills/ship/references/decision-challenges-render.md +71 -0
  700. package/skills/ship/references/delegated-act-authoring-form.md +7 -0
  701. package/skills/ship/references/detached-battery-verdict.md +13 -0
  702. package/skills/ship/references/epic-close-sweep.md +62 -0
  703. package/skills/ship/references/feature-tweet-draft.md +42 -0
  704. package/skills/ship/references/followthrough-issue-body-template.md +47 -0
  705. package/skills/ship/references/followthrough-stub-template.sh +92 -0
  706. package/skills/ship/references/merge-queue-dequeue.md +39 -0
  707. package/skills/ship/references/operator-holds.md +179 -0
  708. package/skills/ship/references/pipeline-tally-render.md +43 -0
  709. package/skills/ship/references/pr-overlap.md +153 -0
  710. package/skills/ship/references/queue-mode.md +7 -0
  711. package/skills/ship/references/ready-run-wait.md +36 -0
  712. package/skills/ship/references/red-on-main-quarantine.md +110 -0
  713. package/skills/ship/references/register-update-pr-pattern.md +88 -0
  714. package/skills/ship/references/settle-then-admin-merge.md +130 -0
  715. package/skills/ship/references/supabase-column-probe.md +13 -0
  716. package/skills/ship/scripts/auto-close-scan.sh +76 -0
  717. package/skills/ship/scripts/battery-owed.sh +403 -0
  718. package/skills/ship/scripts/hold-gate-eval.sh +410 -0
  719. package/skills/ship/scripts/net-issue-flow.sh +665 -0
  720. package/skills/ship/scripts/pr-overlap-preflight.sh +483 -0
  721. package/skills/ship/scripts/ship-pir-action-items-gate.sh +246 -0
  722. package/skills/ship/scripts/technical-ruling-gate.sh +444 -0
  723. package/skills/skill-creator/SKILL.md +299 -0
  724. package/skills/skill-creator/references/api-security.md +248 -0
  725. package/skills/skill-creator/references/authoring-levers.md +110 -0
  726. package/skills/skill-creator/references/be-clear-and-direct.md +587 -0
  727. package/skills/skill-creator/references/best-practices.md +431 -0
  728. package/skills/skill-creator/references/common-patterns.md +639 -0
  729. package/skills/skill-creator/references/core-principles.md +193 -0
  730. package/skills/skill-creator/references/executable-code.md +188 -0
  731. package/skills/skill-creator/references/iteration-and-testing.md +509 -0
  732. package/skills/skill-creator/references/official-spec.md +193 -0
  733. package/skills/skill-creator/references/recommended-structure.md +180 -0
  734. package/skills/skill-creator/references/skill-structure.md +396 -0
  735. package/skills/skill-creator/references/using-scripts.md +122 -0
  736. package/skills/skill-creator/references/using-templates.md +120 -0
  737. package/skills/skill-creator/references/workflows-and-validation.md +541 -0
  738. package/skills/skill-creator/scripts/init_skill.py +322 -0
  739. package/skills/skill-creator/scripts/package_skill.py +110 -0
  740. package/skills/skill-creator/scripts/quick_validate.py +64 -0
  741. package/skills/skill-creator/templates/router-skill.md +73 -0
  742. package/skills/skill-creator/templates/simple-skill.md +34 -0
  743. package/skills/skill-creator/workflows/add-reference.md +96 -0
  744. package/skills/skill-creator/workflows/add-script.md +104 -0
  745. package/skills/skill-creator/workflows/add-template.md +83 -0
  746. package/skills/skill-creator/workflows/add-workflow.md +128 -0
  747. package/skills/skill-creator/workflows/audit-skill.md +159 -0
  748. package/skills/skill-creator/workflows/create-domain-expertise-skill.md +623 -0
  749. package/skills/skill-creator/workflows/create-new-skill.md +207 -0
  750. package/skills/skill-creator/workflows/get-guidance.md +134 -0
  751. package/skills/skill-creator/workflows/upgrade-to-router.md +170 -0
  752. package/skills/skill-creator/workflows/verify-skill.md +226 -0
  753. package/skills/skill-security-scan/SKILL.md +145 -0
  754. package/skills/skill-security-scan/references/disclaimer.md +21 -0
  755. package/skills/skill-security-scan/references/first-party-allowlist.yaml +38 -0
  756. package/skills/skill-security-scan/references/override-artifact-schema.json +68 -0
  757. package/skills/skill-security-scan/references/override-mechanism.md +171 -0
  758. package/skills/skill-security-scan/references/redirect-domains.yaml +27 -0
  759. package/skills/skill-security-scan/references/regex-patterns.md +136 -0
  760. package/skills/skill-security-scan/references/rules/code-exec.yaml +70 -0
  761. package/skills/skill-security-scan/references/rules/filesystem-boundary.yaml +29 -0
  762. package/skills/skill-security-scan/references/rules/manifest.yaml +44 -0
  763. package/skills/skill-security-scan/references/rules/supply-chain.yaml +36 -0
  764. package/skills/skill-security-scan/references/scan-meta-schema.json +63 -0
  765. package/skills/skill-security-scan/references/test-fixtures/clean-soleur-style.skill.md +23 -0
  766. package/skills/skill-security-scan/references/test-fixtures/clean-third-party.skill.md +26 -0
  767. package/skills/skill-security-scan/references/test-fixtures/malicious-codeexec.skill.md +23 -0
  768. package/skills/skill-security-scan/references/test-fixtures/malicious-curl-pipe-bash.skill.md +69 -0
  769. package/skills/skill-security-scan/references/test-fixtures/malicious-prompt-injection.skill.md +17 -0
  770. package/skills/skill-security-scan/references/test-fixtures/malicious-telemetry-beacon.skill.md +23 -0
  771. package/skills/skill-security-scan/references/typosquat-targets.yaml +65 -0
  772. package/skills/skill-security-scan/scripts/check-codeexec.sh +41 -0
  773. package/skills/skill-security-scan/scripts/check-filesystem-boundary.sh +19 -0
  774. package/skills/skill-security-scan/scripts/check-prompt-injection.sh +95 -0
  775. package/skills/skill-security-scan/scripts/check-supply-chain.sh +219 -0
  776. package/skills/skill-security-scan/scripts/check-telemetry-surface.sh +126 -0
  777. package/skills/skill-security-scan/scripts/lib.sh +197 -0
  778. package/skills/skill-security-scan/scripts/parse-override.sh +231 -0
  779. package/skills/skill-security-scan/scripts/run-scan.sh +342 -0
  780. package/skills/skill-security-scan/scripts/run-self-test.sh +95 -0
  781. package/skills/skill-security-scan/test/argv-ceiling.test.sh +180 -0
  782. package/skills/skill-security-scan/test/meta-dir-reap.test.sh +411 -0
  783. package/skills/skill-security-scan/test/parse-override.test.sh +607 -0
  784. package/skills/skill-security-scan/test/redact-pii-ghs-shape.test.sh +251 -0
  785. package/skills/social-distribute/SKILL.md +485 -0
  786. package/skills/spec-templates/SKILL.md +274 -0
  787. package/skills/sync/SKILL.md +49 -0
  788. package/skills/test-browser/SKILL.md +464 -0
  789. package/skills/test-browser/references/feature-map.md +161 -0
  790. package/skills/test-fix-loop/SKILL.md +159 -0
  791. package/skills/test-fix-loop/references/determinism-checklist.md +154 -0
  792. package/skills/triage/SKILL.md +402 -0
  793. package/skills/trigger-cron/SKILL.md +136 -0
  794. package/skills/trigger-cron/scripts/trigger.sh +198 -0
  795. package/skills/user-set-role/SKILL.md +147 -0
  796. package/skills/user-set-role/scripts/set-role.sh +218 -0
  797. package/skills/user-story-writer/SKILL.md +77 -0
  798. package/skills/ux-audit/SKILL.md +251 -0
  799. package/skills/ux-audit/references/finding.schema.json +62 -0
  800. package/skills/ux-audit/references/route-list.yaml +95 -0
  801. package/skills/ux-audit/scripts/bot-fixture.ts +270 -0
  802. package/skills/ux-audit/scripts/bot-signin.ts +135 -0
  803. package/skills/ux-audit/scripts/dedup-hash.ts +46 -0
  804. package/skills/verification-scaffold/SKILL.md +73 -0
  805. package/skills/verification-scaffold/references/gitleaks.toml.template +13 -0
  806. package/skills/verification-scaffold/references/guardrail-audit.md +156 -0
  807. package/skills/verification-scaffold/references/guards/block-stash-hook.sh.template +72 -0
  808. package/skills/verification-scaffold/references/guards/commit-on-main-hook.sh.template +82 -0
  809. package/skills/verification-scaffold/references/guards/orphan-test-check.sh.template +102 -0
  810. package/skills/verification-scaffold/references/guards/precommit-guard.sh.template +115 -0
  811. package/skills/verification-scaffold/references/guards/secret-scan-hook.sh.template +176 -0
  812. package/skills/verification-scaffold/references/guards/verification-gates.yml.template +49 -0
  813. package/skills/verification-scaffold/references/guards/wrapper-boundary.sh.template +47 -0
  814. package/skills/verification-scaffold/references/guards.tsv +21 -0
  815. package/skills/verification-scaffold/references/verification-readme.template +55 -0
  816. package/skills/verification-scaffold/scripts/verification-scaffold.sh +785 -0
  817. package/skills/verification-scaffold/test/bite-proof.test.sh +159 -0
  818. package/skills/verification-scaffold/test/generator.test.sh +319 -0
  819. package/skills/verification-scaffold/test/manifest.test.sh +144 -0
  820. package/skills/work/SKILL.md +1480 -0
  821. package/skills/work/references/end-of-work-resume.md +7 -0
  822. package/skills/work/references/hook-test-main-cwd.md +24 -0
  823. package/skills/work/references/key-principles.md +83 -0
  824. package/skills/work/references/property-testing.md +122 -0
  825. package/skills/work/references/sql-security-definer-rpc-scaffold.sql +78 -0
  826. package/skills/work/references/work-agent-teams.md +97 -0
  827. package/skills/work/references/work-lifecycle-parallel.md +147 -0
  828. package/skills/work/references/work-lockfile-bumps.md +97 -0
  829. package/skills/work/references/work-scratch-sandboxes.md +212 -0
  830. package/skills/work/references/work-subagent-fanout.md +61 -0
  831. package/skills/work/references/work-test-harness-sharp-edges.md +73 -0
  832. package/skills/xcode-test/SKILL.md +360 -0
@@ -0,0 +1,977 @@
1
+ ---
2
+ name: sync
3
+ description: Analyze codebase and populate knowledge-base with conventions, patterns, and technical debt
4
+ argument-hint: "[area: conventions|architecture|testing|debt|project|c4|domain-model|all]"
5
+ ---
6
+
7
+ # Sync Codebase to Knowledge Base
8
+
9
+ Analyze an existing codebase and populate knowledge-base files with coding conventions, architecture decisions, testing practices, and technical debt markers.
10
+
11
+ **Use this command when:**
12
+
13
+ - Adopting Soleur on an existing project (initial bootstrap)
14
+ - Periodically updating knowledge-base as codebase evolves (maintenance)
15
+
16
+ <!-- operator-typed-render:start -->
17
+ **Any message this skill PRINTS that tells the operator to run a skill or command renders at emit time.** The doc names it canonically (`soleur:<name>`, ADR-226); before printing, render it as the active harness's **operator-typed form** per `formatSkillInvocation` (`plugins/soleur/lib/harness.ts`), which owns the per-harness slash and sigil forms — the operator types that string into a fresh session where no routing contract is in context, so a bare canonical name is model-discretion there rather than a dispatch. This covers abort messages, `AskUserQuestion` prompts and options, `Display`/`echo` lines and resume prompts alike; an agent-read instruction stays canonical.
18
+ <!-- operator-typed-render:end -->
19
+
20
+ ## Input
21
+
22
+ <sync_area> #$ARGUMENTS </sync_area>
23
+
24
+ **Valid areas:** `conventions`, `architecture`, `testing`, `debt`, `project`, `c4`, `domain-model`, `all` (default)
25
+
26
+ **Note on `rule-prune` (undocumented, monorepo-only):** This area is excluded
27
+ from `all` dispatch AND from the advertised area list above, because its
28
+ producers (`scripts/rule-metrics-aggregate.sh`, `scripts/rule-prune.sh`) live at
29
+ the monorepo root outside the plugin payload and cannot be shipped to a
30
+ marketplace install (#7442). It also has no input source on a customer machine:
31
+ its telemetry producer `emit_incident()` is defined in
32
+ `.claude/hooks/lib/incidents.sh`, which is likewise not in the payload.
33
+ Advertising it would invite a customer into a path that always halts. It remains
34
+ invocable by name inside this repo, gated on the sentinel below. Append
35
+ `--weeks=<n>` (default 8) to override the staleness threshold.
36
+
37
+ **Note on `c4`:** Generates a LikeC4 diagram from the component docs the `project`
38
+ area writes, so it runs AFTER `project` in `all` dispatch. Non-destructive: it
39
+ emits a distinct composing file and refuses to overwrite anything it did not
40
+ write.
41
+
42
+ **Note on `domain-model`:** This area runs in `all` dispatch AND standalone, with
43
+ **two different contracts** — see Domain Model Analysis below. Standalone, it is
44
+ terminal: the drift report plus the per-row approval-gated write ARE the output.
45
+ Under `all` (and in headless mode, where there is no operator to approve rows) it
46
+ bootstraps the register if absent, drift-checks, appends candidates to the
47
+ `## Auto-inferred (unreviewed)` section only, and feeds its row count into the
48
+ coverage summary rather than terminating the run.
49
+
50
+ ## Execution Flow
51
+
52
+ ### Phase 0: Setup
53
+
54
+ **Load project conventions:**
55
+
56
+ ```bash
57
+ # Load project conventions
58
+ if [[ -f "CLAUDE.md" ]]; then
59
+ cat CLAUDE.md
60
+ fi
61
+ ```
62
+
63
+ Read `CLAUDE.md` if it exists - apply project conventions during sync analysis.
64
+
65
+ **Validate knowledge-base directory exists:**
66
+
67
+ ```bash
68
+ if [[ ! -d "knowledge-base" ]]; then
69
+ mkdir -p knowledge-base/project/{learnings,brainstorms,specs,plans,components}
70
+ echo "Created knowledge-base/ directory structure"
71
+ fi
72
+ ```
73
+
74
+ If `knowledge-base/` does not exist, create it with standard subdirectories.
75
+
76
+ **Validate git repository:**
77
+
78
+ ```bash
79
+ if [[ ! -d ".git" ]]; then
80
+ echo "Warning: Not a git repository. Some analysis features may be limited."
81
+ fi
82
+ ```
83
+
84
+ Warn but continue if not a git repo.
85
+
86
+ **Validate the plugin root is OUR plugin (fail closed — #7442):**
87
+
88
+ ```bash
89
+ SOLEUR_ROOT_OK=0
90
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json" ] \
91
+ && grep -q '"name"[[:space:]]*:[[:space:]]*"soleur"' "${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json" \
92
+ && [ -d "${CLAUDE_PLUGIN_ROOT}/scripts" ]; then
93
+ SOLEUR_ROOT_OK=1
94
+ fi
95
+ if [ "$SOLEUR_ROOT_OK" -ne 1 ]; then
96
+ echo "SOLEUR_SYNC_ROOT_UNRESOLVED reason=plugin-root-unverified"
97
+ echo "soleur:sync — the plugin root did not verify as the Soleur payload; refusing to run any producer (ADR-179)." >&2
98
+ exit 1
99
+ fi
100
+ ```
101
+
102
+ **Probe the producer toolchain (named degradation, not a silent 127):**
103
+
104
+ ```bash
105
+ command -v bun >/dev/null 2>&1 \
106
+ || echo "SOLEUR_SYNC_TOOLCHAIN_MISSING tool=bun affects=c4,coverage"
107
+ ```
108
+
109
+ `bun` absent is not fatal — the areas that do not need it still run — but without
110
+ this line the failure surfaces only as `bun: command not found` with no marker,
111
+ which is indistinguishable from the area having nothing to do. Report the missing
112
+ toolchain to the user alongside whatever else the run produced.
113
+
114
+ **A producer missing from a VERIFIED root is named, not silent.** The gate above
115
+ answers whether the root is genuinely the Soleur payload, and answers it
116
+ correctly. It cannot answer whether that root actually *carries* the producer a
117
+ given area invokes — an incomplete or torn payload satisfies every predicate
118
+ above. Each producer invocation below is therefore wrapped in its own presence
119
+ check, in the same subprocess, so an absent producer is skipped rather than
120
+ invoked and reports:
121
+
122
+ ```text
123
+ SOLEUR_SYNC_PRODUCER_MISSING producer=<payload-relative-path> affects=<area> reason=absent-from-verified-root
124
+ ```
125
+
126
+ `reason=` states what was **observed** — this path is absent under a root that
127
+ verified — never why it is absent. A stale install, an interrupted install, and a
128
+ packaging change that dropped a file are indistinguishable from here, and naming
129
+ one of them would be a diagnosis the guard cannot support.
130
+
131
+ When one of these fires, report to the user verbatim:
132
+
133
+ > Soleur couldn't find one of its own files (`<producer>`), so the `<area>` step
134
+ > didn't run. This is a problem with the Soleur installation, not with your
135
+ > project. The most likely fix is to reinstall the Soleur plugin — updating the
136
+ > marketplace alone does not update an installed plugin. Run
137
+ > `claude plugin marketplace update && claude plugin update soleur@<marketplace>`,
138
+ > then start a new session. `<marketplace>` is the id `claude plugin list` prints
139
+ > beside `soleur` — `soleur-marketplace` if you installed from the published
140
+ > marketplace. If the same line comes back, reinstall outright with
141
+ > `claude plugin uninstall soleur@<marketplace> && claude plugin install soleur@<marketplace>`.
142
+ > If it still comes back, this is a bug in Soleur: please report it with this line.
143
+ > Everything else in this run completed normally.
144
+
145
+ Give the commands, not just the advice. The message names the marketplace-vs-install
146
+ distinction, and a founder who is told that and handed no command is left exactly where the
147
+ report that opened #7474 started. The plugin half is QUALIFIED (`soleur@<marketplace>`) rather
148
+ than bare: upstream anthropics/claude-code#76882 (collaborator comment 5310894439, 2026-08-17)
149
+ records that the bare plugin name can fail with "Plugin not found" on current releases. It stays
150
+ a PLACEHOLDER rather than a literal because the marketplace half differs by install path —
151
+ `soleur-marketplace` on the published path, `soleur` when the monorepo was added directly — and
152
+ this string is read by an operator whose path this code does not know. That is why
153
+ `claude plugin list` is named in the same breath: without it the placeholder is not runnable. The reinstall fallback is still worth naming, though it is no
154
+ longer the only thing that can converge an install: `plugin.json` carried a frozen `0.0.0-dev`
155
+ sentinel until 2026-08-12, which is why an install could sit months stale while reporting success
156
+ (measured in ADR-178). The manifests are keyless now and the recorded version changes with every
157
+ delivered commit, so `plugin update` has something to act on — see ADR-182.
158
+
159
+ **Do not attempt the reinstall yourself.** It mutates `${CLAUDE_PLUGIN_ROOT}` underneath a
160
+ run that is still executing. Report it and let the operator run it between sessions.
161
+
162
+ **Headless variant.** Under `--headless` (the post-clone auto-sync at
163
+ `/api/repo/setup`) the user has no plugin installed, so "reinstall the plugin" is
164
+ actively misdirecting. Report instead: *"A Soleur component (`<producer>`) was
165
+ missing, so the `<area>` step didn't run. That's a Soleur-side defect and needs
166
+ nothing from you — everything else completed normally."*
167
+
168
+ **STOP if the plugin-root block exits non-zero.** Report to the user verbatim: *"I can't run
169
+ `soleur:sync` here — I couldn't verify where the Soleur plugin is installed.
170
+ Please reinstall the plugin and try again."* Do **not** try to locate the
171
+ producers yourself, do **not** substitute a relative path, and do **not**
172
+ continue to the phases below. Resolving the plugin root by hand is the defect
173
+ this gate exists to prevent, and the refusal message is the point at which it is
174
+ most tempting.
175
+
176
+ Every producer below is anchored to `${CLAUDE_PLUGIN_ROOT}` — **bare, never
177
+ `:-` or `:?`** — the operand is **quoted** (an install path may contain spaces),
178
+ and its path is **payload-relative** (the root already *is* `plugins/soleur`, so
179
+ it is `"${CLAUDE_PLUGIN_ROOT}/scripts/foo.ts"`, never the token followed by a second
180
+ `plugins/soleur/` segment).
181
+
182
+ Why this gate checks plugin IDENTITY and not directory shape: `CLAUDE_PLUGIN_ROOT`
183
+ is an ordinary environment variable, and the Bash tool inherits the user's
184
+ profile — so a `.envrc`, a `~/.bashrc` line, or a package `postinstall` can
185
+ export it. A `test -d "$X/scripts"` predicate is satisfied by *any* directory
186
+ with a `scripts/` child, which measurably lets an ambient value execute
187
+ attacker-chosen bytes. Verifying the payload manifest raises the bar from
188
+ "set any variable" to "plant a complete fake plugin". The bare form remains
189
+ strictly better than a `:-` default, which needs no attacker precondition at all
190
+ — but it is not safe *by construction*, and this gate is what carries it.
191
+
192
+ ### Phase 1: Analyze
193
+
194
+ Based on the area specified (or `all` if none):
195
+
196
+ **1.1 Parse Area Filter**
197
+
198
+ If `<sync_area>` is empty or `all`, analyze all areas EXCEPT `rule-prune` (which must be invoked explicitly). Otherwise, analyze only the specified area. If the argument is `rule-prune`, skip all other phases and jump straight to Rule Prune Analysis below.
199
+
200
+ `domain-model` and `c4` both participate in `all` dispatch, and both have a
201
+ distinct standalone contract:
202
+
203
+ - **`domain-model` standalone** — skip all other phases and jump straight to
204
+ Domain Model Analysis; it is terminal (drift report + approval-gated write ARE
205
+ the output). **Under `all`** — run the non-interactive path (§Domain Model
206
+ Analysis, "`all`-dispatch path"), then continue into the remaining phases.
207
+ - **`c4`** — runs after the `project` area, since it consumes the component docs
208
+ that area writes. Standalone it emits only the diagram artifacts.
209
+
210
+ **Ordering within `all`:** `project` → `c4` → `domain-model` → coverage summary.
211
+ The C4 producer reads component docs, so it must not run before they are written.
212
+
213
+ **1.2 Codebase Analysis**
214
+
215
+ For each selected area, analyze the codebase:
216
+
217
+ #### Conventions Analysis
218
+
219
+ Look for coding conventions by examining:
220
+
221
+ - **Naming patterns**: Variable naming (camelCase, snake_case), file naming, class naming
222
+ - **Code style**: Indentation, bracket style, import ordering
223
+ - **Linting config**: `.eslintrc`, `.rubocop.yml`, `pyproject.toml`, etc.
224
+ - **Common patterns**: Guard clauses, early returns, error handling style
225
+
226
+ Extract as constitution.md rules in Always/Never/Prefer format.
227
+
228
+ #### Architecture Analysis
229
+
230
+ Look for architecture patterns by examining:
231
+
232
+ - **Directory structure**: Layer organization (models, services, controllers)
233
+ - **Module boundaries**: How code is organized into modules/packages
234
+ - **Dependency patterns**: Import relationships, service dependencies
235
+ - **Design patterns**: Repository pattern, service objects, etc.
236
+
237
+ Extract as learnings in `learnings/architecture/` with YAML frontmatter.
238
+
239
+ #### Testing Analysis
240
+
241
+ Look for testing practices by examining:
242
+
243
+ - **Test file patterns**: Where tests live, naming conventions
244
+ - **Test frameworks**: What testing tools are used
245
+ - **Fixture/factory patterns**: How test data is managed
246
+ - **Coverage config**: What coverage tools and thresholds are configured
247
+
248
+ Extract as constitution.md rules (Testing section).
249
+
250
+ #### Technical Debt Analysis
251
+
252
+ Look for technical debt by examining:
253
+
254
+ - **TODO/FIXME comments**: Grep for TODO, FIXME, HACK, XXX
255
+ - **Complexity hotspots**: Large files, deeply nested code
256
+ - **Outdated dependencies**: Package versions, deprecation warnings
257
+ - **Code smells**: Duplicate code patterns, long methods
258
+
259
+ Extract as learnings in `learnings/technical-debt/` with severity tags.
260
+
261
+ #### Project Analysis
262
+
263
+ Generate or update project documentation by examining:
264
+
265
+ - **Project structure**: Top-level directories, entry points, main components
266
+ - **Component boundaries**: Logical groupings of related code (not just directories)
267
+ - **Data flow**: How information moves between components
268
+ - **Dependencies**: Internal and external dependencies per component
269
+
270
+ **Component Detection Heuristics:**
271
+
272
+ 1. Top-level directories under primary source path (e.g., `src/`, `plugins/`, `lib/`)
273
+ 2. Directories containing index files or multiple related modules
274
+ 3. Exclude: `tests/`, `dist/`, `node_modules/`, generated code
275
+
276
+ **Output:**
277
+
278
+ - `knowledge-base/project/README.md` - Project purpose, architecture diagram, component index
279
+ - `knowledge-base/project/components/<name>.md` - One file per detected component
280
+
281
+ **Component Template:** Use the template from the `spec-templates` skill.
282
+
283
+ **Dependency emission (load-bearing — the C4 producer parses it).** For every
284
+ component doc, emit internal dependencies in BOTH forms:
285
+
286
+ - `dependencies:` frontmatter — a YAML list of the kebab-case `component` names
287
+ this component uses. This is the machine-readable form.
288
+ - the prose `- **Internal**:` line under `## Dependencies` — human context.
289
+
290
+ The two must agree. Omit `dependencies:` (or write `[]`) only when the component
291
+ genuinely uses no other component; do not write prose-only forms such as
292
+ `**Internal**: None (agents are standalone)` and leave the frontmatter absent.
293
+ The `c4` area below builds diagram edges from this field (falling back to
294
+ markdown links in the prose line for docs written before this contract), and a
295
+ corpus with no parseable dependencies renders a valid diagram of *disconnected
296
+ boxes* — which the relationship-count gate reports as **degraded**.
297
+
298
+ **Update Behavior:**
299
+
300
+ - **New components**: Create new `.md` file from template
301
+ - **Existing components**: Check if `updated` date is current; if not, offer to refresh
302
+ - **Removed components**: Add `status: deprecated` to frontmatter (do not delete)
303
+
304
+ #### C4 Analysis
305
+
306
+ Runs when `<sync_area>` is `c4`, and as part of `all` **after** the `project`
307
+ area (it consumes the component docs that area writes).
308
+
309
+ ```bash
310
+ # Guarded per ADR-179 decision 5 (#7474): the presence check and the invocation
311
+ # share a subprocess, so a producer missing from an otherwise identity-valid
312
+ # plugin root cannot be invoked, and its absence is named rather than surfacing
313
+ # as a bare interpreter error. Changing this shape reds
314
+ # tests/commands/test-sync-producer-reachability.sh (T0j/T0k/T0l) and
315
+ # apps/web-platform/test/plugin-root-anchoring.test.ts (P6).
316
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/generate-c4-from-components.ts" ]; then
317
+ bun "${CLAUDE_PLUGIN_ROOT}/scripts/generate-c4-from-components.ts"
318
+ else
319
+ echo "SOLEUR_SYNC_PRODUCER_MISSING producer=scripts/generate-c4-from-components.ts affects=c4 reason=absent-from-verified-root"
320
+ fi
321
+ ```
322
+
323
+ The producer parses each component doc's `dependencies:` frontmatter (falling back
324
+ to `**Internal**: [name](name.md)` links for docs written before that contract),
325
+ skips `status: deprecated` docs, and writes the diagram artifacts into
326
+ `knowledge-base/engineering/architecture/diagrams/`.
327
+
328
+ **It is non-destructive by construction, via three different mechanisms.**
329
+ `soleur:architecture` writes `spec.c4` / `model.c4` / `views.c4` cwd-relative and
330
+ the agent sandbox pins `cwd = workspacePath` — two writers, one directory. The
331
+ producer never writes those three names. What protects each artifact differs, and
332
+ the difference matters when reading the marker:
333
+
334
+ | Artifact | Protection | Marker field |
335
+ |---|---|---|
336
+ | `generated-components.c4` | `GENERATED` header; refuses to overwrite a file whose first line is not that header | `skipped=` |
337
+ | `spec.c4`, `views.c4`, `c4-model.md` | seeded **only when absent**, via `O_CREAT\|O_EXCL` — an existing one is never touched | `seeded=` |
338
+ | `model.likec4.json` | rendered **off-tree** and published only when the verdict is not `failed` | `published=` |
339
+
340
+ `model.likec4.json` carries no header — it is JSON, and it is a regenerable
341
+ lockfile, so replacing it after a *successful* render is correct. What must never
342
+ happen is replacing it after a *failed* one, which is what the off-tree render
343
+ prevents. Any target that is a **symlink** is refused outright, for every artifact.
344
+
345
+ A hand-corrected edge is never silently reverted, and each refusal is reported —
346
+ `skipped=` for a protected file, `seeded=` for one that already existed, so the
347
+ normal steady state is distinguishable from a refusal.
348
+
349
+ **Report the marker, and read its `status`:**
350
+
351
+ - `status=ok` — elements and relationships both non-zero.
352
+ - `status=degraded` — **not a failure.** Either the component docs declare no
353
+ parseable dependencies (the diagram is a set of disconnected boxes — the docs
354
+ are the defect, not the run), or a hand-edited file was skipped, or the pinned
355
+ likec4 CLI was unreachable. Surface the reason; do not fail the sync.
356
+ - `status=failed` (exit 1) — likec4 reported a source fault (`source-fault`),
357
+ produced an empty model (`empty-model`), or produced an elements-but-no-views
358
+ model (`zero-views` — a layout failure, not a source fault). For
359
+ `source-fault`/`empty-model`, surface the diagnostic and fix the `.c4`
360
+ source. For `zero-views`, do NOT edit the `.c4` source — retry the render,
361
+ then report; the committed artifact is left untouched either way.
362
+
363
+ **Delivery precondition — state this, do not assume otherwise.** The KB viewer
364
+ reads the diagram from the **GitHub source of truth**, not the on-disk clone
365
+ (a clone holding un-pushed commits goes permanently stale). Headless sync commits
366
+ locally and opens a PR, so a generated diagram is not visible in the viewer until
367
+ that PR is **pushed and merged**.
368
+
369
+ #### Coverage Summary
370
+
371
+ Runs at the END of an `all` sync, after every other area. Writes
372
+ `knowledge-base/project/kb-coverage.md` and prints the same marker to stdout:
373
+
374
+ ```bash
375
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/write-kb-coverage.ts" ]; then
376
+ bun "${CLAUDE_PLUGIN_ROOT}/scripts/write-kb-coverage.ts"
377
+ else
378
+ echo "SOLEUR_SYNC_PRODUCER_MISSING producer=scripts/write-kb-coverage.ts affects=coverage reason=absent-from-verified-root"
379
+ fi
380
+ ```
381
+
382
+ Add one `--degraded "<reason>"` for each producer that reported `status=degraded`
383
+ earlier in the run (the `reason=` token from its marker is the right string).
384
+
385
+ For a `SOLEUR_SYNC_PRODUCER_MISSING` marker, pass the **subject as well as the
386
+ reason** — write `--degraded "<area>: producer-missing (<producer>)"`, matching the
387
+ area-prefixed house form shown in the `--degraded` example further down. `write-kb-coverage.ts` renders this string
388
+ verbatim, so passing the bare `reason=` token alone would put
389
+ `absent-from-verified-root` in the durable row with no producer and no area — the
390
+ same unattributed signal this guard exists to replace, one layer down.
391
+
392
+ Two limits, stated once: this carry-forward is unavailable when
393
+ `write-kb-coverage.ts` is itself the missing producer, and for standalone area
394
+ invocations (which write no coverage at all). In both cases a PRIOR
395
+ `kb-coverage.md` still sits on disk and still satisfies the existing
396
+ `SOLEUR_KB_SYNC_PRODUCERS` grep — so that grep certifies the *previous* run, not
397
+ this one.
398
+
399
+ ```bash
400
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/write-kb-coverage.ts" ]; then
401
+ bun "${CLAUDE_PLUGIN_ROOT}/scripts/write-kb-coverage.ts" \
402
+ --degraded "c4: no-generated-relationships"
403
+ else
404
+ echo "SOLEUR_SYNC_PRODUCER_MISSING producer=scripts/write-kb-coverage.ts affects=coverage reason=absent-from-verified-root"
405
+ fi
406
+ ```
407
+
408
+ **Do not hand-author `kb-coverage.md`, and do not pass the counts in.** Every count
409
+ is derived from the tree by the script itself — the rendered `model.likec4.json`, the
410
+ domain-model register, and the expected-path probe. That is deliberate: an earlier
411
+ design took `--c4-elements`/`--c4-relationships`/`--domain-model-rows` flags, and an
412
+ absent flag silently became `0`, which is byte-identical to the very failure state
413
+ this artifact exists to detect. There is now no flag to forget.
414
+
415
+ Standalone area invocations (`soleur:sync c4`, `soleur:sync domain-model`) do NOT
416
+ write this file — its counts describe the whole knowledge base, and a partial run
417
+ would record zeros for the areas that did not execute.
418
+
419
+ **Wording is a hard constraint, not a style preference.** The report states what
420
+ Soleur *expects* versus what is *present*. It never asserts what the business
421
+ lacks. Write "no `privacy-policy.md` present in this knowledge base" — never
422
+ "missing: privacy policy". This file lands in the customer's own repository,
423
+ committed and permanently git-blamed; a deficiency framing is a durable,
424
+ discoverable assertion that their business lacks a compliance artifact, written
425
+ by us, about them, into a record they cannot erase.
426
+
427
+ **Determinism is required.** No embedded timestamp, stable ordering — an
428
+ unchanged KB must produce a byte-identical file, or every sync emits a one-field
429
+ diff forever. `knowledge-base/INDEX.md` is the in-repo warning for this exact
430
+ shape.
431
+
432
+ **Emit the `SOLEUR_KB_SYNC_PRODUCERS` marker twice** — on stdout AND as a line
433
+ inside `kb-coverage.md` — carrying `{c4_elements, c4_relationships,
434
+ domain_model_rows, coverage_present, coverage_expected}`. This is observability
435
+ **layer 7 (`cli-stdout-artifact`)**: on a self-hosted CLI there is no Soleur-side
436
+ sink and there must not be one (ADR-171 §Observability boundary), so stdout alone
437
+ would evaporate with the session and the durable artifact IS the queryable
438
+ surface. Verify with:
439
+
440
+ ```bash
441
+ grep -n 'SOLEUR_KB_SYNC_PRODUCERS' knowledge-base/project/kb-coverage.md
442
+ ```
443
+
444
+ The marker carries **counts only** — no path, filename, or repo URL. On a
445
+ producer failure emit `SOLEUR_KB_SYNC_ERROR` on stdout and record a degraded row
446
+ in the artifact, so the failure survives the session. This is NOT
447
+ `reportSilentFallback`: that lives in `apps/web-platform/server/observability.ts`,
448
+ and nothing under `plugins/` imports Sentry.
449
+
450
+ #### Rule Prune Analysis
451
+
452
+ Runs only when `<sync_area>` is literally `rule-prune`. Surfaces AGENTS.md rules that have zero recorded hits over the threshold window as GitHub issues milestoned to "Post-MVP / Later". Does NOT edit `AGENTS.md` — a CTO agent ruling per `hr-technical-fork-is-not-an-operator-question` decides each issue, recorded "Ruled by CTO agent"; the default verdict is keep, and the prune itself is a normal PR through `soleur:review`. A rule whose purpose is user data, production authorization, GDPR or money is never pruned on a zero-hit shortlist (legal parts go to the CLO). The shortlist is an investigation aid, not retirement evidence: the log records enforcement events only, so an obeyed rule never appears and zero hits nominates the best-obeyed rules first (#8030). Filing an issue does not authorize removal: removal happens only after the CTO ruling, as a normal PR through `soleur:review`. Headroom comes from migration per `cq-agents-md-tier-gate`.
453
+
454
+ 1. **Parse `--weeks=<n>`** from `<sync_area>` additional tokens (e.g., `rule-prune --weeks=4`). Default: 8. Also supports `--dry-run` (forwarded to `rule-prune.sh`).
455
+ 2. **Ensure `knowledge-base/project/rule-metrics.json` exists.** If missing, run the aggregator first. Both producers in this area are repo-root scripts outside the plugin payload, so the invocation is gated on a monorepo sentinel that fails closed — run this block verbatim rather than the bare command, so the halt executes whether or not this paragraph was read:
456
+
457
+ ```bash
458
+ # Fail closed (#7442). scripts/ here is the CUSTOMER's scripts/ on any repo
459
+ # that is not this monorepo, so a same-named file would execute as theirs.
460
+ # The sentinel is the self-hosted plugin checkout -- the same condition
461
+ # Phase 4.1 already gates on, and one a marketplace install never satisfies.
462
+ #
463
+ # SOLEUR_MONOREPO is what makes the invocation line safe ON ITS OWN. If the
464
+ # line is ever separated from this gate -- a reader that takes the last line
465
+ # of the block, a tool that extracts invocations line-wise -- the variable is
466
+ # unset and the operand becomes "/scripts/...": root-anchored, nonexistent,
467
+ # not writable by a non-root user. Fail-closed. A bare relative operand would
468
+ # instead resolve into the customer's tree and execute their file.
469
+ SOLEUR_MONOREPO="$(test -f plugins/soleur/.claude-plugin/plugin.json && pwd || true)"
470
+ if [[ -z "$SOLEUR_MONOREPO" ]]; then
471
+ echo "SOLEUR_SYNC_AREA_UNAVAILABLE area=rule-prune reason=monorepo-only-maintenance-area"
472
+ exit 2
473
+ fi
474
+ bash "${SOLEUR_MONOREPO:?monorepo sentinel not evaluated}/scripts/rule-metrics-aggregate.sh"
475
+ ```
476
+
477
+ Append `--dry-run` to preview the summary without writing. Do not create a stub file.
478
+
479
+ **Local telemetry source:** `.claude/.rule-incidents.jsonl` (gitignored, one line per deny/bypass written by the hooks under `.claude/hooks/`). The aggregator reads this file to produce `rule-metrics.json`. Monthly rotation archives it to `.claude/.rule-incidents-<YYYY-MM>.jsonl.gz` when `AGGREGATOR_ROTATE=1` is set (CI only).
480
+ 3. **Invoke** the pruner behind the same fail-closed sentinel (again, run the block, not the bare command):
481
+
482
+ ```bash
483
+ SOLEUR_MONOREPO="$(test -f plugins/soleur/.claude-plugin/plugin.json && pwd || true)"
484
+ if [[ -z "$SOLEUR_MONOREPO" ]]; then
485
+ echo "SOLEUR_SYNC_AREA_UNAVAILABLE area=rule-prune reason=monorepo-only-maintenance-area"
486
+ exit 2
487
+ fi
488
+ bash "${SOLEUR_MONOREPO:?monorepo sentinel not evaluated}/scripts/rule-prune.sh" --weeks=<n>
489
+ ```
490
+
491
+ Append `--dry-run` to preview candidates without filing. The script:
492
+ - Reads `knowledge-base/project/rule-metrics.json`.
493
+ - Filters rules with `hit_count == 0` AND `first_seen` older than the cutoff.
494
+ - Validates every rule_id against `^(hr|wg|cq|rf|pdr|cm)-[a-z0-9-]{3,60}$`; malformed ids are skipped with a stderr warning (never filed as issues).
495
+ - For each candidate, checks via `gh issue list --state open -L 200 --search "<title> in:title"` whether an open issue already exists (idempotent).
496
+ - Files a new issue via `gh issue create --milestone "Post-MVP / Later"` for each new candidate. Issue body contains a `### Verify` block with a paste-ready `jq` query against `rule-metrics.json` plus the `generated_at` timestamp, and explicitly states that filing does NOT authorize removal (the `scripts/rule-prune.sh` issue-body text is unchanged; the removal decision is the CTO ruling described above, and the removal itself is a normal PR through `soleur:review`).
497
+ 4. **Report** the candidate count and list of filed issue URLs. No constitution / learnings promotion paths apply.
498
+
499
+ Skip Phase 2 through Phase 4 when the area is `rule-prune` — the gh issue filing IS the output.
500
+
501
+ #### Domain Model Analysis
502
+
503
+ Runs when `<sync_area>` is literally `domain-model` (#5754) **and** as part of `all` dispatch — with
504
+ **two different contracts**, reconciled explicitly below so the difference does not survive as
505
+ ambiguity. Drift-checks the business-rules register at
506
+ `knowledge-base/engineering/architecture/domain-model.md` against the repo's data model
507
+ and proposes newly-inferred rows. All extraction is deterministic
508
+ (a bash analyzer); the LLM only phrases candidate statements at approval time — never in the
509
+ drift-detection or write path. **Guarantee is bounded to structural documentation coverage, NOT
510
+ semantic access-control correctness** — dynamic RLS, function-body logic, and un-merged `ALTER POLICY`
511
+ are disclosed as blind spots, never counted.
512
+
513
+ 1. **Emit the drift report** (read-only). Run:
514
+
515
+ ```bash
516
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/domain-model-drift.sh" ]; then
517
+ bash "${CLAUDE_PLUGIN_ROOT}/scripts/domain-model-drift.sh" drift --repo . --register knowledge-base/engineering/architecture/domain-model.md
518
+ else
519
+ echo "SOLEUR_SYNC_PRODUCER_MISSING producer=scripts/domain-model-drift.sh affects=domain-model reason=absent-from-verified-root"
520
+ fi
521
+ ```
522
+
523
+ Exit `0` = clean, `1` = drift found, `2` = error, `3` = secret-shape refuse. **This mapping
524
+ describes the producer's own exit codes and applies only when the producer actually ran.** If
525
+ the guard above emitted `SOLEUR_SYNC_PRODUCER_MISSING`, the fence still exits `0` because the
526
+ `echo` succeeded — that is "could not check", NOT "clean". Report it as unchecked; never fold it
527
+ into the register-agrees-with-source verdict. Present the report verbatim
528
+ to the operator — it has three sections: **stale register citations** (a cited symbol/migration no longer
529
+ resolves), **undocumented source facts** (a table with RLS/constraints the register never names), and a
530
+ **blind-spots** disclosure line. Every report carries the completeness disclaimer.
531
+
532
+ 2. **Approval-gated write (optional).** For each `undocumented` table the operator wants to record, extract a
533
+ candidate anchor + statement from the drift output and run the accept/skip/edit review (reuse the Phase 2
534
+ AskUserQuestion machinery — this is a self-contained reuse of the review UX, NOT a Phase-2 re-entry). For each
535
+ **accepted** candidate, append it via the safe primitive:
536
+
537
+ ```bash
538
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/domain-model-drift.sh" ]; then
539
+ bash "${CLAUDE_PLUGIN_ROOT}/scripts/domain-model-drift.sh" write-row \
540
+ --register knowledge-base/engineering/architecture/domain-model.md \
541
+ --anchor "<migration-file › table.object>" --statement "<candidate statement>"
542
+ else
543
+ echo "SOLEUR_SYNC_PRODUCER_MISSING producer=scripts/domain-model-drift.sh affects=domain-model reason=absent-from-verified-root"
544
+ fi
545
+ ```
546
+
547
+ The primitive writes into the `## Auto-inferred (unreviewed)` section only — it NEVER touches the curated
548
+ `## Business Rules` table, NEVER mints a `BR-*` id, escapes markdown hazards, refuses secret-shaped content
549
+ (fail-closed), dedups by content anchor (an already-known anchor is a no-op, so accepted rows are not
550
+ re-proposed on re-run), and writes atomically. Promotion of an `Auto-inferred` row to a curated `BR-*` rule
551
+ is a deliberate human edit (assign an id + keep the source anchor).
552
+
553
+ 3. **Report** the drift counts (stale / undocumented / blind-spots) and any rows written. No constitution /
554
+ learnings promotion paths apply. **If any guard above emitted `SOLEUR_SYNC_PRODUCER_MISSING`,
555
+ report ZERO rows written and say the register was not consulted** — the `write-row` fence exits 0
556
+ on the guard's `echo`, so "no error" is not evidence a row landed. Reporting rows that were never
557
+ appended is a false statement about the operator's own data, and it is the one thing here worse
558
+ than the bare error this guard replaced.
559
+
560
+ ##### Standalone contract (`soleur:sync domain-model`)
561
+
562
+ Skip Phase 2 through Phase 4 when the area is **explicitly** `domain-model` — the drift report +
563
+ approval-gated write ARE the output. This contract is unchanged.
564
+
565
+ ##### `all`-dispatch path (and any headless run)
566
+
567
+ The interactivity was never in the script — `write-row` is already a non-interactive primitive. It
568
+ lives in the per-row `AskUserQuestion` gate above, which the Headless Execution Contract auto-skips,
569
+ so under `all` (or headless) that gate would write **zero rows**. Take this path instead, then
570
+ **continue into the remaining phases** rather than terminating:
571
+
572
+ 1. **Bootstrap the register if absent** — a fresh repo has none, and `drift` / `write-row` both die
573
+ on a path they cannot resolve:
574
+
575
+ ```bash
576
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/domain-model-drift.sh" ]; then
577
+ bash "${CLAUDE_PLUGIN_ROOT}/scripts/domain-model-drift.sh" init --repo . \
578
+ --register knowledge-base/engineering/architecture/domain-model.md
579
+ else
580
+ echo "SOLEUR_SYNC_PRODUCER_MISSING producer=scripts/domain-model-drift.sh affects=domain-model reason=absent-from-verified-root"
581
+ fi
582
+ ```
583
+
584
+ Idempotent: an existing register is a no-op exit 0, so this is safe to run unconditionally.
585
+ **But exit 0 here has two meanings.** If the guard above emitted
586
+ `SOLEUR_SYNC_PRODUCER_MISSING`, the fence also exits 0 — because the `echo` succeeded, not
587
+ because the register exists. Do not read that as "already initialized": no register was
588
+ created, and the steps below would then append to a file that is not there. Treat a fired
589
+ guard as **unchecked** and skip the rest of this area.
590
+
591
+ 2. **Emit the drift report** exactly as in step 1 above.
592
+
593
+ 3. **Append every candidate directly**, via the same `write-row` primitive — no approval gate.
594
+
595
+ 4. **Feed the row count into the coverage summary** (`domain_model_rows`) rather than reporting it as
596
+ a terminal output.
597
+
598
+ **Why auto-appending is safe here, and only here.** `## Auto-inferred (unreviewed)` **is** the
599
+ staging area for unreviewed content. Appending there is not auto-approving a business rule —
600
+ promotion to a curated `BR-*` id remains a deliberate human edit. That distinction is the whole
601
+ reason the section exists, and it is precisely why this can be automated when a per-row approval gate
602
+ cannot.
603
+
604
+ Because no human now reads each row before it lands, every safety property `write-row` already had
605
+ becomes load-bearing rather than advisory, and each is pinned by a red-when-broken test in
606
+ [`domain-model-headless-append.test.sh`](../test/domain-model-headless-append.test.sh): fail-closed
607
+ secret-shape refusal, content-anchor dedup (re-runs are no-ops), atomic temp-then-rename write,
608
+ appends under `## Auto-inferred (unreviewed)` only, never minting a `BR-*` id, and never touching the
609
+ curated table.
610
+
611
+ **1.3 Assign Confidence Scores**
612
+
613
+ For each finding, assign confidence:
614
+
615
+ - **high**: Clear, explicit pattern (linting rule, documented convention)
616
+ - **medium**: Consistent but implicit pattern (80%+ of files follow it)
617
+ - **low**: Possible pattern (some evidence but not conclusive)
618
+
619
+ **1.4 Limit Findings**
620
+
621
+ Present only the top 20 findings by confidence. If more exist, inform user: "Found N findings. Showing top 20 by confidence. Run `soleur:sync` again to discover more."
622
+
623
+ ### Phase 2: Review
624
+
625
+ **2.1 Load Existing Entries**
626
+
627
+ Before reviewing findings, load existing knowledge-base content for deduplication:
628
+
629
+ - **Constitution rules:** Parse `knowledge-base/project/constitution.md` and extract all bullet points under Always/Never/Prefer sections
630
+ - **Learnings:** List files in `knowledge-base/project/learnings/` and extract titles from YAML frontmatter or first heading
631
+
632
+ Store as a list of existing entry texts for comparison.
633
+
634
+ **2.2 Check for Duplicates (Exact and Fuzzy)**
635
+
636
+ For each finding, check for duplicates:
637
+
638
+ **Exact match check:**
639
+
640
+ - For constitution.md: Check if exact rule text exists in target section
641
+ - For learnings/: Check if file with same title exists
642
+ - If exact duplicate found, skip silently. Track count for summary.
643
+
644
+ **Fuzzy match check (Jaccard similarity):**
645
+
646
+ Compute word-based Jaccard similarity between the finding and all existing entries:
647
+
648
+ ```text
649
+ Jaccard(a, b) = |intersection(words_a, words_b)| / |union(words_a, words_b)|
650
+
651
+ Where:
652
+ - words_a = lowercase words from text a (split by whitespace)
653
+ - words_b = lowercase words from text b (split by whitespace)
654
+ ```
655
+
656
+ Find the existing entry with highest similarity score.
657
+
658
+ **If max similarity > 0.8:**
659
+
660
+ Use **AskUserQuestion** to prompt user:
661
+
662
+ ```text
663
+ ## Similar Entry Found
664
+
665
+ **New finding:**
666
+ [finding text]
667
+
668
+ **Similar to existing:**
669
+ [existing entry text]
670
+
671
+ **Similarity:** [score as percentage]%
672
+ ```
673
+
674
+ **Options:**
675
+
676
+ 1. **Skip** - Don't add this finding (likely a duplicate)
677
+ 2. **Keep** - Proceed to review this finding anyway
678
+
679
+ If user selects **Skip**, continue to next finding. If user selects **Keep**, proceed to normal Accept/Skip/Edit review.
680
+
681
+ **2.3 Sequential Review** (for findings that pass deduplication checks)
682
+
683
+ Present remaining findings one at a time using the **AskUserQuestion tool**:
684
+
685
+ **Format:**
686
+
687
+ ```text
688
+ ## Sync Review (1/N)
689
+
690
+ **Finding:** [type] [description]
691
+ **Target:** [constitution.md > Section > Subsection] or [learnings/category/filename.md]
692
+ **Confidence:** [high/medium/low]
693
+ ```
694
+
695
+ **Options:**
696
+
697
+ 1. **Accept** - Add this to knowledge-base
698
+ 2. **Skip** - Don't add this finding
699
+ 3. **Edit** - Modify the finding before accepting
700
+
701
+ **If user selects Edit:**
702
+
703
+ Use AskUserQuestion with a text input option to let user modify the finding text. Then present the modified version for final approval.
704
+
705
+ **Continue until all findings reviewed or user selects "Done reviewing".**
706
+
707
+ ### Phase 3: Write
708
+
709
+ **3.1 Write Constitution Entries**
710
+
711
+ For accepted constitution findings:
712
+
713
+ 1. Read current `knowledge-base/project/constitution.md`
714
+ 2. Find the target section (Code Style, Architecture, Testing, etc.)
715
+ 3. Find the subsection (Always, Never, Prefer)
716
+ 4. Append the new rule as a bullet point: `- [Rule text]`
717
+ 5. Write updated file
718
+
719
+ **Format:**
720
+
721
+ ```markdown
722
+ ## Code Style
723
+
724
+ ### Prefer
725
+
726
+ - Prefer early returns over nested conditionals
727
+ - [NEW] Prefer snake_case for local variables
728
+ ```
729
+
730
+ **3.2 Write Learnings Entries**
731
+
732
+ For accepted learnings findings:
733
+
734
+ 1. Create new file in appropriate category: `learnings/[category]/[kebab-case-title].md`
735
+ 2. Use compound-capture YAML schema with `problem_type: best_practice`
736
+
737
+ **Template:**
738
+
739
+ ```yaml
740
+ ---
741
+ module: [Extracted module name or "General"]
742
+ date: [TODAY]
743
+ problem_type: best_practice
744
+ component: [Mapped component type]
745
+ tags: [relevant, tags]
746
+ severity: [info|low|medium|high]
747
+ ---
748
+
749
+ # [Finding Title]
750
+
751
+ ## Context
752
+
753
+ [Why this pattern exists or was chosen]
754
+
755
+ ## Pattern
756
+
757
+ [Description of the pattern or convention]
758
+
759
+ ## Examples
760
+
761
+ [Code examples if applicable]
762
+ ```
763
+
764
+ **3.3 Generate Summary**
765
+
766
+ After writing, display summary:
767
+
768
+ ```text
769
+ ## Sync Complete
770
+
771
+ **Created:** N new entries
772
+ **Skipped:** M exact duplicates (already in knowledge-base)
773
+ **Fuzzy duplicates:** F similar entries (user chose to skip)
774
+ **User skipped:** P findings (during review)
775
+
776
+ ### New Constitution Rules
777
+ - [Rule 1] (Code Style > Prefer)
778
+ - [Rule 2] (Testing > Always)
779
+
780
+ ### New Learnings
781
+ - learnings/architecture/service-layer-pattern.md
782
+ - learnings/technical-debt/legacy-api-endpoints.md
783
+
784
+ Run `soleur:sync` again to discover additional patterns.
785
+ ```
786
+
787
+ ### Phase 4: Definition Sync
788
+
789
+ Scan accumulated learnings against skill, agent, and command definitions. Propose one-line bullet edits to route institutional knowledge to the definitions that need it. This complements the per-session routing in compound-capture Step 8 by catching cross-cutting learnings, retroactive learnings, and learnings from sessions where the relevant definition was not directly invoked.
790
+
791
+ **4.1 Gate**
792
+
793
+ Skip Phase 4 with an info message if any of these conditions are true:
794
+
795
+ - Area is a specific scope (`conventions`, `architecture`, `testing`, `debt`, `project`, `rule-prune`, `domain-model`) -- Phase 4 only runs when area is `all` or unspecified
796
+ - `knowledge-base/project/learnings/` directory does not exist
797
+ - `plugins/soleur/` directory does not exist
798
+
799
+ **4.2 Load**
800
+
801
+ List all learning files from `knowledge-base/project/learnings/` recursively, excluding `archive/` and `patterns/` directories. For each learning, extract:
802
+
803
+ - Title (from first `#` heading)
804
+ - Tags or metadata (from YAML frontmatter, ad-hoc tags sections, or title keywords -- any format)
805
+ - `synced_to` array from YAML frontmatter (treat as empty if absent)
806
+
807
+ List all definitions by name:
808
+
809
+ - Skills: `plugins/soleur/skills/*/SKILL.md` (flat, one level)
810
+ - Agents: `plugins/soleur/agents/**/*.md` (recursive)
811
+ - Commands: `plugins/soleur/commands/*.md` (flat)
812
+
813
+ **4.3 Match**
814
+
815
+ For each learning, determine which definitions it is relevant to. Skip pairs where the definition name is already in the learning's `synced_to` array.
816
+
817
+ For each relevant pair, read the full learning content and the full definition content. Draft a one-line bullet capturing the sharp-edge gotcha -- non-obvious insight only, skip if the point is general knowledge. Check the definition does not already contain a bullet covering this topic -- if it does, discard silently.
818
+
819
+ **4.4 Review**
820
+
821
+ Present proposals one at a time using **AskUserQuestion** with options:
822
+
823
+ ```text
824
+ ## Definition Sync (1/N)
825
+
826
+ **Learning:** [learning-title]
827
+ **Definition:** [definition-name] ([skill|agent|command])
828
+ **Section:** [target-section-name]
829
+ **Proposed bullet:** "- [one-line bullet text]"
830
+ ```
831
+
832
+ **Options:**
833
+
834
+ 1. **Accept** - Write the bullet to the definition file and add the definition name to the learning's `synced_to` frontmatter. If the learning has no YAML frontmatter block, prepend a minimal `---` block with only `synced_to: [definition-name]`.
835
+ 2. **Skip** - Move to next proposal. No tracking written (proposal may reappear on next run).
836
+ 3. **Edit** - Modify the bullet text, then re-display for final Accept/Skip.
837
+ 4. **Done reviewing** - Stop Phase 4. Unreviewed proposals reappear on next `soleur:sync` run.
838
+
839
+ **4.5 Summary**
840
+
841
+ ```text
842
+ ## Definition Sync Complete
843
+
844
+ - Learnings scanned: N
845
+ - Proposals generated: P
846
+ - Accepted: A
847
+ - Skipped: S
848
+ - Not reviewed: U (will reappear next run)
849
+
850
+ ### Definitions Updated
851
+ - [definition-name]: +N bullets
852
+ ```
853
+
854
+ If zero proposals were generated: "Phase 4: All learnings already synced to relevant definitions (N learnings, M definitions scanned)."
855
+
856
+ ## Headless Execution Contract (`--headless`)
857
+
858
+ When invoked with the `--headless` flag (e.g. the post-clone auto-sync at
859
+ `/api/repo/setup` runs `soleur:sync --headless`), there is no operator at a
860
+ terminal and the checked-out branch is the freshly-cloned **protected default**
861
+ (`git clone --depth 1` leaves you on the repo's default branch). The sync agent
862
+ MUST obey the following in headless mode:
863
+
864
+ 1. **Commit knowledge-base scaffolding LOCALLY only.** Stage and commit the
865
+ generated `knowledge-base/` files in the workspace. Do this with a local
866
+ `git commit` — never assume the commit will be pushed.
867
+
868
+ 2. **NEVER raw `git push` the checked-out default branch.** A raw
869
+ `git push` to the protected default branch is rejected by branch protection
870
+ / push protection and returns `GH013: Repository rule violations`
871
+ (`! [remote rejected]`). If the changes should reach the remote, use the
872
+ **worktree→PR workflow** (create a feature branch / worktree, push *that*
873
+ branch, and open a PR) — matching the project's `pushBranch` MCP tool
874
+ contract, which already refuses to write a protected branch. Do **not** push
875
+ to the default branch under any circumstance.
876
+
877
+ 3. **Handle `GH013` / `! [remote rejected]` / push-rule rejection as a
878
+ DEGRADED status, not a hard error.** If a push (even of a feature branch /
879
+ PR open) is rejected by branch protection or a push rule, surface a clear,
880
+ actionable degraded status — e.g. "knowledge-base committed locally; could
881
+ not open a PR — branch protection rejected the push" — and finish
882
+ successfully. The local commit is the durable result; the missing PR is a
883
+ degradation the operator can resolve, not a failure of the sync.
884
+
885
+ 4. **Auto-skip the interactive `AskUserQuestion` gates.** The Phase 2 fuzzy-dup
886
+ review (§2.2/§2.3) and the Phase 4 Definition Sync review (§4.4) prompt the
887
+ operator via `AskUserQuestion`. In headless mode there is no one to answer,
888
+ so **do not pause** on these gates — auto-skip them (treat fuzzy-dup matches
889
+ as Skip, and skip Phase 4 Definition Sync entirely) and log the skip rather
890
+ than blocking on a prompt that can never be answered.
891
+
892
+ ## Output Locations
893
+
894
+ | Finding Type | Destination |
895
+ | ------------ | ----------- |
896
+ | Coding conventions | `knowledge-base/project/constitution.md` |
897
+ | Architecture decisions | `knowledge-base/project/learnings/architecture/` |
898
+ | Testing practices | `knowledge-base/project/constitution.md` (Testing section) |
899
+ | Technical debt | `knowledge-base/project/learnings/technical-debt/` |
900
+ | Project docs | `knowledge-base/project/README.md` |
901
+ | Component docs | `knowledge-base/project/components/` |
902
+ | Definition sync bullets | `plugins/soleur/{skills,agents,commands}/*.md` |
903
+
904
+ ## Design Decisions
905
+
906
+ ### Single Command, No Separate Agents
907
+
908
+ Analysis happens inline in this command rather than spawning separate agents. This keeps the implementation simple and debuggable.
909
+
910
+ ### Sequential Review
911
+
912
+ Each finding is reviewed one at a time with y/n/edit options. This is familiar UX with no custom query syntax to learn.
913
+
914
+ ### Two-Stage Deduplication
915
+
916
+ **Stage 1 (Exact match):** If an identical entry exists, skip silently.
917
+
918
+ **Stage 2 (Fuzzy match):** If a similar entry exists (Jaccard similarity > 0.8), prompt user to skip or keep. Word-based Jaccard coefficient catches textual variations like "use const" vs "always use const" without external dependencies.
919
+
920
+ ### Existing Learnings Schema
921
+
922
+ Uses the `compound-capture` YAML schema with `problem_type: best_practice` for non-problem learnings. This ensures compatibility with existing learnings tooling.
923
+
924
+ ## Examples
925
+
926
+ **Bootstrap entire knowledge-base:**
927
+
928
+ ```bash
929
+ soleur:sync all
930
+ # or just
931
+ soleur:sync
932
+ ```
933
+
934
+ **Sync only coding conventions:**
935
+
936
+ ```bash
937
+ soleur:sync conventions
938
+ ```
939
+
940
+ **Sync only technical debt:**
941
+
942
+ ```bash
943
+ soleur:sync debt
944
+ ```
945
+
946
+ **Sync project docs:**
947
+
948
+ ```bash
949
+ soleur:sync project
950
+ ```
951
+
952
+ ## Cursor name map
953
+
954
+ When a canonical skill or agent file in this repository changes, regenerate the Cursor stubs by running bun "${CLAUDE_PLUGIN_ROOT}/scripts/sync-cursor-name-map.ts".
955
+
956
+ Running bun "${CLAUDE_PLUGIN_ROOT}/scripts/sync-cursor-name-map.ts" --check prints cursor-name-map ok when the committed stubs match that walk. This command does not run as part of `all`.
957
+
958
+ ## OpenCode adapter tree
959
+
960
+ The `opencode/` front door — routing instructions, the agent and command stubs, and the `opencode.json` config fragment — is generated from the canonical tree. When a canonical agent, command, or the routing prose changes, regenerate it by running bun "${CLAUDE_PLUGIN_ROOT}/scripts/sync-opencode-adapter.ts".
961
+
962
+ Running bun "${CLAUDE_PLUGIN_ROOT}/scripts/sync-opencode-adapter.ts" --check exits non-zero when the committed tree drifts from the canonical one. Like the Cursor walk above, this does not run as part of `all`.
963
+
964
+ Generated files carry `__SOLEUR_PLUGIN_ROOT__` rather than an absolute path, so the committed tree is machine-independent. Resolve that token once per machine with bun "${CLAUDE_PLUGIN_ROOT}/scripts/install-opencode-adapter.ts": it unions the fragment's `skills`/`instructions` entries into `~/.config/opencode/opencode.json` and preserves an operator's other keys **when it can read that file**. A config it cannot parse (JSONC comments, a syntax error, a torn write) is **refused** — replacing it would discard every key the operator set — and `--force` replaces it only after writing a timestamped `.bak-<ts>` beside it. The installer copies the stubs and the hook module, removes stubs this generator no longer emits (attributed by their own text, so an operator's own command or agent in the same roots is untouched), and `--target DIR` installs into a project `.opencode` instead. `--check` reports `MISSING` / `STALE` / `EXTRA` without writing. Skills are deliberately not copied: they register from the canonical tree through the config's `skills` key, so a second skill tree is never created to drift.
965
+
966
+ **Removing the adapter** (no `--uninstall` today; tracked in #10591 item 4): the single authority is the **Uninstall / removal** section of [`plugins/soleur/opencode/INSTRUCTIONS.md`](../opencode/INSTRUCTIONS.md) — follow it rather than a second copy here, so the two cannot drift. In short: remove the generated `agents/`/`commands/` stubs whose body names the canonical path, `<configdir>/plugins/soleur-plugin.ts`, `<configdir>/soleur/`, and the `skills`/`instructions` entries the installer added to `<configdir>/opencode.json`. Leaving any of them behind leaves Soleur partly live — the section names the exact failure each one causes, including why a leftover plugin keeps enforcing guards rather than failing closed.
967
+
968
+ ## Limitations
969
+
970
+ - No PR analysis (requires GitHub token - deferred)
971
+ - No semantic similarity (word-based Jaccard only - embeddings deferred)
972
+ - No sampling for large codebases (analyze what fits)
973
+ - No parallel agent execution (single-pass analysis)
974
+ - No constitution cross-check (deferred - separate concern)
975
+ - Definition sync skips when area is scoped (only runs on `all` or default)
976
+
977
+ Run `soleur:sync` multiple times to discover more patterns as the codebase evolves.