@nerviq/cli 1.0.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/bin/cli.js +170 -73
  2. package/package.json +1 -1
  3. package/src/activity.js +20 -0
  4. package/src/aider/domain-packs.js +27 -2
  5. package/src/aider/mcp-packs.js +231 -0
  6. package/src/aider/techniques.js +3211 -1397
  7. package/src/audit.js +257 -2
  8. package/src/catalog.js +18 -2
  9. package/src/codex/domain-packs.js +23 -1
  10. package/src/codex/mcp-packs.js +254 -0
  11. package/src/codex/techniques.js +4738 -3257
  12. package/src/copilot/domain-packs.js +23 -1
  13. package/src/copilot/mcp-packs.js +254 -0
  14. package/src/copilot/techniques.js +3433 -1936
  15. package/src/cursor/domain-packs.js +23 -1
  16. package/src/cursor/mcp-packs.js +257 -0
  17. package/src/cursor/techniques.js +3698 -1869
  18. package/src/deprecation.js +98 -0
  19. package/src/domain-pack-expansion.js +571 -0
  20. package/src/domain-packs.js +25 -2
  21. package/src/formatters/otel.js +151 -0
  22. package/src/gemini/domain-packs.js +23 -1
  23. package/src/gemini/mcp-packs.js +257 -0
  24. package/src/gemini/techniques.js +3734 -2238
  25. package/src/integrations.js +194 -0
  26. package/src/mcp-packs.js +233 -0
  27. package/src/opencode/domain-packs.js +23 -1
  28. package/src/opencode/mcp-packs.js +231 -0
  29. package/src/opencode/techniques.js +3501 -1687
  30. package/src/org.js +68 -0
  31. package/src/source-urls.js +410 -260
  32. package/src/stack-checks.js +565 -0
  33. package/src/supplemental-checks.js +817 -0
  34. package/src/techniques.js +2929 -1449
  35. package/src/telemetry.js +160 -0
  36. package/src/windsurf/domain-packs.js +23 -1
  37. package/src/windsurf/mcp-packs.js +257 -0
  38. package/src/windsurf/techniques.js +3648 -1834
  39. package/src/workspace.js +233 -0
