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) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-23 08:22:15 -07:00
parent 8cf23ba61a
commit 78740154a5
+10 -1
View File
@@ -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 */