@framingui/mcp-server 0.6.19 → 0.6.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.
Files changed (44) hide show
  1. package/README.md +79 -990
  2. package/dist/cli/agent-md-templates.d.ts +0 -12
  3. package/dist/cli/agent-md-templates.d.ts.map +1 -1
  4. package/dist/cli/agent-md-templates.js +73 -255
  5. package/dist/cli/agent-md-templates.js.map +1 -1
  6. package/dist/cli/guide-template.d.ts +0 -7
  7. package/dist/cli/guide-template.d.ts.map +1 -1
  8. package/dist/cli/guide-template.js +58 -157
  9. package/dist/cli/guide-template.js.map +1 -1
  10. package/dist/cli/index.d.ts +1 -1
  11. package/dist/cli/index.js +3 -47
  12. package/dist/cli/index.js.map +1 -1
  13. package/dist/cli/init.d.ts +18 -2
  14. package/dist/cli/init.d.ts.map +1 -1
  15. package/dist/cli/init.js +278 -108
  16. package/dist/cli/init.js.map +1 -1
  17. package/dist/index.js +39 -35
  18. package/dist/index.js.map +1 -1
  19. package/dist/prompts/getting-started.d.ts.map +1 -1
  20. package/dist/prompts/getting-started.js +6 -29
  21. package/dist/prompts/getting-started.js.map +1 -1
  22. package/dist/prompts/screen-workflow.d.ts +1 -4
  23. package/dist/prompts/screen-workflow.d.ts.map +1 -1
  24. package/dist/prompts/screen-workflow.js +84 -234
  25. package/dist/prompts/screen-workflow.js.map +1 -1
  26. package/dist/schemas/mcp-schemas.d.ts +212 -449
  27. package/dist/schemas/mcp-schemas.d.ts.map +1 -1
  28. package/dist/schemas/mcp-schemas.js +15 -69
  29. package/dist/schemas/mcp-schemas.js.map +1 -1
  30. package/dist/tools/get-screen-generation-context.d.ts.map +1 -1
  31. package/dist/tools/get-screen-generation-context.js +74 -117
  32. package/dist/tools/get-screen-generation-context.js.map +1 -1
  33. package/dist/tools/preview-component.js +1 -1
  34. package/dist/tools/preview-component.js.map +1 -1
  35. package/dist/tools/preview-screen-template.d.ts.map +1 -1
  36. package/dist/tools/preview-screen-template.js +0 -1
  37. package/dist/tools/preview-screen-template.js.map +1 -1
  38. package/dist/tools/validate-environment.d.ts.map +1 -1
  39. package/dist/tools/validate-environment.js +1 -84
  40. package/dist/tools/validate-environment.js.map +1 -1
  41. package/dist/tools/validate-screen-definition.d.ts.map +1 -1
  42. package/dist/tools/validate-screen-definition.js +0 -6
  43. package/dist/tools/validate-screen-definition.js.map +1 -1
  44. package/package.json +4 -4
@@ -1,16 +1,4 @@
1
- /**
2
- * Agent guidance templates for CLAUDE.md and AGENTS.md
3
- * Provides framework-specific Framingui workflow instructions
4
- */
5
1
  export type Framework = 'nextjs' | 'vite';
6
- /**
7
- * Generate CLAUDE.md section for Claude Code
8
- * (Claude Code-specific patterns and MCP integration)
9
- */
10
2
  export declare function generateClaudeMdSection(framework: Framework): string;
11
- /**
12
- * Generate AGENTS.md section for generic AI agents
13
- * (Platform-agnostic guidance for OpenAI Codex, Cursor, Windsurf, etc.)
14
- */
15
3
  export declare function generateAgentsMdSection(framework: Framework): string;
16
4
  //# sourceMappingURL=agent-md-templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-md-templates.d.ts","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAsHpE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAoLpE"}
