Agent skill
add-prompt
Scaffold a new MCP prompt template. Use when the user asks to add a prompt, create a reusable message template, or define a prompt for LLM interactions.
Install this agent skill to your Project
npx add-skill https://github.com/cyanheads/mcp-ts-core/tree/main/skills/add-prompt
Metadata
Additional technical details for this skill
- type
- reference
- author
- cyanheads
- version
- 1.1
- audience
- external
SKILL.md
Context
Prompts use the prompt() builder from @cyanheads/mcp-ts-core. Each prompt lives in src/mcp-server/prompts/definitions/ with a .prompt.ts suffix and is registered into createApp() in src/index.ts. Some repos later add definitions/index.ts barrels; match the project's current pattern.
Prompts are pure message templates — no Context, no auth, no side effects.
For the full prompt() API, read:
node_modules/@cyanheads/mcp-ts-core/CLAUDE.md
Steps
- Ask the user for the prompt's name, purpose, and arguments
- Create the file at
src/mcp-server/prompts/definitions/{{prompt-name}}.prompt.ts - Register the prompt in the project's existing
createApp()prompt list (directly insrc/index.tsfor fresh scaffolds, or via a barrel if the repo already has one) - Run
bun run devcheckto verify
Template
/**
* @fileoverview {{PROMPT_DESCRIPTION}}
* @module mcp-server/prompts/definitions/{{PROMPT_NAME}}
*/
import { prompt, z } from '@cyanheads/mcp-ts-core';
export const {{PROMPT_EXPORT}} = prompt('{{prompt_name}}', {
description: '{{PROMPT_DESCRIPTION}}',
args: z.object({
// All fields need .describe()
}),
generate: (args) => [
{
role: 'user',
content: {
type: 'text',
text: `{{PROMPT_TEMPLATE_TEXT}}`,
},
},
],
});
Multi-message prompt
generate: (args) => [
{
role: 'user',
content: {
type: 'text',
text: `Here is the ${args.type} to review:\n\n${args.content}`,
},
},
{
role: 'assistant',
content: {
type: 'text',
text: 'I will analyze this carefully. Let me start with...',
},
},
],
Registration
// src/index.ts (fresh scaffold default)
import { createApp } from '@cyanheads/mcp-ts-core';
import { {{PROMPT_EXPORT}} } from './mcp-server/prompts/definitions/{{prompt-name}}.prompt.js';
await createApp({
tools: [/* existing tools */],
resources: [/* existing resources */],
prompts: [{{PROMPT_EXPORT}}],
});
If the repo already uses src/mcp-server/prompts/definitions/index.ts, update that barrel instead.
Checklist
- File created at
src/mcp-server/prompts/definitions/{{prompt-name}}.prompt.ts - All Zod
argsfields have.describe()annotations - JSDoc
@fileoverviewand@moduleheader present -
generatefunction returns valid message array - No side effects — prompts are pure templates
- Registered in the project's existing
createApp()prompt list (directly or via barrel) -
bun run devcheckpasses
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
add-resource
Scaffold a new MCP resource definition. Use when the user asks to add a resource, expose data via URI, or create a readable endpoint.
field-test
Exercise tools, resources, and prompts with real-world inputs to verify behavior end-to-end. Use after adding or modifying definitions, or when the user asks to test, try out, or verify their MCP surface. Calls each definition with realistic and adversarial inputs and produces a report of issues, pain points, and recommendations.
release
Verify release readiness and publish. The git wrapup protocol handles version bumps, changelog, README, commits, and tagging during the coding session. This skill verifies nothing was missed, runs final checks, and presents the irreversible publish commands.
add-export
Add a new subpath export to the @cyanheads/mcp-ts-core package. Use when creating a new public API surface that consumers import from a dedicated subpath (e.g., @cyanheads/mcp-ts-core/newutil).
api-errors
McpError constructor, JsonRpcErrorCode reference, and error handling patterns for `@cyanheads/mcp-ts-core`. Use when looking up error codes, understanding where errors should be thrown vs. caught, or using ErrorHandler.tryCatch in services.
api-utils
API reference for all utilities exported from `@cyanheads/mcp-ts-core/utils`. Use when looking up utility method signatures, options, peer dependencies, or usage patterns.
Didn't find tool you were looking for?