@jwilger/pi-development-system 0.88.0 → 0.89.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/LICENSE +21 -0
- package/README.md +114 -3
- package/agents/coder.md +1 -1
- package/agents/tasker.md +2 -0
- package/package.json +3 -1
- package/skills/profile-design-system/SKILL.md +66 -0
- package/skills/threat-modelling/SKILL.md +76 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 John Wilger
|
|
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
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
# pi-development-system
|
|
2
2
|
|
|
3
3
|
A [pi](https://pi.dev) extension package representing my seasoned approach to
|
|
4
|
-
software development using a full AI SDLC
|
|
4
|
+
software development using a full AI SDLC: work is sized, planned in proportion, built
|
|
5
|
+
test-first in small slices, reviewed by fresh-context reviewers and delivered by trunk-based
|
|
6
|
+
commits. Guards enforce what must hold; the rest is guidance with a recorded way out.
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pi install npm:@jwilger/pi-development-system
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then `/reload`. To move to a newer release use
|
|
15
|
+
`pi install npm:@jwilger/pi-development-system@<version>`.
|
|
16
|
+
|
|
17
|
+
Jev, the classifier behind the judgements, is optional. Without a credential configured, the checks
|
|
18
|
+
that rest on a judgement do not run or fall back to a default: the motive behind a test change, whether a
|
|
19
|
+
diff needs an ADR, the quality of a commit rationale and whether a commit mixes changes, the intent
|
|
20
|
+
nudges, the verifier's check of the agent's own claims, and the lens and severity choices in review.
|
|
21
|
+
The status line shows `jev offline` when that is so. Everything deterministic holds without Jev: the
|
|
22
|
+
hard stops, the delivery mode, the review streak, red-first and the slice life cycle.
|
|
7
23
|
|
|
8
24
|
## Replaces pi-subagent-manager
|
|
9
25
|
|
|
@@ -22,6 +38,12 @@ what the current phase expects. When you say a slice is finished with no review
|
|
|
22
38
|
it tells you to start one. The slash commands (`/devsys-start`, `/devsys-plan`, `/devsys-review`,
|
|
23
39
|
`/devsys-lens-review`, `/devsys-adr`, `/devsys-event-model`) are shortcuts to the same tools.
|
|
24
40
|
|
|
41
|
+
Skills cover the habits behind the gates: `tdd-canon`, `behaviour-tests`, `semantic-types`,
|
|
42
|
+
`typed-errors`, `functional-core-imperative-shell`, `strict-lints`, `delivery-discipline`, `delegation`,
|
|
43
|
+
`code-review`, the language profiles (`profile-rust`, `profile-typescript`), `profile-design-system` for UI
|
|
44
|
+
work (tokens, then components; build from the design system's materials and log a snowflake),
|
|
45
|
+
`threat-modelling` (proportional; a document only when the risk earns it) and the planning skills below.
|
|
46
|
+
|
|
25
47
|
Product planning has a skill (`product-planning`: brief, decision register, follow-ups,
|
|
26
48
|
terminology, journeys). `devsys_lens_review` plans a review of the brief by five product lenses and
|
|
27
49
|
writes the packets to `docs/product/reviews/`; `devsys_adr_new` creates the next numbered ADR, and
|
|
@@ -35,7 +57,7 @@ Event modelling has a skill (`event-modelling`: three slice patterns, Given/When
|
|
|
35
57
|
`devsys_event_model_check` validates a directory of slice files (schema v1) and renders the swimlane
|
|
36
58
|
Markdown or a Mermaid diagram; each profile's `gwt-tests` reference turns scenarios into failing tests.
|
|
37
59
|
A dedicated extension that offers `event_model_validate`, or `event_model.provider` in
|
|
38
|
-
`.development-system.toml`, replaces the builtin tool (
|
|
60
|
+
`.development-system.toml`, replaces the builtin tool ([contract](https://github.com/jwilger/pi-development-system/blob/main/docs/event-model-extension-contract.md)).
|
|
39
61
|
|
|
40
62
|
A slice has a life cycle: `implementing` → `reviewing` (when a review round starts) → `delivering`
|
|
41
63
|
(review satisfied) → `idle`. Editing production source while delivering reopens `implementing`,
|
|
@@ -52,6 +74,95 @@ With `codemode` enabled (`"defaultTools": ["+codemode"]` in pi settings), rarely
|
|
|
52
74
|
reached through scripts and the `judge_*` Jev wrappers exist for scripts only; without codemode
|
|
53
75
|
the rarely used tools are declared directly and the wrappers are absent.
|
|
54
76
|
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
`.development-system.toml` at the repository root (version 1). Every key is optional; an unknown
|
|
80
|
+
key is an error that names it. `/devsys-models` writes the `[models]` table for the models this
|
|
81
|
+
machine can use.
|
|
82
|
+
|
|
83
|
+
| Table | Keys | Meaning |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `[delivery]` | `mode` (`trunk`, `pull-request`, `local-only`), `trunk`, `remote` | Where work lands; the push guard follows it. `local-only` blocks every push. |
|
|
86
|
+
| `[review]` | `required_clean_rounds` (3), `min_rounds` (1) | The clean streak a slice needs before commit. |
|
|
87
|
+
| `[tracker]` | `kind` (`repo-files`, `github`; `jira` and `linear` are not implemented), `repo` | Backlog for `devsys_work_item`. |
|
|
88
|
+
| `[profiles]` | `override` | Languages to apply (`rust`, `typescript`); empty means detect. |
|
|
89
|
+
| `[models]` | one ordered candidate list per slot | See Model tiers below. |
|
|
90
|
+
| `[routing]` | `"<difficulty>/<risk>" = ["<slot>", "<thinking level>"]` | What `devsys_route_task` recommends for a subagent. |
|
|
91
|
+
| `[verifier]` | `max_per_session` (6) | Cap on Jev checks of the agent's own claims. |
|
|
92
|
+
| `[cadence]` | `push_minutes` (60) | Minutes without a push before the cadence nudge. |
|
|
93
|
+
| `[event_model]` | `provider` (`builtin`) | Another provider replaces the builtin validator. |
|
|
94
|
+
|
|
95
|
+
## Model tiers
|
|
96
|
+
|
|
97
|
+
Models are asked for by slot, never by id. Three capability tiers (`frontier`, `strong`, `fast`)
|
|
98
|
+
and role slots built on them (`planning`, `advisor`, `implementer`, `reviewer`, `lens`,
|
|
99
|
+
`researcher`, `jev`). A slot is an ordered list of candidates: `provider/id`, a family pattern
|
|
100
|
+
such as `provider/gpt-*-sol` (the newest available id wins) or a slot reference such as `@strong`.
|
|
101
|
+
The first candidate this machine has credentials for is used, so one committed file works across
|
|
102
|
+
accounts. Pin an exact id to stop it rolling forward. `devsys_models` shows what each slot
|
|
103
|
+
resolves to, and the system recommends a model for a phase but never switches yours.
|
|
104
|
+
|
|
105
|
+
## Enforcement tiers
|
|
106
|
+
|
|
107
|
+
- **Hard stops** fire for the non-negotiables (`principles/NON-NEGOTIABLES.md`): rewriting
|
|
108
|
+
published history, force-pushing, deleting remote branches, discarding work with `reset --hard`,
|
|
109
|
+
`--no-verify`, forbidden commit trailers, pushing onto a red trunk, breaking the delivery mode.
|
|
110
|
+
Only the user can approve one, once, and only with a UI: a headless run refuses.
|
|
111
|
+
- **Soft gates** guard the defaults (`principles/DEFAULTS.md`): weakening tests, commit rationale,
|
|
112
|
+
mixed commits, red-first, lint suppression, an unreviewed slice, scope, model for the phase, a
|
|
113
|
+
skipped planning artifact, a missing ADR. A soft gate is passed by recording a departure with
|
|
114
|
+
`devsys_record_departure` (what, why, cost if wrong, how long it applies).
|
|
115
|
+
- **Guidance** covers everything else: skills and the phase guide, never enforced.
|
|
116
|
+
|
|
117
|
+
What the tiers do not cover, so you can decide what to trust:
|
|
118
|
+
|
|
119
|
+
- **Subagents run unguarded.** A child session is started without extensions, so none of the guards
|
|
120
|
+
runs inside it. The coordinator commits, pushes and delivers; a subagent's prompt tells it not to,
|
|
121
|
+
and the coordinator reviews what it produced.
|
|
122
|
+
- **The red-trunk stop needs `gh`.** It reads CI through an authenticated `gh`; where `gh` is missing
|
|
123
|
+
or offline the trunk reads as unknown and the push is not stopped on that ground.
|
|
124
|
+
- **A departure is the agent's own call.** `devsys_record_departure` waives a soft gate (also with no
|
|
125
|
+
UI) and is written to the decision log; it is never available for a hard stop.
|
|
126
|
+
- **Gating starts at `devsys_intake`.** With no slice open, the review and red-first gates are off.
|
|
127
|
+
- **Editing gate configuration is not guarded** (`biome.json`, hooks, CI files); review catches it.
|
|
128
|
+
|
|
129
|
+
## Decision log
|
|
130
|
+
|
|
131
|
+
Every departure and approval is appended to `docs/decisions/YYYY-MM.md` in the repository, so the
|
|
132
|
+
reasons survive compaction and are reviewable. Architecture-shaping decisions get an ADR in
|
|
133
|
+
`docs/adr/` (`devsys_adr_new`); product decisions go in the decision register that the
|
|
134
|
+
`product-planning` skill describes.
|
|
135
|
+
|
|
136
|
+
## Commands
|
|
137
|
+
|
|
138
|
+
All of them are shortcuts to tools; none is required.
|
|
139
|
+
|
|
140
|
+
| Command | Does |
|
|
141
|
+
| --- | --- |
|
|
142
|
+
| `/devsys-start` | Size the work and propose the artifacts it needs. |
|
|
143
|
+
| `/devsys-plan` | Plan a capability or product, then begin work once approved. |
|
|
144
|
+
| `/devsys-review` | Run a fresh-context review round. |
|
|
145
|
+
| `/devsys-lens-review` | Five product lenses review the brief. |
|
|
146
|
+
| `/devsys-adr` | Create the next ADR. |
|
|
147
|
+
| `/devsys-event-model` | Validate and render an event model. |
|
|
148
|
+
| `/devsys-models` | Write the model matrix for this machine (`--check` to verify). |
|
|
149
|
+
| `/devsys-ci` | Watch CI for the pushed commit. |
|
|
150
|
+
| `/devsys-status` | Phase, slice, review streak, departures and Jev status. |
|
|
151
|
+
| `/agents` | The vendored subagent manager. |
|
|
152
|
+
|
|
153
|
+
## Agents
|
|
154
|
+
|
|
155
|
+
Spawn with `agent_spawn`; `devsys_route_task` picks the model and thinking level. `advisor` gives
|
|
156
|
+
read-only decision support, `implementer`, `coder` and `tasker` build (one task record each),
|
|
157
|
+
`reviewer` reviews a diff in fresh context and submits through `devsys_submit_review`,
|
|
158
|
+
`researcher` reads and cites, `architect` and `writer` design and draft, and the five `lens-*`
|
|
159
|
+
agents (Cagan, Torres, Pichler, Perri, Rumelt) review a product brief.
|
|
160
|
+
|
|
161
|
+
## Changelog
|
|
162
|
+
|
|
163
|
+
`CHANGELOG.md` is generated from the commit history by `npm run changelog`. A release is the commit that
|
|
164
|
+
changes the version, so run it after that commit exists; the file lists what has been committed so far.
|
|
165
|
+
|
|
55
166
|
## Development
|
|
56
167
|
|
|
57
168
|
```sh
|
package/agents/coder.md
CHANGED
|
@@ -46,7 +46,7 @@ You are a coder. You own a change, whether a feature, refactor, bug fix, or fron
|
|
|
46
46
|
|
|
47
47
|
## Boundaries
|
|
48
48
|
|
|
49
|
-
- bash is not a sandbox. Use it to inspect, build, test, and run project tooling. Do not commit, push, install dependencies, or touch the network unless the task says to. Other agents may be editing this tree, so do not revert or restyle their changes.
|
|
49
|
+
- bash is not a sandbox. Use it to inspect, build, test, and run project tooling. Do not commit, push, install dependencies, or touch the network unless the task says to. In this session no devsys guards run in your session, so the repository's rules are yours to keep: never weaken, skip or delete a test to get green, never add a lint suppression without a stated reason, never commit secrets, and leave commits, pushes and history to the coordinator. Other agents may be editing this tree, so do not revert or restyle their changes.
|
|
50
50
|
- You cannot delegate. Send agent_update only when the plan changes or a failure is not obvious. If a missing decision, missing access, an exhausted budget, or a stalled investigation blocks you, call agent_pause with the evidence and stop.
|
|
51
51
|
|
|
52
52
|
## Handback
|
package/agents/tasker.md
CHANGED
|
@@ -56,3 +56,5 @@ Run a proportionate check: the one the task specifies, else a focused test, comm
|
|
|
56
56
|
- **Gaps**: anything unverified or left for another role.
|
|
57
57
|
|
|
58
58
|
Send agent_update only when criteria are met, a check fails, or scope is expanding. If blocked, call agent_pause with the blocker and stop.
|
|
59
|
+
|
|
60
|
+
In this session no devsys guards run in your session, so the repository's rules are yours to keep: never weaken, skip or delete a test to get green, never add a lint suppression without a stated reason, never commit secrets, and leave commits, pushes and history to the coordinator.
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jwilger/pi-development-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"description": "A pi extension package representing a seasoned approach to software development using a full AI SDLC.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
7
7
|
],
|
|
8
|
+
"license": "MIT",
|
|
8
9
|
"author": "John Wilger",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"scripts": {
|
|
58
59
|
"test": "node --experimental-transform-types --no-warnings --test \"test/**/*.test.ts\"",
|
|
59
60
|
"test:jev": "node --experimental-transform-types --no-warnings --test \"test/live/*.live.ts\"",
|
|
61
|
+
"changelog": "node --experimental-transform-types --no-warnings scripts/changelog.ts",
|
|
60
62
|
"check:jev": "node scripts/run-jev-fixtures.ts",
|
|
61
63
|
"typecheck": "tsc --noEmit",
|
|
62
64
|
"lint": "biome check --error-on-warnings .",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: profile-design-system
|
|
3
|
+
description: Design-system discipline for UI work - tokens before components, building only from existing design-system materials, and a logged decision when something does not fit. Use when a slice adds or changes user interface (components, styles, pages), when a repo has a design system or token files (*.tokens.json, .css, .scss, .tsx, .vue, .svelte), or when reviewing UI code for snowflakes and raw values.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Design-system profile
|
|
7
|
+
|
|
8
|
+
Brad Frost's stance, as this system applies it: the AI is deliberately constrained to the
|
|
9
|
+
design system's materials. That constraint is what separates working inside a design
|
|
10
|
+
system from vibe coding. Treat the agent as a smart but sometimes unsophisticated
|
|
11
|
+
junior developer who has read the system's codebase and must follow its conventions.
|
|
12
|
+
|
|
13
|
+
## Order of work: tokens, then components, then pages
|
|
14
|
+
|
|
15
|
+
1. **Tokens.** Three tiers. Raw (`color-brand-green`) feeds semantic
|
|
16
|
+
(`theme-color-primary-background`), which feeds component (`button-primary-background`).
|
|
17
|
+
Components read the component tier; they never reach for a raw value.
|
|
18
|
+
2. **Components.** Structure, behaviour and accessibility live in a structural component
|
|
19
|
+
library, kept apart from the aesthetic token layer. Do not fork a component to change
|
|
20
|
+
how it looks; change tokens.
|
|
21
|
+
3. **Pages.** A page is the test of the system. Build it with real content in more than
|
|
22
|
+
one shape: a 40 and a 340 character headline, one and ten items, empty and error.
|
|
23
|
+
Anything that breaks goes back to the component, not into a page-level patch.
|
|
24
|
+
|
|
25
|
+
## Defaults for a UI slice
|
|
26
|
+
|
|
27
|
+
- **Use an existing component.** Search the design system first and name what you found
|
|
28
|
+
in the task record. The plan lists the states and variants the slice must show
|
|
29
|
+
(default, hover, focus, disabled, loading, empty, error, long content, narrow screen).
|
|
30
|
+
- **No raw values in components.** No hex colours, pixel sizes, z-indexes or font
|
|
31
|
+
stacks inline. Make this a lint (stylelint, a biome or eslint rule, a grep in CI);
|
|
32
|
+
prose alone is a write-only channel and is not enforced.
|
|
33
|
+
- **Build states outside the app first** when the repo has Storybook or a pattern lab:
|
|
34
|
+
write the story with real-content variants, then wire the component into the app.
|
|
35
|
+
- **Accessibility is part of the component**, not a later pass: roles, labels, keyboard
|
|
36
|
+
path, focus order, contrast from the token pair, reduced motion.
|
|
37
|
+
|
|
38
|
+
## When it does not fit: 90 percent and missing components
|
|
39
|
+
|
|
40
|
+
Product pressure will find a way around the system. Decide, do not drift.
|
|
41
|
+
|
|
42
|
+
| Situation | Decision | Record |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| The component fits | Use it as is | nothing |
|
|
45
|
+
| It fits about 90 percent | Extend through a documented variant or a token; ask the system owner when the variant is not yours to add | a line in the task record |
|
|
46
|
+
| Nothing fits, and the need will recur | Propose a new component to the system, build it there first | an ADR if it changes the component API |
|
|
47
|
+
| Nothing fits, and the need is one of a kind | A snowflake: allowed once, local, labelled | `devsys_record_departure` with gate `scope.expansion:snowflake`, naming the 90 percent reasoning and when to revisit |
|
|
48
|
+
|
|
49
|
+
A snowflake written without that record is a defect to fix in review, not a style
|
|
50
|
+
preference.
|
|
51
|
+
|
|
52
|
+
## Checklist
|
|
53
|
+
|
|
54
|
+
- [ ] The slice names the design-system components it uses, or why none fits.
|
|
55
|
+
- [ ] No raw colour, size or font value in a component; the tier rule has a lint.
|
|
56
|
+
- [ ] Every state and variant in the plan has a story or screenshot with real content.
|
|
57
|
+
- [ ] Keyboard, focus, labels and contrast checked on the new or changed component.
|
|
58
|
+
- [ ] Any snowflake or forked component has its recorded decision.
|
|
59
|
+
|
|
60
|
+
## Do not
|
|
61
|
+
|
|
62
|
+
- Do not invent a component, a token or a variant the system does not have without the
|
|
63
|
+
decision above.
|
|
64
|
+
- Do not copy a component's markup into a page to restyle it.
|
|
65
|
+
- Do not choose a different UI library for one slice.
|
|
66
|
+
- Do not let a generated component through that only looks right in the happy case.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: threat-modelling
|
|
3
|
+
description: Proportional threat modelling for a change - decide whether it needs one, ask four questions, and record the result only when the risk earns it. Use before designing or reviewing anything that touches authentication, authorisation, secrets, user data, a network boundary, file or process execution, payments, or a new dependency, or when asked for a threat model or security review.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Threat modelling
|
|
7
|
+
|
|
8
|
+
Proportional on purpose. Most changes need thirty seconds of thought and no document.
|
|
9
|
+
A few need a page. None need a framework exercise.
|
|
10
|
+
|
|
11
|
+
## What this system trusts
|
|
12
|
+
|
|
13
|
+
This system runs on the author's single-owner machine. Trusted: the author, their
|
|
14
|
+
working tree, their credentials in pi, the local shell and git. Do not model an attacker
|
|
15
|
+
who already has that. Untrusted: everything that arrives from outside it. That means
|
|
16
|
+
network input, file contents from other people, dependency code, model output when it
|
|
17
|
+
becomes a command or a path, and anything a deployed service receives.
|
|
18
|
+
|
|
19
|
+
## Is a threat model needed?
|
|
20
|
+
|
|
21
|
+
Ask all four and count the yes answers:
|
|
22
|
+
|
|
23
|
+
1. Does the change add or move a **trust boundary** (a new input from outside, a new
|
|
24
|
+
network call, a new account or role)?
|
|
25
|
+
2. Does it handle **secrets, personal data, money or authority** (login, permissions,
|
|
26
|
+
keys, tokens, payments)?
|
|
27
|
+
3. Does it **execute or interpret** something it did not write (a shell command, a
|
|
28
|
+
file path, a template, deserialised data, a plugin)?
|
|
29
|
+
4. Does it add a **dependency class** or change how packages are fetched or run?
|
|
30
|
+
|
|
31
|
+
No yes: no document. Note "no new trust boundary" in the task record and move on. One or
|
|
32
|
+
more yes: do the four questions below.
|
|
33
|
+
|
|
34
|
+
## The four questions
|
|
35
|
+
|
|
36
|
+
1. **What are we protecting?** Name the asset: the data, the authority, the money, the
|
|
37
|
+
machine. If you cannot name one, the change probably does not need this.
|
|
38
|
+
2. **Who or what can reach it, and from where?** List the entry points and who controls
|
|
39
|
+
each: users, other services, files, the model, a dependency.
|
|
40
|
+
3. **What could go wrong?** For each entry point, a line each for: pretending to be
|
|
41
|
+
someone else, changing what should not change, denying that it happened, reading what
|
|
42
|
+
should stay private, making it unavailable, gaining more authority than intended.
|
|
43
|
+
Skip the ones that do not apply and say so.
|
|
44
|
+
4. **What stops it, and what is left?** Name the control that exists (a check, a limit,
|
|
45
|
+
a permission, a test). Where there is none, decide: build one, accept the risk, or
|
|
46
|
+
leave it to a named follow-up. An accepted risk is written down with its cost.
|
|
47
|
+
|
|
48
|
+
## Checklist for the usual suspects
|
|
49
|
+
|
|
50
|
+
- [ ] Input is parsed into a type at the boundary; length, size and shape limits exist.
|
|
51
|
+
- [ ] Secrets never reach logs, commit messages, eval fixtures or subagent prompts
|
|
52
|
+
(non-negotiable 7); they are read from the environment or the credential store.
|
|
53
|
+
- [ ] A path or a command built from input cannot leave its directory or add
|
|
54
|
+
arguments; use argument arrays, not string concatenation.
|
|
55
|
+
- [ ] Authority is checked on the server side of every boundary, not inferred from the
|
|
56
|
+
client.
|
|
57
|
+
- [ ] A failure refuses safely: with no user to ask, the answer is no.
|
|
58
|
+
- [ ] Errors do not reveal more than the caller may know.
|
|
59
|
+
- [ ] New dependencies are pinned, maintained and needed; the install does not run code
|
|
60
|
+
you did not intend.
|
|
61
|
+
- [ ] Each control has a test that fails when the control is removed.
|
|
62
|
+
|
|
63
|
+
## When to write `docs/security/threat-model.md`
|
|
64
|
+
|
|
65
|
+
Write it, or extend it, when the change has at least two yes answers above, or any
|
|
66
|
+
accepted risk you would want a reviewer to find later. Keep it to one page: assets,
|
|
67
|
+
entry points, the table from question 3 for what applies, controls with their test
|
|
68
|
+
names, accepted risks with who decided. Link it from the ADR when the decision shapes
|
|
69
|
+
the architecture. Otherwise the task record line is enough.
|
|
70
|
+
|
|
71
|
+
## Do not
|
|
72
|
+
|
|
73
|
+
- Do not produce a threat model for a change with no trust boundary to satisfy a process.
|
|
74
|
+
- Do not list generic threats that have no entry point in this system.
|
|
75
|
+
- Do not accept a risk silently; an unrecorded acceptance is an unmanaged one.
|
|
76
|
+
- Do not weaken a control to make a test or a gate pass (non-negotiable 2).
|