underAgentsFolder reports whether p (relative to the repo root) is beneath a directory named "agents" at any depth, e.g. agents/foo.md, .claude/agents/foo.md, or agents/category/foo.md.
(root, p string)
| 89 | // directory named "agents" at any depth, e.g. agents/foo.md, |
| 90 | // .claude/agents/foo.md, or agents/category/foo.md. |
| 91 | func underAgentsFolder(root, p string) bool { |
| 92 | rel := relPath(root, p) |
| 93 | for _, seg := range strings.Split(rel, "/") { |
| 94 | if seg == "agents" { |
| 95 | return true |
| 96 | } |
| 97 | } |
| 98 | return false |
| 99 | } |
| 100 | |
| 101 | func resolveScanRoots(root, subPath string) []string { |
| 102 | if subPath == "" { |
no test coverage detected