/**
* Prompt Templates
*
* Pre-defined prompt templates (like slash commands).
* Note: Claude.ai doesn't support prompts yet (as of Dec 2025), but the MCP API does.
*/
import { z } from 'zod';
import type { PromptDefinition } from './types';
/**
* Summarize prompt
* A template for summarizing content with optional focus
*/
export const summarizePrompt: PromptDefinition<{
content: z.ZodString;
focus: z.ZodOptional<z.ZodString>;
length: z.ZodOptional<z.ZodEnum<['brief', 'detailed']>>;
}> = {
name: 'summarize',
description: 'Summarize content with optional focus area',
schema: {
content: z.string().describe('The content to summarize'),
focus: z.string().optional().describe('Specific aspect to focus on'),
length: z.enum(['brief', 'detailed']).optional().describe('Summary length'),
},
handler: async ({ content, focus, length }) => ({
messages: [{
role: 'user',
content: {
type: 'text',
text: [
focus ? `Please summarize the following, focusing on ${focus}:` : 'Please summarize the following:',
'',
content,
'',
length === 'brief' ? 'Keep it brief (2-3 sentences).' :
length === 'detailed' ? 'Provide a detailed summary with key points.' : '',
].filter(Boolean).join('\n'),
},
}],
}),
};
/**
* Analyze prompt
* A template for analyzing data or content
*/
export const analyzePrompt: PromptDefinition<{
content: z.ZodString;
type: z.ZodEnum<['sentiment', 'technical', 'business']>;
}> = {
name: 'analyze',
description: 'Analyze content and provide insights',
schema: {
content: z.string().describe('The content to analyze'),
type: z.enum(['sentiment', 'technical', 'business']).describe('Type of analysis'),
},
handler: async ({ content, type }) => {
const analysisPrompts = {
sentiment: 'Analyze the sentiment and emotional tone of the following content. Identify positive, negative, and neutral elements.',
technical: 'Provide a technical analysis of the following. Identify key technical concepts, potential issues, and recommendations.',
business: 'Analyze the following from a business perspective. Identify opportunities, risks, and strategic implications.',
};
return {
messages: [{
role: 'user',
content: {
type: 'text',
text: `${analysisPrompts[type]}\n\n${content}`,
},
}],
};
},
};
/**
* All prompt templates
*/
export const templatePrompts: PromptDefinition[] = [
summarizePrompt,
analyzePrompt,
];