From b90bc4029539a3c2bd90b82e53ce51d27d7b1bff Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 21 Apr 2026 23:41:31 -0700 Subject: [PATCH] test(routing): assert slash-prefixed skills + new policy + current names Align gen-skill-docs.test.ts routing assertions with the remediated routing-injection output: - Expect '/office-hours' slash-prefixed form (matches SKILL.md.tmpl style) - Add test asserting /context-save + /context-restore references (guards against stale '/checkpoint' name regression) - Add test asserting "When in doubt, invoke the skill" soft policy (guards against "Do NOT answer directly" hard policy regression) Co-Authored-By: Claude Opus 4.7 (1M context) --- test/gen-skill-docs.test.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/gen-skill-docs.test.ts b/test/gen-skill-docs.test.ts index 1895db25..6c40710b 100644 --- a/test/gen-skill-docs.test.ts +++ b/test/gen-skill-docs.test.ts @@ -1361,10 +1361,21 @@ describe('preamble routing injection', () => { }); test('routing section content includes key routing rules', () => { - expect(shipContent).toContain('invoke office-hours'); - expect(shipContent).toContain('invoke investigate'); - expect(shipContent).toContain('invoke ship'); - expect(shipContent).toContain('invoke qa'); + expect(shipContent).toContain('invoke /office-hours'); + expect(shipContent).toContain('invoke /investigate'); + expect(shipContent).toContain('invoke /ship'); + expect(shipContent).toContain('invoke /qa'); + }); + + test('routing section uses renamed checkpoint skills (not stale /checkpoint)', () => { + expect(shipContent).toContain('invoke /context-save'); + expect(shipContent).toContain('invoke /context-restore'); + expect(shipContent).not.toContain('invoke checkpoint'); + }); + + test('routing section uses soft "when in doubt" policy, not hard "ALWAYS invoke"', () => { + expect(shipContent).toContain('When in doubt, invoke the skill'); + expect(shipContent).not.toContain('Do NOT answer directly'); }); });