@atomazing-org/design-system 2.0.1 → 2.0.2

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 (23) hide show
  1. package/AGENTS.md +92 -0
  2. package/README.MD +45 -425
  3. package/dist/presets/index.d.ts +7 -1
  4. package/dist/presets/index.js +288 -306
  5. package/migrations/README.UPDATE.md +32 -20
  6. package/migrations/docs/migrations/design-system/README.md +48 -17
  7. package/migrations/docs/migrations/design-system/routes/adopt-existing/AEROCRM-EXAMPLE.md +197 -0
  8. package/migrations/docs/migrations/design-system/routes/adopt-existing/RUNBOOK.md +185 -25
  9. package/migrations/docs/migrations/design-system/routes/adopt-existing/migration.spec.json +68 -13
  10. package/migrations/docs/migrations/design-system/routes/greenfield/RUNBOOK.md +57 -25
  11. package/migrations/docs/migrations/design-system/routes/greenfield/migration.spec.json +28 -6
  12. package/migrations/docs/migrations/design-system/routes/mui4-to-latest/RUNBOOK.md +136 -77
  13. package/migrations/docs/migrations/design-system/routes/mui4-to-latest/migration.spec.json +89 -16
  14. package/migrations/docs/migrations/design-system/shared/WORKING-RULES.md +194 -0
  15. package/migrations/docs/migrations/design-system/shared/acceptance.md +76 -20
  16. package/migrations/docs/migrations/design-system/shared/common-regressions.md +218 -0
  17. package/migrations/docs/migrations/design-system/shared/gates.md +39 -3
  18. package/migrations/docs/migrations/design-system/shared/manual-qa-matrix.md +70 -0
  19. package/migrations/docs/migrations/design-system/shared/phase-exit-criteria.md +129 -0
  20. package/migrations/docs/migrations/design-system/shared/phases.md +377 -0
  21. package/migrations/skills/design-system-consumer-agent/SKILL.md +84 -0
  22. package/migrations/skills/design-system-migration-agent/SKILL.md +75 -9
  23. package/package.json +2 -1
@@ -9,20 +9,32 @@ Use this skill to run a design-system migration as an AI-guided workflow.
9
9
 
10
10
  Treat `migrations/docs/migrations/design-system/` as the source of truth.
11
11
  Treat `migrations/scripts/` as optional legacy automation/reference, not a requirement.
12
+ Read `../../docs/migrations/design-system/shared/WORKING-RULES.md` before selecting the route.
12
13
 
13
14
  ## Quick start
14
15
 
15
16
  1. Read `../../docs/migrations/design-system/README.md`.
16
- 2. Detect the route from the target app (`package.json`, imports, current theme setup).
17
- 3. Read only the selected route files:
17
+ 2. Read `../../docs/migrations/design-system/shared/WORKING-RULES.md`.
18
+ 3. Read `../../docs/migrations/design-system/shared/phases.md`.
19
+ 4. Detect the route from the target app (`package.json`, imports, current theme setup).
20
+ 5. Read only the selected route files:
18
21
  - `../../docs/migrations/design-system/routes/<route>/RUNBOOK.md`
19
22
  - `../../docs/migrations/design-system/routes/<route>/migration.spec.json`
20
- 4. Read shared checks:
23
+ 6. Read shared checks:
21
24
  - `../../docs/migrations/design-system/shared/FOUNDATION.md`
25
+ - `../../docs/migrations/design-system/shared/WORKING-RULES.md`
26
+ - `../../docs/migrations/design-system/shared/phases.md`
27
+ - `../../docs/migrations/design-system/shared/phase-exit-criteria.md`
28
+ - `../../docs/migrations/design-system/shared/common-regressions.md`
29
+ - `../../docs/migrations/design-system/shared/manual-qa-matrix.md`
22
30
  - `../../docs/migrations/design-system/shared/gates.md`
23
31
  - `../../docs/migrations/design-system/shared/acceptance.md`
24
32
  - `../../docs/migrations/design-system/shared/rollback.md` (before risky edits)
