@nerviq/cli 1.20.0 → 1.21.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.
Files changed (185) hide show
  1. package/LICENSE +23 -23
  2. package/README.md +2 -2
  3. package/bin/cli.js +1 -0
  4. package/package.json +2 -1
  5. package/src/activity.js +1039 -1039
  6. package/src/adoption-advisor.js +299 -299
  7. package/src/aider/config-parser.js +166 -166
  8. package/src/aider/context.js +6 -2
  9. package/src/aider/deep-review.js +316 -316
  10. package/src/aider/domain-packs.js +303 -303
  11. package/src/aider/freshness.js +93 -93
  12. package/src/aider/governance.js +253 -253
  13. package/src/aider/interactive.js +334 -334
  14. package/src/aider/mcp-packs.js +329 -329
  15. package/src/aider/patch.js +214 -214
  16. package/src/aider/plans.js +186 -186
  17. package/src/aider/premium.js +360 -360
  18. package/src/aider/setup.js +404 -404
  19. package/src/aider/techniques.js +312 -67
  20. package/src/analyze.js +951 -951
  21. package/src/anti-patterns.js +485 -485
  22. package/src/audit/instruction-files.js +180 -180
  23. package/src/audit/recommendations.js +577 -577
  24. package/src/auto-suggest.js +154 -154
  25. package/src/badge.js +13 -13
  26. package/src/behavioral-drift.js +801 -801
  27. package/src/benchmark.js +67 -67
  28. package/src/catalog.js +103 -103
  29. package/src/certification.js +128 -128
  30. package/src/codex/config-parser.js +183 -183
  31. package/src/codex/context.js +223 -223
  32. package/src/codex/deep-review.js +493 -493
  33. package/src/codex/domain-packs.js +394 -394
  34. package/src/codex/freshness.js +84 -84
  35. package/src/codex/governance.js +192 -192
  36. package/src/codex/interactive.js +618 -618
  37. package/src/codex/mcp-packs.js +914 -914
  38. package/src/codex/patch.js +209 -209
  39. package/src/codex/plans.js +251 -251
  40. package/src/codex/premium.js +614 -614
  41. package/src/codex/setup.js +591 -591
  42. package/src/context.js +10 -4
  43. package/src/continuous-ops.js +681 -681
  44. package/src/copilot/activity.js +309 -309
  45. package/src/copilot/deep-review.js +346 -346
  46. package/src/copilot/domain-packs.js +372 -372
  47. package/src/copilot/freshness.js +57 -57
  48. package/src/copilot/governance.js +222 -222
  49. package/src/copilot/interactive.js +406 -406
  50. package/src/copilot/mcp-packs.js +826 -826
  51. package/src/copilot/plans.js +253 -253
  52. package/src/copilot/premium.js +451 -451
  53. package/src/copilot/setup.js +488 -488
  54. package/src/cost-tracking.js +61 -61
  55. package/src/cursor/activity.js +301 -301
  56. package/src/cursor/config-parser.js +265 -265
  57. package/src/cursor/context.js +256 -256
  58. package/src/cursor/deep-review.js +334 -334
  59. package/src/cursor/domain-packs.js +368 -368
  60. package/src/cursor/freshness.js +65 -65
  61. package/src/cursor/governance.js +229 -229
  62. package/src/cursor/interactive.js +391 -391
  63. package/src/cursor/mcp-packs.js +828 -828
  64. package/src/cursor/plans.js +254 -254
  65. package/src/cursor/premium.js +469 -469
  66. package/src/cursor/setup.js +488 -488
  67. package/src/dashboard.js +493 -493
  68. package/src/deep-review.js +428 -428
  69. package/src/deprecation.js +98 -98
  70. package/src/diff-only.js +280 -280
  71. package/src/doctor.js +119 -119
  72. package/src/domain-pack-expansion.js +1033 -1033
  73. package/src/domain-packs.js +387 -387
  74. package/src/feedback.js +178 -178
  75. package/src/fix-engine.js +783 -783
  76. package/src/fix-prompts.js +122 -122
  77. package/src/formatters/sarif.js +115 -115
  78. package/src/freshness.js +74 -74
  79. package/src/gemini/config-parser.js +275 -275
  80. package/src/gemini/deep-review.js +559 -559
  81. package/src/gemini/domain-packs.js +393 -393
  82. package/src/gemini/freshness.js +66 -66
  83. package/src/gemini/governance.js +201 -201
  84. package/src/gemini/interactive.js +860 -860
  85. package/src/gemini/mcp-packs.js +915 -915
  86. package/src/gemini/plans.js +269 -269
  87. package/src/gemini/premium.js +760 -760
  88. package/src/gemini/setup.js +692 -692
  89. package/src/governance.js +72 -72
  90. package/src/harmony/add.js +68 -68
  91. package/src/harmony/advisor.js +333 -333
  92. package/src/harmony/canon.js +565 -565
  93. package/src/harmony/cli.js +591 -591
  94. package/src/harmony/drift.js +401 -401
  95. package/src/harmony/governance.js +313 -313
  96. package/src/harmony/memory.js +239 -239
  97. package/src/harmony/sync.js +475 -475
  98. package/src/harmony/watch.js +370 -370
  99. package/src/hook-validation.js +342 -342
  100. package/src/index.js +271 -271
  101. package/src/init.js +184 -184
  102. package/src/instruction-surfaces.js +185 -185
  103. package/src/integrations.js +144 -144
  104. package/src/interactive.js +118 -118
  105. package/src/locales/en.json +1 -1
  106. package/src/locales/es.json +1 -1
  107. package/src/mcp-packs.js +830 -830
  108. package/src/mcp-server.js +726 -726
  109. package/src/mcp-validation.js +337 -337
  110. package/src/nerviq-sync.json +7 -7
  111. package/src/opencode/config-parser.js +109 -109
  112. package/src/opencode/context.js +247 -247
  113. package/src/opencode/deep-review.js +313 -313
  114. package/src/opencode/domain-packs.js +262 -262
  115. package/src/opencode/freshness.js +66 -66
  116. package/src/opencode/governance.js +159 -159
  117. package/src/opencode/interactive.js +392 -392
  118. package/src/opencode/mcp-packs.js +705 -705
  119. package/src/opencode/patch.js +184 -184
  120. package/src/opencode/plans.js +231 -231
  121. package/src/opencode/premium.js +413 -413
  122. package/src/opencode/setup.js +449 -449
  123. package/src/opencode/techniques.js +27 -27
  124. package/src/operating-profile.js +574 -574
  125. package/src/org.js +152 -152
  126. package/src/permission-rules.js +218 -218
  127. package/src/plans.js +839 -839
  128. package/src/platform-change-manifest.js +86 -86
  129. package/src/plugins.js +110 -110
  130. package/src/policy-layers.js +210 -210
  131. package/src/profiles.js +124 -124
  132. package/src/prompt-injection.js +74 -74
  133. package/src/public-api.js +173 -173
  134. package/src/recommendation-rules.js +84 -84
  135. package/src/repo-archetype.js +386 -386
  136. package/src/secret-patterns.js +39 -39
  137. package/src/server.js +527 -527
  138. package/src/setup/analysis.js +607 -607
  139. package/src/setup/runtime.js +172 -172
  140. package/src/setup.js +677 -677
  141. package/src/shared/capabilities.js +194 -194
  142. package/src/source-urls.js +132 -132
  143. package/src/stack-checks.js +565 -565
  144. package/src/supplemental-checks.js +13 -13
  145. package/src/synergy/adaptive.js +261 -261
  146. package/src/synergy/compensation.js +137 -137
  147. package/src/synergy/evidence.js +193 -193
  148. package/src/synergy/learning.js +199 -199
  149. package/src/synergy/patterns.js +227 -227
  150. package/src/synergy/ranking.js +83 -83
  151. package/src/synergy/report.js +165 -165
  152. package/src/synergy/routing.js +146 -146
  153. package/src/techniques/api.js +407 -407
  154. package/src/techniques/automation.js +316 -316
  155. package/src/techniques/compliance.js +257 -257
  156. package/src/techniques/hygiene.js +294 -294
  157. package/src/techniques/instructions.js +243 -243
  158. package/src/techniques/observability.js +226 -226
  159. package/src/techniques/optimization.js +142 -142
  160. package/src/techniques/quality.js +318 -318
  161. package/src/techniques/security.js +237 -237
  162. package/src/techniques/shared.js +443 -443
  163. package/src/techniques/stacks.js +2294 -2294
  164. package/src/techniques/tools.js +106 -106
  165. package/src/techniques/workflow.js +413 -413
  166. package/src/techniques.js +81 -81
  167. package/src/terminology.js +73 -73
  168. package/src/token-estimate.js +35 -35
  169. package/src/usage-patterns.js +99 -99
  170. package/src/verification-metadata.js +145 -145
  171. package/src/watch.js +247 -247
  172. package/src/windsurf/activity.js +302 -302
  173. package/src/windsurf/config-parser.js +267 -267
  174. package/src/windsurf/context.js +120 -10
  175. package/src/windsurf/deep-review.js +337 -337
  176. package/src/windsurf/domain-packs.js +370 -370
  177. package/src/windsurf/freshness.js +36 -36
  178. package/src/windsurf/governance.js +231 -231
  179. package/src/windsurf/interactive.js +388 -388
  180. package/src/windsurf/mcp-packs.js +792 -792
  181. package/src/windsurf/plans.js +247 -247
  182. package/src/windsurf/premium.js +468 -468
  183. package/src/windsurf/setup.js +471 -471
  184. package/src/windsurf/techniques.js +155 -33
  185. package/src/workspace.js +375 -375
