Return the convention instruction filename for a known agent. Uses canonical ID resolution so aliases (e.g., "claude-code", "codex-cli") map to the same filename as their canonical form. Returns `None` for unknown agents — callers should fall back to the source file's basename.
(agent_name: &str)
| 67 | /// Returns `None` for unknown agents — callers should fall back to the |
| 68 | /// source file's basename. |
| 69 | pub fn agent_convention_filename(agent_name: &str) -> Option<&'static str> { |
| 70 | let canonical = canonical_mcp_agent_id(agent_name) |
| 71 | .or_else(|| canonical_configurable_agent_id(agent_name)) |
| 72 | .unwrap_or(agent_name); |
| 73 | |
| 74 | match canonical { |
| 75 | "claude" => Some("CLAUDE.md"), |
| 76 | "copilot" => Some(".github/copilot-instructions.md"), |
| 77 | "codex" => Some("AGENTS.md"), |
| 78 | "gemini" => Some("GEMINI.md"), |
| 79 | "cursor" => Some(".cursor/rules/agentsync.mdc"), |
| 80 | "windsurf" => Some(".windsurfrules"), |
| 81 | "opencode" => Some("AGENTS.md"), |
| 82 | "crush" => Some("CRUSH.md"), |
| 83 | "warp" => Some("WARP.md"), |
| 84 | "amp" => Some("AMPCODE.md"), |
| 85 | _ => None, |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /// Known gitignore patterns for an agent identifier (canonical or alias). |
| 90 | /// |
no test coverage detected