@coldtea/pr-lens-agent-skill 0.4.0 → 0.5.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 +76 -0
- package/package.json +3 -3
package/SKILL.md
CHANGED
|
@@ -86,6 +86,82 @@ Decide where the diagram lands before you write it: a canvas, or an SVG and a pu
|
|
|
86
86
|
|
|
87
87
|
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.
|
|
88
88
|
|
|
89
|
+
## Answering beside an open canvas
|
|
90
|
+
|
|
91
|
+
Once a canvas is pushed, you can answer questions about it on the canvas itself. The reader keeps the page open, asks you in the terminal, and your answer plays there: the camera moves step by step, what you name lights up, and each name is a link.
|
|
92
|
+
|
|
93
|
+
Run this once, when the user wants to talk about a canvas they have open or are about to open. Name the drawing you pushed, the same path as the push:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx @coldtea/pr-lens-cli@latest canvas open .pr-lens/<drawing>/drawn.graph.json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
It opens one browser tab that follows you. Only that tab moves. Anyone else reading the same link sees the canvas as it was. Every command below talks to that tab, and takes the same path as `--drawing`. Always pass it: a checkout can hold several canvases, and the path says which one you mean.
|
|
100
|
+
|
|
101
|
+
**When the user says "this", "here" or "what I selected", look first.** They clicked a component, dragged a box or picked a part of a drawing in the tab, and you cannot see it:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx @coldtea/pr-lens-cli@latest canvas look --drawing .pr-lens/<drawing>/drawn.graph.json
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
It prints JSON: the diagram they are on (`diagram.stage`, ready to paste into a step), what is on screen (`inFrame`), what they selected (`scope`), the answer they have open, and the drawing hung under the canvas (`fork`), if there is one. Answer about `scope` when it is set. `following: false` means they left agent mode: tell them the answer is waiting rather than saying you moved their canvas.
|
|
108
|
+
|
|
109
|
+
**Answer** with a JSON file, or `-` to pipe it in:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npx @coldtea/pr-lens-cli@latest canvas answer .pr-lens/answer.json --drawing .pr-lens/<drawing>/drawn.graph.json
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"question": "What does push check first?",
|
|
118
|
+
"steps": [
|
|
119
|
+
{
|
|
120
|
+
"heading": "Push checks the token first",
|
|
121
|
+
"stage": { "kind": "view", "view": "overview" },
|
|
122
|
+
"focus": { "kind": "selection", "nodes": ["canvas-api"] },
|
|
123
|
+
"paragraphs": [
|
|
124
|
+
{
|
|
125
|
+
"parts": [
|
|
126
|
+
{ "text": "The " },
|
|
127
|
+
{ "text": "canvas API", "ref": { "kind": "component", "id": "canvas-api" } },
|
|
128
|
+
{ "text": " refuses a push without the write token, before it draws anything." }
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- One to four steps. Two is usual. Each step stops on one diagram, in the order a reader should follow.
|
|
138
|
+
- `heading` is a sentence of at most six words: who or what, a verb, what happens. The first step's heading is the answer. To a yes or no question it says yes or no.
|
|
139
|
+
- `stage` and `focus` work exactly as they do in a walkthrough. Leave `stage` out for the opening diagram. Light one or two things, not half the diagram.
|
|
140
|
+
- A paragraph is one or two sentences and at most 30 words. A second paragraph is for a failure or a risk the first did not name.
|
|
141
|
+
- Every place you name carries a `ref`: `component` is a node id, `message` is `flowId/messageId`, `diagram` is a view or flow id. Copy ids from the document exactly. Never make one up. The CLI checks every id against the drawing before sending, and the app checks again; a wrong one comes back with the ids that exist.
|
|
142
|
+
- When the canvas cannot answer part of the question, say what is missing in `cannotTell` rather than guessing.
|
|
143
|
+
|
|
144
|
+
**"Take me to X"** is a camera move, not an answer:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npx @coldtea/pr-lens-cli@latest canvas show --drawing .pr-lens/<drawing>/drawn.graph.json \
|
|
148
|
+
--diagram send-pipeline --focus send-pipeline/enqueue --open send-pipeline/enqueue
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`--focus` takes node ids or `flow/message` and repeats. `--open` opens that message's sample payload.
|
|
152
|
+
|
|
153
|
+
**"What's inside X", "expand on X" or "break X down"** is a drawing. Write a small graph document of X's insides (up to ten nodes) and hang it under X:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npx @coldtea/pr-lens-cli@latest canvas fork .pr-lens/inside-x.json --from x --drawing .pr-lens/<drawing>/drawn.graph.json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
The sketch can leave out `schemaVersion`, `kind` and `provenance`; they come from the canvas.
|
|
160
|
+
|
|
161
|
+
**When the question needs the diagram itself changed** (a missing component, a wrong arrow), edit the document, validate, render and `canvas push` as usual. The open tab reloads onto the new revision by itself.
|
|
162
|
+
|
|
163
|
+
After `answer`, `show` and `fork`, the CLI says where the reader is. If it says they stepped out, tell the user the answer is waiting in their Questions list, and that `/` opens it.
|
|
164
|
+
|
|
89
165
|
## The pull request body, when there is one
|
|
90
166
|
|
|
91
167
|
A reviewer should understand the change before reading the diff, so the diagram goes where they look first: the description, not a trailing comment. Open with one sentence on why the change exists, then the architecture diagram, then whatever proves the change works, such as a screenshot of the result or a recording of the interaction. Use one visual per idea. A diagram that needs a paragraph of explanation has a document problem; go back to step 2.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coldtea/pr-lens-agent-skill",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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-schema": "^0.5.0",
|
|
38
|
+
"@coldtea/pr-lens-renderer": "^0.2.6"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"skill:sync": "tsx scripts/sync.ts",
|