stylemcp 0.1.0

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 (83) hide show
  1. package/README.md +261 -0
  2. package/action/action.yml +59 -0
  3. package/action/package.json +24 -0
  4. package/action/src/index.ts +455 -0
  5. package/dist/cli/index.d.ts +3 -0
  6. package/dist/cli/index.d.ts.map +1 -0
  7. package/dist/cli/index.js +335 -0
  8. package/dist/cli/index.js.map +1 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +10 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/rewriter/index.d.ts +45 -0
  14. package/dist/rewriter/index.d.ts.map +1 -0
  15. package/dist/rewriter/index.js +163 -0
  16. package/dist/rewriter/index.js.map +1 -0
  17. package/dist/schema/copy-patterns.d.ts +298 -0
  18. package/dist/schema/copy-patterns.d.ts.map +1 -0
  19. package/dist/schema/copy-patterns.js +53 -0
  20. package/dist/schema/copy-patterns.js.map +1 -0
  21. package/dist/schema/cta-rules.d.ts +274 -0
  22. package/dist/schema/cta-rules.d.ts.map +1 -0
  23. package/dist/schema/cta-rules.js +45 -0
  24. package/dist/schema/cta-rules.js.map +1 -0
  25. package/dist/schema/index.d.ts +2172 -0
  26. package/dist/schema/index.d.ts.map +1 -0
  27. package/dist/schema/index.js +92 -0
  28. package/dist/schema/index.js.map +1 -0
  29. package/dist/schema/tests.d.ts +274 -0
  30. package/dist/schema/tests.d.ts.map +1 -0
  31. package/dist/schema/tests.js +37 -0
  32. package/dist/schema/tests.js.map +1 -0
  33. package/dist/schema/tokens.d.ts +632 -0
  34. package/dist/schema/tokens.d.ts.map +1 -0
  35. package/dist/schema/tokens.js +68 -0
  36. package/dist/schema/tokens.js.map +1 -0
  37. package/dist/schema/voice.d.ts +280 -0
  38. package/dist/schema/voice.d.ts.map +1 -0
  39. package/dist/schema/voice.js +52 -0
  40. package/dist/schema/voice.js.map +1 -0
  41. package/dist/server/billing.d.ts +53 -0
  42. package/dist/server/billing.d.ts.map +1 -0
  43. package/dist/server/billing.js +216 -0
  44. package/dist/server/billing.js.map +1 -0
  45. package/dist/server/http.d.ts +5 -0
  46. package/dist/server/http.d.ts.map +1 -0
  47. package/dist/server/http.js +470 -0
  48. package/dist/server/http.js.map +1 -0
  49. package/dist/server/index.d.ts +3 -0
  50. package/dist/server/index.d.ts.map +1 -0
  51. package/dist/server/index.js +480 -0
  52. package/dist/server/index.js.map +1 -0
  53. package/dist/server/middleware/auth.d.ts +15 -0
  54. package/dist/server/middleware/auth.d.ts.map +1 -0
  55. package/dist/server/middleware/auth.js +83 -0
  56. package/dist/server/middleware/auth.js.map +1 -0
  57. package/dist/utils/pack-loader.d.ts +13 -0
  58. package/dist/utils/pack-loader.d.ts.map +1 -0
  59. package/dist/utils/pack-loader.js +98 -0
  60. package/dist/utils/pack-loader.js.map +1 -0
  61. package/dist/validator/index.d.ts +21 -0
  62. package/dist/validator/index.d.ts.map +1 -0
  63. package/dist/validator/index.js +60 -0
  64. package/dist/validator/index.js.map +1 -0
  65. package/dist/validator/rules/constraints.d.ts +8 -0
  66. package/dist/validator/rules/constraints.d.ts.map +1 -0
  67. package/dist/validator/rules/constraints.js +150 -0
  68. package/dist/validator/rules/constraints.js.map +1 -0
  69. package/dist/validator/rules/cta.d.ts +11 -0
  70. package/dist/validator/rules/cta.d.ts.map +1 -0
  71. package/dist/validator/rules/cta.js +113 -0
  72. package/dist/validator/rules/cta.js.map +1 -0
  73. package/dist/validator/rules/voice.d.ts +6 -0
  74. package/dist/validator/rules/voice.d.ts.map +1 -0
  75. package/dist/validator/rules/voice.js +106 -0
  76. package/dist/validator/rules/voice.js.map +1 -0
  77. package/package.json +61 -0
  78. package/packs/saas/copy_patterns.yaml +423 -0
  79. package/packs/saas/cta_rules.yaml +362 -0
  80. package/packs/saas/manifest.yaml +16 -0
  81. package/packs/saas/tests.yaml +305 -0
  82. package/packs/saas/tokens.json +226 -0
  83. package/packs/saas/voice.yaml +232 -0
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "stylemcp",
3
+ "version": "0.1.0",
4
+ "description": "Executable brand rules for models and agents. Brand CI for AI output.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "stylemcp": "dist/cli/index.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsc --watch",
14
+ "start": "node dist/server/http.js",
15
+ "start:mcp": "node dist/server/index.js",
16
+ "cli": "node dist/cli/index.js",
17
+ "test": "vitest",
18
+ "lint": "eslint src --ext .ts",
19
+ "validate": "node dist/cli/index.js validate",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "mcp",
24
+ "brand",
25
+ "style-guide",
26
+ "ai",
27
+ "validation",
28
+ "model-context-protocol"
29
+ ],
30
+ "author": "",
31
+ "license": "MIT",
32
+ "dependencies": {
33
+ "@modelcontextprotocol/sdk": "^1.0.0",
34
+ "@supabase/supabase-js": "^2.91.1",
35
+ "chalk": "^5.3.0",
36
+ "commander": "^12.1.0",
37
+ "cors": "^2.8.6",
38
+ "diff": "^5.2.0",
39
+ "express": "^5.2.1",
40
+ "js-yaml": "^4.1.0",
41
+ "stripe": "^14.25.0",
42
+ "zod": "^3.23.8"
43
+ },
44
+ "devDependencies": {
45
+ "@types/cors": "^2.8.19",
46
+ "@types/diff": "^5.2.1",
47
+ "@types/express": "^5.0.6",
48
+ "@types/js-yaml": "^4.0.9",
49
+ "@types/node": "^20.14.0",
50
+ "typescript": "^5.5.0",
51
+ "vitest": "^1.6.0"
52
+ },
53
+ "engines": {
54
+ "node": ">=18.0.0"
55
+ },
56
+ "files": [
57
+ "dist",
58
+ "packs",
59
+ "action"
60
+ ]
61
+ }
@@ -0,0 +1,423 @@
1
+ version: "1.0"
2
+ name: "SaaS Copy Patterns"
3
+ description: "Reusable patterns for common SaaS UI situations"
4
+
5
+ patterns:
6
+ # ERROR STATES
7
+ - id: error-generic
8
+ name: "Generic Error"
9
+ category: error
10
+ description: "When something fails but we don't know the specific cause"
11
+ variants:
12
+ - template: "Something went wrong. Try again or contact support if this continues."
13
+ tone: neutral
14
+ - template: "We hit a snag. Refresh the page to try again."
15
+ tone: friendly
16
+ guidelines:
17
+ - "Never blame the user"
18
+ - "Always provide a next step"
19
+ - "Don't say 'Oops' or use emojis"
20
+ examples:
21
+ good:
22
+ - "Something went wrong loading your data. Refresh to try again."
23
+ - "We couldn't complete that action. Try again in a few seconds."
24
+ bad:
25
+ - "Oops! Something went wrong 😅"
26
+ - "Error occurred."
27
+ - "An unexpected error has occurred. Please try again later."
28
+
29
+ - id: error-network
30
+ name: "Network Error"
31
+ category: error
32
+ description: "When the user loses connection"
33
+ variants:
34
+ - template: "You're offline. Check your connection and try again."
35
+ tone: neutral
36
+ - template: "No internet connection. We'll sync your changes when you're back online."
37
+ tone: friendly
38
+ guidelines:
39
+ - "Be specific about what's happening"
40
+ - "Mention auto-retry if applicable"
41
+
42
+ - id: error-permission
43
+ name: "Permission Denied"
44
+ category: error
45
+ description: "When user lacks access to a resource"
46
+ variants:
47
+ - template: "You don't have access to {{resource}}. Ask {{owner_role}} to invite you."
48
+ tone: neutral
49
+ - template: "This {{resource}} is private. Request access from the owner."
50
+ tone: neutral
51
+ placeholders:
52
+ resource:
53
+ description: "The thing they can't access"
54
+ examples: ["this project", "this workspace", "this file"]
55
+ required: true
56
+ owner_role:
57
+ description: "Who can grant access"
58
+ examples: ["the workspace admin", "the project owner"]
59
+ required: false
60
+
61
+ - id: error-validation
62
+ name: "Form Validation Error"
63
+ category: form-validation
64
+ description: "When a form field has invalid input"
65
+ variants:
66
+ - template: "{{field}} {{requirement}}. Example: {{example}}"
67
+ tone: neutral
68
+ placeholders:
69
+ field:
70
+ description: "The field name"
71
+ examples: ["Email", "Password", "Username"]
72
+ required: true
73
+ requirement:
74
+ description: "What's required"
75
+ examples: ["must be at least 8 characters", "needs an @ symbol"]
76
+ required: true
77
+ example:
78
+ description: "A valid example"
79
+ examples: ["name@company.com", "MyP@ssw0rd"]
80
+ required: true
81
+ guidelines:
82
+ - "Always show what's wrong, not just that something is wrong"
83
+ - "Give an example when possible"
84
+ - "Use inline validation, don't wait for submit"
85
+ examples:
86
+ good:
87
+ - "Password must be at least 8 characters. You have 6."
88
+ - "Enter a valid email. Example: name@company.com"
89
+ bad:
90
+ - "Invalid email"
91
+ - "This field is required"
92
+ - "Please enter a valid value"
93
+
94
+ # EMPTY STATES
95
+ - id: empty-first-use
96
+ name: "First-Time Empty State"
97
+ category: empty-state
98
+ description: "When a feature/section is empty because user hasn't used it yet"
99
+ variants:
100
+ - template: "No {{items}} yet. {{cta}} to get started."
101
+ tone: neutral
102
+ - template: "Create your first {{item}} to {{benefit}}."
103
+ tone: friendly
104
+ placeholders:
105
+ items:
106
+ description: "Plural item name"
107
+ examples: ["projects", "tasks", "reports"]
108
+ required: true
109
+ item:
110
+ description: "Singular item name"
111
+ examples: ["project", "task", "report"]
112
+ required: true
113
+ cta:
114
+ description: "The action to take"
115
+ examples: ["Create one", "Add your first project"]
116
+ required: true
117
+ benefit:
118
+ description: "What they'll get"
119
+ examples: ["start tracking progress", "organize your work"]
120
+ required: false
121
+ guidelines:
122
+ - "Focus on the benefit, not the emptiness"
123
+ - "Include a clear CTA"
124
+ - "Don't apologize for being empty"
125
+ examples:
126
+ good:
127
+ - "No projects yet. Create one to start tracking your work."
128
+ - "Your dashboard is ready. Add a widget to see your data at a glance."
129
+ bad:
130
+ - "Nothing to see here!"
131
+ - "It's empty in here... 🦗"
132
+ - "No data available."
133
+
134
+ - id: empty-search
135
+ name: "No Search Results"
136
+ category: empty-state
137
+ description: "When a search returns no matches"
138
+ variants:
139
+ - template: "No results for \"{{query}}\". Try a different search term."
140
+ tone: neutral
141
+ - template: "We couldn't find anything matching \"{{query}}\". Check your spelling or try broader terms."
142
+ tone: helpful
143
+ placeholders:
144
+ query:
145
+ description: "The search term"
146
+ examples: ["quarterly report", "john@"]
147
+ required: true
148
+ guidelines:
149
+ - "Echo back their search term"
150
+ - "Suggest how to improve the search"
151
+ examples:
152
+ good:
153
+ - "No results for \"invocie\". Did you mean \"invoice\"?"
154
+ - "No matches for \"Q3 sales\". Try searching for \"sales\" or \"Q3\"."
155
+ bad:
156
+ - "No results found."
157
+ - "Your search returned 0 items."
158
+
159
+ - id: empty-filtered
160
+ name: "No Results After Filtering"
161
+ category: empty-state
162
+ description: "When filters exclude all items"
163
+ variants:
164
+ - template: "No {{items}} match your filters. Clear filters to see all {{items}}."
165
+ tone: neutral
166
+ guidelines:
167
+ - "Make it easy to clear filters"
168
+ - "Don't make them start over"
169
+
170
+ # SUCCESS STATES
171
+ - id: success-action
172
+ name: "Action Completed"
173
+ category: success
174
+ description: "When an action completes successfully"
175
+ variants:
176
+ - template: "{{item}} {{action}}."
177
+ tone: neutral
178
+ length: short
179
+ - template: "{{item}} {{action}}. {{next_step}}"
180
+ tone: neutral
181
+ length: medium
182
+ placeholders:
183
+ item:
184
+ description: "What was affected"
185
+ examples: ["Project", "Your settings", "Invoice #1234"]
186
+ required: true
187
+ action:
188
+ description: "What happened"
189
+ examples: ["created", "saved", "sent"]
190
+ required: true
191
+ next_step:
192
+ description: "Optional next action"
193
+ examples: ["View it in your dashboard.", "You'll receive a confirmation email."]
194
+ required: false
195
+ guidelines:
196
+ - "Be specific about what happened"
197
+ - "Keep it brief - success shouldn't demand attention"
198
+ - "Include next step only if relevant"
199
+ examples:
200
+ good:
201
+ - "Project created."
202
+ - "Settings saved."
203
+ - "Invoice sent to client@example.com."
204
+ bad:
205
+ - "Success!"
206
+ - "Your action was completed successfully."
207
+ - "Great job! You did it! 🎉"
208
+ metadata:
209
+ maxLength: 80
210
+
211
+ - id: success-destructive
212
+ name: "Destructive Action Completed"
213
+ category: success
214
+ description: "When a delete/remove action completes"
215
+ variants:
216
+ - template: "{{item}} deleted."
217
+ tone: neutral
218
+ - template: "{{item}} deleted. Undo"
219
+ tone: neutral
220
+ guidelines:
221
+ - "Offer undo when possible"
222
+ - "Don't celebrate deletion"
223
+ examples:
224
+ good:
225
+ - "Task deleted. Undo"
226
+ - "3 files removed."
227
+ bad:
228
+ - "Successfully deleted!"
229
+ - "Gone forever! 👋"
230
+
231
+ # LOADING STATES
232
+ - id: loading-default
233
+ name: "Default Loading"
234
+ category: loading
235
+ description: "Generic loading state"
236
+ variants:
237
+ - template: "Loading..."
238
+ tone: neutral
239
+ length: short
240
+ - template: "Loading {{item}}..."
241
+ tone: neutral
242
+ length: short
243
+ guidelines:
244
+ - "Keep it simple"
245
+ - "Be specific when possible"
246
+ - "For long waits (>3s), explain why"
247
+ examples:
248
+ good:
249
+ - "Loading..."
250
+ - "Loading your dashboard..."
251
+ bad:
252
+ - "Please wait..."
253
+ - "Hang tight!"
254
+ - "Just a moment... ⏳"
255
+
256
+ - id: loading-long
257
+ name: "Long Loading State"
258
+ category: loading
259
+ description: "When something takes more than a few seconds"
260
+ variants:
261
+ - template: "This is taking longer than usual. {{reason}}"
262
+ tone: neutral
263
+ - template: "Still working on it. {{reason}}"
264
+ tone: friendly
265
+ placeholders:
266
+ reason:
267
+ description: "Why it's slow"
268
+ examples: ["Large file processing.", "Connecting to your data source."]
269
+ required: false
270
+ guidelines:
271
+ - "Acknowledge the wait"
272
+ - "Explain what's happening if you can"
273
+
274
+ # CONFIRMATION DIALOGS
275
+ - id: confirm-destructive
276
+ name: "Destructive Action Confirmation"
277
+ category: confirmation
278
+ description: "Before irreversible destructive actions"
279
+ variants:
280
+ - template: "Delete {{item}}? {{consequence}}"
281
+ tone: neutral
282
+ placeholders:
283
+ item:
284
+ description: "What will be deleted"
285
+ examples: ["this project", "your account"]
286
+ required: true
287
+ consequence:
288
+ description: "What they'll lose"
289
+ examples: ["You'll lose all 12 tasks.", "This removes all your data."]
290
+ required: true
291
+ guidelines:
292
+ - "Be specific about what they'll lose"
293
+ - "Use 'Delete' not 'Yes' for the confirm button"
294
+ - "Make cancel the default/prominent option"
295
+ examples:
296
+ good:
297
+ - "Delete this project? You'll lose all 47 tasks and 12 files."
298
+ - "Remove team member? They'll lose access to all shared projects."
299
+ bad:
300
+ - "Are you sure?"
301
+ - "Are you sure you want to delete this? This cannot be undone."
302
+
303
+ - id: confirm-logout
304
+ name: "Logout Confirmation"
305
+ category: confirmation
306
+ description: "When user is about to log out"
307
+ variants:
308
+ - template: "Log out of {{app}}?"
309
+ tone: neutral
310
+ - template: "Log out? You have unsaved changes in {{location}}."
311
+ tone: warning
312
+
313
+ # ONBOARDING
314
+ - id: onboarding-welcome
315
+ name: "Welcome Message"
316
+ category: onboarding
317
+ description: "First thing user sees after signup"
318
+ variants:
319
+ - template: "Welcome to {{app}}. Let's get you set up."
320
+ tone: neutral
321
+ - template: "You're in. Here's how to get started with {{app}}."
322
+ tone: friendly
323
+ guidelines:
324
+ - "Keep it brief"
325
+ - "Guide to first action immediately"
326
+ - "Don't overwhelm with features"
327
+ examples:
328
+ good:
329
+ - "Welcome to Acme. Create your first project to get started."
330
+ - "You're in. Let's set up your workspace."
331
+ bad:
332
+ - "Welcome to Acme! We're so excited to have you! 🎉 Here's everything you can do..."
333
+ - "Congratulations on signing up!"
334
+
335
+ - id: onboarding-tooltip
336
+ name: "Feature Tooltip"
337
+ category: tooltip
338
+ description: "Brief explanation of a feature"
339
+ variants:
340
+ - template: "{{feature}}: {{benefit}}"
341
+ tone: neutral
342
+ guidelines:
343
+ - "One sentence max"
344
+ - "Focus on what it does, not how"
345
+ - "No exclamation marks"
346
+ metadata:
347
+ maxLength: 100
348
+
349
+ # NOTIFICATIONS
350
+ - id: notification-mention
351
+ name: "Mention Notification"
352
+ category: notification
353
+ description: "When someone mentions the user"
354
+ variants:
355
+ - template: "{{person}} mentioned you in {{location}}: \"{{preview}}\""
356
+ tone: neutral
357
+
358
+ - id: notification-assignment
359
+ name: "Assignment Notification"
360
+ category: notification
361
+ description: "When user is assigned something"
362
+ variants:
363
+ - template: "{{person}} assigned you to {{item}}"
364
+ tone: neutral
365
+
366
+ # FEATURE GATES
367
+ - id: feature-upgrade
368
+ name: "Feature Requires Upgrade"
369
+ category: feature-gate
370
+ description: "When a feature is locked behind a plan"
371
+ variants:
372
+ - template: "{{feature}} is available on {{plan}}. {{cta}}"
373
+ tone: neutral
374
+ - template: "Upgrade to {{plan}} to {{benefit}}."
375
+ tone: neutral
376
+ placeholders:
377
+ feature:
378
+ description: "The locked feature"
379
+ examples: ["Advanced analytics", "Custom domains"]
380
+ required: true
381
+ plan:
382
+ description: "Required plan"
383
+ examples: ["Pro", "Team", "Enterprise"]
384
+ required: true
385
+ benefit:
386
+ description: "What they'll get"
387
+ examples: ["export unlimited reports", "add unlimited team members"]
388
+ required: false
389
+ cta:
390
+ description: "Upgrade action"
391
+ examples: ["View plans", "Upgrade now"]
392
+ required: false
393
+ guidelines:
394
+ - "Be clear about what plan is needed"
395
+ - "Focus on benefit, not restriction"
396
+ - "Don't guilt or pressure"
397
+ examples:
398
+ good:
399
+ - "Custom reports are available on Pro. View plans"
400
+ - "Upgrade to Team to add more than 5 members."
401
+ bad:
402
+ - "Sorry, this feature is not available on your current plan."
403
+ - "Unlock this feature! 🔓"
404
+
405
+ - id: feature-limit
406
+ name: "Usage Limit Reached"
407
+ category: feature-gate
408
+ description: "When user hits a plan limit"
409
+ variants:
410
+ - template: "You've used all {{limit}} {{items}} in your plan. {{cta}}"
411
+ tone: neutral
412
+ placeholders:
413
+ limit:
414
+ description: "The limit number"
415
+ examples: ["5", "100"]
416
+ required: true
417
+ items:
418
+ description: "What's limited"
419
+ examples: ["projects", "API calls", "team seats"]
420
+ required: true
421
+ guidelines:
422
+ - "State the limit clearly"
423
+ - "Offer upgrade path without pressure"