This skill helps you design reusable xmcp prompts by guiding parameterized prompt creation and metadata generation for scalable workflows.
npx playbooks add skill xmcp-dev/skills --skill prompt-design
You are helping the user create a new xmcp prompt. Follow this interactive workflow.
Before generating any code, ask the user these questions using AskUserQuestion:
Create the prompt file in src/prompts/:
src/prompts/{prompt-name}.ts
Every xmcp prompt has three main exports:
// 1. Schema (optional) - Define parameters with Zod
export const schema = { /* ... */ };
// 2. Metadata (optional) - Prompt configuration
export const metadata: PromptMetadata = { /* ... */ };
// 3. Handler (required) - Default export function
export default function handler(params?) { /* ... */ }
import { type PromptMetadata } from "xmcp";
// For parameterized prompts
import { z } from "zod";
import { type InferSchema, type PromptMetadata } from "xmcp";
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| name | string | No* | Unique prompt identifier |
| title | string | No | Human-readable title |
| description | string | No | What this prompt does |
| role | string | No | "user" or "assistant" (default: user) |
*When metadata is omitted, xmcp uses the filename as the prompt name.
| Return Type | Use Case |
|-------------|----------|
| string | Simple text prompt |
| { type: "text", text: string } | Explicit text content |
| { type: "image", data: base64, mimeType: string } | Image content |
| Array<Content> | Multiple content blocks |
MCP prompts are useful for:
For complete code templates including:
Read: references/patterns.md
---
src/prompts/{prompt-name}.tsname, title, and description.describe() for all parameters (if parameterized)Suggest running pnpm build to verify the prompt compiles correctly.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.