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,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup
|
|
3
|
+
description: Establish DocGov documentation governance in this repository — infer the project mode and layout, create the taxonomy namespaces, install agent documentation rules, and build the initial registry and graph. Use when a repository has no .docgov/config.yaml yet.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(docgov *) Read Write Edit
|
|
6
|
+
argument-hint: "[--mode solo|team|enterprise|open-source] [--layout full|compact]"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Establish governance
|
|
10
|
+
|
|
11
|
+
## Current repository
|
|
12
|
+
|
|
13
|
+
!`docgov tools --json 2>/dev/null || echo '{}'`
|
|
14
|
+
|
|
15
|
+
## What to do
|
|
16
|
+
|
|
17
|
+
1. **Run `docgov setup $ARGUMENTS`.** It infers mode from the repository (a LICENSE plus
|
|
18
|
+
CONTRIBUTING means open-source; CODEOWNERS means team) and layout from document count.
|
|
19
|
+
Report what it inferred and why, in one line each.
|
|
20
|
+
|
|
21
|
+
2. **Confirm the inferences with the user before anything else.** These two choices shape
|
|
22
|
+
everything afterwards and are annoying to change later:
|
|
23
|
+
- `mode` decides how much blocks. `solo` blocks three rules; `enterprise` blocks twelve.
|
|
24
|
+
- `layout` decides where documents live. `compact` is right for most repositories;
|
|
25
|
+
`full` (the numbered `00-canonical` … `99-archive` tree) earns its overhead at roughly
|
|
26
|
+
25+ documents or when several teams own different parts of the tree.
|
|
27
|
+
|
|
28
|
+
If the repository is small, say so and recommend `compact` + `solo`. Documentation
|
|
29
|
+
architecture astronautics is a real failure mode and this is where it starts.
|
|
30
|
+
|
|
31
|
+
3. **Set up domains if the codebase has obvious ones.** Look at the top-level source
|
|
32
|
+
layout. If there are clear bounded areas (`src/auth/`, `src/billing/`, `src/licensing/`),
|
|
33
|
+
add them to `.docgov/config.yaml`:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
domains:
|
|
37
|
+
licensing:
|
|
38
|
+
paths: ["src/licensing/**", "migrations/*licen*"]
|
|
39
|
+
owner: platform
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Domains are what make `docgov brief <domain>` and invariant injection work. Without
|
|
43
|
+
them most of DocGov's value stays switched off. This is the highest-leverage thing to
|
|
44
|
+
get right during setup.
|
|
45
|
+
|
|
46
|
+
4. **Then run `/docgov:review`** if documentation already exists, or `/docgov:create` for
|
|
47
|
+
the first document if not.
|
|
48
|
+
|
|
49
|
+
## Do not
|
|
50
|
+
|
|
51
|
+
Do not create documents during init. Do not populate empty namespaces with placeholder
|
|
52
|
+
files — an empty namespace is a namespace, a file full of `TODO` is debt.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stale
|
|
3
|
+
description: Detect documentation drift — implementation changed but documentation did not, documentation changed but implementation did not, machine contracts ahead of their derived docs, and semantic staleness. Use for "are my docs still true", before a release, or after a large change.
|
|
4
|
+
allowed-tools: Bash(docgov *) Bash(git diff*) Bash(git log*) Read
|
|
5
|
+
argument-hint: "[--base main]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Detect documentation drift
|
|
9
|
+
|
|
10
|
+
## Deterministic drift report
|
|
11
|
+
|
|
12
|
+
!`docgov stale --json --compact $ARGUMENTS 2>&1 | head -c 14000`
|
|
13
|
+
|
|
14
|
+
## What this report is, and is not
|
|
15
|
+
|
|
16
|
+
The findings above are facts: a document claims to describe code that changed while the
|
|
17
|
+
document did not, or a specification changed with no corresponding implementation change.
|
|
18
|
+
Those are decided from the diff and the graph.
|
|
19
|
+
|
|
20
|
+
What the report does **not** claim is that the prose actually contradicts the new code.
|
|
21
|
+
That is your job, and it needs the diff.
|
|
22
|
+
|
|
23
|
+
## Confirm each finding
|
|
24
|
+
|
|
25
|
+
Run `docgov inspect stale --json` for review packets: each finding comes with the relevant
|
|
26
|
+
diff hunks and the document excerpt, so you read kilobytes instead of the repository.
|
|
27
|
+
|
|
28
|
+
For each packet decide one of three things and say which:
|
|
29
|
+
|
|
30
|
+
1. **Real drift.** The document states something the code no longer does. Quote the
|
|
31
|
+
document's claim and the code that contradicts it, then make the edit. Be specific —
|
|
32
|
+
"the document says the offline grace period is 7 days; `validator.ts:42` now uses 30"
|
|
33
|
+
is actionable, "the licensing docs look stale" is not.
|
|
34
|
+
2. **Not drift.** The code changed in a way the document does not speak to. Say so in one
|
|
35
|
+
line and move on. Most findings are this, and saying so quickly is the valuable part.
|
|
36
|
+
3. **Reverse drift.** The document is right and the code is wrong — the specification was
|
|
37
|
+
updated and the implementation never followed. This is the more dangerous direction,
|
|
38
|
+
because the code ships. Flag it as an implementation gap, not a documentation task.
|
|
39
|
+
|
|
40
|
+
## Invariants
|
|
41
|
+
|
|
42
|
+
If a finding carries invariants, check them specifically: an invariant the code now
|
|
43
|
+
violates is a higher-severity problem than a stale sentence, and it is the one thing here
|
|
44
|
+
that can be objectively wrong.
|
|
45
|
+
|
|
46
|
+
## Staleness
|
|
47
|
+
|
|
48
|
+
The `staleness` array scores risk from what changed *around* a document, not from its age.
|
|
49
|
+
A document untouched for two years with no implementation churn is not stale. Only report
|
|
50
|
+
entries whose signals you can explain.
|
|
51
|
+
|
|
52
|
+
## If a finding is wrong
|
|
53
|
+
|
|
54
|
+
`docgov ignore DRIFT-xxxxx --reason "..." [--expires YYYY-MM-DD]`. It stays visible in
|
|
55
|
+
every report. Suppress the finding, never the rule.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tag
|
|
3
|
+
description: Reorganize existing documentation — add missing frontmatter, split oversized documents, extract overgrown README sections, merge duplicates, and archive superseded documents. Use for "clean up the docs", oversized files, duplicate documents, or after onboarding leaves judgement calls.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(docgov *) Bash(git *) Read Write Edit
|
|
6
|
+
argument-hint: "[--path <file>]"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Reorganize documentation
|
|
10
|
+
|
|
11
|
+
## State
|
|
12
|
+
|
|
13
|
+
!`docgov tag --json 2>&1 | head -c 8000`
|
|
14
|
+
|
|
15
|
+
## Mechanical work first
|
|
16
|
+
|
|
17
|
+
`docgov tag --apply` writes missing frontmatter for everything it can classify
|
|
18
|
+
confidently. Run it, then report how many documents it annotated. Moves stay with
|
|
19
|
+
`docgov fix` so that link repair and the move happen in one transaction.
|
|
20
|
+
|
|
21
|
+
## Then the judgement calls, one at a time
|
|
22
|
+
|
|
23
|
+
### Splits
|
|
24
|
+
|
|
25
|
+
A document flagged for splitting holds several independently addressable concepts. Do it
|
|
26
|
+
like this, and only this way:
|
|
27
|
+
|
|
28
|
+
1. Create each part with `docgov create <type> "<part name>" --domain <d>` so it lands in
|
|
29
|
+
the right place with the right frontmatter.
|
|
30
|
+
2. Move the content across **verbatim**. Rewriting while splitting is how information gets
|
|
31
|
+
lost; if prose needs improving, that is a separate change.
|
|
32
|
+
3. Turn the parent into an index: a short overview plus a link to each part. Not a stub —
|
|
33
|
+
an overview that is useful on its own.
|
|
34
|
+
4. Add `depends_on` from each part back to the parent, so the graph keeps the structure.
|
|
35
|
+
5. Run `docgov check` to confirm no link broke.
|
|
36
|
+
|
|
37
|
+
### README extraction
|
|
38
|
+
|
|
39
|
+
A README section that has grown past ~40 lines belongs elsewhere. Move the body to the
|
|
40
|
+
document class DocGov names, then leave behind a summary of roughly one line per fifteen
|
|
41
|
+
removed, plus a link. A README answers "what is this, why would I use it, how do I start,
|
|
42
|
+
where is the depth" — it is not the project encyclopedia.
|
|
43
|
+
|
|
44
|
+
### Merges
|
|
45
|
+
|
|
46
|
+
Never merge prose silently. Show the user both documents, say which content you would
|
|
47
|
+
keep, which you would drop, and why. Then merge into the **higher-authority** path, point
|
|
48
|
+
`supersedes` at the retired one, and archive rather than delete it.
|
|
49
|
+
|
|
50
|
+
### Archiving
|
|
51
|
+
|
|
52
|
+
Superseded documents go to the archive namespace with `status: superseded` and a
|
|
53
|
+
`supersedes` edge from their replacement. The archive is a record: do not edit it
|
|
54
|
+
afterwards, and DocGov will block attempts to.
|
|
55
|
+
|
|
56
|
+
## Report
|
|
57
|
+
|
|
58
|
+
End with the `docgov health` score before and after, and the single change that would
|
|
59
|
+
raise it most.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# <Decision, stated as an imperative: "Use Postgres for the primary store">
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
proposed
|
|
6
|
+
|
|
7
|
+
<!-- proposed → accepted → superseded. Never delete an ADR; supersede it and link both ways. -->
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
The forces in play, written so a reader in two years understands why this was even a
|
|
13
|
+
question. Constraints, deadlines, existing commitments, what the alternatives were
|
|
14
|
+
competing on. Link the canonical document or PRD this decision serves.
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
## Decision
|
|
18
|
+
|
|
19
|
+
<!-- One sentence, active voice, no hedging. Then the specifics. -->
|
|
20
|
+
|
|
21
|
+
## Alternatives
|
|
22
|
+
|
|
23
|
+
<!--
|
|
24
|
+
Each alternative that was seriously considered, and the reason it lost. An ADR whose
|
|
25
|
+
alternatives are straw men is worse than no ADR — it forecloses a reconsideration that
|
|
26
|
+
should stay open.
|
|
27
|
+
-->
|
|
28
|
+
|
|
29
|
+
## Consequences
|
|
30
|
+
|
|
31
|
+
<!--
|
|
32
|
+
What this makes easier. What it makes harder. What it forecloses. What has to be true for
|
|
33
|
+
this to keep being the right call, so a future reader can tell when it stops being true.
|
|
34
|
+
-->
|
|
35
|
+
|
|
36
|
+
## Security implications
|
|
37
|
+
|
|
38
|
+
<!-- Trust boundaries moved, new attack surface, new secrets, new data flows. "None" is a valid answer when you have checked. -->
|
|
39
|
+
|
|
40
|
+
## Supersedes
|
|
41
|
+
|
|
42
|
+
<!-- ADR ids this replaces, or "none". Mirror this with `supersedes:` in the frontmatter relationships. -->
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# <Domain name>
|
|
2
|
+
|
|
3
|
+
> Canonical specification for this domain. Nothing of lower authority may contradict it.
|
|
4
|
+
> If reality and this document disagree, one of them is a bug — decide which before editing.
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
<!-- What this domain is responsible for, in one paragraph. -->
|
|
9
|
+
|
|
10
|
+
## Boundaries
|
|
11
|
+
|
|
12
|
+
<!-- What this domain owns and what it explicitly delegates. Which other domains it may call and which it may not. -->
|
|
13
|
+
|
|
14
|
+
## Model
|
|
15
|
+
|
|
16
|
+
<!-- The core concepts and their relationships, in this domain's own vocabulary. Keep terms consistent with the glossary — one term per concept. -->
|
|
17
|
+
|
|
18
|
+
## Invariants
|
|
19
|
+
|
|
20
|
+
<!--
|
|
21
|
+
Rules that must hold at all times. Give each an id:
|
|
22
|
+
|
|
23
|
+
- INV-<DOMAIN>-001 <statement>
|
|
24
|
+
|
|
25
|
+
These become first-class objects: DocGov injects them into any agent that edits the code
|
|
26
|
+
mapped by this document's `documents:` frontmatter. This is the highest-leverage section in
|
|
27
|
+
the whole documentation tree — an invariant written here is enforced everywhere afterwards.
|
|
28
|
+
-->
|
|
29
|
+
|
|
30
|
+
## Interfaces
|
|
31
|
+
|
|
32
|
+
<!-- What this domain exposes and consumes. Point at the machine contract; the contract is authoritative. -->
|
|
33
|
+
|
|
34
|
+
## Failure modes
|
|
35
|
+
|
|
36
|
+
<!-- What goes wrong, how it surfaces, what degrades, what recovers on its own. -->
|
|
37
|
+
|
|
38
|
+
## Dependencies
|
|
39
|
+
|
|
40
|
+
<!-- Other domains and external services, with the direction of dependency and what breaks without each. -->
|
|
41
|
+
|
|
42
|
+
## Open questions
|
|
43
|
+
|
|
44
|
+
<!-- Unresolved, each with an owner. -->
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# <System or change name> — Technical Requirements
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
<!-- Why this document exists and what it implements. Link the PRD; do not restate it. -->
|
|
6
|
+
|
|
7
|
+
## Requirements mapping
|
|
8
|
+
|
|
9
|
+
<!-- Each PRD requirement id → where in this document it is addressed. This table is how a reviewer checks coverage. -->
|
|
10
|
+
|
|
11
|
+
## Existing architecture
|
|
12
|
+
|
|
13
|
+
<!-- What is there now, honestly, including the parts you wish were different. Link the canonical domain documents. -->
|
|
14
|
+
|
|
15
|
+
## Proposed architecture
|
|
16
|
+
|
|
17
|
+
<!-- What it becomes. Boundaries, responsibilities, what moves. -->
|
|
18
|
+
|
|
19
|
+
## Components
|
|
20
|
+
|
|
21
|
+
<!-- Each component: what it owns, what it depends on, what it exposes. -->
|
|
22
|
+
|
|
23
|
+
## Data model
|
|
24
|
+
|
|
25
|
+
<!-- Entities, relationships, lifecycle. Reference the migration or schema; do not copy it. -->
|
|
26
|
+
|
|
27
|
+
## Interfaces
|
|
28
|
+
|
|
29
|
+
<!-- APIs, events, queues. Point at the machine contract. The contract is authoritative; this section is orientation. -->
|
|
30
|
+
|
|
31
|
+
## State transitions
|
|
32
|
+
|
|
33
|
+
<!-- Legal states and the transitions between them. Which transitions are irreversible. -->
|
|
34
|
+
|
|
35
|
+
## Failure handling
|
|
36
|
+
|
|
37
|
+
<!--
|
|
38
|
+
Each failure mode: how it is detected, what degrades, what the user sees, what recovers
|
|
39
|
+
automatically and what needs a human. A TRD without this section is a design sketch.
|
|
40
|
+
-->
|
|
41
|
+
|
|
42
|
+
## Security
|
|
43
|
+
|
|
44
|
+
<!-- Trust boundaries, authorization checkpoints, secret handling, data classification. Link the threat model. -->
|
|
45
|
+
|
|
46
|
+
## Performance
|
|
47
|
+
|
|
48
|
+
<!-- Expected load, measured baseline, target, and where the first bottleneck will be. -->
|
|
49
|
+
|
|
50
|
+
## Observability
|
|
51
|
+
|
|
52
|
+
<!-- What signals prove this is working, which dashboard shows them, which alert fires when it stops. -->
|
|
53
|
+
|
|
54
|
+
## Migration
|
|
55
|
+
|
|
56
|
+
<!-- How existing data and clients move across. Backfill, dual-write, cutover. What is reversible and where that stops. -->
|
|
57
|
+
|
|
58
|
+
## Testing
|
|
59
|
+
|
|
60
|
+
<!-- What is covered at which level, and what is deliberately not covered and why. -->
|
|
61
|
+
|
|
62
|
+
## Rollout
|
|
63
|
+
|
|
64
|
+
<!-- Order, gates, flag strategy, blast radius at each stage. -->
|
|
65
|
+
|
|
66
|
+
## Rollback
|
|
67
|
+
|
|
68
|
+
<!-- How to undo at each stage, and the point of no return. If there is no rollback, say so here, in bold. -->
|
|
69
|
+
|
|
70
|
+
## Open questions
|
|
71
|
+
|
|
72
|
+
<!-- Unresolved, each with an owner. -->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Invariants
|
|
2
|
+
|
|
3
|
+
> Project-level rules that must hold at all times. These are enforced, not aspirational:
|
|
4
|
+
> any line beginning with an id becomes an object DocGov injects into agents editing the
|
|
5
|
+
> code it governs.
|
|
6
|
+
|
|
7
|
+
## How to write one
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
- INV-<DOMAIN>-<NNN> <A single statement, present tense, falsifiable.>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Good: `INV-LIC-001 A license belongs to exactly one organization.`
|
|
14
|
+
Bad: `INV-LIC-001 Licensing should be robust.`
|
|
15
|
+
|
|
16
|
+
An invariant that cannot be violated by a specific code change is not an invariant, it is a
|
|
17
|
+
principle — put it in `PRINCIPLES.md` instead.
|
|
18
|
+
|
|
19
|
+
Map the code each invariant governs in the frontmatter of the document that states it:
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
docgov:
|
|
23
|
+
documents: ["src/licensing/**", "migrations/*licen*"]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Without that mapping the invariant is documentation. With it, every agent that edits
|
|
27
|
+
licensing code is handed the rule before it writes a line.
|
|
28
|
+
|
|
29
|
+
## Invariants
|
|
30
|
+
|
|
31
|
+
<!--
|
|
32
|
+
- INV-<DOMAIN>-001 <statement>
|
|
33
|
+
- INV-<DOMAIN>-002 <statement>
|
|
34
|
+
-->
|
|
35
|
+
|
|
36
|
+
## Changing an invariant
|
|
37
|
+
|
|
38
|
+
Changing one of these is a deliberate act. State what changed, why, what it breaks, and
|
|
39
|
+
which ADR records the decision. Do not soften an invariant to make a failing change pass —
|
|
40
|
+
that is the one manoeuvre this document exists to prevent.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# <Runbook name>
|
|
2
|
+
|
|
3
|
+
> Written for someone woken at 3am who did not build this. Numbered steps, one action each,
|
|
4
|
+
> expected result stated. Prose is unreadable under pressure.
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
<!-- What this procedure achieves, in one sentence. -->
|
|
9
|
+
|
|
10
|
+
## Trigger
|
|
11
|
+
|
|
12
|
+
<!-- The exact signal: alert name, symptom, threshold. Not "when things look wrong". -->
|
|
13
|
+
|
|
14
|
+
## Preconditions
|
|
15
|
+
|
|
16
|
+
<!-- Access required, approvals needed, what must be true before step one. -->
|
|
17
|
+
|
|
18
|
+
## Diagnostics
|
|
19
|
+
|
|
20
|
+
<!--
|
|
21
|
+
Commands that establish what is actually happening, before anything is changed. Each with
|
|
22
|
+
what its output means. Acting before confirming cause turns an incident into two.
|
|
23
|
+
-->
|
|
24
|
+
|
|
25
|
+
## Procedure
|
|
26
|
+
|
|
27
|
+
<!--
|
|
28
|
+
1. <action>
|
|
29
|
+
Expected: <observable result>
|
|
30
|
+
2. <action>
|
|
31
|
+
Expected: <observable result>
|
|
32
|
+
|
|
33
|
+
Commands copy-pasteable with no placeholders to reason about. If a step takes more than a
|
|
34
|
+
minute, say how long, or it will be declared hung and interrupted.
|
|
35
|
+
-->
|
|
36
|
+
|
|
37
|
+
## Validation
|
|
38
|
+
|
|
39
|
+
<!-- How you know it worked. A measurement, not an impression. -->
|
|
40
|
+
|
|
41
|
+
## Rollback
|
|
42
|
+
|
|
43
|
+
<!-- How to undo each step, and the point past which you cannot. -->
|
|
44
|
+
|
|
45
|
+
## Escalation
|
|
46
|
+
|
|
47
|
+
<!-- Who to wake, at what threshold, by what route. Names a rotation, not a person. -->
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# <Product or feature name>
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
<!-- What exists today and what is happening that makes this worth doing now. Link the product constitution. -->
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
The problem in the user's terms, not the solution's. If this section mentions your
|
|
11
|
+
proposed mechanism, it is describing a solution and the problem is still unstated.
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
## Goals
|
|
15
|
+
|
|
16
|
+
<!-- Outcomes, each observable. "Users can recover an account without support" — not "build account recovery". -->
|
|
17
|
+
|
|
18
|
+
## Non-goals
|
|
19
|
+
|
|
20
|
+
<!-- What this explicitly does not do. The most valuable section in the document and the one most often left out. -->
|
|
21
|
+
|
|
22
|
+
## Personas
|
|
23
|
+
|
|
24
|
+
<!-- Who this is for, what they are trying to do, what they already know. Link persona documents rather than restating them. -->
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
<!-- The requirement set, grouped. Each one numbered so tests, TRDs and reviews can cite it. -->
|
|
29
|
+
|
|
30
|
+
## User flows
|
|
31
|
+
|
|
32
|
+
<!-- The paths through the product, including the ones that fail. Link UX documents for detail. -->
|
|
33
|
+
|
|
34
|
+
## Functional requirements
|
|
35
|
+
|
|
36
|
+
<!-- What the system must do. Each independently verifiable. -->
|
|
37
|
+
|
|
38
|
+
## Non-functional requirements
|
|
39
|
+
|
|
40
|
+
<!-- Latency, throughput, availability, limits. Numbers, not adjectives. Targets with no number cannot be met or missed. -->
|
|
41
|
+
|
|
42
|
+
## Security considerations
|
|
43
|
+
|
|
44
|
+
<!-- New data, new trust boundaries, new authorization. Link the threat model if one is needed. -->
|
|
45
|
+
|
|
46
|
+
## Edge cases
|
|
47
|
+
|
|
48
|
+
<!-- Empty states, concurrency, partial failure, abuse, the largest plausible input. Where requirements go to be tested. -->
|
|
49
|
+
|
|
50
|
+
## Dependencies
|
|
51
|
+
|
|
52
|
+
<!-- Teams, services, contracts and decisions this needs. What happens to the plan if each one slips. -->
|
|
53
|
+
|
|
54
|
+
## Acceptance criteria
|
|
55
|
+
|
|
56
|
+
<!-- Conditions a reviewer can check. If a criterion cannot be checked, it is an aspiration, not a criterion. -->
|
|
57
|
+
|
|
58
|
+
## Open questions
|
|
59
|
+
|
|
60
|
+
<!-- Unresolved, each with an owner and the date by which it blocks. -->
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# <System> — Threat Model
|
|
2
|
+
|
|
3
|
+
> This document names risks that are not yet fixed. It must stay `visibility: internal`.
|
|
4
|
+
> The public counterpart is a separate document (`security.public-model`), not a redaction.
|
|
5
|
+
|
|
6
|
+
## Scope
|
|
7
|
+
|
|
8
|
+
<!-- What this covers and, just as importantly, what it does not. Out-of-scope components need their own model or an explicit statement that they are trusted. -->
|
|
9
|
+
|
|
10
|
+
## Assets
|
|
11
|
+
|
|
12
|
+
<!-- What is worth protecting, in priority order, and why. Data, availability, integrity, reputation. -->
|
|
13
|
+
|
|
14
|
+
## Actors
|
|
15
|
+
|
|
16
|
+
<!--
|
|
17
|
+
Each actor with capability and motive. Include the unglamorous ones: a legitimate user
|
|
18
|
+
exceeding their authorization, a compromised dependency, an employee with production access,
|
|
19
|
+
an automated agent acting on an injected instruction.
|
|
20
|
+
-->
|
|
21
|
+
|
|
22
|
+
## Trust boundaries
|
|
23
|
+
|
|
24
|
+
<!-- Where trust changes. For each: what crosses it, what is validated there, and by what. -->
|
|
25
|
+
|
|
26
|
+
## Entry points
|
|
27
|
+
|
|
28
|
+
<!-- Every way input enters: endpoints, queues, webhooks, file uploads, CLI, admin interfaces, agent tool calls. -->
|
|
29
|
+
|
|
30
|
+
## Data flows
|
|
31
|
+
|
|
32
|
+
<!-- How data moves between boundaries, in what form, with what protection at each hop. -->
|
|
33
|
+
|
|
34
|
+
## Threats
|
|
35
|
+
|
|
36
|
+
<!--
|
|
37
|
+
Each threat: the asset, the actor, the entry point, the mechanism, and the likelihood. Give
|
|
38
|
+
each an id so controls and residual risks can cite it.
|
|
39
|
+
-->
|
|
40
|
+
|
|
41
|
+
## Controls
|
|
42
|
+
|
|
43
|
+
<!-- What stops each threat, with a link to the implementation. A control with no threat is a checklist item; a threat with no control belongs under residual risks. -->
|
|
44
|
+
|
|
45
|
+
## Residual risks
|
|
46
|
+
|
|
47
|
+
<!-- What remains after the controls. Who accepted it, when, and under what condition it needs revisiting. An empty section here almost always means the analysis stopped early. -->
|
|
48
|
+
|
|
49
|
+
## Assumptions
|
|
50
|
+
|
|
51
|
+
<!-- What must be true for this model to hold. When one of these breaks, this list tells you what else just broke. -->
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# <Project name>
|
|
2
|
+
|
|
3
|
+
<!-- One or two sentences: what this is. No marketing, no "blazing fast". -->
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
<!-- Why use this rather than the obvious alternative. Two or three lines. -->
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# the shortest path from nothing to installed
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# the smallest useful example, runnable exactly as written
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<!-- Then what the reader should see. -->
|
|
22
|
+
|
|
23
|
+
## What it does
|
|
24
|
+
|
|
25
|
+
<!-- A short list of capabilities, each linking to its own document. A list, not a tour. -->
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
<!-- Links to the real documentation. This is where depth lives; the README points at it. -->
|
|
30
|
+
|
|
31
|
+
## Contributing
|
|
32
|
+
|
|
33
|
+
<!-- Link CONTRIBUTING.md. -->
|
|
34
|
+
|
|
35
|
+
## Help
|
|
36
|
+
|
|
37
|
+
<!-- Where to ask. Issues, discussions, a channel. -->
|
|
38
|
+
|
|
39
|
+
<!--
|
|
40
|
+
README lens: under 300 lines. Architecture gets three lines and a link, never 200 lines.
|
|
41
|
+
If a section has grown past about 40 lines it has become its own document — run
|
|
42
|
+
`docgov check` and it will tell you where to move it.
|
|
43
|
+
-->
|