Expand description
Prompt management system for AI coding agent
This crate provides:
- Model-specific system prompts (Claude, GPT, Gemini)
- Embedded defaults with runtime file-based overrides
- Layered prompt composition
- External tool descriptions
§Quick Start
use codive_prompts::{PromptStore, PromptComposer, ProviderFamily};
// Create store with embedded defaults
let store = PromptStore::new();
// Compose a prompt for a specific model
let prompt = PromptComposer::new(&store)
.with_base()
.with_provider_auto("claude-3-sonnet")
.with_current_environment()
.compose();§File-Based Overrides
Prompts can be overridden at runtime by placing files in a config directory:
~/.config/agent/prompts/
├── base.txt # Override base prompt
├── verification.txt # Override verification
├── providers/
│ ├── anthropic.txt # Override Claude prompt
│ ├── openai.txt # Override GPT prompt
│ └── gemini.txt # Override Gemini prompt
└── tools/
├── bash.txt # Override bash description
└── read_file.txt # Override read_file descriptionLoad with overrides:
ⓘ
use codive_prompts::PromptStore;
use std::path::Path;
let store = PromptStore::new()
.with_overrides_dir(Path::new("~/.config/agent/prompts"))
.expect("Failed to load overrides");Structs§
- Embedded
Prompts - Embedded prompts compiled into the binary
- Environment
Context - Runtime environment context
- Prompt
Composer - Builder for composing prompts from multiple layers
- Prompt
Store - Stores prompts with support for file-based overrides
Enums§
- Loader
Error - Provider
Family - Identifies the LLM provider/model family for prompt selection
Functions§
- compose_
standard - Quick helper to compose a standard prompt
- default_
overrides_ dir - Get the default prompt overrides directory