@codacy/verity-cli 0.31.1 → 0.31.3
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 +124 -0
- package/README.md +28 -3
- package/bin/verity.js +3010 -1103
- package/data/skills/verity-analyze/SKILL.md +7 -0
- package/data/skills/verity-feedback/SKILL.md +6 -0
- package/data/skills/verity-insights/SKILL.md +7 -0
- package/data/skills/verity-learn/SKILL.md +6 -0
- package/data/skills/verity-memory/SKILL.md +7 -0
- package/data/skills/verity-reflect/SKILL.md +6 -0
- package/data/skills/verity-setup/SKILL.md +132 -283
- package/data/skills/verity-status/SKILL.md +6 -0
- package/package.json +1 -1
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
Run an independent AI review of the current change on demand — a second opinion on quality,
|
|
4
|
+
security, and whether the code matches its stated intent. Use when the user asks to review,
|
|
5
|
+
check, or analyze code before committing, or to get an independent check on work you have
|
|
6
|
+
just finished.
|
|
7
|
+
---
|
|
1
8
|
# /verity-analyze — Run Verity analysis on demand
|
|
2
9
|
|
|
3
10
|
You are running an on-demand Verity analysis. This is like a "second opinion" — the user (or you) can invoke it at any point to get a quality and security review with rich context.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
Report project quality metrics from accumulated run data, and manage the Standard's evolution
|
|
4
|
+
suggestions. Use when the user asks for quality trends or metrics, or whether the Standard
|
|
5
|
+
should change.
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
1
8
|
# /verity-insights — Project quality insights and Standard evolution
|
|
2
9
|
|
|
3
10
|
Surface metrics from accumulated run data and manage Standard evolution suggestions.
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
View and manage the durable project knowledge Verity has accumulated — decisions, patterns,
|
|
4
|
+
gotchas, and conventions extracted from past analysis runs. Use when the user asks what
|
|
5
|
+
Verity has learned, or before changing an area of the code you do not know.
|
|
6
|
+
---
|
|
1
7
|
# /verity-learn — View and manage project knowledge
|
|
2
8
|
|
|
3
9
|
Project knowledge is durable insights extracted from analysis runs — decisions, patterns, gotchas, and conventions. When the memory graph is enabled (`memory_graph_enabled`), this skill delegates to the graph. Otherwise, it uses flat lessons.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
Browse, query, and extend the project knowledge graph at .verity/memory/ — typed nodes and
|
|
4
|
+
edges covering decisions, patterns, security constraints, and gotchas. Use to pull prior
|
|
5
|
+
context on files you are about to change, or when the user asks to record or inspect project
|
|
6
|
+
knowledge.
|
|
7
|
+
---
|
|
1
8
|
# /verity-memory — Manage the project knowledge graph
|
|
2
9
|
|
|
3
10
|
The memory graph is a collection of markdown nodes at `.verity/memory/` organized into 8 domains. Each node has YAML frontmatter with typed edges that form a graph. The graph is the project's accumulated knowledge — decisions, patterns, gotchas, security constraints, and more.
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
Capture a durable learning at the end of a task: draft a concrete, cited observation from
|
|
4
|
+
what actually happened, then confirm it with the user or record it directly. Use at natural
|
|
5
|
+
task-completion moments, or when the user asks to record a lesson.
|
|
6
|
+
---
|
|
1
7
|
# /verity-reflect — Capture learnings after a task
|
|
2
8
|
|
|
3
9
|
At a natural task-completion moment, **the agent reflects first** — draft a
|
|
@@ -1,24 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
Configure Verity for this project: create or update the project Standard, wire the
|
|
4
|
+
static-analysis tools, and authenticate. Use when setting Verity up for the first time, or
|
|
5
|
+
when the user asks to change quality rules, severity thresholds, or which analysis tools run.
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
1
8
|
# /verity-setup — Configure Verity for this project
|
|
2
9
|
|
|
3
|
-
You are
|
|
10
|
+
You are finishing Verity's setup: the half that needs a model.
|
|
11
|
+
|
|
12
|
+
**`verity init` already ran the deterministic half** — prerequisites, the skills,
|
|
13
|
+
the Claude Code hooks (reconciled to the moments the user chose), `.gitignore`,
|
|
14
|
+
the CLAUDE.md instructions, the optional GitHub login, and telemetry. It recorded
|
|
15
|
+
the user's answers in `.verity/setup.json` and then handed off to you.
|
|
16
|
+
|
|
17
|
+
So: **do not re-ask what init asked, and do not re-write what init wrote.** Wiring
|
|
18
|
+
hooks or a `.gitignore` block here is how the two flows drifted apart before — the
|
|
19
|
+
skill reconciled hooks init had just installed, silently removing them.
|
|
4
20
|
|
|
5
|
-
**
|
|
21
|
+
**What is yours** — everything a program cannot decide:
|
|
22
|
+
1. Read the codebase and understand it (Step 2).
|
|
23
|
+
2. Synthesize `.verity/standard.yaml` from what you found (Step 4).
|
|
24
|
+
3. Write `.codacy/codacy.config.json` with curated, validated pattern ids (Step 5).
|
|
25
|
+
4. Upload both, seed the knowledge base, write `VERITY.md` (Steps 7–8).
|
|
26
|
+
|
|
27
|
+
**Reference files** (bundled alongside this skill, at `${CLAUDE_SKILL_DIR}`):
|
|
6
28
|
- `patterns-reference.yaml` — Research-backed patterns catalog (quality, security, language-specific)
|
|
7
29
|
- `standard-template.yaml` — YAML skeleton for the Standard
|
|
8
30
|
|
|
9
31
|
---
|
|
10
32
|
|
|
11
|
-
## Step 1:
|
|
33
|
+
## Step 1: Confirm the deterministic phase ran
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
verity doctor --json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
One read gives you prerequisites, which phase is done, the user's recorded
|
|
40
|
+
answers, the hook wiring, and a `next` list. Branch on it:
|
|
41
|
+
|
|
42
|
+
- **`phases.init.done` is false** → `verity init` has not run in this project.
|
|
43
|
+
Run it (it is idempotent, and it is what installed this skill):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
verity init --yes --no-setup
|
|
47
|
+
```
|
|
12
48
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
49
|
+
`--yes` takes the recommended answer for every question — use it only because
|
|
50
|
+
you are already inside a Claude Code session and cannot ask on init's terminal.
|
|
51
|
+
Tell the user which defaults were taken and that `verity init` (run by hand in a
|
|
52
|
+
terminal) is where those choices are made. `--no-setup` stops init from trying
|
|
53
|
+
to launch a second Claude Code session on top of this one.
|
|
54
|
+
- **`blocked` is true** → a required prerequisite is missing. Show the
|
|
55
|
+
`prerequisites[].remedy` lines and stop; nothing below can work.
|
|
56
|
+
- **`artifacts.verityMd` is true and the user did not pass `--force`** → already
|
|
57
|
+
configured. Say "Already configured. Run `/verity-setup --force` to
|
|
58
|
+
reconfigure." and stop.
|
|
59
|
+
- A **warn**-status prerequisite (Claude Code, `@codacy/analysis-cli`) is not
|
|
60
|
+
fatal. Mention it once — a missing analysis CLI means no static findings — and
|
|
61
|
+
continue.
|
|
62
|
+
|
|
63
|
+
Then get the git remote: `git remote get-url origin`. If there is none, ask the
|
|
64
|
+
user for a project identifier to use instead.
|
|
22
65
|
|
|
23
66
|
---
|
|
24
67
|
|
|
@@ -60,80 +103,36 @@ Record all findings. You will use them in the next steps.
|
|
|
60
103
|
|
|
61
104
|
---
|
|
62
105
|
|
|
63
|
-
## Step 3:
|
|
106
|
+
## Step 3: Read the choices already made
|
|
64
107
|
|
|
65
|
-
|
|
108
|
+
From the `verity doctor --json` output in Step 1:
|
|
66
109
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
> Which mode? [balanced]
|
|
110
|
+
| Field | What it is | Where you use it |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| `answers.intensity` | `lightweight` \| `balanced` \| `thorough` | Step 4 (`process_constraints.analysis_mode`) and Step 5 (which tools/patterns) |
|
|
113
|
+
| `answers.moments` | `stop`, `pre-commit`, `pre-push` | Nothing to do — the hooks are already wired to exactly this |
|
|
114
|
+
| `answers.telemetry` | `enabled` \| `declined` \| `deferred` | Nothing to do — mention `deferred` once (see below) |
|
|
73
115
|
|
|
74
|
-
|
|
116
|
+
**Do not ask these again.** They were asked on init's terminal, and the machine
|
|
117
|
+
state already reflects them.
|
|
75
118
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
This decides **when** Verity reviews code. Use the **AskUserQuestion** tool with
|
|
81
|
-
`multiSelect: true`:
|
|
119
|
+
If `answers.intensity` is `null` (a project set up before this file existed, or a
|
|
120
|
+
failed write), that is the only case where you ask — a single question, defaulting
|
|
121
|
+
to `balanced`:
|
|
82
122
|
|
|
83
|
-
> **
|
|
84
|
-
>
|
|
85
|
-
> - **Before commit** — gates `git commit`; reviews the **staged** diff and blocks the commit on FAIL.
|
|
86
|
-
> - **Before push / PR** — gates `git push` and `gh pr create`; reviews the **to-be-pushed** commits and blocks on FAIL.
|
|
87
|
-
>
|
|
88
|
-
> Default: **On stop**
|
|
123
|
+
> **Analysis intensity:** lightweight (critical security only, ~3s) ·
|
|
124
|
+
> **balanced** (security + quality, ~8s) · thorough (all tools, all rules, ~15s)
|
|
89
125
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- These are **Claude Code** hooks (they fire when the agent runs `git commit`/`git push`),
|
|
95
|
-
not native git hooks — no `.git/hooks` files, no GitHub App.
|
|
96
|
-
- "On stop" alone matches today's behavior. Many teams pick **Before commit + Before push**
|
|
97
|
-
and turn **On stop** off to review only at real boundaries.
|
|
98
|
-
|
|
99
|
-
Map the selection to moment ids: On stop → `stop`, Before commit → `pre-commit`,
|
|
100
|
-
Before push/PR → `pre-push`. Remember this list; you apply it in **Step 9**.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Step 3b: Ask about cost & usage telemetry (opt-in)
|
|
105
|
-
|
|
106
|
-
Cost & usage observability is **opt-in** and **required** for the `/usage` dashboard — all
|
|
107
|
-
cost and token data comes from Claude Code's own OpenTelemetry export, so with telemetry off
|
|
108
|
-
the dashboard stays empty.
|
|
109
|
-
|
|
110
|
-
First check the current state (so you don't re-ask if it's already on):
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
verity telemetry check
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
- If it reports **enabled**, don't re-ask — tell the user telemetry is already on and continue
|
|
117
|
-
(mention `verity telemetry uninstall` only if they want to turn it off).
|
|
118
|
-
- If **disabled**, use the **AskUserQuestion** tool:
|
|
119
|
-
|
|
120
|
-
> **Enable Claude Code cost & usage telemetry for this project?**
|
|
121
|
-
> Verity can show cost, tokens, a per-agent / per-session / model breakdown, and a fleet cost
|
|
122
|
-
> tree — by receiving Claude Code's built-in **OpenTelemetry** export. This sends usage
|
|
123
|
-
> **metrics and traces only** (model names, token counts, USD cost, agent types, session IDs).
|
|
124
|
-
> It does **NOT** send your prompts, code, or tool input/output. Without it, the `/usage`
|
|
125
|
-
> dashboard stays empty.
|
|
126
|
-
> - **Yes** (recommended) — enable telemetry
|
|
127
|
-
> - **No** — skip (you can enable later with `verity telemetry install`)
|
|
128
|
-
|
|
129
|
-
Remember the answer; you act on it in Step 7b (the token must exist first). **Declining is
|
|
130
|
-
fine and reversible** — nothing is written, and the next `/verity-setup` re-offers it.
|
|
126
|
+
If `answers.telemetry` is `deferred`, the user asked for cost & usage telemetry
|
|
127
|
+
before a token existed. Say so once, and that `verity login` followed by
|
|
128
|
+
`verity telemetry install` finishes it. Do not run either — logging in is the
|
|
129
|
+
user's decision to make at a terminal.
|
|
131
130
|
|
|
132
131
|
---
|
|
133
132
|
|
|
134
133
|
## Step 4: Synthesize the Standard
|
|
135
134
|
|
|
136
|
-
Read
|
|
135
|
+
Read `${CLAUDE_SKILL_DIR}/patterns-reference.yaml` and `${CLAUDE_SKILL_DIR}/standard-template.yaml`.
|
|
137
136
|
|
|
138
137
|
Generate `.verity/standard.yaml` by filling in the template:
|
|
139
138
|
|
|
@@ -149,9 +148,9 @@ Generate `.verity/standard.yaml` by filling in the template:
|
|
|
149
148
|
- Existing code patterns (e.g., "RLS policies on all Supabase tables")
|
|
150
149
|
- Each pattern needs: id, description, severity, rationale
|
|
151
150
|
|
|
152
|
-
5. **process_constraints**: Set `analysis_mode` to
|
|
151
|
+
5. **process_constraints**: Set `analysis_mode` to `answers.intensity` from Step 3. Keep `self_healing_limit: 2`. Leave the knowledge-system flags (`compound_enabled`, `memory_graph_enabled`, `memory_graph_budget_tokens`, `knowledge_injection_budget_tokens`, `finding_autosuppress_threshold`) and intent thresholds (`intent_fail_threshold`, `intent_warn_threshold`) at their template defaults — they're surfaced so users can tune later, not so you pick new values during setup.
|
|
153
152
|
|
|
154
|
-
6. **tool_configuration**: Based on detected languages +
|
|
153
|
+
6. **tool_configuration**: Based on detected languages + the intensity from Step 3, select tools from the patterns reference `tool_recommendations` section. For existing tool configs, set the config_file path.
|
|
155
154
|
|
|
156
155
|
Write the file to `.verity/standard.yaml`. Show the user a summary:
|
|
157
156
|
> **Standard synthesized:**
|
|
@@ -206,7 +205,7 @@ it from the installed adapter. Then **always validate** (next section).
|
|
|
206
205
|
|
|
207
206
|
```bash
|
|
208
207
|
# balanced/thorough: critical + high vulns, secrets, malicious packages
|
|
209
|
-
node
|
|
208
|
+
node ${CLAUDE_SKILL_DIR}/validate-patterns.mjs --emit Trivy \
|
|
210
209
|
'^Trivy_(secret|malicious_packages|vulnerability_(critical|high))$'
|
|
211
210
|
|
|
212
211
|
# lightweight: drop malicious_packages if you want the minimum
|
|
@@ -391,7 +390,7 @@ alongside this skill. It checks every `patternId` against the IDs the installed
|
|
|
391
390
|
adapters actually define, and exits non-zero on any that does not exist:
|
|
392
391
|
|
|
393
392
|
```bash
|
|
394
|
-
node
|
|
393
|
+
node ${CLAUDE_SKILL_DIR}/validate-patterns.mjs
|
|
395
394
|
```
|
|
396
395
|
|
|
397
396
|
Expected output:
|
|
@@ -459,7 +458,7 @@ disabled tool produces the same zero findings as clean code, so a quiet run prov
|
|
|
459
458
|
nothing on its own:
|
|
460
459
|
|
|
461
460
|
```bash
|
|
462
|
-
node
|
|
461
|
+
node ${CLAUDE_SKILL_DIR}/validate-patterns.mjs
|
|
463
462
|
```
|
|
464
463
|
|
|
465
464
|
Then confirm the volume is sane:
|
|
@@ -480,57 +479,47 @@ binary — Semgrep needs Opengrep installed separately, and at `--log-level erro
|
|
|
480
479
|
|
|
481
480
|
---
|
|
482
481
|
|
|
483
|
-
## Step 6:
|
|
482
|
+
## Step 6: Check authentication
|
|
484
483
|
|
|
485
|
-
Login
|
|
486
|
-
|
|
487
|
-
the rest of setup accordingly.
|
|
488
|
-
|
|
489
|
-
**If the user asks what signing in does or why it matters, tell them:**
|
|
490
|
-
- It confirms they have **write access to this repository** — the GitHub token is
|
|
491
|
-
used **once** to verify that, then discarded. Verity never stores it.
|
|
492
|
-
- It does **not** give Verity access to their code. Code checked by the gate is
|
|
493
|
-
analyzed **in memory and discarded** — Verity never stores their code.
|
|
494
|
-
- It is **required to store and access run history** for the repo (past results,
|
|
495
|
-
trends, and shareable reports).
|
|
496
|
-
- Skipping keeps Verity fully **local-only**: the gate still runs and shows
|
|
497
|
-
findings, but nothing is uploaded.
|
|
484
|
+
Login happens in `verity init` (an optional, skippable step), **not** here. This
|
|
485
|
+
step only checks whether it happened, and branches the rest of setup.
|
|
498
486
|
|
|
499
487
|
```bash
|
|
500
488
|
verity auth verify
|
|
501
489
|
```
|
|
502
490
|
|
|
503
|
-
- **Token valid** (prints the project name):
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
and continue to Step 8. Tell the user they can authenticate anytime to unlock
|
|
511
|
-
deep review, history, and shareable reports by running:
|
|
491
|
+
- **Token valid** (prints the project name): continue to Step 7 — the Standard,
|
|
492
|
+
config, and knowledge base will upload.
|
|
493
|
+
- **Not authenticated / no token**: the user skipped login in `verity init` (or
|
|
494
|
+
lacks write access). Verity runs in **local-only mode** — the gate still runs
|
|
495
|
+
and surfaces findings, but nothing uploads and no history is stored. **Skip
|
|
496
|
+
Step 7** (it requires a token) and continue to Step 8. Tell them they can
|
|
497
|
+
authenticate anytime with:
|
|
512
498
|
|
|
513
499
|
```bash
|
|
514
500
|
verity login # one GitHub login covers every repo you can write to
|
|
515
|
-
# or: verity init # re-runs init; offers the same auth prompt
|
|
516
501
|
```
|
|
517
502
|
|
|
518
|
-
|
|
519
|
-
flow** ("open https://github.com/login/device and enter code WXYZ-1234"),
|
|
520
|
-
proving the user has **write access** before the service issues a token. The
|
|
521
|
-
GitHub App requests only read-only permissions (Metadata + Email addresses);
|
|
522
|
-
the provider token is used once server-side to sweep the repositories the user
|
|
523
|
-
can write to, and is never persisted.
|
|
503
|
+
Then re-run `/verity-setup --force` to upload what was generated locally.
|
|
524
504
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
505
|
+
**If the user asks what signing in does or why it matters:**
|
|
506
|
+
- It confirms they have **write access to this repository** — the GitHub token is
|
|
507
|
+
used **once** for that check, then discarded. Verity never stores it.
|
|
508
|
+
- It does **not** give Verity access to their code. Code checked by the gate is
|
|
509
|
+
analyzed **in memory and discarded**.
|
|
510
|
+
- It is **required to store and access run history** (past results, trends,
|
|
511
|
+
shareable reports).
|
|
512
|
+
- Login is **provider-gated** (GitHub today) via a GitHub App **device flow**
|
|
513
|
+
("open https://github.com/login/device and enter code WXYZ-1234"). The App
|
|
514
|
+
requests only read-only permissions (Metadata + Email addresses).
|
|
515
|
+
- **One login covers every repository** the user can write to. Re-running
|
|
516
|
+
`verity login` is also how newly-granted repos are picked up and how an expired
|
|
517
|
+
verification is restored. If login reports this repository is **not covered**,
|
|
518
|
+
the Verity GitHub App has not been granted access to it — grant it, then re-run
|
|
519
|
+
`verity login`.
|
|
520
|
+
|
|
521
|
+
The token and service_url live in the single global file `~/.verity/credentials`
|
|
522
|
+
— nothing secret is written into the repo.
|
|
534
523
|
|
|
535
524
|
---
|
|
536
525
|
|
|
@@ -570,31 +559,6 @@ This derives a small set of descriptive memory nodes from what you already analy
|
|
|
570
559
|
|
|
571
560
|
---
|
|
572
561
|
|
|
573
|
-
## Step 7b: Enable telemetry (only if the user opted in at Step 3b)
|
|
574
|
-
|
|
575
|
-
> **Skip this step if the user is not authenticated** (local-only mode) — telemetry
|
|
576
|
-
> export requires the token. Note that `/usage` stays empty until they authenticate
|
|
577
|
-
> and run `verity telemetry install`.
|
|
578
|
-
|
|
579
|
-
If — and only if — the user said **Yes** in Step 3b, enable the Claude Code telemetry export
|
|
580
|
-
now (the token from Step 6 must already exist):
|
|
581
|
-
|
|
582
|
-
```bash
|
|
583
|
-
verity telemetry install
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
This writes the `OTEL_*` env block plus an `otelHeadersHelper` to `.claude/settings.local.json`
|
|
587
|
-
and points Claude Code's OpenTelemetry exporter at Verity's OTLP endpoint. No token is written to
|
|
588
|
-
the file — the helper (`verity telemetry headers`) resolves the project token from
|
|
589
|
-
`~/.verity/credentials` at session start, so the secret never lands in the repo. Tell the user it
|
|
590
|
-
takes effect on their **next** Claude Code session, that first metrics appear within ~60s of
|
|
591
|
-
activity, and point them at `/usage`.
|
|
592
|
-
|
|
593
|
-
If the user declined, skip this step and note that `/usage` will stay empty until they run
|
|
594
|
-
`verity telemetry install`.
|
|
595
|
-
|
|
596
|
-
---
|
|
597
|
-
|
|
598
562
|
## Step 8: Generate VERITY.md file
|
|
599
563
|
|
|
600
564
|
Create `VERITY.md` at the project root with this content:
|
|
@@ -633,125 +597,7 @@ Every time the coding agent stops, the Verity hook:
|
|
|
633
597
|
|
|
634
598
|
---
|
|
635
599
|
|
|
636
|
-
## Step
|
|
637
|
-
|
|
638
|
-
If `CLAUDE.md` exists (or `.claude/CLAUDE.md`), append these two blocks. If it doesn't exist, create it with these blocks. Do NOT overwrite existing content — append only.
|
|
639
|
-
|
|
640
|
-
```markdown
|
|
641
|
-
|
|
642
|
-
## Project Knowledge Base
|
|
643
|
-
> Read `.verity/memory/index.md` for accumulated project context, decisions, and conventions.
|
|
644
|
-
|
|
645
|
-
## Post-task reflection
|
|
646
|
-
When a task is complete (you've created a PR, the user says "done" or "ship it",
|
|
647
|
-
or the work is clearly finished), **draft the reflection yourself first** — 1–3
|
|
648
|
-
concrete things worth remembering (a decision, a gotcha, or a pattern), each
|
|
649
|
-
cited with the files / PR / commands / error-signatures it came from. Skip
|
|
650
|
-
entirely if nothing non-obvious happened.
|
|
651
|
-
|
|
652
|
-
Then, depending on how the session is running:
|
|
653
|
-
|
|
654
|
-
- **Interactive** (a person is at the keyboard): show your draft and ask one
|
|
655
|
-
question before recording —
|
|
656
|
-
|
|
657
|
-
> "Here's my reflection draft for the project memory: \<draft\>. Anything to
|
|
658
|
-
> confirm, correct, or add before I record it? (Say 'skip' to drop it.)"
|
|
659
|
-
|
|
660
|
-
Record the final text (with their corrections) via
|
|
661
|
-
`verity reflect --user-input "<final reflection>" --kind <kind>`. If they say
|
|
662
|
-
"skip", do not record.
|
|
663
|
-
|
|
664
|
-
- **Autonomous** (headless / CI / cron, or `VERITY_AUTONOMOUS=1`): record your
|
|
665
|
-
draft directly, never blocking —
|
|
666
|
-
`verity reflect --user-input "<your draft>" --kind <kind> --autonomous`.
|
|
667
|
-
```
|
|
668
|
-
|
|
669
|
-
These blocks enable two capabilities:
|
|
670
|
-
1. **Knowledge Base pointer** — agents can browse `.verity/memory/` for project context on demand (KNOWLEDGE-SYSTEM §8.2 Path B)
|
|
671
|
-
2. **Post-task reflection** — the compound moment where the agent drafts a cited reflection and the user confirms/corrects it (interactive) or it's auto-recorded (autonomous), entering the knowledge base (KNOWLEDGE-SYSTEM §9.3)
|
|
672
|
-
|
|
673
|
-
---
|
|
674
|
-
|
|
675
|
-
## Step 9: Wire the selected moments
|
|
676
|
-
|
|
677
|
-
Apply the moments the user chose in **Step 3a**. Pass the comma-separated moment ids
|
|
678
|
-
(always include the always-on intent hook automatically):
|
|
679
|
-
|
|
680
|
-
```bash
|
|
681
|
-
# Example: user chose On stop + Before commit + Before push
|
|
682
|
-
verity hooks install --moments stop,pre-commit,pre-push
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
`--moments` reconciles Verity's own hooks in `.claude/settings.json` to **exactly**
|
|
686
|
-
the selection (adding the git-moment gate, removing the Stop hook if unselected),
|
|
687
|
-
while preserving every non-Verity hook. The `verity intent capture` hook is always
|
|
688
|
-
installed. If the user picked only `stop` (the default), pass `--moments stop`.
|
|
689
|
-
|
|
690
|
-
Then verify:
|
|
691
|
-
|
|
692
|
-
```bash
|
|
693
|
-
verity hooks check
|
|
694
|
-
```
|
|
695
|
-
|
|
696
|
-
Expected output (for `stop,pre-commit,pre-push`):
|
|
697
|
-
```
|
|
698
|
-
[verity] Stop hook (verity analyze): installed
|
|
699
|
-
[verity] Intent hook (verity intent capture): installed
|
|
700
|
-
[verity] Git-moment gate (verity guard): installed [commit, push]
|
|
701
|
-
```
|
|
702
|
-
|
|
703
|
-
The git-moment gate is a single `PreToolUse(Bash)` hook (`verity guard`) that
|
|
704
|
-
intercepts `git commit` / `git push` / `gh pr create` and reviews the staged or
|
|
705
|
-
to-be-pushed diff before it lands.
|
|
706
|
-
|
|
707
|
-
---
|
|
708
|
-
|
|
709
|
-
## Step 10: Update .gitignore
|
|
710
|
-
|
|
711
|
-
Add these entries to `.gitignore` (create it if it doesn't exist, append if it does):
|
|
712
|
-
|
|
713
|
-
```
|
|
714
|
-
# Verity — machine-local state. Everything in .verity/ is ignored EXCEPT the
|
|
715
|
-
# shared standard and the knowledge graph, which are meant to be committed.
|
|
716
|
-
.verity/*
|
|
717
|
-
!.verity/standard.yaml
|
|
718
|
-
!.verity/memory/
|
|
719
|
-
.verity/memory/log.md
|
|
720
|
-
.claude/settings.local.json
|
|
721
|
-
```
|
|
722
|
-
|
|
723
|
-
This is a whitelist on purpose: `.verity/` accumulates state files over time
|
|
724
|
-
(`.snapshot/` holds byte-for-byte copies of analyzed files — including any
|
|
725
|
-
secret the gate just flagged — plus `.cache/`, `.logs/`, `.baseline`,
|
|
726
|
-
`.task-context`, session-suffixed `.last-analysis.*` files, and whatever comes
|
|
727
|
-
next). Enumerating them one by one is how `.snapshot/` ended up committed in a
|
|
728
|
-
real repo; ignoring everything and re-including the two shared artifacts means
|
|
729
|
-
a future state file can never repeat that.
|
|
730
|
-
|
|
731
|
-
**If the repo previously committed Verity state** (check with
|
|
732
|
-
`git ls-files .verity`), untrack everything except the shared artifacts once:
|
|
733
|
-
|
|
734
|
-
```bash
|
|
735
|
-
git rm -r --cached .verity
|
|
736
|
-
git add .verity/standard.yaml .verity/memory
|
|
737
|
-
```
|
|
738
|
-
|
|
739
|
-
`.claude/settings.local.json` is machine-local Claude Code config (telemetry endpoint + an
|
|
740
|
-
`otelHeadersHelper` reference — no token). `verity telemetry install` adds this entry
|
|
741
|
-
automatically.
|
|
742
|
-
|
|
743
|
-
Do NOT gitignore `.verity/standard.yaml` or `VERITY.md` — those should be committed.
|
|
744
|
-
|
|
745
|
-
**Commit the knowledge graph, but not its log.** The nodes under `.verity/memory/<domain>/` and `.verity/memory/index.md` are durable project knowledge meant to be committed and reviewed. But `.verity/memory/log.md` is an append-only, per-run timestamped activity log — it churns on every analysis and carries no reviewable content, so it is gitignored above. If a project already committed it, untrack it once with `git rm --cached .verity/memory/log.md`.
|
|
746
|
-
|
|
747
|
-
**No secrets live in the repo anymore.** The project token is stored only in the single global
|
|
748
|
-
file `~/.verity/credentials` (outside the repo, keyed by git remote), so there is no
|
|
749
|
-
`.verity/credentials` to ignore. If an older install left one behind, the CLI folds it into the
|
|
750
|
-
global store and removes it automatically on the next `verity` command.
|
|
751
|
-
|
|
752
|
-
---
|
|
753
|
-
|
|
754
|
-
## Step 10b: Offer a `.verityignore` (optional)
|
|
600
|
+
## Step 9: Offer a `.verityignore` (optional)
|
|
755
601
|
|
|
756
602
|
Only if the codebase analysis in Step 2 found committed generated output —
|
|
757
603
|
`dist/`, `build/`, vendored bundles, generated API clients, large fixture
|
|
@@ -793,32 +639,35 @@ Two things to tell the user, because both surprise people:
|
|
|
793
639
|
Excluded files are still named in every run's coverage ledger, and the share of
|
|
794
640
|
changed files they cover is reported — an ignore file is never silent.
|
|
795
641
|
|
|
796
|
-
|
|
642
|
+
---
|
|
643
|
+
|
|
644
|
+
## Step 10: Show summary
|
|
797
645
|
|
|
798
|
-
|
|
646
|
+
Report both halves, so the user sees one flow rather than two:
|
|
799
647
|
|
|
800
648
|
```
|
|
801
|
-
=== Verity
|
|
649
|
+
=== Verity setup complete ===
|
|
802
650
|
|
|
803
651
|
Project: ${PROJECT_NAME}
|
|
804
652
|
Languages: ${LANGUAGES}
|
|
805
653
|
Frameworks: ${FRAMEWORKS}
|
|
806
654
|
Architecture: ${ARCHITECTURE}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
Next: You should now be seeing the first analysis happening below. The hook will fire automatically every time your agent stops working on something.
|
|
655
|
+
Intensity: ${MODE} (chosen during verity init)
|
|
656
|
+
|
|
657
|
+
This step wrote:
|
|
658
|
+
.verity/standard.yaml — Standard v1 (4 quality, 7 security, N custom patterns)
|
|
659
|
+
.codacy/codacy.config.json — ${TOOL_LIST}, curated patterns, validated
|
|
660
|
+
VERITY.md — project quality overview
|
|
661
|
+
.verityignore — only if you created one in Step 9
|
|
662
|
+
|
|
663
|
+
Already in place from verity init:
|
|
664
|
+
Hooks: ${MOMENTS} (+ intent, baseline, compact, session-end)
|
|
665
|
+
Telemetry: ${TELEMETRY_STATUS}
|
|
666
|
+
Uploads: ${authenticated ? "on — runs & memory sync to Verity" : "off — local-only mode"}
|
|
667
|
+
|
|
668
|
+
Next: the gate now runs at the moments you chose. You should see the first
|
|
669
|
+
analysis below.
|
|
824
670
|
```
|
|
671
|
+
|
|
672
|
+
Run `verity doctor` if anything above looks wrong — it reports the real state of
|
|
673
|
+
every part of the install.
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
Show Verity quality status for this project: Standard version, last run summary, quality
|
|
4
|
+
trend, and pending items. Use when the user asks how the project is doing, what Verity found
|
|
5
|
+
recently, or whether the gate is passing.
|
|
6
|
+
---
|
|
1
7
|
# /verity-status — Show Verity quality status
|
|
2
8
|
|
|
3
9
|
You are showing the current Verity quality status for this project. This gives a quick overview of project health without running a new analysis.
|