@@ -1,122 +1,122 @@
1
- /**
2
- * AI-generated fix prompts for checks without template auto-fixes.
3
- * Each key maps to a check key from techniques.js.
4
- * These prompts are designed to be copy-pasted into an AI coding agent.
5
- */
6
-
7
- const FIX_PROMPTS = {
8
- importSyntax:
9
- 'Refactor CLAUDE.md to use @path imports for modularity. Split large sections into separate files (e.g. @docs/coding-style.md, @docs/architecture.md) and reference them with @path syntax. Also consider using .claude/rules/ for path-specific rules.',
10
-
11
- underlines200:
12
- 'Refactor CLAUDE.md to be under 200 lines. Move detailed sections into separate files using @import or .claude/rules/ for path-specific rules. Keep only essential project overview, build commands, and key conventions in the main file.',
13
-
14
- verificationLoop:
15
- 'Add a verification section to CLAUDE.md with commands Claude should run after making changes. Include test, lint, and build commands. Example:\n\n## Verification\nAfter every change, run:\n- `npm test` to verify tests pass\n- `npm run lint` to check code style\n- `npm run build` to verify compilation',
16
-
17
- testCommand:
18
- 'Add an explicit test command to CLAUDE.md. Example: "Run `npm test` before committing." or "Run `pytest` to verify changes." Place it in a ## Commands or ## Verification section.',
19
-
20
- lintCommand:
21
- 'Add a lint command to CLAUDE.md so the AI agent auto-checks code style. Example: "Run `npm run lint` or `eslint .` before committing." Place it in a ## Commands section.',
22
-
23
- buildCommand:
24
- 'Add a build command to CLAUDE.md so the AI agent can verify compilation. Example: "Run `npm run build` or `tsc` to verify the project compiles." Place it in a ## Commands section.',
25
-
26
- settingsPermissions:
27
- 'Create or update .claude/settings.json with permission configuration. Add "permissions": { "allow": ["Read", "Write src/**"], "deny": ["Write .env", "Write **/secrets/**"] } to control which tools and paths the AI agent can access.',
28
-
29
- permissionDeny:
30
- 'Add deny rules to .claude/settings.json under permissions.deny to block dangerous operations. Example entries: "rm -rf /", "DROP TABLE", "Write .env", "Write **/*.pem", "Write **/secrets/**".',
31
-
32
- noBypassPermissions:
33
- 'Remove bypassPermissions from your .claude/settings.json defaultMode. Instead, use explicit allow rules in permissions.allow to grant only the access needed.',
34
-
35
- secretsProtection:
36
- 'Add permissions.deny rules in .claude/settings.json to block reading sensitive files. Add entries like: ".env", ".env.*", "**/.env", "**/*.pem", "**/secrets/**" to the deny array.',
37
-
38
- securityReview:
39
- 'Add a /security-review command or mention security review in CLAUDE.md. Create .claude/commands/security-review.md with: "Review the codebase for OWASP Top 10 vulnerabilities. Check for: SQL injection, XSS, CSRF, insecure dependencies, hardcoded secrets, and misconfigured permissions."',
40
-
41
- preToolUseHook:
42
- 'Add a PreToolUse hook in .claude/settings.json to validate tool calls before execution. Example: add a hook that blocks writes to protected files or validates file paths. See hooks documentation for the event schema.',
43
-
44
- postToolUseHook:
45
- 'Add a PostToolUse hook in .claude/settings.json for automated actions after tool calls. Example: auto-run linting after file writes, or validate output format after code generation.',
46
-
47
- sessionStartHook:
48
- 'Add a SessionStart hook in .claude/settings.json for initialization tasks. Example: load project state, rotate logs, or display a welcome message with project status at the start of each session.',
49
-
50
- deployCommand:
51
- 'Create .claude/commands/deploy.md with deployment instructions. Include: pre-deploy checks (tests, lint, build), deployment steps for your platform (Vercel, AWS, etc.), and post-deploy verification.',
52
-
53
- reviewCommand:
54
- 'Create .claude/commands/review.md with code review instructions. Include: check for security issues, verify test coverage, review naming conventions, check for code duplication, and validate error handling.',
55
-
56
- compactionAwareness:
57
- 'Add compaction guidance to CLAUDE.md. Add a line like: "Run /compact when context gets heavy or before large operations." This helps the AI agent manage its context window effectively.',
58
-
59
- contextManagement:
60
- 'Add context management tips to CLAUDE.md. Include: "Use /compact proactively at 70% capacity. Prefer targeted file reads over broad searches. Keep conversation focused on one task at a time."',
61
-
62
- mcpServers:
63
- 'Create .mcp.json at the project root to configure MCP servers. Example:\n{\n "mcpServers": {\n "memory": { "command": "npx", "args": ["-y", "@anthropic/mcp-memory"] }\n }\n}\nUse `claude mcp add <name>` to add servers interactively.',
64
-
65
- context7Mcp:
66
- 'Add the Context7 MCP server for real-time documentation lookup. Add to .mcp.json:\n"context7": { "command": "npx", "args": ["-y", "@anthropic/context7-mcp"] }\nThis provides always-up-to-date library documentation.',
67
-
68
- xmlTags:
69
- 'Add XML-tagged sections to CLAUDE.md for structured rules. Wrap critical rules in tags like <constraints>, <validation>, or <rules>. Example:\n<constraints>\n- Never modify package-lock.json manually\n- Always run tests before committing\n</constraints>',
70
-
71
- fewShotExamples:
72
- 'Add code examples to CLAUDE.md showing preferred patterns. Include 2-3 examples of your coding style: naming conventions, error handling patterns, file structure. Use fenced code blocks with the appropriate language tag.',
73
-
74
- roleDefinition:
75
- 'Add a role definition to the top of CLAUDE.md. Example: "You are a senior backend engineer working on a Node.js microservices platform. Prioritize type safety, comprehensive error handling, and test coverage."',
76
-
77
- constraintBlocks:
78
- 'Add XML constraint blocks to CLAUDE.md for critical rules. Wrap must-follow rules in <constraints> tags for ~40% better adherence. Example:\n<constraints>\n- Never delete database migrations\n- Always use parameterized queries\n- Run the full test suite before committing\n</constraints>',
79
-
80
- readme:
81
- 'Create a README.md with: project name and description, installation/setup instructions, usage examples, configuration options, and contribution guidelines.',
82
-
83
- changelog:
84
- 'Create a CHANGELOG.md following Keep a Changelog format. Include sections: Added, Changed, Deprecated, Removed, Fixed, Security. Start with your current version.',
85
-
86
- contributing:
87
- 'Create a CONTRIBUTING.md with: how to set up the dev environment, coding standards and style guide, pull request process, issue reporting guidelines, and code of conduct reference.',
88
-
89
- editorconfig:
90
- 'Create a .editorconfig file at the project root with consistent formatting rules:\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true',
91
-
92
- ciPipeline:
93
- 'Add a CI pipeline for automated testing. For GitHub Actions, create .github/workflows/ci.yml with steps: checkout, setup Node/Python, install dependencies, run lint, run tests, run build.',
94
-
95
- dockerfile:
96
- 'Create a Dockerfile for the project. Use a multi-stage build: stage 1 installs dependencies and builds, stage 2 copies only production artifacts. Use a slim base image and set a non-root user.',
97
-
98
- noSecretsInClaude:
99
- 'Remove any API keys, tokens, or secrets from CLAUDE.md. Replace them with environment variable references (e.g. $API_KEY or process.env.API_KEY). Store actual values in .env files that are gitignored.',
100
- };
101
-
102
- /**
103
- * Format a fix prompt for display in the terminal.
104
- */
105
- function formatFixPrompt(key, prompt) {
106
- const divider = '\u2500'.repeat(38);
107
- const lines = [
108
- '',
109
- ` No auto-fix for '${key}'. Here's a prompt for your AI agent:`,
110
- '',
111
- ` ${divider}`,
112
- ];
113
- for (const line of prompt.split('\n')) {
114
- lines.push(` ${line}`);
115
- }
116
- lines.push(` ${divider}`);
117
- lines.push('');
118
- lines.push(' Copy and paste this into Claude Code, Cursor, or your preferred AI agent.');
119
- return lines.join('\n');
120
- }
121
-
122
- module.exports = { FIX_PROMPTS, formatFixPrompt };
1
+ /**
2
+ * AI-generated fix prompts for checks without template auto-fixes.
3
+ * Each key maps to a check key from techniques.js.
4
+ * These prompts are designed to be copy-pasted into an AI coding agent.
5
+ */
6
+
7
+ const FIX_PROMPTS = {
8
+ importSyntax:
9
+ 'Refactor CLAUDE.md to use @path imports for modularity. Split large sections into separate files (e.g. @docs/coding-style.md, @docs/architecture.md) and reference them with @path syntax. Also consider using .claude/rules/ for path-specific rules.',
10
+
11
+ underlines200:
12
+ 'Refactor CLAUDE.md to be under 200 lines. Move detailed sections into separate files using @import or .claude/rules/ for path-specific rules. Keep only essential project overview, build commands, and key conventions in the main file.',
13
+
14
+ verificationLoop:
15
+ 'Add a verification section to CLAUDE.md with commands Claude should run after making changes. Include test, lint, and build commands. Example:\n\n## Verification\nAfter every change, run:\n- `npm test` to verify tests pass\n- `npm run lint` to check code style\n- `npm run build` to verify compilation',
16
+
17
+ testCommand:
18
+ 'Add an explicit test command to CLAUDE.md. Example: "Run `npm test` before committing." or "Run `pytest` to verify changes." Place it in a ## Commands or ## Verification section.',
19
+
20
+ lintCommand:
21
+ 'Add a lint command to CLAUDE.md so the AI agent auto-checks code style. Example: "Run `npm run lint` or `eslint .` before committing." Place it in a ## Commands section.',
22
+
23
+ buildCommand:
24
+ 'Add a build command to CLAUDE.md so the AI agent can verify compilation. Example: "Run `npm run build` or `tsc` to verify the project compiles." Place it in a ## Commands section.',
25
+
26
+ settingsPermissions:
27
+ 'Create or update .claude/settings.json with permission configuration. Add "permissions": { "allow": ["Read", "Write src/**"], "deny": ["Write .env", "Write **/secrets/**"] } to control which tools and paths the AI agent can access.',
28
+
29
+ permissionDeny:
30
+ 'Add deny rules to .claude/settings.json under permissions.deny to block dangerous operations. Example entries: "rm -rf /", "DROP TABLE", "Write .env", "Write **/*.pem", "Write **/secrets/**".',
31
+
32
+ noBypassPermissions:
33
+ 'Remove bypassPermissions from your .claude/settings.json defaultMode. Instead, use explicit allow rules in permissions.allow to grant only the access needed.',
34
+
35
+ secretsProtection:
36
+ 'Add permissions.deny rules in .claude/settings.json to block reading sensitive files. Add entries like: ".env", ".env.*", "**/.env", "**/*.pem", "**/secrets/**" to the deny array.',
37
+
38
+ securityReview:
39
+ 'Add a /security-review command or mention security review in CLAUDE.md. Create .claude/commands/security-review.md with: "Review the codebase for OWASP Top 10 vulnerabilities. Check for: SQL injection, XSS, CSRF, insecure dependencies, hardcoded secrets, and misconfigured permissions."',
40
+
41
+ preToolUseHook:
42
+ 'Add a PreToolUse hook in .claude/settings.json to validate tool calls before execution. Example: add a hook that blocks writes to protected files or validates file paths. See hooks documentation for the event schema.',
43
+
44
+ postToolUseHook:
45
+ 'Add a PostToolUse hook in .claude/settings.json for automated actions after tool calls. Example: auto-run linting after file writes, or validate output format after code generation.',
46
+
47
+ sessionStartHook:
48
+ 'Add a SessionStart hook in .claude/settings.json for initialization tasks. Example: load project state, rotate logs, or display a welcome message with project status at the start of each session.',
49
+
50
+ deployCommand:
51
+ 'Create .claude/commands/deploy.md with deployment instructions. Include: pre-deploy checks (tests, lint, build), deployment steps for your platform (Vercel, AWS, etc.), and post-deploy verification.',
52
+
53
+ reviewCommand:
54
+ 'Create .claude/commands/review.md with code review instructions. Include: check for security issues, verify test coverage, review naming conventions, check for code duplication, and validate error handling.',
55
+
56
+ compactionAwareness:
57
+ 'Add compaction guidance to CLAUDE.md. Add a line like: "Run /compact when context gets heavy or before large operations." This helps the AI agent manage its context window effectively.',
58
+
59
+ contextManagement:
60
+ 'Add context management tips to CLAUDE.md. Include: "Use /compact proactively at 70% capacity. Prefer targeted file reads over broad searches. Keep conversation focused on one task at a time."',
61
+
62
+ mcpServers:
63
+ 'Create .mcp.json at the project root to configure MCP servers. Example:\n{\n "mcpServers": {\n "memory": { "command": "npx", "args": ["-y", "@anthropic/mcp-memory"] }\n }\n}\nUse `claude mcp add <name>` to add servers interactively.',
64
+
65
+ context7Mcp:
66
+ 'Add the Context7 MCP server for real-time documentation lookup. Add to .mcp.json:\n"context7": { "command": "npx", "args": ["-y", "@anthropic/context7-mcp"] }\nThis provides always-up-to-date library documentation.',
67
+
68
+ xmlTags:
69
+ 'Add XML-tagged sections to CLAUDE.md for structured rules. Wrap critical rules in tags like <constraints>, <validation>, or <rules>. Example:\n<constraints>\n- Never modify package-lock.json manually\n- Always run tests before committing\n</constraints>',
70
+
71
+ fewShotExamples:
72
+ 'Add code examples to CLAUDE.md showing preferred patterns. Include 2-3 examples of your coding style: naming conventions, error handling patterns, file structure. Use fenced code blocks with the appropriate language tag.',
73
+
74
+ roleDefinition:
75
+ 'Add a role definition to the top of CLAUDE.md. Example: "You are a senior backend engineer working on a Node.js microservices platform. Prioritize type safety, comprehensive error handling, and test coverage."',
76
+
77
+ constraintBlocks:
78
+ 'Add XML constraint blocks to CLAUDE.md for critical rules. Wrap must-follow rules in <constraints> tags for ~40% better adherence. Example:\n<constraints>\n- Never delete database migrations\n- Always use parameterized queries\n- Run the full test suite before committing\n</constraints>',
79
+
80
+ readme:
81
+ 'Create a README.md with: project name and description, installation/setup instructions, usage examples, configuration options, and contribution guidelines.',
82
+
83
+ changelog:
84
+ 'Create a CHANGELOG.md following Keep a Changelog format. Include sections: Added, Changed, Deprecated, Removed, Fixed, Security. Start with your current version.',
85
+
86
+ contributing:
87
+ 'Create a CONTRIBUTING.md with: how to set up the dev environment, coding standards and style guide, pull request process, issue reporting guidelines, and code of conduct reference.',
88
+
89
+ editorconfig:
90
+ 'Create a .editorconfig file at the project root with consistent formatting rules:\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true',
91
+
92
+ ciPipeline:
93
+ 'Add a CI pipeline for automated testing. For GitHub Actions, create .github/workflows/ci.yml with steps: checkout, setup Node/Python, install dependencies, run lint, run tests, run build.',
94
+
95
+ dockerfile:
96
+ 'Create a Dockerfile for the project. Use a multi-stage build: stage 1 installs dependencies and builds, stage 2 copies only production artifacts. Use a slim base image and set a non-root user.',
97
+
98
+ noSecretsInClaude:
99
+ 'Remove any API keys, tokens, or secrets from CLAUDE.md. Replace them with environment variable references (e.g. $API_KEY or process.env.API_KEY). Store actual values in .env files that are gitignored.',
100
+ };
101
+
102
+ /**
103
+ * Format a fix prompt for display in the terminal.
104
+ */
105
+ function formatFixPrompt(key, prompt) {
106
+ const divider = '\u2500'.repeat(38);
107
+ const lines = [
108
+ '',
109
+ ` No auto-fix for '${key}'. Here's a prompt for your AI agent:`,
110
+ '',
111
+ ` ${divider}`,
112
+ ];
113
+ for (const line of prompt.split('\n')) {
114
+ lines.push(` ${line}`);
115
+ }
116
+ lines.push(` ${divider}`);
117
+ lines.push('');
118
+ lines.push(' Copy and paste this into Claude Code, Cursor, or your preferred AI agent.');
119
+ return lines.join('\n');
120
+ }
121
+
122
+ module.exports = { FIX_PROMPTS, formatFixPrompt };
@@ -1,115 +1,115 @@
1
- const path = require('path');
2
- const { version } = require('../../package.json');
3
-
4
- function levelFromImpact(impact) {
5
- if (impact === 'critical') return 'error';
6
- if (impact === 'high') return 'warning';
7
- return 'note';
8
- }
9
-
10
- function sanitizeUri(filePath) {
11
- if (!filePath) return null;
12
- return filePath.split(path.sep).join('/');
13
- }
14
-
15
- function buildRule(result) {
16
- return {
17
- id: result.id || result.key,
18
- name: result.key,
19
- shortDescription: { text: result.name },
20
- fullDescription: { text: result.fix || result.name },
21
- properties: {
22
- category: result.category,
23
- impact: result.impact,
24
- template: result.template || null,
25
- },
26
- };
27
- }
28
-
29
- function buildSarifResult(result, runRoot = '.') {
30
- const sarifResult = {
31
- ruleId: result.id || result.key,
32
- level: levelFromImpact(result.impact),
33
- message: {
34
- text: result.fix || result.name,
35
- },
36
- properties: {
37
- checkKey: result.key,
38
- category: result.category,
39
- impact: result.impact,
40
- passed: result.passed,
41
- platform: result.platform || null,
42
- },
43
- };
44
-
45
- if (result.file) {
46
- sarifResult.locations = [{
47
- physicalLocation: {
48
- artifactLocation: {
49
- uri: sanitizeUri(result.file),
50
- uriBaseId: '%SRCROOT%',
51
- },
52
- region: result.line ? { startLine: result.line } : undefined,
53
- },
54
- }];
55
- }
56
-
57
- if (runRoot) {
58
- sarifResult.properties.runRoot = sanitizeUri(runRoot);
59
- }
60
-
61
- return sarifResult;
62
- }
63
-
64
- function formatSarif(auditResult, options = {}) {
65
- const failedResults = (auditResult.results || [])
66
- .filter((result) => result.passed === false);
67
-
68
- const rules = [];
69
- const seenRuleIds = new Set();
70
- for (const result of failedResults) {
71
- const ruleId = result.id || result.key;
72
- if (seenRuleIds.has(ruleId)) continue;
73
- seenRuleIds.add(ruleId);
74
- rules.push(buildRule(result));
75
- }
76
-
77
- return {
78
- version: '2.1.0',
79
- $schema: 'https://json.schemastore.org/sarif-2.1.0.json',
80
- runs: [{
81
- tool: {
82
- driver: {
83
- name: 'nerviq',
84
- version,
85
- informationUri: 'https://github.com/nerviq/nerviq',
86
- rules,
87
- },
88
- },
89
- automationDetails: {
90
- id: auditResult.platform || 'claude',
91
- },
92
- properties: {
93
- platform: auditResult.platform,
94
- platformLabel: auditResult.platformLabel,
95
- platformVersion: auditResult.platformVersion || null,
96
- score: auditResult.score,
97
- organicScore: auditResult.organicScore,
98
- passed: auditResult.passed,
99
- failed: auditResult.failed,
100
- skipped: auditResult.skipped,
101
- checkCount: auditResult.checkCount,
102
- },
103
- originalUriBaseIds: {
104
- '%SRCROOT%': {
105
- uri: sanitizeUri(options.dir || '.'),
106
- },
107
- },
108
- results: failedResults.map((result) => buildSarifResult(result, options.dir || '.')),
109
- }],
110
- };
111
- }
112
-
113
- module.exports = {
114
- formatSarif,
115
- };
1
+ const path = require('path');
2
+ const { version } = require('../../package.json');
3
+
4
+ function levelFromImpact(impact) {
5
+ if (impact === 'critical') return 'error';
6
+ if (impact === 'high') return 'warning';
7
+ return 'note';
8
+ }
9
+
10
+ function sanitizeUri(filePath) {
11
+ if (!filePath) return null;
12
+ return filePath.split(path.sep).join('/');
13
+ }
14
+
15
+ function buildRule(result) {
16
+ return {
17
+ id: result.id || result.key,
18
+ name: result.key,
19
+ shortDescription: { text: result.name },
20
+ fullDescription: { text: result.fix || result.name },
21
+ properties: {
22
+ category: result.category,
23
+ impact: result.impact,
24
+ template: result.template || null,
25
+ },
26
+ };
27
+ }
28
+
29
+ function buildSarifResult(result, runRoot = '.') {
30
+ const sarifResult = {
31
+ ruleId: result.id || result.key,
32
+ level: levelFromImpact(result.impact),
33
+ message: {
34
+ text: result.fix || result.name,
35
+ },
36
+ properties: {
37
+ checkKey: result.key,
38
+ category: result.category,
39
+ impact: result.impact,
40
+ passed: result.passed,
41
+ platform: result.platform || null,
42
+ },
43
+ };
44
+
45
+ if (result.file) {
46
+ sarifResult.locations = [{
47
+ physicalLocation: {
48
+ artifactLocation: {
49
+ uri: sanitizeUri(result.file),
50
+ uriBaseId: '%SRCROOT%',
51
+ },
52
+ region: result.line ? { startLine: result.line } : undefined,
53
+ },
54
+ }];
55
+ }
56
+
57
+ if (runRoot) {
58
+ sarifResult.properties.runRoot = sanitizeUri(runRoot);
59
+ }
60
+
61
+ return sarifResult;
62
+ }
63
+
64
+ function formatSarif(auditResult, options = {}) {
65
+ const failedResults = (auditResult.results || [])
66
+ .filter((result) => result.passed === false);
67
+
68
+ const rules = [];
69
+ const seenRuleIds = new Set();
70
+ for (const result of failedResults) {
71
+ const ruleId = result.id || result.key;
72
+ if (seenRuleIds.has(ruleId)) continue;
73
+ seenRuleIds.add(ruleId);
74
+ rules.push(buildRule(result));
75
+ }
76
+
77
+ return {
78
+ version: '2.1.0',
79
+ $schema: 'https://json.schemastore.org/sarif-2.1.0.json',
80
+ runs: [{
81
+ tool: {
82
+ driver: {
83
+ name: 'nerviq',
84
+ version,
85
+ informationUri: 'https://github.com/nerviq/nerviq',
86
+ rules,
87
+ },
88
+ },
89
+ automationDetails: {
90
+ id: auditResult.platform || 'claude',
91
+ },
92
+ properties: {
93
+ platform: auditResult.platform,
94
+ platformLabel: auditResult.platformLabel,
95
+ platformVersion: auditResult.platformVersion || null,
96
+ score: auditResult.score,
97
+ organicScore: auditResult.organicScore,
98
+ passed: auditResult.passed,
99
+ failed: auditResult.failed,
100
+ skipped: auditResult.skipped,
101
+ checkCount: auditResult.checkCount,
102
+ },
103
+ originalUriBaseIds: {
104
+ '%SRCROOT%': {
105
+ uri: sanitizeUri(options.dir || '.'),
106
+ },
107
+ },
108
+ results: failedResults.map((result) => buildSarifResult(result, options.dir || '.')),
109
+ }],
110
+ };
111
+ }
112
+
113
+ module.exports = {
114
+ formatSarif,
115
+ };
package/src/freshness.js CHANGED
@@ -4,8 +4,8 @@
4
4
  * Release gates, recurring probes, propagation checklists,