25
- 5. Execute the migration in small commits, validating after each major step.
33
+ 7. Execute the migration in small commits, validating after each major step.
34
+ 8. For large repos, keep the migration phase-gated:
35
+ - keep the app runnable at the end of each phase
36
+ - keep one main change class per phase
37
+ - stabilize shared infrastructure before domain-by-domain waves
26
38
 
27
39
  ## Select route
28
40
 
@@ -35,22 +47,36 @@ Inspect the target app repository:
35
47
  - Else:
36
48
  - use `adopt-existing`
37
49
 
50
+ Use migration instead of ad hoc integration if the request would otherwise leave
51
+ multiple theme providers, multiple theme state stores, or a large unresolved token layer.
52
+
38
53
  If detection is ambiguous, stop and ask the user which route to prefer.
39
54
 
40
55
  ## Execute workflow (AI-driven, no local migration scripts required)
41
56
 
42
- 1. Create a short plan and name the selected route.
57
+ 1. Create a phased plan and name the selected route.
58
+ - use `shared/phases.md` as the default step-by-step scaffold for the plan
59
+ - For large repos, define explicit stop-gates between dependency landing, mechanical migration, root theme unification, runtime cleanup, shared infrastructure, domain waves, and final closeout.
43
60
  2. Run baseline checks (`npm test`, `npm run build`, and `npm run lint` when available).
44
- 3. Parse `migration.spec.json` and convert each step into concrete actions:
61
+ - If the repo exposes contract gates such as `npm run lint:style-contract`,
62
+ `npm run lint:design-contract`, or `npm run lint:typography-contract`,
63
+ include them in the baseline and closeout pass.
64
+ - If the repo exposes smoke or e2e coverage for shell, protected routes, or
65
+ overlays such as `npm run test:smoke`, include that in the migration gate.
66
+ 3. Run the repo's normal dev/start command and verify the app reaches the first route in a real browser before and after migration work.
67
+ 4. Parse `migration.spec.json` and convert each step into concrete actions:
45
68
  - execute `run` commands when they are generic and safe;
46
69
  - if a `run` command references `migrations/scripts/*`, perform the intent manually:
47
70
  - dependency updates: edit `package.json` directly;
48
71
  - route detection: inspect `package.json` and imports directly;
49
72
  - token replacements: use CSV mapping + targeted search/replace + manual review;
50
73
  - gates: use `rg` searches and test/build commands.
51
- 4. Execute `manualReview` items as explicit subtasks and record what was changed.
52
- 5. Re-run route gates and shared acceptance checks.
53
- 6. Summarize:
74
+ 5. Execute `manualReview` items as explicit subtasks and record what was changed.
75
+ - Do not batch dependency upgrades, shell rewrites, and broad token cleanup into one unvalidated change set.
76
+ - If shell, overlays, or shared primitives are in scope, add or tighten smoke coverage before broad refactors.
77
+ 6. If install scripts fail because of repo tooling such as Husky, retry with the package manager's `--ignore-scripts` equivalent only as a recovery path, then continue with the intended validation commands.
78
+ 7. Re-run route gates and shared acceptance checks, including runtime startup verification in a real browser.
79
+ 8. Summarize:
54
80
  - selected route;
55
81
  - files changed;
56
82
  - remaining manual follow-up (visual QA, edge screens, regressions).
@@ -75,6 +101,45 @@ Use these substitutions when specs mention local `.mjs` helpers:
75
101
 
76
102
  Prefer `rg` for all searches.
77
103
 
