@coldtea/pr-lens-agent-skill 0.1.2 → 0.1.3

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 CHANGED
@@ -45,6 +45,14 @@ If you would rather not author the document yourself, `npx @coldtea/pr-lens-cli
45
45
  - **Attach file refs**: they become the permalinks a reviewer clicks.
46
46
  - **There is no findings lens.** PR Lens is the comprehension layer, not another review bot. There is no field for a bug, a risk or a security note, and a document that invents one is rejected rather than trimmed.
47
47
 
48
+ ## Choosing architecture views
49
+
50
+ Treat architecture views as a C4-inspired decision tree, not a checklist. One useful view is enough for a small change. Start with system context when the change affects a user, an external system or a system boundary. Use a container view for the affected applications, services, jobs, data stores and runtimes. Add a component child only when an affected container's internals matter. Do not add code-level views by default.
51
+
52
+ Every child moves down one level and covers a materially narrower scope. Skip empty, repetitive or speculative levels, and do not infer architecture from folder names alone. Two views should not carry substantially the same nodes and edges. Keep the unchanged direct neighbours that explain blast radius.
53
+
54
+ 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`.
55
+
48
56
  ## What the validator will catch
49
57
 
50
58
  Read `references/graph-document.md` before writing. The four failures that account for nearly everything:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coldtea/pr-lens-agent-skill",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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",
@@ -141,6 +141,69 @@ The drill-down tree in the comment: up to 32 at the root, nesting up to 32 child
141
141
 
142
142
  `scope` is either `{ "kind": "all" }` (the default) or a selection naming at least one lane, node, edge or flow. The two are distinct states on purpose: removing the last element a view pointed at can never quietly turn it into a view of everything. A view's `lens` must be one the document declares.
143
143
 
144
+ ### Choosing architecture views
145
+
146
+ Treat the architecture tree as a set of decisions, not a quota:
147
+
148
+ 1. Ask whether the change affects a user, an external system or a system boundary. If it does, start with a system-context view. If it does not, leave that level out.
149
+ 2. Show affected applications, services, jobs, data stores and runtimes in a container view. Make it the root when there is no useful context view; otherwise make it a child of that context.
150
+ 3. Add a component child only when the internals of an affected container matter to the change. Components may be modules, routes or functions, but the view should explain their responsibilities and relationships rather than mirror folders.
151
+ 4. Stop at components unless someone explicitly asks for code-level detail.
152
+
153
+ One architecture view may be the right answer for a small change. Each child must move down exactly one level and cover a materially narrower scope. Skip a level when it would be empty, speculative or a repeat of its parent. Do not create two views with substantially the same nodes and edges, and do not infer a boundary from a folder name alone. Keep unchanged direct neighbours when they make the blast radius clear.
154
+
155
+ Set `defaultOpen: true` on the highest useful architecture view. Lower levels should normally stay collapsed. A data-flow view describes an ordered sequence, so keep it as a separate root instead of placing it inside the architecture hierarchy.
156
+
157
+ This compact fragment shows the shape. The selected ids refer to elements declared elsewhere in the document:
158
+
159
+ ```json
160
+ {
161
+ "views": [
162
+ {
163
+ "id": "checkout-context",
164
+ "title": "Checkout in its environment",
165
+ "lens": "architecture",
166
+ "defaultOpen": true,
167
+ "scope": {
168
+ "kind": "selection",
169
+ "nodes": ["shopper", "commerce-platform", "payment-provider", "fulfilment-system"],
170
+ "edges": ["shopper-to-commerce", "commerce-to-payment", "commerce-to-fulfilment"]
171
+ },
172
+ "children": [
173
+ {
174
+ "id": "checkout-containers",
175
+ "title": "Checkout containers",
176
+ "lens": "architecture",
177
+ "scope": {
178
+ "kind": "selection",
179
+ "nodes": ["storefront", "checkout-api", "orders-db", "payment-provider"],
180
+ "edges": ["storefront-to-checkout", "checkout-to-orders", "checkout-to-payment"]
181
+ },
182
+ "children": [
183
+ {
184
+ "id": "checkout-components",
185
+ "title": "Checkout API components",
186
+ "lens": "architecture",
187
+ "scope": {
188
+ "kind": "selection",
189
+ "nodes": ["checkout-route", "order-service", "payment-client"],
190
+ "edges": ["route-to-orders", "orders-to-payment-client"]
191
+ }
192
+ }
193
+ ]
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "id": "place-order-flow",
199
+ "title": "Placing an order",
200
+ "lens": "data-flow",
201
+ "scope": { "kind": "selection", "flows": ["place-order"] }
202
+ }
203
+ ]
204
+ }
205
+ ```
206
+
144
207
  ## Layout
145
208
 
146
209
  ```json