5
5
  * and staleness blocking for Claude Code surfaces.
6
6
  *
7
- * P0 sources from code.claude.com/docs and official Anthropic launch posts,
8
- * with propagation for CLAUDE.md, output style, and agent harness changes.
7
+ * P0 sources from code.claude.com/docs and official Anthropic launch posts,
8
+ * with propagation for CLAUDE.md, output style, and agent harness changes.
9
9
  */
10
10
 
11
11
  const { version } = require('../package.json');
@@ -56,46 +56,46 @@ const P0_SOURCES = [
56
56
  stalenessThresholdDays: 14,
57
57
  verifiedAt: '2026-04-07',
58
58
  },
59
- {
60
- key: 'claude-settings-docs',
61
- label: 'Claude Code Settings Documentation',
62
- url: 'https://code.claude.com/docs/en/settings',
63
- stalenessThresholdDays: 30,
64
- verifiedAt: '2026-04-07',
65
- },
66
- {
67
- key: 'claude-output-styles-docs',
68
- label: 'Claude Code Output Styles / Insights',
69
- url: 'https://code.claude.com/docs/en/output-styles',
70
- stalenessThresholdDays: 14,
71
- verifiedAt: '2026-04-10',
72
- },
73
- {
74
- key: 'claude-best-practices-docs',
75
- label: 'Claude Code Best Practices / Auto Mode',
76
- url: 'https://code.claude.com/docs/en/best-practices',
77
- stalenessThresholdDays: 14,
78
- verifiedAt: '2026-04-10',
79
- },
80
- {
81
- key: 'claude-agent-sdk-docs',
82
- label: 'Claude Agent SDK Overview',
83
- url: 'https://code.claude.com/docs/en/agent-sdk/overview',
84
- stalenessThresholdDays: 14,
85
- verifiedAt: '2026-04-10',
86
- },
87
- {
88
- key: 'claude-xcode-agent-sdk',
89
- label: 'Anthropic Xcode Agent SDK Launch',
90
- url: 'https://www.anthropic.com/news/apple-xcode-claude-agent-sdk',
91
- stalenessThresholdDays: 30,
92
- verifiedAt: '2026-04-10',
93
- },
94
- {
95
- key: 'anthropic-changelog',
96
- label: 'Claude Code Changelog',
97
- url: 'https://code.claude.com/docs/en/changelog',
98
- stalenessThresholdDays: 14,
59
+ {
60
+ key: 'claude-settings-docs',
61
+ label: 'Claude Code Settings Documentation',
62
+ url: 'https://code.claude.com/docs/en/settings',
63
+ stalenessThresholdDays: 30,
64
+ verifiedAt: '2026-04-07',
65
+ },
66
+ {
67
+ key: 'claude-output-styles-docs',
68
+ label: 'Claude Code Output Styles / Insights',
69
+ url: 'https://code.claude.com/docs/en/output-styles',
70
+ stalenessThresholdDays: 14,
71
+ verifiedAt: '2026-04-10',
72
+ },
73
+ {
74
+ key: 'claude-best-practices-docs',
75
+ label: 'Claude Code Best Practices / Auto Mode',
76
+ url: 'https://code.claude.com/docs/en/best-practices',
77
+ stalenessThresholdDays: 14,
78
+ verifiedAt: '2026-04-10',
79
+ },
80
+ {
81
+ key: 'claude-agent-sdk-docs',
82
+ label: 'Claude Agent SDK Overview',
83
+ url: 'https://code.claude.com/docs/en/agent-sdk/overview',
84
+ stalenessThresholdDays: 14,
85
+ verifiedAt: '2026-04-10',
86
+ },
87
+ {
88
+ key: 'claude-xcode-agent-sdk',
89
+ label: 'Anthropic Xcode Agent SDK Launch',
90
+ url: 'https://www.anthropic.com/news/apple-xcode-claude-agent-sdk',
91
+ stalenessThresholdDays: 30,
92
+ verifiedAt: '2026-04-10',
93
+ },
94
+ {
95
+ key: 'anthropic-changelog',
96
+ label: 'Claude Code Changelog',
97
+ url: 'https://code.claude.com/docs/en/changelog',
98
+ stalenessThresholdDays: 14,
99
99
  verifiedAt: '2026-04-07',
100
100
  },
101
101
  ];
