@nerviq/cli 1.29.0 → 1.30.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 (93) hide show
  1. package/CHANGELOG.md +1764 -1493
  2. package/README.md +568 -538
  3. package/SECURITY.md +78 -82
  4. package/bin/cli.js +2838 -2558
  5. package/docs/api-reference.md +356 -356
  6. package/docs/audit-fix.md +109 -0
  7. package/docs/autofix.md +3 -62
  8. package/docs/getting-started.md +1 -1
  9. package/docs/index.html +592 -592
  10. package/docs/integration-contracts.md +287 -287
  11. package/docs/maintenance.md +128 -128
  12. package/docs/new-platform-guide.md +202 -202
  13. package/docs/release-process.md +63 -0
  14. package/docs/shallow-risk.md +244 -244
  15. package/docs/why-nerviq.md +82 -82
  16. package/package.json +75 -67
  17. package/sdk/README.md +12 -3
  18. package/sdk/examples/langchain-integration.md +128 -0
  19. package/sdk/examples/self-governing-agent.js +135 -0
  20. package/sdk/index.d.ts +115 -0
  21. package/sdk/index.js +94 -0
  22. package/sdk/package.json +11 -0
  23. package/src/activity.js +13 -0
  24. package/src/aider/activity.js +226 -226
  25. package/src/aider/context.js +162 -162
  26. package/src/aider/freshness.js +123 -123
  27. package/src/aider/techniques.js +3465 -3465
  28. package/src/audit/layers.js +180 -180
  29. package/src/audit.js +1133 -1032
  30. package/src/auto-suggest.js +9 -2
  31. package/src/behavioral-drift.js +37 -2
  32. package/src/benchmark.js +299 -299
  33. package/src/codex/activity.js +324 -324
  34. package/src/codex/freshness.js +149 -142
  35. package/src/codex/techniques.js +4895 -4895
  36. package/src/context.js +326 -326
  37. package/src/continuous-ops.js +11 -1
  38. package/src/convert.js +340 -340
  39. package/src/copilot/config-parser.js +280 -280
  40. package/src/copilot/context.js +218 -218
  41. package/src/copilot/freshness.js +184 -177
  42. package/src/copilot/patch.js +238 -238
  43. package/src/copilot/techniques.js +3578 -3578
  44. package/src/cursor/freshness.js +194 -194
  45. package/src/cursor/patch.js +243 -243
  46. package/src/cursor/techniques.js +3735 -3735
  47. package/src/doctor.js +201 -201
  48. package/src/fix-engine.js +511 -8
  49. package/src/formatters/csv.js +86 -86
  50. package/src/formatters/junit.js +123 -123
  51. package/src/formatters/markdown.js +164 -164
  52. package/src/formatters/otel.js +151 -151
  53. package/src/freshness.js +163 -156
  54. package/src/gemini/activity.js +402 -402
  55. package/src/gemini/context.js +290 -290
  56. package/src/gemini/freshness.js +188 -188
  57. package/src/gemini/patch.js +229 -229
  58. package/src/gemini/techniques.js +3811 -3811
  59. package/src/governance.js +533 -533
  60. package/src/harmony/audit.js +306 -306
  61. package/src/i18n.js +63 -63
  62. package/src/insights.js +119 -119
  63. package/src/integrations.js +134 -134
  64. package/src/locales/en.json +33 -33
  65. package/src/locales/es.json +33 -33
  66. package/src/migrate.js +354 -354
  67. package/src/opencode/activity.js +286 -286
  68. package/src/opencode/freshness.js +137 -137
  69. package/src/opencode/techniques.js +3450 -3450
  70. package/src/safe-glyph.js +97 -0
  71. package/src/setup/analysis.js +12 -12
  72. package/src/setup.js +13 -6
  73. package/src/shallow-risk/index.js +113 -56
  74. package/src/shallow-risk/patterns/agent-config-cross-platform-drift.js +51 -50
  75. package/src/shallow-risk/patterns/agent-config-dangerous-autoapprove.js +47 -46
  76. package/src/shallow-risk/patterns/agent-config-deprecated-keys.js +47 -46
  77. package/src/shallow-risk/patterns/agent-config-framework-version-mismatch.js +138 -0
  78. package/src/shallow-risk/patterns/agent-config-missing-file.js +318 -317
  79. package/src/shallow-risk/patterns/agent-config-script-not-in-package-json.js +108 -0
  80. package/src/shallow-risk/patterns/agent-config-secret-literal.js +52 -49
  81. package/src/shallow-risk/patterns/agent-config-stack-contradiction.js +35 -34
  82. package/src/shallow-risk/patterns/hook-script-missing.js +71 -70
  83. package/src/shallow-risk/patterns/mcp-server-no-allowlist.js +53 -52
  84. package/src/shallow-risk/shared.js +653 -648
  85. package/src/source-urls.js +295 -295
  86. package/src/state-paths.js +85 -85
  87. package/src/supplemental-checks.js +805 -805
  88. package/src/telemetry.js +160 -160
  89. package/src/watch.js +46 -0
  90. package/src/windsurf/context.js +359 -359
  91. package/src/windsurf/freshness.js +194 -194
  92. package/src/windsurf/patch.js +231 -231
  93. package/src/windsurf/techniques.js +3779 -3779
