@canonical/product-design 0.47.0 → 0.49.0-experimental.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 +166 -0
- package/README.md +2 -0
- package/package.json +6 -5
- package/skills/desk-assemble/SKILL.md +6 -1
- package/skills/desk-assemble/starter/README.md +2 -0
- package/skills/desk-map-blocks/SKILL.md +553 -0
- package/skills/desk-map-blocks/tab.json +19 -0
- package/skills/desk-plan-ladder/SKILL.md +502 -0
- package/skills/desk-plan-ladder/tab.json +20 -0
- package/skills/desk-run-studio/SKILL.md +1 -1
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: desk-map-blocks
|
|
3
|
+
description: Map a product's views to the blocks of the design system, read through its ontology, deciding per block whether to reuse, extend, borrow, propose or keep it in the application; also runs as a guided tutorial on a worked example
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Map Blocks
|
|
7
|
+
|
|
8
|
+
List the layouts, patterns and components a product's views need, and map each to the
|
|
9
|
+
design system. This is where a product starts connecting with Pragma: every row is read
|
|
10
|
+
against the design-system graph, and every row ends in a verdict with its reason.
|
|
11
|
+
|
|
12
|
+
The input is the views and layouts of `desk-model-domains`, and the frames of
|
|
13
|
+
`desk-draw-frames` when they exist. The output is one inventory: what the product needs,
|
|
14
|
+
what it reuses, what it adds of its own, and why.
|
|
15
|
+
|
|
16
|
+
**Be pragmatic. Reuse is a means, not a score.** A block from the design system is taken
|
|
17
|
+
when it fits the need, and only then. A part kept in the application is a sound verdict,
|
|
18
|
+
not a failure, and the application never waits on the design system. What this skill is
|
|
19
|
+
strict about is the reading: a block is judged by what the graph says about it, its
|
|
20
|
+
class, its tier, its stage, its guidance, its modifiers and properties, never by its name
|
|
21
|
+
alone.
|
|
22
|
+
|
|
23
|
+
In a fresh session, orient first:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pragma capabilities
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Working mode: assistant to a design authority
|
|
30
|
+
|
|
31
|
+
Most of the time this skill runs with an operator: a designer, an engineer or a product
|
|
32
|
+
lead who knows the product. They are the authority. You are the assistant whose job is
|
|
33
|
+
to make them successful:
|
|
34
|
+
|
|
35
|
+
- Say which step comes next and why.
|
|
36
|
+
- Do the legwork yourself. Read the views, look every candidate up, read its guidance,
|
|
37
|
+
check its implementation, draft the verdicts.
|
|
38
|
+
- Bring each decision as a recommendation plus a question, never as a fait accompli.
|
|
39
|
+
Ask about one concrete row at a time, and say what each verdict would mean for the
|
|
40
|
+
product and for the design system.
|
|
41
|
+
|
|
42
|
+
Full autonomy is the exception. Run the whole flow alone only when explicitly asked to.
|
|
43
|
+
Then no gate can be passed: run to the end, record every gate decision as a guess, leave
|
|
44
|
+
every row `not reviewed`, and list each judgment call in the final report.
|
|
45
|
+
|
|
46
|
+
Decision gates. Pause at each and resolve it WITH the operator:
|
|
47
|
+
|
|
48
|
+
1. Create or update, whenever the signs leave any doubt.
|
|
49
|
+
2. The product's tier: which tier its own blocks would live in, if any.
|
|
50
|
+
3. Each row whose verdict is not "reuse as it is".
|
|
51
|
+
4. Each proposal to the design system, before it is written up.
|
|
52
|
+
5. Anything moved out of blocks into data.
|
|
53
|
+
|
|
54
|
+
## When to Use
|
|
55
|
+
|
|
56
|
+
- The views of a product are named, and what they are made of has to be decided
|
|
57
|
+
- An existing application's components need sorting: what the design system already
|
|
58
|
+
has, what is the product's own, and what is neither
|
|
59
|
+
- A product wants to start using Pragma and needs to know where it stands
|
|
60
|
+
- An earlier inventory needs updating after new views, new frames, or a change in the
|
|
61
|
+
design system
|
|
62
|
+
|
|
63
|
+
## When NOT to Use
|
|
64
|
+
|
|
65
|
+
- No views yet: use `desk-model-domains` first
|
|
66
|
+
- Specifying one new block in full: use `specify-component` or `specify-pattern`, which
|
|
67
|
+
this skill hands its proposals to
|
|
68
|
+
- Swapping an application's code to design-system components: that is adoption work,
|
|
69
|
+
and it comes after the inventory says what to swap
|
|
70
|
+
- Auditing the design system itself: this skill reads the design system for one product,
|
|
71
|
+
it does not judge the catalogue
|
|
72
|
+
|
|
73
|
+
## Opening move: ask, or offer the tutorial
|
|
74
|
+
|
|
75
|
+
Unless the first message already names the work, ask for the starting point as a
|
|
76
|
+
suggestion carrying an example, not as a form to fill in:
|
|
77
|
+
|
|
78
|
+
> To get started, point me at the product's views: the Domain model tab of its desk, a
|
|
79
|
+
> views table, or the application's code. If the views are not named yet, we start with
|
|
80
|
+
> `desk-model-domains`.
|
|
81
|
+
|
|
82
|
+
If the message already carries the starting point, say what you took it to be, and go.
|
|
83
|
+
|
|
84
|
+
Offer the tutorial in the same breath:
|
|
85
|
+
|
|
86
|
+
> Or if you'd rather see the flow first, I can run it as a tutorial on a worked example:
|
|
87
|
+
> a tracker that measures design-system adoption across four apps.
|
|
88
|
+
|
|
89
|
+
Tutorial mode runs the same steps on the worked example at the end of this skill, with
|
|
90
|
+
the reasoning at each gate spelled out. It publishes and writes nothing unless the
|
|
91
|
+
operator asks to keep what was built.
|
|
92
|
+
|
|
93
|
+
## Read the situation: new or existing, create or update
|
|
94
|
+
|
|
95
|
+
Work out two things from context before step 1, and say what you took them to be in one
|
|
96
|
+
line.
|
|
97
|
+
|
|
98
|
+
- **New or existing application.** Existing when there is application code where you
|
|
99
|
+
are running, or the operator names an application or a repository. An existing
|
|
100
|
+
application adds a column to every row: what the part is made from today.
|
|
101
|
+
- **Create or update.** Update when an inventory already exists.
|
|
102
|
+
|
|
103
|
+
**When in doubt about create or update, ask in one plain line with two options. Never
|
|
104
|
+
guess, and never change an earlier inventory on a guess.**
|
|
105
|
+
|
|
106
|
+
**Is there a desk?** One exists where a file named `desk.js` sets `window.desk` with a
|
|
107
|
+
`tabs` list. If so, read its Info tab and the head of this tab first: they say what is
|
|
108
|
+
ruled and how far the tab is. Read the Domain model, Frames and Signage tabs too: the
|
|
109
|
+
views come from the first, the parts from the second, and the third may rule a block out
|
|
110
|
+
(a sign the block cannot carry, a box the signage forbids). The page is the desk's
|
|
111
|
+
`blocks` tab: if it is new, add it to the list in `desk.js` and start its page from this
|
|
112
|
+
skill's `tab.json`; write the page under its head, set the head's state, and add what the
|
|
113
|
+
owner rules to Info. Nothing needs building. If there is no desk, the page stands alone,
|
|
114
|
+
as it always can.
|
|
115
|
+
|
|
116
|
+
## Every step is narrated: outcome, path, conclusion
|
|
117
|
+
|
|
118
|
+
Open every step by telling the operator what it is FOR and how you will get there. Close
|
|
119
|
+
it with what it established and what that means for the next step. One sentence each is
|
|
120
|
+
enough. The operator can only steer a step they saw coming.
|
|
121
|
+
|
|
122
|
+
Do:
|
|
123
|
+
|
|
124
|
+
> **Step 5, the verdicts.** The outcome is one verdict per row, with its reason. I read
|
|
125
|
+
> each candidate's guidance, stage and implementation against the need, and I bring you
|
|
126
|
+
> every row that is not a plain reuse.
|
|
127
|
+
>
|
|
128
|
+
> …
|
|
129
|
+
>
|
|
130
|
+
> So: 14 rows reuse a block as it is, 4 take a modifier, 3 stay in the application, and
|
|
131
|
+
> 2 are proposals. The proposals go to step 6.
|
|
132
|
+
|
|
133
|
+
Don't:
|
|
134
|
+
|
|
135
|
+
> Step 5: Mapped 23 blocks. 61% reuse.
|
|
136
|
+
|
|
137
|
+
## Asked about the skill: methodology and outcomes first
|
|
138
|
+
|
|
139
|
+
Asked what this skill does, give the method and the outcome before the list of steps:
|
|
140
|
+
|
|
141
|
+
> It lists what a product's views are made of, and reads each part against the design
|
|
142
|
+
> system's graph: what kind of block it is, which tier has one, how far that block is,
|
|
143
|
+
> and whether its guidance fits. Each part ends with a verdict and a reason. You end
|
|
144
|
+
> holding an inventory that says what to reuse, what to build, and what to propose.
|
|
145
|
+
|
|
146
|
+
## The ontology, read thoroughly
|
|
147
|
+
|
|
148
|
+
Everything this skill decides rests on the design system's ontology, under the `ds:`
|
|
149
|
+
prefix. Read it live before the first lookup, never from memory:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
pragma ontology list # the vocabularies and their prefixes
|
|
153
|
+
pragma ontology lookup ds --detail detailed
|
|
154
|
+
pragma block sample # real block records, to see their shape
|
|
155
|
+
pragma tier list
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
What follows is how the classes and properties are used here. The graph answers what
|
|
159
|
+
exists; this section says how to read it.
|
|
160
|
+
|
|
161
|
+
### The classes a row can take
|
|
162
|
+
|
|
163
|
+
Every row is one of the subclasses of `ds:UIBlock`. Choose by what the part does, not by
|
|
164
|
+
its size:
|
|
165
|
+
|
|
166
|
+
| Class | A row of this class |
|
|
167
|
+
|---|---|
|
|
168
|
+
| `ds:Layout` | The frame of a view: named regions and how they scroll. Holds no content of its own |
|
|
169
|
+
| `ds:Pattern` | Several blocks arranged to answer one recurring need, such as listing everything of a kind |
|
|
170
|
+
| `ds:Component` | One self-contained piece, usable on its own |
|
|
171
|
+
| `ds:Subcomponent` | A part that only makes sense inside its parent (`ds:parentComponent`); `ds:standalone` says when one may stand alone |
|
|
172
|
+
| `ds:Group` | A family of blocks documented together |
|
|
173
|
+
|
|
174
|
+
`ds:Modifier` and `ds:ModifierFamily` are not rows. They are how a block varies (size,
|
|
175
|
+
importance, density), and they are often the answer to "the block almost fits".
|
|
176
|
+
|
|
177
|
+
When a part could be argued into two classes, say so in the row, choose one, and list it
|
|
178
|
+
under what is least sure. A layout or a pattern, a component or a subcomponent: these
|
|
179
|
+
are real questions, and the operator rules them.
|
|
180
|
+
|
|
181
|
+
### What a block carries
|
|
182
|
+
|
|
183
|
+
Read these on every candidate, through `pragma block lookup --tier all <name>`:
|
|
184
|
+
|
|
185
|
+
| Property | What it tells this skill |
|
|
186
|
+
|---|---|
|
|
187
|
+
| `ds:name` | The display name. **Not unique**: several tiers can carry one name, as different blocks, even of different classes |
|
|
188
|
+
| `ds:tier` | Where the block lives, which decides who may use it (below) |
|
|
189
|
+
| `ds:summary`, `ds:usage`, `ds:guidelines` | Whether it fits. A name match is a candidate; only the usage and guidelines make it a fit |
|
|
190
|
+
| `ds:documentationStage` | How far the block is: a `ds:Tag` such as `needs:triage`, `needs:design`, `needs:core_documentation`, `docs:complete`, or `triaged:rejected` |
|
|
191
|
+
| `ds:hasModifierFamily` | The ways it may vary. A need covered by a modifier is a reuse, not a new block |
|
|
192
|
+
| `ds:hasProperty` | Its props (`ds:Property`: `ds:propertyType`, `ds:optional`, `ds:defaultValue`, `ds:constraints`). A need covered by a prop is a reuse |
|
|
193
|
+
| `ds:hasSubcomponent` | Its parts, each a `ds:Subcomponent` |
|
|
194
|
+
| `ds:variantOf`, `ds:hasVariant` | A named variant of another block |
|
|
195
|
+
| `ds:inheritsFrom`, `ds:specializedBy` | A block built on another, such as an icon button on a button |
|
|
196
|
+
| `ds:anatomyDsl`, `ds:anatomyClassic` | Its anatomy, to compare with the part's own |
|
|
197
|
+
| `ds:hasTokenBinding` | The tokens it consumes, to check against the signage |
|
|
198
|
+
| `ds:changeLog` | Why it is the way it is; read it before arguing with a block |
|
|
199
|
+
|
|
200
|
+
A layout carries more: `ds:grid` and `ds:gridAreas` (its regions), `ds:domain` (the
|
|
201
|
+
category of content it organises, in the graph's own words) and `ds:targetDevices`.
|
|
202
|
+
Compare a view's regions with them before calling a layout a fit.
|
|
203
|
+
|
|
204
|
+
### Tags: the stage of a block
|
|
205
|
+
|
|
206
|
+
Tags (`ds:Tag`, each in a `ds:TagCategory`) say how far a block is and what was decided
|
|
207
|
+
about it. List them live:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
pragma graph query "SELECT ?category ?tag ?when WHERE { ?t a ds:Tag ; ds:name ?tag ; ds:category ?c . ?c ds:name ?category . OPTIONAL { ?t ds:whenToApply ?when } } ORDER BY ?category ?tag"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Read the stage into the verdict:
|
|
214
|
+
|
|
215
|
+
- **`triaged:rejected`**: the design system decided against this block. Do not reuse
|
|
216
|
+
it, and do not propose it again without new evidence. Say so in the row.
|
|
217
|
+
- **`needs:triage`, `needs:design`, `triaged:backlog`**: the block is a name with a
|
|
218
|
+
promise. Reusing it means adopting something unproven; say "unproven" in the row.
|
|
219
|
+
- **`needs:core_documentation`, `needs:full_documentation`**: it exists and is usable,
|
|
220
|
+
with gaps in its guidance. Read what there is.
|
|
221
|
+
- **`docs:complete`**: reviewed and accepted.
|
|
222
|
+
- **Channels (`edge`, `beta`, `candidate`, `stable`)** and the implementation tags say
|
|
223
|
+
how safe it is to depend on.
|
|
224
|
+
|
|
225
|
+
### Tiers: who may use what
|
|
226
|
+
|
|
227
|
+
A block's tier decides who may use it. `pragma tier list` gives the tiers. They form a
|
|
228
|
+
tree read from the name: `global` above all, `apps` under it for applications, and
|
|
229
|
+
`apps_<product>` under `apps` for one product. `documentation` and `sites` are separate
|
|
230
|
+
branches. A read scoped to a tier answers that tier and its ancestors.
|
|
231
|
+
|
|
232
|
+
For a product in `apps_<product>`, the order of preference is:
|
|
233
|
+
|
|
234
|
+
1. **The product's own tier and its ancestors** (`apps_<product>`, `apps`, `global`).
|
|
235
|
+
These are the product's to use.
|
|
236
|
+
2. **A sibling tier** (another product's `apps_<other>`). Usable, labelled "borrowed
|
|
237
|
+
from `<tier>`", and listed as a candidate to move to a shared tier.
|
|
238
|
+
3. **Another branch** (`documentation`, `sites`). Only for a part that truly is that
|
|
239
|
+
kind of thing, and labelled as borrowed.
|
|
240
|
+
|
|
241
|
+
A product with no tier of its own yet is common. Then its own blocks have nowhere ruled
|
|
242
|
+
to live: write "tier to be ruled" in those rows and bring it to gate 2. Creating a tier is
|
|
243
|
+
the design system's decision, not this skill's.
|
|
244
|
+
|
|
245
|
+
### Implementations: can the product use it today
|
|
246
|
+
|
|
247
|
+
A block in the graph is a specification. Whether the product can import it is a separate
|
|
248
|
+
question, answered by the implementation tools, not by a join of your own:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
pragma implementation libraries # the libraries, their platform, tier and version
|
|
252
|
+
pragma implementation list --search <name> # which library implements a block, and its source
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Record, per reused block, the library and platform that implement it, or "no
|
|
256
|
+
implementation for <platform>". A block with no implementation in the product's framework
|
|
257
|
+
is still the right design answer; the row says the product builds it to the block's
|
|
258
|
+
specification until the design system ships it.
|
|
259
|
+
|
|
260
|
+
### Reading a lookup without being fooled
|
|
261
|
+
|
|
262
|
+
- **A name fans out across tiers.** `pragma block lookup --tier all <name>` answers one
|
|
263
|
+
full writeup per tier that carries the name, each under its own heading with its own
|
|
264
|
+
`- Tier:` line. Read every one. The same name can be a component in one tier and a
|
|
265
|
+
rejected pattern in another. Without `--tier`, a lookup reads only the top-level
|
|
266
|
+
tiers, and a sibling product's block stays hidden.
|
|
267
|
+
- **Address one block by its IRI** once you know which: `pragma graph inspect <IRI>`
|
|
268
|
+
prints everything recorded about it.
|
|
269
|
+
- **Scope to the product's tier** to see what it may use: `pragma block list --tier
|
|
270
|
+
apps_<product>`. Use `--tier all` to see everything, including siblings.
|
|
271
|
+
- **A lookup that prints only a tier is not an error**: that block is a name with no
|
|
272
|
+
guidance yet. Treat it as unproven.
|
|
273
|
+
- **If a read answers `STORE_UNAVAILABLE`**, run `pragma sources update` in that folder
|
|
274
|
+
first.
|
|
275
|
+
|
|
276
|
+
> The covered set is whatever the graph answers today. Query it live. Never copy its
|
|
277
|
+
> output into documentation, PRs, or this skill.
|
|
278
|
+
|
|
279
|
+
Queries this skill uses, beyond the lookups:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Every block, with its class, tier and stage
|
|
283
|
+
pragma graph query "SELECT ?name ?class ?tier ?stage WHERE { ?b a ?class ; ds:name ?name ; ds:tier ?t . ?t ds:name ?tier . OPTIONAL { ?b ds:documentationStage ?s . ?s ds:name ?stage } FILTER(?class IN (ds:Layout, ds:Pattern, ds:Component, ds:Subcomponent, ds:Group)) } ORDER BY ?class ?name"
|
|
284
|
+
|
|
285
|
+
# Names that several blocks share, and where
|
|
286
|
+
pragma graph query "SELECT ?name (COUNT(DISTINCT ?b) AS ?blocks) (GROUP_CONCAT(DISTINCT ?tier; separator=', ') AS ?tiers) WHERE { ?b ds:name ?name ; ds:tier ?t . ?t ds:name ?tier } GROUP BY ?name HAVING (COUNT(DISTINCT ?b) > 1)"
|
|
287
|
+
|
|
288
|
+
# Layouts, with their regions and the content they organise
|
|
289
|
+
pragma graph query "SELECT ?name ?tier ?grid ?areas ?domain ?devices WHERE { ?l a ds:Layout ; ds:name ?name ; ds:tier ?t . ?t ds:name ?tier . OPTIONAL { ?l ds:grid ?grid } OPTIONAL { ?l ds:gridAreas ?areas } OPTIONAL { ?l ds:domain ?domain } OPTIONAL { ?l ds:targetDevices ?devices } }"
|
|
290
|
+
|
|
291
|
+
# Blocks built on others: variants, and specialisations
|
|
292
|
+
pragma graph query "SELECT ?name ?relation ?other WHERE { ?b ds:name ?name ; ?relation ?o . ?o ds:name ?other . VALUES ?relation { ds:variantOf ds:inheritsFrom } }"
|
|
293
|
+
|
|
294
|
+
# A component's parts
|
|
295
|
+
pragma graph query "SELECT ?part ?standalone WHERE { ?s a ds:Subcomponent ; ds:name ?part ; ds:parentComponent ?p . ?p ds:name '<Component>' . OPTIONAL { ?s ds:standalone ?standalone } }"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## The verdicts
|
|
299
|
+
|
|
300
|
+
Every row ends in one verdict. They are listed from the cheapest for the product to the
|
|
301
|
+
dearest, but the first that fits is taken, not the first on the list:
|
|
302
|
+
|
|
303
|
+
| Verdict | When | What the row records |
|
|
304
|
+
|---|---|---|
|
|
305
|
+
| **Reuse** | A block in the product's tier or an ancestor fits by its usage and guidelines | The block's IRI, its stage, its implementation |
|
|
306
|
+
| **Reuse with a modifier or a prop** | It fits once a modifier or a property is set | Which modifier or property, and its value |
|
|
307
|
+
| **Compose** | No block fits, but existing blocks arranged in the view answer it, and the arrangement is not recurring | The blocks used; nothing to propose |
|
|
308
|
+
| **Borrow** | A block in a sibling tier fits | "Borrowed from `<tier>`", and a note to move it to a shared tier |
|
|
309
|
+
| **Extend** | A block almost fits, and the gap is a variant (`ds:variantOf`) or a specialisation (`ds:inheritsFrom`) | The gap in one sentence, and who would own the variant |
|
|
310
|
+
| **Keep in the application** | The part is the product's own: used in one product, often in one view | Why it is the product's own; no proposal |
|
|
311
|
+
| **Propose** | The part recurs, and the design system has nothing that fits | The tier it would live in, and the handover to `specify-component` or `specify-pattern` |
|
|
312
|
+
| **Not a block** | The part is plain HTML, data, or a rule, not a piece of interface | What it becomes instead |
|
|
313
|
+
|
|
314
|
+
Rules that keep the balance:
|
|
315
|
+
|
|
316
|
+
- **A name match is a candidate, not a fit.** Read the usage and guidelines. When they
|
|
317
|
+
exclude the case, the block is not reused, whatever its name.
|
|
318
|
+
- **Do not force a block onto a need.** A block bent out of its guidelines costs more
|
|
319
|
+
than a small part of the product's own.
|
|
320
|
+
- **Do not create what a modifier covers.** Before any new block, check the candidate's
|
|
321
|
+
modifier families and properties.
|
|
322
|
+
- **Propose only what recurs.** A part proposed to a shared tier needs a second product
|
|
323
|
+
that would use it. A part proposed to the product's own tier needs a second view. Until
|
|
324
|
+
then it is kept in the application, and the row says what would make it a proposal.
|
|
325
|
+
- **The signage can rule a block out.** When a desk's signage forbids what a block does
|
|
326
|
+
(a box, a second text size, a colour used as a sign), the row says which rule, and the
|
|
327
|
+
verdict moves down.
|
|
328
|
+
- **Not everything is a block.** One wrapper per kind of thing is usually data (a rule
|
|
329
|
+
that picks how a kind is shown), not a block per kind. A heading is an HTML element.
|
|
330
|
+
Say what the part becomes.
|
|
331
|
+
- **The application never waits.** A proposal is a suggestion to the design system. The
|
|
332
|
+
product builds its part meanwhile, to the specification it proposes.
|
|
333
|
+
|
|
334
|
+
## The output
|
|
335
|
+
|
|
336
|
+
The inventory sits on the desk's `blocks` tab, or on a page of its own. With the
|
|
337
|
+
recommended form, its data is `blocks.json` beside the page, and the page embeds a copy
|
|
338
|
+
of it, the way the Journeys tab embeds `journeys.json`.
|
|
339
|
+
|
|
340
|
+
```json
|
|
341
|
+
{
|
|
342
|
+
"product": "",
|
|
343
|
+
"tier": { "name": "", "ruled": false },
|
|
344
|
+
"made": { "date": "", "from": [""], "read": "what was read, and what was not" },
|
|
345
|
+
"rows": [{
|
|
346
|
+
"id": "",
|
|
347
|
+
"class": "ds:Layout | ds:Pattern | ds:Component | ds:Subcomponent",
|
|
348
|
+
"name": "",
|
|
349
|
+
"need": "one sentence",
|
|
350
|
+
"views": [""],
|
|
351
|
+
"madeFrom": [""],
|
|
352
|
+
"candidates": [{ "iri": "", "tier": "", "stage": "", "implementation": "" }],
|
|
353
|
+
"verdict": "reuse | modifier | compose | borrow | extend | keep | propose | not-a-block",
|
|
354
|
+
"reason": "",
|
|
355
|
+
"status": "not reviewed"
|
|
356
|
+
}],
|
|
357
|
+
"data": [{ "what": "", "becomes": "" }],
|
|
358
|
+
"leastSure": [""]
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
The page shows, in this order:
|
|
363
|
+
|
|
364
|
+
1. **How this list was made**: the date, what it was built from, which queries were run,
|
|
365
|
+
and what was not read. A row classified from a name and a one-line description says
|
|
366
|
+
so.
|
|
367
|
+
2. **The classes**: one line each for the classes the rows use, in this product's words.
|
|
368
|
+
3. **Totals**: rows per class, and per verdict.
|
|
369
|
+
4. **The rows**, grouped by class: layouts, then patterns, then components and their
|
|
370
|
+
subcomponents.
|
|
371
|
+
5. **What becomes data, not blocks.**
|
|
372
|
+
6. **What is least sure.**
|
|
373
|
+
|
|
374
|
+
A view's layout is decided by `desk-model-domains`. This skill copies it into its layout
|
|
375
|
+
rows, checks it against `ds:grid` and `ds:gridAreas`, and sends a disagreement back to
|
|
376
|
+
that skill rather than changing the view.
|
|
377
|
+
|
|
378
|
+
Where the output is committed, that repository's rules and the `git` standards apply
|
|
379
|
+
(`pragma standard categories` lists the current set).
|
|
380
|
+
|
|
381
|
+
## The seven steps
|
|
382
|
+
|
|
383
|
+
### 1. Start from the views
|
|
384
|
+
|
|
385
|
+
Read the views, their layouts and their questions from the Domain model tab or the views
|
|
386
|
+
table. Read the frames when they exist: they show what each view is made of. For an
|
|
387
|
+
existing application, list its component folders too, with what each one renders.
|
|
388
|
+
|
|
389
|
+
If there are no views, stop and go to `desk-model-domains`. Do not invent views here.
|
|
390
|
+
|
|
391
|
+
Outcome gate: **the views are in hand, with their layouts; for an existing application,
|
|
392
|
+
its components are listed.**
|
|
393
|
+
|
|
394
|
+
### 2. The product's tier
|
|
395
|
+
|
|
396
|
+
Find where the product sits in the design system: `pragma tier list`, then
|
|
397
|
+
`pragma block list --tier apps_<product>` if it has a tier. Say which tiers the product
|
|
398
|
+
may use (its own and its ancestors), and which are siblings.
|
|
399
|
+
|
|
400
|
+
If the product has no tier, say so, and ask the operator where its own blocks would
|
|
401
|
+
live. "To be ruled" is an answer.
|
|
402
|
+
|
|
403
|
+
Outcome gate: **the product's tier is named, or recorded as to be ruled.**
|
|
404
|
+
|
|
405
|
+
### 3. Read the design system
|
|
406
|
+
|
|
407
|
+
Run the ontology lookups and the queries above, and read the tags. Read the whole list of
|
|
408
|
+
blocks the product may use, not only the names you expect to need. A block you did not
|
|
409
|
+
know about is the reason to read it.
|
|
410
|
+
|
|
411
|
+
Outcome gate: **the classes, tags and tiers are read live, and the list of blocks the
|
|
412
|
+
product may use is in hand.**
|
|
413
|
+
|
|
414
|
+
### 4. List the parts
|
|
415
|
+
|
|
416
|
+
Walk the views, one at a time. For each, write its layout, then the patterns in it, then
|
|
417
|
+
the components, then the subcomponents worth naming. Give each part its class, its need
|
|
418
|
+
in one sentence, and the views it appears in. A part in several views is one row.
|
|
419
|
+
|
|
420
|
+
For an existing application, write what each part is made from today. Several of today's
|
|
421
|
+
components often make one part; one component sometimes makes several.
|
|
422
|
+
|
|
423
|
+
Outcome gate: **every view's parts are rows; every row has a class, a need and its
|
|
424
|
+
views.**
|
|
425
|
+
|
|
426
|
+
### 5. The verdicts
|
|
427
|
+
|
|
428
|
+
For each row, look the candidates up: by name, by what the need is called in other
|
|
429
|
+
words, and by browsing the class in the product's tiers. Read each candidate in full:
|
|
430
|
+
tier, stage, usage, guidelines, modifiers, properties, subcomponents, variants,
|
|
431
|
+
implementation. Then give the verdict and its reason.
|
|
432
|
+
|
|
433
|
+
Bring every row that is not a plain reuse to the operator, one at a time. A reuse that
|
|
434
|
+
depends on an unproven block is brought too.
|
|
435
|
+
|
|
436
|
+
Outcome gate: **every row has a verdict and a reason; the operator has ruled on every row
|
|
437
|
+
that is not a plain reuse.**
|
|
438
|
+
|
|
439
|
+
### 6. Proposals
|
|
440
|
+
|
|
441
|
+
For each row with the verdict "propose", write a short proposal: its class, its purpose
|
|
442
|
+
in one sentence, the views and products that need it, its tier, the closest existing
|
|
443
|
+
block and why it does not fit. Its full specification is then written with
|
|
444
|
+
`specify-component` or `specify-pattern`. Never write into the design system's `data/`.
|
|
445
|
+
|
|
446
|
+
A proposal that is a variant or a specialisation of an existing block names that block
|
|
447
|
+
and the relation (`ds:variantOf` or `ds:inheritsFrom`).
|
|
448
|
+
|
|
449
|
+
Outcome gate: **the operator has seen every proposal; each is handed over or kept in the
|
|
450
|
+
application.**
|
|
451
|
+
|
|
452
|
+
### 7. Write the inventory
|
|
453
|
+
|
|
454
|
+
Write the page and its data. Read every outcome gate again against the rows. Fill "How
|
|
455
|
+
this list was made" and "What is least sure" honestly: what was guessed is said to be
|
|
456
|
+
guessed.
|
|
457
|
+
|
|
458
|
+
Outcome gate: **the inventory is written; every row is in exactly one class with one
|
|
459
|
+
verdict.**
|
|
460
|
+
|
|
461
|
+
## Running as an update
|
|
462
|
+
|
|
463
|
+
The inventory rests on the views and on the design system. Either can move.
|
|
464
|
+
|
|
465
|
+
**Start every update by finding what moved.** Run the queries again and compare: a block
|
|
466
|
+
that reached a new stage, a block that appeared in the product's tiers, a block
|
|
467
|
+
implemented in the product's framework, a block rejected. Compare the views too: a view
|
|
468
|
+
added, cut or changed. Tell the operator what you found before changing anything.
|
|
469
|
+
|
|
470
|
+
| What changed | What to do |
|
|
471
|
+
|---|---|
|
|
472
|
+
| A view was added | List its parts (step 4); most will already be rows |
|
|
473
|
+
| A view was cut | Look at each row only it used. Mark it deferred; nothing is removed silently |
|
|
474
|
+
| A block appeared that fits a "keep" or "propose" row | Bring the row back to the operator: reuse is now possible, not required |
|
|
475
|
+
| A reused block was rejected or changed | Bring the row back with what changed |
|
|
476
|
+
| A proposal was accepted into the design system | The row becomes a reuse, with the new block's IRI |
|
|
477
|
+
| A part now recurs in a second view or product | Its "keep" may become a "propose" |
|
|
478
|
+
|
|
479
|
+
A changed or new row is marked, with the date of the round.
|
|
480
|
+
|
|
481
|
+
## Response format
|
|
482
|
+
|
|
483
|
+
```markdown
|
|
484
|
+
Situation: <new | existing> application, <create | update>
|
|
485
|
+
Tier: <apps_product | to be ruled>; may use: <tiers>
|
|
486
|
+
Output: <form> at <place>
|
|
487
|
+
|
|
488
|
+
- [ ] 1. Views read: <n> views, <n> layouts (<n> components today)
|
|
489
|
+
- [ ] 2. Tier: <name | to be ruled>
|
|
490
|
+
- [ ] 3. Design system read: <n> blocks the product may use
|
|
491
|
+
- [ ] 4. Parts: <n> layouts, <n> patterns, <n> components, <n> subcomponents
|
|
492
|
+
- [ ] 5. Verdicts: <n> reuse, <n> modifier, <n> compose, <n> borrow, <n> extend, <n> keep, <n> propose, <n> not a block
|
|
493
|
+
- [ ] 6. Proposals: <n> handed to specify-component or specify-pattern
|
|
494
|
+
- [ ] 7. Written; least sure: …
|
|
495
|
+
|
|
496
|
+
On an update, what moved: …
|
|
497
|
+
Rows sent back to desk-model-domains: …
|
|
498
|
+
Judgment calls made without the operator: …
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
## Worked example: the adoption tracker
|
|
502
|
+
|
|
503
|
+
This continues the example of `desk-model-domains`: Apps, Components and Runs, with one
|
|
504
|
+
usages list shown pre-filtered in three places, and two views that found no layout in the
|
|
505
|
+
graph, a report and an explorer.
|
|
506
|
+
|
|
507
|
+
The design system below is described as the tutorial supposes it. In a real run, query
|
|
508
|
+
it: the lesson is the reading, not the answers.
|
|
509
|
+
|
|
510
|
+
**Step 2.** The tracker has no tier of its own. It may use `apps` and `global`. Its own
|
|
511
|
+
blocks are "tier to be ruled", and the operator rules that they stay in the application
|
|
512
|
+
until a second product wants one.
|
|
513
|
+
|
|
514
|
+
**Step 4 and 5, a few rows:**
|
|
515
|
+
|
|
516
|
+
| Row | Class | Verdict | Why |
|
|
517
|
+
|---|---|---|---|
|
|
518
|
+
| Apps list, components list, runs list | `ds:Layout` | Reuse, unproven | A list page layout in `apps` fits by name and regions; its stage is `needs:triage`, so the row says "unproven" |
|
|
519
|
+
| One app, one component, one run | `ds:Layout` | Reuse | A view layout in `apps` whose `ds:domain` is a view |
|
|
520
|
+
| Report | `ds:Layout` | Keep | Nothing fits; one view needs it. Proposed if a second view or product does |
|
|
521
|
+
| Usages list | `ds:Pattern` | Reuse | A data list pattern in `apps` answers "list, filter, sort, count" by its usage |
|
|
522
|
+
| A run's facts | `ds:Pattern` | Not a block | The lookup for a description list answers twice: a component in a sibling product's tier, and a pattern in `global` tagged `triaged:rejected`. The rejected one is not reused; the borrowed one is more than the need. A plain `<dl>` does the job |
|
|
523
|
+
| An app's status | `ds:Component` | Reuse with a modifier | A badge in `global`; its importance modifier carries pass or fail, so no new block |
|
|
524
|
+
| Usage bar | `ds:Component` | Keep | One view, one product. Not proposed |
|
|
525
|
+
| One card per app and per component | `ds:Component` | Not a block | Two wrappers for two kinds are one card and a rule that picks what it shows |
|
|
526
|
+
|
|
527
|
+
**What the tutorial should bring out:**
|
|
528
|
+
|
|
529
|
+
- **The fan-out.** The description list is the lesson: one name, two tiers, two classes,
|
|
530
|
+
and one of them rejected. A name match was never a fit.
|
|
531
|
+
- **The modifier.** The status badge was nearly a new component, until its modifier
|
|
532
|
+
families were read.
|
|
533
|
+
- **Keeping is a verdict.** The usage bar and the report stay in the application, with
|
|
534
|
+
what would make them proposals. Nobody is blocked.
|
|
535
|
+
- **Data, not blocks.** A wrapper per kind looks like many components and is one rule.
|
|
536
|
+
|
|
537
|
+
## Related skills
|
|
538
|
+
|
|
539
|
+
- `desk-model-domains`: what comes first; its views and layouts are this skill's input
|
|
540
|
+
- `desk-draw-frames`: the frames show what each view is made of
|
|
541
|
+
- `desk-design-signage`: its rules can rule a block out
|
|
542
|
+
- `specify-component` and `specify-pattern`: where a proposal is specified in full
|
|
543
|
+
- `desk-assemble`: gives the page its tab when the product has a desk
|
|
544
|
+
|
|
545
|
+
## Support
|
|
546
|
+
|
|
547
|
+
If this skill leads somewhere broken (a command that errors, guidance that contradicts
|
|
548
|
+
what the live system answers, a gap the flow cannot cover) you are not stuck:
|
|
549
|
+
|
|
550
|
+
- Raise an issue in the pragma-core repo: https://github.com/canonical/pragma-core/issues,
|
|
551
|
+
with the skill name, what was run, and expected vs. actual outcome.
|
|
552
|
+
- Or contact the design-system team owners directly through your organization's
|
|
553
|
+
professional messaging channels for assistance.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../desk-assemble/tab.schema.json",
|
|
3
|
+
"id": "blocks",
|
|
4
|
+
"title": "Blocks",
|
|
5
|
+
"file": "blocks.html",
|
|
6
|
+
"rank": 38,
|
|
7
|
+
"kind": "shared",
|
|
8
|
+
"purpose": "The layouts, patterns and components the product's views need, each read against the design system: what it reuses, what it adds of its own, what it proposes, and why.",
|
|
9
|
+
"filledFrom": "the views on the Domain model tab, the frames, and the design-system graph",
|
|
10
|
+
"empty": {
|
|
11
|
+
"headline": "No blocks yet.",
|
|
12
|
+
"until": "The list starts once the Domain model names the views: each view's parts are read off it, then looked up in the design system."
|
|
13
|
+
},
|
|
14
|
+
"rules": [
|
|
15
|
+
"A block is reused when its usage and guidelines fit the need. A name match alone is a candidate, not a fit.",
|
|
16
|
+
"Keeping a part in the application is a verdict, not a failure. The application never waits on the design system.",
|
|
17
|
+
"A part is proposed to a shared tier only when a second product needs it, and to the product's own tier only when a second view does."
|
|
18
|
+
]
|
|
19
|
+
}
|