Skip to main content

upsert_instructions

Function upsert_instructions 

Source
pub fn upsert_instructions(
    path: &Path,
    content: &str,
    dry_run: bool,
) -> Result<UpsertResult, CliError>
Expand description

Write or update the Seshat instruction section in an agent instruction file.

The section is wrapped with HTML comment markers:

<!-- seshat:start -->
…content…
<!-- seshat:end -->

Algorithm:

  1. File absent → create with the seshat section.
  2. File present, no markers → append the section.
  3. File present, markers found → replace content between markers.

content is the raw text to embed (should NOT include the markers themselves — they are added by this function). Pass AGENTS_MD_CONTENT for standard use.