@nerviq/cli 1.17.3 → 1.19.0

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 (190) hide show
  1. package/LICENSE +23 -23
  2. package/README.md +4 -4
  3. package/bin/cli.js +61 -274
  4. package/package.json +60 -60
  5. package/src/activity.js +1039 -1039
  6. package/src/adoption-advisor.js +299 -299
  7. package/src/aider/config-parser.js +166 -166
  8. package/src/aider/context.js +158 -158
  9. package/src/aider/deep-review.js +316 -316
  10. package/src/aider/domain-packs.js +303 -303
  11. package/src/aider/freshness.js +93 -93
  12. package/src/aider/governance.js +253 -253
  13. package/src/aider/interactive.js +334 -334
  14. package/src/aider/mcp-packs.js +329 -329
  15. package/src/aider/patch.js +214 -214
  16. package/src/aider/plans.js +186 -186
  17. package/src/aider/premium.js +360 -360
  18. package/src/aider/setup.js +404 -404
  19. package/src/aider/techniques.js +16 -16
  20. package/src/analyze.js +951 -951
  21. package/src/anti-patterns.js +485 -485
  22. package/src/audit/instruction-files.js +180 -180
  23. package/src/audit/recommendations.js +577 -577
  24. package/src/auto-suggest.js +154 -154
  25. package/src/badge.js +13 -13
  26. package/src/behavioral-drift.js +801 -801
  27. package/src/benchmark.js +67 -67
  28. package/src/catalog.js +103 -103
  29. package/src/certification.js +128 -128
  30. package/src/codex/config-parser.js +183 -183
  31. package/src/codex/context.js +223 -223
  32. package/src/codex/deep-review.js +493 -493
  33. package/src/codex/domain-packs.js +394 -394
  34. package/src/codex/freshness.js +84 -84
  35. package/src/codex/governance.js +192 -192
  36. package/src/codex/interactive.js +618 -618
  37. package/src/codex/mcp-packs.js +914 -914
  38. package/src/codex/patch.js +209 -209
  39. package/src/codex/plans.js +251 -251
  40. package/src/codex/premium.js +614 -614
  41. package/src/codex/setup.js +591 -591
  42. package/src/context.js +320 -320
  43. package/src/continuous-ops.js +681 -681
  44. package/src/copilot/activity.js +309 -309
  45. package/src/copilot/config-parser.js +280 -226
  46. package/src/copilot/context.js +218 -197
  47. package/src/copilot/deep-review.js +346 -346
  48. package/src/copilot/domain-packs.js +372 -372
  49. package/src/copilot/freshness.js +57 -57
  50. package/src/copilot/governance.js +222 -222
  51. package/src/copilot/interactive.js +406 -406
  52. package/src/copilot/mcp-packs.js +826 -826
  53. package/src/copilot/plans.js +253 -253
  54. package/src/copilot/premium.js +451 -451
  55. package/src/copilot/setup.js +488 -488
  56. package/src/copilot/techniques.js +219 -78
  57. package/src/cost-tracking.js +61 -61
  58. package/src/cursor/activity.js +301 -301
  59. package/src/cursor/config-parser.js +265 -265
  60. package/src/cursor/context.js +256 -256
  61. package/src/cursor/deep-review.js +334 -334
  62. package/src/cursor/domain-packs.js +368 -368
  63. package/src/cursor/freshness.js +65 -65
  64. package/src/cursor/governance.js +229 -229
  65. package/src/cursor/interactive.js +391 -391
  66. package/src/cursor/mcp-packs.js +828 -828
  67. package/src/cursor/plans.js +254 -254
  68. package/src/cursor/premium.js +469 -469
  69. package/src/cursor/setup.js +488 -488
  70. package/src/dashboard.js +493 -493
  71. package/src/deep-review.js +428 -428
  72. package/src/deprecation.js +98 -98
  73. package/src/diff-only.js +280 -280
  74. package/src/doctor.js +119 -119
  75. package/src/domain-pack-expansion.js +1033 -1033
  76. package/src/domain-packs.js +387 -387
  77. package/src/feedback.js +178 -178
  78. package/src/fix-engine.js +783 -0
  79. package/src/fix-prompts.js +122 -122
  80. package/src/formatters/sarif.js +115 -115
  81. package/src/freshness.js +74 -74
  82. package/src/gemini/config-parser.js +275 -275
  83. package/src/gemini/context.js +221 -221
  84. package/src/gemini/deep-review.js +559 -559
  85. package/src/gemini/domain-packs.js +393 -393
  86. package/src/gemini/freshness.js +66 -66
  87. package/src/gemini/governance.js +201 -201
  88. package/src/gemini/interactive.js +860 -860
  89. package/src/gemini/mcp-packs.js +915 -915
  90. package/src/gemini/plans.js +269 -269
  91. package/src/gemini/premium.js +760 -760
  92. package/src/gemini/setup.js +692 -692
  93. package/src/gemini/techniques.js +14 -14
  94. package/src/governance.js +72 -72
  95. package/src/harmony/add.js +68 -68
  96. package/src/harmony/advisor.js +333 -333
  97. package/src/harmony/canon.js +565 -565
  98. package/src/harmony/cli.js +591 -591
  99. package/src/harmony/drift.js +401 -401
  100. package/src/harmony/governance.js +313 -313
  101. package/src/harmony/memory.js +239 -239
  102. package/src/harmony/sync.js +475 -475
  103. package/src/harmony/watch.js +370 -370
  104. package/src/hook-validation.js +342 -342
  105. package/src/index.js +271 -271
  106. package/src/init.js +184 -184
  107. package/src/instruction-surfaces.js +185 -185
  108. package/src/integrations.js +144 -144
  109. package/src/interactive.js +118 -118
  110. package/src/locales/en.json +1 -1
  111. package/src/locales/es.json +1 -1
  112. package/src/mcp-packs.js +830 -830
  113. package/src/mcp-server.js +726 -726
  114. package/src/mcp-validation.js +337 -337
  115. package/src/nerviq-sync.json +7 -7
  116. package/src/opencode/config-parser.js +109 -109
  117. package/src/opencode/context.js +247 -247
  118. package/src/opencode/deep-review.js +313 -313
  119. package/src/opencode/domain-packs.js +262 -262
  120. package/src/opencode/freshness.js +66 -66
  121. package/src/opencode/governance.js +159 -159
  122. package/src/opencode/interactive.js +392 -392
  123. package/src/opencode/mcp-packs.js +705 -705
  124. package/src/opencode/patch.js +184 -184
  125. package/src/opencode/plans.js +231 -231
  126. package/src/opencode/premium.js +413 -413
  127. package/src/opencode/setup.js +449 -449
  128. package/src/opencode/techniques.js +27 -27
  129. package/src/operating-profile.js +574 -574
  130. package/src/org.js +152 -152
  131. package/src/permission-rules.js +218 -218
  132. package/src/plans.js +839 -839
  133. package/src/platform-change-manifest.js +86 -86
  134. package/src/plugins.js +110 -110
  135. package/src/policy-layers.js +210 -210
  136. package/src/profiles.js +124 -124
  137. package/src/prompt-injection.js +74 -74
  138. package/src/public-api.js +173 -173
  139. package/src/recommendation-rules.js +84 -84
  140. package/src/repo-archetype.js +386 -386
  141. package/src/secret-patterns.js +39 -39
  142. package/src/server.js +527 -527
  143. package/src/setup/analysis.js +607 -607
  144. package/src/setup/runtime.js +172 -172
  145. package/src/setup.js +677 -677
  146. package/src/shared/capabilities.js +194 -194
  147. package/src/source-urls.js +132 -132
  148. package/src/stack-checks.js +565 -565
  149. package/src/supplemental-checks.js +13 -13
  150. package/src/synergy/adaptive.js +261 -261
  151. package/src/synergy/compensation.js +137 -137
  152. package/src/synergy/evidence.js +193 -193
  153. package/src/synergy/learning.js +199 -199
  154. package/src/synergy/patterns.js +227 -227
  155. package/src/synergy/ranking.js +83 -83
  156. package/src/synergy/report.js +165 -165
  157. package/src/synergy/routing.js +146 -146
  158. package/src/techniques/api.js +407 -407
  159. package/src/techniques/automation.js +316 -316
  160. package/src/techniques/compliance.js +257 -257
  161. package/src/techniques/hygiene.js +294 -294
  162. package/src/techniques/instructions.js +243 -243
  163. package/src/techniques/observability.js +226 -226
  164. package/src/techniques/optimization.js +142 -142
  165. package/src/techniques/quality.js +318 -318
  166. package/src/techniques/security.js +237 -237
  167. package/src/techniques/shared.js +443 -443
  168. package/src/techniques/stacks.js +2294 -2294
  169. package/src/techniques/tools.js +106 -106
  170. package/src/techniques/workflow.js +413 -413
  171. package/src/techniques.js +81 -81
  172. package/src/terminology.js +73 -73
  173. package/src/token-estimate.js +35 -35
  174. package/src/usage-patterns.js +99 -99
  175. package/src/verification-metadata.js +145 -145
  176. package/src/watch.js +247 -247
  177. package/src/windsurf/activity.js +302 -302
  178. package/src/windsurf/config-parser.js +267 -267
  179. package/src/windsurf/context.js +249 -249
  180. package/src/windsurf/deep-review.js +337 -337
  181. package/src/windsurf/domain-packs.js +370 -370
  182. package/src/windsurf/freshness.js +36 -36
  183. package/src/windsurf/governance.js +231 -231
  184. package/src/windsurf/interactive.js +388 -388
  185. package/src/windsurf/mcp-packs.js +792 -792
  186. package/src/windsurf/plans.js +247 -247
  187. package/src/windsurf/premium.js +468 -468
  188. package/src/windsurf/setup.js +471 -471
  189. package/src/windsurf/techniques.js +17 -17
  190. package/src/workspace.js +375 -375
