Skip to main content

resolve_agent_docs

Function resolve_agent_docs 

Source
pub fn resolve_agent_docs(
    repo_root: &Path,
    agents: &[AgentId],
) -> (Vec<AgentDoc>, Vec<String>)
Expand description

Walk the registry’s patterns for each agent against repo_root.

Returns the per-agent AgentDoc blocks plus a flat list of warning strings for files we couldn’t read or files that weren’t valid UTF-8.

Pattern handling:

  • Flat patterns (no glob metacharacters, e.g. CLAUDE.md, .github/copilot-instructions.md) are checked by direct existence against repo_root.join(pattern).
  • Glob patterns under a known parent directory (e.g. .cursor/rules/*.md) are matched against the entries of that parent directory only — no recursion, no walking past the known prefix.

Files are deduplicated within a single agent’s files by relative path and sorted ascending for stable output.