From 78740154a53981b498dcdb7c1ed52029938aa07f Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 23 Mar 2026 08:22:15 -0700 Subject: [PATCH] fix: copy CLAUDE.md into routing test tmpDirs for skill context In containerized CI, Claude lacks the project context (CLAUDE.md) that guides routing decisions locally. Without it, Claude answers directly with Bash/Agent instead of invoking specific skills. Copying CLAUDE.md gives Claude the same context it has locally. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/skill-routing-e2e.test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/skill-routing-e2e.test.ts b/test/skill-routing-e2e.test.ts index ae17c2df..597a64e9 100644 --- a/test/skill-routing-e2e.test.ts +++ b/test/skill-routing-e2e.test.ts @@ -44,7 +44,8 @@ if (evalsEnabled && !process.env.EVALS_ALL) { // --- Helper functions --- -/** Copy all SKILL.md files into tmpDir/.claude/skills/gstack/ for auto-discovery */ +/** Copy all SKILL.md files into tmpDir/.claude/skills/gstack/ for auto-discovery, + * plus CLAUDE.md so Claude has project context for routing decisions. */ function installSkills(tmpDir: string) { const skillDirs = [ '', // root gstack SKILL.md @@ -64,6 +65,14 @@ function installSkills(tmpDir: string) { fs.mkdirSync(destDir, { recursive: true }); fs.copyFileSync(srcPath, path.join(destDir, 'SKILL.md')); } + + // Copy CLAUDE.md so Claude has project context for skill routing. + // Without this, Claude in containerized environments lacks the context + // that guides it to invoke specific skills vs answering directly. + const claudeMdSrc = path.join(ROOT, 'CLAUDE.md'); + if (fs.existsSync(claudeMdSrc)) { + fs.copyFileSync(claudeMdSrc, path.join(tmpDir, 'CLAUDE.md')); + } } /** Init a git repo with config */