sinapse-ai 1.8.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/.claude/hooks/mind-clone-governance.py +212 -212
  2. package/.claude/hooks/read-protection.py +152 -152
  3. package/.claude/hooks/slug-validation.py +175 -175
  4. package/.claude/hooks/sql-governance.py +183 -183
  5. package/.claude/rules/documentation-first.md +1 -1
  6. package/.claude/rules/hook-governance.md +1 -1
  7. package/.claude/rules/mandatory-delegation.md +1 -1
  8. package/.claude/rules/project-intelligence.md +1 -1
  9. package/.codex/agents/analyst.md +4 -371
  10. package/.codex/agents/animations-orqx.md +4 -57
  11. package/.codex/agents/architect.md +4 -560
  12. package/.codex/agents/brand-orqx.md +4 -95
  13. package/.codex/agents/claude-mastery-chief.md +4 -0
  14. package/.codex/agents/cloning-orqx.md +4 -70
  15. package/.codex/agents/commercial-orqx.md +4 -67
  16. package/.codex/agents/config-engineer.md +2 -2
  17. package/.codex/agents/content-orqx.md +4 -77
  18. package/.codex/agents/copy-orqx.md +4 -65
  19. package/.codex/agents/cost-optimizer.md +4 -0
  20. package/.codex/agents/council-orqx.md +4 -68
  21. package/.codex/agents/courses-orqx.md +4 -64
  22. package/.codex/agents/cro-persuasion.md +4 -0
  23. package/.codex/agents/cyber-orqx.md +4 -67
  24. package/.codex/agents/data-engineer.md +4 -542
  25. package/.codex/agents/design-orqx.md +4 -65
  26. package/.codex/agents/design-system.md +4 -210
  27. package/.codex/agents/developer.md +4 -666
  28. package/.codex/agents/devops.md +4 -668
  29. package/.codex/agents/finance-orqx.md +4 -57
  30. package/.codex/agents/fiscal-compliance-br.md +4 -0
  31. package/.codex/agents/forecast-strategist.md +4 -0
  32. package/.codex/agents/growth-orqx.md +4 -75
  33. package/.codex/agents/hooks-architect.md +2 -2
  34. package/.codex/agents/mcp-integrator.md +2 -2
  35. package/.codex/agents/paidmedia-orqx.md +4 -67
  36. package/.codex/agents/platform-aesthetic-director.md +4 -0
  37. package/.codex/agents/premium-packaging-strategist.md +4 -0
  38. package/.codex/agents/product-lead.md +4 -371
  39. package/.codex/agents/product-orqx.md +4 -57
  40. package/.codex/agents/product-surface-director.md +4 -0
  41. package/.codex/agents/project-integrator.md +2 -2
  42. package/.codex/agents/project-lead.md +4 -414
  43. package/.codex/agents/quality-gate.md +4 -547
  44. package/.codex/agents/research-orqx.md +4 -67
  45. package/.codex/agents/roadmap-sentinel.md +2 -2
  46. package/.codex/agents/skill-craftsman.md +2 -2
  47. package/.codex/agents/snps-orqx.md +4 -684
  48. package/.codex/agents/sop-extractor.md +4 -61
  49. package/.codex/agents/sprint-lead.md +4 -324
  50. package/.codex/agents/squad-creator.md +4 -402
  51. package/.codex/agents/storytelling-orqx.md +4 -65
  52. package/.codex/agents/swarm-orqx.md +4 -64
  53. package/.codex/agents/ux-design-expert.md +4 -532
  54. package/.codex/agents/ux-designer.md +4 -124
  55. package/.codex/command-registry.json +9 -9
  56. package/.codex/delegation-matrix.json +375 -839
  57. package/.codex/delegation-parity.json +658 -0
  58. package/.codex/handoff-packet.parity.schema.json +148 -0
  59. package/.codex/handoff-packet.template.json +26 -0
  60. package/.codex/instructions.md +8 -8
  61. package/.codex/scripts/resolve-codex-agent.js +482 -0
  62. package/.codex/scripts/resolve-codex-command.js +75 -12
  63. package/.codex/scripts/resolve-codex-delegation.js +131 -92
  64. package/.codex/skills/sinapse-claude/SKILL.md +3 -3
  65. package/.codex/skills/sinapse-po/SKILL.md +1 -1
  66. package/.codex/tasks/resolve-sinapse-conflict.md +1 -1
  67. package/.sinapse-ai/constitution.md +5 -5
  68. package/.sinapse-ai/core/doctor/checks/git-hooks.js +163 -19
  69. package/.sinapse-ai/core/events/dashboard-emitter.js +30 -9
  70. package/.sinapse-ai/core/execution/subagent-dispatcher.js +1 -1
  71. package/.sinapse-ai/core/synapse/engine.js +15 -0
  72. package/.sinapse-ai/core/ui/observability-panel.js +240 -0
  73. package/.sinapse-ai/core-config.yaml +0 -20
  74. package/.sinapse-ai/data/entity-registry.yaml +185 -236
  75. package/.sinapse-ai/development/agents/snps-orqx.md +16 -26
  76. package/.sinapse-ai/development/tasks/build-autonomous.md +11 -1
  77. package/.sinapse-ai/development/tasks/build-resume.md +8 -0
  78. package/.sinapse-ai/development/tasks/build-status.md +8 -0
  79. package/.sinapse-ai/development/tasks/build.md +8 -0
  80. package/.sinapse-ai/development/tasks/cleanup-worktrees.md +8 -1
  81. package/.sinapse-ai/development/tasks/gotcha.md +8 -0
  82. package/.sinapse-ai/development/tasks/gotchas.md +8 -0
  83. package/.sinapse-ai/development/tasks/ids-health.md +14 -6
  84. package/.sinapse-ai/development/tasks/list-mcps.md +15 -0
  85. package/.sinapse-ai/development/tasks/merge-worktree.md +8 -1
  86. package/.sinapse-ai/development/tasks/qa-review-build.md +18 -0
  87. package/.sinapse-ai/development/tasks/remove-mcp.md +8 -1
  88. package/.sinapse-ai/development/tasks/validate-agents.md +26 -14
  89. package/.sinapse-ai/development/templates/service-template/README.md.hbs +159 -159
  90. package/.sinapse-ai/development/templates/service-template/__tests__/index.test.ts.hbs +238 -238
  91. package/.sinapse-ai/development/templates/service-template/client.ts.hbs +404 -404
  92. package/.sinapse-ai/development/templates/service-template/errors.ts.hbs +183 -183
  93. package/.sinapse-ai/development/templates/service-template/index.ts.hbs +121 -121
  94. package/.sinapse-ai/development/templates/service-template/package.json.hbs +88 -88
  95. package/.sinapse-ai/development/templates/service-template/types.ts.hbs +146 -146
  96. package/.sinapse-ai/development/templates/squad-template/LICENSE +22 -22
  97. package/.sinapse-ai/git-hooks/lib/framework-guard.js +258 -0
  98. package/.sinapse-ai/git-hooks/lib/secret-scanner-core.js +355 -0
  99. package/.sinapse-ai/git-hooks/lib/staged-secret-scan.js +179 -0
  100. package/.sinapse-ai/git-hooks/lib/staged-sql-guard.js +204 -0
  101. package/.sinapse-ai/git-hooks/post-commit +28 -0
  102. package/.sinapse-ai/git-hooks/pre-commit +81 -0
  103. package/.sinapse-ai/git-hooks/pre-push +83 -0
  104. package/.sinapse-ai/hooks/ids-post-commit.js +13 -11
  105. package/.sinapse-ai/hooks/ids-pre-push.js +9 -7
  106. package/.sinapse-ai/infrastructure/scripts/codex-parity/resolve.js +161 -0
  107. package/.sinapse-ai/infrastructure/scripts/dashboard-status-writer.js +6 -2
  108. package/.sinapse-ai/infrastructure/scripts/ide-sync/index.js +65 -68
  109. package/.sinapse-ai/infrastructure/scripts/sync-codex-local-first.js +156 -1
  110. package/.sinapse-ai/infrastructure/scripts/validate-codex-delegation.js +1 -4
  111. package/.sinapse-ai/infrastructure/scripts/validate-codex-integration.js +41 -5
  112. package/.sinapse-ai/infrastructure/templates/coderabbit.yaml.template +280 -280
  113. package/.sinapse-ai/infrastructure/templates/config/env.example +16 -16
  114. package/.sinapse-ai/infrastructure/templates/config/gitignore-additions.tmpl +59 -59
  115. package/.sinapse-ai/infrastructure/templates/github/CODEOWNERS.template +12 -12
  116. package/.sinapse-ai/infrastructure/templates/github-workflows/ci.yml.template +170 -170
  117. package/.sinapse-ai/infrastructure/templates/github-workflows/pr-automation.yml.template +331 -331
  118. package/.sinapse-ai/infrastructure/templates/github-workflows/release.yml.template +197 -197
  119. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +19 -19
  120. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-node.tmpl +86 -86
  121. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-python.tmpl +146 -146
  122. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-sinapse-base.tmpl +64 -64
  123. package/.sinapse-ai/infrastructure/templates/safe-collab/CODEOWNERS.template +16 -16
  124. package/.sinapse-ai/infrastructure/templates/sinapse-sync.yaml.template +183 -183
  125. package/.sinapse-ai/install-manifest.yaml +112 -164
  126. package/.sinapse-ai/local-config.yaml.template +65 -65
  127. package/.sinapse-ai/product/templates/adr.hbs +126 -126
  128. package/.sinapse-ai/product/templates/dbdr.hbs +242 -242
  129. package/.sinapse-ai/product/templates/epic.hbs +213 -213
  130. package/.sinapse-ai/product/templates/ide-rules/codex-rules.md +30 -0
  131. package/.sinapse-ai/product/templates/pmdr.hbs +187 -187
  132. package/.sinapse-ai/product/templates/prd-v2.0.hbs +217 -217
  133. package/.sinapse-ai/product/templates/prd.hbs +202 -202
  134. package/.sinapse-ai/product/templates/statusline/statusline-script.js +31 -8
  135. package/.sinapse-ai/product/templates/statusline/track-agent-clear.cjs +79 -0
  136. package/.sinapse-ai/product/templates/statusline/track-agent.cjs +218 -0
  137. package/.sinapse-ai/product/templates/story.hbs +264 -264
  138. package/.sinapse-ai/product/templates/task.hbs +171 -171
  139. package/.sinapse-ai/product/templates/tmpl-comment-on-examples.sql +159 -159
  140. package/.sinapse-ai/product/templates/tmpl-migration-script.sql +92 -92
  141. package/.sinapse-ai/product/templates/tmpl-rls-granular-policies.sql +105 -105
  142. package/.sinapse-ai/product/templates/tmpl-rls-kiss-policy.sql +11 -11
  143. package/.sinapse-ai/product/templates/tmpl-rls-roles.sql +136 -136
  144. package/.sinapse-ai/product/templates/tmpl-rls-simple.sql +78 -78
  145. package/.sinapse-ai/product/templates/tmpl-rls-tenant.sql +153 -153
  146. package/.sinapse-ai/product/templates/tmpl-rollback-script.sql +78 -78
  147. package/.sinapse-ai/product/templates/tmpl-seed-data.sql +141 -141
  148. package/.sinapse-ai/product/templates/tmpl-smoke-test.sql +17 -17
  149. package/.sinapse-ai/product/templates/tmpl-staging-copy-merge.sql +140 -140
  150. package/.sinapse-ai/product/templates/tmpl-stored-proc.sql +141 -141
  151. package/.sinapse-ai/product/templates/tmpl-trigger.sql +153 -153
  152. package/.sinapse-ai/product/templates/tmpl-view-materialized.sql +134 -134
  153. package/.sinapse-ai/product/templates/tmpl-view.sql +178 -178
  154. package/AGENTS.md +193 -0
  155. package/CHANGELOG.md +1247 -0
  156. package/LICENSE +63 -63
  157. package/README.en.md +17 -18
  158. package/README.md +18 -19
  159. package/bin/cli.js +1 -1
  160. package/bin/commands/install.js +194 -22
  161. package/bin/commands/status.js +14 -1
  162. package/bin/commands/uninstall.js +2 -2
  163. package/bin/commands/update.js +52 -0
  164. package/bin/lib/setup-statusline.js +191 -0
  165. package/bin/sinapse-init.js +11 -83
  166. package/bin/utils/framework-guard.js +17 -4
  167. package/bin/utils/secret-scanner-core.js +109 -7
  168. package/bin/utils/staged-sql-guard.js +204 -0
  169. package/bin/utils/validate-publish.js +63 -0
  170. package/docs/agent-reference-guide.md +5 -7
  171. package/docs/framework/agent-prefix-convention.md +58 -0
  172. package/docs/framework/architecture-overview.md +4 -4
  173. package/docs/framework/collaboration-activation.md +45 -0
  174. package/docs/framework/guiding-principles.md +9 -9
  175. package/docs/getting-started.md +1 -1
  176. package/docs/guides/agent-reference.md +1 -1
  177. package/docs/guides/codex-config.md +4 -5
  178. package/docs/pt/architecture/sub-orqx-pattern.md +20 -18
  179. package/docs/security/overview.md +1 -1
  180. package/package.json +16 -12
  181. package/packages/installer/src/index.js +26 -0
  182. package/packages/installer/src/installer/git-hooks-installer.js +211 -47
  183. package/packages/installer/src/installer/sinapse-ai-installer.js +71 -0
  184. package/packages/installer/src/wizard/feedback.js +1 -1
  185. package/packages/installer/src/wizard/ide-config-generator.js +26 -26
  186. package/packages/installer/src/wizard/index.js +53 -4
  187. package/packages/sinapse-install/bin/edmcp.js +0 -0
  188. package/packages/sinapse-install/bin/sinapse-install.js +0 -0
  189. package/scripts/audit-tasks.cjs +112 -91
  190. package/scripts/check-markdown-links.py +352 -352
  191. package/scripts/prepare-hooks.js +58 -0
  192. package/scripts/regenerate-orqx-stubs.ps1 +2 -3
  193. package/scripts/sync-counts.js +10 -2
  194. package/scripts/sync-squad-yaml-components.js +108 -6
  195. package/scripts/validate-agents-md.js +128 -0
  196. package/scripts/validate-all.js +1 -0
  197. package/scripts/validate-squad-orqx.js +19 -9
  198. package/sinapse/agents/sinapse-orqx.md +16 -26
  199. package/sinapse/agents/snps-orqx.md +15 -25
  200. package/sinapse/knowledge-base/routing-catalog.md +1 -1
  201. package/sinapse/tasks/diagnose-and-route.md +1 -1
  202. package/sinapse/tasks/squad-status-report.md +1 -1
  203. package/squads/claude-code-mastery/agents/claude-mastery-chief.md +1 -1
  204. package/squads/claude-code-mastery/agents/hooks-architect.md +60 -68
  205. package/squads/claude-code-mastery/knowledge-base/swarm-orchestration-patterns.md +1 -1
  206. package/squads/claude-code-mastery/squad.yaml +8 -0
  207. package/squads/claude-code-mastery/tasks/audit-setup.md +1 -1
  208. package/squads/claude-code-mastery/workflows/optimization-cycle.yaml +4 -4
  209. package/squads/claude-code-mastery/workflows/project-setup-cycle.yaml +4 -4
  210. package/squads/squad-animations/README.md +1 -1
  211. package/squads/squad-animations/squad.yaml +1 -1
  212. package/squads/squad-brand/squad.yaml +1 -1
  213. package/squads/squad-cloning/README.md +1 -1
  214. package/squads/squad-cloning/squad.yaml +1 -1
  215. package/squads/squad-commercial/README.md +1 -1
  216. package/squads/squad-commercial/squad.yaml +2 -3
  217. package/squads/squad-content/README.md +1 -1
  218. package/squads/squad-content/squad.yaml +1 -1
  219. package/squads/squad-copy/README.md +1 -1
  220. package/squads/squad-copy/squad.yaml +2 -3
  221. package/squads/squad-council/README.md +1 -1
  222. package/squads/squad-courses/README.md +1 -1
  223. package/squads/squad-courses/squad.yaml +1 -1
  224. package/squads/squad-cybersecurity/README.md +1 -1
  225. package/squads/squad-cybersecurity/squad.yaml +2 -3
  226. package/squads/squad-design/README.md +1 -1
  227. package/squads/{squad-artdir → squad-design}/agents/cro-persuasion.md +1 -1
  228. package/squads/{squad-artdir → squad-design}/agents/platform-aesthetic-director.md +2 -2
  229. package/squads/{squad-artdir → squad-design}/agents/premium-packaging-strategist.md +2 -2
  230. package/squads/{squad-artdir → squad-design}/agents/product-surface-director.md +3 -3
  231. package/squads/squad-design/squad.yaml +6 -3
  232. package/squads/squad-finance/README.md +1 -1
  233. package/squads/squad-finance/squad.yaml +7 -1
  234. package/squads/squad-growth/README.md +1 -1
  235. package/squads/squad-growth/squad.yaml +1 -1
  236. package/squads/squad-paidmedia/README.md +1 -1
  237. package/squads/squad-paidmedia/squad.yaml +2 -3
  238. package/squads/squad-product/README.md +1 -1
  239. package/squads/squad-product/squad.yaml +1 -1
  240. package/squads/squad-research/README.md +1 -1
  241. package/squads/squad-research/squad.yaml +2 -3
  242. package/squads/squad-storytelling/README.md +1 -1
  243. package/squads/squad-storytelling/squad.yaml +2 -3
  244. package/.codex/agents/brad-frost.md +0 -46
  245. package/.codex/agents/claude-orqx.md +0 -72
  246. package/.codex/agents/copy-chief.md +0 -162
  247. package/.codex/agents/cyber-chief.md +0 -169
  248. package/.codex/agents/dan-mall.md +0 -43
  249. package/.codex/agents/data-chief.md +0 -198
  250. package/.codex/agents/dave-malouf.md +0 -43
  251. package/.codex/agents/db-sage.md +0 -152
  252. package/.codex/agents/design-chief.md +0 -226
  253. package/.codex/agents/dev.md +0 -102
  254. package/.codex/agents/legal-chief.md +0 -199
  255. package/.codex/agents/nano-banana-generator.md +0 -42
  256. package/.codex/agents/pm.md +0 -81
  257. package/.codex/agents/po.md +0 -85
  258. package/.codex/agents/qa.md +0 -98
  259. package/.codex/agents/sm.md +0 -77
  260. package/.codex/agents/squad-chief.md +0 -1553
  261. package/.codex/agents/squad.md +0 -66
  262. package/.codex/agents/story-chief.md +0 -180
  263. package/.codex/agents/tools-orqx.md +0 -219
  264. package/.codex/agents/traffic-masters-chief.md +0 -211
  265. package/.sinapse-ai/core/memory/__tests__/active-modules.verify.js +0 -265
  266. package/.sinapse-ai/core/permissions/__tests__/permission-mode.test.js +0 -293
  267. package/.sinapse-ai/data/registry-update-log.jsonl +0 -158
  268. package/.sinapse-ai/infrastructure/scripts/ide-sync/gemini-commands.js +0 -298
  269. package/.sinapse-ai/infrastructure/scripts/ide-sync/transformers/antigravity.js +0 -121
  270. package/.sinapse-ai/infrastructure/scripts/ide-sync/transformers/cursor.js +0 -119
  271. package/.sinapse-ai/infrastructure/scripts/ide-sync/transformers/github-copilot.js +0 -191
  272. package/.sinapse-ai/infrastructure/scripts/ide-sync/transformers/kimi.js +0 -448
  273. package/.sinapse-ai/infrastructure/tests/project-status-loader.test.js +0 -569
  274. package/.sinapse-ai/infrastructure/tests/regression-suite-v2.md +0 -622
  275. package/.sinapse-ai/infrastructure/tests/validate-module.js +0 -98
  276. package/.sinapse-ai/infrastructure/tests/worktree-manager.test.js +0 -620
  277. package/.sinapse-ai/monitor/hooks/lib/__init__.py +0 -2
  278. package/.sinapse-ai/monitor/hooks/lib/enrich.py +0 -59
  279. package/.sinapse-ai/monitor/hooks/lib/send_event.py +0 -48
  280. package/.sinapse-ai/monitor/hooks/notification.py +0 -30
  281. package/.sinapse-ai/monitor/hooks/post_tool_use.py +0 -46
  282. package/.sinapse-ai/monitor/hooks/pre_compact.py +0 -30
  283. package/.sinapse-ai/monitor/hooks/pre_tool_use.py +0 -41
  284. package/.sinapse-ai/monitor/hooks/stop.py +0 -30
  285. package/.sinapse-ai/monitor/hooks/subagent_stop.py +0 -30
  286. package/.sinapse-ai/monitor/hooks/user_prompt_submit.py +0 -39
  287. package/.sinapse-ai/product/templates/statusline/track-agent.sh +0 -69
  288. package/.sinapse-ai/workflow-intelligence/__tests__/confidence-scorer.test.js +0 -335
  289. package/.sinapse-ai/workflow-intelligence/__tests__/integration.test.js +0 -340
  290. package/.sinapse-ai/workflow-intelligence/__tests__/suggestion-engine.test.js +0 -438
  291. package/.sinapse-ai/workflow-intelligence/__tests__/wave-analyzer.test.js +0 -448
  292. package/.sinapse-ai/workflow-intelligence/__tests__/workflow-registry.test.js +0 -303
  293. package/bin/sinapse-graph.js +0 -19
  294. package/docs/codex-integration-process.md +0 -22
  295. package/docs/codex-parity-program.md +0 -27
  296. package/packages/installer/src/__tests__/performance-benchmark.js +0 -383
  297. package/packages/installer/tests/integration/environment-configuration.test.js +0 -332
  298. package/packages/installer/tests/integration/wizard-detection.test.js +0 -352
  299. package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +0 -383
  300. package/packages/installer/tests/unit/claude-md-template-v5/claude-md-template-v5.test.js +0 -193
  301. package/packages/installer/tests/unit/config-validator.test.js +0 -315
  302. package/packages/installer/tests/unit/detection/detect-project-type.test.js +0 -539
  303. package/packages/installer/tests/unit/doctor/doctor-checks.test.js +0 -636
  304. package/packages/installer/tests/unit/doctor/doctor-orchestrator.test.js +0 -192
  305. package/packages/installer/tests/unit/entity-registry-bootstrap.test.js +0 -186
  306. package/packages/installer/tests/unit/env-template.test.js +0 -187
  307. package/packages/installer/tests/unit/generate-settings-json/generate-settings-json.test.js +0 -310
  308. package/packages/installer/tests/unit/git-hooks-installer.test.js +0 -262
  309. package/packages/installer/tests/unit/ide-sync-integration/ide-sync-integration.test.js +0 -231
  310. package/packages/installer/tests/unit/merger/env-merger.test.js +0 -191
  311. package/packages/installer/tests/unit/merger/markdown-merger.test.js +0 -262
  312. package/packages/installer/tests/unit/merger/strategies.test.js +0 -154
  313. package/packages/installer/tests/unit/merger/yaml-merger.test.js +0 -328
  314. package/packages/sinapse-install/tests/unit/chrome-brain.smoke.test.js +0 -66
  315. package/scripts/install-monitor-hooks.sh +0 -82
  316. package/squads/squad-artdir/README.md +0 -90
  317. package/squads/squad-artdir/agents/accessibility-guardian.md +0 -184
  318. package/squads/squad-artdir/agents/artdir-orqx.md +0 -222
  319. package/squads/squad-artdir/agents/color-psychologist.md +0 -166
  320. package/squads/squad-artdir/agents/design-system-architect.md +0 -100
  321. package/squads/squad-artdir/agents/ia-architect.md +0 -169
  322. package/squads/squad-artdir/agents/interaction-designer.md +0 -162
  323. package/squads/squad-artdir/agents/layout-engineer.md +0 -163
  324. package/squads/squad-artdir/agents/motion-architect.md +0 -185
  325. package/squads/squad-artdir/agents/type-systemist.md +0 -138
  326. package/squads/squad-artdir/agents/visual-strategist.md +0 -127
  327. package/squads/squad-artdir/checklists/seven-pillars-validation-checklist.md +0 -172
  328. package/squads/squad-artdir/knowledge-base/case-nyo-ia-reference.md +0 -289
  329. package/squads/squad-artdir/knowledge-base/deliverables-templates.md +0 -457
  330. package/squads/squad-artdir/knowledge-base/motion-technique-catalog.md +0 -247
  331. package/squads/squad-artdir/knowledge-base/premium-packaging-principles.md +0 -133
  332. package/squads/squad-artdir/knowledge-base/psychological-toolkit.md +0 -229
  333. package/squads/squad-artdir/knowledge-base/saas-art-direction-canon.md +0 -242
  334. package/squads/squad-artdir/knowledge-base/seven-pillars-framework.md +0 -289
  335. package/squads/squad-artdir/knowledge-base/ten-pillars-framework.md +0 -221
  336. package/squads/squad-artdir/package.json +0 -20
  337. package/squads/squad-artdir/squad.yaml +0 -299
  338. package/squads/squad-artdir/tasks/audit-conversion.md +0 -97
  339. package/squads/squad-artdir/tasks/audit-drift-multi-surface.md +0 -55
  340. package/squads/squad-artdir/tasks/consult-saas-canon.md +0 -54
  341. package/squads/squad-artdir/tasks/create-art-direction-brief.md +0 -110
  342. package/squads/squad-artdir/tasks/create-premium-packaging-brief.md +0 -61
  343. package/squads/squad-artdir/tasks/create-wireflow.md +0 -84
  344. package/squads/squad-artdir/tasks/design-color-system.md +0 -81
  345. package/squads/squad-artdir/tasks/design-product-surface.md +0 -60
  346. package/squads/squad-artdir/tasks/design-token-system.md +0 -58
  347. package/squads/squad-artdir/tasks/diagnose-visual-language.md +0 -92
  348. package/squads/squad-artdir/tasks/first-5-minutes-choreography.md +0 -65
  349. package/squads/squad-artdir/tasks/specify-motion-system.md +0 -84
  350. package/squads/squad-artdir/tasks/validate-against-pillars.md +0 -143
  351. package/squads/squad-artdir/templates/art-direction-brief-template.md +0 -215
  352. package/squads/squad-artdir/workflows/conversion-audit-cycle.yaml +0 -142
  353. package/squads/squad-artdir/workflows/full-art-direction-cycle.yaml +0 -179
  354. package/squads/squad-artdir/workflows/saas-platform-art-direction-cycle.yaml +0 -338
  355. package/squads/squad-commercial/agents/legal-chief.md +0 -199
  356. package/squads/squad-copy/agents/copy-chief.md +0 -162
  357. package/squads/squad-cybersecurity/agents/cyber-chief.md +0 -169
  358. package/squads/squad-design/agents/design-chief.md +0 -226
  359. package/squads/squad-paidmedia/agents/traffic-masters-chief.md +0 -211
  360. package/squads/squad-research/agents/data-chief.md +0 -198
  361. package/squads/squad-storytelling/agents/story-chief.md +0 -180
