@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,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windsurf Domain Packs — 16 domain packs with Windsurf detection.
|
|
3
|
+
*
|
|
4
|
+
* Adapted from Cursor pattern with Windsurf-specific surfaces:
|
|
5
|
+
* - .windsurf/rules/*.md (Markdown + YAML frontmatter, NOT MDC)
|
|
6
|
+
* - .windsurf/mcp.json (with team whitelist)
|
|
7
|
+
* - .windsurf/workflows/*.md (slash commands)
|
|
8
|
+
* - .windsurf/memories/ (team-syncable)
|
|
9
|
+
* - .cascadeignore (gitignore for Cascade)
|
|
10
|
+
* - No background agents (unlike Cursor)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const WINDSURF_DOMAIN_PACKS = [
|
|
14
|
+
{
|
|
15
|
+
key: 'baseline-general',
|
|
16
|
+
label: 'Baseline General',
|
|
17
|
+
useWhen: 'General repos that need a safe, reviewable baseline before deeper specialization.',
|
|
18
|
+
adoption: 'Safe default when no stronger domain signal dominates the repo.',
|
|
19
|
+
recommendedModules: ['.windsurf/rules/ baseline', '.windsurf/mcp.json baseline', 'Workflows starter'],
|
|
20
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp'],
|
|
21
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
22
|
+
benchmarkFocus: ['starter-safe improvement', 'reviewable trust posture'],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'backend-api',
|
|
26
|
+
label: 'Backend API',
|
|
27
|
+
useWhen: 'Service, API, or backend-heavy repos with routes, services, jobs, schemas, or data access.',
|
|
28
|
+
adoption: 'Recommended when Cascade agents need stronger verification and review structure.',
|
|
29
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Backend verification rules', 'CI / review workflow starter'],
|
|
30
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
31
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
|
|
32
|
+
benchmarkFocus: ['test + build verification', 'reviewable API changes', 'safe rollout posture'],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: 'frontend-ui',
|
|
36
|
+
label: 'Frontend UI',
|
|
37
|
+
useWhen: 'React, Next.js, Vue, Angular, or Svelte repos with UI-heavy workflows.',
|
|
38
|
+
adoption: 'Recommended when Cascade agents need better component and build guidance.',
|
|
39
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Frontend review rules', 'Cascade UI guide'],
|
|
40
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
41
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
42
|
+
benchmarkFocus: ['build verification', 'component-safe edits', 'Cascade multi-file awareness'],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'data-pipeline',
|
|
46
|
+
label: 'Data Pipeline',
|
|
47
|
+
useWhen: 'Repos with workers, DAGs, ETL jobs, migrations, or analytics-heavy workflows.',
|
|
48
|
+
adoption: 'Recommended when Cascade agents need pipeline-safe verification.',
|
|
49
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Pipeline verification rules'],
|
|
50
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
51
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
52
|
+
benchmarkFocus: ['pipeline safety', 'repeatable task flows', 'state-aware review'],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: 'infra-platform',
|
|
56
|
+
label: 'Infra Platform',
|
|
57
|
+
useWhen: 'Terraform, Docker, Kubernetes, serverless, or deployment-oriented repos.',
|
|
58
|
+
adoption: 'Recommended when Cascade changes need stronger guardrails and infra-aware verification.',
|
|
59
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Infra review rules', 'Cascadeignore config'],
|
|
60
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
61
|
+
recommendedSurfaces: ['.windsurf/rules/', '.cascadeignore', '.github/workflows/'],
|
|
62
|
+
benchmarkFocus: ['release safety', 'infra verification', 'reviewable operational changes'],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: 'oss-library',
|
|
66
|
+
label: 'OSS Library',
|
|
67
|
+
useWhen: 'Public packages or contributor-heavy repos that need lighter governance.',
|
|
68
|
+
adoption: 'Recommended for open-source repos where Cascade should suggest, not auto-apply.',
|
|
69
|
+
recommendedModules: ['.windsurf/rules/ baseline'],
|
|
70
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
71
|
+
recommendedSurfaces: ['.windsurf/rules/'],
|
|
72
|
+
benchmarkFocus: ['low-footprint adoption', 'contributor-safe defaults', 'manual review friendliness'],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: 'enterprise-governed',
|
|
76
|
+
label: 'Enterprise Governed',
|
|
77
|
+
useWhen: 'Repos with CI, policy files, security posture, or auditable team workflows.',
|
|
78
|
+
adoption: 'Recommended for teams that need explicit approvals, review expectations, and governance.',
|
|
79
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Governance rollout kit', 'Enterprise policy rules', 'Team memories'],
|
|
80
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise', 'windsurf-ci-review'],
|
|
81
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/memories/', '.github/workflows/'],
|
|
82
|
+
benchmarkFocus: ['policy-aware rollout', 'approval posture', 'repeatable governance evidence'],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: 'monorepo',
|
|
86
|
+
label: 'Monorepo',
|
|
87
|
+
useWhen: 'Workspace-based repos with multiple packages sharing a root.',
|
|
88
|
+
adoption: 'Recommended when glob-scoped Auto rules and workspace boundaries matter.',
|
|
89
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Auto rules per package', 'Workflows'],
|
|
90
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp'],
|
|
91
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.windsurf/workflows/'],
|
|
92
|
+
benchmarkFocus: ['workspace-safe edits', 'package-scoped rules', 'cross-package drift control'],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'mobile',
|
|
96
|
+
label: 'Mobile',
|
|
97
|
+
useWhen: 'React Native, Flutter, Swift, or Kotlin repos with mobile-specific workflows.',
|
|
98
|
+
adoption: 'Recommended when Cascade needs mobile build awareness and platform-specific verification.',
|
|
99
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Mobile verification rules'],
|
|
100
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
101
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
102
|
+
benchmarkFocus: ['mobile build safety', 'platform-specific verification', 'reviewable native changes'],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
key: 'regulated-lite',
|
|
106
|
+
label: 'Regulated Lite',
|
|
107
|
+
useWhen: 'Repos with basic compliance needs — activity artifacts, rollback manifests, and audit trail.',
|
|
108
|
+
adoption: 'Recommended for regulated-adjacent repos that need governance without full enterprise overhead.',
|
|
109
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Cascadeignore for sensitive files'],
|
|
110
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise'],
|
|
111
|
+
recommendedSurfaces: ['.windsurf/rules/'],
|
|
112
|
+
benchmarkFocus: ['compliance posture', 'cascadeignore coverage', 'rollback readiness'],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
key: 'ecommerce',
|
|
116
|
+
label: 'E-commerce',
|
|
117
|
+
useWhen: 'Shopify, Stripe, or payment-heavy repos with transaction safety needs.',
|
|
118
|
+
adoption: 'Recommended when Cascade changes touch payment flows, cart logic, or sensitive data.',
|
|
119
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Security review rules'],
|
|
120
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
121
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
|
|
122
|
+
benchmarkFocus: ['transaction safety', 'payment flow review', 'PII-safe changes'],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: 'ai-ml',
|
|
126
|
+
label: 'AI / ML',
|
|
127
|
+
useWhen: 'Repos with ML pipelines, model training, RAG, or LLM integration workflows.',
|
|
128
|
+
adoption: 'Recommended when Cascade needs model-aware verification and experiment tracking.',
|
|
129
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'ML verification rules'],
|
|
130
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
131
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
132
|
+
benchmarkFocus: ['model safety', 'experiment reproducibility', 'data pipeline review'],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
key: 'devops-cicd',
|
|
136
|
+
label: 'DevOps / CI-CD',
|
|
137
|
+
useWhen: 'Repos focused on CI/CD pipelines, deployment automation, and infrastructure-as-code.',
|
|
138
|
+
adoption: 'Recommended when Cascade manages CI workflows, deployment scripts, or release processes.',
|
|
139
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Workflow automation rules'],
|
|
140
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
141
|
+
recommendedSurfaces: ['.windsurf/rules/', '.github/workflows/'],
|
|
142
|
+
benchmarkFocus: ['deployment safety', 'CI pipeline review', 'workflow trigger safety'],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: 'design-system',
|
|
146
|
+
label: 'Design System',
|
|
147
|
+
useWhen: 'Component libraries, Storybook repos, or design token systems.',
|
|
148
|
+
adoption: 'Recommended when Cascade edits shared UI components with downstream consumers.',
|
|
149
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Component review rules'],
|
|
150
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
151
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
152
|
+
benchmarkFocus: ['component safety', 'visual regression awareness', 'Cascade multi-file tracking'],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
key: 'docs-content',
|
|
156
|
+
label: 'Docs / Content',
|
|
157
|
+
useWhen: 'Documentation repos, blogs, or content-heavy sites with editorial workflows.',
|
|
158
|
+
adoption: 'Recommended when Cascade edits prose, docs, or content with editorial review needs.',
|
|
159
|
+
recommendedModules: ['.windsurf/rules/ baseline'],
|
|
160
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
161
|
+
recommendedSurfaces: ['.windsurf/rules/'],
|
|
162
|
+
benchmarkFocus: ['content quality', 'editorial review', 'link and reference integrity'],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
key: 'security-focused',
|
|
166
|
+
label: 'Security Focused',
|
|
167
|
+
useWhen: 'Repos with strong security posture needs — secret management, auth, encryption.',
|
|
168
|
+
adoption: 'Recommended for security-critical repos where every Cascade change needs security review.',
|
|
169
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Security review rules', 'Cascadeignore for secrets'],
|
|
170
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise'],
|
|
171
|
+
recommendedSurfaces: ['.windsurf/rules/', '.cascadeignore'],
|
|
172
|
+
benchmarkFocus: ['secret protection', 'cascadeignore enforcement', 'security review coverage'],
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
|
|
176
|
+
function uniqueByKey(items) {
|
|
177
|
+
const seen = new Set();
|
|
178
|
+
const result = [];
|
|
179
|
+
for (const item of items) {
|
|
180
|
+
if (seen.has(item.key)) continue;
|
|
181
|
+
seen.add(item.key);
|
|
182
|
+
result.push(item);
|
|
183
|
+
}
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function detectWindsurfDomainPacks(ctx, stacks = [], assets = {}) {
|
|
188
|
+
const stackKeys = new Set((stacks || []).map((stack) => stack.key));
|
|
189
|
+
const pkg = ctx.jsonFile ? (ctx.jsonFile('package.json') || {}) : {};
|
|
190
|
+
const deps = ctx.projectDependencies ? ctx.projectDependencies() : {
|
|
191
|
+
...(pkg.dependencies || {}),
|
|
192
|
+
...(pkg.devDependencies || {}),
|
|
193
|
+
};
|
|
194
|
+
const matches = [];
|
|
195
|
+
|
|
196
|
+
function addMatch(key, reasons) {
|
|
197
|
+
const pack = WINDSURF_DOMAIN_PACKS.find((item) => item.key === key);
|
|
198
|
+
if (!pack) return;
|
|
199
|
+
matches.push({ ...pack, matchReasons: reasons.filter(Boolean).slice(0, 3) });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const hasFrontend = stackKeys.has('react') || stackKeys.has('nextjs') || stackKeys.has('vue') ||
|
|
203
|
+
stackKeys.has('angular') || stackKeys.has('svelte') ||
|
|
204
|
+
ctx.hasDir('components') || ctx.hasDir('pages') ||
|
|
205
|
+
(ctx.hasDir('app') && (deps.next || deps.react || deps.vue || deps['@angular/core'] || deps.svelte));
|
|
206
|
+
|
|
207
|
+
const hasBackend = stackKeys.has('python') || stackKeys.has('django') || stackKeys.has('fastapi') ||
|
|
208
|
+
stackKeys.has('go') || stackKeys.has('rust') || stackKeys.has('java') ||
|
|
209
|
+
ctx.hasDir('api') || ctx.hasDir('routes') || ctx.hasDir('services') || ctx.hasDir('controllers') ||
|
|
210
|
+
ctx.hasDir('workers') || ctx.hasDir('jobs');
|
|
211
|
+
|
|
212
|
+
const hasInfra = stackKeys.has('docker') || stackKeys.has('terraform') || stackKeys.has('kubernetes') ||
|
|
213
|
+
ctx.files.includes('wrangler.toml') || ctx.files.includes('serverless.yml') || ctx.files.includes('serverless.yaml') ||
|
|
214
|
+
ctx.files.includes('cdk.json') || ctx.hasDir('infra') || ctx.hasDir('deploy') || ctx.hasDir('helm');
|
|
215
|
+
|
|
216
|
+
const isMonorepo = ctx.files.includes('nx.json') || ctx.files.includes('turbo.json') ||
|
|
217
|
+
ctx.files.includes('lerna.json') || ctx.files.includes('pnpm-workspace.yaml') ||
|
|
218
|
+
ctx.hasDir('packages') ||
|
|
219
|
+
(pkg.workspaces && (Array.isArray(pkg.workspaces) ? pkg.workspaces.length > 0 : true));
|
|
220
|
+
|
|
221
|
+
const hasCi = ctx.hasDir('.github/workflows');
|
|
222
|
+
const hasPolicyFiles = Boolean(ctx.fileContent('SECURITY.md') || ctx.fileContent('CODEOWNERS')) ||
|
|
223
|
+
ctx.hasDir('compliance') || ctx.hasDir('policies') || ctx.hasDir('audit');
|
|
224
|
+
const hasWindsurfRules = ctx.windsurfRules ? ctx.windsurfRules().length > 0 : ctx.hasDir('.windsurf/rules');
|
|
225
|
+
const isEnterpriseGoverned = (hasCi && hasPolicyFiles) || (hasWindsurfRules && hasPolicyFiles);
|
|
226
|
+
|
|
227
|
+
if (hasBackend) {
|
|
228
|
+
addMatch('backend-api', [
|
|
229
|
+
'Detected backend stack or service-oriented directories for Cascade agents.',
|
|
230
|
+
ctx.hasDir('api') ? 'API-facing structure detected.' : null,
|
|
231
|
+
ctx.hasDir('services') ? 'Service-layer directories detected.' : null,
|
|
232
|
+
]);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (hasFrontend) {
|
|
236
|
+
addMatch('frontend-ui', [
|
|
237
|
+
'Detected UI-heavy frontend stack or component directories.',
|
|
238
|
+
stackKeys.has('nextjs') ? 'Next.js stack detected.' : null,
|
|
239
|
+
ctx.hasDir('components') ? 'Component directories detected.' : null,
|
|
240
|
+
]);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (isEnterpriseGoverned) {
|
|
244
|
+
addMatch('enterprise-governed', [
|
|
245
|
+
'Detected team-governed rollout signals such as CI, policies, or explicit trust posture.',
|
|
246
|
+
hasCi ? 'GitHub workflow automation detected.' : null,
|
|
247
|
+
hasPolicyFiles ? 'Security/compliance policy files detected.' : null,
|
|
248
|
+
]);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (isMonorepo) {
|
|
252
|
+
addMatch('monorepo', [
|
|
253
|
+
'Detected workspace or multi-package repository structure.',
|
|
254
|
+
ctx.files.includes('pnpm-workspace.yaml') ? 'pnpm workspace detected.' : null,
|
|
255
|
+
ctx.hasDir('packages') ? 'Packages directory detected.' : null,
|
|
256
|
+
]);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (hasInfra) {
|
|
260
|
+
addMatch('infra-platform', [
|
|
261
|
+
'Detected infrastructure or deployment-oriented repo signals.',
|
|
262
|
+
ctx.files.includes('wrangler.toml') ? 'Wrangler config detected.' : null,
|
|
263
|
+
ctx.hasDir('infra') ? 'Infrastructure directory detected.' : null,
|
|
264
|
+
]);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const hasDataPipeline = ctx.hasDir('dags') || ctx.hasDir('etl') || ctx.hasDir('pipelines') ||
|
|
268
|
+
ctx.hasDir('marts') || ctx.hasDir('migrations') ||
|
|
269
|
+
deps.airflow || deps.prefect || deps.dagster || deps.dbt;
|
|
270
|
+
if (hasDataPipeline) {
|
|
271
|
+
addMatch('data-pipeline', ['Detected data pipeline or ETL-oriented repo signals.', ctx.hasDir('dags') ? 'DAG directory detected.' : null]);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const isOss = ctx.files.includes('LICENSE') && ctx.files.includes('CONTRIBUTING.md');
|
|
275
|
+
if (isOss && !isEnterpriseGoverned) {
|
|
276
|
+
addMatch('oss-library', ['Detected open-source library signals (LICENSE + CONTRIBUTING.md).']);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const isMobile = stackKeys.has('react-native') || stackKeys.has('flutter') ||
|
|
280
|
+
stackKeys.has('swift') || stackKeys.has('kotlin') ||
|
|
281
|
+
deps['react-native'] || deps.flutter || ctx.files.includes('Podfile') ||
|
|
282
|
+
ctx.files.includes('build.gradle') || ctx.hasDir('ios') || ctx.hasDir('android');
|
|
283
|
+
if (isMobile) {
|
|
284
|
+
addMatch('mobile', ['Detected mobile development signals.', ctx.hasDir('ios') ? 'iOS directory detected.' : null, ctx.hasDir('android') ? 'Android directory detected.' : null]);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const isRegulated = hasPolicyFiles && !isEnterpriseGoverned;
|
|
288
|
+
if (isRegulated) {
|
|
289
|
+
addMatch('regulated-lite', ['Detected compliance-adjacent signals without full enterprise governance.']);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const isEcommerce = deps.stripe || deps['@stripe/stripe-js'] ||
|
|
293
|
+
deps.shopify || deps['@shopify/shopify-api'] ||
|
|
294
|
+
ctx.hasDir('checkout') || ctx.hasDir('cart') || ctx.hasDir('payments');
|
|
295
|
+
if (isEcommerce) {
|
|
296
|
+
addMatch('ecommerce', ['Detected e-commerce or payment-related signals.', deps.stripe ? 'Stripe dependency detected.' : null]);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const isAiMl = deps.tensorflow || deps.torch || deps.pytorch || deps.transformers ||
|
|
300
|
+
deps.langchain || deps['@langchain/core'] || deps.openai || deps.anthropic ||
|
|
301
|
+
ctx.hasDir('models') || ctx.hasDir('training') || ctx.hasDir('rag') ||
|
|
302
|
+
ctx.files.includes('model.py') || ctx.files.includes('train.py');
|
|
303
|
+
if (isAiMl) {
|
|
304
|
+
addMatch('ai-ml', ['Detected AI/ML or model training signals.', ctx.hasDir('models') ? 'Models directory detected.' : null]);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const isDevops = hasCi && hasInfra && !isEnterpriseGoverned;
|
|
308
|
+
if (isDevops) {
|
|
309
|
+
addMatch('devops-cicd', ['Detected DevOps/CI-CD focus with both CI workflows and infrastructure.']);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const isDesignSystem = ctx.hasDir('stories') || ctx.hasDir('storybook') ||
|
|
313
|
+
deps['@storybook/react'] || deps['@storybook/vue3'] ||
|
|
314
|
+
ctx.files.includes('.storybook');
|
|
315
|
+
if (isDesignSystem) {
|
|
316
|
+
addMatch('design-system', ['Detected design system or component library signals.', ctx.hasDir('stories') ? 'Storybook stories detected.' : null]);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const isDocsContent = ctx.hasDir('docs') && !hasBackend && !hasFrontend &&
|
|
320
|
+
(ctx.files.includes('mkdocs.yml') || ctx.files.includes('docusaurus.config.js') ||
|
|
321
|
+
ctx.files.includes('_config.yml') || ctx.files.includes('hugo.toml'));
|
|
322
|
+
if (isDocsContent) {
|
|
323
|
+
addMatch('docs-content', ['Detected documentation or content-focused repo.']);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const isSecurityFocused = ctx.hasDir('security') ||
|
|
327
|
+
deps['helmet'] || deps['csurf'] || deps['bcrypt'] ||
|
|
328
|
+
(hasPolicyFiles && ctx.fileContent('SECURITY.md'));
|
|
329
|
+
if (isSecurityFocused) {
|
|
330
|
+
addMatch('security-focused', ['Detected security-focused repo signals.', ctx.fileContent('SECURITY.md') ? 'SECURITY.md present.' : null]);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (matches.length === 0) {
|
|
334
|
+
addMatch('baseline-general', [
|
|
335
|
+
'No stronger platform-specific domain dominated, so a safe general Windsurf baseline is the best starting point.',
|
|
336
|
+
hasWindsurfRules
|
|
337
|
+
? 'The repo already has Windsurf surfaces, but they are not yet specialized by domain.'
|
|
338
|
+
: 'The repo needs a first Windsurf baseline before specialization.',
|
|
339
|
+
]);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return uniqueByKey(matches);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
module.exports = {
|
|
346
|
+
WINDSURF_DOMAIN_PACKS,
|
|
347
|
+
detectWindsurfDomainPacks,
|
|
348
|
+
};
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windsurf Freshness Operationalization
|
|
3
|
+
*
|
|
4
|
+
* Release gates, recurring probes, propagation checklists,
|
|
5
|
+
* and staleness blocking for Windsurf surfaces.
|
|
6
|
+
*
|
|
7
|
+
* P0 sources from windsurf.com docs, propagation for rule format changes.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { version } = require('../../package.json');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* P0 sources that must be fresh before any Windsurf release claim.
|
|
14
|
+
*/
|
|
15
|
+
const P0_SOURCES = [
|
|
16
|
+
{
|
|
17
|
+
key: 'windsurf-rules-docs',
|
|
18
|
+
label: 'Windsurf Rules Documentation',
|
|
19
|
+
url: 'https://docs.windsurf.com/windsurf/cascade/rules',
|
|
20
|
+
stalenessThresholdDays: 30,
|
|
21
|
+
verifiedAt: null,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: 'windsurf-cascade-docs',
|
|
25
|
+
label: 'Cascade Agent Documentation',
|
|
26
|
+
url: 'https://docs.windsurf.com/windsurf/cascade',
|
|
27
|
+
stalenessThresholdDays: 30,
|
|
28
|
+
verifiedAt: null,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'windsurf-mcp-docs',
|
|
32
|
+
label: 'Windsurf MCP Documentation',
|
|
33
|
+
url: 'https://docs.windsurf.com/windsurf/mcp',
|
|
34
|
+
stalenessThresholdDays: 30,
|
|
35
|
+
verifiedAt: null,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: 'windsurf-memories-docs',
|
|
39
|
+
label: 'Memories Documentation',
|
|
40
|
+
url: 'https://docs.windsurf.com/windsurf/cascade/memories',
|
|
41
|
+
stalenessThresholdDays: 30,
|
|
42
|
+
verifiedAt: null,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'windsurf-workflows-docs',
|
|
46
|
+
label: 'Workflows Documentation',
|
|
47
|
+
url: 'https://docs.windsurf.com/windsurf/cascade/workflows',
|
|
48
|
+
stalenessThresholdDays: 30,
|
|
49
|
+
verifiedAt: null,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'windsurf-steps-docs',
|
|
53
|
+
label: 'Steps Documentation',
|
|
54
|
+
url: 'https://docs.windsurf.com/windsurf/cascade/steps',
|
|
55
|
+
stalenessThresholdDays: 30,
|
|
56
|
+
verifiedAt: null,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'windsurf-cascadeignore-docs',
|
|
60
|
+
label: 'Cascadeignore Documentation',
|
|
61
|
+
url: 'https://docs.windsurf.com/windsurf/cascade/cascadeignore',
|
|
62
|
+
stalenessThresholdDays: 30,
|
|
63
|
+
verifiedAt: null,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: 'windsurf-changelog',
|
|
67
|
+
label: 'Windsurf Changelog',
|
|
68
|
+
url: 'https://windsurf.com/changelog',
|
|
69
|
+
stalenessThresholdDays: 14,
|
|
70
|
+
verifiedAt: null,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: 'windsurf-security',
|
|
74
|
+
label: 'Windsurf Security Documentation',
|
|
75
|
+
url: 'https://docs.windsurf.com/windsurf/security',
|
|
76
|
+
stalenessThresholdDays: 30,
|
|
77
|
+
verifiedAt: null,
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Propagation checklist: when a Windsurf source changes, these must update.
|
|
83
|
+
*/
|
|
84
|
+
const PROPAGATION_CHECKLIST = [
|
|
85
|
+
{
|
|
86
|
+
trigger: 'Rule format change (new frontmatter fields, activation mode change)',
|
|
87
|
+
targets: [
|
|
88
|
+
'src/windsurf/config-parser.js — update VALID_WINDSURF_FIELDS, detectRuleType, parseSimpleYaml',
|
|
89
|
+
'src/windsurf/techniques.js — update rule validation checks (WS-A01..WS-A09)',
|
|
90
|
+
'src/windsurf/context.js — update windsurfRules() parsing and type detection',
|
|
91
|
+
'src/windsurf/setup.js — update rule template generation',
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
trigger: 'Cascade agent behavior change (multi-file, Steps, Skills)',
|
|
96
|
+
targets: [
|
|
97
|
+
'src/windsurf/techniques.js — update Cascade agent checks (WS-D01..WS-D05)',
|
|
98
|
+
'src/windsurf/governance.js — update permission profiles',
|
|
99
|
+
'src/windsurf/deep-review.js — update trust class detection',
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
trigger: 'Memories format or sync behavior change',
|
|
104
|
+
targets: [
|
|
105
|
+
'src/windsurf/techniques.js — update memory checks (WS-H01..WS-H05)',
|
|
106
|
+
'src/windsurf/context.js — update memoryContents() parsing',
|
|
107
|
+
'src/windsurf/governance.js — update team-managed permission profile',
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
trigger: 'MCP configuration format change in .windsurf/mcp.json',
|
|
112
|
+
targets: [
|
|
113
|
+
'src/windsurf/mcp-packs.js — update pack JSON projections and merge logic',
|
|
114
|
+
'src/windsurf/techniques.js — update MCP checks (WS-E01..WS-E05)',
|
|
115
|
+
'src/windsurf/context.js — update mcpConfig() parsing',
|
|
116
|
+
'src/windsurf/config-parser.js — update validateMcpEnvVars',
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
trigger: 'MCP team whitelist format change',
|
|
121
|
+
targets: [
|
|
122
|
+
'src/windsurf/techniques.js — update WS-B02, WS-E05 thresholds',
|
|
123
|
+
'src/windsurf/governance.js — update mcp-team-whitelist caveat',
|
|
124
|
+
'src/windsurf/mcp-packs.js — update recommendation logic',
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
trigger: 'Workflow / slash command format change',
|
|
129
|
+
targets: [
|
|
130
|
+
'src/windsurf/techniques.js — update workflow checks (WS-G01..WS-G05)',
|
|
131
|
+
'src/windsurf/context.js — update workflowFiles() parsing',
|
|
132
|
+
'src/windsurf/governance.js — update workflow-trigger hook',
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
trigger: 'Cascadeignore format or behavior change',
|
|
137
|
+
targets: [
|
|
138
|
+
'src/windsurf/techniques.js — update cascadeignore checks (WS-J01..WS-J02)',
|
|
139
|
+
'src/windsurf/context.js — update cascadeignoreContent() parsing',
|
|
140
|
+
'src/windsurf/patch.js — update patchCascadeignore',
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
trigger: '10K char rule limit change',
|
|
145
|
+
targets: [
|
|
146
|
+
'src/windsurf/techniques.js — update WS-A05, WS-L05',
|
|
147
|
+
'src/windsurf/context.js — update overLimit calculation',
|
|
148
|
+
'src/windsurf/governance.js — update rule-char-limit caveat',
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Release gate: check if all P0 sources are within staleness threshold.
|
|
155
|
+
*/
|
|
156
|
+
function checkReleaseGate(sourceVerifications = {}) {
|
|
157
|
+
const now = new Date();
|
|
158
|
+
const results = P0_SOURCES.map(source => {
|
|
159
|
+
const verifiedAt = sourceVerifications[source.key]
|
|
160
|
+
? new Date(sourceVerifications[source.key])
|
|
161
|
+
: source.verifiedAt ? new Date(source.verifiedAt) : null;
|
|
162
|
+
|
|
163
|
+
if (!verifiedAt) {
|
|
164
|
+
return { ...source, status: 'unverified', daysStale: null };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const daysSince = Math.floor((now - verifiedAt) / (1000 * 60 * 60 * 24));
|
|
168
|
+
const isStale = daysSince > source.stalenessThresholdDays;
|
|
169
|
+
|
|
170
|
+
return { ...source, verifiedAt: verifiedAt.toISOString(), daysStale: daysSince, status: isStale ? 'stale' : 'fresh' };
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
ready: results.every(r => r.status === 'fresh'),
|
|
175
|
+
stale: results.filter(r => r.status === 'stale' || r.status === 'unverified'),
|
|
176
|
+
fresh: results.filter(r => r.status === 'fresh'),
|
|
177
|
+
results,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function formatReleaseGate(gateResult) {
|
|
182
|
+
const lines = [
|
|
183
|
+
`Windsurf Freshness Gate (nerviq v${version})`,
|
|
184
|
+
'═══════════════════════════════════════',
|
|
185
|
+
'',
|
|
186
|
+
`Status: ${gateResult.ready ? 'READY' : 'BLOCKED'}`,
|
|
187
|
+
`Fresh: ${gateResult.fresh.length}/${gateResult.results.length}`,
|
|
188
|
+
'',
|
|
189
|
+
];
|
|
190
|
+
|
|
191
|
+
for (const result of gateResult.results) {
|
|
192
|
+
const icon = result.status === 'fresh' ? '✓' : result.status === 'stale' ? '✗' : '?';
|
|
193
|
+
const age = result.daysStale !== null ? ` (${result.daysStale}d ago)` : ' (unverified)';
|
|
194
|
+
lines.push(` ${icon} ${result.label}${age} — threshold: ${result.stalenessThresholdDays}d`);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (!gateResult.ready) {
|
|
198
|
+
lines.push('', 'Action required: verify stale/unverified sources before claiming release freshness.');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return lines.join('\n');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function getPropagationTargets(triggerKeyword) {
|
|
205
|
+
const keyword = triggerKeyword.toLowerCase();
|
|
206
|
+
return PROPAGATION_CHECKLIST.filter(item => item.trigger.toLowerCase().includes(keyword));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
module.exports = {
|
|
210
|
+
P0_SOURCES,
|
|
211
|
+
PROPAGATION_CHECKLIST,
|
|
212
|
+
checkReleaseGate,
|
|
213
|
+
formatReleaseGate,
|
|
214
|
+
getPropagationTargets,
|
|
215
|
+
};
|