@coldtea/pr-lens-agent-skill 0.1.4 → 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/SKILL.md +78 -10
- package/package.json +3 -3
- package/references/config.md +10 -2
- package/references/example.graph.json +106 -1
- package/references/graph-document.md +47 -2
package/SKILL.md
CHANGED
|
@@ -15,12 +15,12 @@ The diff or code is represented as one JSON document (lanes, nodes, edges, order
|
|
|
15
15
|
|
|
16
16
|
If not expressing a code diff, read the code to be visually represented
|
|
17
17
|
|
|
18
|
-
2. **Write the document** to `.pr-lens/graph.json`, following `references/graph-document.md`. `references/example.graph.json` is valid reference with three lanes, all four delta states, a hero edge, a seven-step flow, a nested drill-down tree. Read it before you write your first one. It is quicker than reading the reference.
|
|
18
|
+
2. **Write the document** to `.pr-lens/graph.json`, following `references/graph-document.md`. `references/example.graph.json` is valid reference with three lanes, all four delta states, a hero edge, a seven-step flow, a nested drill-down tree and a six-step walkthrough. Read it before you write your first one. It is quicker than reading the reference.
|
|
19
19
|
|
|
20
20
|
3. **Validate, and fix**
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npx @coldtea/pr-lens-cli validate .pr-lens/graph.json
|
|
23
|
+
npx @coldtea/pr-lens-cli@latest validate .pr-lens/graph.json
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Fix every failure and run it again. Do not render an invalid document; do not "work around" a failure by deleting the element it names.
|
|
@@ -28,12 +28,20 @@ The diff or code is represented as one JSON document (lanes, nodes, edges, order
|
|
|
28
28
|
4. **Render.**
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npx @coldtea/pr-lens-cli render .pr-lens/graph.json --theme dark
|
|
31
|
+
npx @coldtea/pr-lens-cli@latest render .pr-lens/graph.json --theme dark
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Render dark as the default theme unless explicitly requested. The SVGs, the manifest and `drawn.graph.json` land in `.pr-lens/`, which the CLI adds to the repository's .gitignore. Do not commit any of it. These files are rebuilt from the diff whenever anyone wants them again. Each SVG is named after its view, the theme and a content hash; `manifest.json` lists them by lens and view, so read the names from there or from the directory.
|
|
35
35
|
|
|
36
|
-
If the user asked for a diagram
|
|
36
|
+
If the user asked for a diagram, an explanation or a picture of the architecture and nothing more, put it on a canvas and hand back the link:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx @coldtea/pr-lens-cli@latest canvas push
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This pushes `.pr-lens/drawn.graph.json` and prints three links. Give the user the view link, `https://prlens.dev/c/{id}`: that is the diagram, full screen, every view on one page, and it opens without a login. The edit link, the one ending in `#w=…`, lets its holder push over the canvas, so leave it out of the reply unless they ask, and never paste it anywhere public. The embed link serves the top view as an SVG for a README.
|
|
43
|
+
|
|
44
|
+
Pushing the same file again updates the same canvas, so a follow-up such as "rename that node" or "add the queue" is: edit the document, validate, render, push. The link stays the same. If the push fails, say so and tell them where the SVGs are and which one is the top view.
|
|
37
45
|
|
|
38
46
|
5. **Attach, when there is a pull request to attach to.** That means the user asked you to open a PR, asked for a diagram on one that exists, or you are opening a PR as part of changes made. Otherwise skip this step.
|
|
39
47
|
|
|
@@ -62,7 +70,7 @@ The diff or code is represented as one JSON document (lanes, nodes, edges, order
|
|
|
62
70
|
When `--attach` is not an option, publish the SVGs somewhere durable and let the CLI compose the comment instead:
|
|
63
71
|
|
|
64
72
|
```bash
|
|
65
|
-
npx @coldtea/pr-lens-cli comment \
|
|
73
|
+
npx @coldtea/pr-lens-cli@latest comment \
|
|
66
74
|
--graph .pr-lens/drawn.graph.json \
|
|
67
75
|
--manifest .pr-lens/manifest.json \
|
|
68
76
|
--asset-base-url https://raw.githubusercontent.com/<owner>/<repo>/<branch>/<dir>
|
|
@@ -70,7 +78,7 @@ The diff or code is represented as one JSON document (lanes, nodes, edges, order
|
|
|
70
78
|
|
|
71
79
|
`--graph` takes `drawn.graph.json`, not the document you wrote, because corrections change what the diagrams show and the CLI refuses a document its manifest does not describe. `--asset-base-url` is where you published the SVGs; leave it out and the markdown points at local paths no reader can fetch. The markdown goes to stdout, with each diagram as a `<picture>` pair; posting it is your business.
|
|
72
80
|
|
|
73
|
-
If you would rather not author the document yourself, `npx @coldtea/pr-lens-cli analyze --base <ref>` does steps 1 and 2 by asking a provider — Gemini, OpenAI, or any endpoint speaking `/chat/completions` — with a key of your own. That is the only path here that needs one.
|
|
81
|
+
If you would rather not author the document yourself, `npx @coldtea/pr-lens-cli@latest analyze --base <ref>` does steps 1 and 2 by asking a provider — Gemini, OpenAI, or any endpoint speaking `/chat/completions` — with a key of your own. That is the only path here that needs one.
|
|
74
82
|
|
|
75
83
|
## The pull request body, when there is one
|
|
76
84
|
|
|
@@ -93,25 +101,85 @@ Every child moves down one level and covers a materially narrower scope. Skip em
|
|
|
93
101
|
|
|
94
102
|
Keep data-flow views as separate roots rather than nesting them in the architecture tree. Set `defaultOpen: true` on the highest useful architecture view. Lower levels should normally keep the default, `false`.
|
|
95
103
|
|
|
104
|
+
## Writing a walkthrough
|
|
105
|
+
|
|
106
|
+
A walkthrough is a short guided tour of the diagrams. It has two to twelve steps. Each step shows one diagram, points at one part of it, and says a few words about it. A canvas plays it, and the reader scrolls through it.
|
|
107
|
+
|
|
108
|
+
The contract leaves a walkthrough optional. Write one anyway for anything that is not trivial: more than one diagram, a diagram with several changed parts, or any flow. Skip it only when the document is one small diagram whose single step would just repeat the title.
|
|
109
|
+
|
|
110
|
+
Aim for three to seven steps.
|
|
111
|
+
|
|
112
|
+
A walkthrough is the fastest read of a pull request. Each step is one change: something added, changed, removed or moved, in the order a reviewer needs it. A step is never a description of the diagram.
|
|
113
|
+
|
|
114
|
+
What counts as a step: a behaviour change, an API change, an architecture change, a data-flow change, or an addition. Unchanged parts appear only where a step needs them to make sense. The headline change is step one. An overview of everything touched, if there is one, is the last step.
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
"walkthrough": {
|
|
118
|
+
"steps": [
|
|
119
|
+
{
|
|
120
|
+
"id": "four-batch-calls",
|
|
121
|
+
"heading": "Postmark now gets 500 emails per call",
|
|
122
|
+
"body": "One call per batch, and Postmark answers with a result for each message.",
|
|
123
|
+
"stage": { "kind": "flow", "flow": "send-pipeline" },
|
|
124
|
+
"focus": { "kind": "selection", "messages": ["batch-post", "batch-results"] }
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "blast-radius",
|
|
128
|
+
"heading": "4 parts added, 2 removed, across 3 lanes",
|
|
129
|
+
"body": "A 2,000-person broadcast used to make 2,000 calls to Postmark. It now makes 4.",
|
|
130
|
+
"stage": { "kind": "view", "view": "overview" }
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Each step has:
|
|
137
|
+
|
|
138
|
+
- `heading`: the thing and what happened to it, up to 48 characters, in sentence case. Build it from change words: added, removed, replaced, now, moved, split. If a heading could have been true before the pull request, it is not a change heading.
|
|
139
|
+
- `body`: one line under the heading, up to 140 characters, on what the change means for behaviour: what happens now that did not before, or what stops happening, with the numbers when they matter. Not a restatement of the heading, and not a description of the code. A heading with no body reads as unfinished, so the body is required.
|
|
140
|
+
- `stage`: which diagram to show. A document can have several diagrams: its views (the drill-down diagrams) and its flows (the sequence diagrams). `{ "kind": "view", "view": "overview" }` shows the view called `overview`. `{ "kind": "flow", "flow": "send-pipeline" }` shows the flow called `send-pipeline`. Leave `stage` out and the step uses the diagram the reader is already on. Open on the widest view with the focus left out, so the reader sees the whole thing before it narrows.
|
|
141
|
+
- `focus`: what to zoom in on inside that diagram. `{ "kind": "all" }`, the default, means the whole diagram. A selection means "just these things": name any lanes, nodes, edges or flow steps (`messages`) by id, and the camera zooms to them while everything else dims. Focus the elements the step's change touched, so the veil lights the change. Point at two or three of them. A step that lights half the diagram has not said anything.
|
|
142
|
+
|
|
143
|
+
Write every word for a smart twelve-year-old: short common words, one idea per line, active voice, things named as the diagram names them, numbers as digits. If a line needs a second read, rewrite it. Words like leverages, orchestrates, asynchronous pipeline and fan-out never belong in a step. This holds in whatever language the document is written in.
|
|
144
|
+
|
|
145
|
+
The same three steps, written well and written badly. Heading first, then the body after the slash:
|
|
146
|
+
|
|
147
|
+
| Write this | Not this |
|
|
148
|
+
| -------- | -------- |
|
|
149
|
+
| Route now queues the job instead of sending / The API call finishes at once. A worker sends the mail later. | Broadcast fan-out moves behind the queue / The API route now enqueues broadcast jobs for asynchronous batch processing instead of sending emails inline. |
|
|
150
|
+
| Postmark now gets 500 emails per call / One call per batch instead of one call per person. | Batched delivery replaces single sends / The worker leverages the shared library to send emails in chunks of 500 via Postmark's batch endpoint. |
|
|
151
|
+
| processBroadcast and sendSingleEmail removed / sendBroadcastBulk does their job for whole batches. | Single send functions are retired / sendBroadcastBulk replaces processBroadcast and sendSingleEmail to handle bulk deliveries in chunks. |
|
|
152
|
+
|
|
153
|
+
Keep consecutive steps on the same stage together. Every change of stage flies the camera across the canvas, so a tour that alternates between two diagrams spends its time travelling.
|
|
154
|
+
|
|
155
|
+
The validator checks:
|
|
156
|
+
|
|
157
|
+
- Every id you name exists in the document. A flow step you name must belong to the flow the stage shows, because flow step ids are only unique inside their own flow.
|
|
158
|
+
- `messages` needs a stage that shows a flow. Leave it out when the stage is an architecture view.
|
|
159
|
+
- Step ids are unique within the walkthrough. Two steps minimum, twelve maximum.
|
|
160
|
+
- A stored map never carries a walkthrough. A map describes the system; a walkthrough tells the story of one change.
|
|
161
|
+
|
|
162
|
+
The field arrived with contract 0.1.1. A CLI older than 0.4.0 does not know it and rejects the whole document as an invented field, so validate with a current one.
|
|
163
|
+
|
|
96
164
|
## What the validator will catch
|
|
97
165
|
|
|
98
166
|
Read `references/graph-document.md` before writing. The four failures that account for nearly everything:
|
|
99
167
|
|
|
100
168
|
| Code | What you did |
|
|
101
169
|
| ---------------------------- | -------------------------------------------------------------------- |
|
|
102
|
-
| `BROKEN_REFERENCE` | an edge, a flow step or a
|
|
170
|
+
| `BROKEN_REFERENCE` | an edge, a flow step, a view or a walkthrough step names an id you never declared |
|
|
103
171
|
| `INVALID_DOCUMENT` | an invented field; the schemas are strict, unknown keys are rejected |
|
|
104
172
|
| `DUPLICATE_ID` | two nodes, edges or views sharing an id |
|
|
105
173
|
| `UNSUPPORTED_SCHEMA_VERSION` | `schemaVersion` is not the contract version installed |
|
|
106
174
|
|
|
107
|
-
|
|
175
|
+
Six rules cannot be expressed in JSON Schema and are checked only by the parser, so structured output alone does not make a document valid: referential integrity, a line range that ends before it starts, a `self` message whose endpoints disagree, a patch whose two commits are the same, more views than a render manifest could describe, and a walkthrough step focusing flow steps the diagram on its stage does not draw. Always validate.
|
|
108
176
|
|
|
109
177
|
## Fixing a map instead of writing one
|
|
110
178
|
|
|
111
179
|
When someone says the diagram is wrong (a node is misnamed, a folder should not be on it, something sits in the wrong lane), do not edit the generated document. It is regenerated on every run. Write the correction into `.github/pr-lens.yml`, which is an overlay applied over fresh inference every time:
|
|
112
180
|
|
|
113
181
|
```yaml
|
|
114
|
-
schemaVersion: 0.1.
|
|
182
|
+
schemaVersion: 0.1.1
|
|
115
183
|
map:
|
|
116
184
|
rename:
|
|
117
185
|
- match: functions/src/broadcast/sendBroadcastBulk.ts
|
|
@@ -123,7 +191,7 @@ map:
|
|
|
123
191
|
lane: functions
|
|
124
192
|
```
|
|
125
193
|
|
|
126
|
-
`references/config.md` has the full format and the recipes. Validate it the same way: `npx @coldtea/pr-lens-cli validate .github/pr-lens.yml`.
|
|
194
|
+
`references/config.md` has the full format and the recipes. Validate it the same way: `npx @coldtea/pr-lens-cli@latest validate .github/pr-lens.yml`.
|
|
127
195
|
|
|
128
196
|
A `match` beginning with `id:` addresses one node exactly; anything else is a path glob matched against a node's file paths. Prefer the glob, because it keeps holding when the next run names the node differently. A lane pin may name a lane the document never declared: the band is created, and takes the id for its label, so give it one a reader would want to see.
|
|
129
197
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coldtea/pr-lens-agent-skill",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "The PR Lens skill for coding agents: author a graph document from a diff, validate it, render it, and correct a repository's map.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Coldtea AI",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"typescript": "7.0.2",
|
|
35
35
|
"vitest": "4.1.11",
|
|
36
36
|
"yaml": "^2.8.1",
|
|
37
|
-
"@coldtea/pr-lens-
|
|
38
|
-
"@coldtea/pr-lens-
|
|
37
|
+
"@coldtea/pr-lens-renderer": "^0.2.0",
|
|
38
|
+
"@coldtea/pr-lens-schema": "^0.2.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"skill:sync": "tsx scripts/sync.ts",
|
package/references/config.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
The generated document is regenerated on every run, so editing it is pointless. Corrections live in `.github/pr-lens.yml`, an overlay applied over fresh inference every time. Inference never writes back into this file, which is why a correction keeps holding as the code moves.
|
|
4
4
|
|
|
5
5
|
```yaml
|
|
6
|
-
schemaVersion: 0.1.
|
|
6
|
+
schemaVersion: 0.1.1 # required
|
|
7
7
|
lenses: [architecture, data-flow]
|
|
8
8
|
branding: true
|
|
9
9
|
map:
|
|
@@ -81,10 +81,18 @@ map:
|
|
|
81
81
|
lenses: [architecture]
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
## Hosted GitHub App comments
|
|
85
|
+
|
|
86
|
+
The hosted App reads `github` settings from the PR's head commit. Other options apply to the CLI.
|
|
87
|
+
|
|
88
|
+
| Setting | Default | Effect |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| `github.comment.collapsed` | `false` | Start diagrams and details closed. Drawing still runs automatically. |
|
|
91
|
+
|
|
84
92
|
## Check it
|
|
85
93
|
|
|
86
94
|
```bash
|
|
87
|
-
npx @coldtea/pr-lens-cli validate .github/pr-lens.yml
|
|
95
|
+
npx @coldtea/pr-lens-cli@latest validate .github/pr-lens.yml
|
|
88
96
|
```
|
|
89
97
|
|
|
90
98
|
`pr-lens render` reports any correction that changed nothing about the document it drew. That is a config that has drifted out of date, usually because the file a selector named has moved or gone. It is not an error and nothing stops, but it is worth fixing: a correction that matches nothing is a correction nobody is getting.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion": "0.1.
|
|
2
|
+
"schemaVersion": "0.1.1",
|
|
3
3
|
"kind": "graph",
|
|
4
4
|
"generatedAt": "2026-08-19T18:24:00.000Z",
|
|
5
5
|
"title": "Batch broadcast sending through Postmark",
|
|
@@ -564,6 +564,111 @@
|
|
|
564
564
|
"children": []
|
|
565
565
|
}
|
|
566
566
|
],
|
|
567
|
+
"walkthrough": {
|
|
568
|
+
"steps": [
|
|
569
|
+
{
|
|
570
|
+
"id": "batches-of-500",
|
|
571
|
+
"heading": "sendBroadcastBulk and buildBulkPayload added",
|
|
572
|
+
"body": "Nothing loops over recipients any more. The sender works on a whole batch at a time.",
|
|
573
|
+
"stage": {
|
|
574
|
+
"kind": "view",
|
|
575
|
+
"view": "overview"
|
|
576
|
+
},
|
|
577
|
+
"focus": {
|
|
578
|
+
"kind": "selection",
|
|
579
|
+
"lanes": [],
|
|
580
|
+
"nodes": [
|
|
581
|
+
"send-broadcast-bulk",
|
|
582
|
+
"build-bulk-payload",
|
|
583
|
+
"postmark"
|
|
584
|
+
],
|
|
585
|
+
"edges": [],
|
|
586
|
+
"messages": []
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"id": "suppression-first",
|
|
591
|
+
"heading": "getSuppressedEmails added before the send",
|
|
592
|
+
"body": "It pulls the blocked addresses once, before any batch is built.",
|
|
593
|
+
"stage": {
|
|
594
|
+
"kind": "view",
|
|
595
|
+
"view": "new-batch-path"
|
|
596
|
+
},
|
|
597
|
+
"focus": {
|
|
598
|
+
"kind": "selection",
|
|
599
|
+
"lanes": [],
|
|
600
|
+
"nodes": [
|
|
601
|
+
"get-suppressed-emails",
|
|
602
|
+
"postmark"
|
|
603
|
+
],
|
|
604
|
+
"edges": [],
|
|
605
|
+
"messages": []
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"id": "old-path-goes-dark",
|
|
610
|
+
"heading": "processBroadcast and sendSingleEmail removed",
|
|
611
|
+
"body": "sendBroadcastBulk does their job for whole batches.",
|
|
612
|
+
"stage": {
|
|
613
|
+
"kind": "view",
|
|
614
|
+
"view": "overview"
|
|
615
|
+
},
|
|
616
|
+
"focus": {
|
|
617
|
+
"kind": "selection",
|
|
618
|
+
"lanes": [],
|
|
619
|
+
"nodes": [
|
|
620
|
+
"process-broadcast",
|
|
621
|
+
"send-single-email"
|
|
622
|
+
],
|
|
623
|
+
"edges": [],
|
|
624
|
+
"messages": []
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"id": "sequence-start-to-finish",
|
|
629
|
+
"heading": "The send sequence gained 6 new steps",
|
|
630
|
+
"body": "The queue write is the only step that was there before, and it now stamps the batch size.",
|
|
631
|
+
"stage": {
|
|
632
|
+
"kind": "flow",
|
|
633
|
+
"flow": "send-pipeline"
|
|
634
|
+
},
|
|
635
|
+
"focus": {
|
|
636
|
+
"kind": "all"
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"id": "four-batch-calls",
|
|
641
|
+
"heading": "Postmark now gets 500 emails per call",
|
|
642
|
+
"body": "One call per batch, and Postmark answers with a result for each message.",
|
|
643
|
+
"stage": {
|
|
644
|
+
"kind": "flow",
|
|
645
|
+
"flow": "send-pipeline"
|
|
646
|
+
},
|
|
647
|
+
"focus": {
|
|
648
|
+
"kind": "selection",
|
|
649
|
+
"lanes": [],
|
|
650
|
+
"nodes": [],
|
|
651
|
+
"edges": [],
|
|
652
|
+
"messages": [
|
|
653
|
+
"batch-post",
|
|
654
|
+
"batch-results"
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"id": "blast-radius",
|
|
660
|
+
"heading": "4 parts added, 2 removed, across 3 lanes",
|
|
661
|
+
"body": "A 2,000-person broadcast used to make 2,000 calls to Postmark. It now makes 4.",
|
|
662
|
+
"stage": {
|
|
663
|
+
"kind": "view",
|
|
664
|
+
"view": "overview"
|
|
665
|
+
},
|
|
666
|
+
"focus": {
|
|
667
|
+
"kind": "all"
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
]
|
|
671
|
+
},
|
|
567
672
|
"layout": {
|
|
568
673
|
"direction": "right",
|
|
569
674
|
"laneOrder": [
|
|
@@ -10,7 +10,7 @@ Every schema here is **strict**: an unknown key is a rejection, not a warning. A
|
|
|
10
10
|
|
|
11
11
|
```json
|
|
12
12
|
{
|
|
13
|
-
"schemaVersion": "0.1.
|
|
13
|
+
"schemaVersion": "0.1.1",
|
|
14
14
|
"kind": "graph",
|
|
15
15
|
"title": "Batch broadcast sending through Postmark",
|
|
16
16
|
"summary": "One paragraph answering: what does this change do?",
|
|
@@ -204,6 +204,51 @@ This compact fragment shows the shape. The selected ids refer to elements declar
|
|
|
204
204
|
}
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
+
## Walkthrough
|
|
208
|
+
|
|
209
|
+
Optional in the format, but write one for anything that is not trivial: more than one diagram, a diagram with several changed parts, or any flow. Skip it only when the document is one small diagram whose single step would just repeat the title. A canvas or a share page plays it.
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"walkthrough": {
|
|
214
|
+
"steps": [
|
|
215
|
+
{
|
|
216
|
+
"id": "four-batch-calls",
|
|
217
|
+
"heading": "Postmark now gets 500 emails per call",
|
|
218
|
+
"body": "One call per batch, and Postmark answers with a result for each message.",
|
|
219
|
+
"stage": { "kind": "flow", "flow": "send-pipeline" },
|
|
220
|
+
"focus": { "kind": "selection", "messages": ["batch-post", "batch-results"] }
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "blast-radius",
|
|
224
|
+
"heading": "4 parts added, 2 removed, across 3 lanes",
|
|
225
|
+
"body": "A 2,000-person broadcast used to make 2,000 calls to Postmark. It now makes 4.",
|
|
226
|
+
"stage": { "kind": "view", "view": "overview" },
|
|
227
|
+
"focus": { "kind": "all" }
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
A walkthrough is a short guided tour of the diagrams. It has two to twelve steps. Each step shows one diagram, points at one part of it, and says a few words about it.
|
|
235
|
+
|
|
236
|
+
Every step is one change, never a description of the diagram: the heading names the thing and what happened to it, built from change words such as added, removed, replaced, now, moved and split, and the body is one line on what that means for behaviour, with the numbers when they matter. The headline change is step one. Write it all for a smart twelve-year-old, in short common words and active voice. The skill page has the rule in full, with examples of a step written well and the same step written badly.
|
|
237
|
+
|
|
238
|
+
Each step has:
|
|
239
|
+
|
|
240
|
+
- `heading`: the thing and what happened to it, up to 48 characters, in sentence case. For example "Postmark now gets 500 emails per call".
|
|
241
|
+
- `body`: one line under the heading, up to 140 characters, on what the change means for behaviour. For example "One call per batch instead of one call per person". Required: a heading with no body reads as unfinished.
|
|
242
|
+
- `stage`: which diagram to show. A document can have several diagrams: its views (the drill-down diagrams) and its flows (the sequence diagrams). `{ "kind": "view", "view": "overview" }` shows the view called `overview`. `{ "kind": "flow", "flow": "send-pipeline" }` shows the flow called `send-pipeline`. Leave `stage` out and the step uses the diagram the reader is already on.
|
|
243
|
+
- `focus`: what to zoom in on inside that diagram. `{ "kind": "all" }`, the default, means the whole diagram. A selection means "just these things": name any lanes, nodes, edges or flow steps (`messages`) by id, and the camera zooms to them while everything else dims. A selection must name at least one thing.
|
|
244
|
+
|
|
245
|
+
The validator checks:
|
|
246
|
+
|
|
247
|
+
- Every id you name exists in the document. A flow step you name must belong to the flow the stage shows, because flow step ids are only unique inside their own flow.
|
|
248
|
+
- `messages` needs a stage that shows a flow. Leave it out when the stage is an architecture view.
|
|
249
|
+
- Step ids are unique within the walkthrough. Two steps minimum, twelve maximum.
|
|
250
|
+
- A stored map never carries a walkthrough. A map describes the system; a walkthrough tells the story of one change.
|
|
251
|
+
|
|
207
252
|
## Layout
|
|
208
253
|
|
|
209
254
|
```json
|
|
@@ -227,7 +272,7 @@ Labels 120 characters, summaries 2000, chip values 32. They are display fields:
|
|
|
227
272
|
## Then validate
|
|
228
273
|
|
|
229
274
|
```bash
|
|
230
|
-
npx @coldtea/pr-lens-cli validate .pr-lens/graph.json
|
|
275
|
+
npx @coldtea/pr-lens-cli@latest validate .pr-lens/graph.json
|
|
231
276
|
```
|
|
232
277
|
|
|
233
278
|
Every problem is reported at once, with a path into the document. Fix them all and run it again until it is clean.
|