mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-22 04:38:24 +08:00
fix: generate .agents/ on demand in tests (not checked in since v0.11.2.0)
.agents/ is gitignored since v0.11.2.0 — tests that read Codex-host SKILL.md files now generate them on demand via `bun run gen-skill-docs.ts --host codex` before reading. Fixes test failures on fresh clones. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -753,11 +753,6 @@ describe('DESIGN_OUTSIDE_VOICES resolver', () => {
|
|||||||
expect(content).toContain('design direction');
|
expect(content).toContain('design direction');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('codex host produces empty outside voices', () => {
|
|
||||||
const codexContent = fs.readFileSync(path.join(ROOT, '.agents', 'skills', 'gstack-design-review', 'SKILL.md'), 'utf-8');
|
|
||||||
expect(codexContent).not.toContain('Design Outside Voices');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('branches correctly per skillName — different prompts', () => {
|
test('branches correctly per skillName — different prompts', () => {
|
||||||
const planContent = fs.readFileSync(path.join(ROOT, 'plan-design-review', 'SKILL.md'), 'utf-8');
|
const planContent = fs.readFileSync(path.join(ROOT, 'plan-design-review', 'SKILL.md'), 'utf-8');
|
||||||
const consultContent = fs.readFileSync(path.join(ROOT, 'design-consultation', 'SKILL.md'), 'utf-8');
|
const consultContent = fs.readFileSync(path.join(ROOT, 'design-consultation', 'SKILL.md'), 'utf-8');
|
||||||
@@ -844,10 +839,6 @@ describe('DESIGN_REVIEW_LITE extended with Codex', () => {
|
|||||||
expect(content).toContain('SCOPE_FRONTEND');
|
expect(content).toContain('SCOPE_FRONTEND');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('codex host does not include Codex design block', () => {
|
|
||||||
const codexContent = fs.readFileSync(path.join(ROOT, '.agents', 'skills', 'gstack-ship', 'SKILL.md'), 'utf-8');
|
|
||||||
expect(codexContent).not.toContain('Codex design voice');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// ─── Codex Generation Tests ─────────────────────────────────
|
// ─── Codex Generation Tests ─────────────────────────────────
|
||||||
@@ -855,6 +846,11 @@ describe('DESIGN_REVIEW_LITE extended with Codex', () => {
|
|||||||
describe('Codex generation (--host codex)', () => {
|
describe('Codex generation (--host codex)', () => {
|
||||||
const AGENTS_DIR = path.join(ROOT, '.agents', 'skills');
|
const AGENTS_DIR = path.join(ROOT, '.agents', 'skills');
|
||||||
|
|
||||||
|
// .agents/ is gitignored (v0.11.2.0) — generate on demand for tests
|
||||||
|
Bun.spawnSync(['bun', 'run', 'scripts/gen-skill-docs.ts', '--host', 'codex'], {
|
||||||
|
cwd: ROOT, stdout: 'pipe', stderr: 'pipe',
|
||||||
|
});
|
||||||
|
|
||||||
// Dynamic discovery of expected Codex skills: all templates except /codex
|
// Dynamic discovery of expected Codex skills: all templates except /codex
|
||||||
const CODEX_SKILLS = (() => {
|
const CODEX_SKILLS = (() => {
|
||||||
const skills: Array<{ dir: string; codexName: string }> = [];
|
const skills: Array<{ dir: string; codexName: string }> = [];
|
||||||
@@ -1106,6 +1102,18 @@ describe('Codex generation (--host codex)', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ─── Design outside voices: Codex host guard ─────────────────
|
||||||
|
|
||||||
|
test('codex host produces empty outside voices in design-review', () => {
|
||||||
|
const codexContent = fs.readFileSync(path.join(AGENTS_DIR, 'gstack-design-review', 'SKILL.md'), 'utf-8');
|
||||||
|
expect(codexContent).not.toContain('Design Outside Voices');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('codex host does not include Codex design block in ship', () => {
|
||||||
|
const codexContent = fs.readFileSync(path.join(AGENTS_DIR, 'gstack-ship', 'SKILL.md'), 'utf-8');
|
||||||
|
expect(codexContent).not.toContain('Codex design voice');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// ─── Setup script validation ─────────────────────────────────
|
// ─── Setup script validation ─────────────────────────────────
|
||||||
|
|||||||
@@ -1328,6 +1328,10 @@ describe('Codex skill', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('codex-host ship/review do NOT contain adversarial review step', () => {
|
test('codex-host ship/review do NOT contain adversarial review step', () => {
|
||||||
|
// .agents/ is gitignored — generate on demand
|
||||||
|
Bun.spawnSync(['bun', 'run', 'scripts/gen-skill-docs.ts', '--host', 'codex'], {
|
||||||
|
cwd: ROOT, stdout: 'pipe', stderr: 'pipe',
|
||||||
|
});
|
||||||
const shipContent = fs.readFileSync(path.join(ROOT, '.agents', 'skills', 'gstack-ship', 'SKILL.md'), 'utf-8');
|
const shipContent = fs.readFileSync(path.join(ROOT, '.agents', 'skills', 'gstack-ship', 'SKILL.md'), 'utf-8');
|
||||||
expect(shipContent).not.toContain('codex review --base');
|
expect(shipContent).not.toContain('codex review --base');
|
||||||
expect(shipContent).not.toContain('CODEX_REVIEWS');
|
expect(shipContent).not.toContain('CODEX_REVIEWS');
|
||||||
@@ -1402,6 +1406,11 @@ describe('Skill trigger phrases', () => {
|
|||||||
describe('Codex skill validation', () => {
|
describe('Codex skill validation', () => {
|
||||||
const AGENTS_DIR = path.join(ROOT, '.agents', 'skills');
|
const AGENTS_DIR = path.join(ROOT, '.agents', 'skills');
|
||||||
|
|
||||||
|
// .agents/ is gitignored (v0.11.2.0) — generate on demand for tests
|
||||||
|
Bun.spawnSync(['bun', 'run', 'scripts/gen-skill-docs.ts', '--host', 'codex'], {
|
||||||
|
cwd: ROOT, stdout: 'pipe', stderr: 'pipe',
|
||||||
|
});
|
||||||
|
|
||||||
// Discover all Claude skills with templates (except /codex which is Claude-only)
|
// Discover all Claude skills with templates (except /codex which is Claude-only)
|
||||||
const CLAUDE_SKILLS_WITH_TEMPLATES = (() => {
|
const CLAUDE_SKILLS_WITH_TEMPLATES = (() => {
|
||||||
const skills: string[] = [];
|
const skills: string[] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user