@canonical/pragma-cli 0.35.0 → 0.36.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/README.md +2 -2
- package/bundled-skills/add-standard/SKILL.md +338 -0
- package/bundled-skills/adoption-a1-styles/SKILL.md +269 -0
- package/bundled-skills/adoption-a2-components/SKILL.md +291 -0
- package/bundled-skills/adoption-a3-forms/SKILL.md +260 -0
- package/bundled-skills/anatomy-author/ANATOMY_DSL_SPEC.md +406 -0
- package/bundled-skills/anatomy-author/SKILL.md +1226 -0
- package/bundled-skills/design-auditor/SKILL.md +455 -0
- package/bundled-skills/implement-component/SKILL.md +333 -0
- package/bundled-skills/specify-component/SKILL.md +331 -0
- package/bundled-skills/specify-pattern/SKILL.md +292 -0
- package/dist/package.json +16 -15
- package/dist/pragma.conf.js +236 -34
- package/dist/pragma.conf.js.map +1 -1
- package/dist/src/bin.js +1 -1
- package/dist/src/bin.js.map +1 -1
- package/dist/src/capabilities/colophon/colophon.render.js +1 -1
- package/dist/src/capabilities/colophon/colophon.render.js.map +1 -1
- package/dist/src/capabilities/create/mount.js +4 -3
- package/dist/src/capabilities/create/mount.js.map +1 -1
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +60 -4
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -1
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js +8 -8
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js.map +1 -1
- package/dist/src/capabilities/doctor/checks/harnessInventory.js +195 -0
- package/dist/src/capabilities/doctor/checks/harnessInventory.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/index.js +6 -6
- package/dist/src/capabilities/doctor/checks/targetHealth.js +194 -50
- package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -1
- package/dist/src/capabilities/doctor/doctor.render.js +43 -64
- package/dist/src/capabilities/doctor/doctor.render.js.map +1 -1
- package/dist/src/capabilities/doctor/doctor.verb.js +6 -2
- package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -1
- package/dist/src/capabilities/doctor/runChecks.js +14 -11
- package/dist/src/capabilities/doctor/runChecks.js.map +1 -1
- package/dist/src/capabilities/graph/query.render.js +2 -2
- package/dist/src/capabilities/graph/query.render.js.map +1 -1
- package/dist/src/capabilities/info/collectInfo.js +8 -2
- package/dist/src/capabilities/info/collectInfo.js.map +1 -1
- package/dist/src/capabilities/info/info.render.js +6 -2
- package/dist/src/capabilities/info/info.render.js.map +1 -1
- package/dist/src/capabilities/prompt/prompt.render.js +2 -2
- package/dist/src/capabilities/prompt/prompt.render.js.map +1 -1
- package/dist/src/capabilities/setup/buildPlan.js +43 -39
- package/dist/src/capabilities/setup/buildPlan.js.map +1 -1
- package/dist/src/capabilities/setup/mode.js +2 -2
- package/dist/src/capabilities/setup/operations/index.js +4 -4
- package/dist/src/capabilities/setup/operations/index.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupGenerator.js +92 -45
- package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupLsp.js +88 -36
- package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupMcp.js +97 -51
- package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupSkills.js +325 -47
- package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -1
- package/dist/src/capabilities/setup/plan.js.map +1 -1
- package/dist/src/capabilities/setup/plan.render.js +144 -66
- package/dist/src/capabilities/setup/plan.render.js.map +1 -1
- package/dist/src/capabilities/setup/setup.render.js +1 -1
- package/dist/src/capabilities/setup/setup.verb.js +86 -33
- package/dist/src/capabilities/setup/setup.verb.js.map +1 -1
- package/dist/src/capabilities/setup/targets.js +110 -45
- package/dist/src/capabilities/setup/targets.js.map +1 -1
- package/dist/src/capabilities/shared/index.js +6 -5
- package/dist/src/capabilities/shared/index.js.map +1 -1
- package/dist/src/capabilities/shared/packageManager.js +300 -54
- package/dist/src/capabilities/shared/packageManager.js.map +1 -1
- package/dist/src/capabilities/skill/discover.js +97 -11
- package/dist/src/capabilities/skill/discover.js.map +1 -1
- package/dist/src/capabilities/skill/render.js +2 -2
- package/dist/src/capabilities/skill/render.js.map +1 -1
- package/dist/src/capabilities/sources/installSkills.js +145 -3
- package/dist/src/capabilities/sources/installSkills.js.map +1 -1
- package/dist/src/capabilities/sources/runUpdate.js +68 -2
- package/dist/src/capabilities/sources/runUpdate.js.map +1 -1
- package/dist/src/capabilities/sources/update.verb.js +3 -3
- package/dist/src/capabilities/sources/update.verb.js.map +1 -1
- package/dist/src/capabilities/upgrade/runUpgrade.js +43 -7
- package/dist/src/capabilities/upgrade/runUpgrade.js.map +1 -1
- package/dist/src/capabilities/upgrade/upgrade.render.js +10 -2
- package/dist/src/capabilities/upgrade/upgrade.render.js.map +1 -1
- package/dist/src/constants.js +6 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/kernel/index.js +11 -2
- package/dist/src/kernel/index.js.map +1 -1
- package/dist/src/kernel/interactivity.js +68 -0
- package/dist/src/kernel/interactivity.js.map +1 -0
- package/dist/src/kernel/packs/renderPack.js +3 -3
- package/dist/src/kernel/packs/renderPack.js.map +1 -1
- package/dist/src/kernel/packs/resolveEntity.js +63 -12
- package/dist/src/kernel/packs/resolveEntity.js.map +1 -1
- package/dist/src/kernel/packs/runBodies.js +57 -4
- package/dist/src/kernel/packs/runBodies.js.map +1 -1
- package/dist/src/kernel/packs/schema.js +54 -2
- package/dist/src/kernel/packs/schema.js.map +1 -1
- package/dist/src/kernel/packs/sparql/applyFilters.js +104 -5
- package/dist/src/kernel/packs/sparql/applyFilters.js.map +1 -1
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js +306 -43
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -1
- package/dist/src/kernel/packs/types.js.map +1 -1
- package/dist/src/kernel/project/cli/buildProgram.js +1 -1
- package/dist/src/kernel/project/cli/buildProgram.js.map +1 -1
- package/dist/src/kernel/project/cli/dispatch.js +23 -23
- package/dist/src/kernel/project/cli/dispatch.js.map +1 -1
- package/dist/src/kernel/project/cli/globalFlags.js +4 -1
- package/dist/src/kernel/project/cli/globalFlags.js.map +1 -1
- package/dist/src/kernel/project/cli/helpFormat.js +1 -2
- package/dist/src/kernel/project/cli/helpFormat.js.map +1 -1
- package/dist/src/kernel/project/cli/rootHelp.js +34 -4
- package/dist/src/kernel/project/cli/rootHelp.js.map +1 -1
- package/dist/src/kernel/project/mcp/registerVerb.js +16 -1
- package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -1
- package/dist/src/kernel/render/renderers.js +1 -1
- package/dist/src/kernel/render/style.js +29 -9
- package/dist/src/kernel/render/style.js.map +1 -1
- package/dist/src/kernel/render/vocabulary.js +174 -0
- package/dist/src/kernel/render/vocabulary.js.map +1 -0
- package/dist/src/kernel/spec/emitReference.js +1 -1
- package/dist/src/kernel/spec/emitReference.js.map +1 -1
- package/package.json +16 -15
- package/pragma.conf.ts +241 -34
- package/src/bin.ts +8 -1
- package/src/capabilities/block.parity.test.ts +25 -11
- package/src/capabilities/block.shipped.exec.test.ts +282 -0
- package/src/capabilities/block.tierRank.exec.test.ts +300 -0
- package/src/capabilities/colophon/colophon.render.ts +1 -2
- package/src/capabilities/colophon/colophon.test.ts +2 -2
- package/src/capabilities/create/createGrammar.test.ts +1 -1
- package/src/capabilities/create/mount.ts +3 -3
- package/src/capabilities/distribution.parity.test.ts +4 -0
- package/src/capabilities/doctor/checks/checkPackageRefs.ts +69 -4
- package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +6 -4
- package/src/capabilities/doctor/checks/checkShellCompletions.ts +8 -8
- package/src/capabilities/doctor/checks/harnessInventory.test.ts +219 -0
- package/src/capabilities/doctor/checks/harnessInventory.ts +298 -0
- package/src/capabilities/doctor/checks/index.ts +6 -6
- package/src/capabilities/doctor/checks/targetHealth.ts +229 -59
- package/src/capabilities/doctor/doctor.render.test.ts +108 -32
- package/src/capabilities/doctor/doctor.render.ts +56 -80
- package/src/capabilities/doctor/doctor.test.ts +247 -35
- package/src/capabilities/doctor/doctor.verb.ts +7 -2
- package/src/capabilities/doctor/runChecks.ts +14 -11
- package/src/capabilities/doctor/types.ts +15 -24
- package/src/capabilities/emptyRecovery.test.ts +10 -2
- package/src/capabilities/graph/query.render.ts +2 -2
- package/src/capabilities/info/collectInfo.ts +8 -1
- package/src/capabilities/info/info.render.ts +6 -2
- package/src/capabilities/info/info.test.ts +37 -1
- package/src/capabilities/info/types.ts +10 -2
- package/src/capabilities/prompt/prompt.render.ts +2 -2
- package/src/capabilities/renderVocabularySync.test.ts +82 -0
- package/src/capabilities/scopeTypeSync.test.ts +29 -15
- package/src/capabilities/setup/buildPlan.ts +45 -41
- package/src/capabilities/setup/index.ts +1 -1
- package/src/capabilities/setup/mode.ts +2 -2
- package/src/capabilities/setup/operations/index.ts +6 -1
- package/src/capabilities/setup/operations/setupGenerator.ts +144 -70
- package/src/capabilities/setup/operations/setupLsp.ts +129 -37
- package/src/capabilities/setup/operations/setupMcp.ts +132 -61
- package/src/capabilities/setup/operations/setupSkills.ts +392 -58
- package/src/capabilities/setup/plan.render.ts +171 -76
- package/src/capabilities/setup/plan.ts +17 -12
- package/src/capabilities/setup/setup.mcp.correctness.test.ts +9 -9
- package/src/capabilities/setup/setup.render.test.ts +50 -36
- package/src/capabilities/setup/setup.render.ts +1 -1
- package/src/capabilities/setup/setup.test.ts +881 -50
- package/src/capabilities/setup/setup.verb.ts +91 -33
- package/src/capabilities/setup/targets.ts +120 -52
- package/src/capabilities/setup/types.ts +10 -18
- package/src/capabilities/shared/index.ts +17 -6
- package/src/capabilities/shared/packageManager.test.ts +421 -6
- package/src/capabilities/shared/packageManager.ts +394 -59
- package/src/capabilities/skill/bundledSkills.test.ts +347 -0
- package/src/capabilities/skill/discover.ts +100 -11
- package/src/capabilities/skill/render.ts +2 -2
- package/src/capabilities/skill/skill.test.ts +17 -4
- package/src/capabilities/sources/installSkills.ts +181 -3
- package/src/capabilities/sources/runUpdate.ts +78 -2
- package/src/capabilities/sources/sources.test.ts +228 -0
- package/src/capabilities/sources/update.verb.ts +3 -3
- package/src/capabilities/surface.test.ts +2 -2
- package/src/capabilities/upgrade/runUpgrade.ts +45 -6
- package/src/capabilities/upgrade/types.ts +10 -2
- package/src/capabilities/upgrade/upgrade.render.ts +9 -2
- package/src/capabilities/upgrade/upgrade.test.ts +72 -0
- package/src/constants.ts +6 -1
- package/src/identity.test.ts +18 -5
- package/src/kernel/completion/entitySource.test.ts +15 -2
- package/src/kernel/completion/safety.test.ts +16 -9
- package/src/kernel/config/defaults.test.ts +2 -1
- package/src/kernel/index.ts +11 -2
- package/src/kernel/interactivity.test.ts +76 -0
- package/src/kernel/interactivity.ts +69 -0
- package/src/kernel/packs/compile.test.ts +92 -0
- package/src/kernel/packs/renderPack.ts +3 -3
- package/src/kernel/packs/resolveEntity.test.ts +75 -14
- package/src/kernel/packs/resolveEntity.ts +88 -24
- package/src/kernel/packs/runBodies.ts +84 -19
- package/src/kernel/packs/schema.ts +60 -4
- package/src/kernel/packs/sparql/applyFilters.ts +125 -4
- package/src/kernel/packs/sparql/buildLookupQuery.test.ts +290 -0
- package/src/kernel/packs/sparql/buildLookupQuery.ts +323 -45
- package/src/kernel/packs/toolDescription.test.ts +35 -1
- package/src/kernel/packs/types.ts +125 -2
- package/src/kernel/project/cli/buildProgram.test.ts +73 -2
- package/src/kernel/project/cli/buildProgram.ts +8 -1
- package/src/kernel/project/cli/dispatch.test.ts +5 -4
- package/src/kernel/project/cli/dispatch.ts +25 -24
- package/src/kernel/project/cli/globalFlags.ts +4 -1
- package/src/kernel/project/cli/helpFormat.ts +1 -2
- package/src/kernel/project/cli/rootHelp.ts +36 -3
- package/src/kernel/project/mcp/registerVerb.ts +20 -1
- package/src/kernel/render/renderers.ts +1 -1
- package/src/kernel/render/style.ts +32 -9
- package/src/kernel/render/vocabulary.ts +276 -0
- package/src/kernel/spec/emitReference.ts +1 -1
- package/src/kernel/spec/types.ts +35 -6
- package/src/testing/PARITY_GAPS.ts +9 -3
- package/src/testing/behavioral/docExamples.test.ts +4 -2
- package/src/testing/behavioral/errorMatrix.mcp.test.ts +110 -7
- package/src/testing/behavioral/journeys.firstInstall.test.ts +7 -2
- package/src/testing/behavioral/journeys.packageStories.test.ts +6 -3
- package/src/testing/eval/__snapshots__/eval.test.ts.snap +26 -1
- package/src/testing/eval/cases/readNouns.ts +245 -9
- package/src/testing/fixtures/blockGraph.ts +28 -13
- package/src/testing/fixtures/graph/canonical.ts +95 -12
- package/dist/src/capabilities/shared/bands.js +0 -16
- package/dist/src/capabilities/shared/bands.js.map +0 -1
- package/src/capabilities/shared/bands.ts +0 -16
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-auditor
|
|
3
|
+
description: Audit design system coverage, consistency, and quality; also runs as a guided tutorial on a worked example
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Design Auditor
|
|
7
|
+
|
|
8
|
+
Audit design system coverage, consistency, and quality. This semantic skill analyzes
|
|
9
|
+
the knowledge graph to find gaps, inconsistencies, and opportunities for improvement
|
|
10
|
+
across components, patterns, layouts, and documentation.
|
|
11
|
+
|
|
12
|
+
In a fresh session, orient first:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pragma capabilities
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Working mode: assistant to a design authority
|
|
19
|
+
|
|
20
|
+
An audit produces judgments, and most of the time those judgments belong to a senior
|
|
21
|
+
designer or engineer — you are the assistant whose job is to make them successful.
|
|
22
|
+
Default to that mode: lay out the audit direction, run the queries and return
|
|
23
|
+
digestible findings, and bring each judgment to the person as a recommendation plus a
|
|
24
|
+
question rather than a verdict. They know which gaps are deliberate, which components
|
|
25
|
+
are on the way out, and which numbers actually worry the team — the graph does not.
|
|
26
|
+
|
|
27
|
+
Full autonomy is the exception, not the default: run a whole audit alone only when
|
|
28
|
+
explicitly asked to. Even then, list every judgment call made unilaterally in the
|
|
29
|
+
final report so a human can revisit them.
|
|
30
|
+
|
|
31
|
+
Decision gates — in collaboration, pause at each and resolve it WITH the person:
|
|
32
|
+
|
|
33
|
+
1. Scope: which audit dimensions matter right now, and which tiers are in scope.
|
|
34
|
+
2. What counts as concerning: agree the thresholds with the team instead of importing
|
|
35
|
+
folklore numbers — a "low" pattern count may be a young catalog, not a problem.
|
|
36
|
+
3. Prioritization of the recommendations.
|
|
37
|
+
4. Any promote/demote/deprecate suggestion — these are roadmap calls, not data calls.
|
|
38
|
+
|
|
39
|
+
## When to Use
|
|
40
|
+
|
|
41
|
+
- Reviewing design system health and completeness
|
|
42
|
+
- Finding components missing documentation or guidelines
|
|
43
|
+
- Identifying inconsistent modifier family usage
|
|
44
|
+
- Discovering orphaned or underutilized elements
|
|
45
|
+
- Preparing for design system roadmap planning
|
|
46
|
+
- Auditing before a major release
|
|
47
|
+
|
|
48
|
+
## When NOT to Use
|
|
49
|
+
|
|
50
|
+
- Auditing an APP's adoption of the design system — that is the
|
|
51
|
+
`adoption-a1-styles`/`a2`/`a3` tracks
|
|
52
|
+
- Fixing what the audit finds — route gaps to `specify-component`/`specify-pattern`,
|
|
53
|
+
missing anatomies to `anatomy-author`
|
|
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
|
+
|
|
141
|
+
## Discovery Flow
|
|
142
|
+
|
|
143
|
+
Start with a broad inventory, then drill into specific concerns:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pragma block list # every component, pattern, layout and subcomponent, with type and tier
|
|
147
|
+
pragma modifier list # every modifier family with its values
|
|
148
|
+
pragma tier list # the tiers blocks can live in
|
|
149
|
+
pragma graph query "…" # the audit queries below
|
|
150
|
+
pragma graph inspect <IRI-or-ds:name> # every triple on one entity
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Two graph-query mechanics to know (shared with the sibling skills):
|
|
154
|
+
|
|
155
|
+
- Common prefixes (`ds:`, `cs:`) are applied automatically — no PREFIX preamble.
|
|
156
|
+
- Inside a SPARQL body, a local name with more than one dot
|
|
157
|
+
(`ds:global.component.button`) does not parse — use the full IRI there
|
|
158
|
+
(`<https://ds.canonical.com/global.component.button>`). Single-dot and dot-free
|
|
159
|
+
prefixed names (`ds:global`, `ds:Component`) work as-is.
|
|
160
|
+
|
|
161
|
+
Note that `block list` deliberately omits the `ds:Group` class — an audit that counts
|
|
162
|
+
only the list under-counts. The queries below go to the graph directly, so they see
|
|
163
|
+
groups too.
|
|
164
|
+
|
|
165
|
+
> The covered set is whatever the graph answers today. Query it live — never copy its
|
|
166
|
+
> output (counts, names, ratios) into documentation, PRs, or this skill.
|
|
167
|
+
|
|
168
|
+
One more live-data rule: before trusting any query, confirm its predicates against the
|
|
169
|
+
current ontology (`pragma ontology lookup ds`). The vocabulary evolves — for example,
|
|
170
|
+
`ds:usage` subsumed the former `whenToUse`/`whenNotToUse` predicates, and queries
|
|
171
|
+
against retired names return empty tables, not errors. An empty result must be
|
|
172
|
+
distinguished from a wrong query before it becomes a finding.
|
|
173
|
+
|
|
174
|
+
## Audit Dimensions
|
|
175
|
+
|
|
176
|
+
### 1. Coverage Audit
|
|
177
|
+
What's documented vs. what's missing?
|
|
178
|
+
|
|
179
|
+
### 2. Consistency Audit
|
|
180
|
+
Are similar components structured similarly?
|
|
181
|
+
|
|
182
|
+
### 3. Quality Audit
|
|
183
|
+
How complete is the documentation?
|
|
184
|
+
|
|
185
|
+
### 4. Usage Audit
|
|
186
|
+
What's connected vs. orphaned?
|
|
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
|
+
|
|
201
|
+
## Key Queries
|
|
202
|
+
|
|
203
|
+
Documentation-completeness queries must catch BOTH the absent predicate and the empty
|
|
204
|
+
string — many entries carry a field that is present but blank, and a
|
|
205
|
+
`FILTER NOT EXISTS` alone misses them.
|
|
206
|
+
|
|
207
|
+
### Coverage: Components by Tier
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
pragma graph query "SELECT ?tierName (COUNT(?c) as ?componentCount) WHERE {
|
|
211
|
+
?c a ds:Component ;
|
|
212
|
+
ds:tier ?tier .
|
|
213
|
+
?tier ds:name ?tierName .
|
|
214
|
+
} GROUP BY ?tierName
|
|
215
|
+
ORDER BY DESC(?componentCount)"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**What it asks**: where the catalog's weight sits. A tier with few components can be a
|
|
219
|
+
gap, a young tier, or a deliberate scope — which one is a question for the team.
|
|
220
|
+
|
|
221
|
+
### Coverage: UIBlock Types Distribution
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
pragma graph query "SELECT ?type (COUNT(?block) as ?count) WHERE {
|
|
225
|
+
VALUES ?type { ds:Component ds:Pattern ds:Layout ds:Subcomponent ds:Group }
|
|
226
|
+
?block a ?type .
|
|
227
|
+
} GROUP BY ?type"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**What it asks**: the shape of the catalog. There is no universally healthy ratio —
|
|
231
|
+
compare against the previous audit's numbers and let the team judge the trend.
|
|
232
|
+
|
|
233
|
+
### Quality: Blocks Missing or Blank Summary
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
pragma graph query "SELECT ?block ?name WHERE {
|
|
237
|
+
?block a ?type ;
|
|
238
|
+
ds:name ?name .
|
|
239
|
+
VALUES ?type { ds:Component ds:Pattern ds:Layout ds:Subcomponent ds:Group }
|
|
240
|
+
FILTER NOT EXISTS { ?block ds:summary ?s . FILTER(STR(?s) != '') }
|
|
241
|
+
}"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**What it asks**: which blocks have no base definition at all. These rows are also
|
|
245
|
+
what `implement-component` treats as "no spec here to implement".
|
|
246
|
+
|
|
247
|
+
### Quality: Components Missing or Blank Usage
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
pragma graph query "SELECT ?component ?name WHERE {
|
|
251
|
+
?component a ds:Component ;
|
|
252
|
+
ds:name ?name .
|
|
253
|
+
FILTER NOT EXISTS { ?component ds:usage ?u . FILTER(STR(?u) != '') }
|
|
254
|
+
}"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**What it asks**: where When-to-use / When-not-to-use guidance is missing (`ds:usage`
|
|
258
|
+
subsumes both). Without it, adopters cannot tell what replaces what — these gaps
|
|
259
|
+
directly hurt the adoption tracks.
|
|
260
|
+
|
|
261
|
+
### Quality: Components Missing or Blank Guidelines
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
pragma graph query "SELECT ?component ?name WHERE {
|
|
265
|
+
?component a ds:Component ;
|
|
266
|
+
ds:name ?name .
|
|
267
|
+
FILTER NOT EXISTS { ?component ds:guidelines ?g . FILTER(STR(?g) != '') }
|
|
268
|
+
}"
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**What it asks**: where accessibility and best-practice material is missing —
|
|
272
|
+
`ds:guidelines` is its conventional home.
|
|
273
|
+
|
|
274
|
+
### Quality: Blocks Missing or Blank Anatomy
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
pragma graph query "SELECT ?block ?name WHERE {
|
|
278
|
+
?block a ?type ;
|
|
279
|
+
ds:name ?name .
|
|
280
|
+
VALUES ?type { ds:Component ds:Pattern }
|
|
281
|
+
FILTER NOT EXISTS { ?block ds:anatomyDsl ?a . FILTER(STR(?a) != '') }
|
|
282
|
+
}"
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**What it asks**: `anatomy-author` candidates.
|
|
286
|
+
|
|
287
|
+
### Consistency: Modifier Family Usage
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
pragma graph query "SELECT ?family ?familyName (COUNT(?component) as ?usage) WHERE {
|
|
291
|
+
?family a ds:ModifierFamily ;
|
|
292
|
+
ds:name ?familyName .
|
|
293
|
+
OPTIONAL {
|
|
294
|
+
?component a ds:Component ;
|
|
295
|
+
ds:hasModifierFamily ?family .
|
|
296
|
+
}
|
|
297
|
+
} GROUP BY ?family ?familyName
|
|
298
|
+
ORDER BY DESC(?usage)"
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**What it asks**: which families are core and which are unused. A zero-usage family is
|
|
302
|
+
a question — premature abstraction, or adoption that has not landed yet?
|
|
303
|
+
|
|
304
|
+
### Consistency: Components Without Modifier Families
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
pragma graph query "SELECT ?component ?name WHERE {
|
|
308
|
+
?component a ds:Component ;
|
|
309
|
+
ds:name ?name .
|
|
310
|
+
FILTER NOT EXISTS { ?component ds:hasModifierFamily ?mf }
|
|
311
|
+
}"
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**What it asks**: candidates to review — not every component needs modifiers, but
|
|
315
|
+
many do.
|
|
316
|
+
|
|
317
|
+
### Usage: Orphaned Subcomponents
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
pragma graph query "SELECT ?sub ?name WHERE {
|
|
321
|
+
?sub a ds:Subcomponent ;
|
|
322
|
+
ds:name ?name .
|
|
323
|
+
FILTER NOT EXISTS { ?sub ds:parentComponent ?parent }
|
|
324
|
+
}"
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**What it asks**: subcomponents without parents — either the relationship is missing,
|
|
328
|
+
or the block should be promoted to Component. Which one is a team call.
|
|
329
|
+
|
|
330
|
+
### Usage: Components With Subcomponents
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
pragma graph query "SELECT ?component ?componentName (COUNT(?sub) as ?subCount) WHERE {
|
|
334
|
+
?component a ds:Component ;
|
|
335
|
+
ds:name ?componentName .
|
|
336
|
+
?sub ds:parentComponent ?component .
|
|
337
|
+
} GROUP BY ?component ?componentName
|
|
338
|
+
ORDER BY DESC(?subCount)"
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**What it asks**: where composition complexity concentrates. A very high count is a
|
|
342
|
+
prompt to ask whether the decomposition still serves its users.
|
|
343
|
+
|
|
344
|
+
### Cross-Tier: Potential Promotion Candidates
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
pragma graph query "SELECT ?component ?name ?tierName WHERE {
|
|
348
|
+
?component a ds:Component ;
|
|
349
|
+
ds:name ?name ;
|
|
350
|
+
ds:tier ?tier .
|
|
351
|
+
?tier ds:name ?tierName .
|
|
352
|
+
FILTER(?tier != ds:global)
|
|
353
|
+
FILTER EXISTS { ?component ds:hasModifierFamily ?mf }
|
|
354
|
+
FILTER EXISTS { ?component ds:summary ?d . FILTER(STR(?d) != '') }
|
|
355
|
+
FILTER EXISTS { ?component ds:usage ?u . FILTER(STR(?u) != '') }
|
|
356
|
+
}"
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**What it asks**: well-documented tier-specific components that MIGHT be universal.
|
|
360
|
+
Promotion is a roadmap decision — present these as candidates, never as conclusions.
|
|
361
|
+
|
|
362
|
+
## Audit Report
|
|
363
|
+
|
|
364
|
+
Build the report from the live query results, structured as:
|
|
365
|
+
|
|
366
|
+
```markdown
|
|
367
|
+
## Design System Audit Report
|
|
368
|
+
|
|
369
|
+
**Generated:** {date} **Scope:** {tiers/dimensions agreed at the scope gate}
|
|
370
|
+
|
|
371
|
+
### Executive Summary
|
|
372
|
+
Counts per UIBlock type and per tier, documentation coverage percentages, and the
|
|
373
|
+
headline findings — with each "concern" label traced to a threshold the team agreed,
|
|
374
|
+
not an imported one.
|
|
375
|
+
|
|
376
|
+
### Findings per dimension
|
|
377
|
+
Coverage / Quality / Consistency / Usage — for each: the numbers, the specific blocks
|
|
378
|
+
affected, and the open question or recommendation. Route each actionable gap to its
|
|
379
|
+
skill: missing spec → specify-component / specify-pattern; missing anatomy →
|
|
380
|
+
anatomy-author.
|
|
381
|
+
|
|
382
|
+
### Recommendations
|
|
383
|
+
Prioritized WITH the person (decision gate 3). Mark which items are data-driven
|
|
384
|
+
(e.g. "12 components have a blank summary") and which are judgment
|
|
385
|
+
(e.g. "consider promoting X to global").
|
|
386
|
+
|
|
387
|
+
### Appendix
|
|
388
|
+
The raw query results the findings rest on, in collapsible sections.
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
## Workflow
|
|
392
|
+
|
|
393
|
+
### Quick Health Check
|
|
394
|
+
|
|
395
|
+
```text
|
|
396
|
+
1. pragma block list + pragma modifier list — the big picture
|
|
397
|
+
2. Run the three Quality queries (summary, usage, guidelines)
|
|
398
|
+
3. Run Modifier Family Usage
|
|
399
|
+
4. Report the counts and the specific blocks; agree with the person what, if
|
|
400
|
+
anything, is alarming
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Full Audit
|
|
404
|
+
|
|
405
|
+
```text
|
|
406
|
+
1. Scope gate: agree dimensions and tiers with the person
|
|
407
|
+
2. Inventory: block list, tier list, modifier list, types-distribution query
|
|
408
|
+
3. Coverage queries, Quality queries, Consistency queries, Usage queries
|
|
409
|
+
4. Compare against the previous audit's report where one exists
|
|
410
|
+
5. Draft the report; resolve interpretation and priorities with the person
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Targeted Audit
|
|
414
|
+
|
|
415
|
+
| Concern | Queries to Run |
|
|
416
|
+
|---------|----------------|
|
|
417
|
+
| "Are we missing patterns?" | Coverage by tier, types distribution |
|
|
418
|
+
| "Is documentation complete?" | All Quality queries |
|
|
419
|
+
| "Are modifiers consistent?" | Modifier Family Usage, Components Without Modifiers |
|
|
420
|
+
| "Any orphaned elements?" | Orphaned Subcomponents |
|
|
421
|
+
| "What needs promotion?" | Promotion Candidates |
|
|
422
|
+
|
|
423
|
+
## Interpreting Results
|
|
424
|
+
|
|
425
|
+
Interpretation is where the working mode matters most. The queries return facts; what
|
|
426
|
+
they MEAN is judged against the team's intent:
|
|
427
|
+
|
|
428
|
+
- Prefer trends over absolutes: compare with the previous audit rather than against a
|
|
429
|
+
fixed "healthy" number.
|
|
430
|
+
- A gap can be deliberate (out-of-scope tier, deprecation in progress) — ask before
|
|
431
|
+
flagging.
|
|
432
|
+
- Distinguish data findings (a blank field IS blank) from judgment findings (a ratio
|
|
433
|
+
"looks" off) and label them differently in the report.
|
|
434
|
+
- Follow up drill-downs with `pragma graph inspect <IRI>` on the specific blocks a
|
|
435
|
+
query surfaced, and `pragma block lookup <Name>` for the human-readable view.
|
|
436
|
+
|
|
437
|
+
## Limitations
|
|
438
|
+
|
|
439
|
+
- Cannot assess visual design quality (only metadata)
|
|
440
|
+
- Cannot verify Figma link validity (only presence)
|
|
441
|
+
- Pattern quality is subjective (coverage is objective)
|
|
442
|
+
- Does not analyze implementation packages — the graph records what is DOCUMENTED,
|
|
443
|
+
and packages ship what is BUILT; the two run ahead of each other in both directions
|
|
444
|
+
(see `adoption-a2-components` for the export check)
|
|
445
|
+
|
|
446
|
+
## Support
|
|
447
|
+
|
|
448
|
+
If this skill leads somewhere broken — a command that errors, guidance that
|
|
449
|
+
contradicts what the live system answers, a gap the flow cannot cover — you are not
|
|
450
|
+
stuck:
|
|
451
|
+
|
|
452
|
+
- Raise an issue in the pragma repo: https://github.com/canonical/pragma/issues —
|
|
453
|
+
include the skill name, what was run, and expected vs. actual outcome.
|
|
454
|
+
- Or contact the design-system team owners directly through your organization's
|
|
455
|
+
professional messaging channels for assistance.
|