@@ -1,620 +0,0 @@
1
- /**
2
- * @jest-environment node
3
- */
4
-
5
- const fs = require('fs').promises;
6
- const path = require('path');
7
- const os = require('os');
8
- const WorktreeManager = require('../scripts/worktree-manager');
9
-
10
- describe('WorktreeManager', () => {
11
- let manager;
12
- let testRoot;
13
-
14
- beforeEach(async () => {
15
- // Use OS temp directory to ensure complete isolation from source tree
16
- testRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'sinapse-worktree-test-'));
17
-
18
- // Initialize git repo for tests
19
- try {
20
- const execa = require('execa');
21
- await execa('git', ['init'], { cwd: testRoot });
22
- await execa('git', ['config', 'user.email', 'test@test.com'], {
23
- cwd: testRoot,
24
- });
25
- await execa('git', ['config', 'user.name', 'Test User'], { cwd: testRoot });
26
-
27
- // Create initial commit (required for worktrees)
28
- const testFile = path.join(testRoot, 'README.md');
29
- await fs.writeFile(testFile, '# Test Repo');
30
- await execa('git', ['add', '.'], { cwd: testRoot });
31
- await execa('git', ['commit', '-m', 'Initial commit'], { cwd: testRoot });
32
- } catch (error) {
33
- console.warn('Git not available, some tests will be skipped:', error.message);
34
- }
35
-
36
- manager = new WorktreeManager(testRoot, {
37
- maxWorktrees: 3,
38
- staleDays: 30,
39
- });
40
- });
41
-
42
- afterEach(async () => {
43
- // Cleanup test directory
44
- try {
45
- await fs.rm(testRoot, { recursive: true, force: true });
46
- } catch (error) {
47
- // Ignore cleanup errors
48
- }
49
- });
50
-
51
- describe('constructor', () => {
52
- it('should use default options when none provided', () => {
53
- const defaultManager = new WorktreeManager('/tmp/test');
54
- expect(defaultManager.maxWorktrees).toBe(10);
55
- expect(defaultManager.worktreeDir).toBe('.sinapse/worktrees');
56
- expect(defaultManager.branchPrefix).toBe('auto-claude/');
57
- expect(defaultManager.staleDays).toBe(30);
58
- });
59
-
60
- it('should accept custom options', () => {
61
- const customManager = new WorktreeManager('/tmp/test', {
62
- maxWorktrees: 5,
63
- worktreeDir: '.custom/worktrees',
64
- branchPrefix: 'custom/',
65
- staleDays: 15,
66
- });
67
- expect(customManager.maxWorktrees).toBe(5);
68
- expect(customManager.worktreeDir).toBe('.custom/worktrees');
69
- expect(customManager.branchPrefix).toBe('custom/');
70
- expect(customManager.staleDays).toBe(15);
71
- });
72
- });
73
-
74
- describe('getWorktreePath', () => {
75
- it('should return correct path for story', () => {
76
- const wtPath = manager.getWorktreePath('STORY-42');
77
- expect(wtPath).toBe(path.join(testRoot, '.sinapse/worktrees', 'STORY-42'));
78
- });
79
- });
80
-
81
- describe('getBranchName', () => {
82
- it('should return correct branch name for story', () => {
83
- const branch = manager.getBranchName('STORY-42');
84
- expect(branch).toBe('auto-claude/STORY-42');
85
- });
86
- });
87
-
88
- describe('exists', () => {
89
- it('should return false for non-existent worktree', async () => {
90
- const exists = await manager.exists('NONEXISTENT');
91
- expect(exists).toBe(false);
92
- });
93
- });
94
-
95
- describe('create', () => {
96
- it('should create worktree with correct structure', async () => {
97
- try {
98
- const info = await manager.create('STORY-42');
99
-
100
- expect(info).not.toBeNull();
101
- expect(info.storyId).toBe('STORY-42');
102
- expect(info.branch).toBe('auto-claude/STORY-42');
103
- expect(info.status).toBe('active');
104
- expect(info.uncommittedChanges).toBe(0);
105
-
106
- // Verify directory was created
107
- const exists = await manager.exists('STORY-42');
108
- expect(exists).toBe(true);
109
- } catch (error) {
110
- // Git might not be available in CI
111
- if (error.message.includes('Git command failed')) {
112
- console.warn('Git not available, skipping test');
113
- expect(true).toBe(true);
114
- } else {
115
- throw error;
116
- }
117
- }
118
- });
119
-
120
- it('should throw error if worktree already exists', async () => {
121
- try {
122
- await manager.create('STORY-42');
123
- await expect(manager.create('STORY-42')).rejects.toThrow(
124
- "Worktree for story 'STORY-42' already exists",
125
- );
126
- } catch (error) {
127
- if (error.message.includes('Git command failed')) {
128
- console.warn('Git not available, skipping test');
129
- expect(true).toBe(true);
130
- } else if (!error.message.includes('already exists')) {
131
- throw error;
132
- }
133
- }
134
- });
135
-
136
- it('should throw error when max worktrees reached', async () => {
137
- try {
138
- // Create max worktrees (3 in test config)
139
- await manager.create('STORY-1');
140
- await manager.create('STORY-2');
141
- await manager.create('STORY-3');
142
-
143
- // Fourth should fail
144
- await expect(manager.create('STORY-4')).rejects.toThrow(
145
- 'Maximum worktrees limit (3) reached',
146
- );
147
- } catch (error) {
148
- if (error.message.includes('Git command failed')) {
149
- console.warn('Git not available, skipping test');
150
- expect(true).toBe(true);
151
- } else if (!error.message.includes('Maximum worktrees limit')) {
152
- throw error;
153
- }
154
- }
155
- });
156
- });
157
-
158
- describe('list', () => {
159
- it('should return empty array when no worktrees', async () => {
160
- try {
161
- const worktrees = await manager.list();
162
- expect(worktrees).toEqual([]);
163
- } catch (error) {
164
- if (error.message.includes('Git command failed')) {
165
- console.warn('Git not available, skipping test');
166
- expect(true).toBe(true);
167
- } else {
168
- throw error;
169
- }
170
- }
171
- });
172
-
173
- it('should return created worktrees', async () => {
174
- try {
175
- await manager.create('STORY-1');
176
- await manager.create('STORY-2');
177
-
178
- const worktrees = await manager.list();
179
- expect(worktrees.length).toBe(2);
180
- expect(worktrees.map((w) => w.storyId).sort()).toEqual(['STORY-1', 'STORY-2']);
181
- } catch (error) {
182
- if (error.message.includes('Git command failed')) {
183
- console.warn('Git not available, skipping test');
184
- expect(true).toBe(true);
185
- } else {
186
- throw error;
187
- }
188
- }
189
- });
190
- });
191
-
192
- describe('get', () => {
193
- it('should return null for non-existent worktree', async () => {
194
- const info = await manager.get('NONEXISTENT');
195
- expect(info).toBeNull();
196
- });
197
-
198
- it('should return worktree info for existing worktree', async () => {
199
- try {
200
- await manager.create('STORY-42');
201
- const info = await manager.get('STORY-42');
202
-
203
- expect(info).not.toBeNull();
204
- expect(info.storyId).toBe('STORY-42');
205
- expect(info.branch).toBe('auto-claude/STORY-42');
206
- } catch (error) {
207
- if (error.message.includes('Git command failed')) {
208
- console.warn('Git not available, skipping test');
209
- expect(true).toBe(true);
210
- } else {
211
- throw error;
212
- }
213
- }
214
- });
215
- });
216
-
217
- describe('remove', () => {
218
- it('should throw error for non-existent worktree', async () => {
219
- await expect(manager.remove('NONEXISTENT')).rejects.toThrow(
220
- "Worktree for story 'NONEXISTENT' does not exist",
221
- );
222
- });
223
-
224
- it('should remove existing worktree', async () => {
225
- try {
226
- await manager.create('STORY-42');
227
- expect(await manager.exists('STORY-42')).toBe(true);
228
-
229
- await manager.remove('STORY-42');
230
- expect(await manager.exists('STORY-42')).toBe(false);
231
- } catch (error) {
232
- if (error.message.includes('Git command failed')) {
233
- console.warn('Git not available, skipping test');
234
- expect(true).toBe(true);
235
- } else {
236
- throw error;
237
- }
238
- }
239
- });
240
- });
241
-
242
- describe('getCount', () => {
243
- it('should return correct counts', async () => {
244
- try {
245
- const count = await manager.getCount();
246
- expect(count.total).toBe(0);
247
- expect(count.active).toBe(0);
248
- expect(count.stale).toBe(0);
249
-
250
- await manager.create('STORY-1');
251
- await manager.create('STORY-2');
252
-
253
- const count2 = await manager.getCount();
254
- expect(count2.total).toBe(2);
255
- expect(count2.active).toBe(2);
256
- expect(count2.stale).toBe(0);
257
- } catch (error) {
258
- if (error.message.includes('Git command failed')) {
259
- console.warn('Git not available, skipping test');
260
- expect(true).toBe(true);
261
- } else {
262
- throw error;
263
- }
264
- }
265
- });
266
- });
267
-
268
- describe('formatList', () => {
269
- it('should return empty message for no worktrees', () => {
270
- const output = manager.formatList([]);
271
- expect(output).toContain('No active worktrees');
272
- });
273
-
274
- it('should format worktrees correctly', () => {
275
- const worktrees = [
276
- {
277
- storyId: 'STORY-42',
278
- path: '/test/path',
279
- branch: 'auto-claude/STORY-42',
280
- createdAt: new Date(),
281
- uncommittedChanges: 3,
282
- status: 'active',
283
- },
284
- ];
285
-
286
- const output = manager.formatList(worktrees);
287
- expect(output).toContain('STORY-42');
288
- expect(output).toContain('auto-claude/STORY-42');
289
- expect(output).toContain('3 uncommitted');
290
- });
291
- });
292
-
293
- describe('formatAge', () => {
294
- it('should format just now correctly', () => {
295
- const age = manager.formatAge(new Date());
296
- expect(age).toBe('just now');
297
- });
298
-
299
- it('should format hours correctly', () => {
300
- const twoHoursAgo = new Date(Date.now() - 2 * 60 * 60 * 1000);
301
- const age = manager.formatAge(twoHoursAgo);
302
- expect(age).toBe('2h ago');
303
- });
304
-
305
- it('should format days correctly', () => {
306
- const threeDaysAgo = new Date(Date.now() - 3 * 24 * 60 * 60 * 1000);
307
- const age = manager.formatAge(threeDaysAgo);
308
- expect(age).toBe('3d ago');
309
- });
310
- });
311
-
312
- describe('detectConflicts', () => {
313
- it('should throw error for non-existent worktree', async () => {
314
- await expect(manager.detectConflicts('NONEXISTENT')).rejects.toThrow(
315
- "Worktree for story 'NONEXISTENT' does not exist",
316
- );
317
- });
318
-
319
- it('should return empty array when no conflicts', async () => {
320
- try {
321
- await manager.create('STORY-42');
322
-
323
- // Make a change in worktree without conflicting
324
- const execa = require('execa');
325
- const worktreePath = manager.getWorktreePath('STORY-42');
326
- const newFile = path.join(worktreePath, 'new-file.txt');
327
- await fs.writeFile(newFile, 'New content');
328
- await execa('git', ['add', '.'], { cwd: worktreePath });
329
- await execa('git', ['commit', '-m', 'Add new file'], { cwd: worktreePath });
330
-
331
- const conflicts = await manager.detectConflicts('STORY-42');
332
- expect(conflicts).toEqual([]);
333
- } catch (error) {
334
- if (error.message.includes('Git command failed')) {
335
- console.warn('Git not available, skipping test');
336
- expect(true).toBe(true);
337
- } else {
338
- throw error;
339
- }
340
- }
341
- });
342
-
343
- it('should detect conflicting files', async () => {
344
- try {
345
- await manager.create('STORY-42');
346
- const execa = require('execa');
347
- const worktreePath = manager.getWorktreePath('STORY-42');
348
-
349
- // Modify README.md in worktree
350
- const wtReadme = path.join(worktreePath, 'README.md');
351
- await fs.writeFile(wtReadme, '# Modified in worktree');
352
- await execa('git', ['add', '.'], { cwd: worktreePath });
353
- await execa('git', ['commit', '-m', 'Modify README in worktree'], { cwd: worktreePath });
354
-
355
- // Modify README.md in main
356
- const mainReadme = path.join(testRoot, 'README.md');
357
- await fs.writeFile(mainReadme, '# Modified in main');
358
- await execa('git', ['add', '.'], { cwd: testRoot });
359
- await execa('git', ['commit', '-m', 'Modify README in main'], { cwd: testRoot });
360
-
361
- const conflicts = await manager.detectConflicts('STORY-42');
362
- expect(conflicts).toContain('README.md');
363
- } catch (error) {
364
- if (error.message.includes('Git command failed')) {
365
- console.warn('Git not available, skipping test');
366
- expect(true).toBe(true);
367
- } else {
368
- throw error;
369
- }
370
- }
371
- });
372
- });
373
-
374
- describe('mergeToBase', () => {
375
- it('should throw error for non-existent worktree', async () => {
376
- await expect(manager.mergeToBase('NONEXISTENT')).rejects.toThrow(
377
- "Worktree for story 'NONEXISTENT' does not exist",
378
- );
379
- });
380
-
381
- it('should merge worktree successfully', async () => {
382
- try {
383
- await manager.create('STORY-42');
384
- const execa = require('execa');
385
- const worktreePath = manager.getWorktreePath('STORY-42');
386
-
387
- // Make a non-conflicting change
388
- const newFile = path.join(worktreePath, 'feature.txt');
389
- await fs.writeFile(newFile, 'New feature content');
390
- await execa('git', ['add', '.'], { cwd: worktreePath });
391
- await execa('git', ['commit', '-m', 'Add feature'], { cwd: worktreePath });
392
-
393
- const result = await manager.mergeToBase('STORY-42');
394
-
395
- expect(result.success).toBe(true);
396
- expect(result.storyId).toBe('STORY-42');
397
- expect(result.sourceBranch).toBe('auto-claude/STORY-42');
398
- expect(result.conflicts).toEqual([]);
399
- expect(result.commitHash).toBeDefined();
400
- expect(result.logPath).toBeDefined();
401
-
402
- // Verify file exists in main after merge
403
- const mainFile = path.join(testRoot, 'feature.txt');
404
- const exists = await fs
405
- .access(mainFile)
406
- .then(() => true)
407
- .catch(() => false);
408
- expect(exists).toBe(true);
409
- } catch (error) {
410
- if (error.message.includes('Git command failed')) {
411
- console.warn('Git not available, skipping test');
412
- expect(true).toBe(true);
413
- } else {
414
- throw error;
415
- }
416
- }
417
- });
418
-
419
- it('should support staged option (--no-commit)', async () => {
420
- try {
421
- await manager.create('STORY-42');
422
- const execa = require('execa');
423
- const worktreePath = manager.getWorktreePath('STORY-42');
424
-
425
- const newFile = path.join(worktreePath, 'staged-feature.txt');
426
- await fs.writeFile(newFile, 'Staged feature');
427
- await execa('git', ['add', '.'], { cwd: worktreePath });
428
- await execa('git', ['commit', '-m', 'Add staged feature'], { cwd: worktreePath });
429
-
430
- // Get HEAD before merge
431
- const headBefore = await execa('git', ['rev-parse', 'HEAD'], { cwd: testRoot });
432
-
433
- const result = await manager.mergeToBase('STORY-42', { staged: true });
434
-
435
- expect(result.success).toBe(true);
436
- expect(result.commitHash).toBeUndefined(); // Not committed
437
-
438
- // Get HEAD after merge - should be same (no commit was made)
439
- const headAfter = await execa('git', ['rev-parse', 'HEAD'], { cwd: testRoot });
440
- expect(headAfter.stdout).toBe(headBefore.stdout);
441
-
442
- // Verify the file was merged to working tree
443
- const mainFile = path.join(testRoot, 'staged-feature.txt');
444
- const fileExists = await fs
445
- .access(mainFile)
446
- .then(() => true)
447
- .catch(() => false);
448
- expect(fileExists).toBe(true);
449
-
450
- // Clean up merge state for next tests
451
- await execa('git', ['merge', '--abort'], { cwd: testRoot }).catch(() => {
452
- return execa('git', ['reset', '--hard', 'HEAD'], { cwd: testRoot });
453
- });
454
- } catch (error) {
455
- if (error.message.includes('Git command failed')) {
456
- console.warn('Git not available, skipping test');
457
- expect(true).toBe(true);
458
- } else {
459
- throw error;
460
- }
461
- }
462
- });
463
-
464
- it('should support squash option', async () => {
465
- try {
466
- await manager.create('STORY-42');
467
- const execa = require('execa');
468
- const worktreePath = manager.getWorktreePath('STORY-42');
469
-
470
- // Make multiple commits
471
- for (let i = 1; i <= 3; i++) {
472
- const file = path.join(worktreePath, `file${i}.txt`);
473
- await fs.writeFile(file, `Content ${i}`);
474
- await execa('git', ['add', '.'], { cwd: worktreePath });
475
- await execa('git', ['commit', '-m', `Commit ${i}`], { cwd: worktreePath });
476
- }
477
-
478
- const result = await manager.mergeToBase('STORY-42', { squash: true });
479
-
480
- expect(result.success).toBe(true);
481
- expect(result.commitHash).toBeDefined();
482
- } catch (error) {
483
- if (error.message.includes('Git command failed')) {
484
- console.warn('Git not available, skipping test');
485
- expect(true).toBe(true);
486
- } else {
487
- throw error;
488
- }
489
- }
490
- });
491
-
492
- it('should fail gracefully on conflicts', async () => {
493
- try {
494
- await manager.create('STORY-42');
495
- const execa = require('execa');
496
- const worktreePath = manager.getWorktreePath('STORY-42');
497
-
498
- // Create conflict
499
- const wtReadme = path.join(worktreePath, 'README.md');
500
- await fs.writeFile(wtReadme, '# Worktree version');
501
- await execa('git', ['add', '.'], { cwd: worktreePath });
502
- await execa('git', ['commit', '-m', 'Modify in worktree'], { cwd: worktreePath });
503
-
504
- const mainReadme = path.join(testRoot, 'README.md');
505
- await fs.writeFile(mainReadme, '# Main version');
506
- await execa('git', ['add', '.'], { cwd: testRoot });
507
- await execa('git', ['commit', '-m', 'Modify in main'], { cwd: testRoot });
508
-
509
- const result = await manager.mergeToBase('STORY-42');
510
-
511
- expect(result.success).toBe(false);
512
- expect(result.conflicts.length).toBeGreaterThan(0);
513
- expect(result.error).toContain('conflict');
514
- } catch (error) {
515
- if (error.message.includes('Git command failed')) {
516
- console.warn('Git not available, skipping test');
517
- expect(true).toBe(true);
518
- } else {
519
- throw error;
520
- }
521
- }
522
- });
523
-
524
- it('should cleanup worktree after merge when cleanup option is true', async () => {
525
- try {
526
- await manager.create('STORY-42');
527
- const execa = require('execa');
528
- const worktreePath = manager.getWorktreePath('STORY-42');
529
-
530
- const newFile = path.join(worktreePath, 'cleanup-test.txt');
531
- await fs.writeFile(newFile, 'Cleanup test');
532
- await execa('git', ['add', '.'], { cwd: worktreePath });
533
- await execa('git', ['commit', '-m', 'Add cleanup test'], { cwd: worktreePath });
534
-
535
- const result = await manager.mergeToBase('STORY-42', { cleanup: true });
536
-
537
- expect(result.success).toBe(true);
538
- expect(await manager.exists('STORY-42')).toBe(false);
539
- } catch (error) {
540
- if (error.message.includes('Git command failed')) {
541
- console.warn('Git not available, skipping test');
542
- expect(true).toBe(true);
543
- } else {
544
- throw error;
545
- }
546
- }
547
- });
548
- });
549
-
550
- describe('getMergeHistory', () => {
551
- it('should return empty array when no merge history', async () => {
552
- const history = await manager.getMergeHistory();
553
- expect(history).toEqual([]);
554
- });
555
-
556
- it('should return merge history after merge', async () => {
557
- try {
558
- await manager.create('STORY-42');
559
- const execa = require('execa');
560
- const worktreePath = manager.getWorktreePath('STORY-42');
561
-
562
- const newFile = path.join(worktreePath, 'history-test.txt');
563
- await fs.writeFile(newFile, 'History test');
564
- await execa('git', ['add', '.'], { cwd: worktreePath });
565
- await execa('git', ['commit', '-m', 'Add history test'], { cwd: worktreePath });
566
-
567
- await manager.mergeToBase('STORY-42');
568
-
569
- const history = await manager.getMergeHistory();
570
- expect(history.length).toBe(1);
571
- expect(history[0].storyId).toBe('STORY-42');
572
- expect(history[0].success).toBe(true);
573
- } catch (error) {
574
- if (error.message.includes('Git command failed')) {
575
- console.warn('Git not available, skipping test');
576
- expect(true).toBe(true);
577
- } else {
578
- throw error;
579
- }
580
- }
581
- });
582
-
583
- it('should filter by storyId', async () => {
584
- try {
585
- await manager.create('STORY-42');
586
- await manager.create('STORY-43');
587
- const execa = require('execa');
588
-
589
- // Merge STORY-42
590
- const wt42 = manager.getWorktreePath('STORY-42');
591
- await fs.writeFile(path.join(wt42, 'file42.txt'), 'Content 42');
592
- await execa('git', ['add', '.'], { cwd: wt42 });
593
- await execa('git', ['commit', '-m', 'Add file 42'], { cwd: wt42 });
594
- await manager.mergeToBase('STORY-42');
595
-
596
- // Merge STORY-43
597
- const wt43 = manager.getWorktreePath('STORY-43');
598
- await fs.writeFile(path.join(wt43, 'file43.txt'), 'Content 43');
599
- await execa('git', ['add', '.'], { cwd: wt43 });
600
- await execa('git', ['commit', '-m', 'Add file 43'], { cwd: wt43 });
601
- await manager.mergeToBase('STORY-43');
602
-
603
- const allHistory = await manager.getMergeHistory();
604
- expect(allHistory.length).toBe(2);
605
-
606
- const story42History = await manager.getMergeHistory('STORY-42');
607
- expect(story42History.length).toBe(1);
608
- expect(story42History[0].storyId).toBe('STORY-42');
609
- } catch (error) {
610
- if (error.message.includes('Git command failed')) {
611
- console.warn('Git not available, skipping test');
612
- expect(true).toBe(true);
613
- } else {
614
- throw error;
615
- }
616
- }
617
- });
618
- });
619
- });
620
-
@@ -1,2 +0,0 @@
1
- # SINAPSE Monitor Hooks Library
2
-
@@ -1,59 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Enrich events with SINAPSE context (agent, story, task, etc.)
4
- """
5
-
6
- import os
7
- import re
8
- from pathlib import Path
9
- from typing import Any
10
-
11
-
12
- def enrich_event(data: dict[str, Any]) -> dict[str, Any]:
13
- """Add SINAPSE context to event data."""
14
-
15
- # Project detection
16
- cwd = data.get("cwd", os.getcwd())
17
- data["project"] = detect_project(cwd)
18
-
19
- # SINAPSE context from environment
20
- if os.environ.get("SINAPSE_AGENT"):
21
- data["sinapse_agent"] = os.environ["SINAPSE_AGENT"]
22
-
23
- if os.environ.get("SINAPSE_STORY_ID"):
24
- data["sinapse_story_id"] = os.environ["SINAPSE_STORY_ID"]
25
-
26
- if os.environ.get("SINAPSE_TASK_ID"):
27
- data["sinapse_task_id"] = os.environ["SINAPSE_TASK_ID"]
28
-
29
- # Try to detect SINAPSE agent from user prompt if available
30
- user_prompt = data.get("user_prompt", "")
31
- if user_prompt:
32
- detected_agent = detect_agent_from_prompt(user_prompt)
33
- if detected_agent and not data.get("sinapse_agent"):
34
- data["sinapse_agent"] = detected_agent
35
-
36
- return data
37
-
38
-
39
- def detect_project(cwd: str) -> str:
40
- """Detect project name from cwd."""
41
- path = Path(cwd)
42
-
43
- # Check for common project markers
44
- markers = [".git", "package.json", "Cargo.toml", "go.mod", "pyproject.toml"]
45
- for marker in markers:
46
- if (path / marker).exists():
47
- return path.name
48
-
49
- return path.name
50
-
51
-
52
- def detect_agent_from_prompt(prompt: str) -> str | None:
53
- """Detect SINAPSE agent activation from prompt."""
54
- # Look for @agent patterns
55
- match = re.search(r'@(dev|architect|qa|pm|po|sm|analyst|devops|sinapse-orqx)', prompt.lower())
56
- if match:
57
- return match.group(1)
58
- return None
59
-