1
+ {"version":3,"file":"agent-md-templates.d.ts","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA4EpE;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAoDpE"}
@@ -1,311 +1,129 @@
1
- /**
2
- * Agent guidance templates for CLAUDE.md and AGENTS.md
3
- * Provides framework-specific Framingui workflow instructions
4
- */
5
- /**
6
- * Generate CLAUDE.md section for Claude Code
7
- * (Claude Code-specific patterns and MCP integration)
8
- */
9
1
  export function generateClaudeMdSection(framework) {
10
2
  const importPath = framework === 'nextjs' ? 'app/page.tsx' : 'src/App.tsx';
11
3
  return `
12
- ## FramingUI Workflow (Claude Code)
4
+ ## FramingUI Workflow
13
5
 
14
- ### MCP Server Connection
6
+ ### Authentication
15
7
 
16
- Framingui MCP server is configured in \`.mcp.json\`. Claude Code automatically loads 15 tools for screen generation.
17
-
18
- ### Authentication (Step 1)
19
-
20
- Before generating any screens, authenticate:
8
+ Before using licensed themes:
21
9
 
22
10
  \`\`\`bash
23
11
  framingui-mcp login
24
12
  \`\`\`
25
13
 
26
- **Important:** All 6 themes require authentication. No free themes are available.
27
-
28
- ### Screen Generation Workflow (3 Steps)
29
-
30
- **Step 1/3:** Gather Context
31
- - Call \`get-screen-generation-context\` with user's screen description
32
- - Receive template matches, component suggestions with inline props/variants, and schema
33
-
34
- **Step 2/3:** Validate Definition
35
- - Generate Screen Definition JSON based on context
36
- - Call \`validate-screen-definition\` to verify structure
37
- - Apply autoFixPatches or fix any errors before proceeding
38
-
39
- **After Validation:** Write React Code Directly
40
- - Use components and import statements from Step 1 context
41
- - Apply theme recipes via variant props
42
-
43
- **Step 3/3:** Validate Environment (Optional)
44
- - Call \`validate-environment\` with project path and required packages
45
- - Verify Tailwind CSS configuration
46
- - Show user install commands for missing packages
47
-
48
- ### Component Usage Example
14
+ ### Production Screen Flow
15
+
16
+ 1. Decide the style contract:
17
+ - \`host-utility\`
18
+ - \`framingui-native\`
19
+ - \`migrate\`
20
+ 2. Inspect the theme when defaults matter:
21
+ - \`preview-theme\`
22
+ 3. Gather generation context:
23
+ - \`get-screen-generation-context\`
24
+ 4. Resolve ambiguity before drafting:
25
+ - \`preview-component\`
26
+ - \`list-icon-libraries\` when icons are needed
27
+ 5. Validate structure:
28
+ - \`validate-screen-definition\`
29
+ 6. Write React code from the validated definition
30
+ 7. Verify project integration:
31
+ - \`validate-environment\` with \`sourceFiles\`
32
+
33
+ ### Style Contract Rules
34
+
35
+ - If the project stays \`host-utility\`, keep utility classes explicit.
36
+ - If the project uses \`framingui-native\`, ensure the global stylesheet imports \`@framingui/ui/styles\` before relying on FramingUI default variants.
37
+
38
+ ### Slash Commands
39
+
40
+ - \`/screen\`
41
+ - \`/draft\`
42
+ - \`/section\`
43
+ - \`/responsive\`
44
+ - \`/a11y\`
45
+ - \`/theme-swap\`
46
+ - \`/doctor\`
47
+ - \`/install-check\`
48
+ - \`/export\`
49
+ - \`/update\`
50
+
51
+ ### Component Rule
52
+
53
+ Do not claim a FramingUI component is unavailable without checking \`list-components\` or \`preview-component\`.
54
+
55
+ ### Example
49
56
 
50
57
  \`\`\`tsx
51
58
  // ${importPath}
52
- import { Button, Card, CardHeader, CardTitle, CardContent } from '@framingui/ui';
59
+ import '@framingui/ui/styles';
60
+ import { Button, Card, CardContent, CardHeader, CardTitle } from '@framingui/ui';
53
61
 
54
62
  export default function Page() {
55
63
  return (
56
64
  <Card>
57
65
  <CardHeader>
58
- <CardTitle>Welcome to Framingui</CardTitle>
66
+ <CardTitle>Ready for MCP-assisted UI work</CardTitle>
59
67
  </CardHeader>
60
68
  <CardContent>
61
- <Button variant="default" size="lg">Get Started</Button>
69
+ <Button>Continue</Button>
62
70
  </CardContent>
63
71
  </Card>
64
72
  );
65
73
  }
66
74
  \`\`\`
67
-
68
- ### Available Tools
69
-
70
- **Discovery (6 tools):**
71
- - \`list-themes\` - List 6 available themes
72
- - \`preview-theme\` - Get theme design tokens
73
- - \`list-components\` - List 30+ UI components
74
- - \`preview-component\` - Get component props and variants
75
- - \`list-screen-templates\` - List 13 screen templates
76
- - \`preview-screen-template\` - Get template structure
77
-
78
- **Screen Generation (3 tools):**
79
- - \`get-screen-generation-context\` - Step 1/3
80
- - \`validate-screen-definition\` - Step 2/3
81
- - \`validate-environment\` - Step 3/3 (Optional)
82
-
83
- **Legacy Prototyping (3 tools):**
84
- - \`generate-blueprint\` - Legacy blueprint helper
85
- - \`export-screen\` - Export to JSX/TSX/Vue
86
- - \`list_tokens\` - List layout tokens
87
-
88
- **Icon Libraries (2 tools):**
89
- - \`list-icon-libraries\` - List available icon libraries
90
- - \`preview-icon-library\` - Preview icon library
91
-
92
- **Additional:**
93
- - \`validate_screen\` - Simple validation (use \`validate-screen-definition\` for production)
94
-
95
- ### MCP Prompts (Universal Guidance)
96
-
97
- Claude Code can access built-in prompts for guidance:
98
-
99
- - \`getting-started\` - Authentication → Theme → Components → Screen generation
100
- - \`screen-workflow\` - Detailed 3-step workflow with troubleshooting
101
-
102
- These prompts work across all MCP clients, not just Claude Code.
103
-
104
- ### Common Mistakes to Avoid
105
-
106
- 1. ❌ Skipping authentication before generating screens
107
- 2. ❌ Using non-existent theme IDs (only 6 exist)
108
- 3. ❌ Skipping validate-screen-definition step
109
- 4. ❌ Delivering code without verifying Tailwind config
110
-
111
- ### Troubleshooting
112
-
113
- **Authentication issues:**
114
- - Run \`framingui-mcp status\` to check authentication
115
- - Run \`framingui-mcp login\` to re-authenticate
116
-
117
- **Missing styles:**
118
- - Run \`validate-environment\` to check Tailwind config
119
- - Verify \`@framingui/ui\` content paths are included
120
- - Check \`tailwindcss-animate\` plugin is configured
121
-
122
- **Component not found:**
123
- - Use \`list-components\` to verify component exists
124
- - Use \`preview-component\` to check correct component ID
125
75
  `;
126
76
  }
