@nerviq/cli 1.27.0 → 1.27.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 (43) hide show
  1. package/CHANGELOG.md +1407 -0
  2. package/README.md +2 -2
  3. package/SECURITY.md +82 -0
  4. package/contracts/audit-webhook-event.schema.json +138 -0
  5. package/contracts/pack-contract.schema.json +15 -0
  6. package/contracts/technique-contract.schema.json +18 -0
  7. package/docs/ARCHITECTURE.md +74 -0
  8. package/docs/api-reference.md +356 -0
  9. package/docs/autofix.md +64 -0
  10. package/docs/bitbucket-pipe.yml +57 -0
  11. package/docs/case-studies.md +149 -0
  12. package/docs/category-definition-kit.md +56 -0
  13. package/docs/ci-integration.md +127 -0
  14. package/docs/claude-code-style.md +24 -0
  15. package/docs/claude-maintainer-ops.md +19 -0
  16. package/docs/external-validation.md +78 -0
  17. package/docs/first-tier-integration-gate.md +59 -0
  18. package/docs/getting-started.md +119 -0
  19. package/docs/gitlab-ci-template.yml +54 -0
  20. package/docs/index.html +597 -0
  21. package/docs/integration-contracts.md +287 -0
  22. package/docs/license-faq.md +53 -0
  23. package/docs/maintenance.md +155 -0
  24. package/docs/methodology.md +236 -0
  25. package/docs/new-platform-guide.md +202 -0
  26. package/docs/open-vsx-publishing.md +46 -0
  27. package/docs/platform-change-ingestion.md +46 -0
  28. package/docs/plugins.md +101 -0
  29. package/docs/pre-commit.md +58 -0
  30. package/docs/security-model.md +63 -0
  31. package/docs/shallow-risk.md +246 -0
  32. package/docs/versioning-policy.md +63 -0
  33. package/docs/why-nerviq.md +82 -0
  34. package/package.json +7 -2
  35. package/sdk/README.md +190 -0
  36. package/src/codex/setup.js +3 -2
  37. package/src/gemini/setup.js +3 -2
  38. package/src/init.js +4 -3
  39. package/src/opencode/context.js +42 -3
  40. package/src/opencode/techniques.js +198 -142
  41. package/src/output-icons.js +44 -0
  42. package/src/setup/runtime.js +6 -5
  43. package/src/setup.js +4 -3
