← ClaudeAtlas

dspy-rubylisted

This skill should be used when working with DSPy.rb, a Ruby framework for building type-safe, composable LLM applications. Use this when implementing predictable AI features, creating LLM signatures and modules, configuring language model providers (OpenAI, Anthropic, Gemini, Ollama), building agent systems with tools, optimizing prompts, or testing LLM-powered functionality in Ruby applications.
davekilleen/Dex · ★ 473 · AI & Automation · score 77
Install: claude install-skill davekilleen/Dex
# DSPy.rb Expert ## Overview DSPy.rb is a Ruby framework that enables developers to **program LLMs, not prompt them**. Instead of manually crafting prompts, define application requirements through type-safe, composable modules that can be tested, optimized, and version-controlled like regular code. This skill provides comprehensive guidance on: - Creating type-safe signatures for LLM operations - Building composable modules and workflows - Configuring multiple LLM providers - Implementing agents with tools - Testing and optimizing LLM applications - Production deployment patterns ## Core Capabilities ### 1. Type-Safe Signatures Create input/output contracts for LLM operations with runtime type checking. **When to use**: Defining any LLM task, from simple classification to complex analysis. **Quick reference**: ```ruby class EmailClassificationSignature < DSPy::Signature description "Classify customer support emails" input do const :email_subject, String const :email_body, String end output do const :category, T.enum(["Technical", "Billing", "General"]) const :priority, T.enum(["Low", "Medium", "High"]) end end ``` **Templates**: See `assets/signature-template.rb` for comprehensive examples including: - Basic signatures with multiple field types - Vision signatures for multimodal tasks - Sentiment analysis signatures - Code generation signatures **Best practices**: - Always provide clear, specific descriptions - Use enums for constrained o