@codacy/verity-cli 0.33.3-experimental.db99356 → 0.33.3-experimental.f081164
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 +25 -0
- package/README.md +3 -0
- package/bin/verity.js +4256 -3579
- package/data/skills/verity-init/SKILL.md +174 -76
- package/package.json +1 -1
|
@@ -1,46 +1,62 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: >-
|
|
3
|
-
Set Verity up in this project: ask the
|
|
4
|
-
install, and repair a project the Claude
|
|
5
|
-
|
|
6
|
-
set up.
|
|
3
|
+
Set Verity up in this project: ask the setup questions in the session, run the
|
|
4
|
+
deterministic install with those answers, sign in, and repair a project the Claude
|
|
5
|
+
Code plugin has just been added to. Use right after installing the Verity plugin,
|
|
6
|
+
or when Verity says this project is not set up.
|
|
7
7
|
disable-model-invocation: true
|
|
8
8
|
---
|
|
9
9
|
# /verity-init — set Verity up in this project
|
|
10
10
|
|
|
11
|
-
You are running the setup
|
|
11
|
+
You are running, inside this session, the same setup `verity init` runs at a
|
|
12
|
+
terminal: the same questions, the same install, the same sign-in. The only
|
|
13
|
+
difference is who asks. At a terminal the CLI prompts; here **you** ask, and pass
|
|
14
|
+
the answers down as flags.
|
|
12
15
|
|
|
13
16
|
**Why this skill exists.** Claude Code has no post-install hook and a plugin
|
|
14
17
|
cannot invoke a skill, so installing Verity repairs nothing: it cannot remove a
|
|
15
18
|
project's superseded skills, stand down duplicate hooks, or derive a Standard.
|
|
16
19
|
All of that needs a command someone runs — this one.
|
|
17
20
|
|
|
18
|
-
**`verity init` prompts on a terminal, and you are not one.**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
**`verity init` prompts on a terminal, and you are not one.** Run with `--yes`
|
|
22
|
+
alone it takes the unattended answer to every question: stop-only review (no
|
|
23
|
+
commit or push gate), no telemetry, no sign-in, nothing untracked. Every one of
|
|
24
|
+
those is a decision that belongs to the user, so every one is asked here.
|
|
25
|
+
|
|
26
|
+
Run every `verity` command below the way this session's context says (the
|
|
27
|
+
plugin's own copy), not with plain `verity`, whenever the context names one.
|
|
23
28
|
|
|
24
29
|
---
|
|
25
30
|
|
|
26
|
-
## Step 0:
|
|
31
|
+
## Step 0: Read where the project stands — before asking anything
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
verity doctor --json
|
|
35
|
+
```
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
the plugin's, **tell the user that first**, in one line, before the questions —
|
|
30
|
-
with the `npm install -g` command the context gives. Finding out after they have
|
|
31
|
-
answered is the failure this step exists to prevent: an older CLI cannot take the
|
|
32
|
-
answers.
|
|
37
|
+
From that one report:
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
- **`blocked` is true** → show the `prerequisites[].remedy` lines and stop.
|
|
40
|
+
Nothing below can work.
|
|
41
|
+
- **`hooks.versions.skew` is set** → tell the user first, in one line, with
|
|
42
|
+
`hooks.versions.skew.remedy`. An older CLI cannot take the answers, so they
|
|
43
|
+
should hear it now, not after answering.
|
|
44
|
+
- **`answers`** holds what a previous run recorded (`intensity`, `moments`,
|
|
45
|
+
`telemetry`). On a re-run those are the defaults — pre-select them. The shipped
|
|
46
|
+
defaults are only for a project with nothing recorded.
|
|
47
|
+
- **`telemetry.enabled`** decides whether the telemetry question is asked at all.
|
|
48
|
+
- **`memory.trackedFiles > 0` and `memory.optedOut` is false** → the graph
|
|
49
|
+
question applies.
|
|
50
|
+
- **`trackedState.files > 0`** → the committed-state question applies.
|
|
36
51
|
|
|
37
|
-
## Step 1: Ask
|
|
52
|
+
## Step 1: Ask — once, in one prompt
|
|
38
53
|
|
|
39
|
-
Use `AskUserQuestion` with
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
Use `AskUserQuestion` with every question that applies **in a single call**, in
|
|
55
|
+
this order. It takes at most four; if more apply, put the rest in ONE follow-up
|
|
56
|
+
call. Do not ask one at a time, and do not ask in prose unless `AskUserQuestion`
|
|
57
|
+
is unavailable (then ask in prose and **wait** — never choose for the user).
|
|
42
58
|
|
|
43
|
-
**
|
|
59
|
+
**1 — "When should Verity review your code?"** (multi-select, always asked)
|
|
44
60
|
|
|
45
61
|
| Option | Description |
|
|
46
62
|
|---|---|
|
|
@@ -48,12 +64,12 @@ setup gets, so spend it once.
|
|
|
48
64
|
| `Before commit` | Reviews the staged diff and blocks the commit on a failing review. |
|
|
49
65
|
| `Before push / PR` | Reviews the commits about to be pushed and blocks on a failing review. |
|
|
50
66
|
|
|
51
|
-
Pre-select **After every turn
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
Pre-select the recorded moments, or **After every turn** on a first run, and do
|
|
68
|
+
not call it "recommended": under the plugin it runs whatever the answer. Say
|
|
69
|
+
plainly in the question text that choosing only the first means **git commits
|
|
70
|
+
and pushes are not gated**.
|
|
55
71
|
|
|
56
|
-
**
|
|
72
|
+
**2 — "How deeply should Verity review?"** (single-select, always asked)
|
|
57
73
|
|
|
58
74
|
| Option | Description |
|
|
59
75
|
|---|---|
|
|
@@ -61,75 +77,157 @@ first means **git commits and pushes are not gated**.
|
|
|
61
77
|
| `Lightweight` | Critical security only, about 3s. |
|
|
62
78
|
| `Thorough` | All tools, all rules, about 15s. |
|
|
63
79
|
|
|
80
|
+
**3 — "Send cost & usage telemetry to Verity?"** (single-select; **only when
|
|
81
|
+
`telemetry.enabled` is false**)
|
|
82
|
+
|
|
83
|
+
| Option | Description |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `Yes, enable it` | Powers the /usage dashboard. Sends Claude Code's own OpenTelemetry metrics and traces: model names, token counts, cost, session ids. Not your prompts, code, or tool input/output. |
|
|
86
|
+
| `No` | /usage stays empty. Enable later with `verity telemetry install`. |
|
|
87
|
+
|
|
88
|
+
**4 — "Sign in to Verity now?"** (single-select, always asked)
|
|
89
|
+
|
|
90
|
+
| Option | Description |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `Sign in now (recommended)` | One GitHub login covers every repository you can write to, for 90 days. Needed for run history, cloud memory and the dashboard. If you are already signed in this just confirms it. |
|
|
93
|
+
| `Skip for now` | The gate still reviews your code locally; nothing is saved. Sign in later with `/verity-init` or `verity login`. |
|
|
94
|
+
|
|
95
|
+
If asked, explain: the GitHub token is used once to check which repositories they
|
|
96
|
+
can write to, then discarded; signing in does not give Verity access to their
|
|
97
|
+
code, which is analyzed in memory and never stored.
|
|
98
|
+
|
|
99
|
+
**5 — "Stop tracking Verity's knowledge graph in git?"** (only when the graph
|
|
100
|
+
question applies; say how many files)
|
|
101
|
+
|
|
102
|
+
| Option | Description |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `Yes, untrack it (recommended)` | Files stay on disk; their removal from the index is staged for you to commit. Generated notes stop appearing in every diff and PR. |
|
|
105
|
+
| `No, not now` | Nothing changes. `verity memory track` records it as deliberate. |
|
|
106
|
+
|
|
107
|
+
**6 — "Untrack committed Verity state?"** (only when `trackedState.files > 0`;
|
|
108
|
+
say how many files)
|
|
109
|
+
|
|
110
|
+
| Option | Description |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `Yes, untrack it (recommended)` | Machine-local files that should never have been committed — they can include copies of flagged secrets. Files stay on disk; the removal is staged. |
|
|
113
|
+
| `No, not now` | Nothing changes. |
|
|
114
|
+
|
|
64
115
|
## Step 2: Run the install with those answers
|
|
65
116
|
|
|
66
|
-
|
|
67
|
-
defaulted:
|
|
117
|
+
One command, no prompts, nothing silently defaulted:
|
|
68
118
|
|
|
69
119
|
```bash
|
|
70
|
-
verity init --yes --no-setup
|
|
120
|
+
verity init --yes --no-setup \
|
|
121
|
+
--moments <stop[,pre-commit][,pre-push] | none> \
|
|
122
|
+
--intensity <balanced|lightweight|thorough> \
|
|
123
|
+
[--telemetry on|off] [--untrack-memory] [--untrack-state]
|
|
71
124
|
```
|
|
72
125
|
|
|
73
|
-
`--
|
|
74
|
-
|
|
126
|
+
- Pass `--telemetry` only when question 3 was asked. Omitting it leaves the
|
|
127
|
+
recorded choice alone.
|
|
128
|
+
- Pass `--untrack-memory` / `--untrack-state` only on a yes.
|
|
129
|
+
- Pass `stop` only if they ticked it. Under the plugin the Stop review runs either
|
|
130
|
+
way and `verity init` says so.
|
|
131
|
+
- An unrecognised value is refused rather than dropped, so a typo cannot quietly
|
|
132
|
+
remove a gate. If init exits non-zero, show its error and stop.
|
|
133
|
+
|
|
134
|
+
This is idempotent and does the whole install: removes the project's own
|
|
135
|
+
`.claude/skills/verity-*` copies that the plugin supersedes, stands down duplicate
|
|
136
|
+
`.claude/settings.json` hooks, adopts the team's Standard from the service or
|
|
137
|
+
derives one from the codebase, heals a stale analysis config, and records the
|
|
138
|
+
plugin version — which is what stops Verity asking at every session start.
|
|
75
139
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
140
|
+
Init runs before sign-in, so on a first run it says it skipped authentication and
|
|
141
|
+
that telemetry needs a token. That is expected — Step 3 handles both. Do not
|
|
142
|
+
repeat those lines to the user as problems.
|
|
79
143
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
144
|
+
## Step 3: Sign in — here, in two halves
|
|
145
|
+
|
|
146
|
+
Skip this step if they chose **Skip for now**; say the gate runs locally and how
|
|
147
|
+
to sign in later.
|
|
148
|
+
|
|
149
|
+
`verity login` on its own prints a code and then blocks until it is approved, and
|
|
150
|
+
you would only see the code after it ended. So it is split:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
verity login --start
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
It prints one JSON object on stdout:
|
|
157
|
+
|
|
158
|
+
- **`"status": "logged_in"`** → they already are. Say so and go to Step 4.
|
|
159
|
+
- **`"status": "pending"`** → show the user `verification_uri` and `user_code`
|
|
160
|
+
exactly as given, and ask them to approve it in their browser and tell you when
|
|
161
|
+
they have. Wait for their reply. Do not run anything in the meantime.
|
|
162
|
+
- **`"status": "failed"`** → show the error, and tell them to run `verity login`
|
|
163
|
+
in their own terminal later. Go to Step 4.
|
|
164
|
+
|
|
165
|
+
When they say it is approved (or ask you to check):
|
|
86
166
|
|
|
87
|
-
|
|
88
|
-
|
|
167
|
+
```bash
|
|
168
|
+
verity login --finish
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Give the tool call at least a 150-second timeout; it waits up to 100 seconds.
|
|
172
|
+
|
|
173
|
+
- **exit 0, `"status": "logged_in"`** → report the lines it printed about the
|
|
174
|
+
account and whether this repository is covered, word for word where it names a
|
|
175
|
+
link to grant the Verity GitHub App.
|
|
176
|
+
- **exit 2, `"status": "pending"`** → not approved yet. Show the code again, wait
|
|
177
|
+
for them, and run `--finish` again.
|
|
178
|
+
- **exit 1** → `denied`, `expired`, `service_changed`, `no_pending` or `failed`.
|
|
179
|
+
Show the error. For `expired` or `no_pending`, offer to start again with
|
|
180
|
+
`--start`.
|
|
181
|
+
|
|
182
|
+
If they change their mind while a code is pending, run `verity login --cancel`.
|
|
89
183
|
|
|
90
|
-
|
|
184
|
+
⚠ Never run plain `verity login` from here, and never tell a user whose Step 0
|
|
185
|
+
reported a version skew to run it in a terminal until they have fixed the skew —
|
|
186
|
+
the old global CLI can sign the machine in to a different server, and the plugin
|
|
187
|
+
follows that sign-in.
|
|
91
188
|
|
|
92
|
-
|
|
93
|
-
code, waits for the user to approve it in a browser, and blocks until they do.
|
|
94
|
-
Started from a tool call it just hangs, and the user never sees the code.
|
|
189
|
+
## Step 4: Finish telemetry, if it waited on sign-in
|
|
95
190
|
|
|
96
|
-
|
|
191
|
+
If they said yes to telemetry and init reported it needs a token, and Step 3
|
|
192
|
+
signed them in:
|
|
97
193
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
>
|
|
104
|
-
> It prints a code and a link; approve it in your browser. One login covers every
|
|
105
|
-
> repository you can write to, for 90 days. Without it the gate still reviews
|
|
106
|
-
> your code — it just records nothing, so there is no history, no cloud memory
|
|
107
|
-
> and no dashboard.
|
|
194
|
+
```bash
|
|
195
|
+
verity telemetry install
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
It takes effect on their next Claude Code session.
|
|
108
199
|
|
|
109
|
-
|
|
200
|
+
## Step 5: Report what happened
|
|
110
201
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
machine in to a different server, and the plugin follows that sign-in.
|
|
202
|
+
```bash
|
|
203
|
+
verity doctor --json
|
|
204
|
+
```
|
|
115
205
|
|
|
116
|
-
|
|
206
|
+
Summarise from this report, not from memory of what you ran:
|
|
117
207
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
208
|
+
- what init removed (superseded skills, duplicate hooks) — those skill
|
|
209
|
+
directories are usually committed, so the deletions show in `git status` and
|
|
210
|
+
are the user's to commit;
|
|
211
|
+
- whether the Standard was **adopted** from the service or **derived** from the
|
|
212
|
+
codebase (init's output says which);
|
|
213
|
+
- the moments and intensity now in effect, and who wires the hooks
|
|
214
|
+
(`hooks.source`);
|
|
215
|
+
- anything untracked, and that the staged removal is theirs to commit;
|
|
216
|
+
- sign-in and telemetry state;
|
|
217
|
+
- each line of `next`, if any.
|
|
122
218
|
|
|
123
|
-
|
|
124
|
-
|
|
219
|
+
Then offer `/verity-setup` for the part a lookup cannot produce — project-specific
|
|
220
|
+
`custom_patterns` such as *"every route under `api/` uses the auth middleware"* —
|
|
221
|
+
and say it is optional: the gate is already running.
|
|
125
222
|
|
|
126
223
|
---
|
|
127
224
|
|
|
128
225
|
## What NOT to do here
|
|
129
226
|
|
|
130
227
|
- **Do not wire hooks or edit `.gitignore` yourself.** `verity init` owns that.
|
|
131
|
-
Doing it here is how the two flows drifted apart before
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
228
|
+
Doing it here is how the two flows drifted apart before.
|
|
229
|
+
- **Do not synthesize a Standard by hand.** The CLI derives it in seconds from
|
|
230
|
+
the same catalogue you would be reading.
|
|
231
|
+
- **Do not answer a question for the user**, including by leaving a flag off
|
|
232
|
+
because it seemed obvious. An omitted question is an unattended answer.
|
|
233
|
+
- **Do not run plain `verity login`.** Step 3.
|
package/package.json
CHANGED