@nerviq/cli 1.18.0 → 1.20.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.
- package/LICENSE +23 -23
- package/README.md +2 -2
- package/bin/cli.js +131 -130
- package/package.json +2 -1
- package/src/activity.js +1039 -1039
- package/src/adoption-advisor.js +299 -299
- package/src/aider/config-parser.js +166 -166
- package/src/aider/context.js +158 -158
- package/src/aider/deep-review.js +316 -316
- package/src/aider/domain-packs.js +303 -303
- package/src/aider/freshness.js +93 -93
- package/src/aider/governance.js +253 -253
- package/src/aider/interactive.js +334 -334
- package/src/aider/mcp-packs.js +329 -329
- package/src/aider/patch.js +214 -214
- package/src/aider/plans.js +186 -186
- package/src/aider/premium.js +360 -360
- package/src/aider/setup.js +404 -404
- package/src/aider/techniques.js +16 -16
- package/src/analyze.js +951 -951
- package/src/anti-patterns.js +485 -485
- package/src/audit/instruction-files.js +180 -180
- package/src/audit/recommendations.js +577 -577
- package/src/auto-suggest.js +154 -154
- package/src/badge.js +13 -13
- package/src/behavioral-drift.js +801 -801
- package/src/benchmark.js +67 -67
- package/src/catalog.js +103 -103
- package/src/certification.js +128 -128
- package/src/codex/config-parser.js +183 -183
- package/src/codex/context.js +223 -223
- package/src/codex/deep-review.js +493 -493
- package/src/codex/domain-packs.js +394 -394
- package/src/codex/freshness.js +84 -84
- package/src/codex/governance.js +192 -192
- package/src/codex/interactive.js +618 -618
- package/src/codex/mcp-packs.js +914 -914
- package/src/codex/patch.js +209 -209
- package/src/codex/plans.js +251 -251
- package/src/codex/premium.js +614 -614
- package/src/codex/setup.js +591 -591
- package/src/context.js +320 -320
- package/src/continuous-ops.js +681 -681
- package/src/copilot/activity.js +309 -309
- package/src/copilot/deep-review.js +346 -346
- package/src/copilot/domain-packs.js +372 -372
- package/src/copilot/freshness.js +57 -57
- package/src/copilot/governance.js +222 -222
- package/src/copilot/interactive.js +406 -406
- package/src/copilot/mcp-packs.js +826 -826
- package/src/copilot/plans.js +253 -253
- package/src/copilot/premium.js +451 -451
- package/src/copilot/setup.js +488 -488
- package/src/cost-tracking.js +61 -61
- package/src/cursor/activity.js +301 -301
- package/src/cursor/config-parser.js +265 -265
- package/src/cursor/context.js +256 -256
- package/src/cursor/deep-review.js +334 -334
- package/src/cursor/domain-packs.js +368 -368
- package/src/cursor/freshness.js +65 -65
- package/src/cursor/governance.js +229 -229
- package/src/cursor/interactive.js +391 -391
- package/src/cursor/mcp-packs.js +828 -828
- package/src/cursor/plans.js +254 -254
- package/src/cursor/premium.js +469 -469
- package/src/cursor/setup.js +488 -488
- package/src/dashboard.js +493 -493
- package/src/deep-review.js +428 -428
- package/src/deprecation.js +98 -98
- package/src/diff-only.js +280 -280
- package/src/doctor.js +119 -119
- package/src/domain-pack-expansion.js +1033 -1033
- package/src/domain-packs.js +387 -387
- package/src/feedback.js +178 -178
- package/src/fix-engine.js +783 -783
- package/src/fix-prompts.js +122 -122
- package/src/formatters/sarif.js +115 -115
- package/src/freshness.js +74 -74
- package/src/gemini/config-parser.js +275 -275
- package/src/gemini/context.js +290 -221
- package/src/gemini/deep-review.js +559 -559
- package/src/gemini/domain-packs.js +393 -393
- package/src/gemini/freshness.js +66 -66
- package/src/gemini/governance.js +201 -201
- package/src/gemini/interactive.js +860 -860
- package/src/gemini/mcp-packs.js +915 -915
- package/src/gemini/plans.js +269 -269
- package/src/gemini/premium.js +760 -760
- package/src/gemini/setup.js +692 -692
- package/src/gemini/techniques.js +105 -33
- package/src/governance.js +72 -72
- package/src/harmony/add.js +68 -68
- package/src/harmony/advisor.js +333 -333
- package/src/harmony/canon.js +565 -565
- package/src/harmony/cli.js +591 -591
- package/src/harmony/drift.js +401 -401
- package/src/harmony/governance.js +313 -313
- package/src/harmony/memory.js +239 -239
- package/src/harmony/sync.js +475 -475
- package/src/harmony/watch.js +370 -370
- package/src/hook-validation.js +342 -342
- package/src/index.js +271 -271
- package/src/init.js +184 -184
- package/src/instruction-surfaces.js +185 -185
- package/src/integrations.js +144 -144
- package/src/interactive.js +118 -118
- package/src/locales/en.json +1 -1
- package/src/locales/es.json +1 -1
- package/src/mcp-packs.js +830 -830
- package/src/mcp-server.js +726 -726
- package/src/mcp-validation.js +337 -337
- package/src/nerviq-sync.json +7 -7
- package/src/opencode/config-parser.js +109 -109
- package/src/opencode/context.js +247 -247
- package/src/opencode/deep-review.js +313 -313
- package/src/opencode/domain-packs.js +262 -262
- package/src/opencode/freshness.js +66 -66
- package/src/opencode/governance.js +159 -159
- package/src/opencode/interactive.js +392 -392
- package/src/opencode/mcp-packs.js +705 -705
- package/src/opencode/patch.js +184 -184
- package/src/opencode/plans.js +231 -231
- package/src/opencode/premium.js +413 -413
- package/src/opencode/setup.js +449 -449
- package/src/opencode/techniques.js +27 -27
- package/src/operating-profile.js +574 -574
- package/src/org.js +152 -152
- package/src/permission-rules.js +218 -218
- package/src/plans.js +839 -839
- package/src/platform-change-manifest.js +86 -86
- package/src/plugins.js +110 -110
- package/src/policy-layers.js +210 -210
- package/src/profiles.js +124 -124
- package/src/prompt-injection.js +74 -74
- package/src/public-api.js +173 -173
- package/src/recommendation-rules.js +84 -84
- package/src/repo-archetype.js +386 -386
- package/src/secret-patterns.js +39 -39
- package/src/server.js +527 -527
- package/src/setup/analysis.js +607 -607
- package/src/setup/runtime.js +172 -172
- package/src/setup.js +677 -677
- package/src/shared/capabilities.js +194 -194
- package/src/source-urls.js +132 -132
- package/src/stack-checks.js +565 -565
- package/src/supplemental-checks.js +13 -13
- package/src/synergy/adaptive.js +261 -261
- package/src/synergy/compensation.js +137 -137
- package/src/synergy/evidence.js +193 -193
- package/src/synergy/learning.js +199 -199
- package/src/synergy/patterns.js +227 -227
- package/src/synergy/ranking.js +83 -83
- package/src/synergy/report.js +165 -165
- package/src/synergy/routing.js +146 -146
- package/src/techniques/api.js +407 -407
- package/src/techniques/automation.js +316 -316
- package/src/techniques/compliance.js +257 -257
- package/src/techniques/hygiene.js +294 -294
- package/src/techniques/instructions.js +243 -243
- package/src/techniques/observability.js +226 -226
- package/src/techniques/optimization.js +142 -142
- package/src/techniques/quality.js +318 -318
- package/src/techniques/security.js +237 -237
- package/src/techniques/shared.js +443 -443
- package/src/techniques/stacks.js +2294 -2294
- package/src/techniques/tools.js +106 -106
- package/src/techniques/workflow.js +413 -413
- package/src/techniques.js +81 -81
- package/src/terminology.js +73 -73
- package/src/token-estimate.js +35 -35
- package/src/usage-patterns.js +99 -99
- package/src/verification-metadata.js +145 -145
- package/src/watch.js +247 -247
- package/src/windsurf/activity.js +302 -302
- package/src/windsurf/config-parser.js +267 -267
- package/src/windsurf/context.js +249 -249
- package/src/windsurf/deep-review.js +337 -337
- package/src/windsurf/domain-packs.js +370 -370
- package/src/windsurf/freshness.js +36 -36
- package/src/windsurf/governance.js +231 -231
- package/src/windsurf/interactive.js +388 -388
- package/src/windsurf/mcp-packs.js +792 -792
- package/src/windsurf/plans.js +247 -247
- package/src/windsurf/premium.js +468 -468
- package/src/windsurf/setup.js +471 -471
- package/src/windsurf/techniques.js +17 -17
- package/src/workspace.js +375 -375
|
@@ -1,370 +1,370 @@
|
|
|
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 { buildAdditionalDomainPacks, detectAdditionalDomainPacks } = require('../domain-pack-expansion');
|
|
14
|
-
|
|
15
|
-
const BASE_WINDSURF_DOMAIN_PACKS = [
|
|
16
|
-
{
|
|
17
|
-
key: 'baseline-general',
|
|
18
|
-
label: 'Baseline General',
|
|
19
|
-
useWhen: 'General repos that need a safe, reviewable baseline before deeper specialization.',
|
|
20
|
-
adoption: 'Safe default when no stronger domain signal dominates the repo.',
|
|
21
|
-
recommendedModules: ['.windsurf/rules/ baseline', '.windsurf/mcp.json baseline', 'Workflows starter'],
|
|
22
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp'],
|
|
23
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
24
|
-
benchmarkFocus: ['starter-safe improvement', 'reviewable trust posture'],
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
key: 'backend-api',
|
|
28
|
-
label: 'Backend API',
|
|
29
|
-
useWhen: 'Service, API, or backend-heavy repos with routes, services, jobs, schemas, or data access.',
|
|
30
|
-
adoption: 'Recommended when Cascade agents need stronger verification and review structure.',
|
|
31
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Backend verification rules', 'CI / review workflow starter'],
|
|
32
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
33
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
|
|
34
|
-
benchmarkFocus: ['test + build verification', 'reviewable API changes', 'safe rollout posture'],
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
key: 'frontend-ui',
|
|
38
|
-
label: 'Frontend UI',
|
|
39
|
-
useWhen: 'React, Next.js, Vue, Angular, or Svelte repos with UI-heavy workflows.',
|
|
40
|
-
adoption: 'Recommended when Cascade agents need better component and build guidance.',
|
|
41
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Frontend review rules', 'Cascade UI guide'],
|
|
42
|
-
recommendedProposalFamilies: ['windsurf-rules'],
|
|
43
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
44
|
-
benchmarkFocus: ['build verification', 'component-safe edits', 'Cascade multi-file awareness'],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
key: 'data-pipeline',
|
|
48
|
-
label: 'Data Pipeline',
|
|
49
|
-
useWhen: 'Repos with workers, DAGs, ETL jobs, migrations, or analytics-heavy workflows.',
|
|
50
|
-
adoption: 'Recommended when Cascade agents need pipeline-safe verification.',
|
|
51
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Pipeline verification rules'],
|
|
52
|
-
recommendedProposalFamilies: ['windsurf-rules'],
|
|
53
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
54
|
-
benchmarkFocus: ['pipeline safety', 'repeatable task flows', 'state-aware review'],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
key: 'infra-platform',
|
|
58
|
-
label: 'Infra Platform',
|
|
59
|
-
useWhen: 'Terraform, Docker, Kubernetes, serverless, or deployment-oriented repos.',
|
|
60
|
-
adoption: 'Recommended when Cascade changes need stronger guardrails and infra-aware verification.',
|
|
61
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Infra review rules', 'Cascadeignore config'],
|
|
62
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
63
|
-
recommendedSurfaces: ['.windsurf/rules/', '.cascadeignore', '.github/workflows/'],
|
|
64
|
-
benchmarkFocus: ['release safety', 'infra verification', 'reviewable operational changes'],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
key: 'oss-library',
|
|
68
|
-
label: 'OSS Library',
|
|
69
|
-
useWhen: 'Public packages or contributor-heavy repos that need lighter governance.',
|
|
70
|
-
adoption: 'Recommended for open-source repos where Cascade should suggest, not auto-apply.',
|
|
71
|
-
recommendedModules: ['.windsurf/rules/ baseline'],
|
|
72
|
-
recommendedProposalFamilies: ['windsurf-rules'],
|
|
73
|
-
recommendedSurfaces: ['.windsurf/rules/'],
|
|
74
|
-
benchmarkFocus: ['low-footprint adoption', 'contributor-safe defaults', 'manual review friendliness'],
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
key: 'enterprise-governed',
|
|
78
|
-
label: 'Enterprise Governed',
|
|
79
|
-
useWhen: 'Repos with CI, policy files, security posture, or auditable team workflows.',
|
|
80
|
-
adoption: 'Recommended for teams that need explicit approvals, review expectations, and governance.',
|
|
81
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Governance rollout kit', 'Enterprise policy rules', 'Team memories'],
|
|
82
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise', 'windsurf-ci-review'],
|
|
83
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/memories/', '.github/workflows/'],
|
|
84
|
-
benchmarkFocus: ['policy-aware rollout', 'approval posture', 'repeatable governance evidence'],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
key: 'monorepo',
|
|
88
|
-
label: 'Monorepo',
|
|
89
|
-
useWhen: 'Workspace-based repos with multiple packages sharing a root.',
|
|
90
|
-
adoption: 'Recommended when glob-scoped Auto rules and workspace boundaries matter.',
|
|
91
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Auto rules per package', 'Workflows'],
|
|
92
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp'],
|
|
93
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.windsurf/workflows/'],
|
|
94
|
-
benchmarkFocus: ['workspace-safe edits', 'package-scoped rules', 'cross-package drift control'],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
key: 'mobile',
|
|
98
|
-
label: 'Mobile',
|
|
99
|
-
useWhen: 'React Native, Flutter, Swift, or Kotlin repos with mobile-specific workflows.',
|
|
100
|
-
adoption: 'Recommended when Cascade needs mobile build awareness and platform-specific verification.',
|
|
101
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Mobile verification rules'],
|
|
102
|
-
recommendedProposalFamilies: ['windsurf-rules'],
|
|
103
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
104
|
-
benchmarkFocus: ['mobile build safety', 'platform-specific verification', 'reviewable native changes'],
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
key: 'regulated-lite',
|
|
108
|
-
label: 'Regulated Lite',
|
|
109
|
-
useWhen: 'Repos with basic compliance needs — activity artifacts, rollback manifests, and audit trail.',
|
|
110
|
-
adoption: 'Recommended for regulated-adjacent repos that need governance without full enterprise overhead.',
|
|
111
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Cascadeignore for sensitive files'],
|
|
112
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise'],
|
|
113
|
-
recommendedSurfaces: ['.windsurf/rules/'],
|
|
114
|
-
benchmarkFocus: ['compliance posture', 'cascadeignore coverage', 'rollback readiness'],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
key: 'ecommerce',
|
|
118
|
-
label: 'E-commerce',
|
|
119
|
-
useWhen: 'Shopify, Stripe, or payment-heavy repos with transaction safety needs.',
|
|
120
|
-
adoption: 'Recommended when Cascade changes touch payment flows, cart logic, or sensitive data.',
|
|
121
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Security review rules'],
|
|
122
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
123
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
|
|
124
|
-
benchmarkFocus: ['transaction safety', 'payment flow review', 'PII-safe changes'],
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
key: 'ai-ml',
|
|
128
|
-
label: 'AI / ML',
|
|
129
|
-
useWhen: 'Repos with ML pipelines, model training, RAG, or LLM integration workflows.',
|
|
130
|
-
adoption: 'Recommended when Cascade needs model-aware verification and experiment tracking.',
|
|
131
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'ML verification rules'],
|
|
132
|
-
recommendedProposalFamilies: ['windsurf-rules'],
|
|
133
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
134
|
-
benchmarkFocus: ['model safety', 'experiment reproducibility', 'data pipeline review'],
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
key: 'devops-cicd',
|
|
138
|
-
label: 'DevOps / CI-CD',
|
|
139
|
-
useWhen: 'Repos focused on CI/CD pipelines, deployment automation, and infrastructure-as-code.',
|
|
140
|
-
adoption: 'Recommended when Cascade manages CI workflows, deployment scripts, or release processes.',
|
|
141
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Workflow automation rules'],
|
|
142
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
143
|
-
recommendedSurfaces: ['.windsurf/rules/', '.github/workflows/'],
|
|
144
|
-
benchmarkFocus: ['deployment safety', 'CI pipeline review', 'workflow trigger safety'],
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
key: 'design-system',
|
|
148
|
-
label: 'Design System',
|
|
149
|
-
useWhen: 'Component libraries, Storybook repos, or design token systems.',
|
|
150
|
-
adoption: 'Recommended when Cascade edits shared UI components with downstream consumers.',
|
|
151
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Component review rules'],
|
|
152
|
-
recommendedProposalFamilies: ['windsurf-rules'],
|
|
153
|
-
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
154
|
-
benchmarkFocus: ['component safety', 'visual regression awareness', 'Cascade multi-file tracking'],
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
key: 'docs-content',
|
|
158
|
-
label: 'Docs / Content',
|
|
159
|
-
useWhen: 'Documentation repos, blogs, or content-heavy sites with editorial workflows.',
|
|
160
|
-
adoption: 'Recommended when Cascade edits prose, docs, or content with editorial review needs.',
|
|
161
|
-
recommendedModules: ['.windsurf/rules/ baseline'],
|
|
162
|
-
recommendedProposalFamilies: ['windsurf-rules'],
|
|
163
|
-
recommendedSurfaces: ['.windsurf/rules/'],
|
|
164
|
-
benchmarkFocus: ['content quality', 'editorial review', 'link and reference integrity'],
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
key: 'security-focused',
|
|
168
|
-
label: 'Security Focused',
|
|
169
|
-
useWhen: 'Repos with strong security posture needs — secret management, auth, encryption.',
|
|
170
|
-
adoption: 'Recommended for security-critical repos where every Cascade change needs security review.',
|
|
171
|
-
recommendedModules: ['.windsurf/rules/ baseline', 'Security review rules', 'Cascadeignore for secrets'],
|
|
172
|
-
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise'],
|
|
173
|
-
recommendedSurfaces: ['.windsurf/rules/', '.cascadeignore'],
|
|
174
|
-
benchmarkFocus: ['secret protection', 'cascadeignore enforcement', 'security review coverage'],
|
|
175
|
-
},
|
|
176
|
-
];
|
|
177
|
-
|
|
178
|
-
const WINDSURF_DOMAIN_PACKS = [
|
|
179
|
-
...BASE_WINDSURF_DOMAIN_PACKS,
|
|
180
|
-
...buildAdditionalDomainPacks('windsurf', {
|
|
181
|
-
existingKeys: new Set(BASE_WINDSURF_DOMAIN_PACKS.map((pack) => pack.key)),
|
|
182
|
-
}),
|
|
183
|
-
];
|
|
184
|
-
|
|
185
|
-
function uniqueByKey(items) {
|
|
186
|
-
const seen = new Set();
|
|
187
|
-
const result = [];
|
|
188
|
-
for (const item of items) {
|
|
189
|
-
if (seen.has(item.key)) continue;
|
|
190
|
-
seen.add(item.key);
|
|
191
|
-
result.push(item);
|
|
192
|
-
}
|
|
193
|
-
return result;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function detectWindsurfDomainPacks(ctx, stacks = [], assets = {}) {
|
|
197
|
-
const stackKeys = new Set((stacks || []).map((stack) => stack.key));
|
|
198
|
-
const pkg = ctx.jsonFile ? (ctx.jsonFile('package.json') || {}) : {};
|
|
199
|
-
const deps = ctx.projectDependencies ? ctx.projectDependencies() : {
|
|
200
|
-
...(pkg.dependencies || {}),
|
|
201
|
-
...(pkg.devDependencies || {}),
|
|
202
|
-
};
|
|
203
|
-
const matches = [];
|
|
204
|
-
|
|
205
|
-
function addMatch(key, reasons) {
|
|
206
|
-
const pack = WINDSURF_DOMAIN_PACKS.find((item) => item.key === key);
|
|
207
|
-
if (!pack) return;
|
|
208
|
-
matches.push({ ...pack, matchReasons: reasons.filter(Boolean).slice(0, 3) });
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const hasFrontend = stackKeys.has('react') || stackKeys.has('nextjs') || stackKeys.has('vue') ||
|
|
212
|
-
stackKeys.has('angular') || stackKeys.has('svelte') ||
|
|
213
|
-
ctx.hasDir('components') || ctx.hasDir('pages') ||
|
|
214
|
-
(ctx.hasDir('app') && (deps.next || deps.react || deps.vue || deps['@angular/core'] || deps.svelte));
|
|
215
|
-
|
|
216
|
-
const hasBackend = stackKeys.has('python') || stackKeys.has('django') || stackKeys.has('fastapi') ||
|
|
217
|
-
stackKeys.has('go') || stackKeys.has('rust') || stackKeys.has('java') ||
|
|
218
|
-
ctx.hasDir('api') || ctx.hasDir('routes') || ctx.hasDir('services') || ctx.hasDir('controllers') ||
|
|
219
|
-
ctx.hasDir('workers') || ctx.hasDir('jobs');
|
|
220
|
-
|
|
221
|
-
const hasInfra = stackKeys.has('docker') || stackKeys.has('terraform') || stackKeys.has('kubernetes') ||
|
|
222
|
-
ctx.files.includes('wrangler.toml') || ctx.files.includes('serverless.yml') || ctx.files.includes('serverless.yaml') ||
|
|
223
|
-
ctx.files.includes('cdk.json') || ctx.hasDir('infra') || ctx.hasDir('deploy') || ctx.hasDir('helm');
|
|
224
|
-
|
|
225
|
-
const isMonorepo = ctx.files.includes('nx.json') || ctx.files.includes('turbo.json') ||
|
|
226
|
-
ctx.files.includes('lerna.json') || ctx.files.includes('pnpm-workspace.yaml') ||
|
|
227
|
-
ctx.hasDir('packages') ||
|
|
228
|
-
(pkg.workspaces && (Array.isArray(pkg.workspaces) ? pkg.workspaces.length > 0 : true));
|
|
229
|
-
|
|
230
|
-
const hasCi = ctx.hasDir('.github/workflows');
|
|
231
|
-
const hasPolicyFiles = Boolean(ctx.fileContent('SECURITY.md') || ctx.fileContent('CODEOWNERS')) ||
|
|
232
|
-
ctx.hasDir('compliance') || ctx.hasDir('policies') || ctx.hasDir('audit');
|
|
233
|
-
const hasWindsurfRules = ctx.windsurfRules ? ctx.windsurfRules().length > 0 : ctx.hasDir('.windsurf/rules');
|
|
234
|
-
const isEnterpriseGoverned = (hasCi && hasPolicyFiles) || (hasWindsurfRules && hasPolicyFiles);
|
|
235
|
-
|
|
236
|
-
if (hasBackend) {
|
|
237
|
-
addMatch('backend-api', [
|
|
238
|
-
'Detected backend stack or service-oriented directories for Cascade agents.',
|
|
239
|
-
ctx.hasDir('api') ? 'API-facing structure detected.' : null,
|
|
240
|
-
ctx.hasDir('services') ? 'Service-layer directories detected.' : null,
|
|
241
|
-
]);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if (hasFrontend) {
|
|
245
|
-
addMatch('frontend-ui', [
|
|
246
|
-
'Detected UI-heavy frontend stack or component directories.',
|
|
247
|
-
stackKeys.has('nextjs') ? 'Next.js stack detected.' : null,
|
|
248
|
-
ctx.hasDir('components') ? 'Component directories detected.' : null,
|
|
249
|
-
]);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (isEnterpriseGoverned) {
|
|
253
|
-
addMatch('enterprise-governed', [
|
|
254
|
-
'Detected team-governed rollout signals such as CI, policies, or explicit trust posture.',
|
|
255
|
-
hasCi ? 'GitHub workflow automation detected.' : null,
|
|
256
|
-
hasPolicyFiles ? 'Security/compliance policy files detected.' : null,
|
|
257
|
-
]);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (isMonorepo) {
|
|
261
|
-
addMatch('monorepo', [
|
|
262
|
-
'Detected workspace or multi-package repository structure.',
|
|
263
|
-
ctx.files.includes('pnpm-workspace.yaml') ? 'pnpm workspace detected.' : null,
|
|
264
|
-
ctx.hasDir('packages') ? 'Packages directory detected.' : null,
|
|
265
|
-
]);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (hasInfra) {
|
|
269
|
-
addMatch('infra-platform', [
|
|
270
|
-
'Detected infrastructure or deployment-oriented repo signals.',
|
|
271
|
-
ctx.files.includes('wrangler.toml') ? 'Wrangler config detected.' : null,
|
|
272
|
-
ctx.hasDir('infra') ? 'Infrastructure directory detected.' : null,
|
|
273
|
-
]);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
const hasDataPipeline = ctx.hasDir('dags') || ctx.hasDir('etl') || ctx.hasDir('pipelines') ||
|
|
277
|
-
ctx.hasDir('marts') || ctx.hasDir('migrations') ||
|
|
278
|
-
deps.airflow || deps.prefect || deps.dagster || deps.dbt;
|
|
279
|
-
if (hasDataPipeline) {
|
|
280
|
-
addMatch('data-pipeline', ['Detected data pipeline or ETL-oriented repo signals.', ctx.hasDir('dags') ? 'DAG directory detected.' : null]);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const isOss = ctx.files.includes('LICENSE') && ctx.files.includes('CONTRIBUTING.md');
|
|
284
|
-
if (isOss && !isEnterpriseGoverned) {
|
|
285
|
-
addMatch('oss-library', ['Detected open-source library signals (LICENSE + CONTRIBUTING.md).']);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const isMobile = stackKeys.has('react-native') || stackKeys.has('flutter') ||
|
|
289
|
-
stackKeys.has('swift') || stackKeys.has('kotlin') ||
|
|
290
|
-
deps['react-native'] || deps.flutter || ctx.files.includes('Podfile') ||
|
|
291
|
-
ctx.files.includes('build.gradle') || ctx.hasDir('ios') || ctx.hasDir('android');
|
|
292
|
-
if (isMobile) {
|
|
293
|
-
addMatch('mobile', ['Detected mobile development signals.', ctx.hasDir('ios') ? 'iOS directory detected.' : null, ctx.hasDir('android') ? 'Android directory detected.' : null]);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const isRegulated = hasPolicyFiles && !isEnterpriseGoverned;
|
|
297
|
-
if (isRegulated) {
|
|
298
|
-
addMatch('regulated-lite', ['Detected compliance-adjacent signals without full enterprise governance.']);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
const isEcommerce = deps.stripe || deps['@stripe/stripe-js'] ||
|
|
302
|
-
deps.shopify || deps['@shopify/shopify-api'] ||
|
|
303
|
-
ctx.hasDir('checkout') || ctx.hasDir('cart') || ctx.hasDir('payments');
|
|
304
|
-
if (isEcommerce) {
|
|
305
|
-
addMatch('ecommerce', ['Detected e-commerce or payment-related signals.', deps.stripe ? 'Stripe dependency detected.' : null]);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
const isAiMl = deps.tensorflow || deps.torch || deps.pytorch || deps.transformers ||
|
|
309
|
-
deps.langchain || deps['@langchain/core'] || deps.openai || deps.anthropic ||
|
|
310
|
-
ctx.hasDir('models') || ctx.hasDir('training') || ctx.hasDir('rag') ||
|
|
311
|
-
ctx.files.includes('model.py') || ctx.files.includes('train.py');
|
|
312
|
-
if (isAiMl) {
|
|
313
|
-
addMatch('ai-ml', ['Detected AI/ML or model training signals.', ctx.hasDir('models') ? 'Models directory detected.' : null]);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
const isDevops = hasCi && hasInfra && !isEnterpriseGoverned;
|
|
317
|
-
if (isDevops) {
|
|
318
|
-
addMatch('devops-cicd', ['Detected DevOps/CI-CD focus with both CI workflows and infrastructure.']);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
const isDesignSystem = ctx.hasDir('stories') || ctx.hasDir('storybook') ||
|
|
322
|
-
deps['@storybook/react'] || deps['@storybook/vue3'] ||
|
|
323
|
-
ctx.files.includes('.storybook');
|
|
324
|
-
if (isDesignSystem) {
|
|
325
|
-
addMatch('design-system', ['Detected design system or component library signals.', ctx.hasDir('stories') ? 'Storybook stories detected.' : null]);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
const isDocsContent = ctx.hasDir('docs') && !hasBackend && !hasFrontend &&
|
|
329
|
-
(ctx.files.includes('mkdocs.yml') || ctx.files.includes('docusaurus.config.js') ||
|
|
330
|
-
ctx.files.includes('_config.yml') || ctx.files.includes('hugo.toml'));
|
|
331
|
-
if (isDocsContent) {
|
|
332
|
-
addMatch('docs-content', ['Detected documentation or content-focused repo.']);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
const isSecurityFocused = ctx.hasDir('security') ||
|
|
336
|
-
deps['helmet'] || deps['csurf'] || deps['bcrypt'] ||
|
|
337
|
-
(hasPolicyFiles && ctx.fileContent('SECURITY.md'));
|
|
338
|
-
if (isSecurityFocused) {
|
|
339
|
-
addMatch('security-focused', ['Detected security-focused repo signals.', ctx.fileContent('SECURITY.md') ? 'SECURITY.md present.' : null]);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
detectAdditionalDomainPacks({
|
|
343
|
-
ctx,
|
|
344
|
-
pkg,
|
|
345
|
-
deps,
|
|
346
|
-
stackKeys,
|
|
347
|
-
addMatch,
|
|
348
|
-
hasBackend,
|
|
349
|
-
hasFrontend,
|
|
350
|
-
hasInfra,
|
|
351
|
-
hasCi,
|
|
352
|
-
isEnterpriseGoverned,
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
if (matches.length === 0) {
|
|
356
|
-
addMatch('baseline-general', [
|
|
357
|
-
'No stronger platform-specific domain dominated, so a safe general Windsurf baseline is the best starting point.',
|
|
358
|
-
hasWindsurfRules
|
|
359
|
-
? 'The repo already has Windsurf surfaces, but they are not yet specialized by domain.'
|
|
360
|
-
: 'The repo needs a first Windsurf baseline before specialization.',
|
|
361
|
-
]);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
return uniqueByKey(matches);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
module.exports = {
|
|
368
|
-
WINDSURF_DOMAIN_PACKS,
|
|
369
|
-
detectWindsurfDomainPacks,
|
|
370
|
-
};
|
|
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 { buildAdditionalDomainPacks, detectAdditionalDomainPacks } = require('../domain-pack-expansion');
|
|
14
|
+
|
|
15
|
+
const BASE_WINDSURF_DOMAIN_PACKS = [
|
|
16
|
+
{
|
|
17
|
+
key: 'baseline-general',
|
|
18
|
+
label: 'Baseline General',
|
|
19
|
+
useWhen: 'General repos that need a safe, reviewable baseline before deeper specialization.',
|
|
20
|
+
adoption: 'Safe default when no stronger domain signal dominates the repo.',
|
|
21
|
+
recommendedModules: ['.windsurf/rules/ baseline', '.windsurf/mcp.json baseline', 'Workflows starter'],
|
|
22
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp'],
|
|
23
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
24
|
+
benchmarkFocus: ['starter-safe improvement', 'reviewable trust posture'],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'backend-api',
|
|
28
|
+
label: 'Backend API',
|
|
29
|
+
useWhen: 'Service, API, or backend-heavy repos with routes, services, jobs, schemas, or data access.',
|
|
30
|
+
adoption: 'Recommended when Cascade agents need stronger verification and review structure.',
|
|
31
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Backend verification rules', 'CI / review workflow starter'],
|
|
32
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
33
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
|
|
34
|
+
benchmarkFocus: ['test + build verification', 'reviewable API changes', 'safe rollout posture'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'frontend-ui',
|
|
38
|
+
label: 'Frontend UI',
|
|
39
|
+
useWhen: 'React, Next.js, Vue, Angular, or Svelte repos with UI-heavy workflows.',
|
|
40
|
+
adoption: 'Recommended when Cascade agents need better component and build guidance.',
|
|
41
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Frontend review rules', 'Cascade UI guide'],
|
|
42
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
43
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
44
|
+
benchmarkFocus: ['build verification', 'component-safe edits', 'Cascade multi-file awareness'],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: 'data-pipeline',
|
|
48
|
+
label: 'Data Pipeline',
|
|
49
|
+
useWhen: 'Repos with workers, DAGs, ETL jobs, migrations, or analytics-heavy workflows.',
|
|
50
|
+
adoption: 'Recommended when Cascade agents need pipeline-safe verification.',
|
|
51
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Pipeline verification rules'],
|
|
52
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
53
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
54
|
+
benchmarkFocus: ['pipeline safety', 'repeatable task flows', 'state-aware review'],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'infra-platform',
|
|
58
|
+
label: 'Infra Platform',
|
|
59
|
+
useWhen: 'Terraform, Docker, Kubernetes, serverless, or deployment-oriented repos.',
|
|
60
|
+
adoption: 'Recommended when Cascade changes need stronger guardrails and infra-aware verification.',
|
|
61
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Infra review rules', 'Cascadeignore config'],
|
|
62
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
63
|
+
recommendedSurfaces: ['.windsurf/rules/', '.cascadeignore', '.github/workflows/'],
|
|
64
|
+
benchmarkFocus: ['release safety', 'infra verification', 'reviewable operational changes'],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'oss-library',
|
|
68
|
+
label: 'OSS Library',
|
|
69
|
+
useWhen: 'Public packages or contributor-heavy repos that need lighter governance.',
|
|
70
|
+
adoption: 'Recommended for open-source repos where Cascade should suggest, not auto-apply.',
|
|
71
|
+
recommendedModules: ['.windsurf/rules/ baseline'],
|
|
72
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
73
|
+
recommendedSurfaces: ['.windsurf/rules/'],
|
|
74
|
+
benchmarkFocus: ['low-footprint adoption', 'contributor-safe defaults', 'manual review friendliness'],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'enterprise-governed',
|
|
78
|
+
label: 'Enterprise Governed',
|
|
79
|
+
useWhen: 'Repos with CI, policy files, security posture, or auditable team workflows.',
|
|
80
|
+
adoption: 'Recommended for teams that need explicit approvals, review expectations, and governance.',
|
|
81
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Governance rollout kit', 'Enterprise policy rules', 'Team memories'],
|
|
82
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise', 'windsurf-ci-review'],
|
|
83
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/memories/', '.github/workflows/'],
|
|
84
|
+
benchmarkFocus: ['policy-aware rollout', 'approval posture', 'repeatable governance evidence'],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: 'monorepo',
|
|
88
|
+
label: 'Monorepo',
|
|
89
|
+
useWhen: 'Workspace-based repos with multiple packages sharing a root.',
|
|
90
|
+
adoption: 'Recommended when glob-scoped Auto rules and workspace boundaries matter.',
|
|
91
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Auto rules per package', 'Workflows'],
|
|
92
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-mcp'],
|
|
93
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.windsurf/workflows/'],
|
|
94
|
+
benchmarkFocus: ['workspace-safe edits', 'package-scoped rules', 'cross-package drift control'],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
key: 'mobile',
|
|
98
|
+
label: 'Mobile',
|
|
99
|
+
useWhen: 'React Native, Flutter, Swift, or Kotlin repos with mobile-specific workflows.',
|
|
100
|
+
adoption: 'Recommended when Cascade needs mobile build awareness and platform-specific verification.',
|
|
101
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Mobile verification rules'],
|
|
102
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
103
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
104
|
+
benchmarkFocus: ['mobile build safety', 'platform-specific verification', 'reviewable native changes'],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: 'regulated-lite',
|
|
108
|
+
label: 'Regulated Lite',
|
|
109
|
+
useWhen: 'Repos with basic compliance needs — activity artifacts, rollback manifests, and audit trail.',
|
|
110
|
+
adoption: 'Recommended for regulated-adjacent repos that need governance without full enterprise overhead.',
|
|
111
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Cascadeignore for sensitive files'],
|
|
112
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise'],
|
|
113
|
+
recommendedSurfaces: ['.windsurf/rules/'],
|
|
114
|
+
benchmarkFocus: ['compliance posture', 'cascadeignore coverage', 'rollback readiness'],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: 'ecommerce',
|
|
118
|
+
label: 'E-commerce',
|
|
119
|
+
useWhen: 'Shopify, Stripe, or payment-heavy repos with transaction safety needs.',
|
|
120
|
+
adoption: 'Recommended when Cascade changes touch payment flows, cart logic, or sensitive data.',
|
|
121
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Security review rules'],
|
|
122
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
123
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json', '.github/workflows/'],
|
|
124
|
+
benchmarkFocus: ['transaction safety', 'payment flow review', 'PII-safe changes'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
key: 'ai-ml',
|
|
128
|
+
label: 'AI / ML',
|
|
129
|
+
useWhen: 'Repos with ML pipelines, model training, RAG, or LLM integration workflows.',
|
|
130
|
+
adoption: 'Recommended when Cascade needs model-aware verification and experiment tracking.',
|
|
131
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'ML verification rules'],
|
|
132
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
133
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
134
|
+
benchmarkFocus: ['model safety', 'experiment reproducibility', 'data pipeline review'],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: 'devops-cicd',
|
|
138
|
+
label: 'DevOps / CI-CD',
|
|
139
|
+
useWhen: 'Repos focused on CI/CD pipelines, deployment automation, and infrastructure-as-code.',
|
|
140
|
+
adoption: 'Recommended when Cascade manages CI workflows, deployment scripts, or release processes.',
|
|
141
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Workflow automation rules'],
|
|
142
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-ci-review'],
|
|
143
|
+
recommendedSurfaces: ['.windsurf/rules/', '.github/workflows/'],
|
|
144
|
+
benchmarkFocus: ['deployment safety', 'CI pipeline review', 'workflow trigger safety'],
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: 'design-system',
|
|
148
|
+
label: 'Design System',
|
|
149
|
+
useWhen: 'Component libraries, Storybook repos, or design token systems.',
|
|
150
|
+
adoption: 'Recommended when Cascade edits shared UI components with downstream consumers.',
|
|
151
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Component review rules'],
|
|
152
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
153
|
+
recommendedSurfaces: ['.windsurf/rules/', '.windsurf/mcp.json'],
|
|
154
|
+
benchmarkFocus: ['component safety', 'visual regression awareness', 'Cascade multi-file tracking'],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: 'docs-content',
|
|
158
|
+
label: 'Docs / Content',
|
|
159
|
+
useWhen: 'Documentation repos, blogs, or content-heavy sites with editorial workflows.',
|
|
160
|
+
adoption: 'Recommended when Cascade edits prose, docs, or content with editorial review needs.',
|
|
161
|
+
recommendedModules: ['.windsurf/rules/ baseline'],
|
|
162
|
+
recommendedProposalFamilies: ['windsurf-rules'],
|
|
163
|
+
recommendedSurfaces: ['.windsurf/rules/'],
|
|
164
|
+
benchmarkFocus: ['content quality', 'editorial review', 'link and reference integrity'],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
key: 'security-focused',
|
|
168
|
+
label: 'Security Focused',
|
|
169
|
+
useWhen: 'Repos with strong security posture needs — secret management, auth, encryption.',
|
|
170
|
+
adoption: 'Recommended for security-critical repos where every Cascade change needs security review.',
|
|
171
|
+
recommendedModules: ['.windsurf/rules/ baseline', 'Security review rules', 'Cascadeignore for secrets'],
|
|
172
|
+
recommendedProposalFamilies: ['windsurf-rules', 'windsurf-enterprise'],
|
|
173
|
+
recommendedSurfaces: ['.windsurf/rules/', '.cascadeignore'],
|
|
174
|
+
benchmarkFocus: ['secret protection', 'cascadeignore enforcement', 'security review coverage'],
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
|
|
178
|
+
const WINDSURF_DOMAIN_PACKS = [
|
|
179
|
+
...BASE_WINDSURF_DOMAIN_PACKS,
|
|
180
|
+
...buildAdditionalDomainPacks('windsurf', {
|
|
181
|
+
existingKeys: new Set(BASE_WINDSURF_DOMAIN_PACKS.map((pack) => pack.key)),
|
|
182
|
+
}),
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
function uniqueByKey(items) {
|
|
186
|
+
const seen = new Set();
|
|
187
|
+
const result = [];
|
|
188
|
+
for (const item of items) {
|
|
189
|
+
if (seen.has(item.key)) continue;
|
|
190
|
+
seen.add(item.key);
|
|
191
|
+
result.push(item);
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function detectWindsurfDomainPacks(ctx, stacks = [], assets = {}) {
|
|
197
|
+
const stackKeys = new Set((stacks || []).map((stack) => stack.key));
|
|
198
|
+
const pkg = ctx.jsonFile ? (ctx.jsonFile('package.json') || {}) : {};
|
|
199
|
+
const deps = ctx.projectDependencies ? ctx.projectDependencies() : {
|
|
200
|
+
...(pkg.dependencies || {}),
|
|
201
|
+
...(pkg.devDependencies || {}),
|
|
202
|
+
};
|
|
203
|
+
const matches = [];
|
|
204
|
+
|
|
205
|
+
function addMatch(key, reasons) {
|
|
206
|
+
const pack = WINDSURF_DOMAIN_PACKS.find((item) => item.key === key);
|
|
207
|
+
if (!pack) return;
|
|
208
|
+
matches.push({ ...pack, matchReasons: reasons.filter(Boolean).slice(0, 3) });
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const hasFrontend = stackKeys.has('react') || stackKeys.has('nextjs') || stackKeys.has('vue') ||
|
|
212
|
+
stackKeys.has('angular') || stackKeys.has('svelte') ||
|
|
213
|
+
ctx.hasDir('components') || ctx.hasDir('pages') ||
|
|
214
|
+
(ctx.hasDir('app') && (deps.next || deps.react || deps.vue || deps['@angular/core'] || deps.svelte));
|
|
215
|
+
|
|
216
|
+
const hasBackend = stackKeys.has('python') || stackKeys.has('django') || stackKeys.has('fastapi') ||
|
|
217
|
+
stackKeys.has('go') || stackKeys.has('rust') || stackKeys.has('java') ||
|
|
218
|
+
ctx.hasDir('api') || ctx.hasDir('routes') || ctx.hasDir('services') || ctx.hasDir('controllers') ||
|
|
219
|
+
ctx.hasDir('workers') || ctx.hasDir('jobs');
|
|
220
|
+
|
|
221
|
+
const hasInfra = stackKeys.has('docker') || stackKeys.has('terraform') || stackKeys.has('kubernetes') ||
|
|
222
|
+
ctx.files.includes('wrangler.toml') || ctx.files.includes('serverless.yml') || ctx.files.includes('serverless.yaml') ||
|
|
223
|
+
ctx.files.includes('cdk.json') || ctx.hasDir('infra') || ctx.hasDir('deploy') || ctx.hasDir('helm');
|
|
224
|
+
|
|
225
|
+
const isMonorepo = ctx.files.includes('nx.json') || ctx.files.includes('turbo.json') ||
|
|
226
|
+
ctx.files.includes('lerna.json') || ctx.files.includes('pnpm-workspace.yaml') ||
|
|
227
|
+
ctx.hasDir('packages') ||
|
|
228
|
+
(pkg.workspaces && (Array.isArray(pkg.workspaces) ? pkg.workspaces.length > 0 : true));
|
|
229
|
+
|
|
230
|
+
const hasCi = ctx.hasDir('.github/workflows');
|
|
231
|
+
const hasPolicyFiles = Boolean(ctx.fileContent('SECURITY.md') || ctx.fileContent('CODEOWNERS')) ||
|
|
232
|
+
ctx.hasDir('compliance') || ctx.hasDir('policies') || ctx.hasDir('audit');
|
|
233
|
+
const hasWindsurfRules = ctx.windsurfRules ? ctx.windsurfRules().length > 0 : ctx.hasDir('.windsurf/rules');
|
|
234
|
+
const isEnterpriseGoverned = (hasCi && hasPolicyFiles) || (hasWindsurfRules && hasPolicyFiles);
|
|
235
|
+
|
|
236
|
+
if (hasBackend) {
|
|
237
|
+
addMatch('backend-api', [
|
|
238
|
+
'Detected backend stack or service-oriented directories for Cascade agents.',
|
|
239
|
+
ctx.hasDir('api') ? 'API-facing structure detected.' : null,
|
|
240
|
+
ctx.hasDir('services') ? 'Service-layer directories detected.' : null,
|
|
241
|
+
]);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (hasFrontend) {
|
|
245
|
+
addMatch('frontend-ui', [
|
|
246
|
+
'Detected UI-heavy frontend stack or component directories.',
|
|
247
|
+
stackKeys.has('nextjs') ? 'Next.js stack detected.' : null,
|
|
248
|
+
ctx.hasDir('components') ? 'Component directories detected.' : null,
|
|
249
|
+
]);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (isEnterpriseGoverned) {
|
|
253
|
+
addMatch('enterprise-governed', [
|
|
254
|
+
'Detected team-governed rollout signals such as CI, policies, or explicit trust posture.',
|
|
255
|
+
hasCi ? 'GitHub workflow automation detected.' : null,
|
|
256
|
+
hasPolicyFiles ? 'Security/compliance policy files detected.' : null,
|
|
257
|
+
]);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (isMonorepo) {
|
|
261
|
+
addMatch('monorepo', [
|
|
262
|
+
'Detected workspace or multi-package repository structure.',
|
|
263
|
+
ctx.files.includes('pnpm-workspace.yaml') ? 'pnpm workspace detected.' : null,
|
|
264
|
+
ctx.hasDir('packages') ? 'Packages directory detected.' : null,
|
|
265
|
+
]);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (hasInfra) {
|
|
269
|
+
addMatch('infra-platform', [
|
|
270
|
+
'Detected infrastructure or deployment-oriented repo signals.',
|
|
271
|
+
ctx.files.includes('wrangler.toml') ? 'Wrangler config detected.' : null,
|
|
272
|
+
ctx.hasDir('infra') ? 'Infrastructure directory detected.' : null,
|
|
273
|
+
]);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const hasDataPipeline = ctx.hasDir('dags') || ctx.hasDir('etl') || ctx.hasDir('pipelines') ||
|
|
277
|
+
ctx.hasDir('marts') || ctx.hasDir('migrations') ||
|
|
278
|
+
deps.airflow || deps.prefect || deps.dagster || deps.dbt;
|
|
279
|
+
if (hasDataPipeline) {
|
|
280
|
+
addMatch('data-pipeline', ['Detected data pipeline or ETL-oriented repo signals.', ctx.hasDir('dags') ? 'DAG directory detected.' : null]);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const isOss = ctx.files.includes('LICENSE') && ctx.files.includes('CONTRIBUTING.md');
|
|
284
|
+
if (isOss && !isEnterpriseGoverned) {
|
|
285
|
+
addMatch('oss-library', ['Detected open-source library signals (LICENSE + CONTRIBUTING.md).']);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const isMobile = stackKeys.has('react-native') || stackKeys.has('flutter') ||
|
|
289
|
+
stackKeys.has('swift') || stackKeys.has('kotlin') ||
|
|
290
|
+
deps['react-native'] || deps.flutter || ctx.files.includes('Podfile') ||
|
|
291
|
+
ctx.files.includes('build.gradle') || ctx.hasDir('ios') || ctx.hasDir('android');
|
|
292
|
+
if (isMobile) {
|
|
293
|
+
addMatch('mobile', ['Detected mobile development signals.', ctx.hasDir('ios') ? 'iOS directory detected.' : null, ctx.hasDir('android') ? 'Android directory detected.' : null]);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const isRegulated = hasPolicyFiles && !isEnterpriseGoverned;
|
|
297
|
+
if (isRegulated) {
|
|
298
|
+
addMatch('regulated-lite', ['Detected compliance-adjacent signals without full enterprise governance.']);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const isEcommerce = deps.stripe || deps['@stripe/stripe-js'] ||
|
|
302
|
+
deps.shopify || deps['@shopify/shopify-api'] ||
|
|
303
|
+
ctx.hasDir('checkout') || ctx.hasDir('cart') || ctx.hasDir('payments');
|
|
304
|
+
if (isEcommerce) {
|
|
305
|
+
addMatch('ecommerce', ['Detected e-commerce or payment-related signals.', deps.stripe ? 'Stripe dependency detected.' : null]);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const isAiMl = deps.tensorflow || deps.torch || deps.pytorch || deps.transformers ||
|
|
309
|
+
deps.langchain || deps['@langchain/core'] || deps.openai || deps.anthropic ||
|
|
310
|
+
ctx.hasDir('models') || ctx.hasDir('training') || ctx.hasDir('rag') ||
|
|
311
|
+
ctx.files.includes('model.py') || ctx.files.includes('train.py');
|
|
312
|
+
if (isAiMl) {
|
|
313
|
+
addMatch('ai-ml', ['Detected AI/ML or model training signals.', ctx.hasDir('models') ? 'Models directory detected.' : null]);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const isDevops = hasCi && hasInfra && !isEnterpriseGoverned;
|
|
317
|
+
if (isDevops) {
|
|
318
|
+
addMatch('devops-cicd', ['Detected DevOps/CI-CD focus with both CI workflows and infrastructure.']);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const isDesignSystem = ctx.hasDir('stories') || ctx.hasDir('storybook') ||
|
|
322
|
+
deps['@storybook/react'] || deps['@storybook/vue3'] ||
|
|
323
|
+
ctx.files.includes('.storybook');
|
|
324
|
+
if (isDesignSystem) {
|
|
325
|
+
addMatch('design-system', ['Detected design system or component library signals.', ctx.hasDir('stories') ? 'Storybook stories detected.' : null]);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const isDocsContent = ctx.hasDir('docs') && !hasBackend && !hasFrontend &&
|
|
329
|
+
(ctx.files.includes('mkdocs.yml') || ctx.files.includes('docusaurus.config.js') ||
|
|
330
|
+
ctx.files.includes('_config.yml') || ctx.files.includes('hugo.toml'));
|
|
331
|
+
if (isDocsContent) {
|
|
332
|
+
addMatch('docs-content', ['Detected documentation or content-focused repo.']);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const isSecurityFocused = ctx.hasDir('security') ||
|
|
336
|
+
deps['helmet'] || deps['csurf'] || deps['bcrypt'] ||
|
|
337
|
+
(hasPolicyFiles && ctx.fileContent('SECURITY.md'));
|
|
338
|
+
if (isSecurityFocused) {
|
|
339
|
+
addMatch('security-focused', ['Detected security-focused repo signals.', ctx.fileContent('SECURITY.md') ? 'SECURITY.md present.' : null]);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
detectAdditionalDomainPacks({
|
|
343
|
+
ctx,
|
|
344
|
+
pkg,
|
|
345
|
+
deps,
|
|
346
|
+
stackKeys,
|
|
347
|
+
addMatch,
|
|
348
|
+
hasBackend,
|
|
349
|
+
hasFrontend,
|
|
350
|
+
hasInfra,
|
|
351
|
+
hasCi,
|
|
352
|
+
isEnterpriseGoverned,
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
if (matches.length === 0) {
|
|
356
|
+
addMatch('baseline-general', [
|
|
357
|
+
'No stronger platform-specific domain dominated, so a safe general Windsurf baseline is the best starting point.',
|
|
358
|
+
hasWindsurfRules
|
|
359
|
+
? 'The repo already has Windsurf surfaces, but they are not yet specialized by domain.'
|
|
360
|
+
: 'The repo needs a first Windsurf baseline before specialization.',
|
|
361
|
+
]);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
return uniqueByKey(matches);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
module.exports = {
|
|
368
|
+
WINDSURF_DOMAIN_PACKS,
|
|
369
|
+
detectWindsurfDomainPacks,
|
|
370
|
+
};
|