docgov-cli 0.2.0
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/.claude-plugin/marketplace.json +29 -0
- package/.claude-plugin/plugin.json +41 -0
- package/LICENSE +21 -0
- package/README.md +136 -0
- package/agents/architect.md +65 -0
- package/agents/classifier.md +44 -0
- package/agents/drift-reviewer.md +59 -0
- package/agents/quality-reviewer.md +59 -0
- package/bin/docgov +1160 -0
- package/bin/docgov.cmd +2 -0
- package/core/check.js +298 -0
- package/core/classify.js +233 -0
- package/core/config.js +162 -0
- package/core/context.js +144 -0
- package/core/document.js +132 -0
- package/core/drift.js +225 -0
- package/core/find.js +61 -0
- package/core/frontmatter.js +65 -0
- package/core/git.js +113 -0
- package/core/graph.js +182 -0
- package/core/health.js +101 -0
- package/core/impact.js +146 -0
- package/core/invariants.js +126 -0
- package/core/inventory.js +167 -0
- package/core/links.js +80 -0
- package/core/migrate.js +158 -0
- package/core/onboard.js +271 -0
- package/core/paths.js +53 -0
- package/core/publish.js +92 -0
- package/core/registry.js +71 -0
- package/core/similarity.js +89 -0
- package/core/size.js +87 -0
- package/core/suppressions.js +58 -0
- package/core/taxonomy.js +477 -0
- package/core/templates.js +159 -0
- package/core/util.js +124 -0
- package/core/yaml.js +250 -0
- package/hooks/hooks.json +65 -0
- package/lenses/agent.md +38 -0
- package/lenses/architecture.md +30 -0
- package/lenses/developer.md +26 -0
- package/lenses/operations.md +32 -0
- package/lenses/readme.md +32 -0
- package/lenses/security.md +33 -0
- package/lenses/user.md +30 -0
- package/package.json +39 -0
- package/policy/documentation.md +82 -0
- package/schemas/config.json +239 -0
- package/schemas/frontmatter.json +299 -0
- package/skills/affected/SKILL.md +41 -0
- package/skills/brief/SKILL.md +38 -0
- package/skills/create/SKILL.md +53 -0
- package/skills/find/SKILL.md +32 -0
- package/skills/health/SKILL.md +36 -0
- package/skills/inspect/SKILL.md +58 -0
- package/skills/publish/SKILL.md +45 -0
- package/skills/review/SKILL.md +65 -0
- package/skills/setup/SKILL.md +52 -0
- package/skills/stale/SKILL.md +55 -0
- package/skills/tag/SKILL.md +59 -0
- package/templates/architecture.adr.md +42 -0
- package/templates/architecture.domain.md +44 -0
- package/templates/architecture.trd.md +72 -0
- package/templates/constitution.invariants.md +40 -0
- package/templates/operations.runbook.md +47 -0
- package/templates/product.prd.md +60 -0
- package/templates/security.threat-model.md +51 -0
- package/templates/user.readme.md +43 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docgov-marketplace",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "DocGov"
|
|
5
|
+
},
|
|
6
|
+
"metadata": {
|
|
7
|
+
"description": "Your AI writes docs faster than anyone can check them. DocGov checks them.",
|
|
8
|
+
"version": "0.2.0"
|
|
9
|
+
},
|
|
10
|
+
"plugins": [
|
|
11
|
+
{
|
|
12
|
+
"name": "docgov",
|
|
13
|
+
"source": "./",
|
|
14
|
+
"description": "Your AI writes docs faster than anyone can check them. DocGov checks them — catches stale docs, duplicate files, and docs that contradict your code. Claude Code plugin + CLI.",
|
|
15
|
+
"version": "0.2.0",
|
|
16
|
+
"category": "documentation",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"documentation",
|
|
19
|
+
"docs",
|
|
20
|
+
"ai",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"drift",
|
|
23
|
+
"stale-docs",
|
|
24
|
+
"adr",
|
|
25
|
+
"docs-as-code"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docgov",
|
|
3
|
+
"displayName": "DocGov",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"description": "Your AI writes docs faster than anyone can check them. DocGov checks them — catches stale docs, duplicate files, and docs that contradict your code. Claude Code plugin + CLI.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "DocGov"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"documentation",
|
|
12
|
+
"docs",
|
|
13
|
+
"ai",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"drift",
|
|
16
|
+
"stale-docs",
|
|
17
|
+
"adr",
|
|
18
|
+
"docs-as-code"
|
|
19
|
+
],
|
|
20
|
+
"hooks": "./hooks/hooks.json",
|
|
21
|
+
"userConfig": {
|
|
22
|
+
"enforcement": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"title": "Enforcement level",
|
|
25
|
+
"description": "How strict to be. 'repo' follows .docgov/config.yaml (recommended), 'warn' never blocks a write, 'strict' blocks on every rule DocGov can decide for itself.",
|
|
26
|
+
"default": "repo"
|
|
27
|
+
},
|
|
28
|
+
"semantic_gate": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"title": "Semantic gate on new documents",
|
|
31
|
+
"description": "Have a fast model glance at new documents for wrong-audience writing and things that shouldn't be public. Adds about two seconds when you create a document; does nothing when you edit one.",
|
|
32
|
+
"default": true
|
|
33
|
+
},
|
|
34
|
+
"session_briefing": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"title": "Session briefing",
|
|
37
|
+
"description": "Tell your agent which documents are authoritative when a session starts, so it knows what it isn't allowed to contradict.",
|
|
38
|
+
"default": true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zeeshan Sultan
|
|
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,136 @@
|
|
|
1
|
+
# DocGov
|
|
2
|
+
|
|
3
|
+
**Your agent wrote 40 markdown files last week. How many of them are lies?**
|
|
4
|
+
|
|
5
|
+
DocGov is the adult in the room for AI-written docs. It decides where files go, notices when
|
|
6
|
+
two documents contradict each other, and tells you what went stale the moment you change code.
|
|
7
|
+
|
|
8
|
+
It's a Claude Code plugin and a standalone CLI. Node 20+, zero dependencies, nothing leaves
|
|
9
|
+
your machine.
|
|
10
|
+
|
|
11
|
+
## What it looks like
|
|
12
|
+
|
|
13
|
+
You point it at a repo that's been vibe-coded for a few months:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
$ docgov review
|
|
17
|
+
|
|
18
|
+
DocGov review
|
|
19
|
+
─────────────
|
|
20
|
+
5 documents inventoried · 0 machine contracts · stack: none detected
|
|
21
|
+
|
|
22
|
+
Finding Count
|
|
23
|
+
----------------------------- -----
|
|
24
|
+
unclassified 3
|
|
25
|
+
low-confidence classification 1
|
|
26
|
+
moves proposed 1
|
|
27
|
+
frontmatter to add 5
|
|
28
|
+
suspected duplicates 0
|
|
29
|
+
missing documents 2
|
|
30
|
+
|
|
31
|
+
Plan written to .docgov/fix-plan.md — nothing has changed.
|
|
32
|
+
4 of 11 actions need a judgement call.
|
|
33
|
+
|
|
34
|
+
Read the plan, delete anything you disagree with, then: docgov fix --dry-run
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Nothing moved. It wrote you a plan. You read it, delete the parts you disagree with, and run
|
|
38
|
+
`docgov fix` — which works on a branch and reverts itself if anything fails to verify.
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
claude plugin marketplace add ZeeshanSultan/DocGov
|
|
44
|
+
claude plugin install docgov
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
That gets you the hooks, which are the good part: your agent gets handed the rules before it
|
|
48
|
+
edits governed code, and gets stopped before it writes a doc in the wrong place.
|
|
49
|
+
|
|
50
|
+
Not using Claude Code? The CLI works on its own, and it's the same binary CI runs:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx docgov-cli setup
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
(The package is `docgov-cli` because npm won't hand out `docgov`. The command you type is
|
|
57
|
+
still `docgov`.)
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
Your first five minutes:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
docgov setup # turn it on. infers your project's shape, writes .docgov/config.yaml
|
|
65
|
+
docgov review # look at the docs you already have. writes a plan, changes nothing
|
|
66
|
+
docgov fix # run the plan, on a branch, reverting itself if verification fails
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then, day to day:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
docgov check # did I just break a rule?
|
|
73
|
+
docgov stale # which docs did the code move out from under?
|
|
74
|
+
docgov affected # I changed this — what do I need to update?
|
|
75
|
+
docgov health # how bad is it, out of 100?
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Every command takes `--json`. Full list: **[docs/reference/commands.md](docs/reference/commands.md)**.
|
|
79
|
+
|
|
80
|
+
## What it actually does
|
|
81
|
+
|
|
82
|
+
| | |
|
|
83
|
+
|---|---|
|
|
84
|
+
| **Knows what a document is** | 57 document classes. Each one has a place it belongs, sections it must have, and a size past which it stops being that kind of document. Point it at a file and it'll tell you what you wrote. |
|
|
85
|
+
| **Knows which docs outrank which** | Your spec beats the tutorial that paraphrases it. A README can't quietly contradict an ADR. When two documents disagree, there's a defined answer for which one is wrong. |
|
|
86
|
+
| **Hands your agent the rules** | Write `INV-LIC-001 A license belongs to exactly one organization.` in a spec, map it to the code it governs, and every agent that touches that code gets the rule before it writes a line. Cheapest useful thing in here. |
|
|
87
|
+
| **Notices when docs go stale** | Code moved and the doc didn't. Spec moved and the code didn't. Your OpenAPI file is ahead of the page describing it. Scored by what changed *around* a document, not by how old it is. |
|
|
88
|
+
| **Tells you what to update** | You changed this file — here are the docs that need to change with it, split into required and optional, as a checklist your agent can work through and CI can check. |
|
|
89
|
+
| **Packs context for agents** | `docgov brief billing` returns the minimum authoritative context for an area and nothing else. It's the only documentation your agent pays tokens for. |
|
|
90
|
+
| **Won't let you leak** | Before anything goes public it flags what would leak and writes rewrite briefs. An external doc is a different artifact, not a redacted copy. Nothing publishes automatically. |
|
|
91
|
+
|
|
92
|
+
## How it decides things
|
|
93
|
+
|
|
94
|
+
Two halves, and the split is the whole design:
|
|
95
|
+
|
|
96
|
+
**Software decides what blocks.** Is this id a duplicate? Is this file in the right place? Did
|
|
97
|
+
code change that a spec claims to describe? Same answer in your editor and in CI, and it can
|
|
98
|
+
always show its working.
|
|
99
|
+
|
|
100
|
+
**A model decides what's subjective.** Do these two documents actually contradict each other?
|
|
101
|
+
Should this be split? Is this prose still true? Reported for review, never enforced.
|
|
102
|
+
|
|
103
|
+
> An LLM never decides whether `docgov.id` is duplicated. Software never decides whether your
|
|
104
|
+
> prose is clear.
|
|
105
|
+
|
|
106
|
+
A governance tool that blocks a README typo gets uninstalled, so enforcement ramps: adopting
|
|
107
|
+
DocGov on a repo that already has docs starts in warn-only, and `setup` tells you when to turn
|
|
108
|
+
that off.
|
|
109
|
+
|
|
110
|
+
## Honest limits
|
|
111
|
+
|
|
112
|
+
- **Stale ≠ wrong.** DocGov tells you, as a fact, that a document claims to describe code that
|
|
113
|
+
changed while the document didn't. Whether the prose now *contradicts* the code is a
|
|
114
|
+
judgement call, made by an agent, and it's advisory. Claiming otherwise would be the fastest
|
|
115
|
+
way to lose your trust.
|
|
116
|
+
- **Quality scores don't fail builds.** A subjective judgement that fails a build is one nobody
|
|
117
|
+
can appeal.
|
|
118
|
+
- **`fix` needs git and a clean tree.** "Without losing anything" is only a real promise if
|
|
119
|
+
every change is revertible.
|
|
120
|
+
|
|
121
|
+
## Where everything else is
|
|
122
|
+
|
|
123
|
+
- **[docs/reference/commands.md](docs/reference/commands.md)** — every command, what it does, what it writes
|
|
124
|
+
- [docs/architecture.md](docs/architecture.md) — how it's built
|
|
125
|
+
- [SECURITY.md](SECURITY.md) — what the hooks run, and what never leaves your machine
|
|
126
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) — the one architectural rule
|
|
127
|
+
- [CHANGELOG.md](CHANGELOG.md) — what changed
|
|
128
|
+
- [examples/policy-packs](examples/policy-packs/README.md) — governance across a whole organization
|
|
129
|
+
- [Issues](https://github.com/ZeeshanSultan/DocGov/issues) — bugs, and especially false
|
|
130
|
+
positives. A rule that fires when it shouldn't is the bug that decides whether anyone trusts
|
|
131
|
+
this thing.
|
|
132
|
+
|
|
133
|
+
`npm test` runs 63 tests against real temporary git repos. DocGov governs its own repository,
|
|
134
|
+
so `docgov check --all` here is a real end-to-end test.
|
|
135
|
+
|
|
136
|
+
[MIT](LICENSE).
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect
|
|
3
|
+
description: Adjudicates contradictions between documents, designs documentation information architecture, and decides how oversized documents should be split. Use for contradiction review, taxonomy decisions, split and merge planning.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: opus
|
|
6
|
+
effort: high
|
|
7
|
+
maxTurns: 30
|
|
8
|
+
color: purple
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are the documentation architect. You make the structural judgements DocGov refuses to
|
|
12
|
+
make automatically, because getting them wrong silently is worse than asking.
|
|
13
|
+
|
|
14
|
+
## Adjudicating contradictions
|
|
15
|
+
|
|
16
|
+
`docgov inspect contradictions --json` gives you narrowed candidate pairs with excerpts.
|
|
17
|
+
Textual similarity put them on the list; only you can say whether they conflict.
|
|
18
|
+
|
|
19
|
+
For each pair, reach exactly one of three verdicts:
|
|
20
|
+
|
|
21
|
+
- **Contradiction.** The documents state incompatible facts. Quote both sentences. Then
|
|
22
|
+
apply the authority model: the higher-authority document is presumed correct, and the
|
|
23
|
+
lower one must change. Say plainly when you think the presumption is wrong — a canonical
|
|
24
|
+
spec that has fallen behind reality is a real thing, and in that case the spec is what
|
|
25
|
+
needs fixing, not the guide that describes what actually happens.
|
|
26
|
+
- **Equal authority.** No tie-break exists. Do not pick. Escalate with both claims stated
|
|
27
|
+
and a recommendation for which should become authoritative.
|
|
28
|
+
- **Acceptable overlap.** Different audiences saying the same thing in different registers.
|
|
29
|
+
Leave it alone and say so in one line.
|
|
30
|
+
|
|
31
|
+
A contradiction report that does not quote the two conflicting sentences is not a report.
|
|
32
|
+
|
|
33
|
+
## Designing information architecture
|
|
34
|
+
|
|
35
|
+
When asked where documentation should live:
|
|
36
|
+
|
|
37
|
+
- **Start at the smallest structure that works.** The compact layout handles most
|
|
38
|
+
repositories. The numbered `00-canonical` … `99-archive` tree earns its overhead at
|
|
39
|
+
roughly 25+ documents or when several teams own different parts of the tree. Recommending
|
|
40
|
+
the full taxonomy for a twelve-document repository is a failure, not thoroughness.
|
|
41
|
+
- **Namespaces may be empty.** An empty namespace communicates "this kind of document
|
|
42
|
+
belongs here". A namespace full of `TODO` placeholders communicates nothing and rots.
|
|
43
|
+
- **Every tree needs an index.** Overview → concept → guide → reference. A reader should
|
|
44
|
+
never hit five thousand words before learning what a subsystem does.
|
|
45
|
+
- **One document, one concept.** A document holding several independently addressable
|
|
46
|
+
concepts becomes a directory with an index.
|
|
47
|
+
|
|
48
|
+
## Planning splits
|
|
49
|
+
|
|
50
|
+
1. Identify the independently addressable concepts — usually the H2 sections that could
|
|
51
|
+
stand alone and be linked to on their own.
|
|
52
|
+
2. Name the class of each part; they are often different classes, and that is a signal the
|
|
53
|
+
original document was doing too much.
|
|
54
|
+
3. The parent becomes a real overview, not a stub: what the area is, how the parts relate,
|
|
55
|
+
then the links.
|
|
56
|
+
4. Content moves **verbatim**. Improving prose during a split is how information goes
|
|
57
|
+
missing. Improve it in a separate change where the diff is readable.
|
|
58
|
+
5. Say what each part's `depends_on` should be, so the graph preserves the structure the
|
|
59
|
+
single file implied.
|
|
60
|
+
|
|
61
|
+
## Always
|
|
62
|
+
|
|
63
|
+
State your reasoning before your conclusion. Quote the documents. When the right answer
|
|
64
|
+
depends on something only the user knows — which team owns an area, whether a behaviour is
|
|
65
|
+
intended — ask rather than assume.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: classifier
|
|
3
|
+
description: Decides what an ambiguous document actually is, when the deterministic classifier could not. Use for documents where docgov whatis reports needsReview, or for bulk classification during onboarding.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
effort: low
|
|
7
|
+
maxTurns: 20
|
|
8
|
+
color: blue
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You classify documents into DocGov's taxonomy. You are called only for the cases the
|
|
12
|
+
deterministic classifier could not decide, so assume every case you see is genuinely
|
|
13
|
+
ambiguous and that filename heuristics have already been tried and failed.
|
|
14
|
+
|
|
15
|
+
## Method
|
|
16
|
+
|
|
17
|
+
1. Run `docgov types --json` to get the full class list. Never invent a class.
|
|
18
|
+
2. Run `docgov whatis --path <file> --json` to see the candidates and the signals that
|
|
19
|
+
produced them. The signals tell you what the classifier saw; your job is to see what it
|
|
20
|
+
missed.
|
|
21
|
+
3. Read enough of the document to answer one question: **what does this document let a
|
|
22
|
+
reader do?** That is what decides its class, not what it is titled.
|
|
23
|
+
- establishes a rule everything else defers to → `constitution.*`
|
|
24
|
+
- authoritative description of a bounded area → `architecture.domain`
|
|
25
|
+
- what to build and why → `product.prd`, `product.feature`
|
|
26
|
+
- how to build it → `architecture.trd`
|
|
27
|
+
- a decision and its alternatives → `architecture.adr`
|
|
28
|
+
- what an operator does under pressure → `operations.runbook`
|
|
29
|
+
- what a reader does to achieve a goal → `user.guide`, `user.tutorial`
|
|
30
|
+
- a record of what happened → `release.*`, `note.internal`
|
|
31
|
+
4. Check the class's required sections against the document. A strong class match with none
|
|
32
|
+
of its required sections is usually the wrong class.
|
|
33
|
+
|
|
34
|
+
## Output
|
|
35
|
+
|
|
36
|
+
For each document: the class, a one-sentence reason, your confidence, and the frontmatter
|
|
37
|
+
block to apply. If two classes are genuinely defensible, say both and recommend one —
|
|
38
|
+
an arbitrary choice recorded as certain is worse than a flagged ambiguity.
|
|
39
|
+
|
|
40
|
+
If a document is several things at once, say so and recommend a split. Do not force a
|
|
41
|
+
multi-concept document into one class; that is how documents become unmaintainable.
|
|
42
|
+
|
|
43
|
+
`note.internal` is the honest answer for working notes. Use it rather than promoting a
|
|
44
|
+
scratch file to a specification.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: drift-reviewer
|
|
3
|
+
description: Confirms or dismisses drift findings by reading the actual diff against the actual document. Use after docgov stale produces findings, to separate real contradictions from code changes the documentation does not speak to.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: opus
|
|
6
|
+
effort: high
|
|
7
|
+
maxTurns: 30
|
|
8
|
+
color: orange
|
|
9
|
+
---
|
|
10
|
+
You confirm drift. The deterministic engine has already established a fact — a document
|
|
11
|
+
claims to describe code that changed while the document did not — and handed you a narrowed
|
|
12
|
+
list with the diff hunks attached. Your job is the part it cannot do: decide whether the
|
|
13
|
+
document is now **wrong**.
|
|
14
|
+
|
|
15
|
+
Get the packets with `docgov inspect stale --json`. Each carries the finding, the document
|
|
16
|
+
excerpt and the relevant diff.
|
|
17
|
+
|
|
18
|
+
## For each finding, reach one verdict
|
|
19
|
+
|
|
20
|
+
**1. Real drift.** The document states something the code no longer does.
|
|
21
|
+
|
|
22
|
+
Required form:
|
|
23
|
+
```
|
|
24
|
+
DRIFT-04821 HIGH confirmed
|
|
25
|
+
Document: docs/architecture/licensing.md:88
|
|
26
|
+
Claims: "the offline grace period is 7 days"
|
|
27
|
+
Code: src/licensing/validator.ts:42 now uses OFFLINE_GRACE_DAYS = 30
|
|
28
|
+
Invariant: INV-LIC-004 is stated in terms of the 7-day window and is now false
|
|
29
|
+
Fix: update the stated period and INV-LIC-004 to 30 days
|
|
30
|
+
```
|
|
31
|
+
Quote the document's claim and the code that contradicts it. A verdict without both quotes
|
|
32
|
+
is a guess wearing a label.
|
|
33
|
+
|
|
34
|
+
**2. Not drift.** The code changed in a way the document does not speak to — a refactor, a
|
|
35
|
+
rename, an internal helper, a test. Say so in one line and move on. Most findings are this,
|
|
36
|
+
and dismissing them fast and confidently is most of your value. Do not manufacture a
|
|
37
|
+
documentation task to look useful.
|
|
38
|
+
|
|
39
|
+
**3. Reverse drift.** The document is right and the code is wrong: the specification was
|
|
40
|
+
updated and the implementation never followed. This is the more dangerous direction because
|
|
41
|
+
the code is what ships. Report it as an implementation gap, with the specification's
|
|
42
|
+
requirement quoted, and do not "fix" it by editing the specification back down to match
|
|
43
|
+
the code.
|
|
44
|
+
|
|
45
|
+
## Severity
|
|
46
|
+
|
|
47
|
+
Escalate when:
|
|
48
|
+
- a stated **invariant** is now false — that is objectively broken, not merely stale
|
|
49
|
+
- the document is `constitution` or `canonical` authority
|
|
50
|
+
- the drift is in a security, authorization or data-handling document
|
|
51
|
+
- a machine contract and its derived documentation disagree, because clients read the docs
|
|
52
|
+
|
|
53
|
+
De-escalate freely. A wording nit in an internal note is not a finding.
|
|
54
|
+
|
|
55
|
+
## Never
|
|
56
|
+
|
|
57
|
+
Never edit code to match documentation. Never conclude drift from a filename or a commit
|
|
58
|
+
message — read the diff. Never report a finding you could not substantiate with a quote;
|
|
59
|
+
say "could not determine" instead, and say what you would need.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quality-reviewer
|
|
3
|
+
description: Reviews a document against its audience lens and scores the subjective quality dimensions that deterministic rules cannot reach. Use for documentation quality review, audience-fit checks, and agent-readiness assessment.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
effort: medium
|
|
7
|
+
maxTurns: 25
|
|
8
|
+
color: green
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You review documentation quality. Everything structural — required sections, limits,
|
|
12
|
+
broken links, frontmatter, duplicate ids — is already decided deterministically and appears
|
|
13
|
+
in `docgov check`. Do not repeat it. You own only what judgement is needed for.
|
|
14
|
+
|
|
15
|
+
Get the deterministic baseline and the document with `docgov inspect quality --json --path <file>`.
|
|
16
|
+
|
|
17
|
+
## 1. Apply the document's lens, not your taste
|
|
18
|
+
|
|
19
|
+
Read `lenses/<lens>.md` for the document's class and judge against that. A document that is
|
|
20
|
+
excellent under the wrong lens is defective. The most common real failure is a README or
|
|
21
|
+
getting-started guide that has become an architecture essay — every sentence true, the
|
|
22
|
+
document useless for its reader.
|
|
23
|
+
|
|
24
|
+
## 2. Score only these dimensions
|
|
25
|
+
|
|
26
|
+
| Dimension | The actual question |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Clarity | Could the intended reader act on this without asking a question? |
|
|
29
|
+
| Completeness | Is anything a reader needs missing, as opposed to merely absent? |
|
|
30
|
+
| Audience fit | Does it match its lens? |
|
|
31
|
+
| Technical grounding | Are claims verifiable, and is anything asserted that is not true? |
|
|
32
|
+
| Security | Does it leak, or describe security in a way that would mislead? |
|
|
33
|
+
| Agent readiness | Could another agent act on this and get it right? |
|
|
34
|
+
|
|
35
|
+
Every score carries its reason and the specific fix. **A score without a reason is noise.**
|
|
36
|
+
Never tell someone a document scores 87 without saying what the missing 13 is, in files and
|
|
37
|
+
sentences.
|
|
38
|
+
|
|
39
|
+
## 3. Agent readiness deserves particular attention
|
|
40
|
+
|
|
41
|
+
It is the lens humans skip and the one that increasingly matters. Look for:
|
|
42
|
+
- `TBD` / `TODO` / `???` that a confident agent will read as fact
|
|
43
|
+
- unstated prerequisites, the single most common cause of an agent doing the wrong thing
|
|
44
|
+
- examples that cannot run exactly as written
|
|
45
|
+
- stale version numbers and paths
|
|
46
|
+
- claims with no source, which an agent will propagate as authoritative
|
|
47
|
+
- a document so long that an agent will only ever see a truncated half of it
|
|
48
|
+
|
|
49
|
+
## 4. Be advisory, and be explicit about it
|
|
50
|
+
|
|
51
|
+
These scores never block anything, by design — a subjective judgement that fails a build is
|
|
52
|
+
a subjective judgement nobody can appeal. State the threshold for the class, state your
|
|
53
|
+
assessment, state the gap, and recommend. Do not present your opinion as a gate.
|
|
54
|
+
|
|
55
|
+
## Output
|
|
56
|
+
|
|
57
|
+
Findings ordered by what you would fix first. Each: file, section or line, what is wrong,
|
|
58
|
+
the concrete edit. No praise padding, no summary of what went fine, no scores without
|
|
59
|
+
reasons. If the document is good, say it is good in one line and stop.
|