user-majico-mcp 0.7.5

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 (66) hide show
  1. package/README.md +144 -0
  2. package/dist/agent-bootstrap.d.ts +8 -0
  3. package/dist/agent-bootstrap.js +21 -0
  4. package/dist/auth-prompt.d.ts +13 -0
  5. package/dist/auth-prompt.js +15 -0
  6. package/dist/client-disconnect.d.ts +4 -0
  7. package/dist/client-disconnect.js +17 -0
  8. package/dist/credentials.d.ts +40 -0
  9. package/dist/credentials.js +60 -0
  10. package/dist/http-handler.d.ts +6 -0
  11. package/dist/http-handler.js +28 -0
  12. package/dist/index.d.ts +12 -0
  13. package/dist/index.js +22 -0
  14. package/dist/present-interactive.d.ts +92 -0
  15. package/dist/present-interactive.js +479 -0
  16. package/dist/present-types.d.ts +17 -0
  17. package/dist/present-types.js +1 -0
  18. package/dist/project-relevance.d.ts +27 -0
  19. package/dist/project-relevance.js +95 -0
  20. package/dist/project-selection-hints.d.ts +16 -0
  21. package/dist/project-selection-hints.js +32 -0
  22. package/dist/project-selection.d.ts +25 -0
  23. package/dist/project-selection.js +42 -0
  24. package/dist/recommended-external-skills.d.ts +39 -0
  25. package/dist/recommended-external-skills.js +319 -0
  26. package/dist/sdk-surface.d.ts +10 -0
  27. package/dist/sdk-surface.js +24 -0
  28. package/dist/server-branding.d.ts +17 -0
  29. package/dist/server-branding.js +40 -0
  30. package/dist/server.d.ts +3 -0
  31. package/dist/server.js +24 -0
  32. package/dist/svg-preview-block.d.ts +14 -0
  33. package/dist/svg-preview-block.js +82 -0
  34. package/dist/tools/constants.d.ts +47 -0
  35. package/dist/tools/constants.js +95 -0
  36. package/dist/tools/dispatch-branding-studio.d.ts +5 -0
  37. package/dist/tools/dispatch-branding-studio.js +197 -0
  38. package/dist/tools/dispatch-pulse-blog.d.ts +3 -0
  39. package/dist/tools/dispatch-pulse-blog.js +158 -0
  40. package/dist/tools/dispatch-research-assets.d.ts +3 -0
  41. package/dist/tools/dispatch-research-assets.js +132 -0
  42. package/dist/tools/handle-tool-call-pre.d.ts +4 -0
  43. package/dist/tools/handle-tool-call-pre.js +47 -0
  44. package/dist/tools/handle-tool-call.d.ts +3 -0
  45. package/dist/tools/handle-tool-call.js +56 -0
  46. package/dist/tools/tool-call-helpers.d.ts +22 -0
  47. package/dist/tools/tool-call-helpers.js +104 -0
  48. package/dist/tools/tool-catalog.d.ts +14 -0
  49. package/dist/tools/tool-catalog.js +54 -0
  50. package/dist/tools/tool-definitions-blog-git.d.ts +2 -0
  51. package/dist/tools/tool-definitions-blog-git.js +207 -0
  52. package/dist/tools/tool-definitions-branding.d.ts +2 -0
  53. package/dist/tools/tool-definitions-branding.js +197 -0
  54. package/dist/tools/tool-definitions-research-aliases.d.ts +2 -0
  55. package/dist/tools/tool-definitions-research-aliases.js +340 -0
  56. package/dist/tools/tool-definitions-studio-pulse.d.ts +2 -0
  57. package/dist/tools/tool-definitions-studio-pulse.js +235 -0
  58. package/dist/tools/tool-matrix.d.ts +12 -0
  59. package/dist/tools/tool-matrix.js +36 -0
  60. package/dist/tools.d.ts +5 -0
  61. package/dist/tools.js +3 -0
  62. package/dist/ui-ux-skills.d.ts +33 -0
  63. package/dist/ui-ux-skills.js +157 -0
  64. package/dist/user-pick-policy.d.ts +18 -0
  65. package/dist/user-pick-policy.js +21 -0
  66. package/package.json +71 -0