@@ -127,38 +127,38 @@ const PROPAGATION_CHECKLIST = [
127
127
  'src/context.js — update mcpConfig parsing',
128
128
  ],
129
129
  },
130
- {
131
- trigger: 'Permissions model change (allow/deny lists, operator/user split)',
132
- targets: [
133
- 'src/governance.js — update permissionProfiles',
134
- 'src/techniques.js — update permission checks',
135
- ],
136
- },
137
- {
138
- trigger: 'Output style / Insights change (system prompt layering, outputStyle storage, learning mode behavior)',
139
- targets: [
140
- 'src/techniques.js — update Claude settings and instruction-surface checks that depend on system-prompt-adjacent behavior',
141
- 'src/setup.js — update Claude settings starter templates if outputStyle guidance changes',
142
- 'src/source-urls.js — refresh Claude feature source mappings when output style docs move or split',
143
- ],
144
- },
145
- {
146
- trigger: 'Best-practices or auto mode change (permission classifier, unattended mode, safety fallback behavior)',
147
- targets: [
148
- 'src/governance.js — update permission mode caveats and policy guidance',
149
- 'src/techniques.js — update Claude trust/verification checks tied to auto mode or unattended workflows',
150
- 'src/source-urls.js — refresh Claude best-practice source mappings if guidance moves',
151
- ],
152
- },
153
- {
154
- trigger: 'Agent SDK / harness or native integration change (SDK surfaces, subagents, background tasks, Xcode bridge)',
155
- targets: [
156
- 'src/techniques.js — update Claude modern-capability checks and cross-surface expectations',
157
- 'src/mcp-packs.js — revisit pack assumptions when native integrations change MCP usage',
158
- 'src/source-urls.js — refresh Claude source mappings for SDK and integration surfaces',
159
- ],
160
- },
161
- ];
130
+ {
131
+ trigger: 'Permissions model change (allow/deny lists, operator/user split)',
132
+ targets: [
133
+ 'src/governance.js — update permissionProfiles',
134
+ 'src/techniques.js — update permission checks',
135
+ ],
136
+ },
137
+ {
138
+ trigger: 'Output style / Insights change (system prompt layering, outputStyle storage, learning mode behavior)',
139
+ targets: [
140
+ 'src/techniques.js — update Claude settings and instruction-surface checks that depend on system-prompt-adjacent behavior',
141
+ 'src/setup.js — update Claude settings starter templates if outputStyle guidance changes',
142
+ 'src/source-urls.js — refresh Claude feature source mappings when output style docs move or split',
143
+ ],
144
+ },
145
+ {
146
+ trigger: 'Best-practices or auto mode change (permission classifier, unattended mode, safety fallback behavior)',
147
+ targets: [
148
+ 'src/governance.js — update permission mode caveats and policy guidance',
149
+ 'src/techniques.js — update Claude trust/verification checks tied to auto mode or unattended workflows',
150
+ 'src/source-urls.js — refresh Claude best-practice source mappings if guidance moves',
151
+ ],
152
+ },
153
+ {
154
+ trigger: 'Agent SDK / harness or native integration change (SDK surfaces, subagents, background tasks, Xcode bridge)',
155
+ targets: [
156
+ 'src/techniques.js — update Claude modern-capability checks and cross-surface expectations',
157
+ 'src/mcp-packs.js — revisit pack assumptions when native integrations change MCP usage',
158
+ 'src/source-urls.js — refresh Claude source mappings for SDK and integration surfaces',
159
+ ],
160
+ },
161
+ ];
162
162
 
163
163
  /**
164
164
  * Release gate: check if all P0 sources are within staleness threshold.