kiroResourcePath returns a slash-separated path suitable for use in the "resources" field of a Kiro agent config. When the install directory is inside the current git repository the path is made relative to the repo root so the example works for project-scoped agent configs; otherwise the absolute i
(installDir, gitRoot string)
| 1252 | // root so the example works for project-scoped agent configs; otherwise |
| 1253 | // the absolute install path is used (e.g. for --scope user or --dir). |
| 1254 | func kiroResourcePath(installDir, gitRoot string) string { |
| 1255 | if gitRoot != "" && installDir != "" { |
| 1256 | if rel, err := filepath.Rel(gitRoot, installDir); err == nil && !strings.HasPrefix(rel, "..") && !filepath.IsAbs(rel) { |
| 1257 | return filepath.ToSlash(rel) |
| 1258 | } |
| 1259 | } |
| 1260 | return filepath.ToSlash(installDir) |
| 1261 | } |
| 1262 | |
| 1263 | // filterHiddenDirSkills applies the --allow-hidden-dirs flag logic. When the |
| 1264 | // flag is set, all skills are returned with a warning. Otherwise, hidden-dir |