Skip to main content

Module agents

Module agents 

Source
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§

WorktreeAssignment
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§

build_agent_marker
Builds the agent marker file content with optional extended fields.
build_inter_agent_rules
Builds the standard inter-agent rules block that the supervisor injects into every coding agent’s AGENTS.md.
generate_worktree_section
Generates a marker-delimited assignment section for a worktree’s AGENTS.md.
get_agent_marker_path
Returns the path to the agent marker file for a given worktree.
has_git_paw_section
Returns true if content contains a git-paw section start marker.
inject_into_content
Injects section into content: appends if no git-paw section exists, replaces the existing one if present.
inject_section_into_file
install_git_hooks
Installs git-paw’s post-commit dispatcher and pre-push block hook.
remove_git_paw_section
Removes the git-paw managed block (start marker through end marker, inclusive — plus any blank lines immediately adjacent) from content.
remove_session_boot_block
Reads path (treating a missing file as empty), removes any git-paw managed block, and writes the result back. Idempotent: a file with no markers is a no-op and the original content is preserved byte-for-byte.
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.
update_agent_marker
Updates an existing agent marker file with additional fields.