@codacy/verity-cli 0.34.3 → 0.35.0-experimental.2d2f4df
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/README.md +96 -60
- package/bin/verity.js +11037 -9611
- package/data/skills/verity-analyze/SKILL.md +2 -2
- package/data/skills/verity-init/SKILL.md +128 -141
- package/data/skills/verity-setup/SKILL.md +35 -367
- package/data/skills/verity-setup/patterns-reference.yaml +4 -330
- package/data/skills/verity-setup/standard-template.yaml +2 -9
- package/package.json +1 -1
- package/data/skills/verity-setup/validate-patterns.mjs +0 -345
|
@@ -20,8 +20,8 @@ You are running an on-demand Verity analysis. This is like a "second opinion"
|
|
|
20
20
|
|
|
21
21
|
## Step 1: Check configuration
|
|
22
22
|
|
|
23
|
-
1. Verify `.verity/standard.yaml` exists. If not: "Run `/verity-
|
|
24
|
-
2. Verify `verity` CLI is available: `which verity`. If not: "
|
|
23
|
+
1. Verify `.verity/standard.yaml` exists. If not: "Run `/verity-init` (or `verity init` in a terminal) first."
|
|
24
|
+
2. Verify `verity` CLI is available: `which verity`. If not: "Install it: `npm install -g @codacy/verity-cli`, or install the Verity Claude Code plugin."
|
|
25
25
|
3. Run `verity auth verify` to check the token is valid.
|
|
26
26
|
- **Valid**: proceed with the full deep review.
|
|
27
27
|
- **Fails / not authenticated**: don't stop. Tell the user Verity is in
|
|
@@ -1,153 +1,125 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: >-
|
|
3
|
-
Set Verity up in this project: ask the setup questions in the session
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Set Verity up in this project: ask the setup questions in the session (sign in,
|
|
4
|
+
and the Standard: use the team's, or write project rules from a repo profile),
|
|
5
|
+
sign in, and run the install with those answers. Use right after installing the Verity plugin, or when
|
|
6
|
+
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
|
|
12
|
-
terminal
|
|
13
|
-
|
|
14
|
-
the answers down as flags.
|
|
11
|
+
You run, inside this session, the same setup that `verity init` runs at a
|
|
12
|
+
terminal. At a terminal the CLI asks about sign-in and about the Standard. Here
|
|
13
|
+
**you** ask, and pass the answers to the CLI as flags.
|
|
15
14
|
|
|
16
|
-
**Why this skill exists.** Claude Code has no post-install hook and a plugin
|
|
17
|
-
cannot
|
|
18
|
-
|
|
19
|
-
All of that needs a command someone runs — this one.
|
|
15
|
+
**Why this skill exists.** Claude Code has no post-install hook, and a plugin
|
|
16
|
+
cannot start a skill. So installing Verity does not set up the project. That needs
|
|
17
|
+
a command, and this skill runs it.
|
|
20
18
|
|
|
21
|
-
**`verity init`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
those is a decision that belongs to the user, so every one is asked here.
|
|
19
|
+
**`verity init --yes` asks nothing.** Without these flags it skips sign-in, uses
|
|
20
|
+
the team's Standard if there is one, and sends no profile. These are the user's
|
|
21
|
+
decisions, so ask them here.
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
When this session's context names the plugin's own copy of the CLI, run every
|
|
24
|
+
`verity` command below with that copy, not with plain `verity`.
|
|
28
25
|
|
|
29
26
|
---
|
|
30
27
|
|
|
31
|
-
## Step 0: Read where the project stands
|
|
28
|
+
## Step 0: Read where the project stands
|
|
32
29
|
|
|
33
30
|
```bash
|
|
34
31
|
verity doctor --json
|
|
35
32
|
```
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
Use this one report:
|
|
38
35
|
|
|
39
36
|
- **`blocked` is true** → show the `prerequisites[].remedy` lines and stop.
|
|
40
|
-
Nothing below can work.
|
|
41
37
|
- **`hooks.versions.skew` is set** → tell the user first, in one line, with
|
|
42
|
-
`hooks.versions.skew.remedy`.
|
|
43
|
-
|
|
44
|
-
|
|
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.
|
|
38
|
+
`hooks.versions.skew.remedy`.
|
|
39
|
+
- **`artifacts.standard` is true** → this project already has a Standard here.
|
|
40
|
+
Do not ask question 2. Init keeps the Standard and sends no profile.
|
|
51
41
|
|
|
52
|
-
|
|
42
|
+
When `artifacts.standard` is false, also run:
|
|
53
43
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
is unavailable (then ask in prose and **wait** — never choose for the user).
|
|
44
|
+
```bash
|
|
45
|
+
verity standard history
|
|
46
|
+
```
|
|
58
47
|
|
|
59
|
-
**
|
|
48
|
+
- **It lists versions** → the team already has a Standard on the service.
|
|
49
|
+
Question 2 is **2a**.
|
|
50
|
+
- **It prints "No Standard versions found."** → question 2 is **2b**.
|
|
51
|
+
- **It fails** (for example, not signed in) → question 2 is **2b** for now.
|
|
52
|
+
Step 2 checks again after sign-in.
|
|
53
|
+
- **`memory.trackedFiles > 0` and `memory.optedOut` is false** → question 3 applies.
|
|
54
|
+
- **`trackedState.files > 0`** → question 4 applies.
|
|
60
55
|
|
|
61
|
-
|
|
62
|
-
|---|---|
|
|
63
|
-
| `After every turn (always on with the plugin, for now)` | Reviews what the agent just wrote, as you work. Fast feedback, never blocks a commit. Under the Claude Code plugin it cannot be turned off yet. |
|
|
64
|
-
| `Before commit` | Reviews the staged diff and blocks the commit on a failing review. |
|
|
65
|
-
| `Before push / PR` | Reviews the commits about to be pushed and blocks on a failing review. |
|
|
56
|
+
## Step 1: Ask, once, in one prompt
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
and pushes are not gated**.
|
|
58
|
+
Use `AskUserQuestion` with every question that applies, **in one call**. Do not
|
|
59
|
+
ask one at a time. If `AskUserQuestion` is not available, ask in prose and wait for
|
|
60
|
+
the answer. Never choose for the user.
|
|
71
61
|
|
|
72
|
-
**
|
|
62
|
+
**1 — "Sign in to Verity now?"** (always)
|
|
73
63
|
|
|
74
64
|
| Option | Description |
|
|
75
65
|
|---|---|
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `Thorough` | All tools, all rules, about 15s. |
|
|
66
|
+
| `Sign in now (recommended)` | One GitHub sign-in covers every repository on this machine, for 90 days. AI review needs it. If you are signed in already, this only confirms it. |
|
|
67
|
+
| `Skip for now` | Only the local security scan runs. Nothing is saved. Sign in later with `/verity-init` or `verity login`. |
|
|
79
68
|
|
|
80
|
-
|
|
81
|
-
|
|
69
|
+
If the user asks: the GitHub token is used once to check which repositories they
|
|
70
|
+
can write to, then discarded. Signing in does not give Verity access to the
|
|
71
|
+
contents of their repositories.
|
|
72
|
+
|
|
73
|
+
**2a — "Your team already has a Standard for this repository. Use it, or create a new one?"**
|
|
74
|
+
(only when `verity standard history` lists versions; name the latest version and who pushed it)
|
|
82
75
|
|
|
83
76
|
| Option | Description |
|
|
84
77
|
|---|---|
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
78
|
+
| `Use it (recommended)` | Reviews use the same rules as everyone else on the project. Nothing is sent. |
|
|
79
|
+
| `Create a new one from a repo profile` | The new Standard becomes the next version for the whole team. Verity sends the repo profile that 2b describes, and writes project rules from it. |
|
|
80
|
+
| `Create a new one with the built-in rules` | The new Standard becomes the next version for the whole team. It has the built-in rules only. Nothing is sent. |
|
|
87
81
|
|
|
88
|
-
**
|
|
82
|
+
**2b — "Let Verity write review rules for this repository?"** (only when
|
|
83
|
+
`artifacts.standard` is false and 2a does not apply)
|
|
89
84
|
|
|
90
85
|
| Option | Description |
|
|
91
86
|
|---|---|
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
87
|
+
| `Yes, send the profile (recommended)` | Verity sends a profile of this repository to the Verity service: languages, frameworks and dependency names; folder names, 3 levels deep; the subjects of recent commits and the paths each one changed; the agent docs (CLAUDE.md, AGENTS.md, and those of sub-projects) without their code blocks, or the rule sections of README.md when there are none. This step sends no source code, diffs or author names. Verity does not store the profile. Later, each review sends the code that changed. |
|
|
88
|
+
| `No, use the built-in rules` | The Standard has the built-in rules only. Add project rules later with `verity standard generate`. |
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
code, which is analyzed in memory and never stored.
|
|
90
|
+
Say in the question text that the profile needs sign-in. If the user skips
|
|
91
|
+
sign-in, question 2b has no effect.
|
|
98
92
|
|
|
99
|
-
**
|
|
100
|
-
|
|
93
|
+
**3 — "Stop tracking Verity's knowledge graph in git?"** (only when it applies;
|
|
94
|
+
say how many files)
|
|
101
95
|
|
|
102
96
|
| Option | Description |
|
|
103
97
|
|---|---|
|
|
104
|
-
| `Yes, untrack it (recommended)` |
|
|
98
|
+
| `Yes, untrack it (recommended)` | The files stay on disk. Their removal from the index is staged for you to commit. Generated notes stop appearing in every diff. |
|
|
105
99
|
| `No, not now` | Nothing changes. `verity memory track` records it as deliberate. |
|
|
106
100
|
|
|
107
|
-
**
|
|
101
|
+
**4 — "Untrack committed Verity state?"** (only when `trackedState.files > 0`;
|
|
108
102
|
say how many files)
|
|
109
103
|
|
|
110
104
|
| Option | Description |
|
|
111
105
|
|---|---|
|
|
112
|
-
| `Yes, untrack it (recommended)` |
|
|
106
|
+
| `Yes, untrack it (recommended)` | These files are machine-local and can include copies of flagged secrets. The files stay on disk, and the removal is staged. |
|
|
113
107
|
| `No, not now` | Nothing changes. |
|
|
114
108
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
One command, no prompts, nothing silently defaulted:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
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]
|
|
124
|
-
```
|
|
125
|
-
|
|
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.
|
|
109
|
+
Do not ask when Verity reviews. All three moments are on by default: each turn,
|
|
110
|
+
each commit and each push. Step 4 tells the user how to change them.
|
|
139
111
|
|
|
140
|
-
|
|
141
|
-
that telemetry needs a token. That is expected — Step 3 handles both. Do not
|
|
142
|
-
repeat those lines to the user as problems.
|
|
112
|
+
## Step 2: Sign in first, in two halves
|
|
143
113
|
|
|
144
|
-
|
|
114
|
+
Skip this step if the user chose **Skip for now**.
|
|
145
115
|
|
|
146
|
-
|
|
147
|
-
to
|
|
116
|
+
⚠ **Sign in BEFORE the install.** Init needs the sign-in to use the team's
|
|
117
|
+
Standard, to write project rules, and to share the Standard. Run the other way
|
|
118
|
+
round, the Standard stays on this machine, and every review fails with
|
|
119
|
+
`STANDARD_NOT_FOUND`.
|
|
148
120
|
|
|
149
|
-
`verity login`
|
|
150
|
-
|
|
121
|
+
`verity login` waits until the code is approved, and you would see the code only
|
|
122
|
+
after it ends. So use the two halves:
|
|
151
123
|
|
|
152
124
|
```bash
|
|
153
125
|
verity login --start
|
|
@@ -155,79 +127,94 @@ verity login --start
|
|
|
155
127
|
|
|
156
128
|
It prints one JSON object on stdout:
|
|
157
129
|
|
|
158
|
-
- **`"status": "logged_in"`** →
|
|
159
|
-
- **`"status": "pending"`** → show
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
- **`"status": "failed"`** → show the error
|
|
163
|
-
in
|
|
130
|
+
- **`"status": "logged_in"`** → the user is signed in. Say so and go to Step 3.
|
|
131
|
+
- **`"status": "pending"`** → show `verification_uri` and `user_code` exactly as
|
|
132
|
+
given. Ask the user to approve it in the browser and to tell you when they have.
|
|
133
|
+
Wait for the reply. Run nothing in the meantime.
|
|
134
|
+
- **`"status": "failed"`** → show the error. Tell the user to run `verity login`
|
|
135
|
+
in a terminal later. Go to Step 3.
|
|
164
136
|
|
|
165
|
-
|
|
137
|
+
**After a new sign-in, check the Standard again.** If Step 0 could not run
|
|
138
|
+
`verity standard history` (it failed) and `artifacts.standard` is false, run it
|
|
139
|
+
now. If it lists versions, ask question 2a now, in its own prompt. Its answer
|
|
140
|
+
replaces the answer to 2b.
|
|
141
|
+
|
|
142
|
+
When the user says it is approved, or asks you to check:
|
|
166
143
|
|
|
167
144
|
```bash
|
|
168
145
|
verity login --finish
|
|
169
146
|
```
|
|
170
147
|
|
|
171
|
-
Give
|
|
148
|
+
Give this tool call a timeout of at least 150 seconds. It waits up to 100 seconds.
|
|
172
149
|
|
|
173
150
|
- **exit 0, `"status": "logged_in"`** → report the lines it printed about the
|
|
174
|
-
account and
|
|
175
|
-
|
|
151
|
+
account and this repository's coverage. Give any link to the Verity GitHub App
|
|
152
|
+
word for word. Then go to Step 3.
|
|
176
153
|
- **exit 2, `"status": "pending"`** → not approved yet. Show the code again, wait
|
|
177
|
-
for
|
|
154
|
+
for the user, and run `--finish` again.
|
|
178
155
|
- **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`.
|
|
156
|
+
Show the error. For `expired` or `no_pending`, offer to start again with `--start`.
|
|
181
157
|
|
|
182
|
-
If
|
|
158
|
+
If the user changes their mind while a code is pending, run `verity login --cancel`.
|
|
183
159
|
|
|
184
|
-
⚠ Never run plain `verity login`
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
follows that sign-in.
|
|
160
|
+
⚠ Never run plain `verity login` here. If Step 0 reported a version skew, do not
|
|
161
|
+
tell the user to run it in a terminal until they fix the skew: the old global CLI
|
|
162
|
+
can sign the machine in to a different server, and the plugin follows that sign-in.
|
|
188
163
|
|
|
189
|
-
## Step
|
|
164
|
+
## Step 3: Run the install with the answers
|
|
190
165
|
|
|
191
|
-
|
|
192
|
-
signed them in:
|
|
166
|
+
One command. It asks nothing:
|
|
193
167
|
|
|
194
168
|
```bash
|
|
195
|
-
verity
|
|
169
|
+
verity init --yes [--standard <use|new>] --profile <send|skip> [--untrack-memory] [--untrack-state]
|
|
196
170
|
```
|
|
197
171
|
|
|
198
|
-
|
|
172
|
+
- Question 2a: `Use it` → `--standard use`. `Create a new one from a repo
|
|
173
|
+
profile` → `--standard new --profile send`. `Create a new one with the
|
|
174
|
+
built-in rules` → `--standard new --profile skip`.
|
|
175
|
+
- Question 2b: `--profile send` only when the user said yes and signed in.
|
|
176
|
+
Otherwise `--profile skip`.
|
|
177
|
+
- When question 2 was not asked, leave `--standard` and `--profile` off.
|
|
178
|
+
- `--untrack-memory` and `--untrack-state` only on a yes.
|
|
179
|
+
- Do not pass `--moments` or `--telemetry`. Without them, init keeps the moments
|
|
180
|
+
the project has, or turns on all three for a new project.
|
|
181
|
+
- If init exits non-zero, show its error and stop.
|
|
182
|
+
|
|
183
|
+
Init is idempotent. It removes the project's own `.claude/skills/verity-*` copies
|
|
184
|
+
that the plugin replaces, removes duplicate `.claude/settings.json` hooks, keeps
|
|
185
|
+
or adopts or writes the Standard, and records the plugin version. That record
|
|
186
|
+
stops Verity asking at every session start.
|
|
199
187
|
|
|
200
|
-
|
|
188
|
+
With `--profile send`, init prints the rules that Verity wrote. Each rule has an
|
|
189
|
+
id, one sentence, where it applies and why. Show them to the user as printed.
|
|
190
|
+
|
|
191
|
+
## Step 4: Report what happened
|
|
201
192
|
|
|
202
193
|
```bash
|
|
203
194
|
verity doctor --json
|
|
204
195
|
```
|
|
205
196
|
|
|
206
|
-
Summarise from this report
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
197
|
+
Summarise from this report and from init's output, not from memory:
|
|
198
|
+
|
|
199
|
+
- the Standard: **kept**, **adopted** from the team, **written** from the profile
|
|
200
|
+
(with its rules), or built from the catalogue. When it is a new one that
|
|
201
|
+
replaced the team's, say which version it replaced;
|
|
202
|
+
- the moments in effect. Say: "Verity reviews every turn, every commit and every
|
|
203
|
+
push. To change it, run `verity config moments`, or just ask me.";
|
|
204
|
+
- what init removed (superseded skills, duplicate hooks). Those skill folders are
|
|
205
|
+
usually committed, so the deletions show in `git status` and are the user's to
|
|
206
|
+
commit;
|
|
207
|
+
- anything untracked, and that the staged removal is the user's to commit;
|
|
208
|
+
- sign-in state;
|
|
217
209
|
- each line of `next`, if any.
|
|
218
210
|
|
|
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.
|
|
222
|
-
|
|
223
211
|
---
|
|
224
212
|
|
|
225
213
|
## What NOT to do here
|
|
226
214
|
|
|
227
215
|
- **Do not wire hooks or edit `.gitignore` yourself.** `verity init` owns that.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
- **Do not run plain `verity login`.** Step 3.
|
|
216
|
+
- **Do not write a Standard by hand.** Init gets it from the team, from the
|
|
217
|
+
profile, or from the catalogue.
|
|
218
|
+
- **Do not answer a question for the user**, and do not leave a flag off because
|
|
219
|
+
it seems obvious. An omitted answer is an unattended one.
|
|
220
|
+
- **Do not run plain `verity login`.** See Step 2.
|