@tekton-ui/mcp-server 0.3.1 → 0.3.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.
- package/README.md +98 -51
- package/dist/auth/theme-access.d.ts +1 -1
- package/dist/auth/theme-access.d.ts.map +1 -1
- package/dist/auth/theme-access.js +7 -14
- package/dist/auth/theme-access.js.map +1 -1
- package/dist/cli/agent-md-templates.d.ts +16 -0
- package/dist/cli/agent-md-templates.d.ts.map +1 -0
- package/dist/cli/agent-md-templates.js +330 -0
- package/dist/cli/agent-md-templates.js.map +1 -0
- package/dist/cli/guide-template.d.ts.map +1 -1
- package/dist/cli/guide-template.js +59 -0
- package/dist/cli/guide-template.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +63 -16
- package/dist/cli/init.js.map +1 -1
- package/dist/index.js +39 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts/getting-started.d.ts +18 -0
- package/dist/prompts/getting-started.d.ts.map +1 -0
- package/dist/prompts/getting-started.js +94 -0
- package/dist/prompts/getting-started.js.map +1 -0
- package/dist/prompts/screen-workflow.d.ts +17 -0
- package/dist/prompts/screen-workflow.d.ts.map +1 -0
- package/dist/prompts/screen-workflow.js +228 -0
- package/dist/prompts/screen-workflow.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompts: Screen Generation Workflow
|
|
3
|
+
* Step-by-step guide for the 4-step screen generation process
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Screen Workflow prompt with detailed 4-step process
|
|
7
|
+
*/
|
|
8
|
+
export function getScreenWorkflowPrompt() {
|
|
9
|
+
return {
|
|
10
|
+
messages: [
|
|
11
|
+
{
|
|
12
|
+
role: 'user',
|
|
13
|
+
content: {
|
|
14
|
+
type: 'text',
|
|
15
|
+
text: `# Tekton Screen Generation Workflow
|
|
16
|
+
|
|
17
|
+
This is the **recommended production workflow** for generating screens with Tekton.
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
The 4-step workflow ensures:
|
|
22
|
+
- ✅ Correct component usage
|
|
23
|
+
- ✅ Validated screen structure
|
|
24
|
+
- ✅ All dependencies installed
|
|
25
|
+
- ✅ Tailwind CSS properly configured
|
|
26
|
+
|
|
27
|
+
## Step 1/4: Get Screen Generation Context
|
|
28
|
+
|
|
29
|
+
**Tool:** \`get-screen-generation-context\`
|
|
30
|
+
|
|
31
|
+
**Purpose:** Gather all context needed to create a Screen Definition
|
|
32
|
+
|
|
33
|
+
**Input:**
|
|
34
|
+
\`\`\`json
|
|
35
|
+
{
|
|
36
|
+
"description": "User dashboard with profile card and recent activity",
|
|
37
|
+
"themeId": "minimal-workspace",
|
|
38
|
+
"includeExamples": true
|
|
39
|
+
}
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
**Output:**
|
|
43
|
+
- Matching screen templates
|
|
44
|
+
- Available components with props
|
|
45
|
+
- Screen Definition JSON schema
|
|
46
|
+
- Example definitions
|
|
47
|
+
- Theme recipes
|
|
48
|
+
|
|
49
|
+
**When to use:**
|
|
50
|
+
- Beginning of every screen generation
|
|
51
|
+
- When you need component suggestions
|
|
52
|
+
- When exploring available templates
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 2/4: Validate Screen Definition
|
|
57
|
+
|
|
58
|
+
**Tool:** \`validate-screen-definition\`
|
|
59
|
+
|
|
60
|
+
**Purpose:** Ensure your Screen Definition JSON is correct before generating code
|
|
61
|
+
|
|
62
|
+
**Input:**
|
|
63
|
+
\`\`\`json
|
|
64
|
+
{
|
|
65
|
+
"definition": {
|
|
66
|
+
"id": "user-dashboard",
|
|
67
|
+
"shell": "shell.web.dashboard",
|
|
68
|
+
"page": "page.dashboard",
|
|
69
|
+
"sections": [
|
|
70
|
+
{
|
|
71
|
+
"id": "header",
|
|
72
|
+
"token": "section.container",
|
|
73
|
+
"components": [...]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"strict": true
|
|
78
|
+
}
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
**Output:**
|
|
82
|
+
- \`valid\`: true/false
|
|
83
|
+
- \`errors\`: Array of validation errors with suggestions
|
|
84
|
+
- \`warnings\`: Potential issues
|
|
85
|
+
- \`suggestions\`: Improvement recommendations
|
|
86
|
+
|
|
87
|
+
**When to use:**
|
|
88
|
+
- Always before Step 3
|
|
89
|
+
- When fixing validation errors
|
|
90
|
+
- When exploring screen structure improvements
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Step 3/4: Generate Screen Code
|
|
95
|
+
|
|
96
|
+
**Tool:** \`generate_screen\`
|
|
97
|
+
|
|
98
|
+
**Purpose:** Generate production-ready React code from validated Screen Definition
|
|
99
|
+
|
|
100
|
+
**Input:**
|
|
101
|
+
\`\`\`json
|
|
102
|
+
{
|
|
103
|
+
"screenDefinition": { /* validated definition from Step 2 */ },
|
|
104
|
+
"outputFormat": "tailwind",
|
|
105
|
+
"options": {
|
|
106
|
+
"typescript": true,
|
|
107
|
+
"prettier": true
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
\`\`\`
|
|
111
|
+
|
|
112
|
+
**Output:**
|
|
113
|
+
- \`code\`: Production React component
|
|
114
|
+
- \`cssVariables\`: CSS variables for theme
|
|
115
|
+
- \`dependencies\`: Object with:
|
|
116
|
+
- \`external\`: Required npm packages
|
|
117
|
+
- \`internal\`: @tekton-ui/* packages
|
|
118
|
+
- \`missing\`: Packages not in project
|
|
119
|
+
- \`installCommands\`: Ready-to-use install commands
|
|
120
|
+
|
|
121
|
+
**Output Formats:**
|
|
122
|
+
- \`tailwind\`: Tailwind CSS classes (recommended)
|
|
123
|
+
- \`css-in-js\`: Styled-components or Emotion
|
|
124
|
+
- \`react\`: Pure React with CSS variables
|
|
125
|
+
|
|
126
|
+
**Critical:**
|
|
127
|
+
- ALWAYS check the \`dependencies.external\` field
|
|
128
|
+
- If non-empty, proceed to Step 4 or show install commands to user
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Step 4/4: Validate Environment (Optional but Recommended)
|
|
133
|
+
|
|
134
|
+
**Tool:** \`validate-environment\`
|
|
135
|
+
|
|
136
|
+
**Purpose:** Verify project has required packages and Tailwind is configured correctly
|
|
137
|
+
|
|
138
|
+
**Input:**
|
|
139
|
+
\`\`\`json
|
|
140
|
+
{
|
|
141
|
+
"projectPath": "/path/to/package.json",
|
|
142
|
+
"requiredPackages": ["framer-motion", "@radix-ui/react-slot"],
|
|
143
|
+
"checkTailwind": true
|
|
144
|
+
}
|
|
145
|
+
\`\`\`
|
|
146
|
+
|
|
147
|
+
**Output:**
|
|
148
|
+
- \`installed\`: Packages already in package.json
|
|
149
|
+
- \`missing\`: Packages that need installation
|
|
150
|
+
- \`installCommands\`: Commands for npm/yarn/pnpm/bun
|
|
151
|
+
- \`tailwind\`: Tailwind config validation results
|
|
152
|
+
- \`issues\`: Problems found
|
|
153
|
+
- \`fixes\`: How to fix each issue
|
|
154
|
+
|
|
155
|
+
**Tailwind Validation Checks:**
|
|
156
|
+
- ✅ tailwind.config.{ts,js,mjs,cjs} exists
|
|
157
|
+
- ✅ @tekton-ui/ui content paths included
|
|
158
|
+
- ✅ tailwindcss-animate plugin configured
|
|
159
|
+
|
|
160
|
+
**When to use:**
|
|
161
|
+
- After Step 3 when dependencies.external is non-empty
|
|
162
|
+
- Before delivering code to user
|
|
163
|
+
- When user reports missing styles or animations
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Complete Example
|
|
168
|
+
|
|
169
|
+
\`\`\`
|
|
170
|
+
User: "Create a login page with email/password fields"
|
|
171
|
+
|
|
172
|
+
1. Call get-screen-generation-context({ description: "login page..." })
|
|
173
|
+
→ Receive template matches, components, schema
|
|
174
|
+
|
|
175
|
+
2. Generate Screen Definition JSON based on context
|
|
176
|
+
→ Call validate-screen-definition({ definition: {...} })
|
|
177
|
+
→ Fix errors if any, re-validate
|
|
178
|
+
|
|
179
|
+
3. Call generate_screen({ screenDefinition: {...}, outputFormat: "tailwind" })
|
|
180
|
+
→ Receive code + dependencies
|
|
181
|
+
|
|
182
|
+
4. Call validate-environment({ projectPath: "...", requiredPackages: [...] })
|
|
183
|
+
→ Show user missing packages and install commands
|
|
184
|
+
→ Warn about Tailwind config issues if any
|
|
185
|
+
|
|
186
|
+
5. Deliver code to user with complete setup instructions
|
|
187
|
+
\`\`\`
|
|
188
|
+
|
|
189
|
+
## Troubleshooting
|
|
190
|
+
|
|
191
|
+
**Validation fails in Step 2:**
|
|
192
|
+
- Read error messages carefully - they include suggestions
|
|
193
|
+
- Check token names match SPEC-LAYOUT-001
|
|
194
|
+
- Verify component IDs exist (use list-components)
|
|
195
|
+
|
|
196
|
+
**Missing dependencies in Step 3:**
|
|
197
|
+
- Always run Step 4 to verify environment
|
|
198
|
+
- Show install commands to user
|
|
199
|
+
- Check Tailwind config includes @tekton-ui/ui paths
|
|
200
|
+
|
|
201
|
+
**Components render without styles:**
|
|
202
|
+
- Verify Tailwind content paths include @tekton-ui/ui
|
|
203
|
+
- Check tailwindcss-animate plugin is configured
|
|
204
|
+
- Run validate-environment to diagnose
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Best Practices
|
|
209
|
+
|
|
210
|
+
1. ✅ Always follow all 4 steps in order
|
|
211
|
+
2. ✅ Validate before generating (Step 2 before Step 3)
|
|
212
|
+
3. ✅ Check environment before delivering code (Step 4)
|
|
213
|
+
4. ✅ Use strict validation mode for production
|
|
214
|
+
5. ✅ Include theme recipes for visual consistency
|
|
215
|
+
|
|
216
|
+
## Alternative Workflows
|
|
217
|
+
|
|
218
|
+
**Quick Prototyping (not production):**
|
|
219
|
+
- \`generate-blueprint\` → \`export-screen\` (skips validation)
|
|
220
|
+
|
|
221
|
+
**Production (recommended):**
|
|
222
|
+
- Follow complete 4-step workflow above`,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=screen-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-workflow.js","sourceRoot":"","sources":["../../src/prompts/screen-workflow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA+MwB;iBAC/B;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tekton-ui/mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Tekton MCP Server with Claude Code integration and timestamp-based preview system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@anthropic-ai/sdk": "^0.40.0",
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
38
38
|
"zod": "^3.23.8",
|
|
39
|
-
"@tekton-ui/core": "0.3.
|
|
40
|
-
"@tekton-ui/ui": "0.3.
|
|
39
|
+
"@tekton-ui/core": "0.3.2",
|
|
40
|
+
"@tekton-ui/ui": "0.3.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/parser": "^7.28.6",
|