Skip to main content
PromptSmith includes pre-built templates for common AI agent scenarios. These templates provide battle-tested prompts with best practices, constraints, and examples that you can use directly or customize for your needs.

Available Templates

Customer Service

Professional customer support assistant for e-commerce and service businesses

Coding Assistant

Expert coding helper for writing, debugging, and explaining code

Research Assistant

Academic research helper for literature review and analysis

Data Analyst

Data analysis expert for insights, visualization, and statistical analysis

Security

Reusable security template for adding guardrails to any prompt

Multilingual

Multilingual support template for handling multiple languages

Accessibility

Accessibility template for inclusive, screen-reader friendly interactions

Quick Start

All templates are exported from promptsmith-ts/templates:
import { customerService, codingAssistant, security } from "promptsmith-ts/templates";

// Use a template directly
const builder = customerService({
  companyName: "TechStore"
});

const prompt = builder.build();

Template Categories

Domain-Specific Templates

These templates are designed for specific use cases and can be used directly:
  • Customer Service - E-commerce support, order tracking, returns
  • Coding Assistant - Code writing, debugging, explanations
  • Research Assistant - Academic research, citations, literature review
  • Data Analyst - Data analysis, visualization, insights

Composable Templates

These templates are designed to be merged with your domain-specific prompts:
  • Security - Add security constraints and guardrails
  • Multilingual - Add multi-language support
  • Accessibility - Add accessibility best practices

Customization

All templates return a SystemPromptBuilder, so you can further customize them:
import { customerService } from "promptsmith-ts/templates";
import { z } from "zod";

const builder = customerService({
  companyName: "TechStore",
  supportEmail: "[email protected]"
})
  // Add company-specific tools
  .withTool({
    name: "check_inventory",
    description: "Check product inventory",
    schema: z.object({
      productId: z.string()
    })
  })
  // Add additional constraints
  .withConstraint("must", "Always offer free shipping on orders over $50");

const prompt = builder.build();

Merging Templates

Composable templates can be merged with domain-specific templates:
import { customerService, security, multilingual } from "promptsmith-ts/templates";

// Start with customer service template
const builder = customerService({
  companyName: "GlobalStore"
})
  // Add security guardrails
  .merge(security())
  // Add multilingual support
  .merge(multilingual({
    supportedLanguages: ["English", "Spanish", "French"]
  }));

const prompt = builder.build();

Best Practices

  1. Start with a template - Use templates as a foundation and customize rather than building from scratch
  2. Add security - Merge the security template for any customer-facing agent
  3. Test with examples - Templates include examples; test your customizations against similar scenarios
  4. Layer templates - Combine domain templates with composable templates for comprehensive coverage
  5. Customize incrementally - Start with template defaults, then add your specific requirements

Next Steps

Builder API

Learn about the full SystemPromptBuilder API

Merging Prompts

Deep dive into merging and composing prompts

Build docs developers (and LLMs) love