@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.
- package/CHANGELOG.md +181 -0
- package/LICENSE +21 -0
- package/README.md +447 -0
- package/bin/cli.js +749 -0
- package/content/case-study-template.md +91 -0
- package/content/claims-governance.md +37 -0
- package/content/claude-code/audit-repo/SKILL.md +20 -0
- package/content/claude-native-integration.md +60 -0
- package/content/devto-article.json +9 -0
- package/content/launch-posts.md +226 -0
- package/content/pilot-rollout-kit.md +30 -0
- package/content/release-checklist.md +31 -0
- package/package.json +53 -4
- package/src/activity.js +529 -0
- package/src/aider/activity.js +226 -0
- package/src/aider/config-parser.js +166 -0
- package/src/aider/context.js +158 -0
- package/src/aider/deep-review.js +316 -0
- package/src/aider/domain-packs.js +278 -0
- package/src/aider/freshness.js +168 -0
- package/src/aider/governance.js +253 -0
- package/src/aider/interactive.js +334 -0
- package/src/aider/mcp-packs.js +98 -0
- package/src/aider/patch.js +214 -0
- package/src/aider/plans.js +186 -0
- package/src/aider/premium.js +360 -0
- package/src/aider/setup.js +404 -0
- package/src/aider/techniques.js +1323 -0
- package/src/analyze.js +821 -0
- package/src/audit.js +1003 -0
- package/src/badge.js +13 -0
- package/src/benchmark.js +339 -0
- package/src/claudex-sync.json +7 -0
- package/src/codex/activity.js +324 -0
- package/src/codex/config-parser.js +183 -0
- package/src/codex/context.js +221 -0
- package/src/codex/deep-review.js +493 -0
- package/src/codex/domain-packs.js +372 -0
- package/src/codex/freshness.js +167 -0
- package/src/codex/governance.js +192 -0
- package/src/codex/interactive.js +618 -0
- package/src/codex/mcp-packs.js +660 -0
- package/src/codex/patch.js +209 -0
- package/src/codex/plans.js +251 -0
- package/src/codex/premium.js +614 -0
- package/src/codex/setup.js +603 -0
- package/src/codex/techniques.js +2649 -0
- package/src/context.js +272 -0
- package/src/copilot/activity.js +309 -0
- package/src/copilot/config-parser.js +226 -0
- package/src/copilot/context.js +197 -0
- package/src/copilot/deep-review.js +346 -0
- package/src/copilot/domain-packs.js +350 -0
- package/src/copilot/freshness.js +197 -0
- package/src/copilot/governance.js +222 -0
- package/src/copilot/interactive.js +406 -0
- package/src/copilot/mcp-packs.js +572 -0
- package/src/copilot/patch.js +238 -0
- package/src/copilot/plans.js +253 -0
- package/src/copilot/premium.js +450 -0
- package/src/copilot/setup.js +488 -0
- package/src/copilot/techniques.js +1822 -0
- package/src/cursor/activity.js +301 -0
- package/src/cursor/config-parser.js +265 -0
- package/src/cursor/context.js +236 -0
- package/src/cursor/deep-review.js +334 -0
- package/src/cursor/domain-packs.js +346 -0
- package/src/cursor/freshness.js +214 -0
- package/src/cursor/governance.js +229 -0
- package/src/cursor/interactive.js +391 -0
- package/src/cursor/mcp-packs.js +571 -0
- package/src/cursor/patch.js +243 -0
- package/src/cursor/plans.js +254 -0
- package/src/cursor/premium.js +468 -0
- package/src/cursor/setup.js +488 -0
- package/src/cursor/techniques.js +1786 -0
- package/src/deep-review.js +345 -0
- package/src/domain-packs.js +364 -0
- package/src/formatters/sarif.js +115 -0
- package/src/gemini/activity.js +402 -0
- package/src/gemini/config-parser.js +275 -0
- package/src/gemini/context.js +221 -0
- package/src/gemini/deep-review.js +559 -0
- package/src/gemini/domain-packs.js +371 -0
- package/src/gemini/freshness.js +204 -0
- package/src/gemini/governance.js +201 -0
- package/src/gemini/interactive.js +860 -0
- package/src/gemini/mcp-packs.js +658 -0
- package/src/gemini/patch.js +229 -0
- package/src/gemini/plans.js +269 -0
- package/src/gemini/premium.js +759 -0
- package/src/gemini/setup.js +692 -0
- package/src/gemini/techniques.js +2084 -0
- package/src/governance.js +523 -0
- package/src/harmony/advisor.js +383 -0
- package/src/harmony/audit.js +303 -0
- package/src/harmony/canon.js +444 -0
- package/src/harmony/cli.js +331 -0
- package/src/harmony/drift.js +401 -0
- package/src/harmony/governance.js +313 -0
- package/src/harmony/memory.js +238 -0
- package/src/harmony/sync.js +458 -0
- package/src/harmony/watch.js +336 -0
- package/src/index.js +256 -0
- package/src/insights.js +119 -0
- package/src/interactive.js +118 -0
- package/src/mcp-packs.js +597 -0
- package/src/opencode/activity.js +286 -0
- package/src/opencode/config-parser.js +109 -0
- package/src/opencode/context.js +247 -0
- package/src/opencode/deep-review.js +313 -0
- package/src/opencode/domain-packs.js +240 -0
- package/src/opencode/freshness.js +158 -0
- package/src/opencode/governance.js +159 -0
- package/src/opencode/interactive.js +392 -0
- package/src/opencode/mcp-packs.js +474 -0
- package/src/opencode/patch.js +184 -0
- package/src/opencode/plans.js +231 -0
- package/src/opencode/premium.js +413 -0
- package/src/opencode/setup.js +449 -0
- package/src/opencode/techniques.js +1713 -0
- package/src/plans.js +655 -0
- package/src/secret-patterns.js +30 -0
- package/src/setup.js +1274 -0
- package/src/synergy/adaptive.js +261 -0
- package/src/synergy/compensation.js +156 -0
- package/src/synergy/evidence.js +193 -0
- package/src/synergy/learning.js +184 -0
- package/src/synergy/patterns.js +227 -0
- package/src/synergy/ranking.js +83 -0
- package/src/synergy/report.js +163 -0
- package/src/synergy/routing.js +152 -0
- package/src/techniques.js +1354 -0
- package/src/watch.js +229 -0
- package/src/windsurf/activity.js +302 -0
- package/src/windsurf/config-parser.js +267 -0
- package/src/windsurf/context.js +249 -0
- package/src/windsurf/deep-review.js +337 -0
- package/src/windsurf/domain-packs.js +348 -0
- package/src/windsurf/freshness.js +215 -0
- package/src/windsurf/governance.js +231 -0
- package/src/windsurf/interactive.js +388 -0
- package/src/windsurf/mcp-packs.js +535 -0
- package/src/windsurf/patch.js +231 -0
- package/src/windsurf/plans.js +247 -0
- package/src/windsurf/premium.js +467 -0
- package/src/windsurf/setup.js +471 -0
- package/src/windsurf/techniques.js +1758 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
const GEMINI_DOMAIN_PACKS = [
|
|
2
|
+
{
|
|
3
|
+
key: 'baseline-general',
|
|
4
|
+
label: 'Baseline General',
|
|
5
|
+
useWhen: 'General Gemini CLI repos that need a safe, reviewable baseline before deeper specialization.',
|
|
6
|
+
adoption: 'Safe default when no stronger domain signal dominates the repo.',
|
|
7
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Review workflow starter'],
|
|
8
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings'],
|
|
9
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json'],
|
|
10
|
+
benchmarkFocus: ['starter-safe improvement', 'reviewable trust posture'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'backend-api',
|
|
14
|
+
label: 'Backend API',
|
|
15
|
+
useWhen: 'Service, API, or backend-heavy repos with routes, services, jobs, schemas, or data access.',
|
|
16
|
+
adoption: 'Recommended when Gemini CLI needs stronger verification and review structure around backend changes.',
|
|
17
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Backend verification guide', 'CI / review workflow starter'],
|
|
18
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings', 'gemini-hooks'],
|
|
19
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json', '.github/workflows/'],
|
|
20
|
+
benchmarkFocus: ['test + build verification', 'reviewable API changes', 'safe rollout posture'],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'frontend-ui',
|
|
24
|
+
label: 'Frontend UI',
|
|
25
|
+
useWhen: 'React, Next.js, Vue, Angular, or Svelte repos with UI-heavy workflows and component work.',
|
|
26
|
+
adoption: 'Recommended when Gemini CLI needs better component, build, and review guidance.',
|
|
27
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Frontend review workflow', 'CI / review workflow starter'],
|
|
28
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings', 'gemini-hooks'],
|
|
29
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json', '.github/workflows/'],
|
|
30
|
+
benchmarkFocus: ['build verification', 'component-safe edits', 'reviewable UI changes'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: 'data-pipeline',
|
|
34
|
+
label: 'Data Pipeline',
|
|
35
|
+
useWhen: 'Repos with workers, DAGs, ETL jobs, migrations, or analytics-heavy workflows.',
|
|
36
|
+
adoption: 'Recommended when Gemini CLI needs pipeline-safe verification and state-aware review.',
|
|
37
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Pipeline verification guide'],
|
|
38
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings', 'gemini-hooks'],
|
|
39
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json', '.github/workflows/'],
|
|
40
|
+
benchmarkFocus: ['pipeline safety', 'repeatable task flows', 'state-aware review'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: 'infra-platform',
|
|
44
|
+
label: 'Infra Platform',
|
|
45
|
+
useWhen: 'Terraform, Docker, Kubernetes, serverless, or deployment-oriented repos with operational blast radius.',
|
|
46
|
+
adoption: 'Recommended when Gemini CLI changes need stronger guardrails, review gates, and infra-aware verification.',
|
|
47
|
+
recommendedModules: ['settings.json baseline', 'Infra review workflow', 'CI / review workflow starter'],
|
|
48
|
+
recommendedProposalFamilies: ['gemini-settings', 'gemini-hooks', 'gemini-commands'],
|
|
49
|
+
recommendedSurfaces: ['.gemini/settings.json', '.gemini/commands/', '.github/workflows/'],
|
|
50
|
+
benchmarkFocus: ['release safety', 'infra verification', 'reviewable operational changes'],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: 'oss-library',
|
|
54
|
+
label: 'OSS Library',
|
|
55
|
+
useWhen: 'Public packages or contributor-heavy repos that need lighter governance.',
|
|
56
|
+
adoption: 'Recommended for open-source repos where Gemini CLI should suggest, not auto-apply.',
|
|
57
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline'],
|
|
58
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings'],
|
|
59
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json'],
|
|
60
|
+
benchmarkFocus: ['low-footprint adoption', 'contributor-safe defaults', 'manual review friendliness'],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: 'enterprise-governed',
|
|
64
|
+
label: 'Enterprise Governed',
|
|
65
|
+
useWhen: 'Repos with CI, policy files, security posture, or auditable team workflows that need stronger Gemini CLI governance.',
|
|
66
|
+
adoption: 'Recommended for teams that need explicit approvals, review expectations, and durable rollout evidence.',
|
|
67
|
+
recommendedModules: ['settings.json baseline', 'Review workflow starter', 'Governance rollout kit'],
|
|
68
|
+
recommendedProposalFamilies: ['gemini-settings', 'gemini-hooks', 'gemini-agents'],
|
|
69
|
+
recommendedSurfaces: ['.gemini/settings.json', '.gemini/agents/', '.github/workflows/'],
|
|
70
|
+
benchmarkFocus: ['policy-aware rollout', 'approval posture', 'repeatable governance evidence'],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: 'monorepo',
|
|
74
|
+
label: 'Monorepo',
|
|
75
|
+
useWhen: 'Workspace-based repos with multiple packages sharing a root and a need for scoped Gemini CLI behavior.',
|
|
76
|
+
adoption: 'Recommended when path-aware settings and workspace review boundaries matter.',
|
|
77
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Workspace-aware commands', 'Review workflow starter'],
|
|
78
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings', 'gemini-commands'],
|
|
79
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json', '.gemini/commands/'],
|
|
80
|
+
benchmarkFocus: ['workspace-safe edits', 'package-scoped review', 'cross-package drift control'],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: 'mobile',
|
|
84
|
+
label: 'Mobile',
|
|
85
|
+
useWhen: 'React Native, Flutter, Swift, or Kotlin repos with mobile-specific build and test workflows.',
|
|
86
|
+
adoption: 'Recommended when Gemini CLI needs mobile build awareness and platform-specific verification.',
|
|
87
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Mobile verification guide'],
|
|
88
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings'],
|
|
89
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json'],
|
|
90
|
+
benchmarkFocus: ['mobile build safety', 'platform-specific verification', 'reviewable native changes'],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: 'regulated-lite',
|
|
94
|
+
label: 'Regulated Lite',
|
|
95
|
+
useWhen: 'Repos with basic compliance needs — activity artifacts, rollback manifests, and audit trail.',
|
|
96
|
+
adoption: 'Recommended for regulated-adjacent repos that need governance without full enterprise overhead.',
|
|
97
|
+
recommendedModules: ['settings.json baseline', 'Governance rollout kit'],
|
|
98
|
+
recommendedProposalFamilies: ['gemini-settings', 'gemini-hooks'],
|
|
99
|
+
recommendedSurfaces: ['.gemini/settings.json', '.gemini/agents/'],
|
|
100
|
+
benchmarkFocus: ['compliance posture', 'activity artifact coverage', 'rollback readiness'],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: 'ecommerce',
|
|
104
|
+
label: 'E-commerce',
|
|
105
|
+
useWhen: 'Shopify, Stripe, or payment-heavy repos with transaction safety needs.',
|
|
106
|
+
adoption: 'Recommended when Gemini CLI changes touch payment flows, cart logic, or sensitive data.',
|
|
107
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Security review workflow'],
|
|
108
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings', 'gemini-hooks'],
|
|
109
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json', '.github/workflows/'],
|
|
110
|
+
benchmarkFocus: ['transaction safety', 'payment flow review', 'PII-safe changes'],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: 'ai-ml',
|
|
114
|
+
label: 'AI / ML',
|
|
115
|
+
useWhen: 'Repos with ML pipelines, model training, RAG, or LLM integration workflows.',
|
|
116
|
+
adoption: 'Recommended when Gemini CLI needs model-aware verification and experiment tracking.',
|
|
117
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'ML verification guide'],
|
|
118
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings'],
|
|
119
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json'],
|
|
120
|
+
benchmarkFocus: ['model safety', 'experiment reproducibility', 'data pipeline review'],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
key: 'devops-cicd',
|
|
124
|
+
label: 'DevOps / CI-CD',
|
|
125
|
+
useWhen: 'Repos focused on CI/CD pipelines, deployment automation, and infrastructure-as-code.',
|
|
126
|
+
adoption: 'Recommended when Gemini CLI manages CI workflows, deployment scripts, or release processes.',
|
|
127
|
+
recommendedModules: ['settings.json baseline', 'CI / review workflow starter'],
|
|
128
|
+
recommendedProposalFamilies: ['gemini-settings', 'gemini-hooks', 'gemini-commands'],
|
|
129
|
+
recommendedSurfaces: ['.gemini/settings.json', '.gemini/commands/', '.github/workflows/'],
|
|
130
|
+
benchmarkFocus: ['deployment safety', 'CI pipeline review', 'release gate coverage'],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
key: 'design-system',
|
|
134
|
+
label: 'Design System',
|
|
135
|
+
useWhen: 'Component libraries, Storybook repos, or design token systems.',
|
|
136
|
+
adoption: 'Recommended when Gemini CLI edits shared UI components with downstream consumers.',
|
|
137
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline', 'Component review workflow'],
|
|
138
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings'],
|
|
139
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json'],
|
|
140
|
+
benchmarkFocus: ['component safety', 'visual regression awareness', 'cross-consumer impact'],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
key: 'docs-content',
|
|
144
|
+
label: 'Docs / Content',
|
|
145
|
+
useWhen: 'Documentation repos, blogs, or content-heavy sites with editorial workflows.',
|
|
146
|
+
adoption: 'Recommended when Gemini CLI edits prose, docs, or content with editorial review needs.',
|
|
147
|
+
recommendedModules: ['GEMINI.md baseline', 'settings.json baseline'],
|
|
148
|
+
recommendedProposalFamilies: ['gemini-md', 'gemini-settings'],
|
|
149
|
+
recommendedSurfaces: ['GEMINI.md', '.gemini/settings.json'],
|
|
150
|
+
benchmarkFocus: ['content quality', 'editorial review', 'link and reference integrity'],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
key: 'security-focused',
|
|
154
|
+
label: 'Security Focused',
|
|
155
|
+
useWhen: 'Repos with strong security posture needs — secret management, auth, encryption.',
|
|
156
|
+
adoption: 'Recommended for security-critical repos where every Gemini CLI change needs security review.',
|
|
157
|
+
recommendedModules: ['settings.json baseline', 'Security review workflow'],
|
|
158
|
+
recommendedProposalFamilies: ['gemini-settings', 'gemini-hooks', 'gemini-agents'],
|
|
159
|
+
recommendedSurfaces: ['.gemini/settings.json', '.gemini/agents/', '.github/workflows/'],
|
|
160
|
+
benchmarkFocus: ['secret protection', 'auth flow safety', 'security review coverage'],
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
function uniqueByKey(items) {
|
|
165
|
+
const seen = new Set();
|
|
166
|
+
const result = [];
|
|
167
|
+
for (const item of items) {
|
|
168
|
+
if (seen.has(item.key)) continue;
|
|
169
|
+
seen.add(item.key);
|
|
170
|
+
result.push(item);
|
|
171
|
+
}
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function detectGeminiDomainPacks(ctx, stacks = [], assets = {}) {
|
|
176
|
+
const stackKeys = new Set((stacks || []).map((stack) => stack.key));
|
|
177
|
+
const pkg = ctx.jsonFile ? (ctx.jsonFile('package.json') || {}) : {};
|
|
178
|
+
const deps = ctx.projectDependencies ? ctx.projectDependencies() : {
|
|
179
|
+
...(pkg.dependencies || {}),
|
|
180
|
+
...(pkg.devDependencies || {}),
|
|
181
|
+
};
|
|
182
|
+
const matches = [];
|
|
183
|
+
|
|
184
|
+
function addMatch(key, reasons) {
|
|
185
|
+
const pack = GEMINI_DOMAIN_PACKS.find((item) => item.key === key);
|
|
186
|
+
if (!pack) return;
|
|
187
|
+
matches.push({
|
|
188
|
+
...pack,
|
|
189
|
+
matchReasons: reasons.filter(Boolean).slice(0, 3),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const hasFrontend = stackKeys.has('react') || stackKeys.has('nextjs') || stackKeys.has('vue') ||
|
|
194
|
+
stackKeys.has('angular') || stackKeys.has('svelte') ||
|
|
195
|
+
ctx.hasDir('components') || ctx.hasDir('pages') ||
|
|
196
|
+
(ctx.hasDir('app') && (deps.next || deps.react || deps.vue || deps['@angular/core'] || deps.svelte));
|
|
197
|
+
|
|
198
|
+
const hasBackend = stackKeys.has('python') || stackKeys.has('django') || stackKeys.has('fastapi') ||
|
|
199
|
+
stackKeys.has('go') || stackKeys.has('rust') || stackKeys.has('java') ||
|
|
200
|
+
ctx.hasDir('api') || ctx.hasDir('routes') || ctx.hasDir('services') || ctx.hasDir('controllers') ||
|
|
201
|
+
ctx.hasDir('workers') || ctx.hasDir('jobs');
|
|
202
|
+
|
|
203
|
+
const hasInfra = stackKeys.has('docker') || stackKeys.has('terraform') || stackKeys.has('kubernetes') ||
|
|
204
|
+
ctx.files.includes('wrangler.toml') || ctx.files.includes('serverless.yml') || ctx.files.includes('serverless.yaml') ||
|
|
205
|
+
ctx.files.includes('cdk.json') || ctx.hasDir('infra') || ctx.hasDir('deploy') || ctx.hasDir('helm');
|
|
206
|
+
|
|
207
|
+
const isMonorepo = ctx.files.includes('nx.json') || ctx.files.includes('turbo.json') ||
|
|
208
|
+
ctx.files.includes('lerna.json') || ctx.files.includes('pnpm-workspace.yaml') ||
|
|
209
|
+
ctx.hasDir('packages') ||
|
|
210
|
+
(pkg.workspaces && (Array.isArray(pkg.workspaces) ? pkg.workspaces.length > 0 : true));
|
|
211
|
+
|
|
212
|
+
const hasCi = (typeof ctx.workflowFiles === 'function' ? ctx.workflowFiles().length : 0) > 0 ||
|
|
213
|
+
ctx.hasDir('.github/workflows');
|
|
214
|
+
const hasPolicyFiles = Boolean(ctx.fileContent('SECURITY.md') || ctx.fileContent('CODEOWNERS')) ||
|
|
215
|
+
ctx.hasDir('compliance') || ctx.hasDir('policies') || ctx.hasDir('audit');
|
|
216
|
+
const explicitTrust = Boolean(assets.trust && assets.trust.approvalPolicy && assets.trust.sandboxMode);
|
|
217
|
+
const ruleCoverage = Number(assets.counts && assets.counts.rules) > 0;
|
|
218
|
+
const workflowCoverage = Number(assets.counts && assets.counts.workflows) > 0;
|
|
219
|
+
const isEnterpriseGoverned = (hasCi && explicitTrust) || hasPolicyFiles || (ruleCoverage && workflowCoverage);
|
|
220
|
+
|
|
221
|
+
if (hasBackend) {
|
|
222
|
+
addMatch('backend-api', [
|
|
223
|
+
'Detected backend stack or service-oriented directories for Gemini CLI to navigate.',
|
|
224
|
+
ctx.hasDir('api') ? 'API-facing structure detected.' : null,
|
|
225
|
+
ctx.hasDir('services') ? 'Service-layer directories detected.' : null,
|
|
226
|
+
]);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (hasFrontend) {
|
|
230
|
+
addMatch('frontend-ui', [
|
|
231
|
+
'Detected UI-heavy frontend stack or component directories.',
|
|
232
|
+
stackKeys.has('nextjs') ? 'Next.js stack detected.' : null,
|
|
233
|
+
ctx.hasDir('components') ? 'Component directories detected.' : null,
|
|
234
|
+
]);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (isEnterpriseGoverned) {
|
|
238
|
+
addMatch('enterprise-governed', [
|
|
239
|
+
'Detected team-governed rollout signals such as CI, policies, or explicit Gemini CLI trust posture.',
|
|
240
|
+
hasCi ? 'GitHub workflow automation detected.' : null,
|
|
241
|
+
hasPolicyFiles ? 'Security/compliance policy files detected.' : null,
|
|
242
|
+
]);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (isMonorepo) {
|
|
246
|
+
addMatch('monorepo', [
|
|
247
|
+
'Detected workspace or multi-package repository structure.',
|
|
248
|
+
ctx.files.includes('pnpm-workspace.yaml') ? 'pnpm workspace detected.' : null,
|
|
249
|
+
ctx.hasDir('packages') ? 'Packages directory detected.' : null,
|
|
250
|
+
]);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (hasInfra) {
|
|
254
|
+
addMatch('infra-platform', [
|
|
255
|
+
'Detected infrastructure or deployment-oriented repo signals.',
|
|
256
|
+
ctx.files.includes('wrangler.toml') ? 'Wrangler config detected.' : null,
|
|
257
|
+
ctx.hasDir('infra') ? 'Infrastructure directory detected.' : null,
|
|
258
|
+
]);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// --- Parity expansion: detect additional domain packs ---
|
|
262
|
+
|
|
263
|
+
const hasDataPipeline = ctx.hasDir('dags') || ctx.hasDir('etl') || ctx.hasDir('pipelines') ||
|
|
264
|
+
ctx.hasDir('marts') || ctx.hasDir('migrations') ||
|
|
265
|
+
deps.airflow || deps.prefect || deps.dagster || deps.dbt;
|
|
266
|
+
if (hasDataPipeline) {
|
|
267
|
+
addMatch('data-pipeline', [
|
|
268
|
+
'Detected data pipeline or ETL-oriented repo signals.',
|
|
269
|
+
ctx.hasDir('dags') ? 'DAG directory detected.' : null,
|
|
270
|
+
]);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const isOss = ctx.files.includes('LICENSE') && ctx.files.includes('CONTRIBUTING.md');
|
|
274
|
+
if (isOss && !isEnterpriseGoverned) {
|
|
275
|
+
addMatch('oss-library', [
|
|
276
|
+
'Detected open-source library signals (LICENSE + CONTRIBUTING.md).',
|
|
277
|
+
]);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const isMobile = stackKeys.has('react-native') || stackKeys.has('flutter') ||
|
|
281
|
+
stackKeys.has('swift') || stackKeys.has('kotlin') ||
|
|
282
|
+
deps['react-native'] || deps.flutter || ctx.files.includes('Podfile') ||
|
|
283
|
+
ctx.files.includes('build.gradle') || ctx.hasDir('ios') || ctx.hasDir('android');
|
|
284
|
+
if (isMobile) {
|
|
285
|
+
addMatch('mobile', [
|
|
286
|
+
'Detected mobile development signals.',
|
|
287
|
+
ctx.hasDir('ios') ? 'iOS directory detected.' : null,
|
|
288
|
+
ctx.hasDir('android') ? 'Android directory detected.' : null,
|
|
289
|
+
]);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const isRegulated = hasPolicyFiles && !isEnterpriseGoverned;
|
|
293
|
+
if (isRegulated) {
|
|
294
|
+
addMatch('regulated-lite', [
|
|
295
|
+
'Detected compliance-adjacent signals without full enterprise governance.',
|
|
296
|
+
]);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const isEcommerce = deps.stripe || deps['@stripe/stripe-js'] ||
|
|
300
|
+
deps.shopify || deps['@shopify/shopify-api'] ||
|
|
301
|
+
ctx.hasDir('checkout') || ctx.hasDir('cart') || ctx.hasDir('payments');
|
|
302
|
+
if (isEcommerce) {
|
|
303
|
+
addMatch('ecommerce', [
|
|
304
|
+
'Detected e-commerce or payment-related signals.',
|
|
305
|
+
deps.stripe ? 'Stripe dependency detected.' : null,
|
|
306
|
+
]);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const isAiMl = deps.tensorflow || deps.torch || deps.pytorch || deps.transformers ||
|
|
310
|
+
deps.langchain || deps['@langchain/core'] || deps.openai || deps.anthropic ||
|
|
311
|
+
ctx.hasDir('models') || ctx.hasDir('training') || ctx.hasDir('rag') ||
|
|
312
|
+
ctx.files.includes('model.py') || ctx.files.includes('train.py');
|
|
313
|
+
if (isAiMl) {
|
|
314
|
+
addMatch('ai-ml', [
|
|
315
|
+
'Detected AI/ML or model training signals.',
|
|
316
|
+
ctx.hasDir('models') ? 'Models directory detected.' : null,
|
|
317
|
+
]);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const isDevops = hasCi && hasInfra && !isEnterpriseGoverned;
|
|
321
|
+
if (isDevops) {
|
|
322
|
+
addMatch('devops-cicd', [
|
|
323
|
+
'Detected DevOps/CI-CD focus with both CI workflows and infrastructure.',
|
|
324
|
+
]);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const isDesignSystem = ctx.hasDir('stories') || ctx.hasDir('storybook') ||
|
|
328
|
+
deps['@storybook/react'] || deps['@storybook/vue3'] ||
|
|
329
|
+
ctx.files.includes('.storybook');
|
|
330
|
+
if (isDesignSystem) {
|
|
331
|
+
addMatch('design-system', [
|
|
332
|
+
'Detected design system or component library signals.',
|
|
333
|
+
ctx.hasDir('stories') ? 'Storybook stories detected.' : null,
|
|
334
|
+
]);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const isDocsContent = ctx.hasDir('docs') && !hasBackend && !hasFrontend &&
|
|
338
|
+
(ctx.files.includes('mkdocs.yml') || ctx.files.includes('docusaurus.config.js') ||
|
|
339
|
+
ctx.files.includes('_config.yml') || ctx.files.includes('hugo.toml'));
|
|
340
|
+
if (isDocsContent) {
|
|
341
|
+
addMatch('docs-content', [
|
|
342
|
+
'Detected documentation or content-focused repo.',
|
|
343
|
+
]);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const isSecurityFocused = ctx.hasDir('security') ||
|
|
347
|
+
deps['helmet'] || deps['csurf'] || deps['bcrypt'] ||
|
|
348
|
+
(hasPolicyFiles && ctx.fileContent('SECURITY.md'));
|
|
349
|
+
if (isSecurityFocused) {
|
|
350
|
+
addMatch('security-focused', [
|
|
351
|
+
'Detected security-focused repo signals.',
|
|
352
|
+
ctx.fileContent('SECURITY.md') ? 'SECURITY.md present.' : null,
|
|
353
|
+
]);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (matches.length === 0) {
|
|
357
|
+
addMatch('baseline-general', [
|
|
358
|
+
'No stronger platform-specific domain dominated, so a safe general Gemini CLI baseline is the best starting point.',
|
|
359
|
+
assets.instructionPath
|
|
360
|
+
? 'The repo already has Gemini CLI surfaces, but they are not yet specialized by domain.'
|
|
361
|
+
: 'The repo needs a first Gemini CLI baseline before specialization.',
|
|
362
|
+
]);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return uniqueByKey(matches);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
module.exports = {
|
|
369
|
+
GEMINI_DOMAIN_PACKS,
|
|
370
|
+
detectGeminiDomainPacks,
|
|
371
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini Freshness Operationalization
|
|
3
|
+
*
|
|
4
|
+
* Release gates, recurring probes, propagation checklists,
|
|
5
|
+
* and staleness blocking for Gemini CLI surfaces.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { version } = require('../../package.json');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* P0 sources that must be fresh before any Gemini release claim.
|
|
12
|
+
* Each source has a staleness threshold in days.
|
|
13
|
+
* From the watchlist: 62 sources, 18 P0 — main ones listed here.
|
|
14
|
+
*/
|
|
15
|
+
const P0_SOURCES = [
|
|
16
|
+
{
|
|
17
|
+
key: 'gemini-cli-docs',
|
|
18
|
+
label: 'Gemini CLI Official Docs',
|
|
19
|
+
url: 'https://ai.google.dev/gemini-api/docs/cli',
|
|
20
|
+
stalenessThresholdDays: 30,
|
|
21
|
+
verifiedAt: null,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: 'gemini-config-reference',
|
|
25
|
+
label: 'Gemini Config Reference',
|
|
26
|
+
url: 'https://ai.google.dev/gemini-api/docs/cli/config',
|
|
27
|
+
stalenessThresholdDays: 30,
|
|
28
|
+
verifiedAt: null,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'gemini-md-guide',
|
|
32
|
+
label: 'GEMINI.md Guide',
|
|
33
|
+
url: 'https://ai.google.dev/gemini-api/docs/cli/gemini-md',
|
|
34
|
+
stalenessThresholdDays: 30,
|
|
35
|
+
verifiedAt: null,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: 'gemini-hooks-docs',
|
|
39
|
+
label: 'Gemini Hooks Documentation',
|
|
40
|
+
url: 'https://ai.google.dev/gemini-api/docs/cli/hooks',
|
|
41
|
+
stalenessThresholdDays: 30,
|
|
42
|
+
verifiedAt: null,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'gemini-sandbox-docs',
|
|
46
|
+
label: 'Gemini Sandbox Documentation',
|
|
47
|
+
url: 'https://ai.google.dev/gemini-api/docs/cli/sandbox',
|
|
48
|
+
stalenessThresholdDays: 30,
|
|
49
|
+
verifiedAt: null,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'gemini-policy-engine-docs',
|
|
53
|
+
label: 'Gemini Policy Engine Documentation',
|
|
54
|
+
url: 'https://ai.google.dev/gemini-api/docs/cli/policy',
|
|
55
|
+
stalenessThresholdDays: 30,
|
|
56
|
+
verifiedAt: null,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'gemini-mcp-docs',
|
|
60
|
+
label: 'Gemini MCP Documentation',
|
|
61
|
+
url: 'https://ai.google.dev/gemini-api/docs/cli/mcp',
|
|
62
|
+
stalenessThresholdDays: 30,
|
|
63
|
+
verifiedAt: null,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: 'gemini-changelog',
|
|
67
|
+
label: 'Gemini CLI Changelog',
|
|
68
|
+
url: 'https://github.com/google/gemini-cli/releases',
|
|
69
|
+
stalenessThresholdDays: 14,
|
|
70
|
+
verifiedAt: null,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: 'gemini-github-action-docs',
|
|
74
|
+
label: 'Gemini GitHub Action Docs',
|
|
75
|
+
url: 'https://github.com/google/gemini-action',
|
|
76
|
+
stalenessThresholdDays: 30,
|
|
77
|
+
verifiedAt: null,
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Propagation checklist: when a Gemini source changes, these must update.
|
|
83
|
+
*/
|
|
84
|
+
const PROPAGATION_CHECKLIST = [
|
|
85
|
+
{
|
|
86
|
+
trigger: 'Gemini CLI release with config or sandbox changes',
|
|
87
|
+
targets: [
|
|
88
|
+
'src/gemini/techniques.js — update LEGACY patterns, sandbox options, policy syntax',
|
|
89
|
+
'src/gemini/config-parser.js — update validation rules',
|
|
90
|
+
'src/gemini/domain-packs.js — update pack projections if schema changed',
|
|
91
|
+
'test/gemini-check-matrix.js — update check expectations',
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
trigger: 'New Gemini hook event type added',
|
|
96
|
+
targets: [
|
|
97
|
+
'src/gemini/techniques.js — add to SUPPORTED_HOOK_EVENTS',
|
|
98
|
+
'src/gemini/governance.js — add to GEMINI_HOOK_REGISTRY',
|
|
99
|
+
'src/gemini/setup.js — update hooks starter template',
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
trigger: 'New Gemini MCP transport or field',
|
|
104
|
+
targets: [
|
|
105
|
+
'src/gemini/mcp-packs.js — update pack JSON projections',
|
|
106
|
+
'src/gemini/techniques.js — update MCP checks',
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
trigger: 'New sandbox option or isolation mode added',
|
|
111
|
+
targets: [
|
|
112
|
+
'src/gemini/techniques.js — update sandbox checks',
|
|
113
|
+
'src/gemini/governance.js — update governance profiles with new sandbox options',
|
|
114
|
+
'src/gemini/setup.js — update sandbox starter template',
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
trigger: 'Policy engine syntax or rule format change',
|
|
119
|
+
targets: [
|
|
120
|
+
'src/gemini/techniques.js — update policy validation checks',
|
|
121
|
+
'src/gemini/governance.js — update policy templates and caveats',
|
|
122
|
+
'src/gemini/config-parser.js — update policy parsing rules',
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Release gate: check if all P0 sources are within staleness threshold.
|
|
129
|
+
* Returns { ready, stale, fresh } arrays.
|
|
130
|
+
*/
|
|
131
|
+
function checkReleaseGate(sourceVerifications = {}) {
|
|
132
|
+
const now = new Date();
|
|
133
|
+
const results = P0_SOURCES.map(source => {
|
|
134
|
+
const verifiedAt = sourceVerifications[source.key]
|
|
135
|
+
? new Date(sourceVerifications[source.key])
|
|
136
|
+
: source.verifiedAt ? new Date(source.verifiedAt) : null;
|
|
137
|
+
|
|
138
|
+
if (!verifiedAt) {
|
|
139
|
+
return { ...source, status: 'unverified', daysStale: null };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const daysSince = Math.floor((now - verifiedAt) / (1000 * 60 * 60 * 24));
|
|
143
|
+
const isStale = daysSince > source.stalenessThresholdDays;
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
...source,
|
|
147
|
+
verifiedAt: verifiedAt.toISOString(),
|
|
148
|
+
daysStale: daysSince,
|
|
149
|
+
status: isStale ? 'stale' : 'fresh',
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
ready: results.every(r => r.status === 'fresh'),
|
|
155
|
+
stale: results.filter(r => r.status === 'stale' || r.status === 'unverified'),
|
|
156
|
+
fresh: results.filter(r => r.status === 'fresh'),
|
|
157
|
+
results,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Format the release gate results for display.
|
|
163
|
+
*/
|
|
164
|
+
function formatReleaseGate(gateResult) {
|
|
165
|
+
const lines = [
|
|
166
|
+
`Gemini Freshness Gate (nerviq v${version})`,
|
|
167
|
+
'═══════════════════════════════════════',
|
|
168
|
+
'',
|
|
169
|
+
`Status: ${gateResult.ready ? 'READY' : 'BLOCKED'}`,
|
|
170
|
+
`Fresh: ${gateResult.fresh.length}/${gateResult.results.length}`,
|
|
171
|
+
'',
|
|
172
|
+
];
|
|
173
|
+
|
|
174
|
+
for (const result of gateResult.results) {
|
|
175
|
+
const icon = result.status === 'fresh' ? '✓' : result.status === 'stale' ? '✗' : '?';
|
|
176
|
+
const age = result.daysStale !== null ? ` (${result.daysStale}d ago)` : ' (unverified)';
|
|
177
|
+
lines.push(` ${icon} ${result.label}${age} — threshold: ${result.stalenessThresholdDays}d`);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (!gateResult.ready) {
|
|
181
|
+
lines.push('');
|
|
182
|
+
lines.push('Action required: verify stale/unverified sources before claiming release freshness.');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return lines.join('\n');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Get the propagation checklist for a given trigger.
|
|
190
|
+
*/
|
|
191
|
+
function getPropagationTargets(triggerKeyword) {
|
|
192
|
+
const keyword = triggerKeyword.toLowerCase();
|
|
193
|
+
return PROPAGATION_CHECKLIST.filter(item =>
|
|
194
|
+
item.trigger.toLowerCase().includes(keyword)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
module.exports = {
|
|
199
|
+
P0_SOURCES,
|
|
200
|
+
PROPAGATION_CHECKLIST,
|
|
201
|
+
checkReleaseGate,
|
|
202
|
+
formatReleaseGate,
|
|
203
|
+
getPropagationTargets,
|
|
204
|
+
};
|