pub struct ClaudeStrategy;Expand description
Default strategy optimized for Claude models.
Applies research-backed practices:
-
Role-aware ordering (primacy-recency): Instructions → Focus → Context → Examples → Constraints → Schema. Critical directives at the start; output format at the end (closest to generation).
-
Formatting per role:
Instruction→ plain text, no heading (direct authoritative voice)Context→## {label}\n\n{content}Focus→## {label}\n\n{content}Constraint→ collected into a bullet listExample→### Example: {label}\n\n{content}Schema→ “Return ONLY valid JSON (no markdown fences):\n{json}” at end
-
Empty blocks are silently skipped.
Trait Implementations§
Source§impl PromptStrategy for ClaudeStrategy
impl PromptStrategy for ClaudeStrategy
Auto Trait Implementations§
impl Freeze for ClaudeStrategy
impl RefUnwindSafe for ClaudeStrategy
impl Send for ClaudeStrategy
impl Sync for ClaudeStrategy
impl Unpin for ClaudeStrategy
impl UnsafeUnpin for ClaudeStrategy
impl UnwindSafe for ClaudeStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more