@agimon-ai/style-system 0.1.1

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/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@agimon-ai/style-system",
3
+ "version": "0.1.1",
4
+ "description": "MCP server for exploring themes, Tailwind CSS classes, and UI components from Storybook with standalone component rendering capabilities",
5
+ "keywords": [
6
+ "design-system",
7
+ "mcp",
8
+ "model-context-protocol",
9
+ "storybook",
10
+ "tailwind",
11
+ "typescript"
12
+ ],
13
+ "homepage": "https://agimon.ai",
14
+ "license": "MIT",
15
+ "author": "Vuong Ngo",
16
+ "bin": {
17
+ "style-system": "./dist/cli.mjs"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "skills",
22
+ "README.md"
23
+ ],
24
+ "type": "module",
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.mjs",
27
+ "types": "./dist/index.d.cts",
28
+ "exports": {
29
+ ".": {
30
+ "import": "./dist/index.mjs",
31
+ "require": "./dist/index.cjs"
32
+ },
33
+ "./cli": {
34
+ "import": "./dist/cli.mjs",
35
+ "require": "./dist/cli.cjs"
36
+ },
37
+ "./package.json": "./package.json"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "1.29.0",
44
+ "@tailwindcss/vite": "4.3.3",
45
+ "@vitejs/plugin-react": "6.0.3",
46
+ "chalk": "5.6.2",
47
+ "commander": "14.0.3",
48
+ "glob": "13.0.6",
49
+ "inversify": "8.2.1",
50
+ "js-yaml": "5.2.1",
51
+ "pino": "10.3.1",
52
+ "playwright": "^1.63.0",
53
+ "postcss": "8.5.19",
54
+ "react": "19.2.7",
55
+ "react-dom": "19.2.7",
56
+ "react-native-web": "0.21.2",
57
+ "reflect-metadata": "0.2.2",
58
+ "sharp": "0.34.5",
59
+ "storybook": "10.5.2",
60
+ "tailwindcss": "4.3.3",
61
+ "vite": "8.1.5",
62
+ "vite-plugin-singlefile": "^2.3.3",
63
+ "@agimon-ai/foundation-exec": "0.26.23"
64
+ },
65
+ "devDependencies": {
66
+ "@babel/parser": "8.0.0",
67
+ "@babel/traverse": "8.0.0",
68
+ "@babel/types": "8.0.0",
69
+ "@types/babel__traverse": "7.28.0",
70
+ "@types/node": "26.1.1",
71
+ "@types/react": "19.2.17",
72
+ "@types/react-dom": "19.2.3",
73
+ "esbuild": "0.28.0",
74
+ "tsdown": "0.22.14",
75
+ "typescript": "6.0.3",
76
+ "vitest": "4.1.10",
77
+ "zod": "4.4.3"
78
+ },
79
+ "peerDependencies": {
80
+ "zod": "^4.4.3"
81
+ },
82
+ "scripts": {
83
+ "build": "tsdown",
84
+ "test": "vitest --run",
85
+ "typecheck": "tsc --noEmit",
86
+ "lint": "oxlint . && oxfmt . --check",
87
+ "fixcode": "oxlint . --fix && oxfmt ."
88
+ }
89
+ }
@@ -0,0 +1,83 @@
1
+ ---
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, or design-system-aware component polish. Trigger before writing UI styles or creating UI components.'
4
+ metadata:
5
+ paths:
6
+ - 'apps/*-app/src/**/*.tsx'
7
+ - 'apps/*-mcp-app/src/**/*.tsx'
8
+ - 'packages/frontend/**/src/**/*.tsx'
9
+ - 'packages/mcp/style-system/**'
10
+ ---
11
+
12
+ # Style System
13
+
14
+ Use `pnpm exec style-system`, not MCP tools, for UI token, theme, component, and visual discovery. Run the relevant discovery command before creating new UI components or writing Tailwind classes.
15
+
16
+ ## Commands
17
+
18
+ ```bash
19
+ 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
+ pnpm exec style-system list-shared-components
23
+ pnpm exec style-system list-shared-components --cursor <cursor>
24
+
25
+ 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
+ pnpm exec style-system list-themes --app-path apps/{product}-app
29
+
30
+ 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
+ ```
33
+
34
+ ## Workflow
35
+
36
+ - Before writing styles, run `get-css-classes` for the target app and use only supported token classes.
37
+ - Before creating a component, run `list-shared-components` and `list-app-components --app-path <app>` and reuse existing components when possible.
38
+ - Before visual design or Storybook work, run `list-themes --app-path <app>` and `get-ui-component` for the closest existing component.
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.
40
+
41
+ ## React Native Story Composition
42
+
43
+ - Target presentational `View` components in stories. Do not render smart screens that call Expo Router, generated API hooks, stores, or native SDKs.
44
+ - Extract screen state into serializable View props and callbacks. Keep router calls in the smart wrapper and pass callbacks such as `onBack`, `onOpenTask`, or `onSignIn` to the View.
45
+ - Compose native-only content through props such as `renderHeader`, `renderLink`, `renderWidget`, or `renderEmptyState`. Stories provide deterministic web-safe React Native elements for those slots.
46
+ - Prefer callback composition over importing `Link`, `Redirect`, `Stack`, `Tabs`, or router hooks into a story target.
47
+
48
+ ## Data-Heavy Surface Composition
49
+
50
+ Apply this pattern to every data-heavy frontend surface, including native screens, web pages, route content, dashboards, settings pages, detail pages, and feature panels.
51
+
52
+ - Split a monolithic surface into a **Container** and a presentational **View** before adding or repairing its story.
53
+ - Keep API hooks, query or store access, mutations, router calls, SDK calls, derived domain state, and side effects in the Container.
54
+ - Give the View serializable display props, event callbacks, and render slots for nested or platform-specific content. The View must be able to render from deterministic fixture data alone.
55
+ - 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
+ - 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
+ - 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 `get-ui-component`, then inspect the returned image for visual hierarchy, empty and loading states, overflow, and action placement.
59
+
60
+ ### Expo Router web support
61
+
62
+ When a presentation component must retain an Expo Router component, add a web implementation with the same exported component and props:
63
+
64
+ ```text
65
+ Component/
66
+ ├── View.tsx
67
+ ├── View.web.tsx
68
+ └── View.stories.tsx
69
+ ```
70
+
71
+ - Keep `View.tsx` as the native implementation.
72
+ - In `View.web.tsx`, replace Expo Router navigation elements with web-safe React Native composition, normally `Pressable`, `Text`, and injected navigation callbacks.
73
+ - 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
+ - Never mock `expo-router` inside a story file. Use composition or a `.web.tsx` adapter.
75
+ - Apply the same platform adapter pattern to native-only SDK components that cannot be bundled for web.
76
+ - Run `get-ui-component` for every added `Playground` story. A typecheck-only result is insufficient for router or native SDK composition.
77
+
78
+ ## Rules
79
+
80
+ - Prefer `--app-path` so the CLI reads the project's `style-system.config.yaml`.
81
+ - Use `--theme-path` only when there is no target app path or the app config does not define a theme path.
82
+ - Treat CLI output as the allowed design surface: do not invent Tailwind token classes when the CLI can list them.
83
+ - If `pnpm exec style-system` is unavailable after dependency changes, run `pnpm install` and `pnpm nx build style-system`.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Style System"
3
+ short_description: "Inspect UI tokens, themes, and components"
4
+ default_prompt: "Use $style-system to inspect UI tokens, themes, existing components, and component visuals."