@@ -1,260 +1,410 @@
1
- /**
2
- * Official source URL + confidence registry for platform technique catalogs.
3
- *
4
- * We attach metadata at export time so the catalogs stay maintainable without
5
- * hand-editing hundreds of technique literals.
6
- */
7
-
8
- const SOURCE_URLS = {
9
- claude: {
10
- defaultUrl: 'https://code.claude.com/docs/en/overview',
11
- byCategory: {
12
- memory: 'https://code.claude.com/docs/en/memory',
13
- quality: 'https://code.claude.com/docs/en/common-workflows',
14
- git: 'https://code.claude.com/docs/en/settings',
15
- workflow: 'https://code.claude.com/docs/en/common-workflows',
16
- security: 'https://code.claude.com/docs/en/permissions',
17
- automation: 'https://code.claude.com/docs/en/hooks',
18
- design: 'https://code.claude.com/docs/en/best-practices',
19
- devops: 'https://code.claude.com/docs/en/common-workflows',
20
- hygiene: 'https://code.claude.com/docs/en/overview',
21
- performance: 'https://code.claude.com/docs/en/memory',
22
- tools: 'https://code.claude.com/docs/en/mcp',
23
- prompting: 'https://code.claude.com/docs/en/best-practices',
24
- features: 'https://code.claude.com/docs/en/commands',
25
- 'quality-deep': 'https://code.claude.com/docs/en/best-practices',
26
- },
27
- byKey: {
28
- customCommands: 'https://code.claude.com/docs/en/commands',
29
- multipleCommands: 'https://code.claude.com/docs/en/commands',
30
- deployCommand: 'https://code.claude.com/docs/en/commands',
31
- reviewCommand: 'https://code.claude.com/docs/en/commands',
32
- agents: 'https://code.claude.com/docs/en/sub-agents',
33
- multipleAgents: 'https://code.claude.com/docs/en/sub-agents',
34
- agentsHaveMaxTurns: 'https://code.claude.com/docs/en/sub-agents',
35
- agentHasAllowedTools: 'https://code.claude.com/docs/en/sub-agents',
36
- skills: 'https://code.claude.com/docs/en/skills',
37
- multipleSkills: 'https://code.claude.com/docs/en/skills',
38
- skillUsesPaths: 'https://code.claude.com/docs/en/skills',
39
- frontendDesignSkill: 'https://code.claude.com/docs/en/skills',
40
- },
41
- },
42
- codex: {
43
- defaultUrl: 'https://developers.openai.com/codex/cli',
44
- byCategory: {
45
- instructions: 'https://developers.openai.com/codex/guides/agents-md',
46
- config: 'https://developers.openai.com/codex/config-reference',
47
- trust: 'https://developers.openai.com/codex/agent-approvals-security',
48
- rules: 'https://developers.openai.com/codex/rules',
49
- hooks: 'https://developers.openai.com/codex/hooks',
50
- mcp: 'https://developers.openai.com/codex/mcp',
51
- skills: 'https://developers.openai.com/codex/skills',
52
- agents: 'https://developers.openai.com/codex/subagents',
53
- automation: 'https://developers.openai.com/codex/app/automations',
54
- review: 'https://developers.openai.com/codex/cli',
55
- local: 'https://developers.openai.com/codex/app/local-environments',
56
- 'quality-deep': 'https://developers.openai.com/codex/feature-maturity',
57
- advisory: 'https://developers.openai.com/codex/cli',
58
- 'pack-posture': 'https://developers.openai.com/codex/mcp',
59
- 'repeat-usage': 'https://developers.openai.com/codex/cli',
60
- 'release-freshness': 'https://developers.openai.com/codex/changelog',
61
- },
62
- byKey: {
63
- codexAutomationManuallyTested: 'https://developers.openai.com/codex/app/automations',
64
- codexAutomationAppPrereqAcknowledged: 'https://developers.openai.com/codex/app/automations',
65
- codexGitHubActionSafeStrategy: 'https://developers.openai.com/codex/github-action',
66
- codexGitHubActionPromptSourceExclusive: 'https://developers.openai.com/codex/github-action',
67
- codexGitHubActionSinglePromptSource: 'https://developers.openai.com/codex/github-action',
68
- codexGitHubActionTriggerAllowlistsExplicit: 'https://developers.openai.com/codex/github-action',
69
- codexCiAuthUsesManagedKey: 'https://developers.openai.com/codex/github-action',
70
- codexPluginConfigValid: 'https://developers.openai.com/codex/skills',
71
- codexUndoExplicit: 'https://developers.openai.com/codex/config-reference',
72
- codexWorktreeLifecycleDocumented: 'https://developers.openai.com/codex/app/local-environments',
73
- },
74
- },
75
- gemini: {
76
- defaultUrl: 'https://geminicli.com/docs/get-started/',
77
- byCategory: {
78
- instructions: 'https://geminicli.com/docs/cli/gemini-md/',
79
- config: 'https://geminicli.com/docs/reference/configuration/',
80
- trust: 'https://geminicli.com/docs/cli/trusted-folders/',
81
- hooks: 'https://geminicli.com/docs/hooks/reference/',
82
- mcp: 'https://geminicli.com/docs/tools/mcp-server/',
83
- sandbox: 'https://geminicli.com/docs/cli/sandbox/',
84
- agents: 'https://geminicli.com/docs/core/subagents/',
85
- skills: 'https://geminicli.com/docs/cli/skills/',
86
- automation: 'https://geminicli.com/docs/get-started/',
87
- extensions: 'https://geminicli.com/docs/extensions/',
88
- review: 'https://geminicli.com/docs/get-started/',
89
- 'quality-deep': 'https://geminicli.com/docs/get-started/',
90
- commands: 'https://geminicli.com/docs/cli/custom-commands/',
91
- advisory: 'https://geminicli.com/docs/get-started/',
92
- 'pack-posture': 'https://geminicli.com/docs/tools/mcp-server/',
93
- 'repeat-usage': 'https://geminicli.com/docs/cli/session-management/',
94
- 'release-freshness': 'https://geminicli.com/docs/changelogs/latest/',
95
- },
96
- },
97
- copilot: {
98
- defaultUrl: 'https://docs.github.com/en/copilot',
99
- byCategory: {
100
- instructions: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
101
- config: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
102
- trust: 'https://docs.github.com/en/copilot/responsible-use-of-github-copilot-features/github-copilot-data-handling',
103
- mcp: 'https://docs.github.com/en/copilot/customizing-copilot/using-model-context-protocol/extending-copilot-chat-with-mcp',
104
- 'cloud-agent': 'https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent',
105
- organization: 'https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-organization/manage-policies',
106
- 'prompt-files': 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
107
- 'skills-agents': 'https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent',
108
- 'ci-automation': 'https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment',
109
- enterprise: 'https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise',
110
- extensions: 'https://docs.github.com/en/copilot/building-copilot-extensions/about-building-copilot-extensions',
111
- 'quality-deep': 'https://docs.github.com/en/copilot',
112
- advisory: 'https://docs.github.com/en/copilot',
113
- freshness: 'https://docs.github.com/en/copilot',
114
- },
115
- },
116
- cursor: {
117
- defaultUrl: 'https://docs.cursor.com/',
118
- byCategory: {
119
- rules: 'https://docs.cursor.com/context/rules',
120
- config: 'https://docs.cursor.com/',
121
- trust: 'https://docs.cursor.com/enterprise/privacy-and-data-governance',
122
- 'agent-mode': 'https://docs.cursor.com/en/chat/agent',
123
- mcp: 'https://docs.cursor.com/cli/mcp',
124
- 'instructions-quality': 'https://docs.cursor.com/guides/working-with-context',
125
- 'background-agents': 'https://docs.cursor.com/en/background-agents',
126
- automations: 'https://docs.cursor.com/en/background-agents/automations',
127
- enterprise: 'https://docs.cursor.com/enterprise',
128
- bugbot: 'https://docs.cursor.com/bugbot',
129
- 'cross-surface': 'https://docs.cursor.com/',
130
- 'quality-deep': 'https://docs.cursor.com/guides/working-with-context',
131
- advisory: 'https://docs.cursor.com/',
132
- freshness: 'https://docs.cursor.com/',
133
- },
134
- },
135
- windsurf: {
136
- defaultUrl: 'https://docs.windsurf.com/windsurf/cascade/cascade',
137
- byCategory: {
138
- rules: 'https://docs.windsurf.com/windsurf/cascade/cascade',
139
- config: 'https://docs.windsurf.com/windsurf/cascade/cascade',
140
- trust: 'https://docs.windsurf.com/windsurf/cascade/cascade',
141
- 'cascade-agent': 'https://docs.windsurf.com/windsurf/cascade/agents-md',
142
- mcp: 'https://docs.windsurf.com/windsurf/cascade/mcp',
143
- 'instructions-quality': 'https://docs.windsurf.com/windsurf/cascade/agents-md',
144
- workflows: 'https://docs.windsurf.com/windsurf/cascade/workflows',
145
- memories: 'https://docs.windsurf.com/windsurf/cascade/memories',
146
- enterprise: 'https://docs.windsurf.com/windsurf/cascade/cascade',
147
- cascadeignore: 'https://docs.windsurf.com/windsurf/cascade/cascade',
148
- 'cross-surface': 'https://docs.windsurf.com/windsurf/cascade/cascade',
149
- 'quality-deep': 'https://docs.windsurf.com/windsurf/cascade/cascade',
150
- advisory: 'https://docs.windsurf.com/windsurf/cascade/cascade',
151
- freshness: 'https://docs.windsurf.com/windsurf/cascade/cascade',
152
- },
153
- },
154
- aider: {
155
- defaultUrl: 'https://aider.chat/docs/',
156
- byCategory: {
157
- config: 'https://aider.chat/docs/config.html',
158
- 'advanced-config': 'https://aider.chat/docs/config/aider_conf.html',
159
- 'git-safety': 'https://aider.chat/docs/git.html',
160
- 'model-config': 'https://aider.chat/docs/config/adv-model-settings.html',
161
- conventions: 'https://aider.chat/docs/usage/conventions.html',
162
- architecture: 'https://aider.chat/docs/usage/modes.html',
163
- security: 'https://aider.chat/docs/config/dotenv.html',
164
- ci: 'https://aider.chat/docs/usage/modes.html',
165
- quality: 'https://aider.chat/docs/usage/modes.html',
166
- 'workflow-patterns': 'https://aider.chat/docs/usage/modes.html',
167
- 'editor-integration': 'https://aider.chat/docs/config.html',
168
- 'release-readiness': 'https://aider.chat/docs/',
169
- },
170
- },
171
- opencode: {
172
- defaultUrl: 'https://github.com/sst/opencode',
173
- byCategory: {
174
- instructions: 'https://github.com/sst/opencode/blob/dev/AGENTS.md',
175
- config: 'https://github.com/sst/opencode/tree/dev/.opencode',
176
- permissions: 'https://github.com/sst/opencode/tree/dev/.opencode',
177
- plugins: 'https://github.com/sst/opencode/tree/dev/.opencode',
178
- security: 'https://github.com/sst/opencode/blob/dev/SECURITY.md',
179
- mcp: 'https://github.com/sst/opencode/tree/dev/.opencode',
180
- ci: 'https://github.com/sst/opencode/tree/dev/.github',
181
- 'quality-deep': 'https://github.com/sst/opencode/blob/dev/README.md',
182
- skills: 'https://github.com/sst/opencode/tree/dev/.opencode',
183
- agents: 'https://github.com/sst/opencode/blob/dev/AGENTS.md',
184
- commands: 'https://github.com/sst/opencode/tree/dev/.opencode',
185
- tui: 'https://github.com/sst/opencode/blob/dev/README.md',
186
- governance: 'https://github.com/sst/opencode/blob/dev/SECURITY.md',
187
- 'release-freshness': 'https://github.com/sst/opencode/releases',
188
- 'mixed-agent': 'https://github.com/sst/opencode/blob/dev/AGENTS.md',
189
- propagation: 'https://github.com/sst/opencode/tree/dev/.opencode',
190
- },
191
- },
192
- };
193
-
194
- const STALE_CONFIDENCE_IDS = new Set([
195
- 'CX-B04',
196
- 'CX-B09',
197
- 'CX-C05',
198
- 'CX-C06',
199
- ]);
200
-
201
- const RUNTIME_CONFIDENCE_IDS = {
202
- codex: new Set([
203
- 'CX-B01',
204
- 'CX-C01',
205
- 'CX-C02',
206
- 'CX-C03',
207
- 'CX-D01',
208
- 'CX-E02',
209
- 'CX-H02',
210
- 'CX-H03',
211
- 'CX-I01',
212
- ]),
213
- gemini: new Set(['GM-Q01', 'GM-Q02', 'GM-Q03', 'GM-Q04', 'GM-Q05']),
214
- copilot: new Set(['CP-Q01', 'CP-Q02', 'CP-Q03', 'CP-Q04', 'CP-Q05']),
215
- };
216
-
217
- function hasRuntimeVerificationSignal(technique) {
218
- const haystack = `${technique.name || ''}\n${technique.fix || ''}`;
219
- return /experiment(?:ally)? confirmed|confirmed by (?:live )?experiment|current runtime|runtime evidence|runtime-verified|validated in current runtime|observed in current runtime|measured in live experiment|reproduced in runtime|confirmed by experiment/i.test(haystack);
220
- }
221
-
222
- function resolveConfidence(platform, technique) {
223
- if (STALE_CONFIDENCE_IDS.has(technique.id)) {
224
- return 0.3;
225
- }
226
-
227
- if (RUNTIME_CONFIDENCE_IDS[platform]?.has(technique.id) || hasRuntimeVerificationSignal(technique)) {
228
- return 0.9;
229
- }
230
-
231
- return 0.7;
232
- }
233
-
234
- function attachSourceUrls(platform, techniques) {
235
- const mapping = SOURCE_URLS[platform];
236
- if (!mapping) {
237
- throw new Error(`Unknown source-url platform '${platform}'`);
238
- }
239
-
240
- for (const [key, technique] of Object.entries(techniques)) {
241
- const resolved =
242
- mapping.byKey?.[key] ||
243
- mapping.byCategory?.[technique.category] ||
244
- mapping.defaultUrl;
245
-
246
- if (!resolved) {
247
- throw new Error(`No sourceUrl mapping found for ${platform}:${key}`);
248
- }
249
-
250
- technique.sourceUrl = resolved;
251
- technique.confidence = resolveConfidence(platform, technique);
252
- }
253
-
254
- return techniques;
255
- }
256
-
257
- module.exports = {
258
- SOURCE_URLS,
259
- attachSourceUrls,
260
- };
1
+ /**
2
+ * Official source URL + confidence registry for platform technique catalogs.
3
+ *
4
+ * We attach metadata at export time so the catalogs stay maintainable without
5
+ * hand-editing hundreds of technique literals.
6
+ */
7
+
8
+ const SOURCE_URLS = {
9
+ claude: {
10
+ defaultUrl: 'https://code.claude.com/docs/en/overview',
11
+ byCategory: {
12
+ memory: 'https://code.claude.com/docs/en/memory',
13
+ quality: 'https://code.claude.com/docs/en/common-workflows',
14
+ git: 'https://code.claude.com/docs/en/settings',
15
+ workflow: 'https://code.claude.com/docs/en/common-workflows',
16
+ security: 'https://code.claude.com/docs/en/permissions',
17
+ automation: 'https://code.claude.com/docs/en/hooks',
18
+ design: 'https://code.claude.com/docs/en/best-practices',
19
+ devops: 'https://code.claude.com/docs/en/common-workflows',
20
+ hygiene: 'https://code.claude.com/docs/en/overview',
21
+ performance: 'https://code.claude.com/docs/en/memory',
22
+ tools: 'https://code.claude.com/docs/en/mcp',
23
+ prompting: 'https://code.claude.com/docs/en/best-practices',
24
+ features: 'https://code.claude.com/docs/en/commands',
25
+ 'quality-deep': 'https://code.claude.com/docs/en/best-practices',
26
+ 'testing-strategy': 'https://code.claude.com/docs/en/common-workflows',
27
+ 'code-quality': 'https://code.claude.com/docs/en/best-practices',
28
+ 'api-design': 'https://code.claude.com/docs/en/best-practices',
29
+ database: 'https://code.claude.com/docs/en/common-workflows',
30
+ authentication: 'https://code.claude.com/docs/en/permissions',
31
+ monitoring: 'https://code.claude.com/docs/en/common-workflows',
32
+ 'dependency-management': 'https://code.claude.com/docs/en/best-practices',
33
+ 'cost-optimization': 'https://code.claude.com/docs/en/memory',
34
+ python: 'https://code.claude.com/docs/en/common-workflows',
35
+ go: 'https://code.claude.com/docs/en/common-workflows',
36
+ rust: 'https://code.claude.com/docs/en/common-workflows',
37
+ java: 'https://code.claude.com/docs/en/common-workflows',
38
+ ruby: 'https://code.claude.com/docs/en/common-workflows',
39
+ dotnet: 'https://code.claude.com/docs/en/common-workflows',
40
+ php: 'https://code.claude.com/docs/en/common-workflows',
41
+ flutter: 'https://code.claude.com/docs/en/common-workflows',
42
+ swift: 'https://code.claude.com/docs/en/common-workflows',
43
+ kotlin: 'https://code.claude.com/docs/en/common-workflows',
44
+ },
45
+ byKey: {
46
+ customCommands: 'https://code.claude.com/docs/en/commands',
47
+ multipleCommands: 'https://code.claude.com/docs/en/commands',
48
+ deployCommand: 'https://code.claude.com/docs/en/commands',
49
+ reviewCommand: 'https://code.claude.com/docs/en/commands',
50
+ agents: 'https://code.claude.com/docs/en/sub-agents',
51
+ multipleAgents: 'https://code.claude.com/docs/en/sub-agents',
52
+ agentsHaveMaxTurns: 'https://code.claude.com/docs/en/sub-agents',
53
+ agentHasAllowedTools: 'https://code.claude.com/docs/en/sub-agents',
54
+ skills: 'https://code.claude.com/docs/en/skills',
55
+ multipleSkills: 'https://code.claude.com/docs/en/skills',
56
+ skillUsesPaths: 'https://code.claude.com/docs/en/skills',
57
+ frontendDesignSkill: 'https://code.claude.com/docs/en/skills',
58
+ },
59
+ },
60
+ codex: {
61
+ defaultUrl: 'https://developers.openai.com/codex/cli',
62
+ byCategory: {
63
+ instructions: 'https://developers.openai.com/codex/guides/agents-md',
64
+ config: 'https://developers.openai.com/codex/config-reference',
65
+ trust: 'https://developers.openai.com/codex/agent-approvals-security',
66
+ rules: 'https://developers.openai.com/codex/rules',
67
+ hooks: 'https://developers.openai.com/codex/hooks',
68
+ mcp: 'https://developers.openai.com/codex/mcp',
69
+ skills: 'https://developers.openai.com/codex/skills',
70
+ agents: 'https://developers.openai.com/codex/subagents',
71
+ automation: 'https://developers.openai.com/codex/app/automations',
72
+ review: 'https://developers.openai.com/codex/cli',
73
+ local: 'https://developers.openai.com/codex/app/local-environments',
74
+ 'quality-deep': 'https://developers.openai.com/codex/feature-maturity',
75
+ advisory: 'https://developers.openai.com/codex/cli',
76
+ 'pack-posture': 'https://developers.openai.com/codex/mcp',
77
+ 'repeat-usage': 'https://developers.openai.com/codex/cli',
78
+ 'release-freshness': 'https://developers.openai.com/codex/changelog',
79
+ 'testing-strategy': 'https://developers.openai.com/codex/cli',
80
+ 'code-quality': 'https://developers.openai.com/codex/rules',
81
+ 'api-design': 'https://developers.openai.com/codex/guides/agents-md',
82
+ database: 'https://developers.openai.com/codex/cli',
83
+ authentication: 'https://developers.openai.com/codex/agent-approvals-security',
84
+ monitoring: 'https://developers.openai.com/codex/feature-maturity',
85
+ 'dependency-management': 'https://developers.openai.com/codex/config-reference',
86
+ 'cost-optimization': 'https://developers.openai.com/codex/guides/agents-md',
87
+ python: 'https://developers.openai.com/codex/cli',
88
+ go: 'https://developers.openai.com/codex/cli',
89
+ rust: 'https://developers.openai.com/codex/cli',
90
+ java: 'https://developers.openai.com/codex/cli',
91
+ ruby: 'https://developers.openai.com/codex/cli',
92
+ dotnet: 'https://developers.openai.com/codex/cli',
93
+ php: 'https://developers.openai.com/codex/cli',
94
+ flutter: 'https://developers.openai.com/codex/cli',
95
+ swift: 'https://developers.openai.com/codex/cli',
96
+ kotlin: 'https://developers.openai.com/codex/cli',
97
+ },
98
+ byKey: {
99
+ codexAutomationManuallyTested: 'https://developers.openai.com/codex/app/automations',
100
+ codexAutomationAppPrereqAcknowledged: 'https://developers.openai.com/codex/app/automations',
101
+ codexGitHubActionSafeStrategy: 'https://developers.openai.com/codex/github-action',
102
+ codexGitHubActionPromptSourceExclusive: 'https://developers.openai.com/codex/github-action',
103
+ codexGitHubActionSinglePromptSource: 'https://developers.openai.com/codex/github-action',
104
+ codexGitHubActionTriggerAllowlistsExplicit: 'https://developers.openai.com/codex/github-action',
105
+ codexCiAuthUsesManagedKey: 'https://developers.openai.com/codex/github-action',
106
+ codexPluginConfigValid: 'https://developers.openai.com/codex/skills',
107
+ codexUndoExplicit: 'https://developers.openai.com/codex/config-reference',
108
+ codexWorktreeLifecycleDocumented: 'https://developers.openai.com/codex/app/local-environments',
109
+ },
110
+ },
111
+ gemini: {
112
+ defaultUrl: 'https://geminicli.com/docs/get-started/',
113
+ byCategory: {
114
+ instructions: 'https://geminicli.com/docs/cli/gemini-md/',
115
+ config: 'https://geminicli.com/docs/reference/configuration/',
116
+ trust: 'https://geminicli.com/docs/cli/trusted-folders/',
117
+ hooks: 'https://geminicli.com/docs/hooks/reference/',
118
+ mcp: 'https://geminicli.com/docs/tools/mcp-server/',
119
+ sandbox: 'https://geminicli.com/docs/cli/sandbox/',
120
+ agents: 'https://geminicli.com/docs/core/subagents/',
121
+ skills: 'https://geminicli.com/docs/cli/skills/',
122
+ automation: 'https://geminicli.com/docs/get-started/',
123
+ extensions: 'https://geminicli.com/docs/extensions/',
124
+ review: 'https://geminicli.com/docs/get-started/',
125
+ 'quality-deep': 'https://geminicli.com/docs/get-started/',
126
+ commands: 'https://geminicli.com/docs/cli/custom-commands/',
127
+ advisory: 'https://geminicli.com/docs/get-started/',
128
+ 'pack-posture': 'https://geminicli.com/docs/tools/mcp-server/',
129
+ 'repeat-usage': 'https://geminicli.com/docs/cli/session-management/',
130
+ 'release-freshness': 'https://geminicli.com/docs/changelogs/latest/',
131
+ 'testing-strategy': 'https://geminicli.com/docs/get-started/',
132
+ 'code-quality': 'https://geminicli.com/docs/cli/gemini-md/',
133
+ 'api-design': 'https://geminicli.com/docs/cli/gemini-md/',
134
+ database: 'https://geminicli.com/docs/get-started/',
135
+ authentication: 'https://geminicli.com/docs/cli/trusted-folders/',
136
+ monitoring: 'https://geminicli.com/docs/get-started/',
137
+ 'dependency-management': 'https://geminicli.com/docs/reference/configuration/',
138
+ 'cost-optimization': 'https://geminicli.com/docs/get-started/',
139
+ python: 'https://geminicli.com/docs/get-started/',
140
+ go: 'https://geminicli.com/docs/get-started/',
141
+ rust: 'https://geminicli.com/docs/get-started/',
142
+ java: 'https://geminicli.com/docs/get-started/',
143
+ ruby: 'https://geminicli.com/docs/get-started/',
144
+ dotnet: 'https://geminicli.com/docs/get-started/',
145
+ php: 'https://geminicli.com/docs/get-started/',
146
+ flutter: 'https://geminicli.com/docs/get-started/',
147
+ swift: 'https://geminicli.com/docs/get-started/',
148
+ kotlin: 'https://geminicli.com/docs/get-started/',
149
+ },
150
+ },
151
+ copilot: {
152
+ defaultUrl: 'https://docs.github.com/en/copilot',
153
+ byCategory: {
154
+ instructions: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
155
+ config: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
156
+ trust: 'https://docs.github.com/en/copilot/responsible-use-of-github-copilot-features/github-copilot-data-handling',
157
+ mcp: 'https://docs.github.com/en/copilot/customizing-copilot/using-model-context-protocol/extending-copilot-chat-with-mcp',
158
+ 'cloud-agent': 'https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent',
159
+ organization: 'https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-organization/manage-policies',
160
+ 'prompt-files': 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
161
+ 'skills-agents': 'https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent',
162
+ 'ci-automation': 'https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment',
163
+ enterprise: 'https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise',
164
+ extensions: 'https://docs.github.com/en/copilot/building-copilot-extensions/about-building-copilot-extensions',
165
+ 'quality-deep': 'https://docs.github.com/en/copilot',
166
+ advisory: 'https://docs.github.com/en/copilot',
167
+ freshness: 'https://docs.github.com/en/copilot',
168
+ 'testing-strategy': 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
169
+ 'code-quality': 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
170
+ 'api-design': 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
171
+ database: 'https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent',
172
+ authentication: 'https://docs.github.com/en/copilot/responsible-use-of-github-copilot-features/github-copilot-data-handling',
173
+ monitoring: 'https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment',
174
+ 'dependency-management': 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
175
+ 'cost-optimization': 'https://docs.github.com/en/copilot',
176
+ python: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
177
+ go: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
178
+ rust: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
179
+ java: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
180
+ ruby: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
181
+ dotnet: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
182
+ php: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
183
+ flutter: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
184
+ swift: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
185
+ kotlin: 'https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot',
186
+ },
187
+ },
188
+ cursor: {
189
+ defaultUrl: 'https://docs.cursor.com/',
190
+ byCategory: {
191
+ rules: 'https://docs.cursor.com/context/rules',
192
+ config: 'https://docs.cursor.com/',
193
+ trust: 'https://docs.cursor.com/enterprise/privacy-and-data-governance',
194
+ 'agent-mode': 'https://docs.cursor.com/en/chat/agent',
195
+ mcp: 'https://docs.cursor.com/cli/mcp',
196
+ 'instructions-quality': 'https://docs.cursor.com/guides/working-with-context',
197
+ 'background-agents': 'https://docs.cursor.com/en/background-agents',
198
+ automations: 'https://docs.cursor.com/en/background-agents/automations',
199
+ enterprise: 'https://docs.cursor.com/enterprise',
200
+ bugbot: 'https://docs.cursor.com/bugbot',
201
+ 'cross-surface': 'https://docs.cursor.com/',
202
+ 'quality-deep': 'https://docs.cursor.com/guides/working-with-context',
203
+ advisory: 'https://docs.cursor.com/',
204
+ freshness: 'https://docs.cursor.com/',
205
+ 'testing-strategy': 'https://docs.cursor.com/guides/working-with-context',
206
+ 'code-quality': 'https://docs.cursor.com/context/rules',
207
+ 'api-design': 'https://docs.cursor.com/guides/working-with-context',
208
+ database: 'https://docs.cursor.com/guides/working-with-context',
209
+ authentication: 'https://docs.cursor.com/enterprise/privacy-and-data-governance',
210
+ monitoring: 'https://docs.cursor.com/guides/working-with-context',
211
+ 'dependency-management': 'https://docs.cursor.com/guides/working-with-context',
212
+ 'cost-optimization': 'https://docs.cursor.com/account',
213
+ python: 'https://docs.cursor.com/guides/working-with-context',
214
+ go: 'https://docs.cursor.com/guides/working-with-context',
215
+ rust: 'https://docs.cursor.com/guides/working-with-context',
216
+ java: 'https://docs.cursor.com/guides/working-with-context',
217
+ ruby: 'https://docs.cursor.com/guides/working-with-context',
218
+ dotnet: 'https://docs.cursor.com/guides/working-with-context',
219
+ php: 'https://docs.cursor.com/guides/working-with-context',
220
+ flutter: 'https://docs.cursor.com/guides/working-with-context',
221
+ swift: 'https://docs.cursor.com/guides/working-with-context',
222
+ kotlin: 'https://docs.cursor.com/guides/working-with-context',
223
+ },
224
+ },
225
+ windsurf: {
226
+ defaultUrl: 'https://docs.windsurf.com/windsurf/cascade/cascade',
227
+ byCategory: {
228
+ rules: 'https://docs.windsurf.com/windsurf/cascade/cascade',
229
+ config: 'https://docs.windsurf.com/windsurf/cascade/cascade',
230
+ trust: 'https://docs.windsurf.com/windsurf/cascade/cascade',
231
+ 'cascade-agent': 'https://docs.windsurf.com/windsurf/cascade/agents-md',
232
+ mcp: 'https://docs.windsurf.com/windsurf/cascade/mcp',
233
+ 'instructions-quality': 'https://docs.windsurf.com/windsurf/cascade/agents-md',
234
+ workflows: 'https://docs.windsurf.com/windsurf/cascade/workflows',
235
+ memories: 'https://docs.windsurf.com/windsurf/cascade/memories',
236
+ enterprise: 'https://docs.windsurf.com/windsurf/cascade/cascade',
237
+ cascadeignore: 'https://docs.windsurf.com/windsurf/cascade/cascade',
238
+ 'cross-surface': 'https://docs.windsurf.com/windsurf/cascade/cascade',
239
+ 'quality-deep': 'https://docs.windsurf.com/windsurf/cascade/cascade',
240
+ advisory: 'https://docs.windsurf.com/windsurf/cascade/cascade',
241
+ freshness: 'https://docs.windsurf.com/windsurf/cascade/cascade',
242
+ 'testing-strategy': 'https://docs.windsurf.com/windsurf/cascade/cascade',
243
+ 'code-quality': 'https://docs.windsurf.com/windsurf/cascade/cascade',
244
+ 'api-design': 'https://docs.windsurf.com/windsurf/cascade/cascade',
245
+ database: 'https://docs.windsurf.com/windsurf/cascade/cascade',
246
+ authentication: 'https://docs.windsurf.com/windsurf/cascade/cascade',
247
+ monitoring: 'https://docs.windsurf.com/windsurf/cascade/cascade',
248
+ 'dependency-management': 'https://docs.windsurf.com/windsurf/cascade/cascade',
249
+ 'cost-optimization': 'https://docs.windsurf.com/windsurf/cascade/cascade',
250
+ python: 'https://docs.windsurf.com/windsurf/cascade/cascade',
251
+ go: 'https://docs.windsurf.com/windsurf/cascade/cascade',
252
+ rust: 'https://docs.windsurf.com/windsurf/cascade/cascade',
253
+ java: 'https://docs.windsurf.com/windsurf/cascade/cascade',
254
+ ruby: 'https://docs.windsurf.com/windsurf/cascade/cascade',
255
+ dotnet: 'https://docs.windsurf.com/windsurf/cascade/cascade',
256
+ php: 'https://docs.windsurf.com/windsurf/cascade/cascade',
257
+ flutter: 'https://docs.windsurf.com/windsurf/cascade/cascade',
258
+ swift: 'https://docs.windsurf.com/windsurf/cascade/cascade',
259
+ kotlin: 'https://docs.windsurf.com/windsurf/cascade/cascade',
260
+ },
261
+ },
262
+ aider: {
263
+ defaultUrl: 'https://aider.chat/docs/',
264
+ byCategory: {
265
+ config: 'https://aider.chat/docs/config.html',
266
+ 'advanced-config': 'https://aider.chat/docs/config/aider_conf.html',
267
+ 'git-safety': 'https://aider.chat/docs/git.html',
268
+ 'model-config': 'https://aider.chat/docs/config/adv-model-settings.html',
269
+ conventions: 'https://aider.chat/docs/usage/conventions.html',
270
+ architecture: 'https://aider.chat/docs/usage/modes.html',
271
+ security: 'https://aider.chat/docs/config/dotenv.html',
272
+ ci: 'https://aider.chat/docs/usage/modes.html',
273
+ quality: 'https://aider.chat/docs/usage/modes.html',
274
+ 'workflow-patterns': 'https://aider.chat/docs/usage/modes.html',
275
+ 'editor-integration': 'https://aider.chat/docs/config.html',
276
+ 'release-readiness': 'https://aider.chat/docs/',
277
+ 'testing-strategy': 'https://aider.chat/docs/',
278
+ 'code-quality': 'https://aider.chat/docs/',
279
+ 'api-design': 'https://aider.chat/docs/',
280
+ database: 'https://aider.chat/docs/',
281
+ authentication: 'https://aider.chat/docs/',
282
+ monitoring: 'https://aider.chat/docs/',
283
+ 'dependency-management': 'https://aider.chat/docs/',
284
+ 'cost-optimization': 'https://aider.chat/docs/',
285
+ python: 'https://aider.chat/docs/',
286
+ go: 'https://aider.chat/docs/',
287
+ rust: 'https://aider.chat/docs/',
288
+ java: 'https://aider.chat/docs/',
289
+ ruby: 'https://aider.chat/docs/',
290
+ dotnet: 'https://aider.chat/docs/',
291
+ php: 'https://aider.chat/docs/',
292
+ flutter: 'https://aider.chat/docs/',
293
+ swift: 'https://aider.chat/docs/',
294
+ kotlin: 'https://aider.chat/docs/',
295
+ },
296
+ },
297
+ opencode: {
298
+ defaultUrl: 'https://github.com/sst/opencode',
299
+ byCategory: {
300
+ instructions: 'https://github.com/sst/opencode/blob/dev/AGENTS.md',
301
+ config: 'https://github.com/sst/opencode/tree/dev/.opencode',
302
+ permissions: 'https://github.com/sst/opencode/tree/dev/.opencode',
303
+ plugins: 'https://github.com/sst/opencode/tree/dev/.opencode',
304
+ security: 'https://github.com/sst/opencode/blob/dev/SECURITY.md',
305
+ mcp: 'https://github.com/sst/opencode/tree/dev/.opencode',
306
+ ci: 'https://github.com/sst/opencode/tree/dev/.github',
307
+ 'quality-deep': 'https://github.com/sst/opencode/blob/dev/README.md',
308
+ skills: 'https://github.com/sst/opencode/tree/dev/.opencode',
309
+ agents: 'https://github.com/sst/opencode/blob/dev/AGENTS.md',
310
+ commands: 'https://github.com/sst/opencode/tree/dev/.opencode',
311
+ tui: 'https://github.com/sst/opencode/blob/dev/README.md',
312
+ governance: 'https://github.com/sst/opencode/blob/dev/SECURITY.md',
313
+ 'release-freshness': 'https://github.com/sst/opencode/releases',
314
+ 'mixed-agent': 'https://github.com/sst/opencode/blob/dev/AGENTS.md',
315
+ propagation: 'https://github.com/sst/opencode/tree/dev/.opencode',
316
+ 'testing-strategy': 'https://github.com/sst/opencode',
317
+ 'code-quality': 'https://github.com/sst/opencode',
318
+ 'api-design': 'https://github.com/sst/opencode',
319
+ database: 'https://github.com/sst/opencode',
320
+ authentication: 'https://github.com/sst/opencode',
321
+ monitoring: 'https://github.com/sst/opencode',
322
+ 'dependency-management': 'https://github.com/sst/opencode',
323
+ 'cost-optimization': 'https://github.com/sst/opencode',
324
+ python: 'https://github.com/sst/opencode',
325
+ go: 'https://github.com/sst/opencode',
326
+ rust: 'https://github.com/sst/opencode',
327
+ java: 'https://github.com/sst/opencode',
328
+ ruby: 'https://github.com/sst/opencode',
329
+ dotnet: 'https://github.com/sst/opencode',
330
+ php: 'https://github.com/sst/opencode',
331
+ flutter: 'https://github.com/sst/opencode',
332
+ swift: 'https://github.com/sst/opencode',
333
+ kotlin: 'https://github.com/sst/opencode',
334
+ },
335
+ },
336
+ };
337
+
338
+ const STALE_CONFIDENCE_IDS = new Set([
339
+ 'CX-B04',
340
+ 'CX-B09',
341
+ 'CX-C05',
342
+ 'CX-C06',
343
+ ]);
344
+
345
+ const LAST_VERIFIED = {
346
+ default: '2026-04-05',
347
+ };
348
+
349
+ const RUNTIME_CONFIDENCE_IDS = {
350
+ codex: new Set([
351
+ 'CX-B01',
352
+ 'CX-C01',
353
+ 'CX-C02',
354
+ 'CX-C03',
355
+ 'CX-D01',
356
+ 'CX-E02',
357
+ 'CX-H02',
358
+ 'CX-H03',
359
+ 'CX-I01',
360
+ ]),
361
+ gemini: new Set(['GM-Q01', 'GM-Q02', 'GM-Q03', 'GM-Q04', 'GM-Q05']),
362
+ copilot: new Set(['CP-Q01', 'CP-Q02', 'CP-Q03', 'CP-Q04', 'CP-Q05']),
363
+ };
364
+
365
+ function hasRuntimeVerificationSignal(technique) {
366
+ const haystack = `${technique.name || ''}\n${technique.fix || ''}`;
367
+ return /experiment(?:ally)? confirmed|confirmed by (?:live )?experiment|current runtime|runtime evidence|runtime-verified|validated in current runtime|observed in current runtime|measured in live experiment|reproduced in runtime|confirmed by experiment/i.test(haystack);
368
+ }
369
+
370
+ function resolveConfidence(platform, technique) {
371
+ if (STALE_CONFIDENCE_IDS.has(technique.id)) {
372
+ return 0.3;
373
+ }
374
+
375
+ if (RUNTIME_CONFIDENCE_IDS[platform]?.has(technique.id) || hasRuntimeVerificationSignal(technique)) {
376
+ return 0.9;
377
+ }
378
+
379
+ return 0.7;
380
+ }
381
+
382
+ function attachSourceUrls(platform, techniques) {
383
+ const mapping = SOURCE_URLS[platform];
384
+ if (!mapping) {
385
+ throw new Error(`Unknown source-url platform '${platform}'`);
386
+ }
387
+
388
+ for (const [key, technique] of Object.entries(techniques)) {
389
+ const resolved =
390
+ mapping.byKey?.[key] ||
391
+ mapping.byCategory?.[technique.category] ||
392
+ mapping.defaultUrl;
393
+
394
+ if (!resolved) {
395
+ throw new Error(`No sourceUrl mapping found for ${platform}:${key}`);
396
+ }
397
+
398
+ technique.sourceUrl = technique.sourceUrl || resolved;
399
+ technique.confidence = technique.confidence ?? resolveConfidence(platform, technique);
400
+ technique.lastVerified = technique.lastVerified || LAST_VERIFIED[platform] || LAST_VERIFIED.default;
401
+ }
402
+
403
+ return techniques;
404
+ }
405
+
406
+ module.exports = {
407
+ SOURCE_URLS,
408
+ LAST_VERIFIED,
409
+ attachSourceUrls,
410
+ };