@nerviq/cli 0.0.1 → 0.9.0-beta.2

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 (148) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/LICENSE +21 -0
  3. package/README.md +447 -0
  4. package/bin/cli.js +749 -0
  5. package/content/case-study-template.md +91 -0
  6. package/content/claims-governance.md +37 -0
  7. package/content/claude-code/audit-repo/SKILL.md +20 -0
  8. package/content/claude-native-integration.md +60 -0
  9. package/content/devto-article.json +9 -0
  10. package/content/launch-posts.md +226 -0
  11. package/content/pilot-rollout-kit.md +30 -0
  12. package/content/release-checklist.md +31 -0
  13. package/package.json +53 -4
  14. package/src/activity.js +529 -0
  15. package/src/aider/activity.js +226 -0
  16. package/src/aider/config-parser.js +166 -0
  17. package/src/aider/context.js +158 -0
  18. package/src/aider/deep-review.js +316 -0
  19. package/src/aider/domain-packs.js +278 -0
  20. package/src/aider/freshness.js +168 -0
  21. package/src/aider/governance.js +253 -0
  22. package/src/aider/interactive.js +334 -0
  23. package/src/aider/mcp-packs.js +98 -0
  24. package/src/aider/patch.js +214 -0
  25. package/src/aider/plans.js +186 -0
  26. package/src/aider/premium.js +360 -0
  27. package/src/aider/setup.js +404 -0
  28. package/src/aider/techniques.js +1323 -0
  29. package/src/analyze.js +821 -0
  30. package/src/audit.js +1003 -0
  31. package/src/badge.js +13 -0
  32. package/src/benchmark.js +339 -0
  33. package/src/claudex-sync.json +7 -0
  34. package/src/codex/activity.js +324 -0
  35. package/src/codex/config-parser.js +183 -0
  36. package/src/codex/context.js +221 -0
  37. package/src/codex/deep-review.js +493 -0
  38. package/src/codex/domain-packs.js +372 -0
  39. package/src/codex/freshness.js +167 -0
  40. package/src/codex/governance.js +192 -0
  41. package/src/codex/interactive.js +618 -0
  42. package/src/codex/mcp-packs.js +660 -0
  43. package/src/codex/patch.js +209 -0
  44. package/src/codex/plans.js +251 -0
  45. package/src/codex/premium.js +614 -0
  46. package/src/codex/setup.js +603 -0
  47. package/src/codex/techniques.js +2649 -0
  48. package/src/context.js +272 -0
  49. package/src/copilot/activity.js +309 -0
  50. package/src/copilot/config-parser.js +226 -0
  51. package/src/copilot/context.js +197 -0
  52. package/src/copilot/deep-review.js +346 -0
  53. package/src/copilot/domain-packs.js +350 -0
  54. package/src/copilot/freshness.js +197 -0
  55. package/src/copilot/governance.js +222 -0
  56. package/src/copilot/interactive.js +406 -0
  57. package/src/copilot/mcp-packs.js +572 -0
  58. package/src/copilot/patch.js +238 -0
  59. package/src/copilot/plans.js +253 -0
  60. package/src/copilot/premium.js +450 -0
  61. package/src/copilot/setup.js +488 -0
  62. package/src/copilot/techniques.js +1822 -0
  63. package/src/cursor/activity.js +301 -0
  64. package/src/cursor/config-parser.js +265 -0
  65. package/src/cursor/context.js +236 -0
  66. package/src/cursor/deep-review.js +334 -0
  67. package/src/cursor/domain-packs.js +346 -0
  68. package/src/cursor/freshness.js +214 -0
  69. package/src/cursor/governance.js +229 -0
  70. package/src/cursor/interactive.js +391 -0
  71. package/src/cursor/mcp-packs.js +571 -0
  72. package/src/cursor/patch.js +243 -0
  73. package/src/cursor/plans.js +254 -0
  74. package/src/cursor/premium.js +468 -0
  75. package/src/cursor/setup.js +488 -0
  76. package/src/cursor/techniques.js +1786 -0
  77. package/src/deep-review.js +345 -0
  78. package/src/domain-packs.js +364 -0
  79. package/src/formatters/sarif.js +115 -0
  80. package/src/gemini/activity.js +402 -0
  81. package/src/gemini/config-parser.js +275 -0
  82. package/src/gemini/context.js +221 -0
  83. package/src/gemini/deep-review.js +559 -0
  84. package/src/gemini/domain-packs.js +371 -0
  85. package/src/gemini/freshness.js +204 -0
  86. package/src/gemini/governance.js +201 -0
  87. package/src/gemini/interactive.js +860 -0
  88. package/src/gemini/mcp-packs.js +658 -0
  89. package/src/gemini/patch.js +229 -0
  90. package/src/gemini/plans.js +269 -0
  91. package/src/gemini/premium.js +759 -0
  92. package/src/gemini/setup.js +692 -0
  93. package/src/gemini/techniques.js +2084 -0
  94. package/src/governance.js +523 -0
  95. package/src/harmony/advisor.js +383 -0
  96. package/src/harmony/audit.js +303 -0
  97. package/src/harmony/canon.js +444 -0
  98. package/src/harmony/cli.js +331 -0
  99. package/src/harmony/drift.js +401 -0
  100. package/src/harmony/governance.js +313 -0
  101. package/src/harmony/memory.js +238 -0
  102. package/src/harmony/sync.js +458 -0
  103. package/src/harmony/watch.js +336 -0
  104. package/src/index.js +256 -0
  105. package/src/insights.js +119 -0
  106. package/src/interactive.js +118 -0
  107. package/src/mcp-packs.js +597 -0
  108. package/src/opencode/activity.js +286 -0
  109. package/src/opencode/config-parser.js +109 -0
  110. package/src/opencode/context.js +247 -0
  111. package/src/opencode/deep-review.js +313 -0
  112. package/src/opencode/domain-packs.js +240 -0
  113. package/src/opencode/freshness.js +158 -0
  114. package/src/opencode/governance.js +159 -0
  115. package/src/opencode/interactive.js +392 -0
  116. package/src/opencode/mcp-packs.js +474 -0
  117. package/src/opencode/patch.js +184 -0
  118. package/src/opencode/plans.js +231 -0
  119. package/src/opencode/premium.js +413 -0
  120. package/src/opencode/setup.js +449 -0
  121. package/src/opencode/techniques.js +1713 -0
  122. package/src/plans.js +655 -0
  123. package/src/secret-patterns.js +30 -0
  124. package/src/setup.js +1274 -0
  125. package/src/synergy/adaptive.js +261 -0
  126. package/src/synergy/compensation.js +156 -0
  127. package/src/synergy/evidence.js +193 -0
  128. package/src/synergy/learning.js +184 -0
  129. package/src/synergy/patterns.js +227 -0
  130. package/src/synergy/ranking.js +83 -0
  131. package/src/synergy/report.js +163 -0
  132. package/src/synergy/routing.js +152 -0
  133. package/src/techniques.js +1354 -0
  134. package/src/watch.js +229 -0
  135. package/src/windsurf/activity.js +302 -0
  136. package/src/windsurf/config-parser.js +267 -0
  137. package/src/windsurf/context.js +249 -0
  138. package/src/windsurf/deep-review.js +337 -0
  139. package/src/windsurf/domain-packs.js +348 -0
  140. package/src/windsurf/freshness.js +215 -0
  141. package/src/windsurf/governance.js +231 -0
  142. package/src/windsurf/interactive.js +388 -0
  143. package/src/windsurf/mcp-packs.js +535 -0
  144. package/src/windsurf/patch.js +231 -0
  145. package/src/windsurf/plans.js +247 -0
  146. package/src/windsurf/premium.js +467 -0
  147. package/src/windsurf/setup.js +471 -0
  148. package/src/windsurf/techniques.js +1758 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,181 @@
