Move .claude creation for testing agent harness to postinstall (#304283)

* Move .claude creation for testing agent harness to postinstall

title says it all

* rest
This commit is contained in:
Tyler James Leonhardt
2026-03-23 15:22:35 -07:00
committed by GitHub
parent 29359eff77
commit 8978366531
4 changed files with 32 additions and 8 deletions

View File

@@ -1 +0,0 @@
../.github/copilot-instructions.md

View File

@@ -1 +0,0 @@
../../.agents/skills/launch

7
.gitignore vendored
View File

@@ -30,21 +30,16 @@ test/componentFixtures/.screenshots/*
!test/componentFixtures/.screenshots/baseline/
dist
.playwright-cli
.claude/
.agents/agents/*.local.md
.claude/agents/*.local.md
.github/agents/*.local.md
.agents/agents/*.local.agent.md
.claude/agents/*.local.agent.md
.github/agents/*.local.agent.md
.agents/hooks/*.local.json
.claude/hooks/*.local.json
.github/hooks/*.local.json
.agents/instructions/*.local.instructions.md
.claude/instructions/*.local.instructions.md
.github/instructions/*.local.instructions.md
.agents/prompts/*.local.prompt.md
.claude/prompts/*.local.prompt.md
.github/prompts/*.local.prompt.md
.agents/skills/.local/
.claude/skills/.local/
.github/skills/.local/

View File

@@ -288,6 +288,37 @@ async function main() {
fs.writeFileSync(stateFile, JSON.stringify(_state));
fs.writeFileSync(stateContentsFile, JSON.stringify(computeContents()));
// Symlink .claude/ files to their canonical locations to test Claude agent harness
const claudeDir = path.join(root, '.claude');
fs.mkdirSync(claudeDir, { recursive: true });
const claudeMdLink = path.join(claudeDir, 'CLAUDE.md');
if (!fs.existsSync(claudeMdLink)) {
fs.symlinkSync(path.join('..', '.github', 'copilot-instructions.md'), claudeMdLink);
log('.', 'Symlinked .claude/CLAUDE.md -> .github/copilot-instructions.md');
}
const claudeSkillsLink = path.join(claudeDir, 'skills');
if (!fs.existsSync(claudeSkillsLink)) {
fs.symlinkSync(path.join('..', '.agents', 'skills'), claudeSkillsLink);
log('.', 'Symlinked .claude/skills -> .agents/skills');
}
// Temporary: patch @github/copilot-sdk session.js to fix ESM import
// (missing .js extension on vscode-jsonrpc/node). Fixed upstream in v0.1.32.
// TODO: Remove once @github/copilot-sdk is updated to >=0.1.32
for (const dir of ['', 'remote']) {
const sessionFile = path.join(root, dir, 'node_modules', '@github', 'copilot-sdk', 'dist', 'session.js');
if (fs.existsSync(sessionFile)) {
const content = fs.readFileSync(sessionFile, 'utf8');
const patched = content.replace(/from "vscode-jsonrpc\/node"/g, 'from "vscode-jsonrpc/node.js"');
if (content !== patched) {
fs.writeFileSync(sessionFile, patched);
log(dir || '.', 'Patched @github/copilot-sdk session.js (vscode-jsonrpc ESM import fix)');
}
}
}
}
main().catch(err => {