127
- /**
128
- * Generate AGENTS.md section for generic AI agents
129
- * (Platform-agnostic guidance for OpenAI Codex, Cursor, Windsurf, etc.)
130
- */
131
77
  export function generateAgentsMdSection(framework) {
132
78
  const importPath = framework === 'nextjs' ? 'app/page.tsx' : 'src/App.tsx';
133
79
  return `
134
- ## FramingUI Workflow (AI Agents)
135
-
136
- ### Overview
137
-
138
- Framingui MCP server provides 15 tools for screen generation via Model Context Protocol (MCP). This guide is for AI agents on platforms like OpenAI Codex, Cursor, Windsurf, and other MCP-compatible clients.
139
-
140
- ### Prerequisites
141
-
142
- 1. **MCP Server Running:** Ensure \`@framingui/mcp-server\` is running and connected
143
- 2. **Authentication:** User must run \`framingui-mcp login\` before generating screens
144
- 3. **Project Setup:** \`@framingui/ui\` and \`tailwindcss-animate\` must be installed
145
-
146
- ### Required Authentication Flow
147
-
148
- **Step 1:** Check authentication status
149
- \`\`\`bash
150
- framingui-mcp status
151
- \`\`\`
152
-
153
- **Step 2:** If not authenticated, instruct user:
154
- \`\`\`bash
155
- framingui-mcp login
156
- \`\`\`
157
-
158
- **Important:** All 6 themes require valid licenses. There are no free themes available.
159
-
160
- ### Screen Generation Workflow (3 Steps)
80
+ ## FramingUI Workflow
161
81
 
162
- Follow this exact sequence for production-ready screens:
82
+ FramingUI is available in this project through MCP.
163
83
 
164
- #### Step 1/3: Gather Context
84
+ ### Required Sequence
165
85
 
166
- **Tool:** \`get-screen-generation-context\`
86
+ 1. Confirm authentication if licensed themes are needed.
87
+ 2. Decide the style contract before generation.
88
+ 3. Use \`preview-theme\` when theme defaults or recipes matter.
89
+ 4. Use \`get-screen-generation-context\` as the main entry point.
90
+ 5. Use \`preview-component\` for any ambiguous component contract.
91
+ 6. Use \`list-icon-libraries\` before adding icons.
92
+ 7. Validate structure with \`validate-screen-definition\`.
93
+ 8. Write React code directly from the validated definition.
94
+ 9. Run \`validate-environment\` with \`sourceFiles\` before final handoff.
167
95
 
168
- **Purpose:** Get all context needed to create Screen Definition
96
+ ### Style Contract
169
97
 
170
- **Input:**
171
- \`\`\`json
172
- {
173
- "description": "user dashboard with profile card",
174
- "themeId": "minimal-workspace",
175
- "includeExamples": true
176
- }
177
- \`\`\`
178
-
179
- **Output:** Template matches, component suggestions with inline props/variants, schema, examples
180
-
181
- #### Step 2/3: Validate Definition
182
-
183
- **Tool:** \`validate-screen-definition\`
184
-
185
- **Purpose:** Ensure Screen Definition JSON is correct
186
-
187
- **Input:**
188
- \`\`\`json
189
- {
190
- "definition": {
191
- "id": "user-dashboard",
192
- "shell": "shell.web.dashboard",
193
- "page": "page.dashboard",
194
- "sections": [...]
195
- },
196
- "strict": true
197
- }
198
- \`\`\`
199
-
200
- **Output:** Validation results with errors, warnings, suggestions, and autoFix patches
201
-
202
- **Critical:** Always validate before writing code. Apply autoFixPatches or fix all errors.
203
-
204
- #### After Validation: Write React Code Directly
205
-
206
- **No tool needed** - Write production-ready React code using components from Step 1 context.
207
-
208
- Use the import statements and props provided in the context response.
209
-
210
- #### Step 3/3: Validate Environment (Optional)
211
-
212
- **Tool:** \`validate-environment\`
213
-
214
- **Purpose:** Verify project has required packages and Tailwind config
215
-
216
- **Input:**
217
- \`\`\`json
218
- {
219
- "projectPath": "/path/to/package.json",
220
- "requiredPackages": ["@radix-ui/react-slot", "@radix-ui/react-avatar"],
221
- "checkTailwind": true
222
- }
223
- \`\`\`
224
-
225
- **Output:** Missing packages, install commands, Tailwind validation
226
-
227
- **Critical:** Always inform user about missing packages and Tailwind config issues.
228
-
229
- ### Discovery Tools
230
-
231
- Before generating screens, explore available resources:
98
+ - \`host-utility\`: keep explicit utility styling
99
+ - \`framingui-native\`: import \`@framingui/ui/styles\` and then rely on FramingUI variants
100
+ - \`migrate\`: stop and clarify the migration path
232
101
 
233
- **Themes (6 total, all require authentication):**
234
- - \`list-themes\` → See all 6 themes
235
- - \`preview-theme\` → Get theme design tokens
102
+ ### Allowed HTML
236
103
 
237
- **Components (30+ available):**
238
- - \`list-components\` Browse component catalog
239
- - \`preview-component\` → Get component props, variants, examples
104
+ Semantic wrappers such as \`header\`, \`nav\`, \`section\`, and \`footer\` may remain HTML.
105
+ Interactive and form primitives should use FramingUI components when they exist.
240
106
 
241
- **Templates (13 available):**
242
- - \`list-screen-templates\` → Browse screen templates
243
- - \`preview-screen-template\` → Get template structure
244
-
245
- ### Component Usage Example
107
+ ### Example
246
108
 
247
109
  \`\`\`tsx
248
110
  // ${importPath}
249
- import { Button, Card, CardHeader, CardTitle, CardContent } from '@framingui/ui';
111
+ import '@framingui/ui/styles';
112
+ import { Button, Card, CardContent, CardHeader, CardTitle } from '@framingui/ui';
250
113
 
251
114
  export default function Page() {
252
115
  return (
253
116
  <Card>
254
117
  <CardHeader>
255
- <CardTitle>Welcome</CardTitle>
118
+ <CardTitle>FramingUI project setup</CardTitle>
256
119
  </CardHeader>
257
120
  <CardContent>
258
- <Button variant="default">Get Started</Button>
121
+ <Button>Continue</Button>
259
122
  </CardContent>
260
123
  </Card>
261
124
  );
262
125
  }
263
126
  \`\`\`
264
-
265
- ### MCP Prompts (Universal Guidance)
266
-
267
- Your MCP client may support prompts. If available:
268
-
269
- - \`getting-started\` - Complete onboarding guide
270
- - \`screen-workflow\` - Detailed 3-step workflow
271
-
272
- These provide context to help you guide users effectively.
273
-
274
- ### Error Handling
275
-
276
- **Authentication errors:**
277
- - Instruct user to run \`framingui-mcp login\`
278
- - Verify with \`framingui-mcp status\`
279
-
280
- **Validation errors (Step 2):**
281
- - Read error messages - they include suggestions
282
- - Fix errors in Screen Definition
283
- - Re-run \`validate-screen-definition\`
284
-
285
- **Missing dependencies (Step 3):**
286
- - Always run Step 4 to check environment
287
- - Show user install commands from \`validate-environment\`
288
-
289
- **Missing styles (runtime):**
290
- - Run \`validate-environment\` to diagnose
291
- - Check Tailwind config includes \`@framingui/ui\` content paths
292
- - Check \`tailwindcss-animate\` plugin is configured
293
-
294
- ### Best Practices
295
-
296
- 1. ✅ Always authenticate before generating screens
297
- 2. ✅ Follow all 3 workflow steps in order
298
- 3. ✅ Validate before writing code (Step 2)
299
- 4. ✅ Check environment before delivering code (Step 3)
300
- 5. ✅ Inform user about missing dependencies and Tailwind issues
301
- 6. ✅ Use \`strict: true\` for production validation
302
-
303
- ### Quick Reference: All 15 Tools
304
-
305
- **Discovery:** list-themes, preview-theme, list-components, preview-component, list-screen-templates, preview-screen-template
306
- **Workflow:** get-screen-generation-context, validate-screen-definition, validate-environment
307
- **Legacy:** generate-blueprint, export-screen, validate_screen, list_tokens
308
- **Icons:** list-icon-libraries, preview-icon-library
309
127
  `;
310
128
  }