1
+ # Changelog
2
+
3
+ ## [1.16.2] - 2026-04-03
4
+
5
+ ### Changed
6
+ - bumped the local release line to `1.16.2` so the next publish does not overwrite the already-live `1.16.1` npm release
7
+ - synchronized README, docs, launch copy, and proof-facing state to distinguish clearly between public npm latest (`1.16.1`) and local release prep (`1.16.2`)
8
+
9
+ ### Fixed
10
+ - release-truth drift across package metadata, docs, and public-facing proof references
11
+
12
+ ## [1.16.1] - 2026-04-03
13
+
14
+ ### Added
15
+ - `feedback` command validation on the public npm package line
16
+ - stronger secret detection coverage for Anthropic-style keys
17
+ - deep-review sanitization and secret redaction hardening
18
+ - watch-mode resilience improvements across recursive and non-recursive platforms
19
+
20
+ ### Changed
21
+ - increased verified check count from `84` to `85`
22
+ - proof-backed product copy and case-study traceability improvements
23
+
24
+ ## [1.10.3] - 2026-04-02
25
+
26
+ ### Added
27
+ - `--snapshot` support for `audit`, `augment`, `suggest-only`, `benchmark`, and `governance`, writing normalized evidence artifacts under `.claude/claudex-setup/snapshots/`
28
+ - shared snapshot history via `index.json` so before/after work can accumulate into a single local evidence spine
29
+ - `governance --out governance.md` for a shareable governance / pilot-readiness artifact
30
+ - packaged Claude-native `audit-repo` skill template under `content/claude-code/audit-repo/`
31
+ - lightweight release checklist in `content/release-checklist.md`
32
+
33
+ ### Changed
34
+ - default audit now surfaces `Top 5 Next Actions` with rationale, traceability, risk, confidence, and a suggested next command
35
+ - `--lite` now gives a shorter beginner-first top-3 quick scan
36
+ - README and docs now reflect snapshot artifacts, governance export, and the Claude-native skill path
37
+ - packaged content and public-facing counts are now aligned with the current CLAUDEX state
38
+
39
+ ## [1.14.0] - 2026-04-03
40
+
41
+ ### Added
42
+ - Check-level test matrix: 327 verified scenarios across all 84 checks
43
+ - Golden matrix: 12 repo profile tests with expected results
44
+
45
+ ### Fixed
46
+ - `hooks` check now detects hooks in settings.json (not only .claude/hooks/ dir)
47
+ - `context7Mcp` check now reads .mcp.json
48
+ - `skillUsesPaths` now traverses skill subdirectories (skills/name/SKILL.md)
49
+ - `lintCommand` now matches npm/yarn/pnpm/bun lint commands
50
+
51
+ ## [1.13.0] - 2026-04-03
52
+
53
+ ### Added
54
+ - 10 new checks (74→84): project description, directory structure, multiple hook types, stop-failure hook, skill paths, MCP env config, gitignore local settings, .env.example, package scripts, type checking
55
+ - 15 new tests (58→73): history/compare/trend, new checks structure, CLI commands, deny depth, negative instructions, --require flag
56
+ - All references updated to 74→84 checks
57
+
58
+ ## [1.12.0] - 2026-04-03
59
+
60
+ ### Added
61
+ - 12 new checks (62→74): test coverage, agent tool restrictions, auto-memory, sandbox, deny rule depth, git attribution, effort level, snapshot history, worktree, negative instructions, output style, CI variants
62
+ - 8 new stacks (22→30): Deno, Bun, Elixir, Astro, Remix, NestJS, Laravel, .NET
63
+ - Deeper domain detection: llamaindex, crewai, autogen, ollama for AI/ML; paypal, square, adyen, medusa for ecommerce; chromatic, style-dictionary for design; capacitor, ionic for mobile
64
+
65
+ ### Fixed
66
+ - `githubActionsOrCI` check used non-existent `ctx.hasFile()` — now uses `ctx.fileContent()`
67
+ - `.NET` stack detection no longer uses glob patterns
68
+
69
+ ## [1.11.0] - 2026-04-03
70
+
71
+ ### Added
72
+ - `history` command — show score timeline from saved snapshots
73
+ - `compare` command — diff latest vs previous snapshot with delta, regressions, improvements
74
+ - `trend --out report.md` — export trend report as shareable markdown
75
+ - `--require A,B` CI flag — exit code 1 if named checks fail (policy guardrails)
76
+ - Agentic DX positioning in README
77
+ - Real results table (4 case studies) in README
78
+ - Claude-native integration guide (skill, hook, agent examples)
79
+ - Trust-first help text reordering
80
+
81
+ ### Fixed
82
+ - Hook checks (hooksInSettings, preToolUse, postToolUse, sessionStart) now OR across settings.json and settings.local.json
83
+
84
+ ## [1.10.2] - 2026-04-02
85
+
86
+ ### Fixed
87
+ - MCP recommendations are now less speculative: `postgres-mcp` requires explicit Postgres signals, `figma-mcp` only appears for design-system repos, and `mcp-security` is no longer auto-added just because multiple packs were suggested
88
+ - `sentry-mcp` now requires real observability signals or stricter operational domains instead of appearing for every frontend/backend repo
89
+ - design-system detection now respects `.storybook/` directories directly, improving frontend pack accuracy
90
+
91
+ ### Added
92
+ - MCP preflight warnings for `setup`, `plan`, and `apply` when selected packs require missing environment variables
93
+ - user-facing docs now reflect the actual 22 detected stacks
94
+
95
+ ## [1.10.1] - 2026-04-02
96
+
97
+ ### Fixed
98
+ - corrected MCP pack package names to verified npm packages
99
+ - aligned settings hierarchy checks with shared settings precedence
100
+
101
+ ## [1.10.0] - 2026-04-01
102
+
103
+ ### Added
104
+ - 11 new MCP packs (15→26): sequential-thinking, jira-confluence, ga4-analytics, search-console, n8n-workflows, zendesk, infisical-secrets, shopify, huggingface, blender, wordpress
105
+ - 7 new domain packs (10→17→16 final): ecommerce, ai-ml, devops-cicd, design-system, docs-content, security-focused
106
+ - Smart recommendation for all new packs based on detected stack and domain
107
+ - Detection logic: Storybook, Docusaurus, Stripe, LangChain, GitHub Actions, auth deps
108
+
109
+ ## [1.9.0] - 2026-03-31
110
+
111
+ ### Added
112
+ - 3 new domain packs: `monorepo`, `mobile`, `regulated-lite` (7→10 total)
113
+ - 3 new MCP packs: `github-mcp`, `postgres-mcp`, `memory-mcp` (2→5 total)
114
+ - smart MCP pack recommendation based on detected domain packs
115
+ - `suggest-only --out report.md` exports full analysis as shareable markdown
116
+ - `why` explanations for all strengths preserved (20+ specific reasons)
117
+ - `why` explanations for all gap findings (12+ specific reasons)
118
+ - 5 new hooks in governance registry: duplicate-id-check, injection-defense, trust-drift-check, session-init, protect-catalog
119
+ - case study template in `content/case-study-template.md`
120
+ - hook risk level display in governance output (color-coded low/medium/high)
121
+
122
+ ### Fixed
123
+ - **Settings hierarchy bug**: `noBypassPermissions` and `secretsProtection` checks now correctly read `.claude/settings.json` before `.claude/settings.local.json`, so personal maintainer overrides no longer fail the shared audit
124
+ - domain pack detection now handles monorepo (nx.json, turbo.json, lerna.json, workspaces), mobile (React Native, Flutter, iOS/Android dirs), and regulated repos (SECURITY.md, compliance dirs)
125
+
126
+ ### Changed
127
+ - strengths preserved section now shows 8 items (was 6) with specific value explanations
128
+ - claudex-sync.json updated with domain pack, MCP pack, and anti-pattern counts
129
+
130
+ ## [1.8.0] - 2026-03-31
131
+
132
+ ### Added
133
+ - domain pack recommendations for backend, frontend, data, infra, OSS, and enterprise-governed repos
134
+ - MCP pack recommendations and merge support for `context7-docs` and `next-devtools`
135
+ - workflow-evidence coverage in benchmark reports
136
+ - runtime settings overlays so `apply --plan` still respects current `--profile` and `--mcp-pack` flags
137
+
138
+ ### Changed
139
+ - benchmark now respects the selected profile and MCP pack options during isolated-copy runs
140
+ - governance and suggest-only outputs now expose domain packs and MCP packs directly
141
+ - README and docs clarify the local-vs-opt-in-network boundary for core flows vs `deep-review`
142
+ - audit output now frames `setup` as starter-safe generation instead of an automatic full fix
143
+
144
+ ## [1.7.0] - 2026-03-31
145
+
146
+ ### Added
147
+ - `augment` / `suggest-only` repo-aware analysis with strengths, gaps, top actions, risk notes, and rollout order
148
+ - `plan` command for exportable proposal bundles with file previews and diff-style output
149
+ - `apply` command for selective starter-safe apply flows with rollback manifests and activity artifacts
150
+ - `governance` command with permission profiles, hook registry, policy packs, and pilot rollout guidance
151
+ - `benchmark` command that measures before/after impact in an isolated temp copy and exports evidence reports
152
+ - claims governance and pilot rollout docs in `content/`
153
+
154
+ ### Changed
155
+ - `setup` now exposes reusable planning primitives and returns written/preserved file summaries
156
+ - CLI now supports `--out`, `--plan`, `--only`, and `--dry-run`
157
+ - README and docs now reflect the actual product surface instead of only audit/setup flows
158
+ - benchmark and proposal workflows now preserve existing files by default and treat mature repos as review-first
159
+
160
+ ## [0.2.0] - 2026-03-31
161
+
162
+ ### Added
163
+ - 50+ audit checks (up from 16)
164
+ - 8 new categories: Design, DevOps, Hygiene, Performance, MCP, Prompting, Git Safety, Automation
165
+ - 6 new stack detections: Svelte, Flutter, Ruby, Java, Kotlin, Swift
166
+ - Improved CLAUDE.md template with Mermaid diagrams and XML constraints
167
+ - Auto-sync with CLAUDEX research catalog (1,107 items)
168
+ - Copy-paste config snippets in fix suggestions
169
+
170
+ ### Changed
171
+ - Knowledge base upgraded from 972 to 1,107 verified techniques
172
+ - Better scoring weights per category
173
+
174
+ ## [0.1.0] - 2026-03-30
175
+
176
+ ### Added
177
+ - Initial release
178
+ - 16 audit checks
179
+ - Automatic setup with CLAUDE.md, hooks, commands, skills, rules, agents
180
+ - Stack detection for 12 frameworks
181
+ - JSON output mode
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CLAUDEX Project
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,447 @@
1
+ # claudex-setup
2
+
3
+ > Score your repo's Claude Code setup against 85 checks. See what's missing, apply only what you approve with rollback, and benchmark the impact — without breaking existing config.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/claudex-setup)](https://www.npmjs.com/package/claudex-setup)
6
+ [![npm downloads](https://img.shields.io/npm/dm/claudex-setup)](https://www.npmjs.com/package/claudex-setup)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
+
9
+ ### What this is
10
+
11
+ - The **Agentic DX layer for Claude Code** — audit, improve, govern, and benchmark how Claude works with your repo
12
+ - A **Claude Code workflow audit and improvement tool** — not an MCP installer, not a code generator
13
+ - Scores your repo 0-100 across CLAUDE.md, hooks, commands, agents, skills, MCP, security, and more
14
+ - Proposes changes as diffs you review — applies only what you approve, with rollback for every change
15
+ - Includes governance (permission profiles, hook registry, policy packs) and benchmark (isolated before/after)
16
+
17
+ ### What this is NOT
18
+
19
+ - Not an MCP setup tool (MCP packs are one of 26 features, not the product)
20
+ - Not a code generator or refactoring tool — it configures how Claude works with your repo, not the code itself
21
+ - Not a replacement for hand-crafted CLAUDE.md — generated output is a strong starting point, not a final answer
22
+ - Not a score you should chase blindly — 90/100 with bad code is still bad code
23
+
24
+ ## Quick Start
25
+
26
+ ```bash
27
+ npx claudex-setup --lite # Quick beginner scan: top 3 fixes + next command
28
+ npx claudex-setup # Audit your project (10 seconds)
29
+ npx claudex-setup --snapshot # Save a normalized snapshot under .claude/claudex-setup/
30
+ npx claudex-setup setup # Create a starter-safe baseline
31
+ npx claudex-setup augment # Repo-aware plan, no writes
32
+ npx claudex-setup plan # Export proposal bundles with file previews
33
+ npx claudex-setup governance # See permission profiles, packs, and pilot guidance
34
+ npx claudex-setup governance --out governance.md # Export a shareable governance report
35
+ npx claudex-setup benchmark # Measure before/after in an isolated temp copy
36
+ npx claudex-setup --threshold 60 # Fail CI if score is below 60
37
+ ```
38
+
39
+ No install. No config. No dependencies.
40
+
41
+ ## Real Results
42
+
43
+ Tested on 4 real projects — not demos:
44
+
45
+ | Project | Type | Before | After | Delta |
46
+ |---------|------|--------|-------|-------|
47
+ | CLAUDEX | Research engine, Python | 62 | 90 | **+28** |
48
+ | VTCLE | Marketing automation, FastAPI | 46 | 64 | **+18** |
49
+ | Social | Mobile app, React Native | 40 | 48 | **+8** |
50
+ | Polymiro | Prediction system, Python/Docker | 35 | 48 | **+13** |
51
+
52
+ Most common gaps found: missing secrets protection, no deny rules, no mermaid diagram, no hooks in settings.
53
+
54
+ > Scores measured with claudex-setup@1.10.3 on 2026-04-03. Current npm latest: 1.16.1, so exact scores may differ slightly on the newer release.
55
+ >
56
+ > Canonical proof artifacts: [Index](https://github.com/DnaFin/claudex/blob/main/research/proof-artifacts/README.md) | [CLAUDEX trace](https://github.com/DnaFin/claudex/blob/main/research/proof-artifacts/claudex-self-dogfood-proof-trace-2026-04-03.md) | [VTCLE trace](https://github.com/DnaFin/claudex/blob/main/research/proof-artifacts/vtcle-proof-trace-2026-04-03.md) | [Social trace](https://github.com/DnaFin/claudex/blob/main/research/proof-artifacts/social-proof-trace-2026-04-03.md) | [Polymiro trace](https://github.com/DnaFin/claudex/blob/main/research/proof-artifacts/polymiro-proof-trace-2026-04-03.md)
57
+ >
58
+ > Narrative case studies: [VTCLE](https://github.com/DnaFin/claudex/blob/main/research/case-study-vtcle-2026-04-03.md) | [Social](https://github.com/DnaFin/claudex/blob/main/research/case-study-social-2026-04-03.md) | [Polymiro](https://github.com/DnaFin/claudex/blob/main/research/case-study-polymiro-2026-04-03.md)
59
+
60
+ ## What You Get
61
+
62
+ ```
63
+ claudex-setup audit
64
+ ═══════════════════════════════════════
65
+ Detected: React, TypeScript, Docker
66
+
67
+ ████████████████░░░░ 78/100
68
+
69
+ ✅ Passing
70
+ CLAUDE.md project instructions
71
+ Mermaid architecture diagram
72
+ Hooks (PreToolUse + PostToolUse)
73
+ Custom slash commands (5 commands)
74
+ XML constraint blocks
75
+ Secrets protection configured
76
+
77
+ 🟡 High Impact
78
+ CI pipeline configured
79
+ → Add .github/workflows/ for automated testing
80
+
81
+ ⚡ Top 5 Next Actions
82
+ 1. Add CLAUDE.md verification criteria
83
+ Why: Claude needs an explicit verification loop before handoff
84
+ Trace: failed-check:verificationLoop | impact:critical | category:quality
85
+ Risk: high | Confidence: high
86
+ Fix: Add test/lint/build commands to CLAUDE.md so Claude can verify its own work
87
+
88
+ 2. Configure safe permissions + deny rules
89
+ Why: Explicit permissions are the main safety layer for repo writes
90
+ Trace: failed-check:permissionDeny | impact:high | category:security
91
+ Risk: medium | Confidence: high
92
+ Fix: Add permissions.deny rules to block dangerous operations
93
+
94
+ Weakest areas:
95
+ design: none (0/2)
96
+ devops: none (0/4)
97
+
98
+ 29/85 checks passing
99
+ Next command: npx claudex-setup setup
100
+ ```
101
+
102
+ Want the shortest possible first run?
103
+
104
+ ```bash
105
+ npx claudex-setup --lite
106
+ ```
107
+
108
+ That prints a compact top-3 quick scan with one clear next command.
109
+
110
+ ## All Commands
111
+
112
+ | Command | What it does |
113
+ |---------|-------------|
114
+ | `npx claudex-setup` | **Discover** - Score 0-100 against 85 checks |
115
+ | `npx claudex-setup discover` | **Discover** - Alias for audit mode |
116
+ | `npx claudex-setup setup` | **Starter** - Smart CLAUDE.md + hooks + commands + agents |
117
+ | `npx claudex-setup starter` | **Starter** - Alias for setup mode |
118
+ | `npx claudex-setup setup --auto` | **Auto-setup** - No prompts, apply all |
119
+ | `npx claudex-setup augment` | **Augment** - Repo-aware improvement plan, no writes |
120
+ | `npx claudex-setup suggest-only` | **Suggest-Only** - Structured recommendation report, no writes |
121
+ | `npx claudex-setup plan` | **Plan** - Export proposal bundles with previews, rationale, and file-level changes |
122
+ | `npx claudex-setup apply` | **Apply** - Apply ready proposal bundles with rollback + activity artifacts |
123
+ | `npx claudex-setup governance` | **Governance** - Permission profiles, hook registry, policy packs, pilot kit |
124
+ | `npx claudex-setup benchmark` | **Benchmark** - Before/after evidence from an isolated temp copy |
125
+ | `npx claudex-setup interactive` | **Wizard** - Step-by-step guided tour |
126
+ | `npx claudex-setup watch` | **Watch** - Live monitoring with score delta and cross-platform directory fallback |
127
+ | `npx claudex-setup badge` | **Badge** - Generate shields.io badge for README |
128
+ | `npx claudex-setup feedback` | **Feedback** - Record local recommendation outcomes or show outcome summary |
129
+ | `npx claudex-setup deep-review` | **Deep Review** - AI-powered config analysis (Claude Code or API key, selected config only) |
130
+ | `npx claudex-setup insights` | **Insights** - View community aggregate stats |
131
+
132
+ ## Codex Preview On Main
133
+
134
+ The current published npm package is still Claude-first.
135
+
136
+ On the current main branch and next release line, `claudex-setup` also includes a Codex vertical through:
137
+
138
+ - `npx claudex-setup --platform codex`
139
+ - `npx claudex-setup --platform codex augment`
140
+ - `npx claudex-setup --platform codex suggest-only`
141
+ - `npx claudex-setup --platform codex setup`
142
+ - `npx claudex-setup --platform codex plan`
143
+ - `npx claudex-setup --platform codex apply`
144
+ - `npx claudex-setup --platform codex governance`
145
+ - `npx claudex-setup --platform codex benchmark`
146
+
147
+ That means the Codex line now has:
148
+
149
+ - audit and `--lite`
150
+ - no-write advisory flows (`augment`, `suggest-only`)
151
+ - setup / plan / apply
152
+ - governance and benchmark
153
+ - initial domain pack recommendations (`baseline-general`, `backend-api`, `frontend-ui`, `enterprise-governed`, `monorepo`, `infra-platform`)
154
+
155
+ Current pre-release validation artifacts:
156
+
157
+ - [Codex v1.0 validation summary](https://github.com/DnaFin/claudex/blob/main/research/codex-v1.0-validation-results-v1-2026-04-03.md)
158
+ - [Codex case study — CLAUDEX](https://github.com/DnaFin/claudex/blob/main/research/case-study-codex-claudex-2026-04-03.md)
159
+ - [Codex case study — claudex-setup](https://github.com/DnaFin/claudex/blob/main/research/case-study-codex-claudex-setup-2026-04-03.md)
160
+ - [Codex case study — VTCLE](https://github.com/DnaFin/claudex/blob/main/research/case-study-codex-vtcle-2026-04-03.md)
161
+
162
+ Boundary note:
163
+
164
+ - these Codex artifacts are measured on the local `1.16.2` pre-release line
165
+ - do not present them as npm-latest proof until the Codex-capable package line is published
166
+
167
+ ### Options
168
+
169
+ | Flag | Effect |
170
+ |------|--------|
171
+ | `--threshold N` | Exit with code 1 if score is below `N` (great for CI) |
172
+ | `--out FILE` | Write JSON or markdown output to a file |
173
+ | `--plan FILE` | Load a previously exported plan file |
174
+ | `--only A,B` | Limit plan/apply to selected proposal ids |
175
+ | `--profile NAME` | Choose a permission profile for write-capable flows |
176
+ | `--mcp-pack A,B` | Merge named MCP packs into generated or patched settings |
177
+ | `--key NAME` | Recommendation key for `feedback` logging |
178
+ | `--status VALUE` | Outcome status: `accepted`, `rejected`, or `deferred` |
179
+ | `--effect VALUE` | Outcome effect: `positive`, `neutral`, or `negative` |
180
+ | `--score-delta N` | Optional observed score delta tied to the feedback event |
181
+ | `--snapshot` | Save a normalized artifact under `.claude/claudex-setup/snapshots/` |
182
+ | `--lite` | Show a short top-3 quick scan with one clear next command |
183
+ | `--dry-run` | Preview apply without writing files |
184
+ | `--verbose` | Show all recommendations (not just critical/high) |
185
+ | `--json` | Machine-readable JSON output (for CI) |
186
+ | `--auto` | Apply setup files without prompts |
187
+ | `--insights` | Enable anonymous usage insights (off by default) |
188
+
189
+ ## Smart CLAUDE.md Generation
190
+
191
+ Not a generic template. The `setup` command actually analyzes your project:
192
+
193
+ - **Reads package.json** - includes your actual test, build, lint, dev commands
194
+ - **Reads pyproject.toml** - uses Python project name/description when package.json does not exist
195
+ - **Detects framework** - Next.js Server Components, Django models, FastAPI Pydantic, React hooks
196
+ - **TypeScript-aware** - detects strict mode, adds TS-specific rules
197
+ - **Auto Mermaid diagram** - scans directories and generates architecture visualization (Mermaid diagrams are more token-efficient than prose descriptions, per Anthropic docs)
198
+ - **XML constraint blocks** - adds `<constraints>` and `<verification>` with context-aware rules
199
+ - **Verification criteria** - auto-generates checklist from your actual commands
200
+ - **Safer settings.json** - generated hooks config now includes `acceptEdits` plus deny rules for dangerous or secret-sensitive operations
201
+
202
+ ## Mode Model
203
+
204
+ - **Discover**: score the repo, surface critical issues, and show the best next actions
205
+ - **Starter**: generate a safe baseline when the repo has little or no Claude setup
206
+ - **Augment**: inspect the current repo and build a structured improvement plan without writing files
207
+ - **Suggest-Only**: same no-write analysis, optimized for sharing or manual review
208
+ - **Governance**: surface permission profiles, shipped hooks, policy packs, and pilot guidance
209
+ - **Benchmark**: prove value on an isolated copy before touching the real repo
210
+
211
+ ## Proposal + Apply Workflow
212
+
213
+ Use `plan` when you want a file-by-file proposal bundle before any write happens:
214
+
215
+ ```bash
216
+ npx claudex-setup plan --out claudex-plan.json
217
+ ```
218
+
219
+ Each proposal bundle includes:
220
+
221
+ - trigger reasons tied to failed checks
222
+ - file previews and diff-style output
223
+ - `create`, `patch`, or `manual-review` classification
224
+ - risk/confidence labels
225
+
226
+ Apply only the bundles you want:
227
+
228
+ ```bash
229
+ npx claudex-setup apply --plan claudex-plan.json --only claude-md,hooks
230
+ ```
231
+
232
+ `apply` creates rollback manifests and activity artifacts under `.claude/claudex-setup/`, so every applied batch has a paper trail and a create-or-patch rollback path.
233
+
234
+ ## Governance And Pilot Readiness
235
+
236
+ Use `governance` when the question is "can we pilot this safely?" instead of "what files can you generate?".
237
+
238
+ ```bash
239
+ npx claudex-setup governance
240
+ npx claudex-setup governance --out governance.md
241
+ ```
242
+
243
+ It exposes:
244
+
245
+ - permission profiles: `read-only`, `suggest-only`, `safe-write`, `power-user`, `internal-research`
246
+ - hook registry with trigger point, purpose, side effects, risk, and rollback path
247
+ - policy packs for baseline engineering, security-sensitive repos, OSS, and regulated-lite teams
248
+ - 16 domain packs: backend-api, frontend-ui, data-pipeline, infra-platform, oss-library, enterprise-governed, monorepo, mobile, regulated-lite, ecommerce, ai-ml, devops-cicd, design-system, docs-content, security-focused, baseline-general
249
+ - 26 MCP packs: Context7, Next.js devtools, GitHub, PostgreSQL, Playwright, Docker, Notion, Linear, Sentry, Slack, Stripe, Figma, Shopify, Hugging Face, Blender, WordPress, Jira/Confluence, GA4, Search Console, n8n, Zendesk, Infisical, Composio, memory, sequential-thinking, mcp-security
250
+ - a pilot rollout kit with scope, approvals, success metrics, and rollback expectations
251
+
252
+ Use `--out governance.md` if you want a shareable artifact for leads, platform teams, or security review.
253
+
254
+ ## Domain Packs And MCP Packs
255
+
256
+ `augment` and `suggest-only` now recommend repo-shaped guidance instead of giving every project the same advice.
257
+
258
+ - 16 domain packs identify repo shape and recommend relevant modules
259
+ - 26 MCP packs recommend tooling companions matched to your detected domain and stack
260
+ - write-capable flows can merge MCP packs directly into `.claude/settings.json`
261
+
262
+ ```bash
263
+ npx claudex-setup suggest-only --json
264
+ npx claudex-setup setup --mcp-pack context7-docs
265
+ npx claudex-setup apply --plan claudex-plan.json --only hooks --mcp-pack context7-docs,next-devtools
266
+ ```
267
+
268
+ ## Benchmark And Evidence
269
+
270
+ Use `benchmark` to measure the impact of starter-safe improvements without modifying your working repo:
271
+
272
+ ```bash
273
+ npx claudex-setup benchmark --out benchmark.md
274
+ ```
275
+
276
+ Benchmark mode:
277
+
278
+ - runs a baseline audit on your repo
279
+ - copies the repo to an isolated temp workspace
280
+ - applies starter-safe artifacts only in the copy
281
+ - reruns the audit and emits before/after deltas, workflow-evidence coverage, a case-study summary, and an executive recommendation
282
+
283
+ If you want repeatable evidence artifacts for before/after work, add `--snapshot` to `audit`, `augment`, `suggest-only`, `benchmark`, or `governance`.
284
+
285
+ ```bash
286
+ npx claudex-setup --snapshot
287
+ npx claudex-setup augment --snapshot
288
+ npx claudex-setup benchmark --snapshot
289
+ ```
290
+
291
+ Snapshots are written to `.claude/claudex-setup/snapshots/` with a shared envelope and an `index.json` history file.
292
+
293
+ If you want a local-first recommendation loop, record what actually helped:
294
+
295
+ ```bash
296
+ npx claudex-setup feedback --key permissionDeny --status accepted --effect positive --score-delta 12
297
+ npx claudex-setup feedback
298
+ ```
299
+
300
+ Feedback stays under `.claude/claudex-setup/outcomes/` and is used only as a local ranking signal. Recommendations with repeated positive outcomes get a measured boost; recommendations with repeated negative or rejected outcomes get pushed down.
301
+
302
+ `watch` uses native `fs.watch` with recursive directory watches where the platform supports them, and an expanded directory fallback elsewhere. That keeps nested `.claude/` and `.github/` changes visible on Linux too, while staying zero-dependency. Native filesystem watch semantics can still be noisier on very large repos or network filesystems, so the command is best treated as fast local feedback rather than a CI-grade signal.
303
+
304
+ ## Use Inside Claude Code
305
+
306
+ If you want the first Claude-native entry point, copy the shipped skill template into your repo.
307
+
308
+ If `claudex-setup` is installed locally in `node_modules`, use:
309
+
310
+ ```bash
311
+ mkdir -p .claude/skills/audit-repo
312
+ cp ./node_modules/claudex-setup/content/claude-code/audit-repo/SKILL.md .claude/skills/audit-repo/SKILL.md
313
+ ```
314
+
315
+ If you are using `npx` only, copy the same file from the GitHub repo at `content/claude-code/audit-repo/SKILL.md`.
316
+
317
+ The skill runs `npx claudex-setup --json`, summarizes the score, shows the top next actions, and points to the right next command without applying changes.
318
+
319
+ ## 85 Checks Across 14 Categories
320
+
321
+ The exact applicable count can be lower on a given repo because stack-specific checks are skipped when they do not apply.
322
+
323
+ | Category | Checks | Key items |
324
+ |----------|-------:|-----------|
325
+ | Memory | 8 | CLAUDE.md, architecture, conventions, imports |
326
+ | Quality | 6 | verification loops, test/lint/build, testing strategy |
327
+ | Git Safety | 6 | .gitignore, env protection, attribution, secret detection |
328
+ | Workflow | 12 | commands, skills, rules, agents, snapshots |
329
+ | Security | 7 | permissions, secrets, deny rules, sandbox awareness |
330
+ | Automation | 7 | hook coverage, specificity, session and error hooks |
331
+ | Design | 2 | frontend anti-slop guidance, styling signals |
332
+ | DevOps | 5 | Docker, CI, Terraform, infra signals |
333
+ | Hygiene | 8 | README, changelog, license, env example, version pinning |
334
+ | Performance | 3 | context management, compaction, effort level |
335
+ | MCP & Tools | 4 | servers, Context7, tool companions, env config |
336
+ | Prompting | 6 | constraints, examples, negative rules, style guidance |
337
+ | Features | 2 | channels, worktrees |
338
+ | **Quality Deep** | **9** | **freshness, contradictions, deprecated patterns, maxTurns, $ARGUMENTS, hook specificity** |
339
+
340
+ ## Stack Detection
341
+
342
+ Auto-detects and tailors output for 30 stacks:
343
+
344
+ | | |
345
+ |--|--|
346
+ | **Frontend** | React, Vue, Angular, Next.js, Svelte, Astro |
347
+ | **Backend** | Node.js, Python, Django, FastAPI, Express, NestJS, Spring Boot |
348
+ | **Mobile** | React Native, Expo, Flutter, Swift, Kotlin |
349
+ | **Systems** | Rust, Go, Java, Ruby, C++, Bazel, Deno, Bun |
350
+ | **Language** | TypeScript |
351
+ | **Infra** | Docker, Terraform, Kubernetes, Wrangler |
352
+
353
+ ## GitHub Action
354
+
355
+ Add to `.github/workflows/claudex.yml`:
356
+
357
+ ```yaml
358
+ name: CLAUDEX Audit
359
+ on: [pull_request]
360
+ jobs:
361
+ audit:
362
+ runs-on: ubuntu-latest
363
+ steps:
364
+ - uses: actions/checkout@v4
365
+ - uses: DnaFin/claudex-setup@v1.16.1
366
+ with:
367
+ threshold: 50
368
+ ```
369
+
370
+ ## Badge
371
+
372
+ Add a readiness badge to your README:
373
+
374
+ ```bash
375
+ npx claudex-setup badge
376
+ # Output: [![Claude Code Ready](https://img.shields.io/badge/...)](...)
377
+ ```
378
+
379
+ ## For Veteran Claude Code Users
380
+
381
+ Already have a solid CLAUDE.md and hooks? Two things for you:
382
+
383
+ ### Deep Review (AI-powered)
384
+
385
+ ```bash
386
+ npx claudex-setup deep-review
387
+ ```
388
+
389
+ Claude reads your actual config and gives specific feedback: what's strong, what has issues, what's missing for your stack. This is an AI-assisted review, not a local heuristic audit. Your config goes to the Anthropic API only when you run this command; we do not receive it.
390
+
391
+ Deep-review trust boundary:
392
+
393
+ - sends only selected Claude-facing config surfaces: `CLAUDE.md`, settings, commands, agents, rules, hooks, and package scripts
394
+ - truncates large files before sending
395
+ - redacts embedded secrets before sending
396
+ - treats embedded repo text as untrusted review data, not as instructions to follow
397
+ - keeps all non-`deep-review` flows local
398
+
399
+ ### Quality-Deep Checks
400
+
401
+ The v0.4.0 quality-deep checks catch what basic audits miss:
402
+
403
+ | Check | What it catches |
404
+ |-------|----------------|
405
+ | **Freshness** | CLAUDE.md that doesn't mention modern features (hooks, skills, MCP) |
406
+ | **Conciseness** | CLAUDE.md over 200 lines (wastes tokens every session) |
407
+ | **Contradictions** | Conflicting rules ("always X" + "never X") |
408
+ | **Hook specificity** | Hooks without matchers that fire on every tool call |
409
+ | **Permission hygiene** | bypassPermissions still enabled in production |
410
+ | **Command flexibility** | Commands without $ARGUMENTS (static, not reusable) |
411
+ | **Agent limits** | Agents without maxTurns (can run forever) |
412
+ | **Security workflow** | No /security-review in your process |
413
+ | **Deprecated patterns** | Old model names, prefill, deprecated API formats |
414
+
415
+ These checks evaluate **quality**, not just existence. A well-configured project with stale patterns will surface real improvements.
416
+
417
+ ## Privacy
418
+
419
+ - **Zero dependencies** - nothing extra to audit
420
+ - **Core flows run locally** - audit, setup, augment, plan, apply, governance, and benchmark run on your machine
421
+ - **Deep review is opt-in** - only `deep-review` sends selected config to Anthropic or your local Claude Code session for analysis
422
+ - **Deep review sanitizes before send** - selected snippets are truncated, secret-redacted, and wrapped as untrusted review data
423
+ - **Benchmark uses an isolated temp copy** - your live repo is not touched
424
+ - **Anonymous insights** - opt-in, no PII, no file contents (enable with `--insights`)
425
+ - **MIT Licensed** - use anywhere
426
+
427
+ ## Backed by Research
428
+
429
+ Every check traces to a verified technique from a systematic audit of:
430
+ - All 73 official Claude Code documentation pages
431
+ - 100+ community MCP servers verified via GitHub API
432
+ - Anthropic blog posts and benchmark papers
433
+ - 194 hands-on experiments with real evidence
434
+
435
+ The catalog includes 1,107 entries (features, techniques, patterns, tools, stats, and known limitations) — not all are actionable checks. 948 were verified with real evidence. Continuously updated.
436
+
437
+ **Note:** A hand-crafted CLAUDE.md that reflects your real conventions will always be better than a generated one. This tool is most useful for projects starting from zero, or as a checklist for what you might be missing.
438
+
439
+ ## Requirements
440
+
441
+ - Node.js 18+
442
+ - macOS, Linux, Windows
443
+ - No global install (npx handles it)
444
+
445
+ ## License
446
+
447
+ MIT