From 8685fd75e65987a7c116d8269b761d08437eb40c Mon Sep 17 00:00:00 2001 From: Abdul Wahab Date: Tue, 1 Sep 2026 14:45:24 +0500 Subject: [PATCH] Fix: tighten finish-capture contract assertions (#568) The previous substring checks would still pass if the skill told agents to run npx playwright install. AI-assisted: prepared with Cursor Grok under @abdulwahabone direction. Co-authored-by: Cursor --- tests/skill-reference.test.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/skill-reference.test.mjs b/tests/skill-reference.test.mjs index 6d32f3e69..b9c6cd058 100644 --- a/tests/skill-reference.test.mjs +++ b/tests/skill-reference.test.mjs @@ -73,8 +73,9 @@ describe('skill reference authoring contracts', () => { const inspectAndFinish = newWork.match(/## 7\. Inspect and finish\n([\s\S]*?)(?:\n## |$)/)?.[1] ?? ''; assert.match(inspectAndFinish, /native or browser-canvas screenshot path/); - assert.match(inspectAndFinish, /npx playwright install/); - assert.match(inspectAndFinish, /installed Chrome/); + assert.match(inspectAndFinish, /Never run `npx playwright install`/); + assert.match(inspectAndFinish, /installed Chrome, Chromium, or Edge/); + assert.match(inspectAndFinish, /fail fast if none is present/); assert.match(inspectAndFinish, /leftover page from another process on the same localhost port/); }); });