@agimon-ai/po-style-system-tooling 0.2.14-alpha.2 → 0.2.14-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +149 -21
- package/README.md +1 -2
- package/dist/cli.cjs +9 -41
- package/dist/cli.mjs +10 -42
- package/dist/index.cjs +229 -7
- package/dist/index.d.cts +361 -257
- package/dist/index.d.mts +360 -256
- package/dist/index.mjs +224 -2
- package/dist/{stdio-CT9XjOJQ.cjs → stdio-CSwuqV9E.cjs} +427 -660
- package/dist/{stdio-Dgaj2-_8.mjs → stdio-DBEflKj3.mjs} +415 -658
- package/package.json +22 -14
- package/skills/style-system/SKILL.md +43 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-style-system-tooling",
|
|
3
|
-
"version": "0.2.14-alpha.
|
|
3
|
+
"version": "0.2.14-alpha.21",
|
|
4
4
|
"description": "MCP server for exploring themes, Tailwind CSS classes, and UI components from Storybook with standalone component rendering capabilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typescript"
|
|
12
12
|
],
|
|
13
13
|
"homepage": "https://agimon.ai",
|
|
14
|
-
"license": "
|
|
14
|
+
"license": "BUSL-1.1",
|
|
15
15
|
"author": "Vuong Ngo",
|
|
16
16
|
"bin": {
|
|
17
17
|
"po-style-system-tooling": "./dist/cli.mjs"
|
|
@@ -40,29 +40,26 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@agimon-ai/foundation-exec": "0.27.
|
|
44
|
-
"@agimon-ai/foundation-validator": "0.27.
|
|
43
|
+
"@agimon-ai/foundation-exec": "0.27.14",
|
|
44
|
+
"@agimon-ai/foundation-validator": "0.27.14",
|
|
45
45
|
"@modelcontextprotocol/node": "2.1.1",
|
|
46
46
|
"@modelcontextprotocol/server": "2.3.1",
|
|
47
47
|
"@tailwindcss/vite": "4.3.3",
|
|
48
48
|
"@vitejs/plugin-react": "6.1.2",
|
|
49
49
|
"chalk": "5.6.2",
|
|
50
|
-
"commander": "
|
|
50
|
+
"commander": "15.0.0",
|
|
51
51
|
"glob": "13.0.6",
|
|
52
52
|
"inversify": "8.2.3",
|
|
53
|
-
"js-yaml": "5.
|
|
53
|
+
"js-yaml": "5.5.0",
|
|
54
54
|
"pino": "10.4.0",
|
|
55
|
-
"playwright": "^1.64.
|
|
56
|
-
"postcss": "8.5.
|
|
57
|
-
"react": "19.3.0",
|
|
58
|
-
"react-dom": "19.3.0",
|
|
59
|
-
"react-native-web": "0.21.4",
|
|
55
|
+
"playwright": "^1.64.1",
|
|
56
|
+
"postcss": "8.5.30",
|
|
60
57
|
"reflect-metadata": "0.2.2",
|
|
61
|
-
"sharp": "0.35.
|
|
62
|
-
"storybook": "10.6.
|
|
58
|
+
"sharp": "0.35.5",
|
|
59
|
+
"storybook": "10.6.2",
|
|
63
60
|
"tailwindcss": "4.3.3",
|
|
64
61
|
"vite": "8.3.4",
|
|
65
|
-
"vite-plugin-singlefile": "^2.3.
|
|
62
|
+
"vite-plugin-singlefile": "^2.3.4"
|
|
66
63
|
},
|
|
67
64
|
"devDependencies": {
|
|
68
65
|
"@babel/parser": "8.0.7",
|
|
@@ -75,14 +72,25 @@
|
|
|
75
72
|
"@types/react-dom": "19.3.0",
|
|
76
73
|
"@vitest/coverage-v8": "4.1.10",
|
|
77
74
|
"esbuild": "0.28.2",
|
|
75
|
+
"react": "19.3.1",
|
|
76
|
+
"react-dom": "19.3.1",
|
|
77
|
+
"react-native-web": "0.21.4",
|
|
78
78
|
"tsdown": "0.23.1",
|
|
79
79
|
"typescript": "6.0.3",
|
|
80
80
|
"vitest": "4.1.10",
|
|
81
81
|
"zod": "4.6.6"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
85
|
+
"react-dom": "^18.2.0 || ^19.0.0",
|
|
86
|
+
"react-native-web": "^0.19.0 || ^0.20.0 || ^0.21.0",
|
|
84
87
|
"zod": "^4.4.3"
|
|
85
88
|
},
|
|
89
|
+
"peerDependenciesMeta": {
|
|
90
|
+
"react-native-web": {
|
|
91
|
+
"optional": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
86
94
|
"scripts": {
|
|
87
95
|
"build": "tsdown",
|
|
88
96
|
"test": "vitest --run",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: style-system
|
|
3
|
-
description: 'Use the style-system CLI for frontend or design work that needs approved Tailwind classes, theme tokens, shared UI components, app-specific components, Storybook component visuals
|
|
3
|
+
description: 'Use the style-system tools (the design namespace in Po code mode, or the CLI outside Po) for frontend or design work that needs approved Tailwind classes, theme tokens, shared UI components, app-specific components, or Storybook component visuals. Trigger before writing UI styles or creating UI components.'
|
|
4
4
|
metadata:
|
|
5
5
|
paths:
|
|
6
6
|
- 'apps/*-app/src/**/*.tsx'
|
|
@@ -11,32 +11,55 @@ metadata:
|
|
|
11
11
|
|
|
12
12
|
# Style System
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Inside Po, call the style-system tools from code mode: the `design` namespace runs them in the Po server with one browser and one Vite dev server kept warm, so renders after the first take under a second. Run `discover({ namespace: 'design' })` for the full types. Run the relevant discovery call before creating new UI components or writing Tailwind classes.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Code mode (inside Po)
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
// Discovery: one exec can gather everything you need.
|
|
20
|
+
return {
|
|
21
|
+
classes: await design.cssClasses({ appPath: 'apps/{product}-app', category: 'all' }),
|
|
22
|
+
themes: await design.themes({ appPath: 'apps/{product}-app' }),
|
|
23
|
+
shared: await design.sharedComponents({}),
|
|
24
|
+
app: await design.appComponents({ appPath: 'apps/{product}-app' }),
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
// Visuals: each render returns { text, images }; image() shows it to you.
|
|
30
|
+
for (const darkMode of [false, true]) {
|
|
31
|
+
image(
|
|
32
|
+
await design.componentVisual({
|
|
33
|
+
componentName: 'Button',
|
|
34
|
+
appPath: 'apps/{product}-app',
|
|
35
|
+
storyName: 'Playground',
|
|
36
|
+
darkMode,
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- `appPath` resolves from the session folder. Batch renders for one app together: the dev server serves one app at a time and restarts when `appPath` changes.
|
|
43
|
+
- A failed render throws, so a script stops at the story that broke.
|
|
44
|
+
- `sharedComponents` and `appComponents` page with `cursor`; pass the cursor from the previous result.
|
|
45
|
+
|
|
46
|
+
## CLI (outside Po)
|
|
17
47
|
|
|
18
48
|
```bash
|
|
19
49
|
pnpm exec style-system get-css-classes --app-path apps/{product}-app --category all
|
|
20
|
-
pnpm exec style-system get-css-classes --theme-path ./packages/frontend/web-theme/dist/agiflow-theme.css --category colors
|
|
21
|
-
|
|
22
50
|
pnpm exec style-system list-shared-components
|
|
23
|
-
pnpm exec style-system list-shared-components --cursor <cursor>
|
|
24
|
-
|
|
25
51
|
pnpm exec style-system list-app-components --app-path apps/{product}-app
|
|
26
|
-
pnpm exec style-system list-app-components --app-path apps/{product}-app --cursor <cursor>
|
|
27
|
-
|
|
28
52
|
pnpm exec style-system list-themes --app-path apps/{product}-app
|
|
29
|
-
|
|
30
53
|
pnpm exec style-system get-ui-component --component-name Button --app-path apps/{product}-app --story-name Playground
|
|
31
|
-
pnpm exec style-system get-ui-component --component-name Button --app-path apps/{product}-app --story-name Default --dark-mode
|
|
32
54
|
```
|
|
33
55
|
|
|
56
|
+
The CLI starts a cold browser and a static build on every call, so prefer code mode whenever it is available.
|
|
57
|
+
|
|
34
58
|
## Workflow
|
|
35
59
|
|
|
36
|
-
- Before writing styles,
|
|
37
|
-
- Before creating a component,
|
|
38
|
-
- Before visual design or Storybook work,
|
|
39
|
-
- For component polish during implementation, `polish-component <file> --instructions "<text>"` is available, but it edits files and must not be used for read-only planning or review.
|
|
60
|
+
- Before writing styles, read `design.cssClasses` for the target app and use only supported token classes.
|
|
61
|
+
- Before creating a component, read `design.sharedComponents` and `design.appComponents` and reuse existing components when possible.
|
|
62
|
+
- Before visual design or Storybook work, read `design.themes` and render the closest existing component with `design.componentVisual`.
|
|
40
63
|
|
|
41
64
|
## React Native Story Composition
|
|
42
65
|
|
|
@@ -55,7 +78,7 @@ Apply this pattern to every data-heavy frontend surface, including native screen
|
|
|
55
78
|
- Stories target the View and compose it with representative fixture data and web-safe slots. They never render Containers or mock the router, API client, store, or SDK.
|
|
56
79
|
- Preserve the production route/page as the Container boundary, or delegate it to a colocated Container. Do not duplicate business logic in stories or create a catalog-only approximation of the surface.
|
|
57
80
|
- For a large surface, first extract its meaningful sections into presentational components, then compose those sections in the View. Do not replace a data-heavy page with one giant `children` slot.
|
|
58
|
-
- Verify each new `Playground` story with `
|
|
81
|
+
- Verify each new `Playground` story with `design.componentVisual`, then inspect the returned image for visual hierarchy, empty and loading states, overflow, and action placement.
|
|
59
82
|
|
|
60
83
|
### Expo Router web support
|
|
61
84
|
|
|
@@ -73,11 +96,10 @@ Component/
|
|
|
73
96
|
- Keep props identical across native and web files so Metro and the style-system Vite renderer select the platform implementation without story-specific branching.
|
|
74
97
|
- Never mock `expo-router` inside a story file. Use composition or a `.web.tsx` adapter.
|
|
75
98
|
- Apply the same platform adapter pattern to native-only SDK components that cannot be bundled for web.
|
|
76
|
-
-
|
|
99
|
+
- Render every added `Playground` story with `design.componentVisual`. A typecheck-only result is insufficient for router or native SDK composition.
|
|
77
100
|
|
|
78
101
|
## Rules
|
|
79
102
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
- If `pnpm exec style-system` is unavailable after dependency changes, run `pnpm install` and `pnpm nx build style-system`.
|
|
103
|
+
- Always pass `appPath` so the tools read the project's `style-system.config.yaml`. With the CLI, use `--theme-path` only when there is no target app path or the app config defines no theme path.
|
|
104
|
+
- Treat the tools' output as the allowed design surface: do not invent Tailwind token classes when they can list them.
|
|
105
|
+
- If the `design` namespace or `pnpm exec style-system` is unavailable after dependency changes, run `pnpm install` and rebuild `@agimon-ai/po-style-system-tooling`.
|