@canonical/design-system 0.2.2 → 0.2.4
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/data/concept/Foundations-Grid.ttl +9 -0
- package/data/concept/How-to-differentiate-components-variantsinheritance.ttl +9 -0
- package/data/concept/Indicating-required-fields-in-forms.ttl +9 -0
- package/data/concept/Question-mark-vs-information-icon.ttl +9 -0
- package/data/concepttype/Decision-guide.ttl +5 -0
- package/data/concepttype/Explanation.ttl +5 -0
- package/data/concepttype/How-to-guide.ttl +5 -0
- package/data/concepttype/Mental-model.ttl +5 -0
- package/data/concepttype/Reference.ttl +5 -0
- package/data/concepttype/Tutorial.ttl +5 -0
- package/definitions/ontology.ttl +35 -0
- package/package.json +1 -1
- package/skills/adoption-a1-styles/SKILL.md +111 -1
- package/skills/adoption-a2-components/SKILL.md +106 -1
- package/skills/adoption-a3-forms/SKILL.md +106 -1
- package/skills/anatomy-author/SKILL.md +102 -1
- package/skills/design-auditor/SKILL.md +100 -1
- package/skills/implement-component/SKILL.md +90 -1
- package/skills/specify-component/SKILL.md +100 -1
- package/skills/specify-pattern/SKILL.md +101 -1
- package/source.json +36 -1
- package/src/config/source.schema.json +27 -0
- package/src/config/types.ts +25 -0
- package/src/transform/rowFilter.tests.ts +100 -0
- package/src/transform/rowFilter.ts +55 -0
- package/src/transform/transform.ts +7 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: anatomy-author
|
|
3
|
-
description: Write component anatomy specifications using the Design System Anatomy DSL
|
|
3
|
+
description: Write component anatomy specifications using the Design System Anatomy DSL; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Anatomy Author
|
|
@@ -52,6 +52,107 @@ installed skill folder — `pragma skill lookup anatomy-author` renders only thi
|
|
|
52
52
|
SKILL.md, so open the sibling file directly when you need the complete spec (the
|
|
53
53
|
appendix below carries its type system).
|
|
54
54
|
|
|
55
|
+
## Opening move: ask, or offer the tutorial
|
|
56
|
+
|
|
57
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
58
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
59
|
+
form to fill in:
|
|
60
|
+
|
|
61
|
+
> To get started, tell me the component whose anatomy we're writing — a name if it is
|
|
62
|
+
> already in the graph, or just a sketch of its parts, like "a card with an image, a
|
|
63
|
+
> title and a row of actions".
|
|
64
|
+
|
|
65
|
+
A sketch is enough to begin: discovery turns it into the real node set, and the sketch
|
|
66
|
+
is what you check that set against. Ask again only for what the next step genuinely
|
|
67
|
+
blocks on.
|
|
68
|
+
|
|
69
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
70
|
+
you took it to be, and go.
|
|
71
|
+
|
|
72
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
73
|
+
|
|
74
|
+
> Or if you'd rather see the flow first, I can run it as a tutorial: I'll take a
|
|
75
|
+
> plausible example — a card, say — and walk you through it from discovery to the
|
|
76
|
+
> emitted anatomy.
|
|
77
|
+
|
|
78
|
+
Tutorial mode is the step narration below, turned up: the same outcome-path-conclusion
|
|
79
|
+
frame, with the reasoning at each decision gate made fully explicit and a check that
|
|
80
|
+
the person is with you before the next step. Stop short of anything that lands — no
|
|
81
|
+
anatomy written into the graph, no file committed — unless they ask to keep what you
|
|
82
|
+
built.
|
|
83
|
+
|
|
84
|
+
## Every step is narrated: outcome, path, conclusion
|
|
85
|
+
|
|
86
|
+
Every step is addressed to the person — once before it runs, once when it ends. This is
|
|
87
|
+
not tutorial manner. It holds in the ordinary flow too: the person is the design
|
|
88
|
+
authority, and they can only steer a step they saw coming. A decision gate met cold is
|
|
89
|
+
a decision they cannot really make.
|
|
90
|
+
|
|
91
|
+
**Open** the step with what it is FOR — the outcome it should leave behind — and how
|
|
92
|
+
you are about to get there. **Close** it with a sentence saying what it established and
|
|
93
|
+
what that means for the step after. One sentence each is enough; the failure mode is
|
|
94
|
+
silence, not length, and a step whose outcome looks obvious still gets its sentence
|
|
95
|
+
rather than a shrug.
|
|
96
|
+
|
|
97
|
+
Do:
|
|
98
|
+
|
|
99
|
+
> **Discovery, before any DSL.** The outcome is the component's real context — what it
|
|
100
|
+
> is composed of, and what already names its parts — so the anatomy describes the
|
|
101
|
+
> system instead of inventing beside it. The path is `pragma block lookup Card`, then
|
|
102
|
+
> the subcomponent query below.
|
|
103
|
+
>
|
|
104
|
+
> …
|
|
105
|
+
>
|
|
106
|
+
> So: Card already carries a named `Card-Header` subcomponent and no named body — the
|
|
107
|
+
> anatomy inherits the first and has to decide the second, which is the first
|
|
108
|
+
> structural gate.
|
|
109
|
+
|
|
110
|
+
Don't:
|
|
111
|
+
|
|
112
|
+
> Discovery
|
|
113
|
+
>
|
|
114
|
+
> Card exists. Has Card-Header. No body node.
|
|
115
|
+
|
|
116
|
+
Both carry the same facts. Only the first says what the step was trying to achieve and
|
|
117
|
+
what it settled — and only the first lets the person cut in with the thing they know
|
|
118
|
+
and the graph does not, which is the whole reason they are here.
|
|
119
|
+
|
|
120
|
+
## Asked about the skill: methodology and outcomes first
|
|
121
|
+
|
|
122
|
+
A question about what this skill does — what it covers, what its steps are, how it
|
|
123
|
+
works — is answered in that order: the METHOD it applies and the OUTCOMES it leaves
|
|
124
|
+
the person holding come first, the step-by-step breakdown comes after.
|
|
125
|
+
|
|
126
|
+
Two or three sentences of method is enough: what the skill treats as its object, the
|
|
127
|
+
discipline that makes it work, and what exists at the end that did not exist before.
|
|
128
|
+
The enumeration then reads as steps in service of something, rather than as a list to
|
|
129
|
+
be got through.
|
|
130
|
+
|
|
131
|
+
What this prevents is a table of contents standing in for an answer. A reply opening
|
|
132
|
+
with the step names tells someone who already knows the skill nothing new, and someone
|
|
133
|
+
who does not, nothing at all.
|
|
134
|
+
|
|
135
|
+
So, asked what this skill is:
|
|
136
|
+
|
|
137
|
+
> It writes component anatomies in the Anatomy DSL, combining semantic discovery —
|
|
138
|
+
> understanding what the graph already names — with procedural authoring. The
|
|
139
|
+
> structural choices are the substance: node boundaries, cardinality, and slot names,
|
|
140
|
+
> which become API surface. You end holding a well-formed anatomy whose every
|
|
141
|
+
> deliberate decision is one someone can revisit.
|
|
142
|
+
|
|
143
|
+
Then, and only then, the breakdown.
|
|
144
|
+
|
|
145
|
+
## Anatomy falls under standards too
|
|
146
|
+
|
|
147
|
+
Emitted anatomy is Turtle, and Turtle has standards — the `turtle` category, with
|
|
148
|
+
`ui-blocks` governing block modelling (take the actual set from
|
|
149
|
+
`pragma standard categories`, not from this list). Pull them before authoring and hold
|
|
150
|
+
the Do/Don't pairs open while writing the DSL and its emitted TTL; a deviation from a
|
|
151
|
+
pulled standard is RECORDED next to the anatomy, ideally also filed as an issue. The
|
|
152
|
+
standards apply independent of any package dependency and are open to contribution:
|
|
153
|
+
a missing or wrong modelling rule is something to propose a change for, not to
|
|
154
|
+
silently work around.
|
|
155
|
+
|
|
55
156
|
## Discovery Flow
|
|
56
157
|
|
|
57
158
|
Before writing an anatomy, understand the component's context:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-auditor
|
|
3
|
-
description: Audit design system coverage, consistency, and quality
|
|
3
|
+
description: Audit design system coverage, consistency, and quality; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Design Auditor
|
|
@@ -52,6 +52,92 @@ Decision gates — in collaboration, pause at each and resolve it WITH the perso
|
|
|
52
52
|
- Fixing what the audit finds — route gaps to `specify-component`/`specify-pattern`,
|
|
53
53
|
missing anatomies to `anatomy-author`
|
|
54
54
|
|
|
55
|
+
## Opening move: ask, or offer the tutorial
|
|
56
|
+
|
|
57
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
58
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
59
|
+
form to fill in:
|
|
60
|
+
|
|
61
|
+
> To get started, tell me what you'd like audited — the whole system, one tier, or
|
|
62
|
+
> just the worry, like "I think our modifier families have drifted".
|
|
63
|
+
|
|
64
|
+
The worry is the most useful of the three: it says which dimensions to run and which
|
|
65
|
+
numbers actually matter to the team. Ask again only for what the next step genuinely
|
|
66
|
+
blocks on.
|
|
67
|
+
|
|
68
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
69
|
+
you took it to be, and go.
|
|
70
|
+
|
|
71
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
72
|
+
|
|
73
|
+
> Or if you'd rather see how an audit works first, I can run it as a tutorial: I'll
|
|
74
|
+
> take one dimension — documentation coverage, say — and walk you through it end to
|
|
75
|
+
> end on the live graph.
|
|
76
|
+
|
|
77
|
+
Tutorial mode is the step narration below, turned up: the same outcome-path-conclusion
|
|
78
|
+
frame, with the reasoning at each decision gate made fully explicit and a check that
|
|
79
|
+
the person is with you before the next step. Stop short of anything that lands — no
|
|
80
|
+
report filed, no issues opened — unless they ask to keep what you built.
|
|
81
|
+
|
|
82
|
+
## Every step is narrated: outcome, path, conclusion
|
|
83
|
+
|
|
84
|
+
Every step is addressed to the person — once before it runs, once when it ends. This is
|
|
85
|
+
not tutorial manner. It holds in the ordinary flow too: the person is the design
|
|
86
|
+
authority, and they can only steer a step they saw coming. A decision gate met cold is
|
|
87
|
+
a decision they cannot really make.
|
|
88
|
+
|
|
89
|
+
**Open** the step with what it is FOR — the outcome it should leave behind — and how
|
|
90
|
+
you are about to get there. **Close** it with a sentence saying what it established and
|
|
91
|
+
what that means for the step after. One sentence each is enough; the failure mode is
|
|
92
|
+
silence, not length, and a step whose outcome looks obvious still gets its sentence
|
|
93
|
+
rather than a shrug.
|
|
94
|
+
|
|
95
|
+
Do:
|
|
96
|
+
|
|
97
|
+
> **Documentation coverage, the first dimension.** The outcome is a count you can act
|
|
98
|
+
> on: which blocks carry a summary, usage and anatomy, and which are entries in name
|
|
99
|
+
> only. The path is the coverage query below, run per tier so a young tier is not
|
|
100
|
+
> scored against a mature one.
|
|
101
|
+
>
|
|
102
|
+
> …
|
|
103
|
+
>
|
|
104
|
+
> So: 12 of 87 blocks are undocumented and 9 of those sit in one tier — a tier-shaped
|
|
105
|
+
> problem rather than a system-wide one, which changes what the recommendation should
|
|
106
|
+
> say.
|
|
107
|
+
|
|
108
|
+
Don't:
|
|
109
|
+
|
|
110
|
+
> Coverage: 75/87 documented (86%). 12 missing.
|
|
111
|
+
|
|
112
|
+
Both carry the same facts. Only the first says what the step was trying to achieve and
|
|
113
|
+
what it settled — and only the first lets the person cut in with the thing they know
|
|
114
|
+
and the graph does not, which is the whole reason they are here.
|
|
115
|
+
|
|
116
|
+
## Asked about the skill: methodology and outcomes first
|
|
117
|
+
|
|
118
|
+
A question about what this skill does — what it covers, what its steps are, how it
|
|
119
|
+
works — is answered in that order: the METHOD it applies and the OUTCOMES it leaves
|
|
120
|
+
the person holding come first, the step-by-step breakdown comes after.
|
|
121
|
+
|
|
122
|
+
Two or three sentences of method is enough: what the skill treats as its object, the
|
|
123
|
+
discipline that makes it work, and what exists at the end that did not exist before.
|
|
124
|
+
The enumeration then reads as steps in service of something, rather than as a list to
|
|
125
|
+
be got through.
|
|
126
|
+
|
|
127
|
+
What this prevents is a table of contents standing in for an answer. A reply opening
|
|
128
|
+
with the step names tells someone who already knows the skill nothing new, and someone
|
|
129
|
+
who does not, nothing at all.
|
|
130
|
+
|
|
131
|
+
So, asked what this skill is:
|
|
132
|
+
|
|
133
|
+
> It audits the design system by querying the graph along chosen dimensions and
|
|
134
|
+
> turning counts into judgments — against thresholds agreed with the team, not
|
|
135
|
+
> folklore numbers, because a low count can be a young catalog rather than a problem.
|
|
136
|
+
> You end holding prioritised findings, each routed to the skill that fixes it, with
|
|
137
|
+
> the promote/demote/deprecate calls left where they belong: with the person.
|
|
138
|
+
|
|
139
|
+
Then, and only then, the breakdown.
|
|
140
|
+
|
|
55
141
|
## Discovery Flow
|
|
56
142
|
|
|
57
143
|
Start with a broad inventory, then drill into specific concerns:
|
|
@@ -99,6 +185,19 @@ How complete is the documentation?
|
|
|
99
185
|
### 4. Usage Audit
|
|
100
186
|
What's connected vs. orphaned?
|
|
101
187
|
|
|
188
|
+
### 5. Standards Audit
|
|
189
|
+
Do the implementations conform to the live code standards?
|
|
190
|
+
|
|
191
|
+
An audit that stops at the graph misses the code. For each audited implementation,
|
|
192
|
+
pull the applicable categories (`pragma standard categories`, then
|
|
193
|
+
`pragma standard list --category <framework>`) and read the Do/Don't pairs against
|
|
194
|
+
the source the implementation links to (`ds:headLink`). A violation is a finding with
|
|
195
|
+
the standard's name attached — as first-class as a missing anatomy. The standards
|
|
196
|
+
apply even where the audited app has no pragma dependency. Findings cut both ways:
|
|
197
|
+
where the team's practice is right and the standard is not, the finding becomes a
|
|
198
|
+
proposed change to the standard — the standards are open to contribution, and audits
|
|
199
|
+
are where their gaps surface.
|
|
200
|
+
|
|
102
201
|
## Key Queries
|
|
103
202
|
|
|
104
203
|
Documentation-completeness queries must catch BOTH the absent predicate and the empty
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement-component
|
|
3
|
-
description: Implement a specified design-system component with pragma create, following the live code standards
|
|
3
|
+
description: Implement a specified design-system component with pragma create, following the live code standards; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Implement Component
|
|
@@ -32,6 +32,95 @@ autonomously (only on explicit request), list those judgment calls in the PR.
|
|
|
32
32
|
- Adopting existing components into an app — the `adoption-a1-styles` /
|
|
33
33
|
`adoption-a2-components` / `adoption-a3-forms` tracks, not this skill
|
|
34
34
|
|
|
35
|
+
## Opening move: ask, or offer the tutorial
|
|
36
|
+
|
|
37
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
38
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
39
|
+
form to fill in:
|
|
40
|
+
|
|
41
|
+
> To get started, tell me which block to implement — a name like "Badge", or point me
|
|
42
|
+
> at the spec it came out of. If the target framework or package isn't obvious, say
|
|
43
|
+
> that too.
|
|
44
|
+
|
|
45
|
+
If you are unsure whether the thing is specified at all, take the name anyway:
|
|
46
|
+
pre-flight is what decides, and it routes to `specify-component` when the spec turns
|
|
47
|
+
out not to be there. Ask again only for what the next step genuinely blocks on.
|
|
48
|
+
|
|
49
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
50
|
+
you took it to be, and go.
|
|
51
|
+
|
|
52
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
53
|
+
|
|
54
|
+
> Or if you'd rather see the flow first, I can run it as a tutorial: I'll pick a small
|
|
55
|
+
> documented block from the graph and walk you through it from pre-flight to review.
|
|
56
|
+
|
|
57
|
+
Tutorial mode is the step narration below, turned up: the same outcome-path-conclusion
|
|
58
|
+
frame, with the reasoning at each decision gate made fully explicit and a check that
|
|
59
|
+
the person is with you before the next step. Stop short of anything that lands — no
|
|
60
|
+
commit, no PR — unless they ask to keep what you built.
|
|
61
|
+
|
|
62
|
+
## Every step is narrated: outcome, path, conclusion
|
|
63
|
+
|
|
64
|
+
Every step is addressed to the person — once before it runs, once when it ends. This is
|
|
65
|
+
not tutorial manner. It holds in the ordinary flow too: the person is the design
|
|
66
|
+
authority, and they can only steer a step they saw coming. A decision gate met cold is
|
|
67
|
+
a decision they cannot really make.
|
|
68
|
+
|
|
69
|
+
**Open** the step with what it is FOR — the outcome it should leave behind — and how
|
|
70
|
+
you are about to get there. **Close** it with a sentence saying what it established and
|
|
71
|
+
what that means for the step after. One sentence each is enough; the failure mode is
|
|
72
|
+
silence, not length, and a step whose outcome looks obvious still gets its sentence
|
|
73
|
+
rather than a shrug.
|
|
74
|
+
|
|
75
|
+
Do:
|
|
76
|
+
|
|
77
|
+
> **Pulling the standards, before any code.** The outcome is a shortlist held open
|
|
78
|
+
> while the Badge is written, so the code is shaped by the standards as it is written
|
|
79
|
+
> rather than corrected in review. The path is `pragma standard categories` for the
|
|
80
|
+
> live set, then `standard list --category <name>` for each one that applies.
|
|
81
|
+
>
|
|
82
|
+
> …
|
|
83
|
+
>
|
|
84
|
+
> So: `react`, `storybook` and `testing-unit` are the live shortlist and nothing in
|
|
85
|
+
> them contradicts the spec — implementation can proceed against them, with `css` and
|
|
86
|
+
> `styling` held back for the token work.
|
|
87
|
+
|
|
88
|
+
Don't:
|
|
89
|
+
|
|
90
|
+
> Step 3 — Pull the standards NOW
|
|
91
|
+
>
|
|
92
|
+
> Categories exist for: react (16), testing (+coverage/integration/regression/unit),
|
|
93
|
+
> storybook (11), css (15), styling (4).
|
|
94
|
+
|
|
95
|
+
Both carry the same facts. Only the first says what the step was trying to achieve and
|
|
96
|
+
what it settled — and only the first lets the person cut in with the thing they know
|
|
97
|
+
and the graph does not, which is the whole reason they are here.
|
|
98
|
+
|
|
99
|
+
## Asked about the skill: methodology and outcomes first
|
|
100
|
+
|
|
101
|
+
A question about what this skill does — what it covers, what its steps are, how it
|
|
102
|
+
works — is answered in that order: the METHOD it applies and the OUTCOMES it leaves
|
|
103
|
+
the person holding come first, the step-by-step breakdown comes after.
|
|
104
|
+
|
|
105
|
+
Two or three sentences of method is enough: what the skill treats as its object, the
|
|
106
|
+
discipline that makes it work, and what exists at the end that did not exist before.
|
|
107
|
+
The enumeration then reads as steps in service of something, rather than as a list to
|
|
108
|
+
be got through.
|
|
109
|
+
|
|
110
|
+
What this prevents is a table of contents standing in for an answer. A reply opening
|
|
111
|
+
with the step names tells someone who already knows the skill nothing new, and someone
|
|
112
|
+
who does not, nothing at all.
|
|
113
|
+
|
|
114
|
+
So, asked what this skill is:
|
|
115
|
+
|
|
116
|
+
> It takes an approved spec to working code, and the discipline that defines it is
|
|
117
|
+
> that the applicable code standards are pulled and held open DURING implementation —
|
|
118
|
+
> so they shape the code as it is written, not only in review. You end holding a
|
|
119
|
+
> scaffolded and implemented component, any deviation from a standard recorded next to
|
|
120
|
+
> that standard's name, and an independent review of the result.
|
|
121
|
+
|
|
122
|
+
Then, and only then, the breakdown.
|
|
123
|
+
|
|
35
124
|
## Pre-flight
|
|
36
125
|
|
|
37
126
|
1. **Read the spec.**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: specify-component
|
|
3
|
-
description: Specify a new design-system component with the knowledge graph, from graph search to a sync-safe spec file
|
|
3
|
+
description: Specify a new design-system component with the knowledge graph, from graph search to a sync-safe spec file; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Specify Component
|
|
@@ -55,6 +55,105 @@ Decision gates — in collaboration, pause at each and resolve it WITH the perso
|
|
|
55
55
|
- Specifying a pattern (a recurring arrangement of components) — use `specify-pattern`
|
|
56
56
|
- Writing only the anatomy for an existing block — use `anatomy-author`
|
|
57
57
|
|
|
58
|
+
## Opening move: ask, or offer the tutorial
|
|
59
|
+
|
|
60
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
61
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
62
|
+
form to fill in:
|
|
63
|
+
|
|
64
|
+
> To get started, tell me the component you'd like to work on — a name if it has one,
|
|
65
|
+
> or just the idea, like "it should let someone pick a date".
|
|
66
|
+
|
|
67
|
+
Rough is fine, and often better: step 1 turns an idea into a graph search, and the
|
|
68
|
+
search regularly renames the thing. Ask again only for what the next step genuinely
|
|
69
|
+
blocks on.
|
|
70
|
+
|
|
71
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
72
|
+
you took it to be, and go.
|
|
73
|
+
|
|
74
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
75
|
+
|
|
76
|
+
> Or if you'd rather see the flow first, I can run it as a tutorial: I'll take a
|
|
77
|
+
> plausible example — a date picker, say — and walk you through the eight steps on it.
|
|
78
|
+
|
|
79
|
+
Tutorial mode is the step narration below, turned up: the same outcome-path-conclusion
|
|
80
|
+
frame, with the reasoning at each decision gate made fully explicit and a check that
|
|
81
|
+
the person is with you before the next step. Stop short of anything that lands — no spec
|
|
82
|
+
file written, no proposal filed — unless they ask to keep what you built.
|
|
83
|
+
|
|
84
|
+
## Every step is narrated: outcome, path, conclusion
|
|
85
|
+
|
|
86
|
+
Every step is addressed to the person — once before it runs, once when it ends. This is
|
|
87
|
+
not tutorial manner. It holds in the ordinary flow too: the person is the design
|
|
88
|
+
authority, and they can only steer a step they saw coming. A decision gate met cold is
|
|
89
|
+
a decision they cannot really make.
|
|
90
|
+
|
|
91
|
+
**Open** the step with what it is FOR — the outcome it should leave behind — and how
|
|
92
|
+
you are about to get there. **Close** it with a sentence saying what it established and
|
|
93
|
+
what that means for the step after. One sentence each is enough; the failure mode is
|
|
94
|
+
silence, not length, and a step whose outcome looks obvious still gets its sentence
|
|
95
|
+
rather than a shrug.
|
|
96
|
+
|
|
97
|
+
Do:
|
|
98
|
+
|
|
99
|
+
> **Step 1 — search the graph.** The outcome is a verdict: the thing already exists,
|
|
100
|
+
> an existing block should be extended, or there is a named gap worth specifying. The
|
|
101
|
+
> path is `pragma block list` for the catalog, then `block lookup` on the closest
|
|
102
|
+
> candidates.
|
|
103
|
+
>
|
|
104
|
+
> …
|
|
105
|
+
>
|
|
106
|
+
> So: nothing covers date entry, and the nearest neighbour (`Input`) stops at free
|
|
107
|
+
> text — a real gap, and one that step 2 has to place as a component rather than a
|
|
108
|
+
> pattern.
|
|
109
|
+
|
|
110
|
+
Don't:
|
|
111
|
+
|
|
112
|
+
> Step 1 — Search the graph
|
|
113
|
+
>
|
|
114
|
+
> 87 blocks. No date picker. Closest: Input, Select.
|
|
115
|
+
|
|
116
|
+
Both carry the same facts. Only the first says what the step was trying to achieve and
|
|
117
|
+
what it settled — and only the first lets the person cut in with the thing they know
|
|
118
|
+
and the graph does not, which is the whole reason they are here.
|
|
119
|
+
|
|
120
|
+
## Asked about the skill: methodology and outcomes first
|
|
121
|
+
|
|
122
|
+
A question about what this skill does — what it covers, what its steps are, how it
|
|
123
|
+
works — is answered in that order: the METHOD it applies and the OUTCOMES it leaves
|
|
124
|
+
the person holding come first, the step-by-step breakdown comes after.
|
|
125
|
+
|
|
126
|
+
Two or three sentences of method is enough: what the skill treats as its object, the
|
|
127
|
+
discipline that makes it work, and what exists at the end that did not exist before.
|
|
128
|
+
The enumeration then reads as steps in service of something, rather than as a list to
|
|
129
|
+
be got through.
|
|
130
|
+
|
|
131
|
+
What this prevents is a table of contents standing in for an answer. A reply opening
|
|
132
|
+
with the step names tells someone who already knows the skill nothing new, and someone
|
|
133
|
+
who does not, nothing at all.
|
|
134
|
+
|
|
135
|
+
So, asked what this skill is:
|
|
136
|
+
|
|
137
|
+
> It specifies a component against the knowledge graph, and the discipline is that
|
|
138
|
+
> nothing is invented before the graph has been searched: the entry's category comes
|
|
139
|
+
> from the ontology rather than from taste, the boundary is drawn against its real
|
|
140
|
+
> neighbours, and a benchmark decides what is adopted and what is refused. You end
|
|
141
|
+
> holding a standalone spec file the data sync cannot destroy, plus a record of every
|
|
142
|
+
> judgment call it took to get there.
|
|
143
|
+
|
|
144
|
+
Then, and only then, the breakdown.
|
|
145
|
+
|
|
146
|
+
## The spec falls under standards too
|
|
147
|
+
|
|
148
|
+
A spec is Turtle, and Turtle has standards — the `turtle` category, with `ui-blocks`
|
|
149
|
+
governing how blocks are modelled (take the actual set from
|
|
150
|
+
`pragma standard categories`, not from this list). Pull them before writing and hold
|
|
151
|
+
the Do/Don't pairs open; a spec that contradicts a pulled standard carries a DECLARED
|
|
152
|
+
deviation in the proposal, ideally also filed as an issue. The standards apply
|
|
153
|
+
independent of any package dependency and are open to contribution: a missing or
|
|
154
|
+
wrong modelling rule is something to propose a change for, not to silently work
|
|
155
|
+
around.
|
|
156
|
+
|
|
58
157
|
## The eight steps
|
|
59
158
|
|
|
60
159
|
### 1. Search the graph
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: specify-pattern
|
|
3
|
-
description: Specify a new design-system pattern from the repeatable user context it serves
|
|
3
|
+
description: Specify a new design-system pattern from the repeatable user context it serves; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Specify Pattern
|
|
@@ -57,6 +57,106 @@ Decision gates — in collaboration, pause at each and resolve it WITH the perso
|
|
|
57
57
|
- Implementing an already-specified block — use `implement-component`
|
|
58
58
|
- Writing only the anatomy — use `anatomy-author`
|
|
59
59
|
|
|
60
|
+
## Opening move: ask, or offer the tutorial
|
|
61
|
+
|
|
62
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
63
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
64
|
+
form to fill in:
|
|
65
|
+
|
|
66
|
+
> To get started, tell me the pattern you'd like to work on — a name if it has one, or
|
|
67
|
+
> just the situation behind it, like "people keep having to confirm before something
|
|
68
|
+
> destructive happens".
|
|
69
|
+
|
|
70
|
+
The situation is the better of the two starts: this skill defines a pattern by the
|
|
71
|
+
context it serves, so what recurs matters more than what it is called. Ask again only
|
|
72
|
+
for what the next step genuinely blocks on.
|
|
73
|
+
|
|
74
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
75
|
+
you took it to be, and go.
|
|
76
|
+
|
|
77
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
78
|
+
|
|
79
|
+
> Or if you'd rather see the flow first, I can run it as a tutorial: I'll take a
|
|
80
|
+
> plausible example — confirming a destructive action, say — and walk you through the
|
|
81
|
+
> eight steps on it.
|
|
82
|
+
|
|
83
|
+
Tutorial mode is the step narration below, turned up: the same outcome-path-conclusion
|
|
84
|
+
frame, with the reasoning at each decision gate made fully explicit and a check that
|
|
85
|
+
the person is with you before the next step. Stop short of anything that lands — no spec
|
|
86
|
+
file written, no proposal filed — unless they ask to keep what you built.
|
|
87
|
+
|
|
88
|
+
## Every step is narrated: outcome, path, conclusion
|
|
89
|
+
|
|
90
|
+
Every step is addressed to the person — once before it runs, once when it ends. This is
|
|
91
|
+
not tutorial manner. It holds in the ordinary flow too: the person is the design
|
|
92
|
+
authority, and they can only steer a step they saw coming. A decision gate met cold is
|
|
93
|
+
a decision they cannot really make.
|
|
94
|
+
|
|
95
|
+
**Open** the step with what it is FOR — the outcome it should leave behind — and how
|
|
96
|
+
you are about to get there. **Close** it with a sentence saying what it established and
|
|
97
|
+
what that means for the step after. One sentence each is enough; the failure mode is
|
|
98
|
+
silence, not length, and a step whose outcome looks obvious still gets its sentence
|
|
99
|
+
rather than a shrug.
|
|
100
|
+
|
|
101
|
+
Do:
|
|
102
|
+
|
|
103
|
+
> **Step 1 — search the graph, twice.** The outcome is two verdicts: whether a pattern
|
|
104
|
+
> already answers this situation, and whether the components it would compose exist.
|
|
105
|
+
> The path is `pragma block list`, then `block lookup` on the near patterns and on each
|
|
106
|
+
> part.
|
|
107
|
+
>
|
|
108
|
+
> …
|
|
109
|
+
>
|
|
110
|
+
> So: no pattern covers destructive confirmation, and both parts it would compose
|
|
111
|
+
> (`Modal`, `Button`) already exist — the gap is the arrangement, not the pieces, which
|
|
112
|
+
> is exactly what step 2 has to defend.
|
|
113
|
+
|
|
114
|
+
Don't:
|
|
115
|
+
|
|
116
|
+
> Step 1 — Search
|
|
117
|
+
>
|
|
118
|
+
> No confirmation pattern. Modal and Button exist.
|
|
119
|
+
|
|
120
|
+
Both carry the same facts. Only the first says what the step was trying to achieve and
|
|
121
|
+
what it settled — and only the first lets the person cut in with the thing they know
|
|
122
|
+
and the graph does not, which is the whole reason they are here.
|
|
123
|
+
|
|
124
|
+
## Asked about the skill: methodology and outcomes first
|
|
125
|
+
|
|
126
|
+
A question about what this skill does — what it covers, what its steps are, how it
|
|
127
|
+
works — is answered in that order: the METHOD it applies and the OUTCOMES it leaves
|
|
128
|
+
the person holding come first, the step-by-step breakdown comes after.
|
|
129
|
+
|
|
130
|
+
Two or three sentences of method is enough: what the skill treats as its object, the
|
|
131
|
+
discipline that makes it work, and what exists at the end that did not exist before.
|
|
132
|
+
The enumeration then reads as steps in service of something, rather than as a list to
|
|
133
|
+
be got through.
|
|
134
|
+
|
|
135
|
+
What this prevents is a table of contents standing in for an answer. A reply opening
|
|
136
|
+
with the step names tells someone who already knows the skill nothing new, and someone
|
|
137
|
+
who does not, nothing at all.
|
|
138
|
+
|
|
139
|
+
So, asked what this skill is:
|
|
140
|
+
|
|
141
|
+
> It specifies a pattern, and the defining move is that a pattern is defined by the
|
|
142
|
+
> repeatable USER CONTEXT it serves — the situation, the job, the flow it recurs in —
|
|
143
|
+
> more than by the atomicity of the element. Every step is aimed at that context. You
|
|
144
|
+
> end holding a spec that names the situation, fixes what the arrangement holds
|
|
145
|
+
> constant and what it lets vary, and records the judgment calls behind both.
|
|
146
|
+
|
|
147
|
+
Then, and only then, the breakdown.
|
|
148
|
+
|
|
149
|
+
## The spec falls under standards too
|
|
150
|
+
|
|
151
|
+
A pattern spec is Turtle, and Turtle has standards — the `turtle` category, with
|
|
152
|
+
`ui-blocks` governing how blocks and their parts are modelled (take the actual set
|
|
153
|
+
from `pragma standard categories`, not from this list). Pull them before writing and
|
|
154
|
+
hold the Do/Don't pairs open; a spec that contradicts a pulled standard carries a
|
|
155
|
+
RECORDED deviation in the proposal, ideally also filed as an issue. The standards
|
|
156
|
+
apply independent of any package dependency and are open to contribution: a missing
|
|
157
|
+
or wrong modelling rule is something to propose a change for, not to silently work
|
|
158
|
+
around.
|
|
159
|
+
|
|
60
160
|
## The eight steps
|
|
61
161
|
|
|
62
162
|
### 1. Search the graph — patterns AND their parts
|
package/source.json
CHANGED
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"properties": "grid-20chnVyhaz",
|
|
14
14
|
"tags": "grid-lWjILO8uln",
|
|
15
15
|
"tagCategories": "grid-FhqOiepLOs",
|
|
16
|
-
"changeLog": "grid-909bbtNGDK"
|
|
16
|
+
"changeLog": "grid-909bbtNGDK",
|
|
17
|
+
"concepts": "grid-GnfOU3MM-3",
|
|
18
|
+
"conceptTypes": "grid-NN2EoogWeA"
|
|
17
19
|
}
|
|
18
20
|
},
|
|
19
21
|
"transform": {
|
|
@@ -134,6 +136,31 @@
|
|
|
134
136
|
},
|
|
135
137
|
"class": "ds:TagCategory",
|
|
136
138
|
"uriTemplate": "ds:tagcategory.{Category}"
|
|
139
|
+
},
|
|
140
|
+
"concepts": {
|
|
141
|
+
"@context": {
|
|
142
|
+
"ds": "https://ds.canonical.com/",
|
|
143
|
+
"name": "ds:name",
|
|
144
|
+
"summary": "ds:summary",
|
|
145
|
+
"content": "ds:content",
|
|
146
|
+
"known edge cases": "ds:knownEdgeCases",
|
|
147
|
+
"type": { "@id": "ds:conceptType", "@type": "@id" },
|
|
148
|
+
"tier": { "@id": "ds:tier", "@type": "@id" }
|
|
149
|
+
},
|
|
150
|
+
"class": "ds:Concept",
|
|
151
|
+
"uriTemplate": "ds:concept.{name}",
|
|
152
|
+
"rowFilter": {
|
|
153
|
+
"nonEmpty": [{ "column": "content", "minLength": 20 }]
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"conceptTypes": {
|
|
157
|
+
"@context": {
|
|
158
|
+
"ds": "https://ds.canonical.com/",
|
|
159
|
+
"Name": "ds:name",
|
|
160
|
+
"Notes": "ds:summary"
|
|
161
|
+
},
|
|
162
|
+
"class": "ds:ConceptType",
|
|
163
|
+
"uriTemplate": "ds:concepttype.{Name}"
|
|
137
164
|
}
|
|
138
165
|
},
|
|
139
166
|
"references": {
|
|
@@ -164,6 +191,14 @@
|
|
|
164
191
|
"tagCategories": {
|
|
165
192
|
"uriTemplate": "ds:tagcategory.{Category}",
|
|
166
193
|
"keyColumn": "Category"
|
|
194
|
+
},
|
|
195
|
+
"concepts": {
|
|
196
|
+
"uriTemplate": "ds:concept.{name}",
|
|
197
|
+
"keyColumn": "name"
|
|
198
|
+
},
|
|
199
|
+
"conceptTypes": {
|
|
200
|
+
"uriTemplate": "ds:concepttype.{Name}",
|
|
201
|
+
"keyColumn": "Name"
|
|
167
202
|
}
|
|
168
203
|
}
|
|
169
204
|
}
|
|
@@ -98,6 +98,33 @@
|
|
|
98
98
|
"description": "Column→predicate literal mappings for this class"
|
|
99
99
|
},
|
|
100
100
|
"description": "Additional literal column→predicate mappings applied only when the resolved class matches the key (prefixed form, e.g. 'ds:Layout')"
|
|
101
|
+
},
|
|
102
|
+
"rowFilter": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"description": "Optional include-filter: emit only rows matching every condition. Absent → emit every row.",
|
|
105
|
+
"properties": {
|
|
106
|
+
"nameIn": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"required": ["column", "values"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"column": { "type": "string" },
|
|
111
|
+
"values": { "type": "array", "items": { "type": "string" } }
|
|
112
|
+
},
|
|
113
|
+
"description": "Keep only rows whose column equals one of these values (case-insensitive)"
|
|
114
|
+
},
|
|
115
|
+
"nonEmpty": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": ["column"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"column": { "type": "string" },
|
|
122
|
+
"minLength": { "type": "number" }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"description": "Keep only rows whose named column(s) are non-empty (trimmed length ≥ minLength, default 1)"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
101
128
|
}
|
|
102
129
|
}
|
|
103
130
|
},
|