@@ -1,1033 +1,1033 @@
1
- const PACK_BLUEPRINTS = [
2
- {
3
- key: 'blockchain',
4
- label: 'Blockchain',
5
- useWhen: 'Repos with smart contracts, wallet logic, chain integrations, or on-chain deployment tooling.',
6
- adoption: 'Recommended when contract review, deployment safety, and chain-specific build workflows are core to the repo.',
7
- recommendedModules: ['Contract review guide', 'Wallet and secret safety', 'Deployment verification'],
8
- benchmarkFocus: ['contract-aware verification', 'wallet and secret safety', 'deployment review'],
9
- },
10
- {
11
- key: 'realtime',
12
- label: 'Realtime',
13
- useWhen: 'Repos centered on websockets, live collaboration, presence, or push-driven event flows.',
14
- adoption: 'Recommended when event delivery, connection lifecycle, and concurrency behavior matter as much as CRUD flows.',
15
- recommendedModules: ['Event flow guide', 'Connection lifecycle checks', 'Delivery and retry posture'],
16
- benchmarkFocus: ['live event safety', 'connection lifecycle review', 'delivery resilience'],
17
- },
18
- {
19
- key: 'graphql',
20
- label: 'GraphQL',
21
- useWhen: 'Repos with GraphQL schemas, resolvers, or GraphQL-first clients and services.',
22
- adoption: 'Recommended when schema contracts and resolver changes need stronger review and verification loops.',
23
- recommendedModules: ['Schema contract guide', 'Resolver verification', 'Client-server contract checks'],
24
- benchmarkFocus: ['schema safety', 'resolver correctness', 'contract review'],
25
- },
26
- {
27
- key: 'serverless',
28
- label: 'Serverless',
29
- useWhen: 'Repos built around functions, lambdas, edge handlers, or platform-managed deployment surfaces.',
30
- adoption: 'Recommended when deployment packaging, environment isolation, and runtime constraints drive the workflow.',
31
- recommendedModules: ['Function deployment guide', 'Cold-start aware verification', 'Environment isolation checklist'],
32
- benchmarkFocus: ['deployment safety', 'runtime fit', 'environment isolation'],
33
- },
34
- {
35
- key: 'microservices',
36
- label: 'Microservices',
37
- useWhen: 'Repos coordinating several services, contracts, or inter-service boundaries across a shared system.',
38
- adoption: 'Recommended when service boundaries, orchestration, and contract compatibility need stronger guardrails.',
39
- recommendedModules: ['Service boundary guide', 'Contract and proto review', 'Multi-service orchestration checks'],
40
- benchmarkFocus: ['service-boundary safety', 'contract review', 'multi-service coordination'],
41
- },
42
- {
43
- key: 'cli-tool',
44
- label: 'CLI Tool',
45
- useWhen: 'Repos whose primary product surface is a terminal command, scaffolder, or developer-facing CLI.',
46
- adoption: 'Recommended when command UX, flags, help text, and packaging are part of the product contract.',
47
- recommendedModules: ['CLI UX guide', 'Flag and help contract', 'Distribution checklist'],
48
- benchmarkFocus: ['command UX quality', 'flag safety', 'distribution readiness'],
49
- },
50
- {
51
- key: 'browser-ext',
52
- label: 'Browser Extension',
53
- useWhen: 'Repos shipping browser extensions, add-ons, or extension-like surfaces with manifest-driven permissions.',
54
- adoption: 'Recommended when manifest review, permission minimization, and cross-browser packaging are central concerns.',
55
- recommendedModules: ['Extension manifest guide', 'Permission review', 'Store packaging checklist'],
56
- benchmarkFocus: ['manifest safety', 'permission posture', 'store packaging readiness'],
57
- },
58
- {
59
- key: 'desktop',
60
- label: 'Desktop App',
61
- useWhen: 'Repos shipping desktop software through Electron, Tauri, or similar native-shell frameworks.',
62
- adoption: 'Recommended when native bridges, packaging, and OS-specific release workflows shape the repo.',
63
- recommendedModules: ['Desktop packaging guide', 'Native bridge safety', 'Cross-platform release checks'],
64
- benchmarkFocus: ['native-surface safety', 'packaging quality', 'cross-platform release readiness'],
65
- },
66
- {
67
- key: 'game-dev',
68
- label: 'Game Development',
69
- useWhen: 'Repos focused on gameplay loops, rendering, scenes, or asset-heavy interactive experiences.',
70
- adoption: 'Recommended when performance, asset pipelines, and engine-specific workflows dominate the repo.',
71
- recommendedModules: ['Asset pipeline guide', 'Render loop safety', 'Performance regression checks'],
72
- benchmarkFocus: ['render-loop safety', 'asset pipeline quality', 'performance regressions'],
73
- },
74
- {
75
- key: 'data-viz',
76
- label: 'Data Visualization',
77
- useWhen: 'Repos centered on charts, dashboards, visual analytics, or data-heavy rendering surfaces.',
78
- adoption: 'Recommended when chart correctness, data transforms, and rendering fidelity are core product risks.',
79
- recommendedModules: ['Chart correctness guide', 'Dataset transformation review', 'Render performance checks'],
80
- benchmarkFocus: ['visual correctness', 'data-transform review', 'render performance'],
81
- },
82
- {
83
- key: 'cms',
84
- label: 'CMS',
85
- useWhen: 'Repos driven by structured content, headless CMS models, authoring flows, or publishing pipelines.',
86
- adoption: 'Recommended when content modeling, preview, and publish behavior need stronger workflow guidance.',
87
- recommendedModules: ['Content model guide', 'Authoring workflow review', 'Preview and publish checks'],
88
- benchmarkFocus: ['content-model safety', 'authoring workflow quality', 'publish readiness'],
89
- },
90
- {
91
- key: 'testing-framework',
92
- label: 'Testing Framework',
93
- useWhen: 'Repos where the main engineering loop is defined by a first-class test runner and CI test discipline.',
94
- adoption: 'Recommended when test ergonomics, coverage, and CI parity are foundational to the repo workflow.',
95
- recommendedModules: ['Test runner baseline', 'Coverage and flake control', 'CI test parity'],
96
- benchmarkFocus: ['test-loop quality', 'coverage posture', 'CI parity'],
97
- },
98
- {
99
- key: 'devtools',
100
- label: 'Developer Tools',
101
- useWhen: 'Repos building plugins, editor extensions, bundler plugins, or other developer-facing tooling.',
102
- adoption: 'Recommended when extension APIs, integration contracts, and distribution workflows matter to product quality.',
103
- recommendedModules: ['Developer-tool integration guide', 'Extension/plugin API review', 'Distribution checks'],
104
- benchmarkFocus: ['integration safety', 'API compatibility', 'distribution readiness'],
105
- },
106
- {
107
- key: 'auth-service',
108
- label: 'Auth Service',
109
- useWhen: 'Repos centered on authentication, identity, session issuance, or user access management.',
110
- adoption: 'Recommended when auth boundaries, token handling, and identity-provider integrations are primary concerns.',
111
- recommendedModules: ['Auth boundary guide', 'Session/token review', 'Identity-provider integration checks'],
112
- benchmarkFocus: ['auth-boundary safety', 'session and token review', 'identity-provider fit'],
113
- },
114
- {
115
- key: 'payments',
116
- label: 'Payments',
117
- useWhen: 'Repos where billing, subscriptions, checkout, or payment-provider integrations are the core workflow.',
118
- adoption: 'Recommended when money movement, webhooks, and retry semantics are product-critical.',
119
- recommendedModules: ['Payment flow guide', 'Webhook and retry review', 'Financial safety checks'],
120
- benchmarkFocus: ['payment-flow safety', 'webhook correctness', 'financial guardrails'],
121
- },
122
- {
123
- key: 'notifications',
124
- label: 'Notifications',
125
- useWhen: 'Repos whose product flows depend on email, SMS, push, or multi-channel user notifications.',
126
- adoption: 'Recommended when delivery channels, templates, and retry policies drive the system behavior.',
127
- recommendedModules: ['Delivery channel guide', 'Template lifecycle review', 'Retry and rate-limit checks'],
128
- benchmarkFocus: ['delivery reliability', 'template quality', 'retry posture'],
129
- },
130
- {
131
- key: 'search',
132
- label: 'Search',
133
- useWhen: 'Repos built around search indexing, query relevance, or external search infrastructure.',
134
- adoption: 'Recommended when indexing, ranking, and synchronization between source data and search need stronger review.',
135
- recommendedModules: ['Indexing guide', 'Query relevance review', 'Sync and backfill checks'],
136
- benchmarkFocus: ['indexing safety', 'relevance quality', 'sync correctness'],
137
- },
138
- {
139
- key: 'queue-worker',
140
- label: 'Queue Worker',
141
- useWhen: 'Repos organized around job queues, background workers, retries, or asynchronous orchestration.',
142
- adoption: 'Recommended when idempotency, retries, and worker operational safety define the workflow.',
143
- recommendedModules: ['Queue processing guide', 'Retry and idempotency review', 'Worker scaling checks'],
144
- benchmarkFocus: ['job safety', 'retry correctness', 'worker scalability'],
145
- },
146
- {
147
- key: 'observability',
148
- label: 'Observability',
149
- useWhen: 'Repos where logs, traces, metrics, or platform telemetry are a first-class operating surface.',
150
- adoption: 'Recommended when log quality, telemetry coverage, and alertability are central to production readiness.',
151
- recommendedModules: ['Logging and telemetry guide', 'Error-tracing review', 'Alertability checks'],
152
- benchmarkFocus: ['telemetry coverage', 'traceability', 'alert readiness'],
153
- },
154
- {
155
- key: 'i18n',
156
- label: 'Internationalization',
157
- useWhen: 'Repos with locale files, translation workflows, or runtime language switching as a product feature.',
158
- adoption: 'Recommended when fallback behavior, message keys, and translation coverage shape the user experience.',
159
- recommendedModules: ['Locale and message guide', 'Fallback coverage', 'Translation workflow checks'],
160
- benchmarkFocus: ['translation coverage', 'fallback safety', 'message-key consistency'],
161
- },
162
- {
163
- key: 'static-site',
164
- label: 'Static Site',
165
- useWhen: 'Repos generating static documentation, marketing, blog, or content-first sites.',
166
- adoption: 'Recommended when content builds, routing, and publishing pipelines dominate the workflow.',
167
- recommendedModules: ['Content build guide', 'Template and routing review', 'Publish pipeline checks'],
168
- benchmarkFocus: ['build correctness', 'routing safety', 'publish readiness'],
169
- },
170
- {
171
- key: 'api-gateway',
172
- label: 'API Gateway',
173
- useWhen: 'Repos built around gateway routing, proxying, traffic policy, or service aggregation layers.',
174
- adoption: 'Recommended when upstream contracts, routing rules, and auth policy at the edge are major concerns.',
175
- recommendedModules: ['Gateway routing guide', 'Policy and auth review', 'Upstream contract checks'],
176
- benchmarkFocus: ['routing safety', 'policy correctness', 'upstream compatibility'],
177
- },
178
- {
179
- key: 'ml-ops',
180
- label: 'ML Ops',
181
- useWhen: 'Repos focused on experiment tracking, data lineage, model artifacts, or promotion workflows.',
182
- adoption: 'Recommended when model lifecycle and experiment traceability matter as much as the model code itself.',
183
- recommendedModules: ['Experiment tracking guide', 'Artifact lifecycle review', 'Model promotion checks'],
184
- benchmarkFocus: ['artifact traceability', 'experiment hygiene', 'promotion safety'],
185
- },
186
- {
187
- key: 'embedded-iot',
188
- label: 'Embedded / IoT',
189
- useWhen: 'Repos integrating with hardware devices, MQTT-like messaging, or embedded runtime constraints.',
190
- adoption: 'Recommended when device messaging, firmware safety, and hardware integration dominate the repo.',
191
- recommendedModules: ['Hardware integration guide', 'Device messaging review', 'Firmware safety checks'],
192
- benchmarkFocus: ['device-surface safety', 'messaging reliability', 'firmware guardrails'],
193
- },
194
- {
195
- key: 'healthcare',
196
- label: 'Healthcare',
197
- useWhen: 'Repos handling HIPAA compliance, HL7/FHIR integrations, PHI data, or medical records workflows.',
198
- adoption: 'Recommended when patient data protection, regulatory compliance, and clinical data standards are central concerns.',
199
- recommendedModules: ['HIPAA compliance guide', 'PHI data handling review', 'Clinical data safety checks'],
200
- benchmarkFocus: ['HIPAA compliance posture', 'PHI protection', 'clinical data standards'],
201
- },
202
- {
203
- key: 'fintech',
204
- label: 'Fintech',
205
- useWhen: 'Repos with PCI-DSS requirements, KYC/AML workflows, transaction processing, or financial regulation compliance.',
206
- adoption: 'Recommended when financial data safety, regulatory compliance, and transaction integrity are core concerns.',
207
- recommendedModules: ['PCI-DSS compliance guide', 'Transaction safety review', 'KYC/AML workflow checks'],
208
- benchmarkFocus: ['PCI compliance posture', 'transaction integrity', 'regulatory readiness'],
209
- },
210
- {
211
- key: 'gaming',
212
- label: 'Gaming',
213
- useWhen: 'Repos with ECS patterns, asset pipelines, multiplayer networking, or game loop architectures.',
214
- adoption: 'Recommended when game loop performance, asset management, and multiplayer synchronization drive the workflow.',
215
- recommendedModules: ['Game loop optimization guide', 'Asset pipeline review', 'Multiplayer safety checks'],
216
- benchmarkFocus: ['game-loop performance', 'asset pipeline quality', 'multiplayer synchronization'],
217
- },
218
- {
219
- key: 'iot',
220
- label: 'IoT',
221
- useWhen: 'Repos centered on MQTT messaging, edge computing, OTA firmware updates, or sensor data ingestion.',
222
- adoption: 'Recommended when device communication protocols, edge processing, and sensor data pipelines are primary concerns.',
223
- recommendedModules: ['MQTT integration guide', 'Edge computing review', 'OTA update safety checks'],
224
- benchmarkFocus: ['device messaging reliability', 'edge processing safety', 'OTA update integrity'],
225
- },
226
- {
227
- key: 'streaming',
228
- label: 'Streaming',
229
- useWhen: 'Repos handling video/audio codecs, CDN integration, adaptive bitrate streaming, or transcoding pipelines.',
230
- adoption: 'Recommended when media delivery quality, codec management, and CDN configuration are central to the product.',
231
- recommendedModules: ['Media delivery guide', 'Codec and transcoding review', 'CDN configuration checks'],
232
- benchmarkFocus: ['media delivery quality', 'transcoding safety', 'CDN configuration'],
233
- },
234
- {
235
- key: 'robotics',
236
- label: 'Robotics',
237
- useWhen: 'Repos with ROS integration, sensor fusion, real-time control constraints, or actuator management.',
238
- adoption: 'Recommended when real-time safety, sensor data fusion, and hardware control are foundational to the repo.',
239
- recommendedModules: ['Real-time control guide', 'Sensor fusion review', 'Actuator safety checks'],
240
- benchmarkFocus: ['real-time constraint safety', 'sensor fusion quality', 'actuator control integrity'],
241
- },
242
- {
243
- key: 'ar-vr',
244
- label: 'AR / VR',
245
- useWhen: 'Repos focused on 3D rendering, spatial computing, XR frameworks, or immersive experience development.',
246
- adoption: 'Recommended when 3D rendering performance, spatial interaction, and XR platform integration drive the workflow.',
247
- recommendedModules: ['3D rendering guide', 'Spatial computing review', 'XR framework checks'],
248
- benchmarkFocus: ['rendering performance', 'spatial interaction quality', 'XR platform compatibility'],
249
- },
250
- {
251
- key: 'climate-tech',
252
- label: 'Climate Tech',
253
- useWhen: 'Repos handling carbon tracking, energy modeling, ESG reporting, or environmental data workflows.',
254
- adoption: 'Recommended when emissions data accuracy, energy modeling, and ESG compliance are central concerns.',
255
- recommendedModules: ['Carbon tracking guide', 'Energy modeling review', 'ESG reporting checks'],
256
- benchmarkFocus: ['emissions data accuracy', 'energy model quality', 'ESG compliance readiness'],
257
- },
258
- {
259
- key: 'govtech',
260
- label: 'GovTech',
261
- useWhen: 'Repos requiring accessibility compliance, internationalization, audit trails, or government service standards.',
262
- adoption: 'Recommended when accessibility, audit traceability, and regulatory compliance are mandatory product requirements.',
263
- recommendedModules: ['Accessibility compliance guide', 'Audit trail review', 'Government standards checks'],
264
- benchmarkFocus: ['accessibility compliance', 'audit trail completeness', 'regulatory standards'],
265
- },
266
- {
267
- key: 'edtech',
268
- label: 'EdTech',
269
- useWhen: 'Repos with LMS integration, assessment engines, progress tracking, or educational content delivery.',
270
- adoption: 'Recommended when learning management, student progress tracking, and assessment integrity are core product concerns.',
271
- recommendedModules: ['LMS integration guide', 'Assessment engine review', 'Progress tracking checks'],
272
- benchmarkFocus: ['LMS integration quality', 'assessment integrity', 'progress tracking accuracy'],
273
- },
274
- {
275
- key: 'martech',
276
- label: 'MarTech',
277
- useWhen: 'Repos handling analytics pipelines, A/B testing frameworks, personalization engines, or marketing automation.',
278
- adoption: 'Recommended when analytics accuracy, experiment integrity, and personalization workflows drive the product.',
279
- recommendedModules: ['Analytics pipeline guide', 'A/B testing review', 'Personalization safety checks'],
280
- benchmarkFocus: ['analytics accuracy', 'experiment integrity', 'personalization quality'],
281
- },
282
- {
283
- key: 'proptech',
284
- label: 'PropTech',
285
- useWhen: 'Repos handling property data, geospatial analysis, building management systems, or real estate workflows.',
286
- adoption: 'Recommended when property data accuracy, geospatial processing, and building system integration are central.',
287
- recommendedModules: ['Property data guide', 'Geospatial processing review', 'Building systems checks'],
288
- benchmarkFocus: ['property data accuracy', 'geospatial quality', 'building system integration'],
289
- },
290
- {
291
- key: 'legaltech',
292
- label: 'LegalTech',
293
- useWhen: 'Repos focused on document automation, compliance management, e-discovery, or legal workflow tooling.',
294
- adoption: 'Recommended when document accuracy, compliance tracking, and legal data handling are primary concerns.',
295
- recommendedModules: ['Document automation guide', 'Compliance workflow review', 'E-discovery safety checks'],
296
- benchmarkFocus: ['document accuracy', 'compliance tracking', 'legal data handling'],
297
- },
298
- {
299
- key: 'agritech',
300
- label: 'AgriTech',
301
- useWhen: 'Repos handling agricultural sensor data, crop modeling, supply chain tracking, or farm management systems.',
302
- adoption: 'Recommended when sensor data processing, crop analytics, and supply chain traceability are core concerns.',
303
- recommendedModules: ['Sensor data pipeline guide', 'Crop modeling review', 'Supply chain tracking checks'],
304
- benchmarkFocus: ['sensor data quality', 'crop model accuracy', 'supply chain traceability'],
305
- },
306
- {
307
- key: 'biotech',
308
- label: 'BioTech',
309
- useWhen: 'Repos with bioinformatics pipelines, lab automation systems, or regulatory submission workflows.',
310
- adoption: 'Recommended when biological data processing, lab workflow automation, and regulatory compliance drive the repo.',
311
- recommendedModules: ['Bioinformatics pipeline guide', 'Lab automation review', 'Regulatory compliance checks'],
312
- benchmarkFocus: ['bioinformatics accuracy', 'lab automation safety', 'regulatory compliance'],
313
- },
314
- {
315
- key: 'cybersecurity',
316
- label: 'Cybersecurity',
317
- useWhen: 'Repos focused on threat detection, SIEM integration, incident response, or security operations tooling.',
318
- adoption: 'Recommended when threat detection accuracy, incident response workflows, and security telemetry are central.',
319
- recommendedModules: ['Threat detection guide', 'SIEM integration review', 'Incident response checks'],
320
- benchmarkFocus: ['threat detection quality', 'SIEM integration', 'incident response readiness'],
321
- },
322
- {
323
- key: 'logistics',
324
- label: 'Logistics',
325
- useWhen: 'Repos handling route optimization, fleet management, shipment tracking, or warehouse management systems.',
326
- adoption: 'Recommended when routing accuracy, fleet coordination, and tracking reliability are core product concerns.',
327
- recommendedModules: ['Route optimization guide', 'Fleet management review', 'Tracking system checks'],
328
- benchmarkFocus: ['routing accuracy', 'fleet coordination', 'tracking reliability'],
329
- },
330
- {
331
- key: 'media',
332
- label: 'Media',
333
- useWhen: 'Repos with CMS-driven publishing, digital asset management, content delivery pipelines, or editorial workflows.',
334
- adoption: 'Recommended when content management, asset lifecycle, and delivery pipelines are central to the product.',
335
- recommendedModules: ['Content management guide', 'Digital asset review', 'Content delivery checks'],
336
- benchmarkFocus: ['content management quality', 'asset lifecycle safety', 'delivery pipeline reliability'],
337
- },
338
- {
339
- key: 'social',
340
- label: 'Social',
341
- useWhen: 'Repos with feed algorithms, content moderation, real-time messaging, or social graph management.',
342
- adoption: 'Recommended when feed quality, moderation safety, and messaging reliability are core product concerns.',
343
- recommendedModules: ['Feed algorithm guide', 'Content moderation review', 'Messaging safety checks'],
344
- benchmarkFocus: ['feed algorithm quality', 'moderation effectiveness', 'messaging reliability'],
345
- },
346
- {
347
- key: 'travel',
348
- label: 'Travel',
349
- useWhen: 'Repos with booking engines, GDS integration, dynamic pricing, or travel inventory management.',
350
- adoption: 'Recommended when booking reliability, pricing accuracy, and GDS integration are primary concerns.',
351
- recommendedModules: ['Booking engine guide', 'GDS integration review', 'Pricing safety checks'],
352
- benchmarkFocus: ['booking reliability', 'GDS integration quality', 'pricing accuracy'],
353
- },
354
- {
355
- key: 'insurance',
356
- label: 'Insurance',
357
- useWhen: 'Repos handling claims processing, risk modeling, underwriting workflows, or policy management systems.',
358
- adoption: 'Recommended when claims accuracy, risk model integrity, and underwriting workflow safety are core concerns.',
359
- recommendedModules: ['Claims processing guide', 'Risk modeling review', 'Underwriting safety checks'],
360
- benchmarkFocus: ['claims processing accuracy', 'risk model integrity', 'underwriting safety'],
361
- },
362
- {
363
- key: 'energy',
364
- label: 'Energy',
365
- useWhen: 'Repos handling grid management, smart metering, renewable energy systems, or energy trading platforms.',
366
- adoption: 'Recommended when grid reliability, metering accuracy, and energy system integration are central concerns.',
367
- recommendedModules: ['Grid management guide', 'Smart metering review', 'Energy system checks'],
368
- benchmarkFocus: ['grid reliability', 'metering accuracy', 'energy system integration'],
369
- },
370
- ];
371
-
372
- const PLATFORM_DEFAULTS = {
373
- claude: {
374
- recommendedModules: ['CLAUDE.md baseline'],
375
- recommendedProposalFamilies: ['claude-md', 'commands', 'rules'],
376
- recommendedSurfaces: ['CLAUDE.md', '.claude/settings.json', '.github/workflows/'],
377
- recommendedMcpPacks: ['context7-docs'],
378
- },
379
- codex: {
380
- recommendedModules: ['AGENTS.md baseline', 'Codex config baseline'],
381
- recommendedProposalFamilies: ['codex-agents-md', 'codex-config', 'codex-ci-review'],
382
- recommendedSurfaces: ['AGENTS.md', '.codex/config.toml', '.github/workflows/'],
383
- },
384
- gemini: {
385
- recommendedModules: ['GEMINI.md baseline', 'Gemini settings baseline'],
386
- recommendedProposalFamilies: ['gemini-md', 'gemini-settings', 'gemini-hooks'],
387
- recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json', '.github/workflows/'],
388
- },
389
- copilot: {
390
- recommendedModules: ['copilot-instructions baseline', 'VS Code settings baseline'],
391
- recommendedProposalFamilies: ['copilot-instructions', 'copilot-vscode-settings', 'copilot-ci-review'],
392
- recommendedSurfaces: ['.github/copilot-instructions.md', '.vscode/settings.json', '.github/workflows/'],
393
- },
394
- cursor: {
395
- recommendedModules: ['.cursor/rules baseline', 'Cursor MCP baseline'],
396
- recommendedProposalFamilies: ['cursor-rules', 'cursor-mcp', 'cursor-ci-review'],
397
- recommendedSurfaces: ['.cursor/rules/', '.cursor/mcp.json', '.github/workflows/'],
398
- },
399
- windsurf: {
400
- recommendedModules: ['.windsurf/rules baseline', 'Windsurf MCP baseline'],
401
- recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp', 'windsurf-ci-review'],
402
- recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
403
- },
404
- aider: {
405
- recommendedModules: ['.aider.conf.yml baseline', 'Convention file starter'],
406
- recommendedProposalFamilies: ['aider-conf-yml', 'aider-conventions', 'aider-ci'],
407
- recommendedSurfaces: ['.aider.conf.yml', 'CONVENTIONS.md', '.github/workflows/'],
408
- },
409
- opencode: {
410
- recommendedModules: ['AGENTS.md baseline', 'OpenCode config baseline'],
411
- recommendedProposalFamilies: ['opencode-agents-md', 'opencode-config', 'opencode-ci'],
412
- recommendedSurfaces: ['AGENTS.md', 'opencode.json', '.github/workflows/'],
413
- },
414
- };
415
-
416
- function depMapKeys(deps) {
417
- return Object.keys(deps || {}).map((key) => key.toLowerCase());
418
- }
419
-
420
- function hasDependency(depKeys, matchers) {
421
- return depKeys.some((key) => matchers.some((matcher) => {
422
- if (typeof matcher === 'string') return key === matcher.toLowerCase();
423
- return matcher.test(key);
424
- }));
425
- }
426
-
427
- function hasAnyFile(files, pattern) {
428
- return files.some((file) => pattern.test(file));
429
- }
430
-
431
- function getFileContent(ctx, filePath) {
432
- return typeof ctx.fileContent === 'function' ? (ctx.fileContent(filePath) || '') : '';
433
- }
434
-
435
- function countComposeServices(content) {
436
- if (!content || !/^\s*services\s*:\s*$/m.test(content)) return 0;
437
- const lines = content.split(/\r?\n/);
438
- let inServices = false;
439
- let count = 0;
440
-
441
- for (const line of lines) {
442
- if (!inServices) {
443
- if (/^\s*services\s*:\s*$/.test(line)) {
444
- inServices = true;
445
- }
446
- continue;
447
- }
448
-
449
- if (!line.trim()) continue;
450
- if (/^\S/.test(line)) break;
451
- if (/^\s{2}[A-Za-z0-9_.-]+\s*:\s*$/.test(line)) count += 1;
452
- }
453
-
454
- return count;
455
- }
456
-
457
- function getManifestInfo(ctx, files) {
458
- const manifestPath = files.find((file) => /(^|\/)manifest\.json$/i.test(file));
459
- if (!manifestPath) return { path: null, content: '' };
460
- return { path: manifestPath, content: getFileContent(ctx, manifestPath) };
461
- }
462
-
463
- function getComposeInfo(ctx, files) {
464
- const composePath = files.find((file) => /(^|\/)(docker-compose|compose)\.ya?ml$/i.test(file));
465
- if (!composePath) return { path: null, services: 0 };
466
- const content = getFileContent(ctx, composePath);
467
- return { path: composePath, services: countComposeServices(content) };
468
- }
469
-
470
- function buildAdditionalDomainPacks(platform, options = {}) {
471
- const defaults = PLATFORM_DEFAULTS[platform];
472
- if (!defaults) {
473
- throw new Error(`Unknown domain-pack expansion platform '${platform}'`);
474
- }
475
-
476
- const existingKeys = options.existingKeys || new Set();
477
-
478
- return PACK_BLUEPRINTS
479
- .filter((pack) => !existingKeys.has(pack.key))
480
- .map((pack) => ({
481
- key: pack.key,
482
- label: pack.label,
483
- useWhen: pack.useWhen,
484
- adoption: pack.adoption,
485
- recommendedModules: [...defaults.recommendedModules, ...pack.recommendedModules.slice(0, 2)],
486
- recommendedProposalFamilies: defaults.recommendedProposalFamilies.slice(0, 3),
487
- recommendedSurfaces: defaults.recommendedSurfaces.slice(0, 3),
488
- benchmarkFocus: pack.benchmarkFocus.slice(0, 3),
489
- ...(defaults.recommendedMcpPacks ? { recommendedMcpPacks: defaults.recommendedMcpPacks.slice(0, 3) } : {}),
490
- }));
491
- }
492
-
493
- function detectAdditionalDomainPacks(options) {
494
- const {
495
- ctx,
496
- pkg = {},
497
- deps = {},
498
- stackKeys = new Set(),
499
- addMatch,
500
- hasBackend = false,
501
- hasFrontend = false,
502
- hasInfra = false,
503
- hasCi = false,
504
- } = options;
505
-
506
- const files = Array.isArray(ctx.files) ? ctx.files : [];
507
- const depKeys = depMapKeys(deps);
508
- const pkgBin = pkg && pkg.bin;
509
- const hasBinField = typeof pkgBin === 'string' || (pkgBin && typeof pkgBin === 'object' && Object.keys(pkgBin).length > 0);
510
- const manifest = getManifestInfo(ctx, files);
511
- const compose = getComposeInfo(ctx, files);
512
- const vercelConfig = getFileContent(ctx, 'vercel.json');
513
-
514
- if (
515
- hasAnyFile(files, /(^|\/)(hardhat\.config\.(js|ts)|truffle-config\.js|foundry\.toml)$/i) ||
516
- hasAnyFile(files, /\.sol$/i) ||
517
- hasDependency(depKeys, [/^hardhat$/i, /^truffle$/i, /^ethers$/i, /^viem$/i, /^@openzeppelin\//i])
518
- ) {
519
- addMatch('blockchain', [
520
- hasAnyFile(files, /\.sol$/i) ? 'Smart-contract source files detected.' : 'Blockchain toolchain files detected.',
521
- hasAnyFile(files, /foundry\.toml$/i) ? 'Foundry config detected.' : null,
522
- hasDependency(depKeys, [/^hardhat$/i]) ? 'Hardhat dependency detected.' : null,
523
- ]);
524
- }
525
-
526
- if (hasDependency(depKeys, [/^socket\.io$/i, /^socket\.io-client$/i, /^ws$/i, /^ably/i, /^pusher/i])) {
527
- addMatch('realtime', [
528
- 'Realtime communication dependencies detected.',
529
- hasDependency(depKeys, [/^socket\.io$/i, /^socket\.io-client$/i]) ? 'Socket.IO dependency detected.' : null,
530
- hasDependency(depKeys, [/^ws$/i]) ? 'WebSocket dependency detected.' : null,
531
- ]);
532
- }
533
-
534
- if (
535
- hasAnyFile(files, /(^|\/)(schema\.graphql|schema\.gql|.*\.graphqlrc(\.(json|ya?ml))?)$/i) ||
536
- hasDependency(depKeys, [/^graphql$/i, /^@apollo\//i, /^apollo-/i, /^urql$/i, /^relay/i])
537
- ) {
538
- addMatch('graphql', [
539
- hasAnyFile(files, /\.graphql$/i) ? 'GraphQL schema files detected.' : 'GraphQL tooling detected.',
540
- hasAnyFile(files, /\.graphqlrc/i) ? '.graphqlrc detected.' : null,
541
- hasDependency(depKeys, [/^@apollo\//i, /^apollo-/i]) ? 'Apollo dependency detected.' : null,
542
- ]);
543
- }
544
-
545
- if (
546
- hasAnyFile(files, /(^|\/)(serverless\.ya?ml|sam\.ya?ml)$/i) ||
547
- /"functions"\s*:\s*\{/i.test(vercelConfig) ||
548
- (hasInfra && hasAnyFile(files, /vercel\.json$/i))
549
- ) {
550
- addMatch('serverless', [
551
- hasAnyFile(files, /serverless\.ya?ml$/i) ? 'Serverless framework config detected.' : 'Function deployment config detected.',
552
- hasAnyFile(files, /sam\.ya?ml$/i) ? 'AWS SAM config detected.' : null,
553
- /"functions"\s*:\s*\{/i.test(vercelConfig) ? 'Vercel functions config detected.' : null,
554
- ]);
555
- }
556
-
557
- if (compose.services >= 3 || hasAnyFile(files, /\.proto$/i)) {
558
- addMatch('microservices', [
559
- compose.services >= 3 ? `Compose file defines ${compose.services} services.` : 'Protocol buffer contracts detected.',
560
- hasAnyFile(files, /\.proto$/i) ? 'Proto files detected.' : null,
561
- compose.path ? `${compose.path} detected.` : null,
562
- ]);
563
- }
564
-
565
- if (hasBinField && hasDependency(depKeys, [/^commander$/i, /^yargs$/i, /^oclif/i, /^cac$/i])) {
566
- addMatch('cli-tool', [
567
- 'CLI bin entry and command-parser dependencies detected.',
568
- hasDependency(depKeys, [/^commander$/i]) ? 'Commander dependency detected.' : null,
569
- hasDependency(depKeys, [/^yargs$/i]) ? 'Yargs dependency detected.' : null,
570
- ]);
571
- }
572
-
573
- if (manifest.path && /browser_specific_settings/i.test(manifest.content)) {
574
- addMatch('browser-ext', [
575
- 'Browser extension manifest detected.',
576
- `${manifest.path} contains browser_specific_settings.`,
577
- null,
578
- ]);
579
- }
580
-
581
- if (
582
- hasDependency(depKeys, [/^electron$/i, /^electron-builder$/i, /^@tauri-apps\//i, /^tauri$/i]) ||
583
- files.includes('tauri.conf.json') ||
584
- ctx.hasDir('src-tauri')
585
- ) {
586
- addMatch('desktop', [
587
- 'Desktop application framework signals detected.',
588
- ctx.hasDir('src-tauri') ? 'src-tauri directory detected.' : null,
589
- hasDependency(depKeys, [/^electron$/i]) ? 'Electron dependency detected.' : null,
590
- ]);
591
- }
592
-
593
- if (hasDependency(depKeys, [/^phaser$/i, /^three$/i, /^three\.js$/i, /^pixi\.js$/i, /^@pixi\//i])) {
594
- addMatch('game-dev', [
595
- 'Game-development rendering dependencies detected.',
596
- hasDependency(depKeys, [/^phaser$/i]) ? 'Phaser dependency detected.' : null,
597
- hasDependency(depKeys, [/^three$/i, /^three\.js$/i]) ? 'Three.js dependency detected.' : null,
598
- ]);
599
- }
600
-
601
- if (hasDependency(depKeys, [/^d3/i, /^chart\.js$/i, /^plotly/i, /^recharts$/i, /^visx/i])) {
602
- addMatch('data-viz', [
603
- 'Data-visualization dependencies detected.',
604
- hasDependency(depKeys, [/^d3/i]) ? 'D3 dependency detected.' : null,
605
- hasDependency(depKeys, [/^chart\.js$/i]) ? 'Chart.js dependency detected.' : null,
606
- ]);
607
- }
608
-
609
- if (hasDependency(depKeys, [/^strapi/i, /^contentful$/i, /^contentful-/i, /^sanity$/i, /^@sanity\//i])) {
610
- addMatch('cms', [
611
- 'CMS or content-platform dependencies detected.',
612
- hasDependency(depKeys, [/^strapi/i]) ? 'Strapi dependency detected.' : null,
613
- hasDependency(depKeys, [/^contentful/i]) ? 'Contentful dependency detected.' : null,
614
- ]);
615
- }
616
-
617
- if (
618
- hasDependency(depKeys, [/^jest$/i, /^vitest$/i, /^@playwright\/test$/i, /^playwright$/i]) ||
619
- hasAnyFile(files, /(^|\/)(jest\.config|vitest\.config|playwright\.config)\./i)
620
- ) {
621
- addMatch('testing-framework', [
622
- 'Primary test-framework signals detected.',
623
- hasDependency(depKeys, [/^jest$/i]) ? 'Jest dependency detected.' : null,
624
- hasDependency(depKeys, [/^vitest$/i]) ? 'Vitest dependency detected.' : null,
625
- ]);
626
- }
627
-
628
- if (
629
- hasDependency(depKeys, [/^vscode$/i, /^@types\/vscode$/i, /^webpack$/i, /^rollup$/i]) &&
630
- (pkg.engines && pkg.engines.vscode || hasAnyFile(files, /(^|\/)(extension\.(ts|js)|webpack\..*plugin\.(ts|js))$/i))
631
- ) {
632
- addMatch('devtools', [
633
- 'Developer-tooling integration signals detected.',
634
- pkg.engines && pkg.engines.vscode ? 'VS Code extension engine declared.' : null,
635
- hasAnyFile(files, /extension\.(ts|js)$/i) ? 'Extension entrypoint detected.' : null,
636
- ]);
637
- }
638
-
639
- if (hasDependency(depKeys, [/^passport$/i, /^passport-/i, /^auth0$/i, /^@auth0\//i, /^@clerk\//i, /^clerk$/i])) {
640
- addMatch('auth-service', [
641
- 'Authentication-platform dependencies detected.',
642
- hasDependency(depKeys, [/^passport$/i, /^passport-/i]) ? 'Passport dependency detected.' : null,
643
- hasDependency(depKeys, [/^@clerk\//i, /^clerk$/i]) ? 'Clerk dependency detected.' : null,
644
- ]);
645
- }
646
-
647
- if (
648
- hasDependency(depKeys, [/^stripe$/i, /^@stripe\//i, /^paypal$/i, /^@paypal\//i, /^braintree$/i]) ||
649
- ctx.hasDir('payments')
650
- ) {
651
- addMatch('payments', [
652
- 'Payment-platform signals detected.',
653
- hasDependency(depKeys, [/^stripe$/i, /^@stripe\//i]) ? 'Stripe dependency detected.' : null,
654
- hasDependency(depKeys, [/^paypal$/i, /^@paypal\//i]) ? 'PayPal dependency detected.' : null,
655
- ]);
656
- }
657
-
658
- if (hasDependency(depKeys, [/^@sendgrid\//i, /^nodemailer$/i, /^ses$/i, /^@aws-sdk\/client-ses$/i, /^twilio$/i])) {
659
- addMatch('notifications', [
660
- 'Notification-channel dependencies detected.',
661
- hasDependency(depKeys, [/^@sendgrid\//i]) ? 'SendGrid dependency detected.' : null,
662
- hasDependency(depKeys, [/^twilio$/i]) ? 'Twilio dependency detected.' : null,
663
- ]);
664
- }
665
-
666
- if (hasDependency(depKeys, [/^@elastic\/elasticsearch$/i, /^elasticsearch$/i, /^algoliasearch$/i, /^meilisearch$/i])) {
667
- addMatch('search', [
668
- 'Search-platform dependencies detected.',
669
- hasDependency(depKeys, [/^@elastic\/elasticsearch$/i, /^elasticsearch$/i]) ? 'Elasticsearch dependency detected.' : null,
670
- hasDependency(depKeys, [/^algoliasearch$/i]) ? 'Algolia dependency detected.' : null,
671
- ]);
672
- }
673
-
674
- if (hasDependency(depKeys, [/^bull$/i, /^bullmq$/i, /^amqplib$/i, /^rabbitmq$/i, /^@aws-sdk\/client-sqs$/i, /^sqs-consumer$/i])) {
675
- addMatch('queue-worker', [
676
- 'Queue or worker dependencies detected.',
677
- hasDependency(depKeys, [/^bull$/i, /^bullmq$/i]) ? 'Bull/BullMQ dependency detected.' : null,
678
- hasDependency(depKeys, [/^amqplib$/i, /^rabbitmq$/i]) ? 'RabbitMQ dependency detected.' : null,
679
- ]);
680
- }
681
-
682
- if (hasDependency(depKeys, [/^winston$/i, /^pino$/i, /^datadog$/i, /^dd-trace$/i, /^@datadog\//i])) {
683
- addMatch('observability', [
684
- 'Observability dependencies detected.',
685
- hasDependency(depKeys, [/^winston$/i]) ? 'Winston dependency detected.' : null,
686
- hasDependency(depKeys, [/^pino$/i]) ? 'Pino dependency detected.' : null,
687
- ]);
688
- }
689
-
690
- if (hasDependency(depKeys, [/^i18next$/i, /^react-intl$/i, /^formatjs$/i, /^next-intl$/i]) || ctx.hasDir('locales')) {
691
- addMatch('i18n', [
692
- 'Internationalization signals detected.',
693
- ctx.hasDir('locales') ? 'Locales directory detected.' : null,
694
- hasDependency(depKeys, [/^i18next$/i]) ? 'i18next dependency detected.' : null,
695
- ]);
696
- }
697
-
698
- if (
699
- hasDependency(depKeys, [/^gatsby$/i, /^@11ty\/eleventy$/i, /^hugo-bin$/i, /^jekyll$/i]) ||
700
- hasAnyFile(files, /(^|\/)(hugo\.toml|_config\.yml|_config\.yaml|gatsby-config\.(js|ts)|eleventy\.config\.(js|cjs|mjs))$/i)
701
- ) {
702
- addMatch('static-site', [
703
- 'Static-site generator signals detected.',
704
- hasDependency(depKeys, [/^gatsby$/i]) ? 'Gatsby dependency detected.' : null,
705
- hasAnyFile(files, /(^|\/)(hugo\.toml|_config\.yml|_config\.yaml)$/i) ? 'Static-site config detected.' : null,
706
- ]);
707
- }
708
-
709
- if (
710
- hasDependency(depKeys, [/^kong$/i, /^express-gateway$/i]) ||
711
- hasAnyFile(files, /(^|\/)(kong\.ya?ml|gateway\.config\.(json|ya?ml))$/i)
712
- ) {
713
- addMatch('api-gateway', [
714
- 'API-gateway signals detected.',
715
- hasDependency(depKeys, [/^express-gateway$/i]) ? 'express-gateway dependency detected.' : null,
716
- hasAnyFile(files, /kong\.ya?ml$/i) ? 'Kong config detected.' : null,
717
- ]);
718
- }
719
-
720
- if (
721
- hasDependency(depKeys, [/^mlflow$/i, /^wandb$/i, /^dvc$/i]) ||
722
- hasAnyFile(files, /(^|\/)(dvc\.yaml|dvc\.yml|mlruns\/|wandb\/)/i)
723
- ) {
724
- addMatch('ml-ops', [
725
- 'ML Ops tracking or artifact signals detected.',
726
- hasDependency(depKeys, [/^mlflow$/i]) ? 'MLflow dependency detected.' : null,
727
- hasDependency(depKeys, [/^wandb$/i]) ? 'Weights & Biases dependency detected.' : null,
728
- ]);
729
- }
730
-
731
- if (
732
- hasDependency(depKeys, [/^johnny-five$/i, /^mqtt$/i, /^particle-/i, /^particle$/i]) ||
733
- hasAnyFile(files, /\.ino$/i)
734
- ) {
735
- addMatch('embedded-iot', [
736
- 'Embedded or device-integration signals detected.',
737
- hasDependency(depKeys, [/^mqtt$/i]) ? 'MQTT dependency detected.' : null,
738
- hasDependency(depKeys, [/^johnny-five$/i]) ? 'Johnny-Five dependency detected.' : null,
739
- ]);
740
- }
741
-
742
- // Healthcare detection
743
- if (
744
- hasDependency(depKeys, [/^fhir/i, /^hl7/i, /^@medplum\//i, /^hapi-fhir/i]) ||
745
- ctx.hasDir('hipaa') || ctx.hasDir('phi') || ctx.hasDir('medical') || ctx.hasDir('patients') ||
746
- hasAnyFile(files, /(^|\/)(hipaa|fhir|hl7)/i)
747
- ) {
748
- addMatch('healthcare', [
749
- 'Healthcare or clinical data signals detected.',
750
- hasDependency(depKeys, [/^fhir/i, /^hl7/i]) ? 'FHIR/HL7 dependency detected.' : null,
751
- ctx.hasDir('patients') ? 'Patients directory detected.' : null,
752
- ]);
753
- }
754
-
755
- // Fintech detection
756
- if (
757
- hasDependency(depKeys, [/^plaid$/i, /^@plaid\//i, /^dwolla$/i, /^alpaca/i, /^polygon\.io/i]) ||
758
- ctx.hasDir('kyc') || ctx.hasDir('aml') || ctx.hasDir('transactions') ||
759
- (pkg.keywords && pkg.keywords.some(k => ['fintech', 'pci-dss', 'kyc', 'aml'].includes(k)))
760
- ) {
761
- addMatch('fintech', [
762
- 'Fintech or financial compliance signals detected.',
763
- hasDependency(depKeys, [/^plaid$/i, /^@plaid\//i]) ? 'Plaid dependency detected.' : null,
764
- ctx.hasDir('transactions') ? 'Transactions directory detected.' : null,
765
- ]);
766
- }
767
-
768
- // Gaming detection
769
- if (
770
- hasDependency(depKeys, [/^unity/i, /^godot/i, /^kaboom/i, /^excalibur/i, /^playcanvas/i, /^babylonjs/i, /^@babylonjs\//i]) ||
771
- ctx.hasDir('sprites') || ctx.hasDir('assets/sprites') || ctx.hasDir('scenes') ||
772
- hasAnyFile(files, /(^|\/)(game\.config|game\.json|\.gdproject|\.uproject)/i)
773
- ) {
774
- addMatch('gaming', [
775
- 'Game development signals detected.',
776
- ctx.hasDir('sprites') ? 'Sprites directory detected.' : null,
777
- ctx.hasDir('scenes') ? 'Scenes directory detected.' : null,
778
- ]);
779
- }
780
-
781
- // IoT detection
782
- if (
783
- hasDependency(depKeys, [/^mqtt$/i, /^async-mqtt$/i, /^aws-iot-device-sdk/i, /^azure-iot/i, /^node-red/i]) ||
784
- ctx.hasDir('sensors') || ctx.hasDir('devices') || ctx.hasDir('firmware') ||
785
- hasAnyFile(files, /(^|\/)(mosquitto\.conf|iot|sensors)/i)
786
- ) {
787
- addMatch('iot', [
788
- 'IoT or sensor data signals detected.',
789
- hasDependency(depKeys, [/^mqtt$/i, /^async-mqtt$/i]) ? 'MQTT dependency detected.' : null,
790
- ctx.hasDir('sensors') ? 'Sensors directory detected.' : null,
791
- ]);
792
- }
793
-
794
- // Streaming detection
795
- if (
796
- hasDependency(depKeys, [/^fluent-ffmpeg$/i, /^hls\.js$/i, /^dash\.js$/i, /^shaka-player$/i, /^video\.js$/i, /^mux/i, /^@mux\//i, /^cloudinary/i]) ||
797
- ctx.hasDir('transcode') || ctx.hasDir('streams') ||
798
- hasAnyFile(files, /(^|\/)(ffmpeg|transcode|hls|dash)/i)
799
- ) {
800
- addMatch('streaming', [
801
- 'Media streaming signals detected.',
802
- hasDependency(depKeys, [/^fluent-ffmpeg$/i]) ? 'FFmpeg dependency detected.' : null,
803
- hasDependency(depKeys, [/^hls\.js$/i, /^dash\.js$/i]) ? 'Adaptive bitrate streaming dependency detected.' : null,
804
- ]);
805
- }
806
-
807
- // Robotics detection
808
- if (
809
- hasDependency(depKeys, [/^rosnodejs$/i, /^rclnodejs$/i, /^roslib$/i, /^ros2/i]) ||
810
- ctx.hasDir('ros') || ctx.hasDir('catkin_ws') || ctx.hasDir('robot') ||
811
- hasAnyFile(files, /(^|\/)(CMakeLists\.txt|package\.xml|\.launch)/i) && ctx.hasDir('src')
812
- ) {
813
- addMatch('robotics', [
814
- 'Robotics or ROS signals detected.',
815
- hasDependency(depKeys, [/^rosnodejs$/i, /^rclnodejs$/i]) ? 'ROS dependency detected.' : null,
816
- ctx.hasDir('catkin_ws') ? 'Catkin workspace detected.' : null,
817
- ]);
818
- }
819
-
820
- // AR/VR detection
821
- if (
822
- hasDependency(depKeys, [/^aframe$/i, /^@react-three\/xr$/i, /^webxr/i, /^@babylonjs\/core$/i, /^ar\.js$/i, /^mind-ar/i, /^8thwall/i]) ||
823
- ctx.hasDir('xr') || ctx.hasDir('vr') || ctx.hasDir('ar') ||
824
- hasAnyFile(files, /(^|\/)(.xr|spatial|immersive)/i)
825
- ) {
826
- addMatch('ar-vr', [
827
- 'AR/VR or spatial computing signals detected.',
828
- hasDependency(depKeys, [/^aframe$/i]) ? 'A-Frame dependency detected.' : null,
829
- hasDependency(depKeys, [/^@react-three\/xr$/i]) ? 'React Three XR dependency detected.' : null,
830
- ]);
831
- }
832
-
833
- // Climate Tech detection
834
- if (
835
- hasDependency(depKeys, [/^carbon/i, /^climatiq/i, /^patch-node$/i, /^@cloverly\//i]) ||
836
- ctx.hasDir('emissions') || ctx.hasDir('carbon') || ctx.hasDir('esg') ||
837
- (pkg.keywords && pkg.keywords.some(k => ['carbon', 'climate', 'esg', 'sustainability', 'emissions'].includes(k)))
838
- ) {
839
- addMatch('climate-tech', [
840
- 'Climate tech or sustainability signals detected.',
841
- ctx.hasDir('emissions') ? 'Emissions directory detected.' : null,
842
- ctx.hasDir('esg') ? 'ESG directory detected.' : null,
843
- ]);
844
- }
845
-
846
- // GovTech detection
847
- if (
848
- hasDependency(depKeys, [/^pa11y$/i, /^axe-core$/i, /^@axe-core\//i, /^react-aria/i, /^@react-aria\//i]) ||
849
- ctx.hasDir('audit-logs') || ctx.hasDir('accessibility') ||
850
- (pkg.keywords && pkg.keywords.some(k => ['government', 'govtech', 'a11y', 'wcag', 'section508'].includes(k)))
851
- ) {
852
- addMatch('govtech', [
853
- 'Government technology or accessibility compliance signals detected.',
854
- hasDependency(depKeys, [/^axe-core$/i, /^@axe-core\//i]) ? 'Axe accessibility dependency detected.' : null,
855
- ctx.hasDir('audit-logs') ? 'Audit logs directory detected.' : null,
856
- ]);
857
- }
858
-
859
- // EdTech detection
860
- if (
861
- hasDependency(depKeys, [/^scorm/i, /^xapi/i, /^lti/i, /^@canvas\//i]) ||
862
- ctx.hasDir('courses') || ctx.hasDir('assessments') || ctx.hasDir('curriculum') || ctx.hasDir('lms') ||
863
- (pkg.keywords && pkg.keywords.some(k => ['edtech', 'lms', 'elearning', 'assessment'].includes(k)))
864
- ) {
865
- addMatch('edtech', [
866
- 'EdTech or learning management signals detected.',
867
- ctx.hasDir('courses') ? 'Courses directory detected.' : null,
868
- ctx.hasDir('assessments') ? 'Assessments directory detected.' : null,
869
- ]);
870
- }
871
-
872
- // MarTech detection
873
- if (
874
- hasDependency(depKeys, [/^@segment\//i, /^segment/i, /^mixpanel$/i, /^amplitude/i, /^optimizely/i, /^@optimizely\//i, /^launchdarkly/i, /^@launchdarkly\//i]) ||
875
- ctx.hasDir('analytics') || ctx.hasDir('experiments') || ctx.hasDir('personalization') ||
876
- hasAnyFile(files, /(^|\/)(segment|analytics|ab-test)/i)
877
- ) {
878
- addMatch('martech', [
879
- 'Marketing technology or analytics signals detected.',
880
- hasDependency(depKeys, [/^@segment\//i, /^segment/i]) ? 'Segment dependency detected.' : null,
881
- hasDependency(depKeys, [/^optimizely/i, /^@optimizely\//i]) ? 'Optimizely dependency detected.' : null,
882
- ]);
883
- }
884
-
885
- // PropTech detection
886
- if (
887
- hasDependency(depKeys, [/^turf$/i, /^@turf\//i, /^mapbox/i, /^@mapbox\//i, /^leaflet$/i, /^openlayers/i]) ||
888
- ctx.hasDir('properties') || ctx.hasDir('geospatial') || ctx.hasDir('buildings') ||
889
- (pkg.keywords && pkg.keywords.some(k => ['proptech', 'real-estate', 'geospatial', 'property'].includes(k)))
890
- ) {
891
- addMatch('proptech', [
892
- 'Property technology or geospatial signals detected.',
893
- hasDependency(depKeys, [/^@turf\//i, /^turf$/i]) ? 'Turf.js geospatial dependency detected.' : null,
894
- hasDependency(depKeys, [/^mapbox/i, /^@mapbox\//i]) ? 'Mapbox dependency detected.' : null,
895
- ]);
896
- }
897
-
898
- // LegalTech detection
899
- if (
900
- hasDependency(depKeys, [/^docusign/i, /^@docusign\//i, /^docassemble/i, /^clio/i]) ||
901
- ctx.hasDir('contracts') || ctx.hasDir('legal') || ctx.hasDir('compliance') || ctx.hasDir('discovery') ||
902
- (pkg.keywords && pkg.keywords.some(k => ['legaltech', 'legal', 'compliance', 'e-discovery', 'ediscovery'].includes(k)))
903
- ) {
904
- addMatch('legaltech', [
905
- 'Legal technology or compliance signals detected.',
906
- hasDependency(depKeys, [/^docusign/i, /^@docusign\//i]) ? 'DocuSign dependency detected.' : null,
907
- ctx.hasDir('contracts') ? 'Contracts directory detected.' : null,
908
- ]);
909
- }
910
-
911
- // AgriTech detection
912
- if (
913
- hasDependency(depKeys, [/^agworld/i, /^farmos/i, /^cropsar/i]) ||
914
- ctx.hasDir('crops') || ctx.hasDir('farm') || ctx.hasDir('agriculture') || ctx.hasDir('harvest') ||
915
- (pkg.keywords && pkg.keywords.some(k => ['agritech', 'agriculture', 'farming', 'crop', 'precision-agriculture'].includes(k)))
916
- ) {
917
- addMatch('agritech', [
918
- 'Agricultural technology signals detected.',
919
- ctx.hasDir('crops') ? 'Crops directory detected.' : null,
920
- ctx.hasDir('farm') ? 'Farm directory detected.' : null,
921
- ]);
922
- }
923
-
924
- // BioTech detection
925
- if (
926
- hasDependency(depKeys, [/^bionode/i, /^bioinformatics/i, /^@biom3\//i, /^openbabel/i]) ||
927
- ctx.hasDir('bioinformatics') || ctx.hasDir('lab') || ctx.hasDir('sequences') || ctx.hasDir('genomics') ||
928
- hasAnyFile(files, /(^|\/)(\.fasta|\.fastq|\.vcf|\.bam|\.sam)/i)
929
- ) {
930
- addMatch('biotech', [
931
- 'Biotech or bioinformatics signals detected.',
932
- ctx.hasDir('genomics') ? 'Genomics directory detected.' : null,
933
- hasAnyFile(files, /(\.fasta|\.fastq|\.vcf)/i) ? 'Bioinformatics data files detected.' : null,
934
- ]);
935
- }
936
-
937
- // Cybersecurity detection
938
- if (
939
- hasDependency(depKeys, [/^snort/i, /^suricata/i, /^zeek/i, /^wazuh/i, /^elastic-siem/i, /^splunk/i, /^@elastic\/elasticsearch$/i]) ||
940
- ctx.hasDir('threats') || ctx.hasDir('incidents') || ctx.hasDir('siem') || ctx.hasDir('detection-rules') ||
941
- (pkg.keywords && pkg.keywords.some(k => ['cybersecurity', 'siem', 'threat-detection', 'incident-response'].includes(k)))
942
- ) {
943
- addMatch('cybersecurity', [
944
- 'Cybersecurity or threat detection signals detected.',
945
- ctx.hasDir('detection-rules') ? 'Detection rules directory detected.' : null,
946
- ctx.hasDir('incidents') ? 'Incidents directory detected.' : null,
947
- ]);
948
- }
949
-
950
- // Logistics detection
951
- if (
952
- hasDependency(depKeys, [/^graphhopper/i, /^osrm/i, /^mapbox-directions/i, /^@googlemaps\//i]) ||
953
- ctx.hasDir('routes') || ctx.hasDir('fleet') || ctx.hasDir('shipments') || ctx.hasDir('warehouse') ||
954
- (pkg.keywords && pkg.keywords.some(k => ['logistics', 'fleet', 'routing', 'shipment', 'warehouse'].includes(k)))
955
- ) {
956
- addMatch('logistics', [
957
- 'Logistics or fleet management signals detected.',
958
- ctx.hasDir('fleet') ? 'Fleet directory detected.' : null,
959
- ctx.hasDir('shipments') ? 'Shipments directory detected.' : null,
960
- ]);
961
- }
962
-
963
- // Media detection
964
- if (
965
- hasDependency(depKeys, [/^keystonejs/i, /^@keystonejs\//i, /^ghost/i, /^@tryghost\//i, /^wordpress/i, /^tinymce/i]) ||
966
- ctx.hasDir('editorial') || ctx.hasDir('dam') || ctx.hasDir('assets/media') || ctx.hasDir('publications') ||
967
- (pkg.keywords && pkg.keywords.some(k => ['media', 'publishing', 'editorial', 'digital-asset'].includes(k)))
968
- ) {
969
- addMatch('media', [
970
- 'Media or digital publishing signals detected.',
971
- hasDependency(depKeys, [/^keystonejs/i, /^@keystonejs\//i]) ? 'KeystoneJS CMS detected.' : null,
972
- ctx.hasDir('editorial') ? 'Editorial directory detected.' : null,
973
- ]);
974
- }
975
-
976
- // Social detection
977
- if (
978
- hasDependency(depKeys, [/^stream-chat/i, /^@stream-io\//i, /^getstream/i, /^socket\.io$/i, /^perspective-api/i]) ||
979
- ctx.hasDir('feed') || ctx.hasDir('moderation') || ctx.hasDir('messaging') || ctx.hasDir('social') ||
980
- (pkg.keywords && pkg.keywords.some(k => ['social', 'feed', 'moderation', 'messaging', 'community'].includes(k)))
981
- ) {
982
- addMatch('social', [
983
- 'Social platform signals detected.',
984
- ctx.hasDir('feed') ? 'Feed directory detected.' : null,
985
- ctx.hasDir('moderation') ? 'Moderation directory detected.' : null,
986
- ]);
987
- }
988
-
989
- // Travel detection
990
- if (
991
- hasDependency(depKeys, [/^amadeus/i, /^sabre/i, /^travelport/i, /^booking/i, /^skyscanner/i]) ||
992
- ctx.hasDir('bookings') || ctx.hasDir('reservations') || ctx.hasDir('itineraries') || ctx.hasDir('pricing') ||
993
- (pkg.keywords && pkg.keywords.some(k => ['travel', 'booking', 'gds', 'hospitality', 'reservation'].includes(k)))
994
- ) {
995
- addMatch('travel', [
996
- 'Travel or booking platform signals detected.',
997
- hasDependency(depKeys, [/^amadeus/i]) ? 'Amadeus GDS dependency detected.' : null,
998
- ctx.hasDir('bookings') ? 'Bookings directory detected.' : null,
999
- ]);
1000
- }
1001
-
1002
- // Insurance detection
1003
- if (
1004
- hasDependency(depKeys, [/^guidewire/i, /^duck-creek/i, /^actuarial/i, /^socotra/i]) ||
1005
- ctx.hasDir('claims') || ctx.hasDir('underwriting') || ctx.hasDir('policies') || ctx.hasDir('risk-models') ||
1006
- (pkg.keywords && pkg.keywords.some(k => ['insurance', 'insurtech', 'claims', 'underwriting', 'actuarial'].includes(k)))
1007
- ) {
1008
- addMatch('insurance', [
1009
- 'Insurance or risk management signals detected.',
1010
- ctx.hasDir('claims') ? 'Claims directory detected.' : null,
1011
- ctx.hasDir('underwriting') ? 'Underwriting directory detected.' : null,
1012
- ]);
1013
- }
1014
-
1015
- // Energy detection
1016
- if (
1017
- hasDependency(depKeys, [/^openadr/i, /^green-button/i, /^iec61850/i, /^modbus/i, /^opc-ua/i]) ||
1018
- ctx.hasDir('grid') || ctx.hasDir('metering') || ctx.hasDir('energy') || ctx.hasDir('renewables') ||
1019
- (pkg.keywords && pkg.keywords.some(k => ['energy', 'smart-grid', 'metering', 'renewable', 'utility'].includes(k)))
1020
- ) {
1021
- addMatch('energy', [
1022
- 'Energy or grid management signals detected.',
1023
- ctx.hasDir('grid') ? 'Grid directory detected.' : null,
1024
- ctx.hasDir('metering') ? 'Metering directory detected.' : null,
1025
- ]);
1026
- }
1027
- }
1028
-
1029
- module.exports = {
1030
- PACK_BLUEPRINTS,
1031
- buildAdditionalDomainPacks,
1032
- detectAdditionalDomainPacks,
1033
- };
1
+ const PACK_BLUEPRINTS = [
2
+ {
3
+ key: 'blockchain',
4
+ label: 'Blockchain',
5
+ useWhen: 'Repos with smart contracts, wallet logic, chain integrations, or on-chain deployment tooling.',
6
+ adoption: 'Recommended when contract review, deployment safety, and chain-specific build workflows are core to the repo.',
7
+ recommendedModules: ['Contract review guide', 'Wallet and secret safety', 'Deployment verification'],
8
+ benchmarkFocus: ['contract-aware verification', 'wallet and secret safety', 'deployment review'],
9
+ },
10
+ {
11
+ key: 'realtime',
12
+ label: 'Realtime',
13
+ useWhen: 'Repos centered on websockets, live collaboration, presence, or push-driven event flows.',
14
+ adoption: 'Recommended when event delivery, connection lifecycle, and concurrency behavior matter as much as CRUD flows.',
15
+ recommendedModules: ['Event flow guide', 'Connection lifecycle checks', 'Delivery and retry posture'],
16
+ benchmarkFocus: ['live event safety', 'connection lifecycle review', 'delivery resilience'],
17
+ },
18
+ {
19
+ key: 'graphql',
20
+ label: 'GraphQL',
21
+ useWhen: 'Repos with GraphQL schemas, resolvers, or GraphQL-first clients and services.',
22
+ adoption: 'Recommended when schema contracts and resolver changes need stronger review and verification loops.',
23
+ recommendedModules: ['Schema contract guide', 'Resolver verification', 'Client-server contract checks'],
24
+ benchmarkFocus: ['schema safety', 'resolver correctness', 'contract review'],
25
+ },
26
+ {
27
+ key: 'serverless',
28
+ label: 'Serverless',
29
+ useWhen: 'Repos built around functions, lambdas, edge handlers, or platform-managed deployment surfaces.',
30
+ adoption: 'Recommended when deployment packaging, environment isolation, and runtime constraints drive the workflow.',
31
+ recommendedModules: ['Function deployment guide', 'Cold-start aware verification', 'Environment isolation checklist'],
32
+ benchmarkFocus: ['deployment safety', 'runtime fit', 'environment isolation'],
33
+ },
34
+ {
35
+ key: 'microservices',
36
+ label: 'Microservices',
37
+ useWhen: 'Repos coordinating several services, contracts, or inter-service boundaries across a shared system.',
38
+ adoption: 'Recommended when service boundaries, orchestration, and contract compatibility need stronger guardrails.',
39
+ recommendedModules: ['Service boundary guide', 'Contract and proto review', 'Multi-service orchestration checks'],
40
+ benchmarkFocus: ['service-boundary safety', 'contract review', 'multi-service coordination'],
41
+ },
42
+ {
43
+ key: 'cli-tool',
44
+ label: 'CLI Tool',
45
+ useWhen: 'Repos whose primary product surface is a terminal command, scaffolder, or developer-facing CLI.',
46
+ adoption: 'Recommended when command UX, flags, help text, and packaging are part of the product contract.',
47
+ recommendedModules: ['CLI UX guide', 'Flag and help contract', 'Distribution checklist'],
48
+ benchmarkFocus: ['command UX quality', 'flag safety', 'distribution readiness'],
49
+ },
50
+ {
51
+ key: 'browser-ext',
52
+ label: 'Browser Extension',
53
+ useWhen: 'Repos shipping browser extensions, add-ons, or extension-like surfaces with manifest-driven permissions.',
54
+ adoption: 'Recommended when manifest review, permission minimization, and cross-browser packaging are central concerns.',
55
+ recommendedModules: ['Extension manifest guide', 'Permission review', 'Store packaging checklist'],
56
+ benchmarkFocus: ['manifest safety', 'permission posture', 'store packaging readiness'],
57
+ },
58
+ {
59
+ key: 'desktop',
60
+ label: 'Desktop App',
61
+ useWhen: 'Repos shipping desktop software through Electron, Tauri, or similar native-shell frameworks.',
62
+ adoption: 'Recommended when native bridges, packaging, and OS-specific release workflows shape the repo.',
63
+ recommendedModules: ['Desktop packaging guide', 'Native bridge safety', 'Cross-platform release checks'],
64
+ benchmarkFocus: ['native-surface safety', 'packaging quality', 'cross-platform release readiness'],
65
+ },
66
+ {
67
+ key: 'game-dev',
68
+ label: 'Game Development',
69
+ useWhen: 'Repos focused on gameplay loops, rendering, scenes, or asset-heavy interactive experiences.',
70
+ adoption: 'Recommended when performance, asset pipelines, and engine-specific workflows dominate the repo.',
71
+ recommendedModules: ['Asset pipeline guide', 'Render loop safety', 'Performance regression checks'],
72
+ benchmarkFocus: ['render-loop safety', 'asset pipeline quality', 'performance regressions'],
73
+ },
74
+ {
75
+ key: 'data-viz',
76
+ label: 'Data Visualization',
77
+ useWhen: 'Repos centered on charts, dashboards, visual analytics, or data-heavy rendering surfaces.',
78
+ adoption: 'Recommended when chart correctness, data transforms, and rendering fidelity are core product risks.',
79
+ recommendedModules: ['Chart correctness guide', 'Dataset transformation review', 'Render performance checks'],
80
+ benchmarkFocus: ['visual correctness', 'data-transform review', 'render performance'],
81
+ },
82
+ {
83
+ key: 'cms',
84
+ label: 'CMS',
85
+ useWhen: 'Repos driven by structured content, headless CMS models, authoring flows, or publishing pipelines.',
86
+ adoption: 'Recommended when content modeling, preview, and publish behavior need stronger workflow guidance.',
87
+ recommendedModules: ['Content model guide', 'Authoring workflow review', 'Preview and publish checks'],
88
+ benchmarkFocus: ['content-model safety', 'authoring workflow quality', 'publish readiness'],
89
+ },
90
+ {
91
+ key: 'testing-framework',
92
+ label: 'Testing Framework',
93
+ useWhen: 'Repos where the main engineering loop is defined by a first-class test runner and CI test discipline.',
94
+ adoption: 'Recommended when test ergonomics, coverage, and CI parity are foundational to the repo workflow.',
95
+ recommendedModules: ['Test runner baseline', 'Coverage and flake control', 'CI test parity'],
96
+ benchmarkFocus: ['test-loop quality', 'coverage posture', 'CI parity'],
97
+ },
98
+ {
99
+ key: 'devtools',
100
+ label: 'Developer Tools',
101
+ useWhen: 'Repos building plugins, editor extensions, bundler plugins, or other developer-facing tooling.',
102
+ adoption: 'Recommended when extension APIs, integration contracts, and distribution workflows matter to product quality.',
103
+ recommendedModules: ['Developer-tool integration guide', 'Extension/plugin API review', 'Distribution checks'],
104
+ benchmarkFocus: ['integration safety', 'API compatibility', 'distribution readiness'],
105
+ },
106
+ {
107
+ key: 'auth-service',
108
+ label: 'Auth Service',
109
+ useWhen: 'Repos centered on authentication, identity, session issuance, or user access management.',
110
+ adoption: 'Recommended when auth boundaries, token handling, and identity-provider integrations are primary concerns.',
111
+ recommendedModules: ['Auth boundary guide', 'Session/token review', 'Identity-provider integration checks'],
112
+ benchmarkFocus: ['auth-boundary safety', 'session and token review', 'identity-provider fit'],
113
+ },
114
+ {
115
+ key: 'payments',
116
+ label: 'Payments',
117
+ useWhen: 'Repos where billing, subscriptions, checkout, or payment-provider integrations are the core workflow.',
118
+ adoption: 'Recommended when money movement, webhooks, and retry semantics are product-critical.',
119
+ recommendedModules: ['Payment flow guide', 'Webhook and retry review', 'Financial safety checks'],
120
+ benchmarkFocus: ['payment-flow safety', 'webhook correctness', 'financial guardrails'],
121
+ },
122
+ {
123
+ key: 'notifications',
124
+ label: 'Notifications',
125
+ useWhen: 'Repos whose product flows depend on email, SMS, push, or multi-channel user notifications.',
126
+ adoption: 'Recommended when delivery channels, templates, and retry policies drive the system behavior.',
127
+ recommendedModules: ['Delivery channel guide', 'Template lifecycle review', 'Retry and rate-limit checks'],
128
+ benchmarkFocus: ['delivery reliability', 'template quality', 'retry posture'],
129
+ },
130
+ {
131
+ key: 'search',
132
+ label: 'Search',
133
+ useWhen: 'Repos built around search indexing, query relevance, or external search infrastructure.',
134
+ adoption: 'Recommended when indexing, ranking, and synchronization between source data and search need stronger review.',
135
+ recommendedModules: ['Indexing guide', 'Query relevance review', 'Sync and backfill checks'],
136
+ benchmarkFocus: ['indexing safety', 'relevance quality', 'sync correctness'],
137
+ },
138
+ {
139
+ key: 'queue-worker',
140
+ label: 'Queue Worker',
141
+ useWhen: 'Repos organized around job queues, background workers, retries, or asynchronous orchestration.',
142
+ adoption: 'Recommended when idempotency, retries, and worker operational safety define the workflow.',
143
+ recommendedModules: ['Queue processing guide', 'Retry and idempotency review', 'Worker scaling checks'],
144
+ benchmarkFocus: ['job safety', 'retry correctness', 'worker scalability'],
145
+ },
146
+ {
147
+ key: 'observability',
148
+ label: 'Observability',
149
+ useWhen: 'Repos where logs, traces, metrics, or platform telemetry are a first-class operating surface.',
150
+ adoption: 'Recommended when log quality, telemetry coverage, and alertability are central to production readiness.',
151
+ recommendedModules: ['Logging and telemetry guide', 'Error-tracing review', 'Alertability checks'],
152
+ benchmarkFocus: ['telemetry coverage', 'traceability', 'alert readiness'],
153
+ },
154
+ {
155
+ key: 'i18n',
156
+ label: 'Internationalization',
157
+ useWhen: 'Repos with locale files, translation workflows, or runtime language switching as a product feature.',
158
+ adoption: 'Recommended when fallback behavior, message keys, and translation coverage shape the user experience.',
159
+ recommendedModules: ['Locale and message guide', 'Fallback coverage', 'Translation workflow checks'],
160
+ benchmarkFocus: ['translation coverage', 'fallback safety', 'message-key consistency'],
161
+ },
162
+ {
163
+ key: 'static-site',
164
+ label: 'Static Site',
165
+ useWhen: 'Repos generating static documentation, marketing, blog, or content-first sites.',
166
+ adoption: 'Recommended when content builds, routing, and publishing pipelines dominate the workflow.',
167
+ recommendedModules: ['Content build guide', 'Template and routing review', 'Publish pipeline checks'],
168
+ benchmarkFocus: ['build correctness', 'routing safety', 'publish readiness'],
169
+ },
170
+ {
171
+ key: 'api-gateway',
172
+ label: 'API Gateway',
173
+ useWhen: 'Repos built around gateway routing, proxying, traffic policy, or service aggregation layers.',
174
+ adoption: 'Recommended when upstream contracts, routing rules, and auth policy at the edge are major concerns.',
175
+ recommendedModules: ['Gateway routing guide', 'Policy and auth review', 'Upstream contract checks'],
176
+ benchmarkFocus: ['routing safety', 'policy correctness', 'upstream compatibility'],
177
+ },
178
+ {
179
+ key: 'ml-ops',
180
+ label: 'ML Ops',
181
+ useWhen: 'Repos focused on experiment tracking, data lineage, model artifacts, or promotion workflows.',
182
+ adoption: 'Recommended when model lifecycle and experiment traceability matter as much as the model code itself.',
183
+ recommendedModules: ['Experiment tracking guide', 'Artifact lifecycle review', 'Model promotion checks'],
184
+ benchmarkFocus: ['artifact traceability', 'experiment hygiene', 'promotion safety'],
185
+ },
186
+ {
187
+ key: 'embedded-iot',
188
+ label: 'Embedded / IoT',
189
+ useWhen: 'Repos integrating with hardware devices, MQTT-like messaging, or embedded runtime constraints.',
190
+ adoption: 'Recommended when device messaging, firmware safety, and hardware integration dominate the repo.',
191
+ recommendedModules: ['Hardware integration guide', 'Device messaging review', 'Firmware safety checks'],
192
+ benchmarkFocus: ['device-surface safety', 'messaging reliability', 'firmware guardrails'],
193
+ },
194
+ {
195
+ key: 'healthcare',
196
+ label: 'Healthcare',
197
+ useWhen: 'Repos handling HIPAA compliance, HL7/FHIR integrations, PHI data, or medical records workflows.',
198
+ adoption: 'Recommended when patient data protection, regulatory compliance, and clinical data standards are central concerns.',
199
+ recommendedModules: ['HIPAA compliance guide', 'PHI data handling review', 'Clinical data safety checks'],
200
+ benchmarkFocus: ['HIPAA compliance posture', 'PHI protection', 'clinical data standards'],
201
+ },
202
+ {
203
+ key: 'fintech',
204
+ label: 'Fintech',
205
+ useWhen: 'Repos with PCI-DSS requirements, KYC/AML workflows, transaction processing, or financial regulation compliance.',
206
+ adoption: 'Recommended when financial data safety, regulatory compliance, and transaction integrity are core concerns.',
207
+ recommendedModules: ['PCI-DSS compliance guide', 'Transaction safety review', 'KYC/AML workflow checks'],
208
+ benchmarkFocus: ['PCI compliance posture', 'transaction integrity', 'regulatory readiness'],
209
+ },
210
+ {
211
+ key: 'gaming',
212
+ label: 'Gaming',
213
+ useWhen: 'Repos with ECS patterns, asset pipelines, multiplayer networking, or game loop architectures.',
214
+ adoption: 'Recommended when game loop performance, asset management, and multiplayer synchronization drive the workflow.',
215
+ recommendedModules: ['Game loop optimization guide', 'Asset pipeline review', 'Multiplayer safety checks'],
216
+ benchmarkFocus: ['game-loop performance', 'asset pipeline quality', 'multiplayer synchronization'],
217
+ },
218
+ {
219
+ key: 'iot',
220
+ label: 'IoT',
221
+ useWhen: 'Repos centered on MQTT messaging, edge computing, OTA firmware updates, or sensor data ingestion.',
222
+ adoption: 'Recommended when device communication protocols, edge processing, and sensor data pipelines are primary concerns.',
223
+ recommendedModules: ['MQTT integration guide', 'Edge computing review', 'OTA update safety checks'],
224
+ benchmarkFocus: ['device messaging reliability', 'edge processing safety', 'OTA update integrity'],
225
+ },
226
+ {
227
+ key: 'streaming',
228
+ label: 'Streaming',
229
+ useWhen: 'Repos handling video/audio codecs, CDN integration, adaptive bitrate streaming, or transcoding pipelines.',
230
+ adoption: 'Recommended when media delivery quality, codec management, and CDN configuration are central to the product.',
231
+ recommendedModules: ['Media delivery guide', 'Codec and transcoding review', 'CDN configuration checks'],
232
+ benchmarkFocus: ['media delivery quality', 'transcoding safety', 'CDN configuration'],
233
+ },
234
+ {
235
+ key: 'robotics',
236
+ label: 'Robotics',
237
+ useWhen: 'Repos with ROS integration, sensor fusion, real-time control constraints, or actuator management.',
238
+ adoption: 'Recommended when real-time safety, sensor data fusion, and hardware control are foundational to the repo.',
239
+ recommendedModules: ['Real-time control guide', 'Sensor fusion review', 'Actuator safety checks'],
240
+ benchmarkFocus: ['real-time constraint safety', 'sensor fusion quality', 'actuator control integrity'],
241
+ },
242
+ {
243
+ key: 'ar-vr',
244
+ label: 'AR / VR',
245
+ useWhen: 'Repos focused on 3D rendering, spatial computing, XR frameworks, or immersive experience development.',
246
+ adoption: 'Recommended when 3D rendering performance, spatial interaction, and XR platform integration drive the workflow.',
247
+ recommendedModules: ['3D rendering guide', 'Spatial computing review', 'XR framework checks'],
248
+ benchmarkFocus: ['rendering performance', 'spatial interaction quality', 'XR platform compatibility'],
249
+ },
250
+ {
251
+ key: 'climate-tech',
252
+ label: 'Climate Tech',
253
+ useWhen: 'Repos handling carbon tracking, energy modeling, ESG reporting, or environmental data workflows.',
254
+ adoption: 'Recommended when emissions data accuracy, energy modeling, and ESG compliance are central concerns.',
255
+ recommendedModules: ['Carbon tracking guide', 'Energy modeling review', 'ESG reporting checks'],
256
+ benchmarkFocus: ['emissions data accuracy', 'energy model quality', 'ESG compliance readiness'],
257
+ },
258
+ {
259
+ key: 'govtech',
260
+ label: 'GovTech',
261
+ useWhen: 'Repos requiring accessibility compliance, internationalization, audit trails, or government service standards.',
262
+ adoption: 'Recommended when accessibility, audit traceability, and regulatory compliance are mandatory product requirements.',
263
+ recommendedModules: ['Accessibility compliance guide', 'Audit trail review', 'Government standards checks'],
264
+ benchmarkFocus: ['accessibility compliance', 'audit trail completeness', 'regulatory standards'],
265
+ },
266
+ {
267
+ key: 'edtech',
268
+ label: 'EdTech',
269
+ useWhen: 'Repos with LMS integration, assessment engines, progress tracking, or educational content delivery.',
270
+ adoption: 'Recommended when learning management, student progress tracking, and assessment integrity are core product concerns.',
271
+ recommendedModules: ['LMS integration guide', 'Assessment engine review', 'Progress tracking checks'],
272
+ benchmarkFocus: ['LMS integration quality', 'assessment integrity', 'progress tracking accuracy'],
273
+ },
274
+ {
275
+ key: 'martech',
276
+ label: 'MarTech',
277
+ useWhen: 'Repos handling analytics pipelines, A/B testing frameworks, personalization engines, or marketing automation.',
278
+ adoption: 'Recommended when analytics accuracy, experiment integrity, and personalization workflows drive the product.',
279
+ recommendedModules: ['Analytics pipeline guide', 'A/B testing review', 'Personalization safety checks'],
280
+ benchmarkFocus: ['analytics accuracy', 'experiment integrity', 'personalization quality'],
281
+ },
282
+ {
283
+ key: 'proptech',
284
+ label: 'PropTech',
285
+ useWhen: 'Repos handling property data, geospatial analysis, building management systems, or real estate workflows.',
286
+ adoption: 'Recommended when property data accuracy, geospatial processing, and building system integration are central.',
287
+ recommendedModules: ['Property data guide', 'Geospatial processing review', 'Building systems checks'],
288
+ benchmarkFocus: ['property data accuracy', 'geospatial quality', 'building system integration'],
289
+ },
290
+ {
291
+ key: 'legaltech',
292
+ label: 'LegalTech',
293
+ useWhen: 'Repos focused on document automation, compliance management, e-discovery, or legal workflow tooling.',
294
+ adoption: 'Recommended when document accuracy, compliance tracking, and legal data handling are primary concerns.',
295
+ recommendedModules: ['Document automation guide', 'Compliance workflow review', 'E-discovery safety checks'],
296
+ benchmarkFocus: ['document accuracy', 'compliance tracking', 'legal data handling'],
297
+ },
298
+ {
299
+ key: 'agritech',
300
+ label: 'AgriTech',
301
+ useWhen: 'Repos handling agricultural sensor data, crop modeling, supply chain tracking, or farm management systems.',
302
+ adoption: 'Recommended when sensor data processing, crop analytics, and supply chain traceability are core concerns.',
303
+ recommendedModules: ['Sensor data pipeline guide', 'Crop modeling review', 'Supply chain tracking checks'],
304
+ benchmarkFocus: ['sensor data quality', 'crop model accuracy', 'supply chain traceability'],
305
+ },
306
+ {
307
+ key: 'biotech',
308
+ label: 'BioTech',
309
+ useWhen: 'Repos with bioinformatics pipelines, lab automation systems, or regulatory submission workflows.',
310
+ adoption: 'Recommended when biological data processing, lab workflow automation, and regulatory compliance drive the repo.',
311
+ recommendedModules: ['Bioinformatics pipeline guide', 'Lab automation review', 'Regulatory compliance checks'],
312
+ benchmarkFocus: ['bioinformatics accuracy', 'lab automation safety', 'regulatory compliance'],
313
+ },
314
+ {
315
+ key: 'cybersecurity',
316
+ label: 'Cybersecurity',
317
+ useWhen: 'Repos focused on threat detection, SIEM integration, incident response, or security operations tooling.',
318
+ adoption: 'Recommended when threat detection accuracy, incident response workflows, and security telemetry are central.',
319
+ recommendedModules: ['Threat detection guide', 'SIEM integration review', 'Incident response checks'],
320
+ benchmarkFocus: ['threat detection quality', 'SIEM integration', 'incident response readiness'],
321
+ },
322
+ {
323
+ key: 'logistics',
324
+ label: 'Logistics',
325
+ useWhen: 'Repos handling route optimization, fleet management, shipment tracking, or warehouse management systems.',
326
+ adoption: 'Recommended when routing accuracy, fleet coordination, and tracking reliability are core product concerns.',
327
+ recommendedModules: ['Route optimization guide', 'Fleet management review', 'Tracking system checks'],
328
+ benchmarkFocus: ['routing accuracy', 'fleet coordination', 'tracking reliability'],
329
+ },
330
+ {
331
+ key: 'media',
332
+ label: 'Media',
333
+ useWhen: 'Repos with CMS-driven publishing, digital asset management, content delivery pipelines, or editorial workflows.',
334
+ adoption: 'Recommended when content management, asset lifecycle, and delivery pipelines are central to the product.',
335
+ recommendedModules: ['Content management guide', 'Digital asset review', 'Content delivery checks'],
336
+ benchmarkFocus: ['content management quality', 'asset lifecycle safety', 'delivery pipeline reliability'],
337
+ },
338
+ {
339
+ key: 'social',
340
+ label: 'Social',
341
+ useWhen: 'Repos with feed algorithms, content moderation, real-time messaging, or social graph management.',
342
+ adoption: 'Recommended when feed quality, moderation safety, and messaging reliability are core product concerns.',
343
+ recommendedModules: ['Feed algorithm guide', 'Content moderation review', 'Messaging safety checks'],
344
+ benchmarkFocus: ['feed algorithm quality', 'moderation effectiveness', 'messaging reliability'],
345
+ },
346
+ {
347
+ key: 'travel',
348
+ label: 'Travel',
349
+ useWhen: 'Repos with booking engines, GDS integration, dynamic pricing, or travel inventory management.',
350
+ adoption: 'Recommended when booking reliability, pricing accuracy, and GDS integration are primary concerns.',
351
+ recommendedModules: ['Booking engine guide', 'GDS integration review', 'Pricing safety checks'],
352
+ benchmarkFocus: ['booking reliability', 'GDS integration quality', 'pricing accuracy'],
353
+ },
354
+ {
355
+ key: 'insurance',
356
+ label: 'Insurance',
357
+ useWhen: 'Repos handling claims processing, risk modeling, underwriting workflows, or policy management systems.',
358
+ adoption: 'Recommended when claims accuracy, risk model integrity, and underwriting workflow safety are core concerns.',
359
+ recommendedModules: ['Claims processing guide', 'Risk modeling review', 'Underwriting safety checks'],
360
+ benchmarkFocus: ['claims processing accuracy', 'risk model integrity', 'underwriting safety'],
361
+ },
362
+ {
363
+ key: 'energy',
364
+ label: 'Energy',
365
+ useWhen: 'Repos handling grid management, smart metering, renewable energy systems, or energy trading platforms.',
366
+ adoption: 'Recommended when grid reliability, metering accuracy, and energy system integration are central concerns.',
367
+ recommendedModules: ['Grid management guide', 'Smart metering review', 'Energy system checks'],
368
+ benchmarkFocus: ['grid reliability', 'metering accuracy', 'energy system integration'],
369
+ },
370
+ ];
371
+
372
+ const PLATFORM_DEFAULTS = {
373
+ claude: {
374
+ recommendedModules: ['CLAUDE.md baseline'],
375
+ recommendedProposalFamilies: ['claude-md', 'commands', 'rules'],
376
+ recommendedSurfaces: ['CLAUDE.md', '.claude/settings.json', '.github/workflows/'],
377
+ recommendedMcpPacks: ['context7-docs'],
378
+ },
379
+ codex: {
380
+ recommendedModules: ['AGENTS.md baseline', 'Codex config baseline'],
381
+ recommendedProposalFamilies: ['codex-agents-md', 'codex-config', 'codex-ci-review'],
382
+ recommendedSurfaces: ['AGENTS.md', '.codex/config.toml', '.github/workflows/'],
383
+ },
384
+ gemini: {
385
+ recommendedModules: ['GEMINI.md baseline', 'Gemini settings baseline'],
386
+ recommendedProposalFamilies: ['gemini-md', 'gemini-settings', 'gemini-hooks'],
387
+ recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json', '.github/workflows/'],
388
+ },
389
+ copilot: {
390
+ recommendedModules: ['copilot-instructions baseline', 'VS Code settings baseline'],
391
+ recommendedProposalFamilies: ['copilot-instructions', 'copilot-vscode-settings', 'copilot-ci-review'],
392
+ recommendedSurfaces: ['.github/copilot-instructions.md', '.vscode/settings.json', '.github/workflows/'],
393
+ },
394
+ cursor: {
395
+ recommendedModules: ['.cursor/rules baseline', 'Cursor MCP baseline'],
396
+ recommendedProposalFamilies: ['cursor-rules', 'cursor-mcp', 'cursor-ci-review'],
397
+ recommendedSurfaces: ['.cursor/rules/', '.cursor/mcp.json', '.github/workflows/'],
398
+ },
399
+ windsurf: {
400
+ recommendedModules: ['.windsurf/rules baseline', 'Windsurf MCP baseline'],
401
+ recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp', 'windsurf-ci-review'],
402
+ recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
403
+ },
404
+ aider: {
405
+ recommendedModules: ['.aider.conf.yml baseline', 'Convention file starter'],
406
+ recommendedProposalFamilies: ['aider-conf-yml', 'aider-conventions', 'aider-ci'],
407
+ recommendedSurfaces: ['.aider.conf.yml', 'CONVENTIONS.md', '.github/workflows/'],
408
+ },
409
+ opencode: {
410
+ recommendedModules: ['AGENTS.md baseline', 'OpenCode config baseline'],
411
+ recommendedProposalFamilies: ['opencode-agents-md', 'opencode-config', 'opencode-ci'],
412
+ recommendedSurfaces: ['AGENTS.md', 'opencode.json', '.github/workflows/'],
413
+ },
414
+ };
415
+
416
+ function depMapKeys(deps) {
417
+ return Object.keys(deps || {}).map((key) => key.toLowerCase());
418
+ }
419
+
420
+ function hasDependency(depKeys, matchers) {
421
+ return depKeys.some((key) => matchers.some((matcher) => {
422
+ if (typeof matcher === 'string') return key === matcher.toLowerCase();
423
+ return matcher.test(key);
424
+ }));
425
+ }
426
+
427
+ function hasAnyFile(files, pattern) {
428
+ return files.some((file) => pattern.test(file));
429
+ }
430
+
431
+ function getFileContent(ctx, filePath) {
432
+ return typeof ctx.fileContent === 'function' ? (ctx.fileContent(filePath) || '') : '';
433
+ }
434
+
435
+ function countComposeServices(content) {
436
+ if (!content || !/^\s*services\s*:\s*$/m.test(content)) return 0;
437
+ const lines = content.split(/\r?\n/);
438
+ let inServices = false;
439
+ let count = 0;
440
+
441
+ for (const line of lines) {
442
+ if (!inServices) {
443
+ if (/^\s*services\s*:\s*$/.test(line)) {
444
+ inServices = true;
445
+ }
446
+ continue;
447
+ }
448
+
449
+ if (!line.trim()) continue;
450
+ if (/^\S/.test(line)) break;
451
+ if (/^\s{2}[A-Za-z0-9_.-]+\s*:\s*$/.test(line)) count += 1;
452
+ }
453
+
454
+ return count;
455
+ }
456
+
457
+ function getManifestInfo(ctx, files) {
458
+ const manifestPath = files.find((file) => /(^|\/)manifest\.json$/i.test(file));
459
+ if (!manifestPath) return { path: null, content: '' };
460
+ return { path: manifestPath, content: getFileContent(ctx, manifestPath) };
461
+ }
462
+
463
+ function getComposeInfo(ctx, files) {
464
+ const composePath = files.find((file) => /(^|\/)(docker-compose|compose)\.ya?ml$/i.test(file));
465
+ if (!composePath) return { path: null, services: 0 };
466
+ const content = getFileContent(ctx, composePath);
467
+ return { path: composePath, services: countComposeServices(content) };
468
+ }
469
+
470
+ function buildAdditionalDomainPacks(platform, options = {}) {
471
+ const defaults = PLATFORM_DEFAULTS[platform];
472
+ if (!defaults) {
473
+ throw new Error(`Unknown domain-pack expansion platform '${platform}'`);
474
+ }
475
+
476
+ const existingKeys = options.existingKeys || new Set();
477
+
478
+ return PACK_BLUEPRINTS
479
+ .filter((pack) => !existingKeys.has(pack.key))
480
+ .map((pack) => ({
481
+ key: pack.key,
482
+ label: pack.label,
483
+ useWhen: pack.useWhen,
484
+ adoption: pack.adoption,
485
+ recommendedModules: [...defaults.recommendedModules, ...pack.recommendedModules.slice(0, 2)],
486
+ recommendedProposalFamilies: defaults.recommendedProposalFamilies.slice(0, 3),
487
+ recommendedSurfaces: defaults.recommendedSurfaces.slice(0, 3),
488
+ benchmarkFocus: pack.benchmarkFocus.slice(0, 3),
489
+ ...(defaults.recommendedMcpPacks ? { recommendedMcpPacks: defaults.recommendedMcpPacks.slice(0, 3) } : {}),
490
+ }));
491
+ }
492
+
493
+ function detectAdditionalDomainPacks(options) {
494
+ const {
495
+ ctx,
496
+ pkg = {},
497
+ deps = {},
498
+ stackKeys = new Set(),
499
+ addMatch,
500
+ hasBackend = false,
501
+ hasFrontend = false,
502
+ hasInfra = false,
503
+ hasCi = false,
504
+ } = options;
505
+
506
+ const files = Array.isArray(ctx.files) ? ctx.files : [];
507
+ const depKeys = depMapKeys(deps);
508
+ const pkgBin = pkg && pkg.bin;
509
+ const hasBinField = typeof pkgBin === 'string' || (pkgBin && typeof pkgBin === 'object' && Object.keys(pkgBin).length > 0);
510
+ const manifest = getManifestInfo(ctx, files);
511
+ const compose = getComposeInfo(ctx, files);
512
+ const vercelConfig = getFileContent(ctx, 'vercel.json');
513
+
514
+ if (
515
+ hasAnyFile(files, /(^|\/)(hardhat\.config\.(js|ts)|truffle-config\.js|foundry\.toml)$/i) ||
516
+ hasAnyFile(files, /\.sol$/i) ||
517
+ hasDependency(depKeys, [/^hardhat$/i, /^truffle$/i, /^ethers$/i, /^viem$/i, /^@openzeppelin\//i])
518
+ ) {
519
+ addMatch('blockchain', [
520
+ hasAnyFile(files, /\.sol$/i) ? 'Smart-contract source files detected.' : 'Blockchain toolchain files detected.',
521
+ hasAnyFile(files, /foundry\.toml$/i) ? 'Foundry config detected.' : null,
522
+ hasDependency(depKeys, [/^hardhat$/i]) ? 'Hardhat dependency detected.' : null,
523
+ ]);
524
+ }
525
+
526
+ if (hasDependency(depKeys, [/^socket\.io$/i, /^socket\.io-client$/i, /^ws$/i, /^ably/i, /^pusher/i])) {
527
+ addMatch('realtime', [
528
+ 'Realtime communication dependencies detected.',
529
+ hasDependency(depKeys, [/^socket\.io$/i, /^socket\.io-client$/i]) ? 'Socket.IO dependency detected.' : null,
530
+ hasDependency(depKeys, [/^ws$/i]) ? 'WebSocket dependency detected.' : null,
531
+ ]);
532
+ }
533
+
534
+ if (
535
+ hasAnyFile(files, /(^|\/)(schema\.graphql|schema\.gql|.*\.graphqlrc(\.(json|ya?ml))?)$/i) ||
536
+ hasDependency(depKeys, [/^graphql$/i, /^@apollo\//i, /^apollo-/i, /^urql$/i, /^relay/i])
537
+ ) {
538
+ addMatch('graphql', [
539
+ hasAnyFile(files, /\.graphql$/i) ? 'GraphQL schema files detected.' : 'GraphQL tooling detected.',
540
+ hasAnyFile(files, /\.graphqlrc/i) ? '.graphqlrc detected.' : null,
541
+ hasDependency(depKeys, [/^@apollo\//i, /^apollo-/i]) ? 'Apollo dependency detected.' : null,
542
+ ]);
543
+ }
544
+
545
+ if (
546
+ hasAnyFile(files, /(^|\/)(serverless\.ya?ml|sam\.ya?ml)$/i) ||
547
+ /"functions"\s*:\s*\{/i.test(vercelConfig) ||
548
+ (hasInfra && hasAnyFile(files, /vercel\.json$/i))
549
+ ) {
550
+ addMatch('serverless', [
551
+ hasAnyFile(files, /serverless\.ya?ml$/i) ? 'Serverless framework config detected.' : 'Function deployment config detected.',
552
+ hasAnyFile(files, /sam\.ya?ml$/i) ? 'AWS SAM config detected.' : null,
553
+ /"functions"\s*:\s*\{/i.test(vercelConfig) ? 'Vercel functions config detected.' : null,
554
+ ]);
555
+ }
556
+
557
+ if (compose.services >= 3 || hasAnyFile(files, /\.proto$/i)) {
558
+ addMatch('microservices', [
559
+ compose.services >= 3 ? `Compose file defines ${compose.services} services.` : 'Protocol buffer contracts detected.',
560
+ hasAnyFile(files, /\.proto$/i) ? 'Proto files detected.' : null,
561
+ compose.path ? `${compose.path} detected.` : null,
562
+ ]);
563
+ }
564
+
565
+ if (hasBinField && hasDependency(depKeys, [/^commander$/i, /^yargs$/i, /^oclif/i, /^cac$/i])) {
566
+ addMatch('cli-tool', [
567
+ 'CLI bin entry and command-parser dependencies detected.',
568
+ hasDependency(depKeys, [/^commander$/i]) ? 'Commander dependency detected.' : null,
569
+ hasDependency(depKeys, [/^yargs$/i]) ? 'Yargs dependency detected.' : null,
570
+ ]);
571
+ }
572
+
573
+ if (manifest.path && /browser_specific_settings/i.test(manifest.content)) {
574
+ addMatch('browser-ext', [
575
+ 'Browser extension manifest detected.',
576
+ `${manifest.path} contains browser_specific_settings.`,
577
+ null,
578
+ ]);
579
+ }
580
+
581
+ if (
582
+ hasDependency(depKeys, [/^electron$/i, /^electron-builder$/i, /^@tauri-apps\//i, /^tauri$/i]) ||
583
+ files.includes('tauri.conf.json') ||
584
+ ctx.hasDir('src-tauri')
585
+ ) {
586
+ addMatch('desktop', [
587
+ 'Desktop application framework signals detected.',
588
+ ctx.hasDir('src-tauri') ? 'src-tauri directory detected.' : null,
589
+ hasDependency(depKeys, [/^electron$/i]) ? 'Electron dependency detected.' : null,
590
+ ]);
591
+ }
592
+
593
+ if (hasDependency(depKeys, [/^phaser$/i, /^three$/i, /^three\.js$/i, /^pixi\.js$/i, /^@pixi\//i])) {
594
+ addMatch('game-dev', [
595
+ 'Game-development rendering dependencies detected.',
596
+ hasDependency(depKeys, [/^phaser$/i]) ? 'Phaser dependency detected.' : null,
597
+ hasDependency(depKeys, [/^three$/i, /^three\.js$/i]) ? 'Three.js dependency detected.' : null,
598
+ ]);
599
+ }
600
+
601
+ if (hasDependency(depKeys, [/^d3/i, /^chart\.js$/i, /^plotly/i, /^recharts$/i, /^visx/i])) {
602
+ addMatch('data-viz', [
603
+ 'Data-visualization dependencies detected.',
604
+ hasDependency(depKeys, [/^d3/i]) ? 'D3 dependency detected.' : null,
605
+ hasDependency(depKeys, [/^chart\.js$/i]) ? 'Chart.js dependency detected.' : null,
606
+ ]);
607
+ }
608
+
609
+ if (hasDependency(depKeys, [/^strapi/i, /^contentful$/i, /^contentful-/i, /^sanity$/i, /^@sanity\//i])) {
610
+ addMatch('cms', [
611
+ 'CMS or content-platform dependencies detected.',
612
+ hasDependency(depKeys, [/^strapi/i]) ? 'Strapi dependency detected.' : null,
613
+ hasDependency(depKeys, [/^contentful/i]) ? 'Contentful dependency detected.' : null,
614
+ ]);
615
+ }
616
+
617
+ if (
618
+ hasDependency(depKeys, [/^jest$/i, /^vitest$/i, /^@playwright\/test$/i, /^playwright$/i]) ||
619
+ hasAnyFile(files, /(^|\/)(jest\.config|vitest\.config|playwright\.config)\./i)
620
+ ) {
621
+ addMatch('testing-framework', [
622
+ 'Primary test-framework signals detected.',
623
+ hasDependency(depKeys, [/^jest$/i]) ? 'Jest dependency detected.' : null,
624
+ hasDependency(depKeys, [/^vitest$/i]) ? 'Vitest dependency detected.' : null,
625
+ ]);
626
+ }
627
+
628
+ if (
629
+ hasDependency(depKeys, [/^vscode$/i, /^@types\/vscode$/i, /^webpack$/i, /^rollup$/i]) &&
630
+ (pkg.engines && pkg.engines.vscode || hasAnyFile(files, /(^|\/)(extension\.(ts|js)|webpack\..*plugin\.(ts|js))$/i))
631
+ ) {
632
+ addMatch('devtools', [
633
+ 'Developer-tooling integration signals detected.',
634
+ pkg.engines && pkg.engines.vscode ? 'VS Code extension engine declared.' : null,
635
+ hasAnyFile(files, /extension\.(ts|js)$/i) ? 'Extension entrypoint detected.' : null,
636
+ ]);
637
+ }
638
+
639
+ if (hasDependency(depKeys, [/^passport$/i, /^passport-/i, /^auth0$/i, /^@auth0\//i, /^@clerk\//i, /^clerk$/i])) {
640
+ addMatch('auth-service', [
641
+ 'Authentication-platform dependencies detected.',
642
+ hasDependency(depKeys, [/^passport$/i, /^passport-/i]) ? 'Passport dependency detected.' : null,
643
+ hasDependency(depKeys, [/^@clerk\//i, /^clerk$/i]) ? 'Clerk dependency detected.' : null,
644
+ ]);
645
+ }
646
+
647
+ if (
648
+ hasDependency(depKeys, [/^stripe$/i, /^@stripe\//i, /^paypal$/i, /^@paypal\//i, /^braintree$/i]) ||
649
+ ctx.hasDir('payments')
650
+ ) {
651
+ addMatch('payments', [
652
+ 'Payment-platform signals detected.',
653
+ hasDependency(depKeys, [/^stripe$/i, /^@stripe\//i]) ? 'Stripe dependency detected.' : null,
654
+ hasDependency(depKeys, [/^paypal$/i, /^@paypal\//i]) ? 'PayPal dependency detected.' : null,
655
+ ]);
656
+ }
657
+
658
+ if (hasDependency(depKeys, [/^@sendgrid\//i, /^nodemailer$/i, /^ses$/i, /^@aws-sdk\/client-ses$/i, /^twilio$/i])) {
659
+ addMatch('notifications', [
660
+ 'Notification-channel dependencies detected.',
661
+ hasDependency(depKeys, [/^@sendgrid\//i]) ? 'SendGrid dependency detected.' : null,
662
+ hasDependency(depKeys, [/^twilio$/i]) ? 'Twilio dependency detected.' : null,
663
+ ]);
664
+ }
665
+
666
+ if (hasDependency(depKeys, [/^@elastic\/elasticsearch$/i, /^elasticsearch$/i, /^algoliasearch$/i, /^meilisearch$/i])) {
667
+ addMatch('search', [
668
+ 'Search-platform dependencies detected.',
669
+ hasDependency(depKeys, [/^@elastic\/elasticsearch$/i, /^elasticsearch$/i]) ? 'Elasticsearch dependency detected.' : null,
670
+ hasDependency(depKeys, [/^algoliasearch$/i]) ? 'Algolia dependency detected.' : null,
671
+ ]);
672
+ }
673
+
674
+ if (hasDependency(depKeys, [/^bull$/i, /^bullmq$/i, /^amqplib$/i, /^rabbitmq$/i, /^@aws-sdk\/client-sqs$/i, /^sqs-consumer$/i])) {
675
+ addMatch('queue-worker', [
676
+ 'Queue or worker dependencies detected.',
677
+ hasDependency(depKeys, [/^bull$/i, /^bullmq$/i]) ? 'Bull/BullMQ dependency detected.' : null,
678
+ hasDependency(depKeys, [/^amqplib$/i, /^rabbitmq$/i]) ? 'RabbitMQ dependency detected.' : null,
679
+ ]);
680
+ }
681
+
682
+ if (hasDependency(depKeys, [/^winston$/i, /^pino$/i, /^datadog$/i, /^dd-trace$/i, /^@datadog\//i])) {
683
+ addMatch('observability', [
684
+ 'Observability dependencies detected.',
685
+ hasDependency(depKeys, [/^winston$/i]) ? 'Winston dependency detected.' : null,
686
+ hasDependency(depKeys, [/^pino$/i]) ? 'Pino dependency detected.' : null,
687
+ ]);
688
+ }
689
+
690
+ if (hasDependency(depKeys, [/^i18next$/i, /^react-intl$/i, /^formatjs$/i, /^next-intl$/i]) || ctx.hasDir('locales')) {
691
+ addMatch('i18n', [
692
+ 'Internationalization signals detected.',
693
+ ctx.hasDir('locales') ? 'Locales directory detected.' : null,
694
+ hasDependency(depKeys, [/^i18next$/i]) ? 'i18next dependency detected.' : null,
695
+ ]);
696
+ }
697
+
698
+ if (
699
+ hasDependency(depKeys, [/^gatsby$/i, /^@11ty\/eleventy$/i, /^hugo-bin$/i, /^jekyll$/i]) ||
700
+ hasAnyFile(files, /(^|\/)(hugo\.toml|_config\.yml|_config\.yaml|gatsby-config\.(js|ts)|eleventy\.config\.(js|cjs|mjs))$/i)
701
+ ) {
702
+ addMatch('static-site', [
703
+ 'Static-site generator signals detected.',
704
+ hasDependency(depKeys, [/^gatsby$/i]) ? 'Gatsby dependency detected.' : null,
705
+ hasAnyFile(files, /(^|\/)(hugo\.toml|_config\.yml|_config\.yaml)$/i) ? 'Static-site config detected.' : null,
706
+ ]);
707
+ }
708
+
709
+ if (
710
+ hasDependency(depKeys, [/^kong$/i, /^express-gateway$/i]) ||
711
+ hasAnyFile(files, /(^|\/)(kong\.ya?ml|gateway\.config\.(json|ya?ml))$/i)
712
+ ) {
713
+ addMatch('api-gateway', [
714
+ 'API-gateway signals detected.',
715
+ hasDependency(depKeys, [/^express-gateway$/i]) ? 'express-gateway dependency detected.' : null,
716
+ hasAnyFile(files, /kong\.ya?ml$/i) ? 'Kong config detected.' : null,
717
+ ]);
718
+ }
719
+
720
+ if (
721
+ hasDependency(depKeys, [/^mlflow$/i, /^wandb$/i, /^dvc$/i]) ||
722
+ hasAnyFile(files, /(^|\/)(dvc\.yaml|dvc\.yml|mlruns\/|wandb\/)/i)
723
+ ) {
724
+ addMatch('ml-ops', [
725
+ 'ML Ops tracking or artifact signals detected.',
726
+ hasDependency(depKeys, [/^mlflow$/i]) ? 'MLflow dependency detected.' : null,
727
+ hasDependency(depKeys, [/^wandb$/i]) ? 'Weights & Biases dependency detected.' : null,
728
+ ]);
729
+ }
730
+
731
+ if (
732
+ hasDependency(depKeys, [/^johnny-five$/i, /^mqtt$/i, /^particle-/i, /^particle$/i]) ||
733
+ hasAnyFile(files, /\.ino$/i)
734
+ ) {
735
+ addMatch('embedded-iot', [
736
+ 'Embedded or device-integration signals detected.',
737
+ hasDependency(depKeys, [/^mqtt$/i]) ? 'MQTT dependency detected.' : null,
738
+ hasDependency(depKeys, [/^johnny-five$/i]) ? 'Johnny-Five dependency detected.' : null,
739
+ ]);
740
+ }
741
+
742
+ // Healthcare detection
743
+ if (
744
+ hasDependency(depKeys, [/^fhir/i, /^hl7/i, /^@medplum\//i, /^hapi-fhir/i]) ||
745
+ ctx.hasDir('hipaa') || ctx.hasDir('phi') || ctx.hasDir('medical') || ctx.hasDir('patients') ||
746
+ hasAnyFile(files, /(^|\/)(hipaa|fhir|hl7)/i)
747
+ ) {
748
+ addMatch('healthcare', [
749
+ 'Healthcare or clinical data signals detected.',
750
+ hasDependency(depKeys, [/^fhir/i, /^hl7/i]) ? 'FHIR/HL7 dependency detected.' : null,
751
+ ctx.hasDir('patients') ? 'Patients directory detected.' : null,
752
+ ]);
753
+ }
754
+
755
+ // Fintech detection
756
+ if (
757
+ hasDependency(depKeys, [/^plaid$/i, /^@plaid\//i, /^dwolla$/i, /^alpaca/i, /^polygon\.io/i]) ||
758
+ ctx.hasDir('kyc') || ctx.hasDir('aml') || ctx.hasDir('transactions') ||
759
+ (pkg.keywords && pkg.keywords.some(k => ['fintech', 'pci-dss', 'kyc', 'aml'].includes(k)))
760
+ ) {
761
+ addMatch('fintech', [
762
+ 'Fintech or financial compliance signals detected.',
763
+ hasDependency(depKeys, [/^plaid$/i, /^@plaid\//i]) ? 'Plaid dependency detected.' : null,
764
+ ctx.hasDir('transactions') ? 'Transactions directory detected.' : null,
765
+ ]);
766
+ }
767
+
768
+ // Gaming detection
769
+ if (
770
+ hasDependency(depKeys, [/^unity/i, /^godot/i, /^kaboom/i, /^excalibur/i, /^playcanvas/i, /^babylonjs/i, /^@babylonjs\//i]) ||
771
+ ctx.hasDir('sprites') || ctx.hasDir('assets/sprites') || ctx.hasDir('scenes') ||
772
+ hasAnyFile(files, /(^|\/)(game\.config|game\.json|\.gdproject|\.uproject)/i)
773
+ ) {
774
+ addMatch('gaming', [
775
+ 'Game development signals detected.',
776
+ ctx.hasDir('sprites') ? 'Sprites directory detected.' : null,
777
+ ctx.hasDir('scenes') ? 'Scenes directory detected.' : null,
778
+ ]);
779
+ }
780
+
781
+ // IoT detection
782
+ if (
783
+ hasDependency(depKeys, [/^mqtt$/i, /^async-mqtt$/i, /^aws-iot-device-sdk/i, /^azure-iot/i, /^node-red/i]) ||
784
+ ctx.hasDir('sensors') || ctx.hasDir('devices') || ctx.hasDir('firmware') ||
785
+ hasAnyFile(files, /(^|\/)(mosquitto\.conf|iot|sensors)/i)
786
+ ) {
787
+ addMatch('iot', [
788
+ 'IoT or sensor data signals detected.',
789
+ hasDependency(depKeys, [/^mqtt$/i, /^async-mqtt$/i]) ? 'MQTT dependency detected.' : null,
790
+ ctx.hasDir('sensors') ? 'Sensors directory detected.' : null,
791
+ ]);
792
+ }
793
+
794
+ // Streaming detection
795
+ if (
796
+ hasDependency(depKeys, [/^fluent-ffmpeg$/i, /^hls\.js$/i, /^dash\.js$/i, /^shaka-player$/i, /^video\.js$/i, /^mux/i, /^@mux\//i, /^cloudinary/i]) ||
797
+ ctx.hasDir('transcode') || ctx.hasDir('streams') ||
798
+ hasAnyFile(files, /(^|\/)(ffmpeg|transcode|hls|dash)/i)
799
+ ) {
800
+ addMatch('streaming', [
801
+ 'Media streaming signals detected.',
802
+ hasDependency(depKeys, [/^fluent-ffmpeg$/i]) ? 'FFmpeg dependency detected.' : null,
803
+ hasDependency(depKeys, [/^hls\.js$/i, /^dash\.js$/i]) ? 'Adaptive bitrate streaming dependency detected.' : null,
804
+ ]);
805
+ }
806
+
807
+ // Robotics detection
808
+ if (
809
+ hasDependency(depKeys, [/^rosnodejs$/i, /^rclnodejs$/i, /^roslib$/i, /^ros2/i]) ||
810
+ ctx.hasDir('ros') || ctx.hasDir('catkin_ws') || ctx.hasDir('robot') ||
811
+ hasAnyFile(files, /(^|\/)(CMakeLists\.txt|package\.xml|\.launch)/i) && ctx.hasDir('src')
812
+ ) {
813
+ addMatch('robotics', [
814
+ 'Robotics or ROS signals detected.',
815
+ hasDependency(depKeys, [/^rosnodejs$/i, /^rclnodejs$/i]) ? 'ROS dependency detected.' : null,
816
+ ctx.hasDir('catkin_ws') ? 'Catkin workspace detected.' : null,
817
+ ]);
818
+ }
819
+
820
+ // AR/VR detection
821
+ if (
822
+ hasDependency(depKeys, [/^aframe$/i, /^@react-three\/xr$/i, /^webxr/i, /^@babylonjs\/core$/i, /^ar\.js$/i, /^mind-ar/i, /^8thwall/i]) ||
823
+ ctx.hasDir('xr') || ctx.hasDir('vr') || ctx.hasDir('ar') ||
824
+ hasAnyFile(files, /(^|\/)(.xr|spatial|immersive)/i)
825
+ ) {
826
+ addMatch('ar-vr', [
827
+ 'AR/VR or spatial computing signals detected.',
828
+ hasDependency(depKeys, [/^aframe$/i]) ? 'A-Frame dependency detected.' : null,
829
+ hasDependency(depKeys, [/^@react-three\/xr$/i]) ? 'React Three XR dependency detected.' : null,
830
+ ]);
831
+ }
832
+
833
+ // Climate Tech detection
834
+ if (
835
+ hasDependency(depKeys, [/^carbon/i, /^climatiq/i, /^patch-node$/i, /^@cloverly\//i]) ||
836
+ ctx.hasDir('emissions') || ctx.hasDir('carbon') || ctx.hasDir('esg') ||
837
+ (pkg.keywords && pkg.keywords.some(k => ['carbon', 'climate', 'esg', 'sustainability', 'emissions'].includes(k)))
838
+ ) {
839
+ addMatch('climate-tech', [
840
+ 'Climate tech or sustainability signals detected.',
841
+ ctx.hasDir('emissions') ? 'Emissions directory detected.' : null,
842
+ ctx.hasDir('esg') ? 'ESG directory detected.' : null,
843
+ ]);
844
+ }
845
+
846
+ // GovTech detection
847
+ if (
848
+ hasDependency(depKeys, [/^pa11y$/i, /^axe-core$/i, /^@axe-core\//i, /^react-aria/i, /^@react-aria\//i]) ||
849
+ ctx.hasDir('audit-logs') || ctx.hasDir('accessibility') ||
850
+ (pkg.keywords && pkg.keywords.some(k => ['government', 'govtech', 'a11y', 'wcag', 'section508'].includes(k)))
851
+ ) {
852
+ addMatch('govtech', [
853
+ 'Government technology or accessibility compliance signals detected.',
854
+ hasDependency(depKeys, [/^axe-core$/i, /^@axe-core\//i]) ? 'Axe accessibility dependency detected.' : null,
855
+ ctx.hasDir('audit-logs') ? 'Audit logs directory detected.' : null,
856
+ ]);
857
+ }
858
+
859
+ // EdTech detection
860
+ if (
861
+ hasDependency(depKeys, [/^scorm/i, /^xapi/i, /^lti/i, /^@canvas\//i]) ||
862
+ ctx.hasDir('courses') || ctx.hasDir('assessments') || ctx.hasDir('curriculum') || ctx.hasDir('lms') ||
863
+ (pkg.keywords && pkg.keywords.some(k => ['edtech', 'lms', 'elearning', 'assessment'].includes(k)))
864
+ ) {
865
+ addMatch('edtech', [
866
+ 'EdTech or learning management signals detected.',
867
+ ctx.hasDir('courses') ? 'Courses directory detected.' : null,
868
+ ctx.hasDir('assessments') ? 'Assessments directory detected.' : null,
869
+ ]);
870
+ }
871
+
872
+ // MarTech detection
873
+ if (
874
+ hasDependency(depKeys, [/^@segment\//i, /^segment/i, /^mixpanel$/i, /^amplitude/i, /^optimizely/i, /^@optimizely\//i, /^launchdarkly/i, /^@launchdarkly\//i]) ||
875
+ ctx.hasDir('analytics') || ctx.hasDir('experiments') || ctx.hasDir('personalization') ||
876
+ hasAnyFile(files, /(^|\/)(segment|analytics|ab-test)/i)
877
+ ) {
878
+ addMatch('martech', [
879
+ 'Marketing technology or analytics signals detected.',
880
+ hasDependency(depKeys, [/^@segment\//i, /^segment/i]) ? 'Segment dependency detected.' : null,
881
+ hasDependency(depKeys, [/^optimizely/i, /^@optimizely\//i]) ? 'Optimizely dependency detected.' : null,
882
+ ]);
883
+ }
884
+
885
+ // PropTech detection
886
+ if (
887
+ hasDependency(depKeys, [/^turf$/i, /^@turf\//i, /^mapbox/i, /^@mapbox\//i, /^leaflet$/i, /^openlayers/i]) ||
888
+ ctx.hasDir('properties') || ctx.hasDir('geospatial') || ctx.hasDir('buildings') ||
889
+ (pkg.keywords && pkg.keywords.some(k => ['proptech', 'real-estate', 'geospatial', 'property'].includes(k)))
890
+ ) {
891
+ addMatch('proptech', [
892
+ 'Property technology or geospatial signals detected.',
893
+ hasDependency(depKeys, [/^@turf\//i, /^turf$/i]) ? 'Turf.js geospatial dependency detected.' : null,
894
+ hasDependency(depKeys, [/^mapbox/i, /^@mapbox\//i]) ? 'Mapbox dependency detected.' : null,
895
+ ]);
896
+ }
897
+
898
+ // LegalTech detection
899
+ if (
900
+ hasDependency(depKeys, [/^docusign/i, /^@docusign\//i, /^docassemble/i, /^clio/i]) ||
901
+ ctx.hasDir('contracts') || ctx.hasDir('legal') || ctx.hasDir('compliance') || ctx.hasDir('discovery') ||
902
+ (pkg.keywords && pkg.keywords.some(k => ['legaltech', 'legal', 'compliance', 'e-discovery', 'ediscovery'].includes(k)))
903
+ ) {
904
+ addMatch('legaltech', [
905
+ 'Legal technology or compliance signals detected.',
906
+ hasDependency(depKeys, [/^docusign/i, /^@docusign\//i]) ? 'DocuSign dependency detected.' : null,
907
+ ctx.hasDir('contracts') ? 'Contracts directory detected.' : null,
908
+ ]);
909
+ }
910
+
911
+ // AgriTech detection
912
+ if (
913
+ hasDependency(depKeys, [/^agworld/i, /^farmos/i, /^cropsar/i]) ||
914
+ ctx.hasDir('crops') || ctx.hasDir('farm') || ctx.hasDir('agriculture') || ctx.hasDir('harvest') ||
915
+ (pkg.keywords && pkg.keywords.some(k => ['agritech', 'agriculture', 'farming', 'crop', 'precision-agriculture'].includes(k)))
916
+ ) {
917
+ addMatch('agritech', [
918
+ 'Agricultural technology signals detected.',
919
+ ctx.hasDir('crops') ? 'Crops directory detected.' : null,
920
+ ctx.hasDir('farm') ? 'Farm directory detected.' : null,
921
+ ]);
922
+ }
923
+
924
+ // BioTech detection
925
+ if (
926
+ hasDependency(depKeys, [/^bionode/i, /^bioinformatics/i, /^@biom3\//i, /^openbabel/i]) ||
927
+ ctx.hasDir('bioinformatics') || ctx.hasDir('lab') || ctx.hasDir('sequences') || ctx.hasDir('genomics') ||
928
+ hasAnyFile(files, /(^|\/)(\.fasta|\.fastq|\.vcf|\.bam|\.sam)/i)
929
+ ) {
930
+ addMatch('biotech', [
931
+ 'Biotech or bioinformatics signals detected.',
932
+ ctx.hasDir('genomics') ? 'Genomics directory detected.' : null,
933
+ hasAnyFile(files, /(\.fasta|\.fastq|\.vcf)/i) ? 'Bioinformatics data files detected.' : null,
934
+ ]);
935
+ }
936
+
937
+ // Cybersecurity detection
938
+ if (
939
+ hasDependency(depKeys, [/^snort/i, /^suricata/i, /^zeek/i, /^wazuh/i, /^elastic-siem/i, /^splunk/i, /^@elastic\/elasticsearch$/i]) ||
940
+ ctx.hasDir('threats') || ctx.hasDir('incidents') || ctx.hasDir('siem') || ctx.hasDir('detection-rules') ||
941
+ (pkg.keywords && pkg.keywords.some(k => ['cybersecurity', 'siem', 'threat-detection', 'incident-response'].includes(k)))
942
+ ) {
943
+ addMatch('cybersecurity', [
944
+ 'Cybersecurity or threat detection signals detected.',
945
+ ctx.hasDir('detection-rules') ? 'Detection rules directory detected.' : null,
946
+ ctx.hasDir('incidents') ? 'Incidents directory detected.' : null,
947
+ ]);
948
+ }
949
+
950
+ // Logistics detection
951
+ if (
952
+ hasDependency(depKeys, [/^graphhopper/i, /^osrm/i, /^mapbox-directions/i, /^@googlemaps\//i]) ||
953
+ ctx.hasDir('routes') || ctx.hasDir('fleet') || ctx.hasDir('shipments') || ctx.hasDir('warehouse') ||
954
+ (pkg.keywords && pkg.keywords.some(k => ['logistics', 'fleet', 'routing', 'shipment', 'warehouse'].includes(k)))
955
+ ) {
956
+ addMatch('logistics', [
957
+ 'Logistics or fleet management signals detected.',
958
+ ctx.hasDir('fleet') ? 'Fleet directory detected.' : null,
959
+ ctx.hasDir('shipments') ? 'Shipments directory detected.' : null,
960
+ ]);
961
+ }
962
+
963
+ // Media detection
964
+ if (
965
+ hasDependency(depKeys, [/^keystonejs/i, /^@keystonejs\//i, /^ghost/i, /^@tryghost\//i, /^wordpress/i, /^tinymce/i]) ||
966
+ ctx.hasDir('editorial') || ctx.hasDir('dam') || ctx.hasDir('assets/media') || ctx.hasDir('publications') ||
967
+ (pkg.keywords && pkg.keywords.some(k => ['media', 'publishing', 'editorial', 'digital-asset'].includes(k)))
968
+ ) {
969
+ addMatch('media', [
970
+ 'Media or digital publishing signals detected.',
971
+ hasDependency(depKeys, [/^keystonejs/i, /^@keystonejs\//i]) ? 'KeystoneJS CMS detected.' : null,
972
+ ctx.hasDir('editorial') ? 'Editorial directory detected.' : null,
973
+ ]);
974
+ }
975
+
976
+ // Social detection
977
+ if (
978
+ hasDependency(depKeys, [/^stream-chat/i, /^@stream-io\//i, /^getstream/i, /^socket\.io$/i, /^perspective-api/i]) ||
979
+ ctx.hasDir('feed') || ctx.hasDir('moderation') || ctx.hasDir('messaging') || ctx.hasDir('social') ||
980
+ (pkg.keywords && pkg.keywords.some(k => ['social', 'feed', 'moderation', 'messaging', 'community'].includes(k)))
981
+ ) {
982
+ addMatch('social', [
983
+ 'Social platform signals detected.',
984
+ ctx.hasDir('feed') ? 'Feed directory detected.' : null,
985
+ ctx.hasDir('moderation') ? 'Moderation directory detected.' : null,
986
+ ]);
987
+ }
988
+
989
+ // Travel detection
990
+ if (
991
+ hasDependency(depKeys, [/^amadeus/i, /^sabre/i, /^travelport/i, /^booking/i, /^skyscanner/i]) ||
992
+ ctx.hasDir('bookings') || ctx.hasDir('reservations') || ctx.hasDir('itineraries') || ctx.hasDir('pricing') ||
993
+ (pkg.keywords && pkg.keywords.some(k => ['travel', 'booking', 'gds', 'hospitality', 'reservation'].includes(k)))
994
+ ) {
995
+ addMatch('travel', [
996
+ 'Travel or booking platform signals detected.',
997
+ hasDependency(depKeys, [/^amadeus/i]) ? 'Amadeus GDS dependency detected.' : null,
998
+ ctx.hasDir('bookings') ? 'Bookings directory detected.' : null,
999
+ ]);
1000
+ }
1001
+
1002
+ // Insurance detection
1003
+ if (
1004
+ hasDependency(depKeys, [/^guidewire/i, /^duck-creek/i, /^actuarial/i, /^socotra/i]) ||
1005
+ ctx.hasDir('claims') || ctx.hasDir('underwriting') || ctx.hasDir('policies') || ctx.hasDir('risk-models') ||
1006
+ (pkg.keywords && pkg.keywords.some(k => ['insurance', 'insurtech', 'claims', 'underwriting', 'actuarial'].includes(k)))
1007
+ ) {
1008
+ addMatch('insurance', [
1009
+ 'Insurance or risk management signals detected.',
1010
+ ctx.hasDir('claims') ? 'Claims directory detected.' : null,
1011
+ ctx.hasDir('underwriting') ? 'Underwriting directory detected.' : null,
1012
+ ]);
1013
+ }
1014
+
1015
+ // Energy detection
1016
+ if (
1017
+ hasDependency(depKeys, [/^openadr/i, /^green-button/i, /^iec61850/i, /^modbus/i, /^opc-ua/i]) ||
1018
+ ctx.hasDir('grid') || ctx.hasDir('metering') || ctx.hasDir('energy') || ctx.hasDir('renewables') ||
1019
+ (pkg.keywords && pkg.keywords.some(k => ['energy', 'smart-grid', 'metering', 'renewable', 'utility'].includes(k)))
1020
+ ) {
1021
+ addMatch('energy', [
1022
+ 'Energy or grid management signals detected.',
1023
+ ctx.hasDir('grid') ? 'Grid directory detected.' : null,
1024
+ ctx.hasDir('metering') ? 'Metering directory detected.' : null,
1025
+ ]);
1026
+ }
1027
+ }
1028
+
1029
+ module.exports = {
1030
+ PACK_BLUEPRINTS,
1031
+ buildAdditionalDomainPacks,
1032
+ detectAdditionalDomainPacks,
1033
+ };