@@ -1,356 +1,356 @@
1
- # API Reference
2
-
3
- This document covers every function export surfaced through `src/index.js`. Constants and classes are intentionally omitted.
4
-
5
- Return types are documented at the API boundary level. Most workflows return structured objects; formatter helpers return strings; async workflows return promises.
6
-
7
- Known unresolved index aliases: `copilotInteractive`, `cursorInteractive`, and `windsurfInteractive` are present in `src/index.js`, but currently resolve `undefined` at runtime because their source modules export differently named wizard functions.
8
-
9
- ## Example Recipes
10
-
11
- ### audit
12
-
13
- ```js
14
- const { audit } = require('@nerviq/cli');
15
-
16
- const result = await audit({
17
- dir: process.cwd(),
18
- format: 'json',
19
- });
20
-
21
- console.log(result.summary);
22
- ```
23
-
24
- ### setup
25
-
26
- ```js
27
- const { setup } = require('@nerviq/cli');
28
-
29
- await setup({
30
- dir: process.cwd(),
31
- template: 'claude-md',
32
- force: false,
33
- });
34
- ```
35
-
36
- ### buildProposalBundle
37
-
38
- ```js
39
- const { buildProposalBundle } = require('@nerviq/cli');
40
-
41
- const bundle = await buildProposalBundle({
42
- dir: process.cwd(),
43
- stacks: ['node', 'react'],
44
- });
45
-
46
- console.log(bundle.files);
47
- ```
48
-
49
- ### applyProposalBundle
50
-
51
- ```js
52
- const { buildProposalBundle, applyProposalBundle } = require('@nerviq/cli');
53
-
54
- const bundle = await buildProposalBundle({ dir: process.cwd() });
55
- await applyProposalBundle({ dir: process.cwd(), bundle });
56
- ```
57
-
58
- ### setupCodex
59
-
60
- ```js
61
- const { setupCodex } = require('@nerviq/cli');
62
-
63
- await setupCodex({
64
- dir: process.cwd(),
65
- mode: 'guided',
66
- });
67
- ```
68
-
69
- ### setupGemini
70
-
71
- ```js
72
- const { setupGemini } = require('@nerviq/cli');
73
-
74
- await setupGemini({
75
- dir: process.cwd(),
76
- mcpPacks: ['filesystem', 'github'],
77
- });
78
- ```
79
-
80
- ### harmonyAudit
81
-
82
- ```js
83
- const { harmonyAudit } = require('@nerviq/cli');
84
-
85
- const report = await harmonyAudit({ dir: process.cwd() });
86
- console.log(report.recommendations);
87
- ```
88
-
89
- ### generateStrategicAdvice
90
-
91
- ```js
92
- const { buildCanonicalModel, generateStrategicAdvice } = require('@nerviq/cli');
93
-
94
- const canon = buildCanonicalModel(process.cwd());
95
- const advice = generateStrategicAdvice(canon, []);
96
- console.log(advice);
97
- ```
98
-
99
- ### synergyReport (Experimental)
100
-
101
- ```js
102
- const { synergyReport } = require('@nerviq/cli');
103
-
104
- const report = await synergyReport(process.cwd());
105
- console.log(report.score);
106
- ```
107
-
108
- ### createServer
109
-
110
- ```js
111
- const { createServer } = require('@nerviq/cli');
112
-
113
- const server = createServer({ baseDir: process.cwd() });
114
- server.listen(4310);
115
-
116
- // GET http://127.0.0.1:4310/api/openapi.json
117
- // GET http://127.0.0.1:4310/api/health
118
- // GET http://127.0.0.1:4310/api/catalog
119
- // GET http://127.0.0.1:4310/api/audit?platform=claude&dir=.
120
- // GET http://127.0.0.1:4310/api/harmony?dir=.
121
- ```
122
-
123
- ### buildServeOpenApiSpec
124
-
125
- ```js
126
- const { buildServeOpenApiSpec } = require('@nerviq/cli');
127
-
128
- const spec = buildServeOpenApiSpec({
129
- serverUrl: 'http://127.0.0.1:4310',
130
- });
131
-
132
- console.log(spec.paths['/api/audit'].get.parameters);
133
- ```
134
-
135
- ## Core
136
-
137
- Source modules: `src/audit.js`, `src/setup.js`, `src/analyze.js`, `src/plans.js`, `src/governance.js`, `src/benchmark.js`, `src/domain-packs.js`, `src/mcp-packs.js`, `src/activity.js`, `src/public-api.js`, `src/server.js`, `src/formatters/sarif.js`
138
-
139
- | Function | Signature | Returns | Description |
140
- | --- | --- | --- | --- |
141
- | `audit` | `audit(options)` | `Promise<object>` | Run the primary NERVIQ audit pipeline against a project directory. |
142
- | `setup` | `setup(options)` | `Promise<object>` | Apply the primary NERVIQ setup flow and write managed project scaffolding. |
143
- | `analyzeProject` | `analyzeProject(options)` | `Promise<object>` | Inspect a project and return the raw analysis used by higher-level flows, including archetype, operating profile, and adopt/defer/ignore guidance. |
144
- | `buildProposalBundle` | `buildProposalBundle(options)` | `Promise<object>` | Build a file-change proposal bundle without writing it to disk. |
145
- | `applyProposalBundle` | `applyProposalBundle(options)` | `Promise<object>` | Apply a previously generated proposal bundle to a target project. |
146
- | `getGovernanceSummary` | `getGovernanceSummary(platform = 'claude')` | `object` | Return governance guidance for the selected platform family. |
147
- | `runBenchmark` | `runBenchmark(options)` | `Promise<object>` | Execute the benchmark pipeline and collect timing and score output. |
148
- | `detectDomainPacks` | `detectDomainPacks(ctx, stacks, assets = null)` | `array` | Detect domain packs for the current project. |
149
- | `getMcpPack` | `getMcpPack(key)` | `object` | Return mcp pack from the core module. |
150
- | `mergeMcpServers` | `mergeMcpServers(existing = {}, packKeys = [])` | `object` | Merge mcp servers into an existing value. |
151
- | `getMcpPackPreflight` | `getMcpPackPreflight(packKeys = [], env = process.env)` | `object` | Return mcp pack preflight from the core module. |
152
- | `recommendMcpPacks` | `recommendMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend mcp packs based on detected project context. |
153
- | `recordRecommendationOutcome` | `recordRecommendationOutcome(dir, payload)` | `object` | Record recommendation outcome in the project activity history. |
154
- | `getRecommendationOutcomeSummary` | `getRecommendationOutcomeSummary(dir)` | `object` | Return recommendation outcome summary from the core module. |
155
- | `formatRecommendationOutcomeSummary` | `formatRecommendationOutcomeSummary(dir)` | `string` | Format recommendation outcome summary for display or export. |
156
- | `detectPlatforms` | `detectPlatforms(dir)` | `array` | Detect which agent platforms are active in the target repository. |
157
- | `getCatalog` | `getCatalog()` | `object` | Return the public catalog of supported platforms, packs, and capabilities. |
158
- | `synergyReport` | `synergyReport(dir)` | `Promise<object>` | (Experimental) Run the public cross-platform synergy report workflow for a repository. |
159
- | `buildServeOpenApiSpec` | `buildServeOpenApiSpec(options = {})` | `object` | Build the OpenAPI 3.1 contract for the local `nerviq serve` HTTP surface. |
160
- | `createServer` | `createServer(options = {})` | `http.Server` | Create the HTTP server used by the package API and local integrations. |
161
- | `startServer` | `startServer(options = {})` | `Promise<http.Server>` | Start the package HTTP server with the supplied runtime options. |
162
- | `getPlatformChangeManifest` | `getPlatformChangeManifest()` | `array` | Return the canonical platform-change watchlist manifest for all supported platforms. |
163
- | `summarizePlatformChangeManifest` | `summarizePlatformChangeManifest()` | `object` | Return a summary of tracked platform sources, cadence, and update-trigger counts. |
164
- | `formatSarif` | `formatSarif(auditResult, options = {})` | `string` | Format an audit result as SARIF output for code scanning tools. |
165
-
166
- ## Codex
167
-
168
- Source modules: `src/codex/*`
169
-
170
- | Function | Signature | Returns | Description |
171
- | --- | --- | --- | --- |
172
- | `detectCodexVersion` | `detectCodexVersion()` | `object` | Detect codex version for the current project. |
173
- | `recommendCodexMcpPacks` | `recommendCodexMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend codex mcp packs based on detected project context. |
174
- | `getCodexMcpPreflight` | `getCodexMcpPreflight(packKeys = [], env = process.env)` | `object` | Return codex mcp preflight from the codex module. |
175
- | `mergeCodexMcpToml` | `mergeCodexMcpToml(existingConfigContent = '', packKeys = [])` | `string` | Merge codex mcp toml into an existing value. |
176
- | `buildCodexProposalBundle` | `buildCodexProposalBundle(options)` | `Promise<object>` | Build codex proposal bundle for downstream codex workflows. |
177
- | `setupCodex` | `setupCodex(options)` | `Promise<object>` | Set up codex configuration and managed project files. |
178
- | `getCodexHistory` | `getCodexHistory(dir, limit = 20)` | `array` | Return codex history from the codex module. |
179
- | `formatCodexHistory` | `formatCodexHistory(dir)` | `string` | Format codex history for display or export. |
180
- | `compareCodexLatest` | `compareCodexLatest(dir)` | `object` | Compare codex latest against the latest recorded baseline. |
181
- | `exportCodexTrendReport` | `exportCodexTrendReport(dir)` | `object` | Export codex trend report for reporting or downstream processing. |
182
- | `recordCodexFeedback` | `recordCodexFeedback(dir, payload)` | `object` | Record codex feedback in the project activity history. |
183
- | `formatCodexFeedback` | `formatCodexFeedback(dir)` | `string` | Format codex feedback for display or export. |
184
- | `generateCodexInsights` | `generateCodexInsights(dir)` | `object` | Generate codex insights from codex inputs. |
185
- | `formatCodexInsights` | `formatCodexInsights(dir)` | `string` | Format codex insights for display or export. |
186
- | `patchAgentsMd` | `patchAgentsMd(existingContent, managedSections)` | `string` | Patch agents md with managed sections. |
187
- | `patchConfigToml` | `patchConfigToml(existingContent, newSections)` | `string` | Patch config toml with managed sections. |
188
- | `detectMixedAgentRepo` | `detectMixedAgentRepo(dir)` | `object` | Detect mixed agent repo for the current project. |
189
- | `applyPatch` | `applyPatch(dir, filePath, patchFn, options = {})` | `object` | Apply patch to the target project or model. |
190
- | `getCodexGovernanceSummary` | `getCodexGovernanceSummary()` | `object` | Return codex governance summary from the codex module. |
191
- | `checkReleaseGate` | `checkReleaseGate(sourceVerifications = {})` | `object` | Check release gate and return the evaluation result. |
192
- | `formatReleaseGate` | `formatReleaseGate(gateResult)` | `string` | Format release gate for display or export. |
193
- | `getPropagationTargets` | `getPropagationTargets(triggerKeyword)` | `array` | Return propagation targets from the codex module. |
194
- | `runCodexDeepReview` | `runCodexDeepReview(options)` | `Promise<object>` | Run the codex deep review workflow. |
195
- | `collectCodexConfig` | `collectCodexConfig(ctx, stacks)` | `object` | Collect codex config into a structured object. |
196
- | `buildCodexReviewPayload` | `buildCodexReviewPayload(config)` | `object` | Build codex review payload for downstream codex workflows. |
197
- | `codexInteractive` | `codexInteractive(options = {})` | `Promise<object|null>` | Return the codex interactive capability from the codex module. |
198
- | `composePacks` | `composePacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose packs into a combined configuration payload. |
199
- | `getCiTemplate` | `getCiTemplate(templateKey)` | `object` | Return ci template from the codex module. |
200
- | `checkAdoptionGate` | `checkAdoptionGate(gateKey, dir)` | `object` | Check adoption gate and return the evaluation result. |
201
-
202
- ## Gemini
203
-
204
- Source modules: `src/gemini/*`
205
-
206
- | Function | Signature | Returns | Description |
207
- | --- | --- | --- | --- |
208
- | `detectGeminiVersion` | `detectGeminiVersion()` | `object` | Detect gemini version for the current project. |
209
- | `recommendGeminiMcpPacks` | `recommendGeminiMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend gemini mcp packs based on detected project context. |
210
- | `getGeminiMcpPreflight` | `getGeminiMcpPreflight(packKeys = [], env = process.env)` | `object` | Return gemini mcp preflight from the gemini module. |
211
- | `mergeGeminiMcpJson` | `mergeGeminiMcpJson(existingSettings = {}, packKeys = [])` | `object` | Merge gemini mcp json into an existing value. |
212
- | `detectGeminiDomainPacks` | `detectGeminiDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect gemini domain packs for the current project. |
213
- | `buildGeminiProposalBundle` | `buildGeminiProposalBundle(options)` | `Promise<object>` | Build gemini proposal bundle for downstream gemini workflows. |
214
- | `setupGemini` | `setupGemini(options)` | `Promise<object>` | Set up gemini configuration and managed project files. |
215
- | `getGeminiGovernanceSummary` | `getGeminiGovernanceSummary()` | `object` | Return gemini governance summary from the gemini module. |
216
- | `getGeminiHistory` | `getGeminiHistory(dir, limit = 20)` | `array` | Return gemini history from the gemini module. |
217
- | `formatGeminiHistory` | `formatGeminiHistory(dir)` | `string` | Format gemini history for display or export. |
218
- | `compareGeminiLatest` | `compareGeminiLatest(dir)` | `object` | Compare gemini latest against the latest recorded baseline. |
219
- | `exportGeminiTrendReport` | `exportGeminiTrendReport(dir)` | `object` | Export gemini trend report for reporting or downstream processing. |
220
- | `recordGeminiFeedback` | `recordGeminiFeedback(dir, payload)` | `object` | Record gemini feedback in the project activity history. |
221
- | `formatGeminiFeedback` | `formatGeminiFeedback(dir)` | `string` | Format gemini feedback for display or export. |
222
- | `generateGeminiInsights` | `generateGeminiInsights(dir)` | `object` | Generate gemini insights from gemini inputs. |
223
- | `formatGeminiInsights` | `formatGeminiInsights(dir)` | `string` | Format gemini insights for display or export. |
224
- | `patchGeminiMd` | `patchGeminiMd(existingContent, managedSections)` | `string` | Patch gemini md with managed sections. |
225
- | `patchSettingsJson` | `patchSettingsJson(existingContent, newKeys)` | `object` | Patch settings json with managed sections. |
226
- | `detectMixedAgentRepoGemini` | `detectMixedAgentRepoGemini(dir)` | `object` | Detect mixed agent repo gemini for the current project. |
227
- | `checkGeminiReleaseGate` | `checkGeminiReleaseGate(sourceVerifications = {})` | `object` | Check gemini release gate and return the evaluation result. |
228
- | `formatGeminiReleaseGate` | `formatGeminiReleaseGate(gateResult)` | `string` | Format gemini release gate for display or export. |
229
- | `runGeminiDeepReview` | `runGeminiDeepReview(options)` | `Promise<object>` | Run the gemini deep review workflow. |
230
- | `collectGeminiConfig` | `collectGeminiConfig(ctx, stacks)` | `object` | Collect gemini config into a structured object. |
231
- | `geminiInteractive` | `geminiInteractive(options = {})` | `Promise<object|null>` | Return the gemini interactive capability from the gemini module. |
232
- | `composeGeminiPacks` | `composeGeminiPacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose gemini packs into a combined configuration payload. |
233
- | `getGeminiCiTemplate` | `getGeminiCiTemplate(templateKey)` | `object` | Return gemini ci template from the gemini module. |
234
- | `checkGeminiAdoptionGate` | `checkGeminiAdoptionGate(gateKey, dir)` | `object` | Check gemini adoption gate and return the evaluation result. |
235
-
236
- ## Copilot
237
-
238
- Source modules: `src/copilot/*`
239
-
240
- | Function | Signature | Returns | Description |
241
- | --- | --- | --- | --- |
242
- | `recommendCopilotMcpPacks` | `recommendCopilotMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend copilot mcp packs based on detected project context. |
243
- | `getCopilotMcpPreflight` | `getCopilotMcpPreflight(packKeys = [], env = process.env)` | `object` | Return copilot mcp preflight from the copilot module. |
244
- | `detectCopilotDomainPacks` | `detectCopilotDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect copilot domain packs for the current project. |
245
- | `buildCopilotProposalBundle` | `buildCopilotProposalBundle(options)` | `Promise<object>` | Build copilot proposal bundle for downstream copilot workflows. |
246
- | `setupCopilot` | `setupCopilot(options)` | `Promise<object>` | Set up copilot configuration and managed project files. |
247
- | `getCopilotGovernanceSummary` | `getCopilotGovernanceSummary()` | `object` | Return copilot governance summary from the copilot module. |
248
- | `getCopilotHistory` | `getCopilotHistory(dir, limit = 20)` | `array` | Return copilot history from the copilot module. |
249
- | `formatCopilotHistory` | `formatCopilotHistory(dir)` | `string` | Format copilot history for display or export. |
250
- | `compareCopilotLatest` | `compareCopilotLatest(dir)` | `object` | Compare copilot latest against the latest recorded baseline. |
251
- | `exportCopilotTrendReport` | `exportCopilotTrendReport(dir)` | `object` | Export copilot trend report for reporting or downstream processing. |
252
- | `generateCopilotInsights` | `generateCopilotInsights(dir)` | `object` | Generate copilot insights from copilot inputs. |
253
- | `runCopilotDeepReview` | `runCopilotDeepReview(options)` | `Promise<object>` | Run the copilot deep review workflow. |
254
- | `copilotInteractive` | `copilotInteractive(...)` | `undefined` | Reserved index export for the Copilot interactive wizard; currently unresolved at runtime. The index exports `copilotInteractive`, but `src/copilot/interactive.js` currently exports `runCopilotWizard` and `runProjectDetection`. |
255
- | `composeCopilotPacks` | `composeCopilotPacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose copilot packs into a combined configuration payload. |
256
- | `getCopilotCiTemplate` | `getCopilotCiTemplate(templateKey)` | `object` | Return copilot ci template from the copilot module. |
257
- | `checkCopilotAdoptionGate` | `checkCopilotAdoptionGate(gateKey, dir)` | `object` | Check copilot adoption gate and return the evaluation result. |
258
-
259
- ## Cursor
260
-
261
- Source modules: `src/cursor/*`
262
-
263
- | Function | Signature | Returns | Description |
264
- | --- | --- | --- | --- |
265
- | `recommendCursorMcpPacks` | `recommendCursorMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend cursor mcp packs based on detected project context. |
266
- | `detectCursorDomainPacks` | `detectCursorDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect cursor domain packs for the current project. |
267
- | `buildCursorProposalBundle` | `buildCursorProposalBundle(options)` | `Promise<object>` | Build cursor proposal bundle for downstream cursor workflows. |
268
- | `setupCursor` | `setupCursor(options)` | `Promise<object>` | Set up cursor configuration and managed project files. |
269
- | `getCursorGovernanceSummary` | `getCursorGovernanceSummary()` | `object` | Return cursor governance summary from the cursor module. |
270
- | `getCursorHistory` | `getCursorHistory(dir, limit = 20)` | `array` | Return cursor history from the cursor module. |
271
- | `compareCursorLatest` | `compareCursorLatest(dir)` | `object` | Compare cursor latest against the latest recorded baseline. |
272
- | `generateCursorInsights` | `generateCursorInsights(dir)` | `object` | Generate cursor insights from cursor inputs. |
273
- | `runCursorDeepReview` | `runCursorDeepReview(options)` | `Promise<object>` | Run the cursor deep review workflow. |
274
- | `cursorInteractive` | `cursorInteractive(...)` | `undefined` | Reserved index export for the Cursor interactive wizard; currently unresolved at runtime. The index exports `cursorInteractive`, but `src/cursor/interactive.js` currently exports `runCursorWizard` and `runProjectDetection`. |
275
- | `composeCursorPacks` | `composeCursorPacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose cursor packs into a combined configuration payload. |
276
- | `checkCursorAdoptionGate` | `checkCursorAdoptionGate(gateKey, dir)` | `object` | Check cursor adoption gate and return the evaluation result. |
277
-
278
- ## Windsurf
279
-
280
- Source modules: `src/windsurf/*`
281
-
282
- | Function | Signature | Returns | Description |
283
- | --- | --- | --- | --- |
284
- | `detectWindsurfDomainPacks` | `detectWindsurfDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect windsurf domain packs for the current project. |
285
- | `setupWindsurf` | `setupWindsurf(options)` | `Promise<object>` | Set up windsurf configuration and managed project files. |
286
- | `getWindsurfGovernanceSummary` | `getWindsurfGovernanceSummary()` | `object` | Return windsurf governance summary from the windsurf module. |
287
- | `runWindsurfDeepReview` | `runWindsurfDeepReview(options)` | `Promise<object>` | Run the windsurf deep review workflow. |
288
- | `windsurfInteractive` | `windsurfInteractive(...)` | `undefined` | Reserved index export for the Windsurf interactive wizard; currently unresolved at runtime. The index exports `windsurfInteractive`, but `src/windsurf/interactive.js` currently exports `runWindsurfWizard` and `runProjectDetection`. |
289
-
290
- ## Aider
291
-
292
- Source modules: `src/aider/*`
293
-
294
- | Function | Signature | Returns | Description |
295
- | --- | --- | --- | --- |
296
- | `detectAiderDomainPacks` | `detectAiderDomainPacks(ctx)` | `object` | Detect aider domain packs for the current project. |
297
- | `setupAider` | `setupAider(options = {})` | `Promise<object>` | Set up aider configuration and managed project files. |
298
- | `getAiderGovernanceSummary` | `getAiderGovernanceSummary()` | `object` | Return aider governance summary from the aider module. |
299
- | `runAiderDeepReview` | `runAiderDeepReview(dir)` | `Promise<object>` | Run the aider deep review workflow. |
300
- | `aiderInteractive` | `aiderInteractive(dir)` | `Promise<object|null>` | Return the aider interactive capability from the aider module. |
301
-
302
- ## OpenCode
303
-
304
- Source modules: `src/opencode/*`
305
-
306
- | Function | Signature | Returns | Description |
307
- | --- | --- | --- | --- |
308
- | `detectOpenCodeDomainPacks` | `detectOpenCodeDomainPacks(ctx, stacks = [])` | `object` | Detect open code domain packs for the current project. |
309
- | `setupOpenCode` | `setupOpenCode(options)` | `Promise<object>` | Set up opencode configuration and managed project files. |
310
- | `getOpenCodeGovernanceSummary` | `getOpenCodeGovernanceSummary()` | `object` | Return open code governance summary from the opencode module. |
311
- | `runOpenCodeDeepReview` | `runOpenCodeDeepReview(options)` | `Promise<object>` | Run the open code deep review workflow. |
312
- | `opencodeInteractive` | `opencodeInteractive(options = {})` | `Promise<object|null>` | Return the opencode interactive capability from the opencode module. |
313
-
314
- ## Harmony
315
-
316
- Source modules: `src/harmony/*`
317
-
318
- | Function | Signature | Returns | Description |
319
- | --- | --- | --- | --- |
320
- | `buildCanonicalModel` | `buildCanonicalModel(dir)` | `object` | Build the Harmony canonical model from the current repository state. |
321
- | `detectActivePlatforms` | `detectActivePlatforms(dir)` | `array` | Detect active platforms for the current project. |
322
- | `detectDrift` | `detectDrift(canonicalModel)` | `object` | Detect drift for the current project. |
323
- | `formatDriftReport` | `formatDriftReport(driftResult, options = {})` | `string` | Format drift report for display or export. |
324
- | `harmonyAudit` | `harmonyAudit(options)` | `Promise<object>` | Run the Harmony audit across detected platform configurations. |
325
- | `formatHarmonyAuditReport` | `formatHarmonyAuditReport(result)` | `string` | Format harmony audit report for display or export. |
326
- | `generateHarmonySync` | `generateHarmonySync(canonicalModel, options = {})` | `object` | Generate harmony sync from harmony inputs. |
327
- | `applyHarmonySync` | `applyHarmonySync(dir, options = {})` | `object` | Apply harmony sync to the target project or model. |
328
- | `previewHarmonySync` | `previewHarmonySync(dir, options = {})` | `object` | Return the preview harmony sync capability from the harmony module. |
329
- | `generateStrategicAdvice` | `generateStrategicAdvice(canonicalModel, platformAudits)` | `object` | Generate cross-platform platform advice from the canonical model and audits. |
330
- | `startHarmonyWatch` | `startHarmonyWatch(options)` | `Promise<object>` | Start harmony watch and return the running handle. |
331
- | `saveHarmonyState` | `saveHarmonyState(dir, state)` | `object` | Save harmony state to persistent storage. |
332
- | `loadHarmonyState` | `loadHarmonyState(dir)` | `object` | Load harmony state from persistent storage. |
333
- | `getHarmonyHistory` | `getHarmonyHistory(dir, filter)` | `array` | Return harmony history from the harmony module. |
334
- | `getHarmonyGovernanceSummary` | `getHarmonyGovernanceSummary(canonicalModel, platformAudits)` | `object` | Return harmony governance summary from the harmony module. |
335
- | `formatHarmonyGovernanceReport` | `formatHarmonyGovernanceReport(summary, options)` | `string` | Format harmony governance report for display or export. |
336
-
337
- ## Synergy (Experimental)
338
-
339
- Source modules: `src/synergy/*` — static-rule research surface. Do not rely on for production task routing.
340
-
341
- | Function | Signature | Returns | Description |
342
- | --- | --- | --- | --- |
343
- | `propagateInsight` | `propagateInsight(insight, sourcePlatform, targetPlatforms)` | `object` | Propagate insight across selected platforms. |
344
- | `getCrossLearnings` | `getCrossLearnings(dir)` | `array` | Return cross learnings from the synergy module. |
345
- | `routeTask` | `routeTask(taskDescription, activePlatforms, projectHistory)` | `object` | Route a task description to the most suitable active platforms. |
346
- | `classifyTaskType` | `classifyTaskType(taskDescription)` | `string` | Classify task type into a known synergy category. |
347
- | `compoundAudit` | `compoundAudit(platformAudits)` | `object` | Combine audit into a single evidence view. |
348
- | `calculateAmplification` | `calculateAmplification(platformAudits)` | `number` | Calculate amplification for the current inputs. |
349
- | `analyzeCompensation` | `analyzeCompensation(activePlatforms, platformAudits)` | `object` | Analyze compensation and return structured findings. |
350
- | `getUncoveredGaps` | `getUncoveredGaps(activePlatforms)` | `array` | Return uncovered gaps from the synergy module. |
351
- | `discoverPatterns` | `discoverPatterns(harmonyHistory)` | `object` | Discover patterns from accumulated history. |
352
- | `rankRecommendations` | `rankRecommendations(recommendations, activePlatforms, context)` | `array` | Return the rank recommendations capability from the synergy module. |
353
- | `calculateSynergyScore` | `calculateSynergyScore(recommendation, activePlatforms, context)` | `number` | Calculate synergy score for the current inputs. |
354
- | `generateSynergyReport` | `generateSynergyReport(options)` | `Promise<object>` | Build the full Synergy report structure from routing and amplification inputs. |
355
- | `detectProjectChanges` | `detectProjectChanges(dir, previousCanon)` | `object` | Detect project changes for the current project. |
356
- | `generateAdaptiveUpdates` | `generateAdaptiveUpdates(changes)` | `object` | Generate adaptive updates from synergy inputs. |
1
+ # API Reference
2
+
3
+ This document covers every function export surfaced through `src/index.js`. Constants and classes are intentionally omitted.
4
+
5
+ Return types are documented at the API boundary level. Most workflows return structured objects; formatter helpers return strings; async workflows return promises.
6
+
7
+ Known unresolved index aliases: `copilotInteractive`, `cursorInteractive`, and `windsurfInteractive` are present in `src/index.js`, but currently resolve `undefined` at runtime because their source modules export differently named wizard functions.
8
+
9
+ ## Example Recipes
10
+
11
+ ### audit
12
+
13
+ ```js
14
+ const { audit } = require('@nerviq/cli');
15
+
16
+ const result = await audit({
17
+ dir: process.cwd(),
18
+ format: 'json',
19
+ });
20
+
21
+ console.log(result.summary);
22
+ ```
23
+
24
+ ### setup
25
+
26
+ ```js
27
+ const { setup } = require('@nerviq/cli');
28
+
29
+ await setup({
30
+ dir: process.cwd(),
31
+ template: 'claude-md',
32
+ force: false,
33
+ });
34
+ ```
35
+
36
+ ### buildProposalBundle
37
+
38
+ ```js
39
+ const { buildProposalBundle } = require('@nerviq/cli');
40
+
41
+ const bundle = await buildProposalBundle({
42
+ dir: process.cwd(),
43
+ stacks: ['node', 'react'],
44
+ });
45
+
46
+ console.log(bundle.files);
47
+ ```
48
+
49
+ ### applyProposalBundle
50
+
51
+ ```js
52
+ const { buildProposalBundle, applyProposalBundle } = require('@nerviq/cli');
53
+
54
+ const bundle = await buildProposalBundle({ dir: process.cwd() });
55
+ await applyProposalBundle({ dir: process.cwd(), bundle });
56
+ ```
57
+
58
+ ### setupCodex
59
+
60
+ ```js
61
+ const { setupCodex } = require('@nerviq/cli');
62
+
63
+ await setupCodex({
64
+ dir: process.cwd(),
65
+ mode: 'guided',
66
+ });
67
+ ```
68
+
69
+ ### setupGemini
70
+
71
+ ```js
72
+ const { setupGemini } = require('@nerviq/cli');
73
+
74
+ await setupGemini({
75
+ dir: process.cwd(),
76
+ mcpPacks: ['filesystem', 'github'],
77
+ });
78
+ ```
79
+
80
+ ### harmonyAudit
81
+
82
+ ```js
83
+ const { harmonyAudit } = require('@nerviq/cli');
84
+
85
+ const report = await harmonyAudit({ dir: process.cwd() });
86
+ console.log(report.recommendations);
87
+ ```
88
+
89
+ ### generateStrategicAdvice
90
+
91
+ ```js
92
+ const { buildCanonicalModel, generateStrategicAdvice } = require('@nerviq/cli');
93
+
94
+ const canon = buildCanonicalModel(process.cwd());
95
+ const advice = generateStrategicAdvice(canon, []);
96
+ console.log(advice);
97
+ ```
98
+
99
+ ### synergyReport (Experimental)
100
+
101
+ ```js
102
+ const { synergyReport } = require('@nerviq/cli');
103
+
104
+ const report = await synergyReport(process.cwd());
105
+ console.log(report.score);
106
+ ```
107
+
108
+ ### createServer
109
+
110
+ ```js
111
+ const { createServer } = require('@nerviq/cli');
112
+
113
+ const server = createServer({ baseDir: process.cwd() });
114
+ server.listen(4310);
115
+
116
+ // GET http://127.0.0.1:4310/api/openapi.json
117
+ // GET http://127.0.0.1:4310/api/health
118
+ // GET http://127.0.0.1:4310/api/catalog
119
+ // GET http://127.0.0.1:4310/api/audit?platform=claude&dir=.
120
+ // GET http://127.0.0.1:4310/api/harmony?dir=.
121
+ ```
122
+
123
+ ### buildServeOpenApiSpec
124
+
125
+ ```js
126
+ const { buildServeOpenApiSpec } = require('@nerviq/cli');
127
+
128
+ const spec = buildServeOpenApiSpec({
129
+ serverUrl: 'http://127.0.0.1:4310',
130
+ });
131
+
132
+ console.log(spec.paths['/api/audit'].get.parameters);
133
+ ```
134
+
135
+ ## Core
136
+
137
+ Source modules: `src/audit.js`, `src/setup.js`, `src/analyze.js`, `src/plans.js`, `src/governance.js`, `src/benchmark.js`, `src/domain-packs.js`, `src/mcp-packs.js`, `src/activity.js`, `src/public-api.js`, `src/server.js`, `src/formatters/sarif.js`
138
+
139
+ | Function | Signature | Returns | Description |
140
+ | --- | --- | --- | --- |
141
+ | `audit` | `audit(options)` | `Promise<object>` | Run the primary NERVIQ audit pipeline against a project directory. |
142
+ | `setup` | `setup(options)` | `Promise<object>` | Apply the primary NERVIQ setup flow and write managed project scaffolding. |
143
+ | `analyzeProject` | `analyzeProject(options)` | `Promise<object>` | Inspect a project and return the raw analysis used by higher-level flows, including archetype, operating profile, and adopt/defer/ignore guidance. |
144
+ | `buildProposalBundle` | `buildProposalBundle(options)` | `Promise<object>` | Build a file-change proposal bundle without writing it to disk. |
145
+ | `applyProposalBundle` | `applyProposalBundle(options)` | `Promise<object>` | Apply a previously generated proposal bundle to a target project. |
146
+ | `getGovernanceSummary` | `getGovernanceSummary(platform = 'claude')` | `object` | Return governance guidance for the selected platform family. |
147
+ | `runBenchmark` | `runBenchmark(options)` | `Promise<object>` | Execute the benchmark pipeline and collect timing and score output. |
148
+ | `detectDomainPacks` | `detectDomainPacks(ctx, stacks, assets = null)` | `array` | Detect domain packs for the current project. |
149
+ | `getMcpPack` | `getMcpPack(key)` | `object` | Return mcp pack from the core module. |
150
+ | `mergeMcpServers` | `mergeMcpServers(existing = {}, packKeys = [])` | `object` | Merge mcp servers into an existing value. |
151
+ | `getMcpPackPreflight` | `getMcpPackPreflight(packKeys = [], env = process.env)` | `object` | Return mcp pack preflight from the core module. |
152
+ | `recommendMcpPacks` | `recommendMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend mcp packs based on detected project context. |
153
+ | `recordRecommendationOutcome` | `recordRecommendationOutcome(dir, payload)` | `object` | Record recommendation outcome in the project activity history. |
154
+ | `getRecommendationOutcomeSummary` | `getRecommendationOutcomeSummary(dir)` | `object` | Return recommendation outcome summary from the core module. |
155
+ | `formatRecommendationOutcomeSummary` | `formatRecommendationOutcomeSummary(dir)` | `string` | Format recommendation outcome summary for display or export. |
156
+ | `detectPlatforms` | `detectPlatforms(dir)` | `array` | Detect which agent platforms are active in the target repository. |
157
+ | `getCatalog` | `getCatalog()` | `object` | Return the public catalog of supported platforms, packs, and capabilities. |
158
+ | `synergyReport` | `synergyReport(dir)` | `Promise<object>` | (Experimental) Run the public cross-platform synergy report workflow for a repository. |
159
+ | `buildServeOpenApiSpec` | `buildServeOpenApiSpec(options = {})` | `object` | Build the OpenAPI 3.1 contract for the local `nerviq serve` HTTP surface. |
160
+ | `createServer` | `createServer(options = {})` | `http.Server` | Create the HTTP server used by the package API and local integrations. |
161
+ | `startServer` | `startServer(options = {})` | `Promise<http.Server>` | Start the package HTTP server with the supplied runtime options. |
162
+ | `getPlatformChangeManifest` | `getPlatformChangeManifest()` | `array` | Return the canonical platform-change watchlist manifest for all supported platforms. |
163
+ | `summarizePlatformChangeManifest` | `summarizePlatformChangeManifest()` | `object` | Return a summary of tracked platform sources, cadence, and update-trigger counts. |
164
+ | `formatSarif` | `formatSarif(auditResult, options = {})` | `string` | Format an audit result as SARIF output for code scanning tools. |
165
+
166
+ ## Codex
167
+
168
+ Source modules: `src/codex/*`
169
+
170
+ | Function | Signature | Returns | Description |
171
+ | --- | --- | --- | --- |
172
+ | `detectCodexVersion` | `detectCodexVersion()` | `object` | Detect codex version for the current project. |
173
+ | `recommendCodexMcpPacks` | `recommendCodexMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend codex mcp packs based on detected project context. |
174
+ | `getCodexMcpPreflight` | `getCodexMcpPreflight(packKeys = [], env = process.env)` | `object` | Return codex mcp preflight from the codex module. |
175
+ | `mergeCodexMcpToml` | `mergeCodexMcpToml(existingConfigContent = '', packKeys = [])` | `string` | Merge codex mcp toml into an existing value. |
176
+ | `buildCodexProposalBundle` | `buildCodexProposalBundle(options)` | `Promise<object>` | Build codex proposal bundle for downstream codex workflows. |
177
+ | `setupCodex` | `setupCodex(options)` | `Promise<object>` | Set up codex configuration and managed project files. |
178
+ | `getCodexHistory` | `getCodexHistory(dir, limit = 20)` | `array` | Return codex history from the codex module. |
179
+ | `formatCodexHistory` | `formatCodexHistory(dir)` | `string` | Format codex history for display or export. |
180
+ | `compareCodexLatest` | `compareCodexLatest(dir)` | `object` | Compare codex latest against the latest recorded baseline. |
181
+ | `exportCodexTrendReport` | `exportCodexTrendReport(dir)` | `object` | Export codex trend report for reporting or downstream processing. |
182
+ | `recordCodexFeedback` | `recordCodexFeedback(dir, payload)` | `object` | Record codex feedback in the project activity history. |
183
+ | `formatCodexFeedback` | `formatCodexFeedback(dir)` | `string` | Format codex feedback for display or export. |
184
+ | `generateCodexInsights` | `generateCodexInsights(dir)` | `object` | Generate codex insights from codex inputs. |
185
+ | `formatCodexInsights` | `formatCodexInsights(dir)` | `string` | Format codex insights for display or export. |
186
+ | `patchAgentsMd` | `patchAgentsMd(existingContent, managedSections)` | `string` | Patch agents md with managed sections. |
187
+ | `patchConfigToml` | `patchConfigToml(existingContent, newSections)` | `string` | Patch config toml with managed sections. |
188
+ | `detectMixedAgentRepo` | `detectMixedAgentRepo(dir)` | `object` | Detect mixed agent repo for the current project. |
189
+ | `applyPatch` | `applyPatch(dir, filePath, patchFn, options = {})` | `object` | Apply patch to the target project or model. |
190
+ | `getCodexGovernanceSummary` | `getCodexGovernanceSummary()` | `object` | Return codex governance summary from the codex module. |
191
+ | `checkReleaseGate` | `checkReleaseGate(sourceVerifications = {})` | `object` | Check release gate and return the evaluation result. |
192
+ | `formatReleaseGate` | `formatReleaseGate(gateResult)` | `string` | Format release gate for display or export. |
193
+ | `getPropagationTargets` | `getPropagationTargets(triggerKeyword)` | `array` | Return propagation targets from the codex module. |
194
+ | `runCodexDeepReview` | `runCodexDeepReview(options)` | `Promise<object>` | Run the codex deep review workflow. |
195
+ | `collectCodexConfig` | `collectCodexConfig(ctx, stacks)` | `object` | Collect codex config into a structured object. |
196
+ | `buildCodexReviewPayload` | `buildCodexReviewPayload(config)` | `object` | Build codex review payload for downstream codex workflows. |
197
+ | `codexInteractive` | `codexInteractive(options = {})` | `Promise<object|null>` | Return the codex interactive capability from the codex module. |
198
+ | `composePacks` | `composePacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose packs into a combined configuration payload. |
199
+ | `getCiTemplate` | `getCiTemplate(templateKey)` | `object` | Return ci template from the codex module. |
200
+ | `checkAdoptionGate` | `checkAdoptionGate(gateKey, dir)` | `object` | Check adoption gate and return the evaluation result. |
201
+
202
+ ## Gemini
203
+
204
+ Source modules: `src/gemini/*`
205
+
206
+ | Function | Signature | Returns | Description |
207
+ | --- | --- | --- | --- |
208
+ | `detectGeminiVersion` | `detectGeminiVersion()` | `object` | Detect gemini version for the current project. |
209
+ | `recommendGeminiMcpPacks` | `recommendGeminiMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend gemini mcp packs based on detected project context. |
210
+ | `getGeminiMcpPreflight` | `getGeminiMcpPreflight(packKeys = [], env = process.env)` | `object` | Return gemini mcp preflight from the gemini module. |
211
+ | `mergeGeminiMcpJson` | `mergeGeminiMcpJson(existingSettings = {}, packKeys = [])` | `object` | Merge gemini mcp json into an existing value. |
212
+ | `detectGeminiDomainPacks` | `detectGeminiDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect gemini domain packs for the current project. |
213
+ | `buildGeminiProposalBundle` | `buildGeminiProposalBundle(options)` | `Promise<object>` | Build gemini proposal bundle for downstream gemini workflows. |
214
+ | `setupGemini` | `setupGemini(options)` | `Promise<object>` | Set up gemini configuration and managed project files. |
215
+ | `getGeminiGovernanceSummary` | `getGeminiGovernanceSummary()` | `object` | Return gemini governance summary from the gemini module. |
216
+ | `getGeminiHistory` | `getGeminiHistory(dir, limit = 20)` | `array` | Return gemini history from the gemini module. |
217
+ | `formatGeminiHistory` | `formatGeminiHistory(dir)` | `string` | Format gemini history for display or export. |
218
+ | `compareGeminiLatest` | `compareGeminiLatest(dir)` | `object` | Compare gemini latest against the latest recorded baseline. |
219
+ | `exportGeminiTrendReport` | `exportGeminiTrendReport(dir)` | `object` | Export gemini trend report for reporting or downstream processing. |
220
+ | `recordGeminiFeedback` | `recordGeminiFeedback(dir, payload)` | `object` | Record gemini feedback in the project activity history. |
221
+ | `formatGeminiFeedback` | `formatGeminiFeedback(dir)` | `string` | Format gemini feedback for display or export. |
222
+ | `generateGeminiInsights` | `generateGeminiInsights(dir)` | `object` | Generate gemini insights from gemini inputs. |
223
+ | `formatGeminiInsights` | `formatGeminiInsights(dir)` | `string` | Format gemini insights for display or export. |
224
+ | `patchGeminiMd` | `patchGeminiMd(existingContent, managedSections)` | `string` | Patch gemini md with managed sections. |
225
+ | `patchSettingsJson` | `patchSettingsJson(existingContent, newKeys)` | `object` | Patch settings json with managed sections. |
226
+ | `detectMixedAgentRepoGemini` | `detectMixedAgentRepoGemini(dir)` | `object` | Detect mixed agent repo gemini for the current project. |
227
+ | `checkGeminiReleaseGate` | `checkGeminiReleaseGate(sourceVerifications = {})` | `object` | Check gemini release gate and return the evaluation result. |
228
+ | `formatGeminiReleaseGate` | `formatGeminiReleaseGate(gateResult)` | `string` | Format gemini release gate for display or export. |
229
+ | `runGeminiDeepReview` | `runGeminiDeepReview(options)` | `Promise<object>` | Run the gemini deep review workflow. |
230
+ | `collectGeminiConfig` | `collectGeminiConfig(ctx, stacks)` | `object` | Collect gemini config into a structured object. |
231
+ | `geminiInteractive` | `geminiInteractive(options = {})` | `Promise<object|null>` | Return the gemini interactive capability from the gemini module. |
232
+ | `composeGeminiPacks` | `composeGeminiPacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose gemini packs into a combined configuration payload. |
233
+ | `getGeminiCiTemplate` | `getGeminiCiTemplate(templateKey)` | `object` | Return gemini ci template from the gemini module. |
234
+ | `checkGeminiAdoptionGate` | `checkGeminiAdoptionGate(gateKey, dir)` | `object` | Check gemini adoption gate and return the evaluation result. |
235
+
236
+ ## Copilot
237
+
238
+ Source modules: `src/copilot/*`
239
+
240
+ | Function | Signature | Returns | Description |
241
+ | --- | --- | --- | --- |
242
+ | `recommendCopilotMcpPacks` | `recommendCopilotMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend copilot mcp packs based on detected project context. |
243
+ | `getCopilotMcpPreflight` | `getCopilotMcpPreflight(packKeys = [], env = process.env)` | `object` | Return copilot mcp preflight from the copilot module. |
244
+ | `detectCopilotDomainPacks` | `detectCopilotDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect copilot domain packs for the current project. |
245
+ | `buildCopilotProposalBundle` | `buildCopilotProposalBundle(options)` | `Promise<object>` | Build copilot proposal bundle for downstream copilot workflows. |
246
+ | `setupCopilot` | `setupCopilot(options)` | `Promise<object>` | Set up copilot configuration and managed project files. |
247
+ | `getCopilotGovernanceSummary` | `getCopilotGovernanceSummary()` | `object` | Return copilot governance summary from the copilot module. |
248
+ | `getCopilotHistory` | `getCopilotHistory(dir, limit = 20)` | `array` | Return copilot history from the copilot module. |
249
+ | `formatCopilotHistory` | `formatCopilotHistory(dir)` | `string` | Format copilot history for display or export. |
250
+ | `compareCopilotLatest` | `compareCopilotLatest(dir)` | `object` | Compare copilot latest against the latest recorded baseline. |
251
+ | `exportCopilotTrendReport` | `exportCopilotTrendReport(dir)` | `object` | Export copilot trend report for reporting or downstream processing. |
252
+ | `generateCopilotInsights` | `generateCopilotInsights(dir)` | `object` | Generate copilot insights from copilot inputs. |
253
+ | `runCopilotDeepReview` | `runCopilotDeepReview(options)` | `Promise<object>` | Run the copilot deep review workflow. |
254
+ | `copilotInteractive` | `copilotInteractive(...)` | `undefined` | Reserved index export for the Copilot interactive wizard; currently unresolved at runtime. The index exports `copilotInteractive`, but `src/copilot/interactive.js` currently exports `runCopilotWizard` and `runProjectDetection`. |
255
+ | `composeCopilotPacks` | `composeCopilotPacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose copilot packs into a combined configuration payload. |
256
+ | `getCopilotCiTemplate` | `getCopilotCiTemplate(templateKey)` | `object` | Return copilot ci template from the copilot module. |
257
+ | `checkCopilotAdoptionGate` | `checkCopilotAdoptionGate(gateKey, dir)` | `object` | Check copilot adoption gate and return the evaluation result. |
258
+
259
+ ## Cursor
260
+
261
+ Source modules: `src/cursor/*`
262
+
263
+ | Function | Signature | Returns | Description |
264
+ | --- | --- | --- | --- |
265
+ | `recommendCursorMcpPacks` | `recommendCursorMcpPacks(stacks = [], domainPacks = [], options = {})` | `array` | Recommend cursor mcp packs based on detected project context. |
266
+ | `detectCursorDomainPacks` | `detectCursorDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect cursor domain packs for the current project. |
267
+ | `buildCursorProposalBundle` | `buildCursorProposalBundle(options)` | `Promise<object>` | Build cursor proposal bundle for downstream cursor workflows. |
268
+ | `setupCursor` | `setupCursor(options)` | `Promise<object>` | Set up cursor configuration and managed project files. |
269
+ | `getCursorGovernanceSummary` | `getCursorGovernanceSummary()` | `object` | Return cursor governance summary from the cursor module. |
270
+ | `getCursorHistory` | `getCursorHistory(dir, limit = 20)` | `array` | Return cursor history from the cursor module. |
271
+ | `compareCursorLatest` | `compareCursorLatest(dir)` | `object` | Compare cursor latest against the latest recorded baseline. |
272
+ | `generateCursorInsights` | `generateCursorInsights(dir)` | `object` | Generate cursor insights from cursor inputs. |
273
+ | `runCursorDeepReview` | `runCursorDeepReview(options)` | `Promise<object>` | Run the cursor deep review workflow. |
274
+ | `cursorInteractive` | `cursorInteractive(...)` | `undefined` | Reserved index export for the Cursor interactive wizard; currently unresolved at runtime. The index exports `cursorInteractive`, but `src/cursor/interactive.js` currently exports `runCursorWizard` and `runProjectDetection`. |
275
+ | `composeCursorPacks` | `composeCursorPacks(domainPackKeys = [], mcpPackKeys = [], options = {})` | `object` | Compose cursor packs into a combined configuration payload. |
276
+ | `checkCursorAdoptionGate` | `checkCursorAdoptionGate(gateKey, dir)` | `object` | Check cursor adoption gate and return the evaluation result. |
277
+
278
+ ## Windsurf
279
+
280
+ Source modules: `src/windsurf/*`
281
+
282
+ | Function | Signature | Returns | Description |
283
+ | --- | --- | --- | --- |
284
+ | `detectWindsurfDomainPacks` | `detectWindsurfDomainPacks(ctx, stacks = [], assets = {})` | `object` | Detect windsurf domain packs for the current project. |
285
+ | `setupWindsurf` | `setupWindsurf(options)` | `Promise<object>` | Set up windsurf configuration and managed project files. |
286
+ | `getWindsurfGovernanceSummary` | `getWindsurfGovernanceSummary()` | `object` | Return windsurf governance summary from the windsurf module. |
287
+ | `runWindsurfDeepReview` | `runWindsurfDeepReview(options)` | `Promise<object>` | Run the windsurf deep review workflow. |
288
+ | `windsurfInteractive` | `windsurfInteractive(...)` | `undefined` | Reserved index export for the Windsurf interactive wizard; currently unresolved at runtime. The index exports `windsurfInteractive`, but `src/windsurf/interactive.js` currently exports `runWindsurfWizard` and `runProjectDetection`. |
289
+
290
+ ## Aider
291
+
292
+ Source modules: `src/aider/*`
293
+
294
+ | Function | Signature | Returns | Description |
295
+ | --- | --- | --- | --- |
296
+ | `detectAiderDomainPacks` | `detectAiderDomainPacks(ctx)` | `object` | Detect aider domain packs for the current project. |
297
+ | `setupAider` | `setupAider(options = {})` | `Promise<object>` | Set up aider configuration and managed project files. |
298
+ | `getAiderGovernanceSummary` | `getAiderGovernanceSummary()` | `object` | Return aider governance summary from the aider module. |
299
+ | `runAiderDeepReview` | `runAiderDeepReview(dir)` | `Promise<object>` | Run the aider deep review workflow. |
300
+ | `aiderInteractive` | `aiderInteractive(dir)` | `Promise<object|null>` | Return the aider interactive capability from the aider module. |
301
+
302
+ ## OpenCode
303
+
304
+ Source modules: `src/opencode/*`
305
+
306
+ | Function | Signature | Returns | Description |
307
+ | --- | --- | --- | --- |
308
+ | `detectOpenCodeDomainPacks` | `detectOpenCodeDomainPacks(ctx, stacks = [])` | `object` | Detect open code domain packs for the current project. |
309
+ | `setupOpenCode` | `setupOpenCode(options)` | `Promise<object>` | Set up opencode configuration and managed project files. |
310
+ | `getOpenCodeGovernanceSummary` | `getOpenCodeGovernanceSummary()` | `object` | Return open code governance summary from the opencode module. |
311
+ | `runOpenCodeDeepReview` | `runOpenCodeDeepReview(options)` | `Promise<object>` | Run the open code deep review workflow. |
312
+ | `opencodeInteractive` | `opencodeInteractive(options = {})` | `Promise<object|null>` | Return the opencode interactive capability from the opencode module. |
313
+
314
+ ## Harmony
315
+
316
+ Source modules: `src/harmony/*`
317
+
318
+ | Function | Signature | Returns | Description |
319
+ | --- | --- | --- | --- |
320
+ | `buildCanonicalModel` | `buildCanonicalModel(dir)` | `object` | Build the Harmony canonical model from the current repository state. |
321
+ | `detectActivePlatforms` | `detectActivePlatforms(dir)` | `array` | Detect active platforms for the current project. |
322
+ | `detectDrift` | `detectDrift(canonicalModel)` | `object` | Detect drift for the current project. |
323
+ | `formatDriftReport` | `formatDriftReport(driftResult, options = {})` | `string` | Format drift report for display or export. |
324
+ | `harmonyAudit` | `harmonyAudit(options)` | `Promise<object>` | Run the Harmony audit across detected platform configurations. |
325
+ | `formatHarmonyAuditReport` | `formatHarmonyAuditReport(result)` | `string` | Format harmony audit report for display or export. |
326
+ | `generateHarmonySync` | `generateHarmonySync(canonicalModel, options = {})` | `object` | Generate harmony sync from harmony inputs. |
327
+ | `applyHarmonySync` | `applyHarmonySync(dir, options = {})` | `object` | Apply harmony sync to the target project or model. |
328
+ | `previewHarmonySync` | `previewHarmonySync(dir, options = {})` | `object` | Return the preview harmony sync capability from the harmony module. |
329
+ | `generateStrategicAdvice` | `generateStrategicAdvice(canonicalModel, platformAudits)` | `object` | Generate cross-platform platform advice from the canonical model and audits. |
330
+ | `startHarmonyWatch` | `startHarmonyWatch(options)` | `Promise<object>` | Start harmony watch and return the running handle. |
331
+ | `saveHarmonyState` | `saveHarmonyState(dir, state)` | `object` | Save harmony state to persistent storage. |
332
+ | `loadHarmonyState` | `loadHarmonyState(dir)` | `object` | Load harmony state from persistent storage. |
333
+ | `getHarmonyHistory` | `getHarmonyHistory(dir, filter)` | `array` | Return harmony history from the harmony module. |
334
+ | `getHarmonyGovernanceSummary` | `getHarmonyGovernanceSummary(canonicalModel, platformAudits)` | `object` | Return harmony governance summary from the harmony module. |
335
+ | `formatHarmonyGovernanceReport` | `formatHarmonyGovernanceReport(summary, options)` | `string` | Format harmony governance report for display or export. |
336
+
337
+ ## Synergy (Experimental)
338
+
339
+ Source modules: `src/synergy/*` — static-rule research surface. Do not rely on for production task routing.
340
+
341
+ | Function | Signature | Returns | Description |
342
+ | --- | --- | --- | --- |
343
+ | `propagateInsight` | `propagateInsight(insight, sourcePlatform, targetPlatforms)` | `object` | Propagate insight across selected platforms. |
344
+ | `getCrossLearnings` | `getCrossLearnings(dir)` | `array` | Return cross learnings from the synergy module. |
345
+ | `routeTask` | `routeTask(taskDescription, activePlatforms, projectHistory)` | `object` | Route a task description to the most suitable active platforms. |
346
+ | `classifyTaskType` | `classifyTaskType(taskDescription)` | `string` | Classify task type into a known synergy category. |
347
+ | `compoundAudit` | `compoundAudit(platformAudits)` | `object` | Combine audit into a single evidence view. |
348
+ | `calculateAmplification` | `calculateAmplification(platformAudits)` | `number` | Calculate amplification for the current inputs. |
349
+ | `analyzeCompensation` | `analyzeCompensation(activePlatforms, platformAudits)` | `object` | Analyze compensation and return structured findings. |
350
+ | `getUncoveredGaps` | `getUncoveredGaps(activePlatforms)` | `array` | Return uncovered gaps from the synergy module. |
351
+ | `discoverPatterns` | `discoverPatterns(harmonyHistory)` | `object` | Discover patterns from accumulated history. |
352
+ | `rankRecommendations` | `rankRecommendations(recommendations, activePlatforms, context)` | `array` | Return the rank recommendations capability from the synergy module. |
353
+ | `calculateSynergyScore` | `calculateSynergyScore(recommendation, activePlatforms, context)` | `number` | Calculate synergy score for the current inputs. |
354
+ | `generateSynergyReport` | `generateSynergyReport(options)` | `Promise<object>` | Build the full Synergy report structure from routing and amplification inputs. |
355
+ | `detectProjectChanges` | `detectProjectChanges(dir, previousCanon)` | `object` | Detect project changes for the current project. |
356
+ | `generateAdaptiveUpdates` | `generateAdaptiveUpdates(changes)` | `object` | Generate adaptive updates from synergy inputs. |