Help us improve
Share bugs, ideas, or general feedback.
From baml-toolkit
Create a new BAML function with proper structure and types
npx claudepluginhub orbruno/baml-ccpluginHow this command is triggered — by the user, by Claude, or both
Slash command
/baml-toolkit:create-functionThe summary Claude sees in its command listing — used to decide when to auto-load this command
# Create BAML Function You are tasked with creating a new BAML function definition based on user requirements. ## Task Create a BAML function as specified in "$ARGUMENTS". Parse the requirements and scaffold a complete function definition. ## Steps 1. **Parse requirements from arguments**: - Function name - Input parameters and types - Output type/structure - LLM provider preference - Prompt description 2. **Determine file location**: - Find `baml_src/` directory - Choose appropriate `.baml` file (main.baml or create new one) - Read existing content to avoid co...
/cloudflare-aiGenerates production-ready Cloudflare Workers code for AI tasks: TTS, STT, image, chat, vision, embedding, RAG. Requires task argument; optional model.
/create-promptCreates optimized, XML-structured prompts for Claude Code tasks from a description, using adaptive questioning if needed, and saves as sequenced Markdown files in ./prompts/.
/fal-deployDeploys custom ML models to fal.ai serverless infrastructure with GPU support. Generates fal.App Python code including setup, endpoints, scaling, dependencies, and deployment commands.
/atomic-agentCreates a new Atomic Agents agent with input/output schemas, configuration, and system prompt based on the provided agent description.
/ai-agent-createCreates a specialized AI agent file with custom system prompt, optional tools, handoff rules, and TypeScript types based on provided name and specialization.
Share bugs, ideas, or general feedback.
You are tasked with creating a new BAML function definition based on user requirements.
Create a BAML function as specified in "$ARGUMENTS". Parse the requirements and scaffold a complete function definition.
Parse requirements from arguments:
Determine file location:
baml_src/ directory.baml file (main.baml or create new one)Design function structure:
Generate BAML code:
Add to BAML file:
.baml fileNext steps:
/baml-toolkit:generate to create client code/baml-toolkit:create-function "ExtractReceipt that takes an image and returns vendor, items, and total"
/baml-toolkit:create-function "ClassifyEmail with text input returning category (spam/important/newsletter)"
/baml-toolkit:create-function "SummarizeArticle: input is article_text (string), output is Summary class with title, key_points (array), and sentiment"
// Output type definition
class Receipt {
vendor string
date string @description("Format: YYYY-MM-DD")
items ReceiptItem[]
total float
}
class ReceiptItem {
name string
quantity int
price float
}
// Function definition
function ExtractReceipt(image: image) -> Receipt {
client GPT4Vision
prompt #"
Extract receipt information from the provided image.
Return a structured receipt with:
- Vendor/merchant name
- Purchase date (format YYYY-MM-DD)
- List of items with quantities and prices
- Total amount
{{ _.role('user') }}
Image: {{ image }}
"#
}
// Test case
test ExtractReceipt {
functions [ExtractReceipt]
args {
image @"./test_images/sample_receipt.jpg"
}
assert {
{
checks [
this.vendor.length > 0,
this.total > 0,
this.items.length > 0
]
}
}
}
Classification:
enum EmailCategory {
SPAM
IMPORTANT
NEWSLETTER
PERSONAL
}
function ClassifyEmail(text: string) -> EmailCategory {
client GPT4
prompt #"Classify this email: {{ text }}"#
}
Extraction:
class ContactInfo {
name string
email string?
phone string?
}
function ExtractContact(text: string) -> ContactInfo {
client Claude
prompt #"Extract contact information from: {{ text }}"#
}
Generation:
function GenerateSummary(article: string) -> string {
client GPT4
prompt #"Summarize in 2-3 sentences: {{ article }}"#
}
? suffix for optional fields (e.g., email string?)@description for field documentation{{ variable }}