From 099a7723a33f6ae14c9ac33f6351fb34028abb3c Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 10 Apr 2026 13:40:45 -0500 Subject: [PATCH 1/2] fix(gsd): add missing directories to codebase generator exclude list .agents/, .bg-shell/, .idea/, venv/, target/, .cache/, and tmp/ were missing from DEFAULT_EXCLUDES. This caused /gsd-new-project to scan skill and agent definition files as project code, confusing researcher agents during project initialization. Aligns the exclude list with the gitignore patterns in gitignore.ts. --- .../extensions/gsd/codebase-generator.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/resources/extensions/gsd/codebase-generator.ts b/src/resources/extensions/gsd/codebase-generator.ts index f56d84079..b291c3c1f 100644 --- a/src/resources/extensions/gsd/codebase-generator.ts +++ b/src/resources/extensions/gsd/codebase-generator.ts @@ -71,13 +71,23 @@ interface EnumeratedFiles { // ─── Defaults ──────────────────────────────────────────────────────────────── const DEFAULT_EXCLUDES = [ + // ── AI / tooling meta ── + ".agents/", ".gsd/", ".planning/", ".plans/", ".claude/", ".cursor/", + ".bg-shell/", + + // ── Editor / IDE ── ".vscode/", + ".idea/", + + // ── VCS ── ".git/", + + // ── Dependencies & build artifacts ── "node_modules/", "dist/", "build/", @@ -85,7 +95,13 @@ const DEFAULT_EXCLUDES = [ "coverage/", "__pycache__/", ".venv/", + "venv/", "vendor/", + "target/", + + // ── Misc ── + ".cache/", + "tmp/", ]; const DEFAULT_MAX_FILES = 500; From 89bdc1e7f931ba29f11bd69e10caeaf2c752bb3c Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 10 Apr 2026 13:46:53 -0500 Subject: [PATCH 2/2] test(gsd): add regression test for .agents/ and tooling dir exclusion Verifies that .agents/, .bg-shell/, .idea/, .cache/, tmp/, target/, and venv/ are excluded from the codebase map during generation. --- .../gsd/tests/codebase-generator.test.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/resources/extensions/gsd/tests/codebase-generator.test.ts b/src/resources/extensions/gsd/tests/codebase-generator.test.ts index d8d3d74c8..923c19f1d 100644 --- a/src/resources/extensions/gsd/tests/codebase-generator.test.ts +++ b/src/resources/extensions/gsd/tests/codebase-generator.test.ts @@ -162,6 +162,34 @@ test("generateCodebaseMap: excludes .claude/ and other tool directories", () => } }); +test("generateCodebaseMap: excludes .agents/ and other tooling directories", () => { + const base = makeTmpRepo(); + try { + addFile(base, "src/main.ts"); + addFile(base, ".agents/skills/pdf/SKILL.md"); + addFile(base, ".agents/skills/find-skills/SKILL.md"); + addFile(base, ".bg-shell/session.json"); + addFile(base, ".idea/workspace.xml"); + addFile(base, ".cache/data.bin"); + addFile(base, "tmp/scratch.ts"); + addFile(base, "target/debug/build.rs"); + addFile(base, "venv/lib/site.py"); + + const result = generateCodebaseMap(base); + assert.ok(result.content.includes("`src/main.ts`"), "should include src/main.ts"); + assert.ok(!result.content.includes("SKILL.md"), "should exclude .agents/ files"); + assert.ok(!result.content.includes(".bg-shell"), "should exclude .bg-shell/ files"); + assert.ok(!result.content.includes(".idea"), "should exclude .idea/ files"); + assert.ok(!result.content.includes(".cache"), "should exclude .cache/ files"); + assert.ok(!result.content.includes("tmp/"), "should exclude tmp/ files"); + assert.ok(!result.content.includes("target"), "should exclude target/ files"); + assert.ok(!result.content.includes("venv"), "should exclude venv/ files"); + assert.equal(result.fileCount, 1); + } finally { + cleanup(base); + } +}); + test("generateCodebaseMap: excludes binary and lock files", () => { const base = makeTmpRepo(); try {