@nerviq/cli 0.0.1 → 0.9.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/LICENSE +21 -0
  3. package/README.md +447 -0
  4. package/bin/cli.js +749 -0
  5. package/content/case-study-template.md +91 -0
  6. package/content/claims-governance.md +37 -0
  7. package/content/claude-code/audit-repo/SKILL.md +20 -0
  8. package/content/claude-native-integration.md +60 -0
  9. package/content/devto-article.json +9 -0
  10. package/content/launch-posts.md +226 -0
  11. package/content/pilot-rollout-kit.md +30 -0
  12. package/content/release-checklist.md +31 -0
  13. package/package.json +53 -4
  14. package/src/activity.js +529 -0
  15. package/src/aider/activity.js +226 -0
  16. package/src/aider/config-parser.js +166 -0
  17. package/src/aider/context.js +158 -0
  18. package/src/aider/deep-review.js +316 -0
  19. package/src/aider/domain-packs.js +278 -0
  20. package/src/aider/freshness.js +168 -0
  21. package/src/aider/governance.js +253 -0
  22. package/src/aider/interactive.js +334 -0
  23. package/src/aider/mcp-packs.js +98 -0
  24. package/src/aider/patch.js +214 -0
  25. package/src/aider/plans.js +186 -0
  26. package/src/aider/premium.js +360 -0
  27. package/src/aider/setup.js +404 -0
  28. package/src/aider/techniques.js +1323 -0
  29. package/src/analyze.js +821 -0
  30. package/src/audit.js +1003 -0
  31. package/src/badge.js +13 -0
  32. package/src/benchmark.js +339 -0
  33. package/src/claudex-sync.json +7 -0
  34. package/src/codex/activity.js +324 -0
  35. package/src/codex/config-parser.js +183 -0
  36. package/src/codex/context.js +221 -0
  37. package/src/codex/deep-review.js +493 -0
  38. package/src/codex/domain-packs.js +372 -0
  39. package/src/codex/freshness.js +167 -0
  40. package/src/codex/governance.js +192 -0
  41. package/src/codex/interactive.js +618 -0
  42. package/src/codex/mcp-packs.js +660 -0
  43. package/src/codex/patch.js +209 -0
  44. package/src/codex/plans.js +251 -0
  45. package/src/codex/premium.js +614 -0
  46. package/src/codex/setup.js +603 -0
  47. package/src/codex/techniques.js +2649 -0
  48. package/src/context.js +272 -0
  49. package/src/copilot/activity.js +309 -0
  50. package/src/copilot/config-parser.js +226 -0
  51. package/src/copilot/context.js +197 -0
  52. package/src/copilot/deep-review.js +346 -0
  53. package/src/copilot/domain-packs.js +350 -0
  54. package/src/copilot/freshness.js +197 -0
  55. package/src/copilot/governance.js +222 -0
  56. package/src/copilot/interactive.js +406 -0
  57. package/src/copilot/mcp-packs.js +572 -0
  58. package/src/copilot/patch.js +238 -0
  59. package/src/copilot/plans.js +253 -0
  60. package/src/copilot/premium.js +450 -0
  61. package/src/copilot/setup.js +488 -0
  62. package/src/copilot/techniques.js +1822 -0
  63. package/src/cursor/activity.js +301 -0
  64. package/src/cursor/config-parser.js +265 -0
  65. package/src/cursor/context.js +236 -0
  66. package/src/cursor/deep-review.js +334 -0
  67. package/src/cursor/domain-packs.js +346 -0
  68. package/src/cursor/freshness.js +214 -0
  69. package/src/cursor/governance.js +229 -0
  70. package/src/cursor/interactive.js +391 -0
  71. package/src/cursor/mcp-packs.js +571 -0
  72. package/src/cursor/patch.js +243 -0
  73. package/src/cursor/plans.js +254 -0
  74. package/src/cursor/premium.js +468 -0
  75. package/src/cursor/setup.js +488 -0
  76. package/src/cursor/techniques.js +1786 -0
  77. package/src/deep-review.js +345 -0
  78. package/src/domain-packs.js +364 -0
  79. package/src/formatters/sarif.js +115 -0
  80. package/src/gemini/activity.js +402 -0
  81. package/src/gemini/config-parser.js +275 -0
  82. package/src/gemini/context.js +221 -0
  83. package/src/gemini/deep-review.js +559 -0
  84. package/src/gemini/domain-packs.js +371 -0
  85. package/src/gemini/freshness.js +204 -0
  86. package/src/gemini/governance.js +201 -0
  87. package/src/gemini/interactive.js +860 -0
  88. package/src/gemini/mcp-packs.js +658 -0
  89. package/src/gemini/patch.js +229 -0
  90. package/src/gemini/plans.js +269 -0
  91. package/src/gemini/premium.js +759 -0
  92. package/src/gemini/setup.js +692 -0
  93. package/src/gemini/techniques.js +2084 -0
  94. package/src/governance.js +523 -0
  95. package/src/harmony/advisor.js +383 -0
  96. package/src/harmony/audit.js +303 -0
  97. package/src/harmony/canon.js +444 -0
  98. package/src/harmony/cli.js +331 -0
  99. package/src/harmony/drift.js +401 -0
  100. package/src/harmony/governance.js +313 -0
  101. package/src/harmony/memory.js +238 -0
  102. package/src/harmony/sync.js +458 -0
  103. package/src/harmony/watch.js +336 -0
  104. package/src/index.js +256 -0
  105. package/src/insights.js +119 -0
  106. package/src/interactive.js +118 -0
  107. package/src/mcp-packs.js +597 -0
  108. package/src/opencode/activity.js +286 -0
  109. package/src/opencode/config-parser.js +109 -0
  110. package/src/opencode/context.js +247 -0
  111. package/src/opencode/deep-review.js +313 -0
  112. package/src/opencode/domain-packs.js +240 -0
  113. package/src/opencode/freshness.js +158 -0
  114. package/src/opencode/governance.js +159 -0
  115. package/src/opencode/interactive.js +392 -0
  116. package/src/opencode/mcp-packs.js +474 -0
  117. package/src/opencode/patch.js +184 -0
  118. package/src/opencode/plans.js +231 -0
  119. package/src/opencode/premium.js +413 -0
  120. package/src/opencode/setup.js +449 -0
  121. package/src/opencode/techniques.js +1713 -0
  122. package/src/plans.js +655 -0
  123. package/src/secret-patterns.js +30 -0
  124. package/src/setup.js +1274 -0
  125. package/src/synergy/adaptive.js +261 -0
  126. package/src/synergy/compensation.js +156 -0
  127. package/src/synergy/evidence.js +193 -0
  128. package/src/synergy/learning.js +184 -0
  129. package/src/synergy/patterns.js +227 -0
  130. package/src/synergy/ranking.js +83 -0
  131. package/src/synergy/report.js +163 -0
  132. package/src/synergy/routing.js +152 -0
  133. package/src/techniques.js +1354 -0
  134. package/src/watch.js +229 -0
  135. package/src/windsurf/activity.js +302 -0
  136. package/src/windsurf/config-parser.js +267 -0
  137. package/src/windsurf/context.js +249 -0
  138. package/src/windsurf/deep-review.js +337 -0
  139. package/src/windsurf/domain-packs.js +348 -0
  140. package/src/windsurf/freshness.js +215 -0
  141. package/src/windsurf/governance.js +231 -0
  142. package/src/windsurf/interactive.js +388 -0
  143. package/src/windsurf/mcp-packs.js +535 -0
  144. package/src/windsurf/patch.js +231 -0
  145. package/src/windsurf/plans.js +247 -0
  146. package/src/windsurf/premium.js +467 -0
  147. package/src/windsurf/setup.js +471 -0
  148. package/src/windsurf/techniques.js +1758 -0
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Aider Freshness Operationalization
3
+ *
4
+ * Release gates, recurring probes, propagation checklists,
5
+ * and staleness blocking for Aider surfaces.
6
+ */
7
+
8
+ const { version } = require('../../package.json');
9
+
10
+ /**
11
+ * P0 sources that must be fresh before any Aider release claim.
12
+ */
13
+ const P0_SOURCES = [
14
+ {
15
+ key: 'aider-docs',
16
+ label: 'Aider Official Docs',
17
+ url: 'https://aider.chat',
18
+ stalenessThresholdDays: 30,
19
+ verifiedAt: null,
20
+ },
21
+ {
22
+ key: 'aider-config-reference',
23
+ label: 'Aider Config Reference',
24
+ url: 'https://aider.chat/docs/config/aider_conf.html',
25
+ stalenessThresholdDays: 30,
26
+ verifiedAt: null,
27
+ },
28
+ {
29
+ key: 'aider-github-releases',
30
+ label: 'Aider GitHub Releases',
31
+ url: 'https://github.com/paul-gauthier/aider/releases',
32
+ stalenessThresholdDays: 14,
33
+ verifiedAt: null,
34
+ },
35
+ {
36
+ key: 'aider-model-docs',
37
+ label: 'Aider Model Documentation',
38
+ url: 'https://aider.chat/docs/llms.html',
39
+ stalenessThresholdDays: 30,
40
+ verifiedAt: null,
41
+ },
42
+ {
43
+ key: 'aider-pypi',
44
+ label: 'Aider PyPI Package',
45
+ url: 'https://pypi.org/project/aider-chat/',
46
+ stalenessThresholdDays: 14,
47
+ verifiedAt: null,
48
+ },
49
+ ];
50
+
51
+ /**
52
+ * Propagation checklist: when an Aider source changes, these must update.
53
+ */
54
+ const PROPAGATION_CHECKLIST = [
55
+ {
56
+ trigger: 'Aider release with new config keys',
57
+ targets: [
58
+ 'src/aider/techniques.js — update checks for new keys',
59
+ 'src/aider/config-parser.js — update if YAML handling changes',
60
+ 'src/aider/setup.js — update generated .aider.conf.yml template',
61
+ ],
62
+ },
63
+ {
64
+ trigger: 'New Aider model support or role changes',
65
+ targets: [
66
+ 'src/aider/techniques.js — update model config checks',
67
+ 'src/aider/context.js — update modelRoles()',
68
+ 'src/aider/governance.js — update policy packs if needed',
69
+ ],
70
+ },
71
+ {
72
+ trigger: 'New Aider edit format or architect changes',
73
+ targets: [
74
+ 'src/aider/techniques.js — update edit format checks',
75
+ 'src/aider/setup.js — update template comments',
76
+ ],
77
+ },
78
+ {
79
+ trigger: 'Aider CLI flag changes (renamed/removed)',
80
+ targets: [
81
+ 'src/aider/techniques.js — update flag pattern matching',
82
+ 'src/aider/setup.js — update generated config',
83
+ 'src/aider/interactive.js — update wizard options',
84
+ ],
85
+ },
86
+ {
87
+ trigger: 'Aider domain pack definitions change',
88
+ targets: [
89
+ 'src/aider/domain-packs.js — update pack registry',
90
+ 'src/aider/governance.js — governance export picks up changes',
91
+ ],
92
+ },
93
+ ];
94
+
95
+ /**
96
+ * Check release gate — are all P0 sources fresh?
97
+ */
98
+ function checkReleaseGate(overrides = {}) {
99
+ const now = new Date();
100
+ const results = P0_SOURCES.map(source => {
101
+ const verifiedAt = overrides[source.key] || source.verifiedAt;
102
+ if (!verifiedAt) {
103
+ return { ...source, status: 'unverified', daysStale: null };
104
+ }
105
+
106
+ const verifiedDate = new Date(verifiedAt);
107
+ const daysSince = Math.floor((now - verifiedDate) / (1000 * 60 * 60 * 24));
108
+
109
+ return {
110
+ ...source,
111
+ verifiedAt,
112
+ status: daysSince <= source.stalenessThresholdDays ? 'fresh' : 'stale',
113
+ daysStale: daysSince,
114
+ };
115
+ });
116
+
117
+ const allFresh = results.every(r => r.status === 'fresh');
118
+
119
+ return {
120
+ ready: allFresh,
121
+ results,
122
+ nerviqVersion: version,
123
+ checkedAt: now.toISOString(),
124
+ };
125
+ }
126
+
127
+ /**
128
+ * Format release gate for display.
129
+ */
130
+ function formatReleaseGate(overrides = {}) {
131
+ const gateResult = checkReleaseGate(overrides);
132
+ const lines = [
133
+ `Aider Release Freshness Gate (nerviq v${version})`,
134
+ `Status: ${gateResult.ready ? 'READY' : 'NOT READY'}`,
135
+ '',
136
+ ];
137
+
138
+ for (const result of gateResult.results) {
139
+ const icon = result.status === 'fresh' ? '✓' : result.status === 'stale' ? '✗' : '?';
140
+ const age = result.daysStale !== null ? ` (${result.daysStale}d ago)` : ' (unverified)';
141
+ lines.push(` ${icon} ${result.label}${age} — threshold: ${result.stalenessThresholdDays}d`);
142
+ }
143
+
144
+ if (!gateResult.ready) {
145
+ lines.push('');
146
+ lines.push('Action required: verify stale/unverified sources before claiming release freshness.');
147
+ }
148
+
149
+ return lines.join('\n');
150
+ }
151
+
152
+ /**
153
+ * Get propagation targets for a given trigger.
154
+ */
155
+ function getPropagationTargets(triggerKeyword) {
156
+ const keyword = triggerKeyword.toLowerCase();
157
+ return PROPAGATION_CHECKLIST.filter(item =>
158
+ item.trigger.toLowerCase().includes(keyword)
159
+ );
160
+ }
161
+
162
+ module.exports = {
163
+ P0_SOURCES,
164
+ PROPAGATION_CHECKLIST,
165
+ checkReleaseGate,
166
+ formatReleaseGate,
167
+ getPropagationTargets,
168
+ };
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Aider Governance — permission profiles, policy packs, pilot rollout
3
+ *
4
+ * Aider governance is fundamentally simpler than IDE platforms:
5
+ * - Git is the ONLY safety mechanism (commits before changes)
6
+ * - No hooks, no sandbox modes, no approval policies
7
+ * - Safety comes from: auto-commits, git history, CI gates, code review
8
+ * - 3 model roles provide implicit trust levels
9
+ */
10
+
11
+ const { AIDER_DOMAIN_PACKS } = require('./domain-packs');
12
+ const { AIDER_MCP_PACKS } = require('./mcp-packs');
13
+
14
+ /**
15
+ * Aider permission profiles are git-based.
16
+ * Since Aider has no sandbox/approval system, profiles map to
17
+ * recommended git workflow patterns.
18
+ */
19
+ const AIDER_PERMISSION_PROFILES = [
20
+ {
21
+ key: 'review-first',
22
+ label: 'Review First',
23
+ risk: 'low',
24
+ defaultAutoCommits: true,
25
+ approvalPolicy: 'manual-review',
26
+ useWhen: 'First contact with a repo, security-sensitive work, or regulated environments.',
27
+ behavior: 'Auto-commits enabled but all changes require manual git review before push. Use `git diff` and `git log` after each session.',
28
+ },
29
+ {
30
+ key: 'standard',
31
+ label: 'Standard',
32
+ risk: 'medium',
33
+ defaultAutoCommits: true,
34
+ approvalPolicy: 'trust-with-tests',
35
+ useWhen: 'Normal development with test and lint verification loops.',
36
+ behavior: 'Auto-commits + auto-test + auto-lint. Changes verified automatically, manual review for complex work.',
37
+ },
38
+ {
39
+ key: 'autonomous',
40
+ label: 'Autonomous',
41
+ risk: 'high',
42
+ defaultAutoCommits: true,
43
+ approvalPolicy: 'ci-gated',
44
+ useWhen: 'Automated batch processing with CI gates for quality control.',
45
+ behavior: 'Aider runs with --yes flag in CI. All changes go through CI pipeline before merge.',
46
+ },
47
+ {
48
+ key: 'ci-headless',
49
+ label: 'CI Headless',
50
+ risk: 'high',
51
+ defaultAutoCommits: true,
52
+ approvalPolicy: 'pipeline-only',
53
+ useWhen: 'GitHub Actions or CI automation where Aider generates PRs.',
54
+ behavior: 'No human interaction. Changes submitted as PRs with required reviews.',
55
+ },
56
+ ];
57
+
58
+ /**
59
+ * Git-based safety registry — Aider's safety comes from git, not hooks.
60
+ */
61
+ const AIDER_SAFETY_REGISTRY = [
62
+ {
63
+ key: 'auto-commits',
64
+ mechanism: 'git',
65
+ purpose: 'Every Aider change creates a git commit — the primary undo mechanism.',
66
+ risk: 'critical-if-disabled',
67
+ configKey: 'auto-commits',
68
+ },
69
+ {
70
+ key: 'dirty-commits',
71
+ mechanism: 'git',
72
+ purpose: 'Allow Aider to commit even with a dirty working tree.',
73
+ risk: 'low',
74
+ configKey: 'dirty-commits',
75
+ },
76
+ {
77
+ key: 'attribute-author',
78
+ mechanism: 'git-metadata',
79
+ purpose: 'Tag AI-authored commits with distinct author for traceability.',
80
+ risk: 'none',
81
+ configKey: 'attribute-author',
82
+ },
83
+ {
84
+ key: 'commit-prefix',
85
+ mechanism: 'git-metadata',
86
+ purpose: 'Prefix AI commits for easy filtering in git log.',
87
+ risk: 'none',
88
+ configKey: 'aider-commit-prefix',
89
+ },
90
+ {
91
+ key: 'pre-commit-hooks',
92
+ mechanism: 'git-hooks',
93
+ purpose: 'Git pre-commit hooks run on Aider commits too — lint, format, etc.',
94
+ risk: 'medium',
95
+ configKey: null,
96
+ },
97
+ {
98
+ key: 'undo-command',
99
+ mechanism: 'git-reset',
100
+ purpose: '/undo command reverts the last Aider commit via git.',
101
+ risk: 'none',
102
+ configKey: null,
103
+ },
104
+ ];
105
+
106
+ /**
107
+ * Aider policy packs — recommended policy configurations.
108
+ */
109
+ const AIDER_POLICY_PACKS = [
110
+ {
111
+ key: 'solo-dev',
112
+ label: 'Solo Developer',
113
+ useWhen: 'Single developer working with Aider on personal projects.',
114
+ config: {
115
+ 'auto-commits': true,
116
+ 'auto-lint': true,
117
+ 'auto-test': true,
118
+ 'show-diffs': true,
119
+ 'attribute-author': true,
120
+ },
121
+ conventions: ['Document key commands (/undo, /add, /drop)', 'Set up lint and test commands'],
122
+ },
123
+ {
124
+ key: 'team-standard',
125
+ label: 'Team Standard',
126
+ useWhen: 'Team development where Aider changes go through code review.',
127
+ config: {
128
+ 'auto-commits': true,
129
+ 'auto-lint': true,
130
+ 'auto-test': true,
131
+ 'show-diffs': true,
132
+ 'attribute-author': true,
133
+ 'attribute-committer': true,
134
+ 'aider-commit-prefix': '"aider: "',
135
+ },
136
+ conventions: ['Require PR review for Aider branches', 'CI must pass before merge', 'Tag AI-authored commits'],
137
+ },
138
+ {
139
+ key: 'enterprise-governed',
140
+ label: 'Enterprise Governed',
141
+ useWhen: 'Enterprise environment with compliance requirements.',
142
+ config: {
143
+ 'auto-commits': true,
144
+ 'auto-lint': true,
145
+ 'auto-test': true,
146
+ 'show-diffs': true,
147
+ 'attribute-author': true,
148
+ 'attribute-committer': true,
149
+ 'aider-commit-prefix': '"aider: "',
150
+ },
151
+ conventions: [
152
+ 'All AI changes require human review',
153
+ 'CI pipeline mandatory before merge',
154
+ 'Audit trail via git log with commit prefix',
155
+ 'Convention file must include security guidelines',
156
+ 'Regular review of Aider convention file',
157
+ ],
158
+ },
159
+ {
160
+ key: 'ci-automation',
161
+ label: 'CI Automation',
162
+ useWhen: 'Aider running in CI/CD pipelines (headless mode).',
163
+ config: {
164
+ 'auto-commits': true,
165
+ 'yes': true,
166
+ 'no-auto-lint': false,
167
+ 'auto-test': true,
168
+ 'attribute-author': true,
169
+ 'aider-commit-prefix': '"aider-ci: "',
170
+ },
171
+ conventions: [
172
+ 'All changes submitted as PRs',
173
+ 'Required reviewer approvals',
174
+ 'CI gates must pass',
175
+ 'No direct push to main',
176
+ ],
177
+ },
178
+ ];
179
+
180
+ /**
181
+ * Pilot rollout kit for Aider adoption.
182
+ */
183
+ const AIDER_PILOT_ROLLOUT_KIT = {
184
+ phasedRollout: [
185
+ {
186
+ phase: 1,
187
+ label: 'Single Developer Trial',
188
+ duration: '1-2 weeks',
189
+ actions: [
190
+ 'Install Aider, create .aider.conf.yml',
191
+ 'Create CONVENTIONS.md with project basics',
192
+ 'Enable auto-commits and show-diffs',
193
+ 'Use on low-risk tasks first',
194
+ ],
195
+ },
196
+ {
197
+ phase: 2,
198
+ label: 'Team Pilot',
199
+ duration: '2-4 weeks',
200
+ actions: [
201
+ 'Share .aider.conf.yml and CONVENTIONS.md in repo',
202
+ 'Enable auto-lint and auto-test loops',
203
+ 'Add commit prefix for AI traceability',
204
+ 'Require PR review for Aider branches',
205
+ ],
206
+ },
207
+ {
208
+ phase: 3,
209
+ label: 'Full Adoption',
210
+ duration: 'Ongoing',
211
+ actions: [
212
+ 'Standardize Aider config across repos',
213
+ 'Integrate Aider into CI pipelines (optional)',
214
+ 'Regular convention file reviews',
215
+ 'Monitor AI-authored code quality metrics',
216
+ ],
217
+ },
218
+ ],
219
+ successMetrics: [
220
+ 'Time-to-resolution for Aider-assisted tasks',
221
+ 'Test pass rate on Aider-generated code',
222
+ 'Developer satisfaction scores',
223
+ 'No-overwrite rate on existing repo files',
224
+ ],
225
+ rollbackExpectations: [
226
+ 'Every Aider change can be undone with /undo or git revert.',
227
+ 'Convention files can be removed without breaking anything.',
228
+ 'Config file removal returns Aider to CLI-flag-only mode.',
229
+ ],
230
+ };
231
+
232
+ function getAiderGovernanceSummary() {
233
+ return {
234
+ platform: 'aider',
235
+ platformLabel: 'Aider',
236
+ permissionProfiles: AIDER_PERMISSION_PROFILES,
237
+ safetyRegistry: AIDER_SAFETY_REGISTRY,
238
+ policyPacks: AIDER_POLICY_PACKS,
239
+ domainPacks: AIDER_DOMAIN_PACKS,
240
+ mcpPacks: AIDER_MCP_PACKS,
241
+ pilotRolloutKit: AIDER_PILOT_ROLLOUT_KIT,
242
+ platformCaveats: [
243
+ 'Git is the ONLY safety mechanism — do not disable auto-commits.',
244
+ 'No native MCP, hooks, or agent system.',
245
+ 'Convention files must be explicitly passed (no auto-discovery).',
246
+ '4-level config precedence: env vars > CLI args > .aider.conf.yml > defaults.',
247
+ ],
248
+ };
249
+ }
250
+
251
+ module.exports = {
252
+ getAiderGovernanceSummary,
253
+ };