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)
| 1242 | // root so the example works for project-scoped agent configs; otherwise |
| 1243 | // the absolute install path is used (e.g. for --scope user or --dir). |
| 1244 | func kiroResourcePath(installDir, gitRoot string) string { |
| 1245 | if gitRoot != "" && installDir != "" { |
| 1246 | if rel, err := filepath.Rel(gitRoot, installDir); err == nil && !strings.HasPrefix(rel, "..") && !filepath.IsAbs(rel) { |
| 1247 | return filepath.ToSlash(rel) |
| 1248 | } |
| 1249 | } |
| 1250 | return filepath.ToSlash(installDir) |
| 1251 | } |
| 1252 | |
| 1253 | // filterHiddenDirSkills applies the --allow-hidden-dirs flag logic. When the |
| 1254 | // flag is set, all skills are returned with a warning. Otherwise, hidden-dir |