311
129
  //# sourceMappingURL=agent-md-templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-md-templates.js","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAoB;IAC1D,MAAM,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCJ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Ed,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAoB;IAC1D,MAAM,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmHJ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Dd,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"agent-md-templates.js","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,uBAAuB,CAAC,SAAoB;IAC1D,MAAM,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuDJ,UAAU;;;;;;;;;;;;;;;;;CAiBd,CAAC;AACF,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,SAAoB;IAC1D,MAAM,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BJ,UAAU;;;;;;;;;;;;;;;;;CAiBd,CAAC;AACF,CAAC"}
@@ -1,10 +1,3 @@
1
- /**
2
- * FRAMINGUI-GUIDE.md 콘텐츠 템플릿
3
- * 프레임워크별 맞춤 가이드 생성
4
- */
5
1
  export type Framework = 'nextjs' | 'vite';
6
- /**
7
- * FRAMINGUI-GUIDE.md 콘텐츠 생성
8
- */
9
2
  export declare function generateGuide(framework: Framework): string;
10
3
  //# sourceMappingURL=guide-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guide-template.d.ts","sourceRoot":"","sources":["../../src/cli/guide-template.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA4L1D"}
1
+ {"version":3,"file":"guide-template.d.ts","sourceRoot":"","sources":["../../src/cli/guide-template.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA+F1D"}
@@ -1,195 +1,96 @@
1
- /**
2
- * FRAMINGUI-GUIDE.md 콘텐츠 템플릿
3
- * 프레임워크별 맞춤 가이드 생성
4
- */
5
- /**
6
- * FRAMINGUI-GUIDE.md 콘텐츠 생성
7
- */
8
1
  export function generateGuide(framework) {
9
- const importExample = framework === 'nextjs'
10
- ? `// app/page.tsx
11
- import { Button, Card, CardHeader, CardTitle, CardContent } from '@framingui/ui';
12
-
13
- export default function HomePage() {
14
- return (
15
- <Card>
16
- <CardHeader>
17
- <CardTitle>Welcome</CardTitle>
18
- </CardHeader>
19
- <CardContent>
20
- <Button variant="default" size="lg">Get Started</Button>
21
- </CardContent>
22
- </Card>
23
- );
24
- }`
25
- : `// src/App.tsx
26
- import { Button, Card, CardHeader, CardTitle, CardContent } from '@framingui/ui';
27
-
28
- function App() {
29
- return (
30
- <Card>
31
- <CardHeader>
32
- <CardTitle>Welcome</CardTitle>
33
- </CardHeader>
34
- <CardContent>
35
- <Button variant="default" size="lg">Get Started</Button>
36
- </CardContent>
37
- </Card>
38
- );
39
- }
40
-
41
- export default App;`;
2
+ const appFile = framework === 'nextjs' ? 'app/page.tsx' : 'src/App.tsx';
42
3
  return `# FramingUI Guide
43
4
 
44
- > AI-powered design system for building production-ready UIs.
45
-
46
- ---
5
+ FramingUI is installed in this project as an MCP-assisted design system for production UI work.
47
6
 
48
7
  ## Authentication
49
8
 
50
- Before generating screens, authenticate with your Framingui account:
9
+ Authenticate before using licensed themes:
51
10
 
52
11
  \`\`\`bash
53
12
  framingui-mcp login
54
13
  \`\`\`
55
14
 
56
- This opens your browser for OAuth authentication. Your credentials are stored in \`~/.framingui/credentials.json\`.
57
-
58
- **Why authentication is required:**
59
- - All 6 themes require valid licenses
60
- - No free themes are available
61
- - Authentication verifies your license status
62
-
63
- **Check your authentication status:**
15
+ Check the current state with:
64
16
 
65
17
  \`\`\`bash
66
18
  framingui-mcp status
67
19
  \`\`\`
68
20
 
69
- ---
70
-
71
- ## Screen Generation Workflow
72
-
73
- Framingui provides a **3-step workflow** for production-ready screen generation:
74
-
75
- ### Step 1/3: Get Context
76
-
77
- Claude Code calls \`get-screen-generation-context\` with your screen description:
78
-
79
- \`\`\`
80
- "Create a user dashboard with profile card and recent activity"
81
- \`\`\`
82
-
83
- Returns: Template matches, component suggestions with inline props/variants, Screen Definition schema
84
-
85
- ### Step 2/3: Validate Definition
86
-
87
- Claude Code generates a Screen Definition JSON and calls \`validate-screen-definition\`:
88
-
89
- Returns: Validation results, errors with auto-fix patches (if any), improvement suggestions
90
-
91
- ### After Validation: Write Code
92
-
93
- Claude Code writes React code directly using the components and props from Step 1 context.
21
+ ## Recommended Workflow
94
22
 
95
- ### Step 3/3: Validate Environment (Optional)
23
+ 1. Decide the style contract for this project:
24
+ - \`host-utility\`
25
+ - \`framingui-native\`
26
+ - \`migrate\`
27
+ 2. Inspect theme and component contracts before drafting:
28
+ - \`preview-theme\`
29
+ - \`preview-component\`
30
+ - \`list-icon-libraries\` when icons are needed
31
+ 3. Call \`get-screen-generation-context\`
32
+ 4. Validate the generated definition with \`validate-screen-definition\`
33
+ 5. Write React code from the validated definition
34
+ 6. Run \`validate-environment\` with \`sourceFiles\` before handoff
96
35
 
97
- Claude Code calls \`validate-environment\` to check your project:
36
+ ## Style Contract Rules
98
37
 
99
- Returns: Missing packages, install commands, Tailwind CSS config validation
38
+ ### host-utility
100
39
 
101
- **Important:** Always check the dependencies and Tailwind configuration before running generated code.
40
+ Keep utility classes explicit. Do not rely on FramingUI default variants unless you intentionally migrate.
102
41
 
103
- ---
42
+ ### framingui-native
104
43
 
105
- ## Quick Start
44
+ Your global stylesheet should import:
106
45
 
107
- ### Using Components
108
-
109
- \`\`\`tsx
110
- ${importExample}
46
+ \`\`\`css
47
+ @import '@framingui/ui/styles';
111
48
  \`\`\`
112
49
 
113
- ### AI Screen Generation
114
-
115
- Claude Code에서 MCP 서버가 연결되어 있으면, 자연어로 화면을 생성할 수 있습니다:
50
+ Only use FramingUI default variants after that import is in place.
116
51
 
117
- \`\`\`
118
- "로그인 화면 만들어줘"
119
- "대시보드 페이지를 카드 레이아웃으로 만들어줘"
120
- "사용자 프로필 페이지를 만들어줘"
121
- \`\`\`
52
+ ## Slash Commands
122
53
 
123
- ---
54
+ FramingUI guidance is available for:
124
55
 
125
- ## Components (30+)
56
+ - \`/screen\`
57
+ - \`/draft\`
58
+ - \`/section\`
59
+ - \`/responsive\`
60
+ - \`/a11y\`
61
+ - \`/theme-swap\`
62
+ - \`/doctor\`
63
+ - \`/install-check\`
64
+ - \`/export\`
65
+ - \`/update\`
126
66
 
127
- ### Core
128
- Button, Input, Label, Card, Badge, Avatar, Separator, Checkbox, RadioGroup, Switch, Textarea, Skeleton, ScrollArea, Select, Progress
129
-
130
- ### Complex
131
- Dialog, DropdownMenu, Table, Tabs, Toast, Tooltip, Popover, Sheet, AlertDialog, NavigationMenu
132
-
133
- ### Advanced
134
- Sidebar, Breadcrumb, Command, Calendar, Form
135
-
136
- ### Usage
67
+ ## Example Component Usage
137
68
 
138
69
  \`\`\`tsx
139
- import { Button, Dialog, DialogTrigger, DialogContent } from '@framingui/ui';
140
- \`\`\`
70
+ // ${appFile}
71
+ import '@framingui/ui/styles';
72
+ import { Button, Card, CardContent, CardHeader, CardTitle } from '@framingui/ui';
141
73
 
142
- ---
143
-
144
- ## Screen Templates (13)
145
-
146
- 프로덕션에서 바로 사용할 수 있는 완성된 화면 템플릿:
147
-
148
- | Category | Templates |
149
- |----------|-----------|
150
- | Auth | Login, Signup, ForgotPassword, Verification |
151
- | Core | Landing, Preferences, Profile |
152
- | Feedback | Loading, Error, Empty, Confirmation, Success |
153
- | Dashboard | Dashboard |
154
-
155
- ---
156
-
157
- ## Themes (6)
158
-
159
- | Theme ID | Description |
160
- |----------|-------------|
161
- | \`classic-magazine\` | Classic magazine style |
162
- | \`dark-boldness\` | Fitness & wellness |
163
- | \`minimal-workspace\` | Minimal workspace |
164
- | \`neutral-workspace\` | Neutral humanism |
165
- | \`pebble\` | Round minimal |
166
- | \`square-minimalism\` | Square minimalism |
167
-
168
- ### Applying a Theme
169
-
170
- \`\`\`tsx
171
- import { themeToCSS, injectThemeCSS } from '@framingui/ui';
172
-
173
- // Inject theme CSS at runtime
174
- injectThemeCSS(themeData);
175
- \`\`\`
176
-
177
- ---
178
-
179
- ## Utility: cn()
180
-
181
- \`\`\`tsx
182
- import { cn } from '@framingui/ui';
183
-
184
- <div className={cn('p-4 bg-white', isActive && 'bg-blue-500', className)} />
74
+ export default function Page() {
75
+ return (
76
+ <Card>
77
+ <CardHeader>
78
+ <CardTitle>FramingUI is ready</CardTitle>
79
+ </CardHeader>
80
+ <CardContent>
81
+ <Button>Continue</Button>
82
+ </CardContent>
83
+ </Card>
84
+ );
85
+ }
185
86
  \`\`\`
186
87
 
187
- ---
188
-
189
- ## Links
88
+ ## Guardrails
190
89
 
191
- - [npm: @framingui/ui](https://www.npmjs.com/package/@framingui/ui)
192
- - [npm: @framingui/mcp-server](https://www.npmjs.com/package/@framingui/mcp-server)
90
+ - Do not claim that a component is unavailable without checking the catalog.
91
+ - Treat templates as hints, not the final structure.
92
+ - Treat the validated screen definition as the production contract.
93
+ - Keep semantic wrappers as HTML only when there is no FramingUI primitive to replace them.
193
94
  `;
194
95
  }
195
96
  //# sourceMappingURL=guide-template.js.map