diff --git a/test/skill-e2e.test.ts b/test/skill-e2e.test.ts index 4f96f197..ba00bcf8 100644 --- a/test/skill-e2e.test.ts +++ b/test/skill-e2e.test.ts @@ -323,10 +323,13 @@ File a contributor report about this issue. Then tell me what you filed.`, const logFiles = fs.readdirSync(logsDir).filter(f => f.endsWith('.md')); expect(logFiles.length).toBeGreaterThan(0); + // Verify new reflection-based format const logContent = fs.readFileSync(path.join(logsDir, logFiles[0]), 'utf-8'); expect(logContent).toContain('Hey gstack team'); expect(logContent).toContain('What I was trying to do'); expect(logContent).toContain('What happened instead'); + expect(logContent).toMatch(/rating/i); + expect(logContent).toMatch(/what would make/i); // Clean up try { fs.rmSync(contribDir, { recursive: true, force: true }); } catch {} diff --git a/test/skill-validation.test.ts b/test/skill-validation.test.ts index 88e98935..1cefac5a 100644 --- a/test/skill-validation.test.ts +++ b/test/skill-validation.test.ts @@ -438,6 +438,44 @@ describe('v0.4.1 preamble features', () => { } }); +// --- Contributor mode preamble structure validation --- + +describe('Contributor mode preamble structure', () => { + const skillsWithPreamble = [ + 'SKILL.md', 'browse/SKILL.md', 'qa/SKILL.md', + 'qa-only/SKILL.md', + 'setup-browser-cookies/SKILL.md', + 'ship/SKILL.md', 'review/SKILL.md', + 'plan-ceo-review/SKILL.md', 'plan-eng-review/SKILL.md', + 'retro/SKILL.md', + ]; + + for (const skill of skillsWithPreamble) { + test(`${skill} has 0-10 rating in contributor mode`, () => { + const content = fs.readFileSync(path.join(ROOT, skill), 'utf-8'); + expect(content).toContain('0 to 10'); + expect(content).toContain('My rating'); + }); + + test(`${skill} has calibration example`, () => { + const content = fs.readFileSync(path.join(ROOT, skill), 'utf-8'); + expect(content).toContain('Calibration'); + expect(content).toContain('the bar'); + }); + + test(`${skill} has "what would make this a 10" field`, () => { + const content = fs.readFileSync(path.join(ROOT, skill), 'utf-8'); + expect(content).toContain('What would make this a 10'); + }); + + test(`${skill} uses periodic reflection (not per-command)`, () => { + const content = fs.readFileSync(path.join(ROOT, skill), 'utf-8'); + expect(content).toContain('workflow step'); + expect(content).not.toContain('After you use gstack-provided CLIs'); + }); + } +}); + describe('Enum & Value Completeness in review checklist', () => { const checklist = fs.readFileSync(path.join(ROOT, 'review', 'checklist.md'), 'utf-8');