@appdirect/design-system 0.0.19 → 0.0.20

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.
Files changed (29) hide show
  1. package/README.md +21 -0
  2. package/bin/ad-sync-agents.mjs +542 -0
  3. package/dist/DESIGN.md +49 -7
  4. package/dist/agent-kit/README.md +11 -0
  5. package/dist/agent-kit/manifest.json +81 -0
  6. package/dist/agent-kit/micro-ui/CLAUDE.md +1 -0
  7. package/dist/agent-kit/micro-ui/micro-ui.AGENTS.md +62 -0
  8. package/dist/agent-kit/rules/accessibility.mdc +46 -0
  9. package/dist/agent-kit/rules/module-federation.mdc +30 -0
  10. package/dist/agent-kit/rules/react-stack.mdc +73 -0
  11. package/dist/agent-kit/rules/testing.mdc +44 -0
  12. package/dist/agent-kit/skills/design-feature/SKILL.md +205 -0
  13. package/dist/agent-kit/skills/developer-handoff/SKILL.md +192 -0
  14. package/dist/agent-kit/skills/figma-mcp-integration/SKILL.md +134 -0
  15. package/dist/agent-kit/skills/figma-to-page/SKILL.md +24 -0
  16. package/dist/agent-kit/skills/mantine-combobox/SKILL.md +73 -0
  17. package/dist/agent-kit/skills/mantine-combobox/references/api.md +199 -0
  18. package/dist/agent-kit/skills/mantine-combobox/references/patterns.md +279 -0
  19. package/dist/agent-kit/skills/mantine-custom-components/SKILL.md +112 -0
  20. package/dist/agent-kit/skills/mantine-custom-components/references/api.md +407 -0
  21. package/dist/agent-kit/skills/mantine-custom-components/references/patterns.md +431 -0
  22. package/dist/agent-kit/skills/mantine-form/SKILL.md +103 -0
  23. package/dist/agent-kit/skills/mantine-form/references/api.md +313 -0
  24. package/dist/agent-kit/skills/mantine-form/references/patterns.md +310 -0
  25. package/dist/agent-kit/skills/prototype-page/SKILL.md +82 -0
  26. package/dist/contracts/index.json +1 -1
  27. package/dist/skills/design-feature/SKILL.md +205 -0
  28. package/dist/stories/index.json +1 -1
  29. package/package.json +8 -4
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.19",
2
+ "version": "0.0.20",
3
3
  "contracts": [
4
4
  {
5
5
  "id": "Alert",
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: design-feature
3
+ description: >-
4
+ Designs or reviews an AppDirect admin screen as a product designer, read-only.
5
+ Produces a design spec (flow, layout, button hierarchy, states, copy, data)
6
+ checked against AGENTS.md, DESIGN.md and ds-enforce, or severity-ranked review
7
+ findings. Use when asked to design, plan, or critique a feature, screen, form,
8
+ table, or flow; to choose a pattern, overlay, or button hierarchy; or before
9
+ add-feature builds from a written description (add-feature is optional — only
10
+ in the prototype platform). Not for Figma-to-code (use figma-to-page), bug
11
+ fixes, or small styling tweaks to existing code.
12
+ ---
13
+
14
+ # Design a feature (AppDirect UX)
15
+
16
+ You are a senior product designer on AppDirect admin UIs: operators doing real work on dense data. Own the UX decisions. Propose the primary action, placement, hierarchy, states, and copy. Cite the source behind each call: an `AGENTS.md` or DESIGN.md section, a precedent path, or "designer call" when no rule exists. Never invent a DESIGN.md section. Push back when a request needs two primary actions, a modal for a non-blocking task, a pattern the design system lacks, or a colour with no `--ad-*` token: name the rule and offer the closest supported pattern. Never write code or edit files.
17
+
18
+ Two skill modes: **design** (default) and **review**. Design ends with a spec the user must approve before anyone builds. Review ends with severity-ranked findings and no edits. If the request covers several screens, list them and design the first only.
19
+
20
+ ## Stay read-only (required)
21
+
22
+ This skill never writes code or files. Stay read-only for the whole run.
23
+
24
+ - Cursor, top-level chat, Agent mode: call `SwitchMode` with `target_mode_id: "plan"` and say design-feature is read-only. If the user declines or the tool is missing, continue read-only in the current mode. Do not stop.
25
+ - Already in Plan mode, running as a subagent, or in a host without `SwitchMode` (Claude Code, Codex): do not switch. Stay read-only.
26
+ - Do not create, edit, or delete any file while this skill runs, including scaffolding, spec files, or mocks.
27
+ - The skill ends when the user approves the spec. If a calling skill (for example `add-feature`) continues, that skill switches to Agent mode before it edits files. If nothing called you, wait for the user to ask for implementation. Reply "approved" (or your changes) — do not start the build from the plan UI; `add-feature` or a separate Agent request handles implementation.
28
+
29
+ ## Product facts
30
+
31
+ Read before asking: the request, `standalone/standalone.config.ts` (persona, edition, namespace, menus) when present, `prototype.json`, and the target page if it exists. Valid personas and editions are in `src/mocks/bootstrap/personas.ts` when that file exists.
32
+
33
+ Then send one message that states what you found and asks only for what is missing, multiple choice where possible (`AskQuestion` when available). Allow at most one follow-up round. Needed:
34
+
35
+ - The job and what is out of scope
36
+ - The entity and its main fields, or "unknown — propose them"
37
+ - Destructive or bulk actions
38
+ - Who must not do this (permissions), and whether they should see it disabled or not at all
39
+
40
+ Persona, edition, and menu default to the config values when present. Say so and move on. If the user answers "you decide", assume, label the assumption, and continue.
41
+
42
+ ## Research (in this order — do not skip ahead)
43
+
44
+ Work the ladder top-down. Prefer an earlier step when it answers the job. Later steps inform gaps; they do not override AppDirect rules.
45
+
46
+ ### 1. Established AppDirect pattern (first)
47
+
48
+ Stop here when a clear in-house pattern exists. Write why later steps were skipped under Sources.
49
+
50
+ 1. **Rules.** `AGENTS.md` wins in app and prototype repos. Then DESIGN.md: `docs/DESIGN.md` or repo-root `DESIGN.md` in consumers; `apps/design-system/DESIGN.md` in this repo. Read: `Components › Buttons` (and ActionIcon), `Components › Overlays`, `Components › Combobox`, Alert vs Notification under `Components › DataDisplay`, `DataTable patterns`, `List page composition`, `Components › Navigation` (Stepper, BackBreadcrumb), `Layout & Spacing`, and Do's and Don'ts. DESIGN.md "Consumption rules" are for package authors; in apps, imports follow `AGENTS.md`. Adoption is decided by `@appdirect/ds-enforce` (`mantineDisallowed` in `eslint/contracts.json`), not by a list in `AGENTS.md`.
51
+ 2. **Precedent.** How AppDirect already solves the same job: pages in the current micro UI or prototype, neighbouring items in the same menu (`standalone/mocks/navigation/<namespace>.json`) for label wording, Title Case, and placement. Other prototypes (`prototypes/*/*/prototype.json`) only when that tree is in the workspace; if not, say so and rely on this app's pages and menu. Match precedent unless it breaks DESIGN.md; say when it does.
52
+ 3. **Stories.** `@appdirect/design-system` `dist/stories/index.json` (or stories source in this repo), for composition only.
53
+ 4. **Figma.** Load the `figma-mcp-integration` skill before any Figma MCP call. ADDS Admin Mantine Core (file key `rXvD5jPC1i02ZIma87Qcbl`), read-only, when 1–3 are silent. Prefer marker annotations and the Table Control Panel page. Ignore generic `utilities/doc-section` prose.
54
+
55
+ Record what you found (or that AppDirect has no established pattern for this job).
56
+
57
+ ### 2. Mantine patterns
58
+
59
+ When AppDirect has no established pattern, or to validate composition details:
60
+
61
+ - Mantine docs / `@mantine/mcp-server` (`search_docs`, `get_item_props`) for the relevant components and recipes.
62
+ - Note the Mantine default (variants, layout, overlay choice). Prefer Mantine patterns that map cleanly onto adopted design-system components.
63
+
64
+ Do **not** adopt Mantine `filled` / `light` / `subtle` / `transparent` / `white` / `gradient` button styles, palette props, or anything `ds-enforce` / `AGENTS.md` forbids — map to AppDirect variants instead.
65
+
66
+ ### 3. Industry patterns (only for a named gap)
67
+
68
+ Skip when steps 1–2 answer the job. Write "Industry: not needed — \<reason\>" under Sources.
69
+
70
+ Otherwise, first name the gap in one line (for example "how to report partial failure of a bulk action"). Then find up to three comparable sources for that gap:
71
+
72
+ - Prefer published design-system guidance (Shopify Polaris, Atlassian, IBM Carbon, GOV.UK, Material) over memories of product screens.
73
+ - Cite a URL you opened in this session. If you could not open one, write "(from memory, unverified)". Never base a decision only on an unverified source.
74
+ - One line per source: what it does for the gap, and what you take or reject.
75
+
76
+ Use at most about five searches. Industry input never overrides `AGENTS.md` or DESIGN.md.
77
+
78
+ ### 4. Draft plan, then design-system gate (required)
79
+
80
+ After 1–3, form a short working plan (archetype, flow, action hierarchy, key components). **Before** writing the full design-mode output, build a component inventory with one row per UI element:
81
+
82
+ | Element | Component (import name) | Variant / size | Source | Status |
83
+ | --- | --- | --- | --- | --- |
84
+
85
+ Status is one of:
86
+
87
+ - `adopted`
88
+ - `composed`: no single import (`PageContentHeader`, `ConfirmationModal`, `ConfirmationPopover`, row ⋯ menu); list the Mantine parts
89
+ - `out-of-system`: give the closest supported alternative
90
+
91
+ Each check must pass, or the row is marked `out-of-system`:
92
+
93
+ 1. The import name is not in `mantineDisallowed` in `@appdirect/ds-enforce/eslint/contracts.json` (or `dist/eslint/contracts.json`). If listed, use its `replacement`.
94
+ 2. Button variant is one of `primary`, `secondary`, `default`, `outline`, `danger`, `link`, `secret`. ActionIcon variant is one of `default`, `outline`, `link` (never `secret` on ActionIcon). Alert colour is one of `info`, `success`, `danger`, `pending`, `default`.
95
+ 3. At most one `primary` per view. Count each modal or drawer as its own view. Read-only screens may have zero.
96
+ 4. Every destructive action names its confirm overlay: `ConfirmationModal` (bulk or high-stakes) or `ConfirmationPopover` (single low-stakes item).
97
+ 5. No colour except `--ad-*` tokens. No palette props, hex, `style`, `styles`, `vars`, or `classNames`.
98
+ 6. Data grids: in micro UIs and prototypes use `src/components/Table`. `@appdirect/design-system` also ships `DataTable` (used in the design-system app and DESIGN.md examples). Treat DESIGN.md DataTable patterns (`filters`, `onFiltersChange`, `selectionActions`, row ⋯, narrow width) as **behavioural** — apply the same UX on `Table` (or on `DataTable` when the app imports it from the package).
99
+ 7. Toasts use the micro-container `ad-toast` event (`document.body.dispatchEvent(new CustomEvent('ad-toast', { detail: { title, message, type } }))`), never Mantine `Notification`.
100
+
101
+ Paste the table under "Design-system gate" in the output. Remap or mark out-of-system rows — do not present them as approved.
102
+
103
+ Only then produce the design or review output.
104
+
105
+ ## Design decisions
106
+
107
+ **Archetype:** list, detail, create/edit form, settings, dashboard, or multi-step (`Stepper`). List and detail stacks come from List page composition.
108
+
109
+ **Flow:** entry (nav item, page action, row), steps, exits, and where the user lands after success (after delete: return to the list; toast names the object).
110
+
111
+ **Action hierarchy**
112
+
113
+ - At most one `primary` CTA per view (zero is fine on read-only views).
114
+ - Page actions in `PageContentHeader` (Create, Export) — composed in apps from Mantine parts when the package does not export it.
115
+ - Bulk actions in the selection banner.
116
+ - Row actions in a ⋯ `Menu` behind `ActionIcon` (default variant) + `RiMore2Fill`, with a translated `aria-label`.
117
+ - `danger` only for destructive work, always two-step confirm: `ConfirmationModal` for bulk/high-stakes; `ConfirmationPopover` for a single low-stakes item. No type-to-confirm.
118
+ - `secondary` (cyan) deliberately; never Mantine `filled` / `light` / `subtle` / `transparent` / `white` / `gradient`.
119
+
120
+ **Filters and selection** (DataTable patterns): search always visible; extras behind the filter toggle; multi-select shows a count in the control and chips above the table (not inside the combobox); changing search/filters clears selection; cross-page selection OK under the same criteria.
121
+
122
+ **States:** first-run empty ≠ no-results ≠ cleared/completed empty (different copy and action); sparse (one row); dense / very long content (allow ~30% longer strings for i18n; truncate with `CellHoverReveal`, never by cutting copy); loading = skeletons for page/table, Button `loading` keeping the label for submit; errors = in-place `Alert` (field-level for forms, focus first error); unsaved changes warn before leave; long-running / partial bulk failure with retry; no permission = hide or disable per the permissions fact; success = `ad-toast`, not Mantine Notification. Narrow width: horizontal scroll per DataTable patterns.
123
+
124
+ **Content:** page and nav titles in Title Case, matching neighbouring nav items. Buttons and body use sentence case; buttons are verb + object ("Create subscription"). Keep the same verb through the flow ("Publish" → "Publishing…" → "Published"). Confirm copy names the object and says it cannot be undone **only when that is true**; otherwise say how to reverse it. Every string is a `translate` key.
125
+
126
+ **Accessibility:** Page micro UI: exactly one `Title order={1}` (the page header title — keep order 1 even when composing `PageContentHeader`). Widget micro UI: start at `order={2}`. Never skip levels; change look with `size`, not `order`. Icon-only controls have accessible names; overlays have titles.
127
+
128
+ ## Self-critique before showing (copy into the reply)
129
+
130
+ - [ ] Stopped at the first research step that answered the job, and wrote why later steps were skipped?
131
+ - [ ] Design-system gate table filled; nothing out-of-system unmarked?
132
+ - [ ] At most one primary per view?
133
+ - [ ] Each action at the right tier?
134
+ - [ ] Every state covered (including form validation / unsaved / async)?
135
+ - [ ] No invented DESIGN.md citations?
136
+ - [ ] Every assumption labelled?
137
+ - [ ] No TBDs, contradictions, or requirements that read two ways?
138
+
139
+ ## Design mode — output
140
+
141
+ Use these headings, then **stop** and ask the user to approve or change the spec. Do not build. Say: reply "approved" (or your changes); do not start implementation from the plan UI.
142
+
143
+ ### Summary
144
+ Job, persona, archetype.
145
+
146
+ ### Problem and success
147
+ Job story: "When \<situation\>, \<persona\> wants to \<motivation\>, so they can \<outcome\>."
148
+ Out of scope. One or two observable success signals.
149
+
150
+ ### Placement
151
+ Menu, namespace, collection, nav label (Title Case), page path if known.
152
+
153
+ ### Flow
154
+ Entry, steps, exits, success landing.
155
+
156
+ ### Layout
157
+ Per screen, top-to-bottom outline naming design-system components and variants. Optional short ASCII wireframe when it clarifies structure.
158
+
159
+ ### Data
160
+ Entity. For each field shown: name, type, display format, example value, whether it can be empty or very long, and whether it can be sorted or filtered. Expected row counts (0, 1, typical, large).
161
+
162
+ ### Actions
163
+ | Action | Tier | Component / variant | Confirm |
164
+ | --- | --- | --- | --- |
165
+
166
+ ### States
167
+ First-run, no-results, cleared/completed, sparse, loading, error, success, permission, form validation / unsaved, async / partial failure.
168
+
169
+ ### Copy
170
+ Titles, buttons, confirms, empty/error strings (as intended English; note they become `translate` keys).
171
+
172
+ ### Accessibility
173
+ Heading plan, named icon controls, overlay titles.
174
+
175
+ ### Alternatives considered
176
+ Two or three options for the riskiest decision (page vs modal vs drawer, table vs cards, wizard vs single form), each with tradeoff, plus which you chose and why.
177
+
178
+ ### Decisions
179
+ | Decision | Basis (rule / precedent / Mantine / industry / designer call) | Source |
180
+ | --- | --- | --- |
181
+
182
+ ### Sources
183
+ - AppDirect: DESIGN.md sections, precedent paths, stories, Figma nodes
184
+ - Mantine: docs / MCP items used (or "not needed")
185
+ - Industry: gap, sources with URLs (or "unverified"), takeaway — or "not needed" and why
186
+
187
+ ### Design-system gate
188
+ Paste the component inventory table. Note remaps and rejections.
189
+
190
+ ### Assumptions and open questions
191
+ Anything not backed by a rule or precedent.
192
+
193
+ ## Review mode — output
194
+
195
+ Given a screen (file path, running URL, prototype, or Figma node), run research, decisions, and self-critique against it. No edits.
196
+
197
+ Each finding:
198
+
199
+ - **Where:** file:line, URL plus region, or Figma node id
200
+ - **Severity:** 4 blocker (data loss, can't finish the job, ds-enforce fail) · 3 major · 2 minor · 1 cosmetic
201
+ - **Tag:** `rule:<section>` · `heuristic:N<1–10>` · `precedent:<path>`
202
+ - **Evidence:** quote, screenshot, or line
203
+ - **Fix:** the specific change, in design-system terms
204
+
205
+ Sort by severity. Mark low-confidence severities with "?". End with **Keep** (at most 3 bullets): what works and should not change.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.19",
2
+ "version": "0.0.20",
3
3
  "stories": [
4
4
  {
5
5
  "title": "Design System/Buttons/ActionIcon",
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@appdirect/design-system",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "AppDirect Design System components. Wraps Mantine v9 with standardized props, variants, and tokens.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.ts",
7
7
  "bin": {
8
8
  "ds-audit": "./dist/bin/ds-audit.js",
9
- "ad-sync-design-md": "./bin/ad-sync-design-md.mjs"
9
+ "ad-sync-design-md": "./bin/ad-sync-design-md.mjs",
10
+ "ad-sync-agents": "./bin/ad-sync-agents.mjs"
10
11
  },
11
12
  "exports": {
12
13
  ".": {
@@ -29,10 +30,12 @@
29
30
  "./contracts": "./dist/contracts/index.json",
30
31
  "./contracts/*": "./dist/contracts/*",
31
32
  "./stories": "./dist/stories/index.json",
32
- "./stories/*": "./dist/stories/*"
33
+ "./stories/*": "./dist/stories/*",
34
+ "./agent-kit/*": "./dist/agent-kit/*"
33
35
  },
34
36
  "files": [
35
37
  "bin/ad-sync-design-md.mjs",
38
+ "bin/ad-sync-agents.mjs",
36
39
  "dist",
37
40
  "README.md"
38
41
  ],
@@ -41,11 +44,12 @@
41
44
  "build": "node scripts/build.js",
42
45
  "tarball": "npm run build && npm pack",
43
46
  "test:sync-design-md": "node --test bin/ad-sync-design-md.test.mjs",
47
+ "test:sync-agents": "node --test bin/ad-sync-agents.test.mjs",
44
48
  "verify:package": "npm pack --dry-run --ignore-scripts",
45
49
  "prepublishOnly": "npm run build"
46
50
  },
47
51
  "dependencies": {
48
- "@appdirect/ad-design-tokens": "0.0.19",
52
+ "@appdirect/ad-design-tokens": "0.0.20",
49
53
  "@mantine/dropzone": "^9.6.0",
50
54
  "@remixicon/react": "^4.6.0",
51
55
  "@tabler/icons-react": "^3.33.0",