From db3aeb1ac9b8a6b0c9ff78550c82d8eefdd0d552 Mon Sep 17 00:00:00 2001 From: Nader Helmy Date: Wed, 15 Jul 2026 19:39:58 -0500 Subject: [PATCH] test: cover canonical benchmark routing --- docs/designs/GSTACK_BROWSER_V0.md | 2 +- setup | 12 ++++++------ test/gen-skill-docs.test.ts | 7 +++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/designs/GSTACK_BROWSER_V0.md b/docs/designs/GSTACK_BROWSER_V0.md index 7539336ad..96e7a30ef 100644 --- a/docs/designs/GSTACK_BROWSER_V0.md +++ b/docs/designs/GSTACK_BROWSER_V0.md @@ -193,7 +193,7 @@ Every gstack skill becomes a browser capability. | `/qa` | Test every page, find bugs, fix them, verify fixes | | `/design-review` | Screenshot → analyze → fix CSS → screenshot again | | `/investigate` | See the error in browser → trace to code → fix → verify | -| `/benchmark` | Measure page performance → detect regressions → alert | +| `/web-performance-benchmark` | Measure page performance → detect regressions → alert | | `/canary` | Monitor deployed site → screenshot periodically → alert on changes | | `/ship` | Run tests → review diff → create PR → verify deployment in browser | | `/cso` | Audit page for XSS, open redirects, clickjacking in real browser | diff --git a/setup b/setup index fe14ae120..ad676ff1c 100755 --- a/setup +++ b/setup @@ -1010,12 +1010,12 @@ if [ "$INSTALL_CLAUDE" -eq 1 ]; then fi # Compatibility aliases for the former generic benchmark command. Keep # both paths available while new docs use /web-performance-benchmark. -for _WEB_PERF_ALIAS in benchmark gstack-benchmark; do - _WEB_PERF_LINK="$INSTALL_SKILLS_DIR/$_WEB_PERF_ALIAS" - if [ -L "$_WEB_PERF_LINK" ] || [ ! -e "$_WEB_PERF_LINK" ]; then - _link_or_copy "$SOURCE_GSTACK_DIR/benchmark" "$_WEB_PERF_LINK" - fi -done + for _WEB_PERF_ALIAS in benchmark gstack-benchmark; do + _WEB_PERF_LINK="$INSTALL_SKILLS_DIR/$_WEB_PERF_ALIAS" + if [ -L "$_WEB_PERF_LINK" ] || [ ! -e "$_WEB_PERF_LINK" ]; then + _link_or_copy "$SOURCE_GSTACK_DIR/benchmark" "$_WEB_PERF_LINK" + fi + done if [ "$LOCAL_INSTALL" -eq 1 ]; then log "gstack ready (project-local)." log " skills: $INSTALL_SKILLS_DIR" diff --git a/test/gen-skill-docs.test.ts b/test/gen-skill-docs.test.ts index 800ff547a..601f49b22 100644 --- a/test/gen-skill-docs.test.ts +++ b/test/gen-skill-docs.test.ts @@ -491,6 +491,13 @@ describe('gen-skill-docs', () => { expect(setup).toContain('_link_or_copy "$SOURCE_GSTACK_DIR/benchmark" "$_WEB_PERF_LINK"'); }); + test('active browser design docs route to the canonical command', () => { + const design = fs.readFileSync(path.join(ROOT, 'docs', 'designs', 'GSTACK_BROWSER_V0.md'), 'utf-8'); + + expect(design).toContain('| `/web-performance-benchmark` | Measure page performance'); + expect(design).not.toContain('| `/benchmark` | Measure page performance'); + }); + test('qa and qa-only templates use QA_METHODOLOGY placeholder', () => { const qaTmpl = fs.readFileSync(path.join(ROOT, 'qa', 'SKILL.md.tmpl'), 'utf-8'); expect(qaTmpl).toContain('{{QA_METHODOLOGY}}');