From 349647d4aabf1563f82ec4b6ad5bf15eda9dd3de Mon Sep 17 00:00:00 2001 From: Snider Date: Sat, 21 Feb 2026 02:18:29 +0000 Subject: [PATCH] feat(docs): scan KB/ directory alongside docs/ Co-Authored-By: Virgil --- cmd/docs/cmd_scan.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmd/docs/cmd_scan.go b/cmd/docs/cmd_scan.go index d4f8fa73..73f4542d 100644 --- a/cmd/docs/cmd_scan.go +++ b/cmd/docs/cmd_scan.go @@ -22,6 +22,7 @@ type RepoDocInfo struct { ClaudeMd string Changelog string DocsFiles []string // All files in docs/ directory (recursive) + KBFiles []string // All files in KB/ directory (recursive) } func loadRegistry(registryPath string) (*repos.Registry, string, error) { @@ -137,5 +138,22 @@ func scanRepoDocs(repo *repos.Repo) RepoDocInfo { }) } + // Recursively scan KB/ directory for .md files + kbDir := filepath.Join(repo.Path, "KB") + if _, err := io.Local.List(kbDir); err == nil { + _ = filepath.WalkDir(kbDir, func(path string, d fs.DirEntry, err error) error { + if err != nil { + return nil + } + if d.IsDir() || !strings.HasSuffix(d.Name(), ".md") { + return nil + } + relPath, _ := filepath.Rel(kbDir, path) + info.KBFiles = append(info.KBFiles, relPath) + info.HasDocs = true + return nil + }) + } + return info }