Skip to content

Commit dcc1fbd

Browse files
fix: hide local docs metadata noise
1 parent 8a03938 commit dcc1fbd

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

scripts/docs-list.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ if (!statSync(DOCS_DIR).isDirectory()) {
2020
process.exit(1);
2121
}
2222

23-
const EXCLUDED_DIRS = new Set(["archive", "research"]);
23+
const EXCLUDED_DIRS = new Set(["archive", "research", "superpowers"]);
24+
const EXCLUDED_FILES = new Set(["AGENTS.md", "CLAUDE.md"]);
2425

2526
/**
2627
* @param {unknown[]} values
@@ -59,13 +60,14 @@ function walkMarkdownFiles(dir, base = dir) {
5960
continue;
6061
}
6162
const fullPath = join(dir, entry.name);
63+
const relativePath = relative(base, fullPath);
6264
if (entry.isDirectory()) {
6365
if (EXCLUDED_DIRS.has(entry.name)) {
6466
continue;
6567
}
6668
files.push(...walkMarkdownFiles(fullPath, base));
67-
} else if (entry.isFile() && entry.name.endsWith(".md")) {
68-
files.push(relative(base, fullPath));
69+
} else if (entry.isFile() && entry.name.endsWith(".md") && !EXCLUDED_FILES.has(relativePath)) {
70+
files.push(relativePath);
6971
}
7072
}
7173
return files.toSorted((a, b) => a.localeCompare(b));

test/scripts/docs-list.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { execFileSync } from "node:child_process";
2+
import { describe, expect, it } from "vitest";
3+
4+
describe("docs-list", () => {
5+
it("omits scoped agent guides and ignored local docs while reporting docs metadata", () => {
6+
const output = execFileSync(process.execPath, ["scripts/docs-list.js"], {
7+
encoding: "utf8",
8+
});
9+
10+
expect(output).not.toContain("[missing front matter]");
11+
expect(output).not.toContain("[summary key missing]");
12+
expect(output).not.toContain("[unterminated front matter]");
13+
expect(output).not.toMatch(/^AGENTS\.md -/mu);
14+
expect(output).not.toContain("superpowers/specs/");
15+
expect(output).toContain("architecture/sparsekernel.md - SparseKernel architecture");
16+
});
17+
});

0 commit comments

Comments
 (0)