@nerviq/cli 1.26.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 (59) hide show
  1. package/CHANGELOG.md +1407 -0
  2. package/README.md +4 -4
  3. package/SECURITY.md +82 -0
  4. package/bin/cli.js +13 -1
  5. package/contracts/audit-webhook-event.schema.json +138 -0
  6. package/contracts/pack-contract.schema.json +15 -0
  7. package/contracts/technique-contract.schema.json +18 -0
  8. package/docs/ARCHITECTURE.md +74 -0
  9. package/docs/api-reference.md +356 -0
  10. package/docs/autofix.md +64 -0
  11. package/docs/bitbucket-pipe.yml +57 -0
  12. package/docs/case-studies.md +149 -0
  13. package/docs/category-definition-kit.md +56 -0
  14. package/docs/ci-integration.md +127 -0
  15. package/docs/claude-code-style.md +24 -0
  16. package/docs/claude-maintainer-ops.md +19 -0
  17. package/docs/external-validation.md +78 -0
  18. package/docs/first-tier-integration-gate.md +59 -0
  19. package/docs/getting-started.md +119 -0
  20. package/docs/gitlab-ci-template.yml +54 -0
  21. package/docs/index.html +597 -0
  22. package/docs/integration-contracts.md +287 -0
  23. package/docs/license-faq.md +53 -0
  24. package/docs/maintenance.md +155 -0
  25. package/docs/methodology.md +236 -0
  26. package/docs/new-platform-guide.md +202 -0
  27. package/docs/open-vsx-publishing.md +46 -0
  28. package/docs/platform-change-ingestion.md +46 -0
  29. package/docs/plugins.md +101 -0
  30. package/docs/pre-commit.md +58 -0
  31. package/docs/security-model.md +63 -0
  32. package/docs/shallow-risk.md +246 -0
  33. package/docs/versioning-policy.md +63 -0
  34. package/docs/why-nerviq.md +82 -0
  35. package/package.json +7 -2
  36. package/sdk/README.md +190 -0
  37. package/src/audit/layers.js +180 -179
  38. package/src/audit.js +118 -48
  39. package/src/codex/setup.js +3 -2
  40. package/src/formatters/csv.js +86 -85
  41. package/src/formatters/junit.js +123 -103
  42. package/src/formatters/markdown.js +164 -135
  43. package/src/gemini/setup.js +3 -2
  44. package/src/init.js +4 -3
  45. package/src/opencode/context.js +42 -3
  46. package/src/opencode/techniques.js +198 -142
  47. package/src/output-icons.js +44 -0
  48. package/src/setup/runtime.js +6 -5
  49. package/src/setup.js +4 -3
  50. package/src/shallow-risk/index.js +56 -0
  51. package/src/shallow-risk/patterns/agent-config-cross-platform-drift.js +50 -0
  52. package/src/shallow-risk/patterns/agent-config-dangerous-autoapprove.js +46 -0
  53. package/src/shallow-risk/patterns/agent-config-deprecated-keys.js +46 -0
  54. package/src/shallow-risk/patterns/agent-config-missing-file.js +72 -0
  55. package/src/shallow-risk/patterns/agent-config-secret-literal.js +49 -0
  56. package/src/shallow-risk/patterns/agent-config-stack-contradiction.js +34 -0
  57. package/src/shallow-risk/patterns/hook-script-missing.js +70 -0
  58. package/src/shallow-risk/patterns/mcp-server-no-allowlist.js +52 -0
  59. package/src/shallow-risk/shared.js +520 -0
