claudex-setup 1.16.0 → 1.16.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.
- package/CHANGELOG.md +21 -0
- package/README.md +52 -23
- package/bin/cli.js +92 -5
- package/content/launch-posts.md +159 -92
- package/package.json +2 -2
- package/src/activity.js +195 -1
- package/src/analyze.js +11 -6
- package/src/audit.js +49 -14
- package/src/context.js +106 -0
- package/src/deep-review.js +95 -68
- package/src/domain-packs.js +13 -4
- package/src/index.js +4 -0
- package/src/mcp-packs.js +16 -0
- package/src/secret-patterns.js +30 -0
- package/src/techniques.js +4 -2
- package/src/watch.js +170 -42
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
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
|
+
|
|
3
24
|
## [1.10.3] - 2026-04-02
|
|
4
25
|
|
|
5
26
|
### Added
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# claudex-setup
|
|
2
2
|
|
|
3
|
-
> Score your repo's Claude Code setup against
|
|
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
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/claudex-setup)
|
|
6
6
|
[](https://www.npmjs.com/package/claudex-setup)
|
|
@@ -51,7 +51,11 @@ Tested on 4 real projects — not demos:
|
|
|
51
51
|
|
|
52
52
|
Most common gaps found: missing secrets protection, no deny rules, no mermaid diagram, no hooks in settings.
|
|
53
53
|
|
|
54
|
-
> Scores measured with claudex-setup@1.10.3 on 2026-04-03.
|
|
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)
|
|
55
59
|
|
|
56
60
|
## What You Get
|
|
57
61
|
|
|
@@ -91,7 +95,7 @@ Most common gaps found: missing secrets protection, no deny rules, no mermaid di
|
|
|
91
95
|
design: none (0/2)
|
|
92
96
|
devops: none (0/4)
|
|
93
97
|
|
|
94
|
-
29/
|
|
98
|
+
29/85 checks passing
|
|
95
99
|
Next command: npx claudex-setup setup
|
|
96
100
|
```
|
|
97
101
|
|
|
@@ -107,7 +111,7 @@ That prints a compact top-3 quick scan with one clear next command.
|
|
|
107
111
|
|
|
108
112
|
| Command | What it does |
|
|
109
113
|
|---------|-------------|
|
|
110
|
-
| `npx claudex-setup` | **Discover** - Score 0-100 against
|
|
114
|
+
| `npx claudex-setup` | **Discover** - Score 0-100 against 85 checks |
|
|
111
115
|
| `npx claudex-setup discover` | **Discover** - Alias for audit mode |
|
|
112
116
|
| `npx claudex-setup setup` | **Starter** - Smart CLAUDE.md + hooks + commands + agents |
|
|
113
117
|
| `npx claudex-setup starter` | **Starter** - Alias for setup mode |
|
|
@@ -119,9 +123,10 @@ That prints a compact top-3 quick scan with one clear next command.
|
|
|
119
123
|
| `npx claudex-setup governance` | **Governance** - Permission profiles, hook registry, policy packs, pilot kit |
|
|
120
124
|
| `npx claudex-setup benchmark` | **Benchmark** - Before/after evidence from an isolated temp copy |
|
|
121
125
|
| `npx claudex-setup interactive` | **Wizard** - Step-by-step guided tour |
|
|
122
|
-
| `npx claudex-setup watch` | **Watch** - Live monitoring with score delta |
|
|
126
|
+
| `npx claudex-setup watch` | **Watch** - Live monitoring with score delta and cross-platform directory fallback |
|
|
123
127
|
| `npx claudex-setup badge` | **Badge** - Generate shields.io badge for README |
|
|
124
|
-
| `npx claudex-setup
|
|
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) |
|
|
125
130
|
| `npx claudex-setup insights` | **Insights** - View community aggregate stats |
|
|
126
131
|
|
|
127
132
|
### Options
|
|
@@ -134,6 +139,10 @@ That prints a compact top-3 quick scan with one clear next command.
|
|
|
134
139
|
| `--only A,B` | Limit plan/apply to selected proposal ids |
|
|
135
140
|
| `--profile NAME` | Choose a permission profile for write-capable flows |
|
|
136
141
|
| `--mcp-pack A,B` | Merge named MCP packs into generated or patched settings |
|
|
142
|
+
| `--key NAME` | Recommendation key for `feedback` logging |
|
|
143
|
+
| `--status VALUE` | Outcome status: `accepted`, `rejected`, or `deferred` |
|
|
144
|
+
| `--effect VALUE` | Outcome effect: `positive`, `neutral`, or `negative` |
|
|
145
|
+
| `--score-delta N` | Optional observed score delta tied to the feedback event |
|
|
137
146
|
| `--snapshot` | Save a normalized artifact under `.claude/claudex-setup/snapshots/` |
|
|
138
147
|
| `--lite` | Show a short top-3 quick scan with one clear next command |
|
|
139
148
|
| `--dry-run` | Preview apply without writing files |
|
|
@@ -246,6 +255,17 @@ npx claudex-setup benchmark --snapshot
|
|
|
246
255
|
|
|
247
256
|
Snapshots are written to `.claude/claudex-setup/snapshots/` with a shared envelope and an `index.json` history file.
|
|
248
257
|
|
|
258
|
+
If you want a local-first recommendation loop, record what actually helped:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
npx claudex-setup feedback --key permissionDeny --status accepted --effect positive --score-delta 12
|
|
262
|
+
npx claudex-setup feedback
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
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.
|
|
266
|
+
|
|
267
|
+
`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.
|
|
268
|
+
|
|
249
269
|
## Use Inside Claude Code
|
|
250
270
|
|
|
251
271
|
If you want the first Claude-native entry point, copy the shipped skill template into your repo.
|
|
@@ -261,26 +281,26 @@ If you are using `npx` only, copy the same file from the GitHub repo at `content
|
|
|
261
281
|
|
|
262
282
|
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.
|
|
263
283
|
|
|
264
|
-
##
|
|
284
|
+
## 85 Checks Across 14 Categories
|
|
265
285
|
|
|
266
286
|
The exact applicable count can be lower on a given repo because stack-specific checks are skipped when they do not apply.
|
|
267
287
|
|
|
268
288
|
| Category | Checks | Key items |
|
|
269
289
|
|----------|-------:|-----------|
|
|
270
|
-
| Memory | 8 | CLAUDE.md, architecture, conventions |
|
|
271
|
-
| Quality |
|
|
272
|
-
| Git Safety |
|
|
273
|
-
| Workflow |
|
|
274
|
-
| Security |
|
|
275
|
-
| Automation |
|
|
276
|
-
| Design |
|
|
277
|
-
| DevOps |
|
|
278
|
-
| Hygiene |
|
|
279
|
-
| Performance | 3 | context management, compaction |
|
|
280
|
-
| MCP |
|
|
281
|
-
| Prompting |
|
|
282
|
-
| Features |
|
|
283
|
-
| **Quality Deep** | **
|
|
290
|
+
| Memory | 8 | CLAUDE.md, architecture, conventions, imports |
|
|
291
|
+
| Quality | 6 | verification loops, test/lint/build, testing strategy |
|
|
292
|
+
| Git Safety | 6 | .gitignore, env protection, attribution, secret detection |
|
|
293
|
+
| Workflow | 12 | commands, skills, rules, agents, snapshots |
|
|
294
|
+
| Security | 7 | permissions, secrets, deny rules, sandbox awareness |
|
|
295
|
+
| Automation | 7 | hook coverage, specificity, session and error hooks |
|
|
296
|
+
| Design | 2 | frontend anti-slop guidance, styling signals |
|
|
297
|
+
| DevOps | 5 | Docker, CI, Terraform, infra signals |
|
|
298
|
+
| Hygiene | 8 | README, changelog, license, env example, version pinning |
|
|
299
|
+
| Performance | 3 | context management, compaction, effort level |
|
|
300
|
+
| MCP & Tools | 4 | servers, Context7, tool companions, env config |
|
|
301
|
+
| Prompting | 6 | constraints, examples, negative rules, style guidance |
|
|
302
|
+
| Features | 2 | channels, worktrees |
|
|
303
|
+
| **Quality Deep** | **9** | **freshness, contradictions, deprecated patterns, maxTurns, $ARGUMENTS, hook specificity** |
|
|
284
304
|
|
|
285
305
|
## Stack Detection
|
|
286
306
|
|
|
@@ -307,7 +327,7 @@ jobs:
|
|
|
307
327
|
runs-on: ubuntu-latest
|
|
308
328
|
steps:
|
|
309
329
|
- uses: actions/checkout@v4
|
|
310
|
-
- uses: DnaFin/claudex-setup@v1.
|
|
330
|
+
- uses: DnaFin/claudex-setup@v1.16.1
|
|
311
331
|
with:
|
|
312
332
|
threshold: 50
|
|
313
333
|
```
|
|
@@ -333,6 +353,14 @@ npx claudex-setup deep-review
|
|
|
333
353
|
|
|
334
354
|
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.
|
|
335
355
|
|
|
356
|
+
Deep-review trust boundary:
|
|
357
|
+
|
|
358
|
+
- sends only selected Claude-facing config surfaces: `CLAUDE.md`, settings, commands, agents, rules, hooks, and package scripts
|
|
359
|
+
- truncates large files before sending
|
|
360
|
+
- redacts embedded secrets before sending
|
|
361
|
+
- treats embedded repo text as untrusted review data, not as instructions to follow
|
|
362
|
+
- keeps all non-`deep-review` flows local
|
|
363
|
+
|
|
336
364
|
### Quality-Deep Checks
|
|
337
365
|
|
|
338
366
|
The v0.4.0 quality-deep checks catch what basic audits miss:
|
|
@@ -355,7 +383,8 @@ These checks evaluate **quality**, not just existence. A well-configured project
|
|
|
355
383
|
|
|
356
384
|
- **Zero dependencies** - nothing extra to audit
|
|
357
385
|
- **Core flows run locally** - audit, setup, augment, plan, apply, governance, and benchmark run on your machine
|
|
358
|
-
- **Deep review is opt-in** - only `deep-review` sends selected config to Anthropic for analysis
|
|
386
|
+
- **Deep review is opt-in** - only `deep-review` sends selected config to Anthropic or your local Claude Code session for analysis
|
|
387
|
+
- **Deep review sanitizes before send** - selected snippets are truncated, secret-redacted, and wrapped as untrusted review data
|
|
359
388
|
- **Benchmark uses an isolated temp copy** - your live repo is not touched
|
|
360
389
|
- **Anonymous insights** - opt-in, no PII, no file contents (enable with `--insights`)
|
|
361
390
|
- **MIT Licensed** - use anywhere
|
package/bin/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ const { analyzeProject, printAnalysis, exportMarkdown } = require('../src/analyz
|
|
|
6
6
|
const { buildProposalBundle, printProposalBundle, writePlanFile, applyProposalBundle, printApplyResult } = require('../src/plans');
|
|
7
7
|
const { getGovernanceSummary, printGovernanceSummary, ensureWritableProfile, renderGovernanceMarkdown } = require('../src/governance');
|
|
8
8
|
const { runBenchmark, printBenchmark, writeBenchmarkReport } = require('../src/benchmark');
|
|
9
|
-
const { writeSnapshotArtifact } = require('../src/activity');
|
|
9
|
+
const { writeSnapshotArtifact, recordRecommendationOutcome, formatRecommendationOutcomeSummary, getRecommendationOutcomeSummary } = require('../src/activity');
|
|
10
10
|
const { version } = require('../package.json');
|
|
11
11
|
|
|
12
12
|
const args = process.argv.slice(2);
|
|
@@ -18,8 +18,9 @@ const COMMAND_ALIASES = {
|
|
|
18
18
|
starter: 'setup',
|
|
19
19
|
suggest: 'suggest-only',
|
|
20
20
|
gov: 'governance',
|
|
21
|
+
outcome: 'feedback',
|
|
21
22
|
};
|
|
22
|
-
const KNOWN_COMMANDS = ['audit', 'setup', 'augment', 'suggest-only', 'plan', 'apply', 'governance', 'benchmark', 'deep-review', 'interactive', 'watch', 'badge', 'insights', 'history', 'compare', 'trend', 'scan', 'help', 'version'];
|
|
23
|
+
const KNOWN_COMMANDS = ['audit', 'setup', 'augment', 'suggest-only', 'plan', 'apply', 'governance', 'benchmark', 'deep-review', 'interactive', 'watch', 'badge', 'insights', 'history', 'compare', 'trend', 'scan', 'feedback', 'help', 'version'];
|
|
23
24
|
|
|
24
25
|
function levenshtein(a, b) {
|
|
25
26
|
const matrix = Array.from({ length: a.length + 1 }, () => Array(b.length + 1).fill(0));
|
|
@@ -62,13 +63,19 @@ function parseArgs(rawArgs) {
|
|
|
62
63
|
let profile = 'safe-write';
|
|
63
64
|
let mcpPacks = [];
|
|
64
65
|
let requireChecks = [];
|
|
66
|
+
let feedbackKey = null;
|
|
67
|
+
let feedbackStatus = null;
|
|
68
|
+
let feedbackEffect = null;
|
|
69
|
+
let feedbackNotes = null;
|
|
70
|
+
let feedbackSource = null;
|
|
71
|
+
let feedbackScoreDelta = null;
|
|
65
72
|
let commandSet = false;
|
|
66
73
|
let extraArgs = [];
|
|
67
74
|
|
|
68
75
|
for (let i = 0; i < rawArgs.length; i++) {
|
|
69
76
|
const arg = rawArgs[i];
|
|
70
77
|
|
|
71
|
-
if (arg === '--threshold' || arg === '--out' || arg === '--plan' || arg === '--only' || arg === '--profile' || arg === '--mcp-pack' || arg === '--require') {
|
|
78
|
+
if (arg === '--threshold' || arg === '--out' || arg === '--plan' || arg === '--only' || arg === '--profile' || arg === '--mcp-pack' || arg === '--require' || arg === '--key' || arg === '--status' || arg === '--effect' || arg === '--notes' || arg === '--source' || arg === '--score-delta') {
|
|
72
79
|
const value = rawArgs[i + 1];
|
|
73
80
|
if (!value || value.startsWith('--')) {
|
|
74
81
|
throw new Error(`${arg} requires a value`);
|
|
@@ -80,6 +87,12 @@ function parseArgs(rawArgs) {
|
|
|
80
87
|
if (arg === '--profile') profile = value.trim();
|
|
81
88
|
if (arg === '--mcp-pack') mcpPacks = value.split(',').map(item => item.trim()).filter(Boolean);
|
|
82
89
|
if (arg === '--require') requireChecks = value.split(',').map(item => item.trim()).filter(Boolean);
|
|
90
|
+
if (arg === '--key') feedbackKey = value.trim();
|
|
91
|
+
if (arg === '--status') feedbackStatus = value.trim();
|
|
92
|
+
if (arg === '--effect') feedbackEffect = value.trim();
|
|
93
|
+
if (arg === '--notes') feedbackNotes = value;
|
|
94
|
+
if (arg === '--source') feedbackSource = value.trim();
|
|
95
|
+
if (arg === '--score-delta') feedbackScoreDelta = value.trim();
|
|
83
96
|
i++;
|
|
84
97
|
continue;
|
|
85
98
|
}
|
|
@@ -119,6 +132,36 @@ function parseArgs(rawArgs) {
|
|
|
119
132
|
continue;
|
|
120
133
|
}
|
|
121
134
|
|
|
135
|
+
if (arg.startsWith('--key=')) {
|
|
136
|
+
feedbackKey = arg.split('=').slice(1).join('=').trim();
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (arg.startsWith('--status=')) {
|
|
141
|
+
feedbackStatus = arg.split('=').slice(1).join('=').trim();
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (arg.startsWith('--effect=')) {
|
|
146
|
+
feedbackEffect = arg.split('=').slice(1).join('=').trim();
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (arg.startsWith('--notes=')) {
|
|
151
|
+
feedbackNotes = arg.split('=').slice(1).join('=');
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (arg.startsWith('--source=')) {
|
|
156
|
+
feedbackSource = arg.split('=').slice(1).join('=').trim();
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (arg.startsWith('--score-delta=')) {
|
|
161
|
+
feedbackScoreDelta = arg.split('=').slice(1).join('=').trim();
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
|
|
122
165
|
if (arg.startsWith('--')) {
|
|
123
166
|
flags.push(arg);
|
|
124
167
|
continue;
|
|
@@ -134,7 +177,7 @@ function parseArgs(rawArgs) {
|
|
|
134
177
|
|
|
135
178
|
const normalizedCommand = COMMAND_ALIASES[command] || command;
|
|
136
179
|
|
|
137
|
-
return { flags, command, normalizedCommand, threshold, out, planFile, only, profile, mcpPacks, requireChecks, extraArgs };
|
|
180
|
+
return { flags, command, normalizedCommand, threshold, out, planFile, only, profile, mcpPacks, requireChecks, feedbackKey, feedbackStatus, feedbackEffect, feedbackNotes, feedbackSource, feedbackScoreDelta, extraArgs };
|
|
138
181
|
}
|
|
139
182
|
|
|
140
183
|
const HELP = `
|
|
@@ -166,8 +209,9 @@ const HELP = `
|
|
|
166
209
|
npx claudex-setup benchmark Before/after in isolated temp copy
|
|
167
210
|
npx claudex-setup deep-review AI-powered config review (opt-in, uses API)
|
|
168
211
|
npx claudex-setup interactive Step-by-step guided wizard
|
|
169
|
-
npx claudex-setup watch Live monitoring on config changes
|
|
212
|
+
npx claudex-setup watch Live monitoring on config changes with cross-platform watch fallback
|
|
170
213
|
npx claudex-setup badge Generate shields.io badge markdown
|
|
214
|
+
npx claudex-setup feedback Record recommendation outcomes or show local outcome summary
|
|
171
215
|
|
|
172
216
|
Options:
|
|
173
217
|
--threshold N Exit with code 1 if score is below N (useful for CI)
|
|
@@ -177,6 +221,12 @@ const HELP = `
|
|
|
177
221
|
--only A,B Limit plan/apply to selected proposal ids or technique keys
|
|
178
222
|
--profile NAME Choose permission profile (read-only, suggest-only, safe-write, power-user, internal-research)
|
|
179
223
|
--mcp-pack A,B Merge named MCP packs into generated settings (e.g. context7-docs,next-devtools)
|
|
224
|
+
--key NAME Recommendation key for feedback logging (e.g. permissionDeny)
|
|
225
|
+
--status VALUE Feedback status: accepted, rejected, deferred
|
|
226
|
+
--effect VALUE Feedback effect: positive, neutral, negative
|
|
227
|
+
--notes TEXT Short notes to store with a feedback event
|
|
228
|
+
--source NAME Source label for feedback event (default: manual-cli)
|
|
229
|
+
--score-delta N Optional observed score delta tied to the outcome
|
|
180
230
|
--snapshot Save a normalized snapshot artifact under .claude/claudex-setup/snapshots/
|
|
181
231
|
--lite Show a short top-3 quick scan with one clear next command
|
|
182
232
|
--dry-run Preview apply without writing files
|
|
@@ -203,6 +253,8 @@ const HELP = `
|
|
|
203
253
|
npx claudex-setup apply --profile power-user --only claude-md,hooks
|
|
204
254
|
npx claudex-setup governance --json
|
|
205
255
|
npx claudex-setup benchmark --out benchmark.md
|
|
256
|
+
npx claudex-setup feedback
|
|
257
|
+
npx claudex-setup feedback --key permissionDeny --status accepted --effect positive --score-delta 12
|
|
206
258
|
npx claudex-setup --json --threshold 60
|
|
207
259
|
npx claudex-setup setup --auto
|
|
208
260
|
npx claudex-setup interactive
|
|
@@ -439,6 +491,41 @@ async function main() {
|
|
|
439
491
|
console.log(' Insights request timed out. Run locally: npx claudex-setup');
|
|
440
492
|
});
|
|
441
493
|
return; // keep process alive for http
|
|
494
|
+
} else if (normalizedCommand === 'feedback') {
|
|
495
|
+
if (parsed.feedbackKey) {
|
|
496
|
+
if (!parsed.feedbackStatus) {
|
|
497
|
+
console.error('\n Error: feedback logging requires --status when --key is provided.\n');
|
|
498
|
+
process.exit(1);
|
|
499
|
+
}
|
|
500
|
+
const artifact = recordRecommendationOutcome(options.dir, {
|
|
501
|
+
key: parsed.feedbackKey,
|
|
502
|
+
status: parsed.feedbackStatus,
|
|
503
|
+
effect: parsed.feedbackEffect || 'neutral',
|
|
504
|
+
notes: parsed.feedbackNotes || '',
|
|
505
|
+
source: parsed.feedbackSource || 'manual-cli',
|
|
506
|
+
scoreDelta: parsed.feedbackScoreDelta !== null ? Number(parsed.feedbackScoreDelta) : null,
|
|
507
|
+
});
|
|
508
|
+
const summary = getRecommendationOutcomeSummary(options.dir);
|
|
509
|
+
if (options.json) {
|
|
510
|
+
console.log(JSON.stringify({ artifact, summary }, null, 2));
|
|
511
|
+
} else {
|
|
512
|
+
console.log('');
|
|
513
|
+
console.log(` Feedback recorded for ${parsed.feedbackKey}`);
|
|
514
|
+
console.log(` Artifact: ${artifact.relativePath}`);
|
|
515
|
+
console.log('');
|
|
516
|
+
console.log(formatRecommendationOutcomeSummary(options.dir));
|
|
517
|
+
console.log('');
|
|
518
|
+
}
|
|
519
|
+
} else {
|
|
520
|
+
if (options.json) {
|
|
521
|
+
console.log(JSON.stringify(getRecommendationOutcomeSummary(options.dir), null, 2));
|
|
522
|
+
} else {
|
|
523
|
+
console.log('');
|
|
524
|
+
console.log(formatRecommendationOutcomeSummary(options.dir));
|
|
525
|
+
console.log('');
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
process.exit(0);
|
|
442
529
|
} else if (normalizedCommand === 'augment' || normalizedCommand === 'suggest-only') {
|
|
443
530
|
const report = await analyzeProject({ ...options, mode: normalizedCommand });
|
|
444
531
|
const snapshot = options.snapshot ? writeSnapshotArtifact(options.dir, normalizedCommand, report, {
|