MCPcopy Create free account
hub / github.com/github/gh-aw / isCustomAgentFile

Function isCustomAgentFile

pkg/parser/remote_fetch.go:137–143  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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).
137func 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)

Calls 1

ToLowerMethod · 0.80

Tested by 1

TestIsCustomAgentFileFunction · 0.56