# PromptSmith ## Docs - [createPromptBuilder()](https://mintlify.wiki/galfrevn/promptsmith/api/create-prompt-builder.md): Factory function to create a new SystemPromptBuilder instance for building type-safe AI agent prompts - [Composition](https://mintlify.wiki/galfrevn/promptsmith/api/methods/composition.md): Extend and merge builders for reusable configurations - [Constraints](https://mintlify.wiki/galfrevn/promptsmith/api/methods/constraints.md): Define behavioral rules and guidelines for your agent - [Context & Examples](https://mintlify.wiki/galfrevn/promptsmith/api/methods/context-examples.md): Provide domain knowledge and behavioral examples - [Identity & Capabilities](https://mintlify.wiki/galfrevn/promptsmith/api/methods/identity-capabilities.md): Define your agent's identity and core capabilities - [Output & Tone](https://mintlify.wiki/galfrevn/promptsmith/api/methods/output-tone.md): Configure response formatting and communication style - [Tools](https://mintlify.wiki/galfrevn/promptsmith/api/methods/tools.md): Register tools that your agent can use - [Validation & Export](https://mintlify.wiki/galfrevn/promptsmith/api/methods/validation.md): Build, validate, and export your prompts - [PromptTester](https://mintlify.wiki/galfrevn/promptsmith/api/prompt-tester.md): Testing framework for evaluating system prompts against test cases using LLM-as-judge - [PromptValidator](https://mintlify.wiki/galfrevn/promptsmith/api/prompt-validator.md): Validation framework for checking builder configuration and providing helpful error messages - [SystemPromptBuilder](https://mintlify.wiki/galfrevn/promptsmith/api/system-prompt-builder.md): Main builder class for constructing type-safe system prompts for AI agents - [Constraint Types](https://mintlify.wiki/galfrevn/promptsmith/api/types/constraint-types.md): Types for defining behavioral constraints and guidelines for AI agents - [Format Types](https://mintlify.wiki/galfrevn/promptsmith/api/types/format-types.md): Types for configuring prompt output format and AI SDK integration - [Test Types](https://mintlify.wiki/galfrevn/promptsmith/api/types/test-types.md): Types for testing and evaluating AI agent prompts - [ToolDefinition & ExecutableToolDefinition](https://mintlify.wiki/galfrevn/promptsmith/api/types/tool-definition.md): Type definitions for declaring tools available to AI agents - [SystemPromptBuilder](https://mintlify.wiki/galfrevn/promptsmith/concepts/builder.md): Understanding the fluent API for constructing type-safe AI agent prompts - [Behavioral Constraints](https://mintlify.wiki/galfrevn/promptsmith/concepts/constraints.md): Define rules and guidelines that govern AI agent behavior with different severity levels - [Output Formats](https://mintlify.wiki/galfrevn/promptsmith/concepts/formats.md): Optimize token usage with markdown, TOON, and compact formats for system prompts - [Tool Integration](https://mintlify.wiki/galfrevn/promptsmith/concepts/tools.md): How to define, validate, and document AI agent tools using Zod schemas - [Code Assistant](https://mintlify.wiki/galfrevn/promptsmith/examples/code-assistant.md): Build a coding assistant with file operations and code analysis capabilities - [Conditional Logic](https://mintlify.wiki/galfrevn/promptsmith/examples/conditional-logic.md): Learn how to use withToolIf and withConstraintIf to build dynamic prompts that adapt based on runtime conditions and configuration - [Customer Support Agent](https://mintlify.wiki/galfrevn/promptsmith/examples/customer-support.md): Build a customer support agent with knowledge base search and order management - [Data Analysis Agent](https://mintlify.wiki/galfrevn/promptsmith/examples/data-analysis.md): Build a data analysis agent with conditional logic and role-based access control - [Dynamic Tools](https://mintlify.wiki/galfrevn/promptsmith/examples/dynamic-tools.md): Learn how to register tools at runtime, build dynamic tool collections, and create adaptive agents that respond to changing contexts - [Error Handling](https://mintlify.wiki/galfrevn/promptsmith/examples/error-handling.md): Learn best practices for error handling in prompts, including validation, graceful degradation, and user-friendly error messages - [Multi-Tool Agent](https://mintlify.wiki/galfrevn/promptsmith/examples/multi-tool-agent.md): Build agents with multiple tools using both AI SDK and Mastra frameworks - [Examples Overview](https://mintlify.wiki/galfrevn/promptsmith/examples/overview.md): Complete examples showing how to build AI agents with PromptSmith - [Prompt Composition](https://mintlify.wiki/galfrevn/promptsmith/examples/prompt-composition.md): Learn how to use extend() and merge() to create reusable prompt patterns and compose complex prompts from modular components - [Building Prompts](https://mintlify.wiki/galfrevn/promptsmith/guides/building-prompts.md): Step-by-step guide to constructing effective AI agent prompts with PromptSmith - [Prompt Composition](https://mintlify.wiki/galfrevn/promptsmith/guides/composition.md): Extend and merge builders to create reusable prompt components and specialized agents - [Security Guardrails](https://mintlify.wiki/galfrevn/promptsmith/guides/security-guardrails.md): Protect your AI agents from prompt injection and implement security best practices - [Testing Prompts](https://mintlify.wiki/galfrevn/promptsmith/guides/testing.md): Validate AI agent behavior with PromptTester and LLM-as-judge evaluation - [Token Optimization](https://mintlify.wiki/galfrevn/promptsmith/guides/token-optimization.md): Reduce API costs by 30-60% with TOON format and optimization strategies - [Tool Integration](https://mintlify.wiki/galfrevn/promptsmith/guides/tool-integration.md): Add executable tools to your AI agents with type-safe Zod schemas - [Installation](https://mintlify.wiki/galfrevn/promptsmith/installation.md): Install PromptSmith and get started building type-safe AI agents - [Other Framework Integrations](https://mintlify.wiki/galfrevn/promptsmith/integrations/frameworks.md): Use PromptSmith with any AI framework or custom implementation - [Mastra Integration](https://mintlify.wiki/galfrevn/promptsmith/integrations/mastra.md): Integrate PromptSmith with Mastra framework for advanced agent workflows - [Vercel AI SDK Integration](https://mintlify.wiki/galfrevn/promptsmith/integrations/vercel-ai-sdk.md): Use PromptSmith with Vercel AI SDK for type-safe agent development with toAiSdk() - [Introduction to PromptSmith](https://mintlify.wiki/galfrevn/promptsmith/introduction.md): Type-safe system prompt builder for production AI agents with Vercel AI SDK and Mastra integration - [Quick Start](https://mintlify.wiki/galfrevn/promptsmith/quickstart.md): Build your first AI agent with PromptSmith in 5 minutes - [Accessibility Template](https://mintlify.wiki/galfrevn/promptsmith/templates/accessibility.md): Reusable accessibility template for creating inclusive, screen-reader friendly interactions - [Coding Assistant Template](https://mintlify.wiki/galfrevn/promptsmith/templates/coding-assistant.md): Expert coding assistant optimized for code writing, debugging, and technical explanations - [Customer Service Template](https://mintlify.wiki/galfrevn/promptsmith/templates/customer-service.md): Professional customer service assistant optimized for e-commerce and support scenarios - [Data Analyst Template](https://mintlify.wiki/galfrevn/promptsmith/templates/data-analyst.md): Data analysis assistant optimized for insights, visualization, and statistical analysis - [Multilingual Template](https://mintlify.wiki/galfrevn/promptsmith/templates/multilingual.md): Reusable multilingual template for adding multi-language support to any prompt - [Templates Overview](https://mintlify.wiki/galfrevn/promptsmith/templates/overview.md): Pre-built templates for common AI agent use cases - [Research Assistant Template](https://mintlify.wiki/galfrevn/promptsmith/templates/research-assistant.md): Academic research assistant optimized for literature review and scholarly analysis - [Security Template](https://mintlify.wiki/galfrevn/promptsmith/templates/security.md): Reusable security template for adding guardrails and best practices to any prompt