Working with Prompts
Prompts are the core resource in Claro. Learn how to retrieve them, access their content, and understand their metadata.Getting a Prompt
Retrieve a prompt using its package name:Package Names
Prompts use a semantic naming convention:@workspace- Your workspace slug (unique identifier)prompt-name- The prompt’s URL-friendly nameversion- Version identifier (v0 for drafts, v1+ for published)
Version Conventions
Version
v0 is reserved for drafts. Published versions start at v1.Prompt Content Fields
Prompts contain three types of content:Generator Prompt
The main prompt content:System Prompt
Optional system-level instructions:Critique Prompt
Optional prompt for evaluating outputs:Prompt Metadata
Access metadata about the prompt:Available Metadata
Dictionary-Style Access
Prompts support both attribute and dictionary access:Working with Multiple Prompts
Fetching Different Versions
Version Migration
Using with Different LLM Providers
OpenAI
Anthropic Claude
Google Gemini
Caching Prompts
For frequently accessed prompts, consider caching:Best Practices
Use Specific Versions in Production
Use Specific Versions in Production
Always use specific versions (v1, v2) in production code:Using
latest in production means your application behavior changes when prompts are updated.Test Drafts Before Publishing
Test Drafts Before Publishing
Use v0 (draft) for development and testing:
Handle Missing Optional Fields
Handle Missing Optional Fields
Not all prompts have system or critique prompts:
Validate Package Names
Validate Package Names
Validate package names before fetching:
Next Steps
Context Files
Work with file attachments and URLs
Variables
Extract and validate variables in prompts
Listing Prompts
Browse and paginate through prompts
Error Handling
Handle errors when fetching prompts