@@ -0,0 +1,236 @@
1
+ # How Nerviq Verifies 2,441 Checks (~300 Governance Rules × 8 Platforms)
2
+
3
+ ## Overview
4
+
5
+ Nerviq is a rule-based audit engine for AI coding agent configurations with evidence tracking. Every check we ship is traceable to primary documentation or verified experiment results. Checks are structured assertions backed by official vendor docs, runtime experiments, and continuous feedback calibration — but they are rules, not AI-generated insights.
6
+
7
+ This document explains the full lifecycle: how checks are created, verified, rated, maintained, and retired.
8
+
9
+ ## Check Anatomy
10
+
11
+ Each check in the Nerviq catalog is a structured object with these fields:
12
+
13
+ | Field | Type | Description |
14
+ |-------|------|-------------|
15
+ | `id` | `string` | Unique identifier following the `{CATEGORY}-{SEQUENCE}` pattern (e.g., `CU-A01`, `SC-B14`, `AU-C03`) |
16
+ | `name` | `string` | Human-readable description of what the check detects |
17
+ | `check(ctx)` | `function` | Detection function that inspects the `ProjectContext` and returns `true`, `false`, or `null` |
18
+ | `impact` | `enum` | Severity level: `critical`, `high`, or `medium` |
19
+ | `confidence` | `number` | Score from 0.0 to 1.0 reflecting certainty that this check is accurate and current |
20
+ | `sourceUrl` | `string` | URL pointing to the official documentation backing this check |
21
+ | `category` | `string` | One of 96 categories (e.g., `memory`, `security`, `quality`, `automation`, `hooks`) |
22
+ | `fix` | `string` | Actionable remediation guidance shown when the check fails |
23
+
24
+ ### Return values
25
+
26
+ The `check(ctx)` function receives a `ProjectContext` — a normalized view of the project's files, configuration, and environment. It returns:
27
+
28
+ - `true` — the practice is present (pass)
29
+ - `false` — the practice is missing (finding)
30
+ - `null` — the check is not applicable to this project (e.g., a Node.js check in a Python project)
31
+
32
+ Checks are keyed by a stable string identifier (e.g., `claudeMd`, `permissionDeny`, `codexAgentsMd`) that remains consistent across versions. This enables feedback tracking and trend analysis over time.
33
+
34
+ ## Verification Levels
35
+
36
+ Every check is assigned a confidence score that maps to one of three verification levels:
37
+
38
+ ### HIGH confidence (0.7–1.0)
39
+
40
+ The check is backed by official platform documentation **and** has been validated through a runtime experiment. A maintainer executed the check logic against real project fixtures and observed the expected outcome.
41
+
42
+ | Condition | Score |
43
+ |-----------|-------|
44
+ | Runtime-verified with passing experiment and test coverage | **0.9** |
45
+ | Community-confirmed (positive feedback rate > 80%) | **0.9** |
46
+ | Documented in official vendor docs, not yet runtime-tested | **0.7** |
47
+
48
+ This tier covers approximately 65% of the catalog. These checks appear as primary recommendations in audit output.
49
+
50
+ ### MEDIUM confidence (0.4–0.69)
51
+
52
+ The check is backed by official documentation or established community best practice, but has not been independently verified through a runtime experiment. Common reasons: the platform feature is too new for full experiment coverage, or the check logic relies on behavioral observations that are difficult to isolate in a fixture.
53
+
54
+ | Condition | Score |
55
+ |-----------|-------|
56
+ | Disputed (negative feedback rate > 50%) | **0.5** |
57
+ | Documented but not yet experiment-verified | **0.5** |
58
+
59
+ These checks appear in audit output but are ranked below HIGH-confidence checks at the same impact level.
60
+
61
+ ### HEURISTIC (0.0–0.39)
62
+
63
+ Pattern-based detection that may produce false positives. These checks infer configuration quality from indirect signals (file size, naming patterns, structural heuristics) rather than direct feature detection.
64
+
65
+ | Condition | Score |
66
+ |-----------|-------|
67
+ | Stale — not re-verified within 90 days | **0.3** |
68
+ | Pattern-based with no direct documentation backing | **0.2** |
69
+
70
+ Heuristic checks are never promoted to "recommended" status. They appear in verbose audit output and are clearly labeled.
71
+
72
+ ## The 5-Layer Evidence Chain
73
+
74
+ Every check passes through five layers before reaching users:
75
+
76
+ ### Layer 1 — Official Source
77
+
78
+ Each check starts with an official documentation reference. The `sourceUrl` field links directly to the platform vendor's docs (Anthropic, OpenAI, Google, GitHub, Cursor, Windsurf, Aider, OpenCode). No check exists without a traceable origin.
79
+
80
+ ### Layer 2 — Research Memo
81
+
82
+ Findings from official sources are documented in structured research memos following the Anthropic-recommended research methodology: explore from multiple angles, form competing hypotheses, triangulate across independent sources, extract quotes before analyzing, identify gaps and contradictions, integrate with confidence levels, and self-critique.
83
+
84
+ **448+ research documents** feed the current check catalog.
85
+
86
+ ### Layer 3 — Runtime Experiment
87
+
88
+ Claims are tested in real project environments. Each experiment runs actual check logic against controlled fixtures — real directory structures, real configuration files, real tool outputs. Nothing is marked as verified without executing it and observing the output.
89
+
90
+ **332+ experiments across 8 platforms** with real runtime evidence.
91
+
92
+ ### Layer 4 — Check Implementation
93
+
94
+ The verified finding becomes a `check(ctx)` function operating on `ProjectContext`. The function is deterministic: same project state produces the same result.
95
+
96
+ ### Layer 5 — Test Coverage
97
+
98
+ Every check is covered by matrix tests that verify correct behavior across project shapes. Golden matrices lock expected pass/fail outcomes so regressions are caught immediately. Platform-specific matrices ensure cross-platform correctness.
99
+
100
+ ## Freshness Cycle
101
+
102
+ Stale checks are worse than missing checks — they create false confidence. Nerviq enforces a 90-day verification window.
103
+
104
+ ### 90-Day Rule
105
+
106
+ Every check has a `lastVerified` date. Any check not re-verified within 90 days is marked stale. Stale checks:
107
+
108
+ - Have their confidence score reduced to **0.3** (HEURISTIC tier)
109
+ - Are flagged in audit output with a staleness warning
110
+ - Are blocked from appearing as top recommendations until re-verified
111
+
112
+ ### Daily Changelog Watch
113
+
114
+ A CI cron job monitors platform changelogs and release notes. When a platform ships a breaking change or deprecation, affected checks are flagged for immediate review — they do not wait for the 90-day window.
115
+
116
+ ### Staleness Blocking
117
+
118
+ Stale checks cannot graduate to "recommended" status. They remain in the catalog for completeness but are deprioritized in all ranking algorithms until a maintainer re-verifies them against current platform behavior.
119
+
120
+ ## False Positive Management
121
+
122
+ False positives erode trust. Nerviq has a structured feedback loop to catch and suppress them.
123
+
124
+ ### Reporting
125
+
126
+ Users report whether a finding was helpful or not via the CLI:
127
+
128
+ ```
129
+ npx nerviq feedback --key <checkKey> --status rejected --effect negative
130
+ ```
131
+
132
+ Feedback is stored locally in `.nerviq/outcomes/` and aggregated per check key.
133
+
134
+ ### Confidence Calibration
135
+
136
+ Feedback data flows directly into confidence scoring:
137
+
138
+ - Checks with **>80% positive feedback** receive a confidence boost (up to +0.1)
139
+ - Checks with **>50% negative feedback** receive a confidence reduction (down to 0.5)
140
+ - Checks exceeding **30% "not helpful" rate** are deprioritized in recommendations
141
+
142
+ ### Feedback-Aware Ranking
143
+
144
+ The `getRecommendationAdjustment` function computes a bounded adjustment (plus or minus 8 points) based on:
145
+
146
+ - Accepted vs. rejected outcomes
147
+ - Positive vs. negative effect ratings
148
+ - Average score delta from before/after measurements
149
+
150
+ This adjustment feeds into `topNextActions` and `quickWins` ranking, so recommendations improve with use.
151
+
152
+ ## Platform Coverage
153
+
154
+ Nerviq covers 8 AI coding agent platforms:
155
+
156
+ | Platform | Config Detection | Check Count |
157
+ |----------|-----------------|-------------|
158
+ | Claude Code | `CLAUDE.md`, `.claude/` | ~500 |
159
+ | GitHub Copilot | `.github/copilot-instructions.md` | ~350 |
160
+ | Cursor | `.cursor/rules/`, `.cursorrules` | ~350 |
161
+ | Windsurf | `.windsurfrules`, `.windsurf/` | ~300 |
162
+ | OpenAI Codex | `agents.md`, `AGENTS.md` | ~280 |
163
+ | Google Gemini | `.gemini/` | ~250 |
164
+ | Aider | `.aider.conf.yml`, `.aiderignore` | ~200 |
165
+ | OpenCode | `opencode.json` | ~200 |
166
+
167
+ Each platform has a dedicated context class that reads the correct config files and normalizes them into the shared `ProjectContext` interface. Platform-specific checks target a single platform. Cross-platform checks run through the **Harmony module**, which identifies practices that apply regardless of which agent a team uses (e.g., having a project instructions file, ignoring secrets, defining coding standards).
168
+
169
+ ## How Checks Are Added
170
+
171
+ New checks follow a strict pipeline from research to production:
172
+
173
+ ```
174
+ Research → Hypothesis → Experiment → Verify → Catalog → Implement
175
+ ```
176
+
177
+ ### Step-by-step
178
+
179
+ 1. **Research** — A platform changelog, documentation update, or community report identifies a potential new check. The finding is documented in a research memo with source URLs.
180
+
181
+ 2. **Hypothesis** — The researcher formulates what the check should detect and what impact level it warrants. At least 3 competing hypotheses are considered before committing to an approach.
182
+
183
+ 3. **Experiment** — The check logic is implemented as a standalone experiment and run against real project fixtures. The experiment must produce observable output.
184
+
185
+ 4. **Verify** — Results are reviewed. If the experiment passes, the check is marked as runtime-verified. If it fails or produces ambiguous results, it returns to research.
186
+
187
+ 5. **Catalog** — The verified check is added to the internal catalog with all required fields: `id`, `name`, `check`, `impact`, `confidence`, `sourceUrl`, `category`, `fix`.
188
+
189
+ 6. **Implement** — The cataloged check is implemented in the CLI audit engine and covered by matrix tests.
190
+
191
+ ### Minimum requirements for a new check
192
+
193
+ - `sourceUrl` pointing to official documentation or a verifiable primary source
194
+ - Minimum confidence score of **0.5** (no HEURISTIC-tier checks ship by default)
195
+ - At least one passing fixture test
196
+ - Assigned `impact` level with written justification
197
+ - `fix` text that gives the user a concrete next step
198
+
199
+ ## Plugin Extension
200
+
201
+ The check catalog is extensible. Any project can add custom checks by placing plugin modules in a configured directory. Plugins:
202
+
203
+ 1. Export an object of technique definitions matching the standard check structure
204
+ 2. Are loaded at audit time via `loadPlugins()` and merged into the active technique set
205
+ 3. Follow the same scoring, ranking, and feedback rules as built-in checks
206
+ 4. Can target any platform or be platform-agnostic
207
+
208
+ This allows organizations to enforce internal standards using the same rule-based audit infrastructure with evidence tracking.
209
+
210
+ ## Transparency
211
+
212
+ Every check has a `sourceUrl` pointing to official vendor documentation. This means:
213
+
214
+ - Users can verify any finding by clicking through to the source
215
+ - Disputed checks can be resolved by comparing the check logic against current docs
216
+ - The audit is not a black box — it is a structured interpretation of documented best practices
217
+
218
+ ## Summary
219
+
220
+ | Metric | Value |
221
+ |--------|-------|
222
+ | Total checks | **2,441** (~300 unique rules × 8 platforms) |
223
+ | Platforms covered | **8** |
224
+ | Categories | **96** |
225
+ | Stack-specific languages | **10** |
226
+ | Research documents | **448+** |
227
+ | Runtime experiments | **332+** |
228
+ | Domain packs | **62** |
229
+ | Impact levels | 3 (critical, high, medium) |
230
+ | Confidence range | 0.0–1.0 |
231
+ | Freshness window | 90 days |
232
+ | Feedback tracking | Per-check, per-project, with trend analysis |
233
+
234
+ ---
235
+
236
+ *This methodology is maintained as part of the Nerviq project. For implementation details, see the source code in `src/audit.js`, `src/activity.js`, `src/feedback.js`, and `src/freshness.js`.*
@@ -0,0 +1,202 @@
1
+ # New Platform Onboarding Guide
2
+
3
+ How to add a new AI coding platform to Nerviq.
4
+
5
+ ## Overview
6
+
7
+ Each platform in Nerviq follows a standardized structure with 14 source modules, dedicated tests, research documentation, and integration points. This guide walks through every step required to bring a new platform from zero to full parity.
8
+
9
+ ## Prerequisites
10
+
11
+ - Access to the platform's official documentation
12
+ - A test project configured for the platform
13
+ - Familiarity with Nerviq's audit engine (`src/audit.js`)
14
+
15
+ ## Step 1: Research Phase
16
+
17
+ Before writing code, produce the research deliverables:
18
+
19
+ 1. **Platform Research Doc** — `research/{platform}-platform-research-v1-YYYY-MM-DD.md`
20
+ - Architecture, config file formats, CLI commands, extension points
21
+ - Minimum 5 queries from different angles (Anthropic research protocol)
22
+ - Confidence levels for every claim
23
+
24
+ 2. **Gap Matrix** — `research/nerviq-{platform}-full-gap-matrix-YYYY-MM-DD.md`
25
+ - Compare platform capabilities against Claude Code baseline
26
+ - Identify all gaps and parity opportunities
27
+
28
+ 3. **Build Plan** — `research/nerviq-for-{platform}-build-plan-v3-final-YYYY-MM-DD.md`
29
+ - Phased implementation plan with deliverables per phase
30
+ - Dependencies and risk assessment
31
+
32
+ 4. **Parity Closure Plan** — `research/nerviq-{platform}-parity-closure-plan-v1-YYYY-MM-DD.md`
33
+ - Specific steps to close each identified gap
34
+
35
+ ## Step 2: Create Platform Source Modules
36
+
37
+ Create the directory `src/{platform}/` with these 14 required modules:
38
+
39
+ | # | File | Purpose |
40
+ |---|------|---------|
41
+ | 1 | `techniques.js` | Check definitions (id, name, check function, impact, category, fix) |
42
+ | 2 | `config-parser.js` | Parse platform-specific config files |
43
+ | 3 | `context.js` | `{Platform}ProjectContext` class with `is{Platform}Repo(dir)` detection |
44
+ | 4 | `setup.js` | Generate starter config files for the platform |
45
+ | 5 | `plans.js` | Proposal generation and application logic |
46
+ | 6 | `governance.js` | Permission profiles, policy packs, governance rules |
47
+ | 7 | `interactive.js` | Step-by-step guided wizard for the platform |
48
+ | 8 | `deep-review.js` | AI-powered config review (opt-in) |
49
+ | 9 | `freshness.js` | Freshness checks for platform-specific configs |
50
+ | 10 | `domain-packs.js` | Domain-specific check packs (React, Python, etc.) |
51
+ | 11 | `mcp-packs.js` | MCP server integration packs |
52
+ | 12 | `activity.js` | Snapshot and activity tracking |
53
+ | 13 | `patch.js` | Config patching and migration helpers |
54
+ | 14 | `premium.js` | Premium/advanced checks |
55
+
56
+ ### Module template
57
+
58
+ Each `techniques.js` must export an array of check objects:
59
+
60
+ ```js
61
+ module.exports = [
62
+ {
63
+ key: '{platform}ConfigExists',
64
+ name: '{Platform} config file exists',
65
+ category: 'Memory & Context',
66
+ impact: 'critical',
67
+ check: (dir) => {
68
+ const fs = require('fs');
69
+ return fs.existsSync(`${dir}/.{platform}-config`);
70
+ },
71
+ fix: 'Create a .{platform}-config file in the project root.',
72
+ sourceUrl: 'https://docs.{platform}.dev/config',
73
+ confidence: 0.9,
74
+ },
75
+ // ... more checks
76
+ ];
77
+ ```
78
+
79
+ Each `context.js` must export a class with static detection:
80
+
81
+ ```js
82
+ class {Platform}ProjectContext {
83
+ static is{Platform}Repo(dir) {
84
+ const fs = require('fs');
85
+ return fs.existsSync(`${dir}/.{platform}-config`);
86
+ }
87
+ }
88
+ module.exports = { {Platform}ProjectContext };
89
+ ```
90
+
91
+ ## Step 3: Create Test Files
92
+
93
+ | File | Purpose |
94
+ |------|---------|
95
+ | `test/{platform}.test.js` | Unit tests for all 14 modules |
96
+ | `test/{platform}-check-matrix.js` | Matrix test: every check runs against fixtures |
97
+ | `test/{platform}-golden-matrix.js` | Golden file test: audit output matches expected |
98
+ | `test/{platform}-fixtures.js` | Test fixture generator |
99
+
100
+ ### Check matrix template
101
+
102
+ The check matrix ensures every technique key in `techniques.js` is exercised:
103
+
104
+ ```js
105
+ const techniques = require('../src/{platform}/techniques');
106
+ const allKeys = techniques.map(t => t.key);
107
+
108
+ for (const key of allKeys) {
109
+ // Verify check function exists and returns boolean
110
+ const technique = techniques.find(t => t.key === key);
111
+ const result = technique.check(fixtureDir);
112
+ assert(typeof result === 'boolean', `${key} must return boolean`);
113
+ }
114
+ ```
115
+
116
+ ## Step 4: Integration Points
117
+
118
+ ### 4a. Register in `src/audit.js`
119
+
120
+ Add platform detection and technique loading:
121
+
122
+ ```js
123
+ // In the platform resolution logic
124
+ if (platform === '{platform}') {
125
+ techniques = require('./{platform}/techniques');
126
+ }
127
+ ```
128
+
129
+ ### 4b. Register in `src/public-api.js`
130
+
131
+ Add to `PLATFORM_ORDER` and `PLATFORM_DETECTORS`:
132
+
133
+ ```js
134
+ const { {Platform}ProjectContext } = require('./{platform}/context');
135
+
136
+ // In PLATFORM_ORDER array:
137
+ '{platform}',
138
+
139
+ // In PLATFORM_DETECTORS object:
140
+ {platform}: (dir) => {Platform}ProjectContext.is{Platform}Repo(dir),
141
+ ```
142
+
143
+ ### 4c. Register in `src/catalog.js`
144
+
145
+ Ensure `generateCatalog()` includes the new platform's techniques.
146
+
147
+ ### 4d. Register in `bin/cli.js`
148
+
149
+ Add platform validation in the CLI argument parser (the platform check near line 363).
150
+
151
+ ### 4e. Register in Harmony
152
+
153
+ Add to `PLATFORM_AUDIT_MAP` in `src/harmony/audit.js`:
154
+
155
+ ```js
156
+ {platform}: '{platform}',
157
+ ```
158
+
159
+ ### 4f. Update `action.yml`
160
+
161
+ Add platform to the GitHub Action inputs if needed.
162
+
163
+ ## Step 5: Documentation
164
+
165
+ - Update `README.md` platform table
166
+ - Update `CHANGELOG.md` with the new platform entry
167
+ - Add platform to `package.json` keywords
168
+ - Update `docs/ARCHITECTURE.md` if it references platform list
169
+
170
+ ## 17-Point Deliverables Checklist
171
+
172
+ Use this checklist to track completion. All items must be done before the platform is considered fully supported.
173
+
174
+ - [ ] 1. Platform research document
175
+ - [ ] 2. Gap matrix vs Claude Code baseline
176
+ - [ ] 3. Build plan (v3 final)
177
+ - [ ] 4. Parity closure plan
178
+ - [ ] 5. `src/{platform}/techniques.js` — all checks with sourceUrl + confidence
179
+ - [ ] 6. `src/{platform}/config-parser.js`
180
+ - [ ] 7. `src/{platform}/context.js` — with `is{Platform}Repo()` detection
181
+ - [ ] 8. `src/{platform}/setup.js`
182
+ - [ ] 9. `src/{platform}/plans.js`
183
+ - [ ] 10. `src/{platform}/governance.js`
184
+ - [ ] 11. Remaining 8 modules (interactive, deep-review, freshness, domain-packs, mcp-packs, activity, patch, premium)
185
+ - [ ] 12. `test/{platform}.test.js`
186
+ - [ ] 13. `test/{platform}-check-matrix.js`
187
+ - [ ] 14. `test/{platform}-golden-matrix.js`
188
+ - [ ] 15. Integration in audit.js, public-api.js, catalog.js, cli.js
189
+ - [ ] 16. Harmony integration
190
+ - [ ] 17. README, CHANGELOG, and documentation updates
191
+
192
+ ## Quality Gates
193
+
194
+ Before merging a new platform:
195
+
196
+ 1. All check-matrix tests pass: `node test/{platform}-check-matrix.js`
197
+ 2. All golden-matrix tests pass: `node test/{platform}-golden-matrix.js`
198
+ 3. Jest tests pass: `npx jest test/{platform}.test.js`
199
+ 4. Platform appears in `nerviq catalog` output
200
+ 5. `nerviq audit --platform {platform}` runs successfully on a real project
201
+ 6. Harmony audit includes the new platform
202
+ 7. Every technique has `sourceUrl` and `confidence >= 0.7`
@@ -0,0 +1,46 @@
1
+ # Publishing to Open VSX Registry
2
+
3
+ ## What is Open VSX?
4
+
5
+ Open VSX is an open, vendor-neutral registry for VS Code extensions, hosted by the Eclipse Foundation.
6
+
7
+ ## Why Publish to Open VSX?
8
+
9
+ Cursor IDE uses Open VSX (not Microsoft's VS Code Marketplace) as its extension backend. Microsoft's licensing blocks non-VS-Code forks from accessing their marketplace, so Cursor, VSCodium, and Gitpod all rely on Open VSX instead.
10
+
11
+ **Publishing to Open VSX gives us compatibility with all three platforms for free.**
12
+
13
+ See: [Cursor Marketplace Research (2026-04-06)](../../research/cursor-marketplace-research-2026-04-06.md)
14
+
15
+ ## VS Code Extension Source
16
+
17
+ The Nerviq VS Code extension lives in this repo at [`vscode-extension/`](../vscode-extension/).
18
+
19
+ ## How to Get a Token
20
+
21
+ 1. Create an account at [accounts.eclipse.org](https://accounts.eclipse.org/)
22
+ 2. Go to [open-vsx.org](https://open-vsx.org/) and sign in with your Eclipse account
23
+ 3. Navigate to your user settings and generate an access token
24
+ 4. Store the token as `OVSX_TOKEN` in your GitHub repository secrets
25
+
26
+ ## How to Publish Manually
27
+
28
+ ```bash
29
+ # Package the extension
30
+ cd vscode-extension
31
+ npm install
32
+ npx @vscode/vsce package
33
+
34
+ # Publish to Open VSX
35
+ npx ovsx publish *.vsix -p <your-token>
36
+ ```
37
+
38
+ ## Automated Publishing
39
+
40
+ A GitHub Actions workflow is available at [`.github/workflows/publish-ovsx.yml`](../.github/workflows/publish-ovsx.yml). It runs on manual dispatch (`workflow_dispatch`) and requires the `OVSX_TOKEN` secret to be configured.
41
+
42
+ ## References
43
+
44
+ - [Open VSX Registry](https://open-vsx.org/)
45
+ - [Open VSX Publishing Guide](https://github.com/eclipse/openvsx/wiki/Publishing-Extensions)
46
+ - [Eclipse Foundation Account](https://accounts.eclipse.org/)
@@ -0,0 +1,46 @@
1
+ # Platform Change Ingestion
2
+
3
+ How Nerviq stays current across Claude, Codex, Cursor, Copilot, Gemini CLI, Windsurf, Aider, and OpenCode.
4
+
5
+ ## Source of truth
6
+
7
+ - `src/platform-change-manifest.js`
8
+ - `.github/workflows/freshness-check.yml`
9
+ - Platform-specific freshness modules under `src/*/freshness.js`
10
+
11
+ The manifest is the canonical inventory for:
12
+ - tracked P0 sources per platform
13
+ - review cadence
14
+ - daily freshness workflow details
15
+ - propagation/update triggers
16
+
17
+ ## What gets tracked
18
+
19
+ For each supported platform, Nerviq keeps:
20
+ - official docs URLs
21
+ - changelog / release-note URLs
22
+ - freshness thresholds
23
+ - propagation triggers that describe what must update when the platform changes
24
+
25
+ ## Cadence
26
+
27
+ - Automation: daily freshness workflow at `06:00 UTC`
28
+ - Manual review: weekly for 14-day sources, monthly for 30-day sources
29
+ - Immediate review: any stale source or breaking platform change
30
+
31
+ ## Operational workflow
32
+
33
+ 1. The daily freshness workflow checks each platform's P0 sources.
34
+ 2. If a source is stale or unverified, the workflow opens or updates a GitHub issue.
35
+ 3. The maintainer verifies the source, updates the matching `freshness.js` file, and follows the propagation checklist.
36
+ 4. If config semantics changed, update the relevant checks plus `src/platform-change-manifest.js`.
37
+
38
+ ## Why this matters
39
+
40
+ This is the layer that lets Nerviq say more than "we have source URLs."
41
+ It creates an explicit system for:
42
+ - what we watch
43
+ - how often we review it
44
+ - what code/docs must change when a platform moves
45
+
46
+ That keeps freshness from becoming tribal knowledge or an ad-hoc chore.
@@ -0,0 +1,101 @@
1
+ # Nerviq Plugin System
2
+
3
+ Nerviq supports custom checks via a plugin system. You can extend the audit with project-specific or organization-specific checks by creating a `nerviq.config.js` file in your project root.
4
+
5
+ ## Creating a Plugin
6
+
7
+ 1. Create `nerviq.config.js` in your project root.
8
+ 2. Export an object with a `plugins` array.
9
+ 3. Each plugin has a `name` and a `checks` object.
10
+
11
+ ```javascript
12
+ // nerviq.config.js
13
+ module.exports = {
14
+ plugins: [
15
+ {
16
+ name: 'my-org-standards',
17
+ checks: {
18
+ hasChangelog: {
19
+ id: 'ORG-001',
20
+ name: 'Project has a CHANGELOG',
21
+ check: (ctx) => ctx.files.includes('CHANGELOG.md'),
22
+ impact: 'medium',
23
+ category: 'hygiene',
24
+ fix: 'Create a CHANGELOG.md to track project changes.',
25
+ sourceUrl: 'https://keepachangelog.com',
26
+ confidence: 0.9,
27
+ },
28
+ hasCodeOwners: {
29
+ id: 'ORG-002',
30
+ name: 'CODEOWNERS file exists',
31
+ check: (ctx) => ctx.files.includes('CODEOWNERS') || ctx.files.includes('.github/CODEOWNERS'),
32
+ impact: 'high',
33
+ category: 'quality',
34
+ fix: 'Add a CODEOWNERS file to enforce review assignments.',
35
+ sourceUrl: null,
36
+ confidence: 0.8,
37
+ },
38
+ },
39
+ },
40
+ ],
41
+ };
42
+ ```
43
+
44
+ ## Plugin API
45
+
46
+ ### Check Object Format
47
+
48
+ Each check in the `checks` object must have these **required** fields:
49
+
50
+ | Field | Type | Description |
51
+ |------------|------------|----------------------------------------------------------------|
52
+ | `id` | `string` | Unique identifier for the check (e.g. `'CUSTOM-001'`). |
53
+ | `name` | `string` | Human-readable name shown in audit results. |
54
+ | `check` | `function` | `(ctx) => boolean \| null`. Return `true` if passed, `false` if failed, `null` if not applicable. |
55
+ | `impact` | `string` | One of: `'critical'`, `'high'`, `'medium'`, `'low'`. |
56
+ | `category` | `string` | Category grouping (e.g. `'custom'`, `'hygiene'`, `'security'`). |
57
+ | `fix` | `string` | Actionable fix message shown when the check fails. |
58
+
59
+ Optional fields:
60
+
61
+ | Field | Type | Default | Description |
62
+ |--------------|----------|---------|----------------------------------------------------|
63
+ | `sourceUrl` | `string` | `null` | URL to documentation or rationale for this check. |
64
+ | `confidence` | `number` | `0.5` | Confidence level from 0 to 1. |
65
+
66
+ ### The Context Object (`ctx`)
67
+
68
+ The `check` function receives a project context object with these useful properties and methods:
69
+
70
+ - `ctx.files` -- array of all file paths in the project (relative to root)
71
+ - `ctx.fileContent(path)` -- returns file contents as string, or empty string
72
+ - `ctx.claudeMdContent()` -- returns CLAUDE.md content
73
+ - `ctx.hasDir(path)` -- returns true if directory exists
74
+ - `ctx.dirFiles(path)` -- returns array of files in a directory
75
+
76
+ ## How Plugin Checks Appear in Audit Results
77
+
78
+ Plugin checks are merged into the standard audit and appear alongside built-in checks. In the results, plugin checks are keyed as `plugin:<plugin-name>:<check-key>`. For example, a check `hasChangelog` in plugin `my-org-standards` appears as:
79
+
80
+ ```
81
+ plugin:my-org-standards:hasChangelog
82
+ ```
83
+
84
+ Plugin checks are scored and weighted using the same `impact`-based system as built-in checks. They appear in:
85
+
86
+ - The full results list
87
+ - Failed check recommendations (if they fail)
88
+ - Score calculations
89
+
90
+ ## Validation
91
+
92
+ Nerviq validates all plugins at load time. Plugins with missing required fields are skipped and an error is logged. You can also validate a plugin programmatically:
93
+
94
+ ```javascript
95
+ const { validatePlugin } = require('@nerviq/cli/src/plugins');
96
+
97
+ const result = validatePlugin(myPlugin);
98
+ if (!result.valid) {
99
+ console.error('Plugin errors:', result.errors);
100
+ }
101
+ ```
@@ -0,0 +1,58 @@
1
+ # Pre-commit Hook Integration
2
+
3
+ [pre-commit](https://pre-commit.com) is a framework for managing and running git hooks across projects using a shared configuration file.
4
+
5
+ ## Setup
6
+
7
+ Install pre-commit if you haven't already:
8
+
9
+ ```bash
10
+ pip install pre-commit
11
+ ```
12
+
13
+ Add Nerviq to your `.pre-commit-config.yaml`:
14
+
15
+ ```yaml
16
+ repos:
17
+ - repo: https://github.com/nerviq/nerviq
18
+ rev: v1.8.0
19
+ hooks:
20
+ - id: nerviq-audit
21
+ args: ['60'] # minimum score threshold
22
+ ```
23
+
24
+ Then install the hooks:
25
+
26
+ ```bash
27
+ pre-commit install
28
+ ```
29
+
30
+ ## Customization
31
+
32
+ **Change the threshold** by editing the `args` value. The audit fails if the project score is below this number (0-100):
33
+
34
+ ```yaml
35
+ args: ['80'] # stricter threshold
36
+ ```
37
+
38
+ **Use pre-push instead of pre-commit** for a full audit that runs only when pushing:
39
+
40
+ ```yaml
41
+ repos:
42
+ - repo: https://github.com/nerviq/nerviq
43
+ rev: v1.8.0
44
+ hooks:
45
+ - id: nerviq-audit-full
46
+ args: ['40']
47
+ ```
48
+
49
+ Then install the push hook:
50
+
51
+ ```bash
52
+ pre-commit install --hook-type pre-push
53
+ ```
54
+
55
+ ## Requirements
56
+
57
+ - Node.js 18+
58
+ - `npx` available on PATH (included with Node.js)