Skip to main content
Generates a @Prompt class with optional typed arguments.

Usage

nx g @frontmcp/nx:prompt summarize --project crm
nx g @frontmcp/nx:prompt summarize --project crm --arguments topic,length

Options

OptionTypeDefaultDescription
namestringRequired. The name of the prompt
projectstringRequired. The project to add the prompt to
argumentsstringComma-separated argument names for the prompt
directorystringSubdirectory within src/prompts/

Generated Code

import { Prompt, PromptContext } from '@frontmcp/sdk';
import type { GetPromptResult } from '@modelcontextprotocol/sdk/types.js';

@Prompt({
  name: 'summarize',
  description: 'TODO: describe what this prompt does',
  arguments: [
    { name: 'topic', description: 'TODO: describe', required: true },
    { name: 'length', description: 'TODO: describe', required: true },
  ],
})
export default class SummarizePrompt extends PromptContext {
  async execute(args: Record<string, string>): Promise<GetPromptResult> {
    return {
      messages: [
        { role: 'user', content: { type: 'text', text: 'TODO: implement prompt template' } },
      ],
    };
  }
}