isCustomAgentFile checks if a file path is a custom agent file under .github/agents/ Custom agent files use GitHub Copilot's agent format, which differs from gh-aw workflow format. These files have a different schema for the 'tools' field (array vs object).
(filePath string)
| 135 | // Custom agent files use GitHub Copilot's agent format, which differs from gh-aw workflow format. |
| 136 | // These files have a different schema for the 'tools' field (array vs object). |
| 137 | func isCustomAgentFile(filePath string) bool { |
| 138 | // Normalize the path to use forward slashes |
| 139 | normalizedPath := filepath.ToSlash(filePath) |
| 140 | |
| 141 | // Check if the path contains .github/agents/ and ends with .md |
| 142 | return strings.Contains(normalizedPath, constants.AgentsDir) && strings.HasSuffix(strings.ToLower(normalizedPath), ".md") |
| 143 | } |
| 144 | |
| 145 | // isRepositoryImport checks if an import spec is a repository-only import (no file path) |
| 146 | // Format: owner/repo@ref or owner/repo (downloads entire .github folder, no agent extraction) |