@@ -0,0 +1,235 @@
1
+ import { ASK_USER_PROJECT_SCOPE, optionalCredentialProps, projectContextProps, } from "./constants.js";
2
+ export const STUDIO_PULSE_TOOL_DEFINITIONS = [
3
+ {
4
+ name: "ping",
5
+ description: "Pre-flight check: auth mode, user, project scope, and whether brand canvas data exists. Call this first before other branding tools. If authRequired is true or the MCP session is not connected, stop and ask the user to Connect in Cursor Settings → MCP → majico (call mcp_auth for the exact prompt). When project scope is not confirmed, returns projectSelectionRequired and relevantProjects (top 3–5 by name/description match) — present options to the user; never auto-switches scope." +
6
+ ASK_USER_PROJECT_SCOPE,
7
+ inputSchema: {
8
+ type: "object",
9
+ properties: {
10
+ ...optionalCredentialProps,
11
+ ...projectContextProps,
12
+ },
13
+ },
14
+ },
15
+ {
16
+ name: "health",
17
+ description: "Alias for ping. Call ping first to verify auth; if authRequired, stop and ask the user to Connect before other tools." +
18
+ ASK_USER_PROJECT_SCOPE,
19
+ inputSchema: {
20
+ type: "object",
21
+ properties: {
22
+ ...optionalCredentialProps,
23
+ ...projectContextProps,
24
+ },
25
+ },
26
+ },
27
+ {
28
+ name: "update_studio_html_frame",
29
+ description: "Patch one htmlFrame element on the Studio canvas by element ID. HTML is sanitized server-side.",
30
+ inputSchema: {
31
+ type: "object",
32
+ properties: {
33
+ ...optionalCredentialProps,
34
+ elementId: {
35
+ type: "string",
36
+ description: "Canvas element ID of the htmlFrame to update",
37
+ },
38
+ html: {
39
+ type: "string",
40
+ description: "New HTML content for the frame",
41
+ },
42
+ },
43
+ required: ["elementId", "html"],
44
+ },
45
+ },
46
+ {
47
+ name: "generate_creative",
48
+ description: "Enqueue a creative_batch job to generate hero/social raster images for template slots.",
49
+ inputSchema: {
50
+ type: "object",
51
+ properties: {
52
+ ...optionalCredentialProps,
53
+ slotId: { type: "string", description: "Default hero" },
54
+ prompt: { type: "string" },
55
+ slots: {
56
+ type: "array",
57
+ items: {
58
+ type: "object",
59
+ properties: {
60
+ slotId: { type: "string" },
61
+ prompt: { type: "string" },
62
+ },
63
+ },
64
+ },
65
+ },
66
+ },
67
+ },
68
+ {
69
+ name: "refine_creative",
70
+ description: "Enqueue creative_refine to adjust an existing slot asset (Grok edit or OpenAI edit when source exists).",
71
+ inputSchema: {
72
+ type: "object",
73
+ properties: {
74
+ ...optionalCredentialProps,
75
+ slotId: { type: "string", description: "Default hero" },
76
+ refinePrompt: { type: "string" },
77
+ prompt: { type: "string", description: "Alias for refinePrompt" },
78
+ },
79
+ },
80
+ },
81
+ {
82
+ name: "list_palette_options",
83
+ description: "List color scheme options for a project. Always call before select_palette — do not guess. Default: present numbered options with swatches, then wait for user choice (do not call select_palette in the same turn). Exception: if user prompt explicitly asks you to choose (e.g. 'auto-select the Reeldemo match'), you may call select_palette with userDelegatedPick: true in the same turn.",
84
+ inputSchema: {
85
+ type: "object",
86
+ properties: { ...optionalCredentialProps },
87
+ },
88
+ },
89
+ {
90
+ name: "select_palette",
91
+ description: "Persist a color scheme by optionId from list_palette_options. Default: only after user confirms option number (1–3) or browser/Studio pick (userConfirmed: true). Exception: when user prompt explicitly delegates the choice (e.g. 'pick option 2 for me', 'choose the best dark scheme'), pass userDelegatedPick: true — same turn as list_palette_options is OK. Returns cursorHandoff for repo apply.",
92
+ inputSchema: {
93
+ type: "object",
94
+ properties: {
95
+ ...optionalCredentialProps,
96
+ optionId: {
97
+ type: "string",
98
+ description: "optionId from list_palette_options",
99
+ },
100
+ userConfirmed: {
101
+ type: "boolean",
102
+ description: "True when user replied 1/2/3, confirmed in chat, or saved via browser palette picker.",
103
+ },
104
+ userDelegatedPick: {
105
+ type: "boolean",
106
+ description: "True when the user prompt explicitly asked you to choose (e.g. 'auto-select the Reeldemo match'). Do not set from heuristics or reeldemoFitAdvisory alone.",
107
+ },
108
+ },
109
+ required: ["optionId"],
110
+ },
111
+ },
112
+ {
113
+ name: "get_pulse_status",
114
+ description: "Check whether Pulse/X is linked for this project and return org stats.",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: { ...optionalCredentialProps },
118
+ },
119
+ },
120
+ {
121
+ name: "generate_tweet_drafts",
122
+ description: "Generate 2–3 tweet draft variants using brand + Pulse post context. Always list results and wait for user before select_tweet_draft.",
123
+ inputSchema: {
124
+ type: "object",
125
+ properties: {
126
+ ...optionalCredentialProps,
127
+ prompt: { type: "string", description: "Optional goal or angle" },
128
+ },
129
+ },
130
+ },
131
+ {
132
+ name: "select_tweet_draft",
133
+ description: "Persist chosen tweet draft to canvas tweet-draft widget + emit handoff.",
134
+ inputSchema: {
135
+ type: "object",
136
+ properties: {
137
+ ...optionalCredentialProps,
138
+ draftId: { type: "string" },
139
+ text: { type: "string" },
140
+ },
141
+ required: ["draftId", "text"],
142
+ },
143
+ },
144
+ {
145
+ name: "list_pulse_posts",
146
+ description: "List top or recent X posts for Pulse-linked projects. Use for canvas widgets and summaries.",
147
+ inputSchema: {
148
+ type: "object",
149
+ properties: {
150
+ ...optionalCredentialProps,
151
+ sort: { type: "string", enum: ["best", "recent"] },
152
+ limit: { type: "number" },
153
+ },
154
+ },
155
+ },
156
+ {
157
+ name: "list_calendar_slots",
158
+ description: "List upcoming X publish slots from content-plan sync. Use list→choose before approve or schedule.",
159
+ inputSchema: {
160
+ type: "object",
161
+ properties: {
162
+ ...optionalCredentialProps,
163
+ limit: { type: "number" },
164
+ platform: { type: "string", description: "Default X" },
165
+ },
166
+ },
167
+ },
168
+ {
169
+ name: "generate_post_variants",
170
+ description: "Generate 2–3 tweet variants for a publish slot. List results; wait for user before select_post_variant.",
171
+ inputSchema: {
172
+ type: "object",
173
+ properties: {
174
+ ...optionalCredentialProps,
175
+ slotId: { type: "string" },
176
+ prompt: { type: "string" },
177
+ },
178
+ required: ["slotId"],
179
+ },
180
+ },
181
+ {
182
+ name: "select_post_variant",
183
+ description: "Persist chosen variant on publish slot + sync Studio post-slot widget.",
184
+ inputSchema: {
185
+ type: "object",
186
+ properties: {
187
+ ...optionalCredentialProps,
188
+ slotId: { type: "string" },
189
+ variantId: { type: "string" },
190
+ },
191
+ required: ["slotId", "variantId"],
192
+ },
193
+ },
194
+ {
195
+ name: "approve_publish_slot",
196
+ description: "Human approval for a publish slot; increments trust counter toward autopost.",
197
+ inputSchema: {
198
+ type: "object",
199
+ properties: {
200
+ ...optionalCredentialProps,
201
+ slotId: { type: "string" },
202
+ },
203
+ required: ["slotId"],
204
+ },
205
+ },
206
+ {
207
+ name: "schedule_publish_slot",
208
+ description: "Set scheduled_at on a publish slot (ISO datetime). Never auto-pick time without user confirm.",
209
+ inputSchema: {
210
+ type: "object",
211
+ properties: {
212
+ ...optionalCredentialProps,
213
+ slotId: { type: "string" },
214
+ scheduledAt: { type: "string", description: "ISO 8601 datetime" },
215
+ },
216
+ required: ["slotId", "scheduledAt"],
217
+ },
218
+ },
219
+ {
220
+ name: "get_performance_insights",
221
+ description: "Read-only closed-loop insights from classifier + engagement for agent narratives.",
222
+ inputSchema: {
223
+ type: "object",
224
+ properties: { ...optionalCredentialProps },
225
+ },
226
+ },
227
+ {
228
+ name: "get_product_ops_view",
229
+ description: "Unified brand + pulse + jobs payload for Cursor product-ops canvas. After calling, write or refresh the user's .canvas.tsx — do not dump JSON in chat.",
230
+ inputSchema: {
231
+ type: "object",
232
+ properties: { ...optionalCredentialProps },
233
+ },
234
+ },
235
+ ];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Classifies MCP tools for the quick (mock) vs Ollama integration matrices.
3
+ * Keep in sync with tool definitions — every listMcpTools() name must appear here.
4
+ */
5
+ export type McpToolKind = "non_llm" | "llm";
6
+ /** Tools that call the LLM router / Ollama / generative model paths. */
7
+ export declare const MCP_LLM_TOOL_NAMES: Set<string>;
8
+ export declare function classifyMcpTool(name: string): McpToolKind;
9
+ export declare function partitionMcpToolNames(names: string[]): {
10
+ llm: string[];
11
+ nonLlm: string[];
12
+ };
@@ -0,0 +1,36 @@
1
+ /** Tools that call the LLM router / Ollama / generative model paths. */
2
+ export const MCP_LLM_TOOL_NAMES = new Set([
3
+ "generate_creative",
4
+ "refine_creative",
5
+ "generate_tweet_drafts",
6
+ "generate_post_variants",
7
+ "get_performance_insights",
8
+ "run_niche_research",
9
+ "run_market_scan",
10
+ "web_search",
11
+ "run_asset_research",
12
+ "generate_asset",
13
+ "quiver_generate_svg",
14
+ "quiver_vectorize_svg",
15
+ "generate_brand_md",
16
+ "suggest_blog_opportunities",
17
+ "run_blog_research",
18
+ "generate_blog_outline",
19
+ "generate_blog_section",
20
+ "assemble_blog_post",
21
+ "submit_brief",
22
+ ]);
23
+ export function classifyMcpTool(name) {
24
+ return MCP_LLM_TOOL_NAMES.has(name) ? "llm" : "non_llm";
25
+ }
26
+ export function partitionMcpToolNames(names) {
27
+ const llm = [];
28
+ const nonLlm = [];
29
+ for (const name of names) {
30
+ if (classifyMcpTool(name) === "llm")
31
+ llm.push(name);
32
+ else
33
+ nonLlm.push(name);
34
+ }
35
+ return { llm, nonLlm };
36
+ }
@@ -0,0 +1,5 @@
1
+ export { MCP_SERVER_VERSION } from "./tools/constants.js";
2
+ export { MAJICO_USER_TOOLS, MAJICO_ADMIN_BOOTSTRAP_TOOLS, MAJICO_TOOLS, listMcpTools, classifyMcpTool, MCP_LLM_TOOL_NAMES, partitionMcpToolNames, } from "./tools/tool-catalog.js";
3
+ export type { McpToolKind } from "./tools/tool-catalog.js";
4
+ export { type ToolCallResult } from "./tools/tool-call-helpers.js";
5
+ export { handleMajicoToolCall } from "./tools/handle-tool-call.js";
package/dist/tools.js ADDED
@@ -0,0 +1,3 @@
1
+ export { MCP_SERVER_VERSION } from "./tools/constants.js";
2
+ export { MAJICO_USER_TOOLS, MAJICO_ADMIN_BOOTSTRAP_TOOLS, MAJICO_TOOLS, listMcpTools, classifyMcpTool, MCP_LLM_TOOL_NAMES, partitionMcpToolNames, } from "./tools/tool-catalog.js";
3
+ export { handleMajicoToolCall } from "./tools/handle-tool-call.js";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Majico-curated Cursor UI/UX skills for agent handoff.
3
+ * Read together with BRAND.md + DESIGN.md when applying brand to a consumer repo.
4
+ *
5
+ * Canonical source: `lib/agent-handoff/ui-ux-skills.ts` (keep in sync when editing).
6
+ */
7
+ import { buildRecommendedExternalSkillsPayload } from "./recommended-external-skills.js";
8
+ export type UiUxSkillPhase = "prepare" | "discover" | "implement" | "sync" | "verify";
9
+ export type UiUxSkillSource = "majico" | "cursor-plugin" | "optional";
10
+ export interface UiUxSkillEntry {
11
+ id: string;
12
+ name: string;
13
+ skillRef: string;
14
+ phase: UiUxSkillPhase;
15
+ source: UiUxSkillSource;
16
+ whenToUse: string;
17
+ requiresMcp?: "majico" | "figma";
18
+ priority: number;
19
+ }
20
+ export declare const UI_UX_SKILL_PHASE_LABELS: Record<UiUxSkillPhase, string>;
21
+ export declare const MAJICO_UI_UX_SKILLS: readonly UiUxSkillEntry[];
22
+ export declare const UI_UX_HANDOFF_WORKFLOW_STEPS: readonly string[];
23
+ export declare function renderUiUxSkillsHandoffMarkdown(options?: {
24
+ headingLevel?: "##" | "###";
25
+ }): string;
26
+ export declare function buildUiUxSkillsHandoffPayload(): {
27
+ version: 1;
28
+ skills: UiUxSkillEntry[];
29
+ workflowSteps: string[];
30
+ readingOrder: string[];
31
+ recommendedExternal: ReturnType<typeof buildRecommendedExternalSkillsPayload>;
32
+ };
33
+ export declare function figmaHandoffSkillRefs(): string[];
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Majico-curated Cursor UI/UX skills for agent handoff.
3
+ * Read together with BRAND.md + DESIGN.md when applying brand to a consumer repo.
4
+ *
5
+ * Canonical source: `lib/agent-handoff/ui-ux-skills.ts` (keep in sync when editing).
6
+ */
7
+ import { buildRecommendedExternalSkillsPayload } from "./recommended-external-skills.js";
8
+ export const UI_UX_SKILL_PHASE_LABELS = {
9
+ prepare: "Prepare — read handoff docs and connect MCP",
10
+ discover: "Discover — layout and UX decisions before building",
11
+ implement: "Implement — components, tokens, and polish in code",
12
+ sync: "Sync — Figma / design-system parity",
13
+ verify: "Verify — regression tests and completion gate",
14
+ };
15
+ export const MAJICO_UI_UX_SKILLS = [
16
+ {
17
+ id: "majico-branding-sync",
18
+ name: "Majico branding sync",
19
+ skillRef: "majico-branding-sync",
20
+ phase: "prepare",
21
+ source: "majico",
22
+ whenToUse: "Always when applying Majico brand via MCP — OAuth gate, project scope, get_brand_md / get_design_md / get_design_tokens workflow.",
23
+ requiresMcp: "majico",
24
+ priority: 1,
25
+ },
26
+ {
27
+ id: "brainstorming",
28
+ name: "Brainstorming",
29
+ skillRef: "brainstorming",
30
+ phase: "discover",
31
+ source: "cursor-plugin",
32
+ whenToUse: "Before net-new screens, landing sections, or navigation — explore layout and UX intent aligned with BRAND.md voice and DESIGN.md layout principles.",
33
+ priority: 2,
34
+ },
35
+ {
36
+ id: "figma-use",
37
+ name: "Figma use",
38
+ skillRef: "figma-use",
39
+ phase: "sync",
40
+ source: "cursor-plugin",
41
+ whenToUse: "Mandatory prerequisite before any Figma MCP write/read — load before figma-generate-design or push tokens.",
42
+ requiresMcp: "figma",
43
+ priority: 3,
44
+ },
45
+ {
46
+ id: "figma-generate-design",
47
+ name: "Figma generate design",
48
+ skillRef: "figma-generate-design",
49
+ phase: "sync",
50
+ source: "cursor-plugin",
51
+ whenToUse: "Push implemented pages to Figma or capture reference layouts when Cursor Figma MCP is connected.",
52
+ requiresMcp: "figma",
53
+ priority: 4,
54
+ },
55
+ {
56
+ id: "figma-generate-library",
57
+ name: "Figma generate library",
58
+ skillRef: "figma-generate-library",
59
+ phase: "sync",
60
+ source: "cursor-plugin",
61
+ whenToUse: "Build or extend a component library / variables in Figma from DESIGN.md tokens.",
62
+ requiresMcp: "figma",
63
+ priority: 5,
64
+ },
65
+ {
66
+ id: "figma-implement-motion",
67
+ name: "Figma implement motion",
68
+ skillRef: "figma-implement-motion",
69
+ phase: "implement",
70
+ source: "cursor-plugin",
71
+ whenToUse: "Translate motion specs from Figma into production CSS/animation after base UI matches tokens.",
72
+ requiresMcp: "figma",
73
+ priority: 6,
74
+ },
75
+ {
76
+ id: "verification-before-completion",
77
+ name: "Verification before completion",
78
+ skillRef: "verification-before-completion",
79
+ phase: "verify",
80
+ source: "cursor-plugin",
81
+ whenToUse: "Before claiming UI work is done — run tests, validate light/dark themes, and confirm token usage.",
82
+ priority: 7,
83
+ },
84
+ ];
85
+ export const UI_UX_HANDOFF_WORKFLOW_STEPS = [
86
+ "Read **BRAND.md** + **DESIGN.md** together — identity/voice first, then tokens, typography, components, layout.",
87
+ "If Majico MCP is connected: load **majico-branding-sync**, then call `get_brand_md`, `get_design_md`, `get_design_tokens`, and `get_logo_svg` (when logo exists).",
88
+ "For greenfield UI: load **brainstorming** — lock hero order (headline → subcopy → CTA) and section rhythm before coding.",
89
+ "Map DESIGN.md tokens to repo CSS variables / theme config — never hardcode brand hex in components.",
90
+ "Implement surfaces using DESIGN.md component + layout rules; write copy from BRAND.md voice and do's/don'ts.",
91
+ "When Cursor Figma MCP is connected: load **figma-use**, then **figma-generate-design** or **figma-generate-library** for parity.",
92
+ "For UI/CSS fixes: add a regression test that would have failed before the change.",
93
+ "Before done: load **verification-before-completion**; if this session started from Studio handoff, call `ack_cursor_handoff`.",
94
+ ];
95
+ function sourceLabel(source) {
96
+ switch (source) {
97
+ case "majico":
98
+ return "Majico (repo / MCP)";
99
+ case "cursor-plugin":
100
+ return "Cursor plugin skill";
101
+ case "optional":
102
+ return "Optional";
103
+ default:
104
+ return source;
105
+ }
106
+ }
107
+ function mcpRequirement(entry) {
108
+ if (!entry.requiresMcp)
109
+ return "";
110
+ return entry.requiresMcp === "majico"
111
+ ? " — requires Majico MCP"
112
+ : " — requires Cursor Figma MCP";
113
+ }
114
+ export function renderUiUxSkillsHandoffMarkdown(options) {
115
+ const heading = options?.headingLevel ?? "##";
116
+ const lines = [
117
+ `${heading} 11. Cursor UI/UX skills (agent workflow)`,
118
+ "",
119
+ "Majico curates these Cursor skills so agents ship **on-brand UI**, not generic templates. Use with the handoff pair **[BRAND.md](./BRAND.md) + [design.md](./design.md)** (or `get_brand_md` + `get_design_md` via MCP).",
120
+ "",
121
+ "### Reading order",
122
+ "",
123
+ "1. **BRAND.md** — identity, voice, positioning, visual summary, do's/don'ts",
124
+ "2. **design.md** — tokens, typography, components, layout (source of truth for CSS)",
125
+ "3. **This section** — which skills to load and in what order",
126
+ "",
127
+ "### Curated skills",
128
+ "",
129
+ ];
130
+ const sorted = [...MAJICO_UI_UX_SKILLS].sort((a, b) => a.priority - b.priority);
131
+ for (const entry of sorted) {
132
+ lines.push(`- **${entry.name}** (\`${entry.skillRef}\`, ${UI_UX_SKILL_PHASE_LABELS[entry.phase]}) — ${entry.whenToUse}${mcpRequirement(entry)}`, ` - Source: ${sourceLabel(entry.source)}`, "");
133
+ }
134
+ lines.push("### Agent workflow", "", ...UI_UX_HANDOFF_WORKFLOW_STEPS.map((step, index) => `${index + 1}. ${step}`), "", "**Note:** Plugin skills load when installed in Cursor. Per-project skills live in the DB — call MCP `sync_cursor_skills` to write `.cursor/skills/` in the consumer repo. Users edit skills via `update_cursor_skill`.", "", "### Optional killer UI/UX skills (external)", "", "Research-backed installs via `npx ui-skills add <skill>` — optional, stack-dependent. See MCP `recommendedExternal` or `docs/internal/cursor-ui-ux-skills-research.md`.", "", "**UI:** ui-skills-root, baseline-ui, make-interfaces-feel-better, fixing-accessibility", "", "**UX:** shape, clarify, harden, uxauditor", "");
135
+ return lines.join("\n").trimEnd();
136
+ }
137
+ export function buildUiUxSkillsHandoffPayload() {
138
+ return {
139
+ version: 1,
140
+ skills: [...MAJICO_UI_UX_SKILLS],
141
+ workflowSteps: [...UI_UX_HANDOFF_WORKFLOW_STEPS],
142
+ readingOrder: [
143
+ "BRAND.md — identity, voice, positioning",
144
+ "design.md — tokens, typography, components, layout",
145
+ "UI/UX skills — load order and MCP/Figma gates",
146
+ "Optional external skills — npx ui-skills (see recommendedExternal)",
147
+ ],
148
+ recommendedExternal: buildRecommendedExternalSkillsPayload(),
149
+ };
150
+ }
151
+ export function figmaHandoffSkillRefs() {
152
+ return MAJICO_UI_UX_SKILLS.filter((entry) => entry.requiresMcp === "figma" ||
153
+ entry.id === "majico-branding-sync" ||
154
+ entry.id === "verification-before-completion")
155
+ .sort((a, b) => a.priority - b.priority)
156
+ .map((entry) => `/${entry.skillRef}`);
157
+ }
@@ -0,0 +1,18 @@
1
+ /** Shared palette/logo pick policy for MCP tools and presentation metadata. */
2
+ export declare const AUTO_PICK_ALLOWED_WHEN = "User prompt explicitly asks the agent to choose (e.g. \"pick option 2 for me\", \"choose the best dark scheme\", \"auto-select the Reeldemo match\").";
3
+ export declare const AUTO_PICK_DEFAULT_POLICY = "Default: present numbered options and wait for user choice. Do not auto-pick from heuristics, fit hints, or agent judgment.";
4
+ export declare const USER_SELECTION_JSON_META: {
5
+ readonly requiresUserSelection: true;
6
+ readonly autoPickForbidden: true;
7
+ readonly autoPickAllowedWhen: "User prompt explicitly asks the agent to choose (e.g. \"pick option 2 for me\", \"choose the best dark scheme\", \"auto-select the Reeldemo match\").";
8
+ };
9
+ export type UserPickGateArgs = {
10
+ userConfirmed?: boolean;
11
+ userDelegatedPick?: boolean;
12
+ };
13
+ /**
14
+ * Validates select_palette / select_logo confirmation gates.
15
+ * - userConfirmed: user replied 1/2/3, confirmed in chat, or saved via browser picker
16
+ * - userDelegatedPick: user prompt explicitly delegated the choice to the agent
17
+ */
18
+ export declare function validateUserPickGate(args: UserPickGateArgs | undefined, toolName: "select_palette" | "select_logo"): string | null;
@@ -0,0 +1,21 @@
1
+ /** Shared palette/logo pick policy for MCP tools and presentation metadata. */
2
+ export const AUTO_PICK_ALLOWED_WHEN = 'User prompt explicitly asks the agent to choose (e.g. "pick option 2 for me", "choose the best dark scheme", "auto-select the Reeldemo match").';
3
+ export const AUTO_PICK_DEFAULT_POLICY = "Default: present numbered options and wait for user choice. Do not auto-pick from heuristics, fit hints, or agent judgment.";
4
+ export const USER_SELECTION_JSON_META = {
5
+ requiresUserSelection: true,
6
+ autoPickForbidden: true,
7
+ autoPickAllowedWhen: AUTO_PICK_ALLOWED_WHEN,
8
+ };
9
+ /**
10
+ * Validates select_palette / select_logo confirmation gates.
11
+ * - userConfirmed: user replied 1/2/3, confirmed in chat, or saved via browser picker
12
+ * - userDelegatedPick: user prompt explicitly delegated the choice to the agent
13
+ */
14
+ export function validateUserPickGate(args, toolName) {
15
+ if (args?.userConfirmed === true || args?.userDelegatedPick === true) {
16
+ return null;
17
+ }
18
+ return (`${toolName} requires userConfirmed: true (user replied 1/2/3, browser pick, or confirmed in chat) ` +
19
+ `or userDelegatedPick: true (user prompt explicitly asked you to choose, e.g. "pick option 2 for me"). ` +
20
+ `Do not pick based on heuristics or advisory hints without explicit user delegation.`);
21
+ }
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "user-majico-mcp",
3
+ "version": "0.7.5",
4
+ "description": "MCP server for Majico.xyz: brand guidelines, design tokens, studio canvas (Pro projects).",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/majico-xyz/majico.xyz.git",
8
+ "directory": "packages/user-majico-mcp"
9
+ },
10
+ "homepage": "https://github.com/majico-xyz/majico.xyz/tree/main/packages/user-majico-mcp#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/majico-xyz/majico.xyz/issues"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "type": "module",
18
+ "main": "dist/index.js",
19
+ "types": "dist/index.d.ts",
20
+ "bin": {
21
+ "user-majico-mcp": "dist/index.js"
22
+ },
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js"
27
+ },
28
+ "./http": {
29
+ "types": "./dist/http-handler.d.ts",
30
+ "import": "./dist/http-handler.js"
31
+ },
32
+ "./auth-prompt": {
33
+ "types": "./dist/auth-prompt.d.ts",
34
+ "import": "./dist/auth-prompt.js"
35
+ }
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "README.md"
40
+ ],
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "start": "node dist/index.js",
44
+ "typecheck": "tsc --noEmit",
45
+ "test": "vitest run",
46
+ "prepublishOnly": "npm run typecheck && npm run build && npm test"
47
+ },
48
+ "keywords": [
49
+ "mcp",
50
+ "majico",
51
+ "brand",
52
+ "design-tokens"
53
+ ],
54
+ "license": "MIT",
55
+ "dependencies": {
56
+ "@modelcontextprotocol/sdk": "^1.0.0",
57
+ "sharp": "^0.34.5"
58
+ },
59
+ "peerDependencies": {
60
+ "@majico/sdk": ">=1.1.0"
61
+ },
62
+ "devDependencies": {
63
+ "@majico/sdk": "file:../majico-sdk",
64
+ "@types/node": "^22.19.0",
65
+ "typescript": "^5.9.0",
66
+ "vitest": "4.1.6"
67
+ },
68
+ "engines": {
69
+ "node": ">=18"
70
+ }
71
+ }