104
+ ## Runtime Startup Gate
105
+
106
+ Do not close a migration on the basis of build success alone.
107
+
108
+ - Start the app with the repo's normal dev/start command.
109
+ - Open the first route in a real browser.
110
+ - Fix startup console errors before closeout.
111
+ - Fix migration-caused startup warnings before closeout when they indicate broken runtime alignment.
112
+ - If `react`, `react-dom`, `@emotion/react`, or `@emotion/styled` are loaded more than once, align bundler/runtime configuration with dedupe, aliasing, or singleton-sharing.
113
+ - Remove module-scope code that depends on browser APIs, storage, or i18n locale activation.
114
+ - Verify that the active preset still owns the application background after migration.
115
+ - If root shells, layouts, or page wrappers set page-level `background` or `backgroundColor`, remove those overrides unless they are intentional component surfaces.
116
+ - If shell workspaces or route-level content panes were touched, verify the main page root still fills the available content region instead of collapsing to content width or leaving empty workspace.
117
+ - If shared charts, legends, chips, segmented filters, or compact status controls were touched, verify they still read as preset-aligned UI instead of ad hoc chip-like chrome.
118
+ - Keep preset selection explicit in one app-owned theme module instead of generic constants passthrough files.
119
+ - If several role-based pages share the same structural shell, extract a shared workflow layout contract before continuing with visual cleanup.
120
+ - If a local barrel re-export introduces circular chunk warnings, switch the affected app internals to direct local imports.
121
+ - Fix consumer-owned build warnings such as stale asset globs or oversized local chunks with config and bundling changes.
122
+ - If a remaining build warning is emitted by an upstream toolchain package, record the exact package and file rather than pretending the app owns it.
123
+ - Audit visible text when UI components are touched:
124
+ - use `Typography` with explicit `variant`
125
+ - wrap visible text in `Button`, `ToggleButton`, `MenuItem`, `Chip`, and `Alert` with `Typography component="span"`
126
+ - if typography regressions are broad, add or update a repo-local typography contract check and keep it green
127
+ - If raw token drift is broad, add or update a repo-local design-contract check for hardcoded colors, raw numeric font sizes, or ad hoc radius/opacity values and keep it green
128
+ - Expand the design-contract check when needed so it also catches decorative gradients, direct shadow styling, theme shadow-token drift, palette alpha suffix hacks, and unapproved visual-preview exceptions
129
+ - If the consumer repo already enforces a style-contract or styleless-UI rule, keep that gate green during the migration instead of treating it as unrelated local debt
130
+ - If a migrated consumer component still carries a large inline `sx` object, extract that styling into a local `styled(...)` component in the same file and keep the styled declarations near the bottom of the file
131
+ - If bulk replacements, codemods, or encoding-sensitive file rewrites touched localized copy, scan for mojibake or replacement characters and verify at least one real localized route renders readable text
132
+ - Remove zero-value surface wrappers that only forward to MUI `Card` or `Paper`
133
+ - Replace palette-string alpha hacks with theme helpers such as `alpha()`
134
+ - Treat consumer-owned gradient or shadow chrome on normal surfaces as a migration defect unless it is an explicitly documented preview exception
135
+ - When shared overlays are touched:
136
+ - keep `aria-labelledby` and `aria-describedby` wired through stable ids
137
+ - label close actions explicitly
138
+ - hide decorative bottom-sheet chrome from assistive tech when it carries no state
139
+ - use `combobox` and `listbox` semantics for overlay search UIs with keyboard filtering
140
+ - Keep browser event listeners such as `beforeinstallprompt` or `matchMedia` subscriptions inside effects with cleanup instead of render paths or module scope
141
+ - Prefer smoke checks through stable overlay entrypoints if overlay infrastructure changes during migration
142
+
78
143
  ## Required outputs
79
144
 
80
145
  Produce all of the following in the final response/work log:
@@ -82,6 +147,7 @@ Produce all of the following in the final response/work log:
82
147
  - selected route and why
83
148
  - completed steps vs skipped steps
84
149
  - exact commands run
150
+ - startup issues found and how they were fixed
85
151
  - unresolved warnings / manual QA checklist
86
152
  - rollback guidance if migration is partial
87
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomazing-org/design-system",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@9.14.4",
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "files": [
34
34
  "dist",
35
+ "AGENTS.md",
35
36
  "README.MD",
36
37
  "migrations/README.UPDATE.md",
37
38
  "migrations/docs",