Skip to main content

render_instructions

Function render_instructions 

Source
pub fn render_instructions(
    instructions: &ProjectInstructions,
    byte_budget: usize,
    replace: bool,
) -> Option<Message>
Expand description

Render project instructions into one User <system-reminder> message, or None when there is nothing to inject.

Each entry becomes a ## From: <source_path> section (root→cwd order, so the deepest file is last). The sections body is capped at byte_budget bytes (UTF-8-boundary safe) with a truncation marker; byte_budget == 0 means unbounded. When replace is set (the content changed mid-session), a replace banner leads the envelope.