Expand description
AGENTS.md generation and injection.
Provides marker-based section injection into AGENTS.md files.
Core logic uses pure &str → String functions for testability,
with a thin I/O wrapper for file operations.
Structs§
- Worktree
Assignment - Reads a file (or treats a missing file as empty), injects
section, and writes the result back. Per-worktree assignment context passed by the session launch flow.
Functions§
- assume_
unchanged - Marks a file as assume-unchanged in git’s index.
- exclude_
from_ git - Adds
filenameto the worktree’s.git/info/excludeif not already present. - generate_
worktree_ section - Generates a marker-delimited assignment section for a worktree’s AGENTS.md.
- has_
git_ paw_ section - Returns
trueifcontentcontains a git-paw section start marker. - inject_
into_ content - Injects
sectionintocontent: appends if no git-paw section exists, replaces the existing one if present. - inject_
section_ into_ file - replace_
git_ paw_ section - Replaces the git-paw section (start marker through end marker, inclusive)
with
new_section. If the end marker is missing, replaces from the start marker to EOF. - setup_
worktree_ agents_ md - Reads the root repo’s AGENTS.md, injects the worktree assignment section, writes the result to the worktree root, and protects it from being committed.