@@ -0,0 +1,56 @@
1
+ # Category Definition Kit
2
+
3
+ Nerviq is the control plane for AI-enabled development.
4
+
5
+ It helps teams govern how AI coding agents operate across a repo, align multiple tool surfaces, and keep that setup inspectable over time.
6
+
7
+ ## Category definition
8
+
9
+ Nerviq belongs to:
10
+
11
+ - AI agent governance
12
+ - AI development control plane
13
+ - configuration intelligence for coding-agent workflows
14
+
15
+ It is not primarily:
16
+
17
+ - a full SAST scanner
18
+ - a prompt library
19
+ - a single-vendor IDE helper
20
+ - a generic policy engine with no repo context
21
+
22
+ ## Comparison matrix
23
+
24
+ | Category | What it does well | Where Nerviq differs |
25
+ |---|---|---|
26
+ | SAST / code scanners | Finds code-level vulnerabilities and risky patterns | Nerviq focuses on the configuration, governance, drift, and operating model around AI agents. |
27
+ | Policy-as-code | Defines enforcement rules and compliance logic | Nerviq is repo-native and AI-workflow-aware, with cross-platform agent surfaces, Harmony, and benchmark/proof flows. |
28
+ | IDE plugins | Improve one editor experience | Nerviq governs the repo across tools instead of binding to one vendor surface only. |
29
+ | Prompt libraries / starter kits | Speed up first setup | Nerviq keeps the setup measurable, aligned, and auditable after day one. |
30
+ | DevEx / internal platform tooling | Standardizes workflows | Nerviq specifically targets AI-enabled development posture and multi-agent drift. |
31
+
32
+ ## Operating model
33
+
34
+ 1. Detect
35
+ Audit the repo, detect drift, and establish a live baseline.
36
+ 2. Align
37
+ Use Harmony, plan/apply, and policy layers to reduce contradictions safely.
38
+ 3. Govern
39
+ Add permissions, hooks, deny rules, diff gates, and org/team/repo policy inheritance.
40
+ 4. Prove
41
+ Preserve score semantics, snapshots, benchmark evidence, and public proof surfaces.
42
+ 5. Scale
43
+ Move from one repo to fleets, integration contracts, and gated first-tier distribution.
44
+
45
+ ## Adoption playbook
46
+
47
+ | Stage | Primary user | Nerviq job |
48
+ |---|---|---|
49
+ | Single repo | developer or team lead | Find drift, score the setup, fix the basics, create proof. |
50
+ | Team standard | DevEx / eng lead | Define operating profiles, policy packs, and CI drift gates. |
51
+ | Org control plane | platform / security / governance | Apply policy inheritance, fleet semantics, and integration contracts. |
52
+ | Market standard | external ecosystem | Publish proof, hold first-tier integrations to a gate, and keep the category language consistent. |
53
+
54
+ ## Positioning sentence
55
+
56
+ Nerviq turns AI coding from a pile of local tool configs into a governed, measurable, cross-platform operating layer.
@@ -0,0 +1,127 @@
1
+ # CI Integration
2
+
3
+ NERVIQ integrates with any CI system that can run Node.js. The audit command exits with a non-zero code when the project score falls below the configured threshold, so it plugs directly into your pipeline's pass/fail logic. Below are ready-to-use snippets for the most common providers.
4
+
5
+ ## GitHub Actions
6
+
7
+ ```yaml
8
+ # .github/workflows/nerviq.yml
9
+ name: NERVIQ Audit
10
+ on: [push, pull_request]
11
+
12
+ jobs:
13
+ audit:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: nerviq/nerviq@v1
18
+ with:
19
+ threshold: 60
20
+ ```
21
+
22
+ ## GitLab CI
23
+
24
+ See the full template at [`gitlab-ci-template.yml`](./gitlab-ci-template.yml). Copy it to your project root as `.gitlab-ci.yml` or include it via:
25
+
26
+ ```yaml
27
+ include:
28
+ - local: 'path/to/gitlab-ci-template.yml'
29
+ ```
30
+
31
+ ## Bitbucket Pipelines
32
+
33
+ See the full template at [`bitbucket-pipe.yml`](./bitbucket-pipe.yml). It includes three pipeline triggers:
34
+
35
+ | Pipeline | Trigger | Purpose |
36
+ |---|---|---|
37
+ | `default` | Every push | Audit on all branches |
38
+ | `pull-requests` | PR opened/updated | Gate PRs on score threshold |
39
+ | `custom / harmony-audit` | Manual (UI) | Run Harmony multi-config audit |
40
+
41
+ Quick inline example:
42
+
43
+ ```yaml
44
+ # bitbucket-pipelines.yml
45
+ image: node:20-slim
46
+
47
+ pipelines:
48
+ default:
49
+ - step:
50
+ name: Nerviq Audit
51
+ script:
52
+ - npm install -g @nerviq/cli
53
+ - nerviq audit --json --threshold ${NERVIQ_THRESHOLD:-60}
54
+ artifacts:
55
+ - nerviq-report.json
56
+ pull-requests:
57
+ '**':
58
+ - step:
59
+ name: Nerviq PR Audit
60
+ script:
61
+ - npm install -g @nerviq/cli
62
+ - nerviq audit --json --threshold ${NERVIQ_THRESHOLD:-60} --out nerviq-report.json
63
+ artifacts:
64
+ - nerviq-report.json
65
+ ```
66
+
67
+ Set `NERVIQ_THRESHOLD` in **Repository Settings > Pipelines > Variables** to override the default score of 60.
68
+
69
+ ## Pre-commit
70
+
71
+ Use the [pre-commit](https://pre-commit.com) framework to run Nerviq automatically on every commit or push. Add to your `.pre-commit-config.yaml`:
72
+
73
+ ```yaml
74
+ repos:
75
+ - repo: https://github.com/nerviq/nerviq
76
+ rev: v1.8.0
77
+ hooks:
78
+ - id: nerviq-audit
79
+ args: ['60']
80
+ ```
81
+
82
+ See the full guide at [`pre-commit.md`](./pre-commit.md).
83
+
84
+ ## Generic CI (any provider)
85
+
86
+ If your CI can run `npx`, no global install is needed:
87
+
88
+ ```bash
89
+ npx @nerviq/cli audit --threshold 60
90
+ ```
91
+
92
+ For faster repeat runs, install globally in a setup step:
93
+
94
+ ```bash
95
+ npm install -g @nerviq/cli
96
+ nerviq audit --json --threshold 60
97
+ ```
98
+
99
+ ## PR Drift Gating
100
+
101
+ For pull-request workflows, gate drift against the managed Nerviq baseline instead of only checking the whole repo score:
102
+
103
+ ```bash
104
+ npx @nerviq/cli audit --diff-only --drift-mode ci --threshold 60
105
+ ```
106
+
107
+ This mode:
108
+
109
+ - limits analysis to changed files plus linked governance/config surfaces
110
+ - compares drift against the managed baseline when one exists
111
+ - keeps score semantics explicit by treating this as a changed-file audit, not a full snapshot score
112
+
113
+ ## Fleet Rollups
114
+
115
+ For organizations that want one artifact across multiple repos:
116
+
117
+ ```bash
118
+ npx @nerviq/cli org scan ./app ./api ./infra --json --out nerviq-fleet.json
119
+ ```
120
+
121
+ This returns:
122
+
123
+ - repo-level `live-repo-audit-score` rows
124
+ - an `org-live-average-score` rollup
125
+ - fleet policy coverage
126
+ - score bands
127
+ - shared top evidence across repos
@@ -0,0 +1,24 @@
1
+ # Claude Code Style
2
+
3
+ ## Output Style
4
+ - Use camelCase for variables and functions, PascalCase for classes, and UPPER_SNAKE for constants.
5
+ - Prefer `const`; never use `var`.
6
+ - Write JSDoc for public functions and exported helpers when the contract is not obvious.
7
+ - Keep functions small when practical, but prioritize readability over an arbitrary line limit.
8
+ - Use descriptive test names that state the expected behavior.
9
+
10
+ ## Repo Shape
11
+ ```text
12
+ bin/ CLI entry point
13
+ src/ Core runtime, platform adapters, HTTP API, MCP transport
14
+ sdk/ Public SDK with TypeScript types
15
+ test/ Custom suite + Jest coverage
16
+ tools/ Build, validation, and maintenance scripts
17
+ docs/ Public and maintainer-facing documentation
18
+ action/ GitHub Action
19
+ vscode-extension/ VS Code surface
20
+ ```
21
+
22
+ ## Naming Notes
23
+ - Use kebab-case for CLI commands and doc file names.
24
+ - Follow the existing platform folder layout under `src/` instead of inventing new top-level shapes.
@@ -0,0 +1,19 @@
1
+ # Claude Maintainer Ops
2
+
3
+ ## Working Notes
4
+ - You are working inside the shipped product repo, not the research repo.
5
+ - Keep public contracts stable across CLI JSON, HTTP serve, MCP transport, SDK, Action, and docs.
6
+ - Favor small, test-backed refactors over broad rewrites.
7
+
8
+ ## Environment & Credentials
9
+ - Credentials stay in local environment or local `.env` files and must never be copied into tracked files.
10
+ - If a task needs account-level access, use local configuration only and keep the repo baseline credential-agnostic.
11
+
12
+ ## Security & Runtime
13
+ - Be careful with untrusted paths, shell commands, and generated content.
14
+ - Pin dependency versions and run `npm audit` before publish-oriented work.
15
+ - When operating on large repos, consider token/context limits and prefer cached or incremental paths when they already exist.
16
+
17
+ ## Release Operations
18
+ - Leave releases publish-ready for the human; do not publish automatically.
19
+ - When public docs or messaging change, sync the site and research repos in the same cycle.
@@ -0,0 +1,78 @@
1
+ # Nerviq External Validation Report
2
+
3
+ **Date:** 2026-04-07
4
+ **CLI Version:** 1.5.3 (2,431 checks)
5
+ **Method:** `nerviq audit --json` on shallow clone of each repo's default branch
6
+ **Repos tested:** 20 real open-source projects (selected for AI agent config presence)
7
+
8
+ ## Results
9
+
10
+ | # | Repo | Stars | Score | Passed | Failed | CLAUDE.md | AGENTS.md | .cursorrules | Top 3 Missing |
11
+ |---|------|-------|-------|--------|--------|-----------|-----------|-------------|---------------|
12
+ | 1 | [supabase/supabase](https://github.com/supabase/supabase) | 175k⭐ | **44** | 106 | 177 | ❌ | ❌ | ❌ | Secrets protection; CLAUDE.md; Python CI |
13
+ | 2 | [AudiusProject/apps](https://github.com/AudiusProject/apps) | - | **41** | 97 | 192 | ✅ | ❌ | ❌ | Secrets protection; Python CI; Swift tests |
14
+ | 3 | [anthropics/anthropic-cookbook](https://github.com/anthropics/anthropic-cookbook) | - | **41** | 69 | 119 | ✅ | ❌ | ❌ | Secrets protection; PostToolUse hooks; XML constraints |
15
+ | 4 | [medusajs/medusa](https://github.com/medusajs/medusa) | - | **40** | 73 | 129 | ✅ | ❌ | ❌ | Secrets protection; PostToolUse hooks; XML constraints |
16
+ | 5 | [calcom/cal.com](https://github.com/calcom/cal.com) | - | **39** | 71 | 121 | ✅ | ✅ | ❌ | Verification commands; Secrets protection; PostToolUse hooks |
17
+ | 6 | [langchain-ai/langchain](https://github.com/langchain-ai/langchain) | - | **37** | 66 | 119 | ✅ | ✅ | ❌ | Secrets protection; PostToolUse hooks; Custom commands |
18
+ | 7 | [openai/codex](https://github.com/openai/codex) | - | **31** | 61 | 150 | ❌ | ✅ | ❌ | Verification commands; Secrets protection; CLAUDE.md |
19
+ | 8 | [wei/socialify](https://github.com/wei/socialify) | - | **30** | 52 | 132 | ✅ | ✅ | ❌ | Verification commands; Secrets protection; PostToolUse hooks |
20
+ | 9 | [metriport/metriport](https://github.com/metriport/metriport) | - | **30** | 59 | 168 | ❌ | ❌ | ✅ | Verification commands; Secrets protection; CLAUDE.md |
21
+ | 10 | [frantracer/linkurator-frontend](https://github.com/frantracer/linkurator-frontend) | - | **29** | 39 | 139 | ✅ | ❌ | ❌ | Secrets protection; PostToolUse hooks; Custom commands |
22
+ | 11 | [shadcn-ui/ui](https://github.com/shadcn-ui/ui) | 111k⭐ | **26** | 44 | 141 | ❌ | ❌ | ❌ | Verification commands; Secrets protection; CLAUDE.md |
23
+ | 12 | [uhop/node-re2](https://github.com/uhop/node-re2) | - | **25** | 34 | 129 | ✅ | ✅ | ✅ | .gitignore .env; Verification commands; Secrets protection |
24
+ | 13 | [umijs/umi](https://github.com/umijs/umi) | - | **25** | 41 | 150 | ✅ | ❌ | ✅ | Verification commands; Secrets protection; PostToolUse hooks |
25
+ | 14 | [grafana/docker-otel-lgtm](https://github.com/grafana/docker-otel-lgtm) | - | **24** | 44 | 174 | ✅ | ✅ | ❌ | Verification commands; Secrets protection; Python CI |
26
+ | 15 | [vercel/ai](https://github.com/vercel/ai) | - | **24** | 46 | 163 | ✅ | ✅ | ❌ | Verification commands; Secrets protection; Python CI |
27
+ | 16 | [rabbitmq/rabbitmq-server](https://github.com/rabbitmq/rabbitmq-server) | - | **23** | 48 | 156 | ✅ | ✅ | ❌ | Verification commands; Secrets protection; Python CI |
28
+ | 17 | [t3-oss/create-t3-app](https://github.com/t3-oss/create-t3-app) | - | **20** | 33 | 150 | ❌ | ❌ | ❌ | Verification commands; Secrets protection; CLAUDE.md |
29
+ | 18 | [grapeot/devin.cursorrules](https://github.com/grapeot/devin.cursorrules) | - | **13** | 21 | 161 | ❌ | ❌ | ✅ | Verification commands; Secrets protection; CLAUDE.md |
30
+ | 19 | [anthropics/claude-code](https://github.com/anthropics/claude-code) | - | **11** | 21 | 161 | ❌ | ❌ | ❌ | .gitignore .env; Verification commands; Secrets protection |
31
+ | 20 | [elixir-dx/dx](https://github.com/elixir-dx/dx) | - | **10** | 14 | 143 | ❌ | ❌ | ❌ | .gitignore .env; Verification commands; Secrets protection |
32
+
33
+ ## Key Findings
34
+
35
+ ### Score Distribution
36
+ - **Average score: 28/100** — even repos with AI agent configs have significant gaps
37
+ - **Highest: 44** (supabase/supabase) — large monorepo with good hygiene but no AI agent config
38
+ - **Lowest: 10-11** (elixir-dx/dx, anthropics/claude-code) — minimal config files
39
+
40
+ ### Most Common Critical Gaps (appeared in 18+ repos)
41
+ 1. **Secrets protection not configured** — 19/20 repos (95%) lack deny rules for .env
42
+ 2. **No verification commands** — 17/20 repos (85%) don't tell the agent how to verify its own work
43
+ 3. **No PostToolUse hooks** — 16/20 repos (80%) miss automated checks after tool use
44
+
45
+ ### Repos WITH AI Agent Config Still Score Low
46
+ - Repos with `CLAUDE.md` average **30/100** — having instructions is not enough
47
+ - Repos with `CLAUDE.md` + `AGENTS.md` average **28/100** — instructions without hooks/permissions/verification still leave gaps
48
+ - The gap between "has CLAUDE.md" and "well-configured for agents" is where Nerviq adds value
49
+
50
+ ### False Positive Assessment
51
+ - **Secrets protection** on repos without .env: legitimate finding (should still protect against accidental creation)
52
+ - **Python CI checks** on non-Python repos: these fire when `requirements.txt` is detected anywhere — could be a docs dependency. **Candidate for tighter scoping.**
53
+ - **Stack-specific checks**: fire based on file detection, generally accurate
54
+
55
+ ### What Nerviq Got Right
56
+ - Correctly detected CLAUDE.md, AGENTS.md, .cursorrules, GEMINI.md presence
57
+ - Correctly identified verification commands (or lack thereof)
58
+ - Correctly detected .gitignore patterns, hook configurations, permission profiles
59
+ - Stack detection worked: Node.js, Python, Go, Rust, Java repos all detected correctly
60
+ - Cross-platform configs detected where present (node-re2 had all three: CLAUDE.md + AGENTS.md + .cursorrules)
61
+
62
+ ### What Could Improve
63
+ - Python CI check fires on repos with incidental Python (e.g., docs tooling) — needs relevance filter
64
+ - Some enterprise/compliance checks are noise for small open-source projects
65
+ - Score of 0-10 for repos with zero AI config is correct but not actionable — these users need onboarding, not a score
66
+
67
+ ## Methodology
68
+
69
+ 1. Selected 20 repos: mix of repos with known AI agent config files + popular open-source projects
70
+ 2. Shallow-cloned each repo (`git clone --depth 1`)
71
+ 3. Ran `nerviq audit --json` (read-only, no files written)
72
+ 4. Extracted score, pass/fail counts, and top 3 recommendations
73
+ 5. Manually verified CLAUDE.md/AGENTS.md/.cursorrules presence
74
+ 6. Assessed false positive candidates
75
+
76
+ ## Conclusion
77
+
78
+ Nerviq correctly identifies meaningful gaps in AI coding agent configurations. Even repos that have adopted CLAUDE.md or AGENTS.md typically score 25-40/100, with secrets protection, verification commands, and hooks being the most consistently missing elements. The tool adds the most value in the gap between "has instructions file" and "well-governed agent setup."
@@ -0,0 +1,59 @@
1
+ # First-Tier Integration Gate
2
+
3
+ Nerviq ships first-tier integrations only when the product is ready to be judged by them.
4
+
5
+ This gate exists to stop distribution-by-eagerness. A marketplace listing, IDE plugin, or prominent CI surface should amplify a trustworthy product, not expose unfinished semantics.
6
+
7
+ ## Gate dimensions
8
+
9
+ ### 1. Contract stability
10
+
11
+ - machine-readable contracts exist where relevant
12
+ - score semantics are explicit and documented
13
+ - the integration does not depend on scraping unstable CLI text
14
+
15
+ ### 2. Public proof density
16
+
17
+ - public before/after proof exists
18
+ - benchmarkable public evidence exists across more than one repo shape
19
+ - the product boundary is stated clearly, including what Nerviq is not
20
+
21
+ ### 3. Operational reliability
22
+
23
+ - canonical test/build paths are green
24
+ - no known release-blocking CI failures exist
25
+ - setup, docs, and support paths are reproducible for external users
26
+
27
+ ### 4. Ownership and support
28
+
29
+ - one repo clearly owns the surface
30
+ - release/update flow is defined
31
+ - incoming user issues can be triaged without ambiguity
32
+
33
+ ### 5. Category fit
34
+
35
+ - the surface reinforces Nerviq as agent governance / AI development control plane
36
+ - the integration does not blur Nerviq into a different category by accident
37
+ - marketing copy and product behavior tell the same story
38
+
39
+ ## Surface posture
40
+
41
+ | Surface | Posture | What this means |
42
+ |---|---|---|
43
+ | GitHub Action marketplace | Gated | The action can exist before the marketplace listing; broader distribution waits for the full first-tier bar. |
44
+ | JetBrains plugin | Gated | IDE distribution waits until the plugin contract, install path, and support posture reinforce the core category instead of distracting from it. |
45
+ | Shared/team dashboard | Gated | Monetization-facing surfaces stay behind trustworthy fleet semantics and control-plane clarity. |
46
+ | Community seeding | Deferred until story is strong | Community distribution follows public proof plus category clarity, not the other way around. |
47
+
48
+ ## Unfreeze rule
49
+
50
+ A first-tier surface can move forward only when:
51
+
52
+ - the relevant gate dimensions are green
53
+ - the owning repo is updated
54
+ - public messaging is synchronized if the surface is public
55
+ - the move strengthens Nerviq's standard story instead of fragmenting it
56
+
57
+ ## Why this matters
58
+
59
+ Without this gate, new surfaces can create false momentum while weakening trust. With it, each external integration becomes proof that the product is stabilizing into a standard, not just expanding its footprint.
@@ -0,0 +1,119 @@
1
+ # Getting Started with Nerviq
2
+
3
+ The fastest way to understand Nerviq is not to memorize every command. It is to
4
+ go through one short loop:
5
+
6
+ 1. detect platforms
7
+ 2. score the repo
8
+ 3. show the biggest gaps
9
+ 4. fix the basics
10
+ 5. check drift
11
+ 6. compare the improvement
12
+
13
+ Install once:
14
+
15
+ ```bash
16
+ npm i -g @nerviq/cli
17
+ ```
18
+
19
+ For one-off use, `npx @nerviq/cli` works too.
20
+
21
+ If you want the shortest possible command map inside the terminal, start with:
22
+
23
+ ```bash
24
+ npx @nerviq/cli --beginner
25
+ ```
26
+
27
+ That view only shows `audit`, `setup`, `fix`, `augment`, and `doctor`.
28
+
29
+ ---
30
+
31
+ ## The 6-Step First-Value Path
32
+
33
+ ### 1. Detect active platforms
34
+
35
+ ```bash
36
+ npx @nerviq/cli harmony-audit
37
+ ```
38
+
39
+ Use this first so you know which agent surfaces Nerviq actually found in the
40
+ repo. If the project uses more than one AI coding tool, this is the first drift
41
+ signal that matters.
42
+
43
+ ### 2. Score the current repo
44
+
45
+ ```bash
46
+ npx @nerviq/cli audit --snapshot
47
+ ```
48
+
49
+ This gives you the live baseline and saves the first audit snapshot. That
50
+ snapshot matters because `compare` needs two snapshots later.
51
+
52
+ ### 3. Show the biggest gaps
53
+
54
+ ```bash
55
+ npx @nerviq/cli audit --full
56
+ ```
57
+
58
+ The short score is useful, but the full audit is where you see critical checks,
59
+ top next actions, and weakest categories.
60
+
61
+ ### 4. Fix the basics safely
62
+
63
+ ```bash
64
+ npx @nerviq/cli setup --auto
65
+ npx @nerviq/cli fix --all-critical --auto
66
+ ```
67
+
68
+ This is the fastest way to generate the starter-safe governance layer and then
69
+ close the most obvious critical issues.
70
+
71
+ ### 5. Check drift again
72
+
73
+ ```bash
74
+ npx @nerviq/cli harmony-audit
75
+ ```
76
+
77
+ Re-run Harmony after the baseline changes so you can see whether the active
78
+ platform surfaces are becoming more coherent.
79
+
80
+ ### 6. Show the improvement
81
+
82
+ ```bash
83
+ npx @nerviq/cli audit --snapshot
84
+ npx @nerviq/cli compare
85
+ ```
86
+
87
+ This closes the loop: Nerviq should not only recommend changes, it should show
88
+ that the repo actually improved.
89
+
90
+ ---
91
+
92
+ ## What You Should Have After Step 6
93
+
94
+ - one clear baseline score
95
+ - two saved audit snapshots
96
+ - a concrete before/after comparison
97
+ - a stronger starter-safe config layer
98
+ - a better sense of whether the repo is drifting across platforms
99
+
100
+ ---
101
+
102
+ ## After First Value
103
+
104
+ Once the six-step path makes sense, then go deeper:
105
+
106
+ - `npx @nerviq/cli plan` and `npx @nerviq/cli apply --dry-run` for reviewable rollout
107
+ - `npx @nerviq/cli governance --json` for policy and permission posture
108
+ - `npx @nerviq/cli benchmark` for isolated projected uplift
109
+ - `npx @nerviq/cli dashboard` for snapshot-backed reporting
110
+
111
+ If you want a public inspectable example, see:
112
+
113
+ - [DnaFin/nerviq-multi-agent-before-after](https://github.com/DnaFin/nerviq-multi-agent-before-after)
114
+
115
+ ## Need help?
116
+
117
+ - **Docs:** [nerviq.net/docs/getting-started](https://nerviq.net/docs/getting-started)
118
+ - **GitHub:** [github.com/nerviq/nerviq](https://github.com/nerviq/nerviq)
119
+ - **Discord:** [Join the community](https://discord.gg/nerviq)
@@ -0,0 +1,54 @@
1
+ # NERVIQ GitLab CI Template
2
+ # Ready-to-copy .gitlab-ci.yml for running nerviq audit on every push/MR.
3
+ # Copy this file to your project root as .gitlab-ci.yml (or include it).
4
+
5
+ # ---------------------------------------------------------------------------
6
+ # Global variables — override in GitLab CI/CD settings or per-job.
7
+ # ---------------------------------------------------------------------------
8
+ variables:
9
+ NERVIQ_THRESHOLD: "60" # Minimum audit score (0-100) to pass
10
+ NODE_ENV: "production"
11
+
12
+ # ---------------------------------------------------------------------------
13
+ # Stages
14
+ # ---------------------------------------------------------------------------
15
+ stages:
16
+ - audit
17
+
18
+ # ---------------------------------------------------------------------------
19
+ # nerviq-audit — runs on every MR and push to main/master
20
+ # ---------------------------------------------------------------------------
21
+ nerviq-audit:
22
+ stage: audit
23
+ image: node:20-slim
24
+ # Run on merge requests AND pushes to the default branches
25
+ rules:
26
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
27
+ - if: '$CI_COMMIT_BRANCH == "main"'
28
+ - if: '$CI_COMMIT_BRANCH == "master"'
29
+ before_script:
30
+ - npm install -g @nerviq/cli
31
+ script:
32
+ - echo "Running NERVIQ audit (threshold=${NERVIQ_THRESHOLD})..."
33
+ - nerviq audit --json --threshold "${NERVIQ_THRESHOLD}" | tee nerviq-report.json
34
+ artifacts:
35
+ # Keep the JSON report for 30 days so it can be downloaded from the pipeline UI
36
+ paths:
37
+ - nerviq-report.json
38
+ expire_in: 30 days
39
+ when: always # Save artifact even if the job fails
40
+
41
+ # ---------------------------------------------------------------------------
42
+ # nerviq-harmony — deeper harmony audit, triggered manually
43
+ # ---------------------------------------------------------------------------
44
+ nerviq-harmony:
45
+ stage: audit
46
+ image: node:20-slim
47
+ rules:
48
+ - when: manual # Only runs when a developer clicks "Play"
49
+ allow_failure: true # Manual jobs should not block the pipeline
50
+ before_script:
51
+ - npm install -g @nerviq/cli
52
+ script:
53
+ - echo "Running NERVIQ harmony audit..."
54
+ - nerviq harmony-audit