@runchr/gstack-antigravity 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @runchr/gstack-antigravity might be problematic. Click here for more details.
- package/.agents/rules/ETHOS.md +129 -0
- package/.agents/rules/global-gstack.md +117 -0
- package/.agents/rules/persona-gstack-autoplan.md +14 -0
- package/.agents/rules/persona-gstack-benchmark.md +14 -0
- package/.agents/rules/persona-gstack-browse.md +14 -0
- package/.agents/rules/persona-gstack-canary.md +14 -0
- package/.agents/rules/persona-gstack-careful.md +14 -0
- package/.agents/rules/persona-gstack-codex.md +14 -0
- package/.agents/rules/persona-gstack-cso.md +14 -0
- package/.agents/rules/persona-gstack-design-consultation.md +14 -0
- package/.agents/rules/persona-gstack-design-review.md +14 -0
- package/.agents/rules/persona-gstack-document-release.md +14 -0
- package/.agents/rules/persona-gstack-freeze.md +14 -0
- package/.agents/rules/persona-gstack-gstack-upgrade.md +14 -0
- package/.agents/rules/persona-gstack-guard.md +14 -0
- package/.agents/rules/persona-gstack-investigate.md +14 -0
- package/.agents/rules/persona-gstack-land-and-deploy.md +14 -0
- package/.agents/rules/persona-gstack-office-hours.md +14 -0
- package/.agents/rules/persona-gstack-plan-ceo-review.md +14 -0
- package/.agents/rules/persona-gstack-plan-design-review.md +14 -0
- package/.agents/rules/persona-gstack-plan-eng-review.md +14 -0
- package/.agents/rules/persona-gstack-qa-only.md +14 -0
- package/.agents/rules/persona-gstack-qa.md +14 -0
- package/.agents/rules/persona-gstack-retro.md +14 -0
- package/.agents/rules/persona-gstack-review.md +14 -0
- package/.agents/rules/persona-gstack-setup-browser-cookies.md +14 -0
- package/.agents/rules/persona-gstack-setup-deploy.md +14 -0
- package/.agents/rules/persona-gstack-ship.md +14 -0
- package/.agents/rules/persona-gstack-unfreeze.md +14 -0
- package/.agents/rules/persona-gstack.md +40 -0
- package/.agents/rules/recursive-identities.md +22 -0
- package/.agents/workflows/autoplan.md +30 -0
- package/.agents/workflows/benchmark.md +31 -0
- package/.agents/workflows/browse.md +26 -0
- package/.agents/workflows/canary.md +33 -0
- package/.agents/workflows/careful.md +22 -0
- package/.agents/workflows/codex.md +36 -0
- package/.agents/workflows/cso.md +29 -0
- package/.agents/workflows/design-consultation.md +28 -0
- package/.agents/workflows/design-review.md +28 -0
- package/.agents/workflows/document-release.md +32 -0
- package/.agents/workflows/freeze.md +17 -0
- package/.agents/workflows/gstack-upgrade.md +54 -0
- package/.agents/workflows/gstack.md +56 -0
- package/.agents/workflows/guard.md +18 -0
- package/.agents/workflows/investigate.md +37 -0
- package/.agents/workflows/land-and-deploy.md +35 -0
- package/.agents/workflows/office-hours.md +27 -0
- package/.agents/workflows/plan-ceo-review.md +34 -0
- package/.agents/workflows/plan-design-review.md +31 -0
- package/.agents/workflows/plan-eng-review.md +28 -0
- package/.agents/workflows/qa-only.md +28 -0
- package/.agents/workflows/qa.md +73 -0
- package/.agents/workflows/retro.md +34 -0
- package/.agents/workflows/review.md +30 -0
- package/.agents/workflows/setup-browser-cookies.md +15 -0
- package/.agents/workflows/setup-cookies.md +8 -0
- package/.agents/workflows/setup-deploy.md +21 -0
- package/.agents/workflows/ship.md +93 -0
- package/.agents/workflows/unfreeze.md +12 -0
- package/LICENSE +22 -0
- package/README.md +189 -0
- package/README_KO.md +191 -0
- package/bin/install.js +105 -0
- package/gstack-origin/.agents/skills/gstack/SKILL.md +651 -0
- package/gstack-origin/.agents/skills/gstack-autoplan/SKILL.md +678 -0
- package/gstack-origin/.agents/skills/gstack-benchmark/SKILL.md +482 -0
- package/gstack-origin/.agents/skills/gstack-browse/SKILL.md +511 -0
- package/gstack-origin/.agents/skills/gstack-canary/SKILL.md +486 -0
- package/gstack-origin/.agents/skills/gstack-careful/SKILL.md +50 -0
- package/gstack-origin/.agents/skills/gstack-cso/SKILL.md +607 -0
- package/gstack-origin/.agents/skills/gstack-design-consultation/SKILL.md +615 -0
- package/gstack-origin/.agents/skills/gstack-design-review/SKILL.md +988 -0
- package/gstack-origin/.agents/skills/gstack-document-release/SKILL.md +604 -0
- package/gstack-origin/.agents/skills/gstack-freeze/SKILL.md +67 -0
- package/gstack-origin/.agents/skills/gstack-guard/SKILL.md +62 -0
- package/gstack-origin/.agents/skills/gstack-investigate/SKILL.md +415 -0
- package/gstack-origin/.agents/skills/gstack-land-and-deploy/SKILL.md +873 -0
- package/gstack-origin/.agents/skills/gstack-office-hours/SKILL.md +986 -0
- package/gstack-origin/.agents/skills/gstack-plan-ceo-review/SKILL.md +1268 -0
- package/gstack-origin/.agents/skills/gstack-plan-design-review/SKILL.md +668 -0
- package/gstack-origin/.agents/skills/gstack-plan-eng-review/SKILL.md +826 -0
- package/gstack-origin/.agents/skills/gstack-qa/SKILL.md +1006 -0
- package/gstack-origin/.agents/skills/gstack-qa-only/SKILL.md +626 -0
- package/gstack-origin/.agents/skills/gstack-retro/SKILL.md +1065 -0
- package/gstack-origin/.agents/skills/gstack-review/SKILL.md +704 -0
- package/gstack-origin/.agents/skills/gstack-setup-browser-cookies/SKILL.md +325 -0
- package/gstack-origin/.agents/skills/gstack-setup-deploy/SKILL.md +450 -0
- package/gstack-origin/.agents/skills/gstack-ship/SKILL.md +1312 -0
- package/gstack-origin/.agents/skills/gstack-unfreeze/SKILL.md +36 -0
- package/gstack-origin/.agents/skills/gstack-upgrade/SKILL.md +220 -0
- package/gstack-origin/.env.example +5 -0
- package/gstack-origin/.github/workflows/skill-docs.yml +17 -0
- package/gstack-origin/AGENTS.md +49 -0
- package/gstack-origin/ARCHITECTURE.md +359 -0
- package/gstack-origin/BROWSER.md +271 -0
- package/gstack-origin/CHANGELOG.md +800 -0
- package/gstack-origin/CLAUDE.md +284 -0
- package/gstack-origin/CONTRIBUTING.md +370 -0
- package/gstack-origin/ETHOS.md +129 -0
- package/gstack-origin/LICENSE +21 -0
- package/gstack-origin/README.md +228 -0
- package/gstack-origin/SKILL.md +657 -0
- package/gstack-origin/SKILL.md.tmpl +281 -0
- package/gstack-origin/TODOS.md +564 -0
- package/gstack-origin/VERSION +1 -0
- package/gstack-origin/autoplan/SKILL.md +689 -0
- package/gstack-origin/autoplan/SKILL.md.tmpl +416 -0
- package/gstack-origin/benchmark/SKILL.md +489 -0
- package/gstack-origin/benchmark/SKILL.md.tmpl +233 -0
- package/gstack-origin/bin/dev-setup +68 -0
- package/gstack-origin/bin/dev-teardown +56 -0
- package/gstack-origin/bin/gstack-analytics +191 -0
- package/gstack-origin/bin/gstack-community-dashboard +113 -0
- package/gstack-origin/bin/gstack-config +38 -0
- package/gstack-origin/bin/gstack-diff-scope +71 -0
- package/gstack-origin/bin/gstack-global-discover.ts +591 -0
- package/gstack-origin/bin/gstack-repo-mode +93 -0
- package/gstack-origin/bin/gstack-review-log +9 -0
- package/gstack-origin/bin/gstack-review-read +12 -0
- package/gstack-origin/bin/gstack-slug +15 -0
- package/gstack-origin/bin/gstack-telemetry-log +158 -0
- package/gstack-origin/bin/gstack-telemetry-sync +127 -0
- package/gstack-origin/bin/gstack-update-check +196 -0
- package/gstack-origin/browse/SKILL.md +517 -0
- package/gstack-origin/browse/SKILL.md.tmpl +141 -0
- package/gstack-origin/browse/bin/find-browse +21 -0
- package/gstack-origin/browse/bin/remote-slug +14 -0
- package/gstack-origin/browse/scripts/build-node-server.sh +48 -0
- package/gstack-origin/browse/src/browser-manager.ts +634 -0
- package/gstack-origin/browse/src/buffers.ts +137 -0
- package/gstack-origin/browse/src/bun-polyfill.cjs +109 -0
- package/gstack-origin/browse/src/cli.ts +420 -0
- package/gstack-origin/browse/src/commands.ts +111 -0
- package/gstack-origin/browse/src/config.ts +150 -0
- package/gstack-origin/browse/src/cookie-import-browser.ts +417 -0
- package/gstack-origin/browse/src/cookie-picker-routes.ts +207 -0
- package/gstack-origin/browse/src/cookie-picker-ui.ts +541 -0
- package/gstack-origin/browse/src/find-browse.ts +61 -0
- package/gstack-origin/browse/src/meta-commands.ts +269 -0
- package/gstack-origin/browse/src/platform.ts +17 -0
- package/gstack-origin/browse/src/read-commands.ts +335 -0
- package/gstack-origin/browse/src/server.ts +369 -0
- package/gstack-origin/browse/src/snapshot.ts +398 -0
- package/gstack-origin/browse/src/url-validation.ts +91 -0
- package/gstack-origin/browse/src/write-commands.ts +352 -0
- package/gstack-origin/browse/test/bun-polyfill.test.ts +72 -0
- package/gstack-origin/browse/test/commands.test.ts +1836 -0
- package/gstack-origin/browse/test/config.test.ts +250 -0
- package/gstack-origin/browse/test/cookie-import-browser.test.ts +397 -0
- package/gstack-origin/browse/test/cookie-picker-routes.test.ts +205 -0
- package/gstack-origin/browse/test/find-browse.test.ts +50 -0
- package/gstack-origin/browse/test/fixtures/basic.html +33 -0
- package/gstack-origin/browse/test/fixtures/cursor-interactive.html +22 -0
- package/gstack-origin/browse/test/fixtures/dialog.html +15 -0
- package/gstack-origin/browse/test/fixtures/empty.html +2 -0
- package/gstack-origin/browse/test/fixtures/forms.html +55 -0
- package/gstack-origin/browse/test/fixtures/qa-eval-checkout.html +108 -0
- package/gstack-origin/browse/test/fixtures/qa-eval-spa.html +98 -0
- package/gstack-origin/browse/test/fixtures/qa-eval.html +51 -0
- package/gstack-origin/browse/test/fixtures/responsive.html +49 -0
- package/gstack-origin/browse/test/fixtures/snapshot.html +55 -0
- package/gstack-origin/browse/test/fixtures/spa.html +24 -0
- package/gstack-origin/browse/test/fixtures/states.html +17 -0
- package/gstack-origin/browse/test/fixtures/upload.html +25 -0
- package/gstack-origin/browse/test/gstack-config.test.ts +125 -0
- package/gstack-origin/browse/test/gstack-update-check.test.ts +467 -0
- package/gstack-origin/browse/test/handoff.test.ts +235 -0
- package/gstack-origin/browse/test/path-validation.test.ts +63 -0
- package/gstack-origin/browse/test/platform.test.ts +37 -0
- package/gstack-origin/browse/test/snapshot.test.ts +467 -0
- package/gstack-origin/browse/test/test-server.ts +57 -0
- package/gstack-origin/browse/test/url-validation.test.ts +72 -0
- package/gstack-origin/canary/SKILL.md +493 -0
- package/gstack-origin/canary/SKILL.md.tmpl +220 -0
- package/gstack-origin/careful/SKILL.md +59 -0
- package/gstack-origin/careful/SKILL.md.tmpl +57 -0
- package/gstack-origin/careful/bin/check-careful.sh +112 -0
- package/gstack-origin/codex/SKILL.md +677 -0
- package/gstack-origin/codex/SKILL.md.tmpl +356 -0
- package/gstack-origin/conductor.json +6 -0
- package/gstack-origin/cso/SKILL.md +615 -0
- package/gstack-origin/cso/SKILL.md.tmpl +376 -0
- package/gstack-origin/design-consultation/SKILL.md +625 -0
- package/gstack-origin/design-consultation/SKILL.md.tmpl +369 -0
- package/gstack-origin/design-review/SKILL.md +998 -0
- package/gstack-origin/design-review/SKILL.md.tmpl +262 -0
- package/gstack-origin/docs/images/github-2013.png +0 -0
- package/gstack-origin/docs/images/github-2026.png +0 -0
- package/gstack-origin/docs/skills.md +877 -0
- package/gstack-origin/document-release/SKILL.md +613 -0
- package/gstack-origin/document-release/SKILL.md.tmpl +357 -0
- package/gstack-origin/freeze/SKILL.md +82 -0
- package/gstack-origin/freeze/SKILL.md.tmpl +80 -0
- package/gstack-origin/freeze/bin/check-freeze.sh +68 -0
- package/gstack-origin/gstack-upgrade/SKILL.md +226 -0
- package/gstack-origin/gstack-upgrade/SKILL.md.tmpl +224 -0
- package/gstack-origin/guard/SKILL.md +82 -0
- package/gstack-origin/guard/SKILL.md.tmpl +80 -0
- package/gstack-origin/investigate/SKILL.md +435 -0
- package/gstack-origin/investigate/SKILL.md.tmpl +196 -0
- package/gstack-origin/land-and-deploy/SKILL.md +880 -0
- package/gstack-origin/land-and-deploy/SKILL.md.tmpl +575 -0
- package/gstack-origin/office-hours/SKILL.md +996 -0
- package/gstack-origin/office-hours/SKILL.md.tmpl +624 -0
- package/gstack-origin/package.json +55 -0
- package/gstack-origin/plan-ceo-review/SKILL.md +1277 -0
- package/gstack-origin/plan-ceo-review/SKILL.md.tmpl +838 -0
- package/gstack-origin/plan-design-review/SKILL.md +676 -0
- package/gstack-origin/plan-design-review/SKILL.md.tmpl +314 -0
- package/gstack-origin/plan-eng-review/SKILL.md +836 -0
- package/gstack-origin/plan-eng-review/SKILL.md.tmpl +279 -0
- package/gstack-origin/qa/SKILL.md +1016 -0
- package/gstack-origin/qa/SKILL.md.tmpl +316 -0
- package/gstack-origin/qa/references/issue-taxonomy.md +85 -0
- package/gstack-origin/qa/templates/qa-report-template.md +126 -0
- package/gstack-origin/qa-only/SKILL.md +633 -0
- package/gstack-origin/qa-only/SKILL.md.tmpl +101 -0
- package/gstack-origin/retro/SKILL.md +1072 -0
- package/gstack-origin/retro/SKILL.md.tmpl +833 -0
- package/gstack-origin/review/SKILL.md +849 -0
- package/gstack-origin/review/SKILL.md.tmpl +259 -0
- package/gstack-origin/review/TODOS-format.md +62 -0
- package/gstack-origin/review/checklist.md +190 -0
- package/gstack-origin/review/design-checklist.md +132 -0
- package/gstack-origin/review/greptile-triage.md +220 -0
- package/gstack-origin/scripts/analytics.ts +190 -0
- package/gstack-origin/scripts/dev-skill.ts +82 -0
- package/gstack-origin/scripts/eval-compare.ts +96 -0
- package/gstack-origin/scripts/eval-list.ts +116 -0
- package/gstack-origin/scripts/eval-select.ts +86 -0
- package/gstack-origin/scripts/eval-summary.ts +187 -0
- package/gstack-origin/scripts/eval-watch.ts +172 -0
- package/gstack-origin/scripts/gen-skill-docs.ts +2414 -0
- package/gstack-origin/scripts/skill-check.ts +167 -0
- package/gstack-origin/setup +269 -0
- package/gstack-origin/setup-browser-cookies/SKILL.md +330 -0
- package/gstack-origin/setup-browser-cookies/SKILL.md.tmpl +74 -0
- package/gstack-origin/setup-deploy/SKILL.md +459 -0
- package/gstack-origin/setup-deploy/SKILL.md.tmpl +220 -0
- package/gstack-origin/ship/SKILL.md +1457 -0
- package/gstack-origin/ship/SKILL.md.tmpl +528 -0
- package/gstack-origin/supabase/config.sh +10 -0
- package/gstack-origin/supabase/functions/community-pulse/index.ts +59 -0
- package/gstack-origin/supabase/functions/telemetry-ingest/index.ts +135 -0
- package/gstack-origin/supabase/functions/update-check/index.ts +37 -0
- package/gstack-origin/supabase/migrations/001_telemetry.sql +89 -0
- package/gstack-origin/test/analytics.test.ts +277 -0
- package/gstack-origin/test/codex-e2e.test.ts +197 -0
- package/gstack-origin/test/fixtures/coverage-audit-fixture.ts +76 -0
- package/gstack-origin/test/fixtures/eval-baselines.json +7 -0
- package/gstack-origin/test/fixtures/qa-eval-checkout-ground-truth.json +43 -0
- package/gstack-origin/test/fixtures/qa-eval-ground-truth.json +43 -0
- package/gstack-origin/test/fixtures/qa-eval-spa-ground-truth.json +43 -0
- package/gstack-origin/test/fixtures/review-eval-design-slop.css +86 -0
- package/gstack-origin/test/fixtures/review-eval-design-slop.html +41 -0
- package/gstack-origin/test/fixtures/review-eval-enum-diff.rb +30 -0
- package/gstack-origin/test/fixtures/review-eval-enum.rb +27 -0
- package/gstack-origin/test/fixtures/review-eval-vuln.rb +14 -0
- package/gstack-origin/test/gemini-e2e.test.ts +173 -0
- package/gstack-origin/test/gen-skill-docs.test.ts +1049 -0
- package/gstack-origin/test/global-discover.test.ts +187 -0
- package/gstack-origin/test/helpers/codex-session-runner.ts +282 -0
- package/gstack-origin/test/helpers/e2e-helpers.ts +239 -0
- package/gstack-origin/test/helpers/eval-store.test.ts +548 -0
- package/gstack-origin/test/helpers/eval-store.ts +689 -0
- package/gstack-origin/test/helpers/gemini-session-runner.test.ts +104 -0
- package/gstack-origin/test/helpers/gemini-session-runner.ts +201 -0
- package/gstack-origin/test/helpers/llm-judge.ts +130 -0
- package/gstack-origin/test/helpers/observability.test.ts +283 -0
- package/gstack-origin/test/helpers/session-runner.test.ts +96 -0
- package/gstack-origin/test/helpers/session-runner.ts +357 -0
- package/gstack-origin/test/helpers/skill-parser.ts +206 -0
- package/gstack-origin/test/helpers/touchfiles.ts +260 -0
- package/gstack-origin/test/hook-scripts.test.ts +373 -0
- package/gstack-origin/test/skill-e2e-browse.test.ts +293 -0
- package/gstack-origin/test/skill-e2e-deploy.test.ts +279 -0
- package/gstack-origin/test/skill-e2e-design.test.ts +614 -0
- package/gstack-origin/test/skill-e2e-plan.test.ts +538 -0
- package/gstack-origin/test/skill-e2e-qa-bugs.test.ts +194 -0
- package/gstack-origin/test/skill-e2e-qa-workflow.test.ts +412 -0
- package/gstack-origin/test/skill-e2e-review.test.ts +535 -0
- package/gstack-origin/test/skill-e2e-workflow.test.ts +586 -0
- package/gstack-origin/test/skill-e2e.test.ts +3325 -0
- package/gstack-origin/test/skill-llm-eval.test.ts +787 -0
- package/gstack-origin/test/skill-parser.test.ts +179 -0
- package/gstack-origin/test/skill-routing-e2e.test.ts +605 -0
- package/gstack-origin/test/skill-validation.test.ts +1520 -0
- package/gstack-origin/test/telemetry.test.ts +278 -0
- package/gstack-origin/test/touchfiles.test.ts +262 -0
- package/gstack-origin/unfreeze/SKILL.md +40 -0
- package/gstack-origin/unfreeze/SKILL.md.tmpl +38 -0
- package/package.json +38 -0
- package/scripts/install-antigravity-skill.ps1 +33 -0
- package/scripts/install-antigravity-skill.sh +41 -0
- package/scripts/sync-gstack-origin.ps1 +37 -0
- package/scripts/sync-gstack-origin.sh +35 -0
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
import { describe, test, expect, afterAll } from 'bun:test';
|
|
2
|
+
import { runSkillTest } from './helpers/session-runner';
|
|
3
|
+
import type { SkillTestResult } from './helpers/session-runner';
|
|
4
|
+
import { EvalCollector } from './helpers/eval-store';
|
|
5
|
+
import type { EvalTestEntry } from './helpers/eval-store';
|
|
6
|
+
import { selectTests, detectBaseBranch, getChangedFiles, E2E_TOUCHFILES, GLOBAL_TOUCHFILES } from './helpers/touchfiles';
|
|
7
|
+
import { spawnSync } from 'child_process';
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
import * as os from 'os';
|
|
11
|
+
|
|
12
|
+
const ROOT = path.resolve(import.meta.dir, '..');
|
|
13
|
+
|
|
14
|
+
// Skip unless EVALS=1.
|
|
15
|
+
const evalsEnabled = !!process.env.EVALS;
|
|
16
|
+
const describeE2E = evalsEnabled ? describe : describe.skip;
|
|
17
|
+
|
|
18
|
+
// Eval result collector
|
|
19
|
+
const evalCollector = evalsEnabled ? new EvalCollector('e2e-routing') : null;
|
|
20
|
+
|
|
21
|
+
// Unique run ID for this session
|
|
22
|
+
const runId = new Date().toISOString().replace(/[:.]/g, '').replace('T', '-').slice(0, 15);
|
|
23
|
+
|
|
24
|
+
// --- Diff-based test selection ---
|
|
25
|
+
// Journey routing tests use E2E_TOUCHFILES (entries prefixed 'journey-' in touchfiles.ts).
|
|
26
|
+
let selectedTests: string[] | null = null;
|
|
27
|
+
|
|
28
|
+
if (evalsEnabled && !process.env.EVALS_ALL) {
|
|
29
|
+
const baseBranch = process.env.EVALS_BASE
|
|
30
|
+
|| detectBaseBranch(ROOT)
|
|
31
|
+
|| 'main';
|
|
32
|
+
const changedFiles = getChangedFiles(baseBranch, ROOT);
|
|
33
|
+
|
|
34
|
+
if (changedFiles.length > 0) {
|
|
35
|
+
const selection = selectTests(changedFiles, E2E_TOUCHFILES, GLOBAL_TOUCHFILES);
|
|
36
|
+
selectedTests = selection.selected;
|
|
37
|
+
process.stderr.write(`\nRouting E2E selection (${selection.reason}): ${selection.selected.length}/${Object.keys(E2E_TOUCHFILES).length} tests\n`);
|
|
38
|
+
if (selection.skipped.length > 0) {
|
|
39
|
+
process.stderr.write(` Skipped: ${selection.skipped.join(', ')}\n`);
|
|
40
|
+
}
|
|
41
|
+
process.stderr.write('\n');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// --- Helper functions ---
|
|
46
|
+
|
|
47
|
+
/** Copy all SKILL.md files into tmpDir/.claude/skills/gstack/ for auto-discovery */
|
|
48
|
+
function installSkills(tmpDir: string) {
|
|
49
|
+
const skillDirs = [
|
|
50
|
+
'', // root gstack SKILL.md
|
|
51
|
+
'qa', 'qa-only', 'ship', 'review', 'plan-ceo-review', 'plan-eng-review',
|
|
52
|
+
'plan-design-review', 'design-review', 'design-consultation', 'retro',
|
|
53
|
+
'document-release', 'investigate', 'office-hours', 'browse', 'setup-browser-cookies',
|
|
54
|
+
'gstack-upgrade', 'humanizer',
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
for (const skill of skillDirs) {
|
|
58
|
+
const srcPath = path.join(ROOT, skill, 'SKILL.md');
|
|
59
|
+
if (!fs.existsSync(srcPath)) continue;
|
|
60
|
+
|
|
61
|
+
const destDir = skill
|
|
62
|
+
? path.join(tmpDir, '.claude', 'skills', 'gstack', skill)
|
|
63
|
+
: path.join(tmpDir, '.claude', 'skills', 'gstack');
|
|
64
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
65
|
+
fs.copyFileSync(srcPath, path.join(destDir, 'SKILL.md'));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Init a git repo with config */
|
|
70
|
+
function initGitRepo(dir: string) {
|
|
71
|
+
const run = (cmd: string, args: string[]) =>
|
|
72
|
+
spawnSync(cmd, args, { cwd: dir, stdio: 'pipe', timeout: 5000 });
|
|
73
|
+
run('git', ['init']);
|
|
74
|
+
run('git', ['config', 'user.email', 'test@test.com']);
|
|
75
|
+
run('git', ['config', 'user.name', 'Test']);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function logCost(label: string, result: { costEstimate: { turnsUsed: number; estimatedTokens: number; estimatedCost: number }; duration: number }) {
|
|
79
|
+
const { turnsUsed, estimatedTokens, estimatedCost } = result.costEstimate;
|
|
80
|
+
const durationSec = Math.round(result.duration / 1000);
|
|
81
|
+
console.log(`${label}: $${estimatedCost.toFixed(2)} (${turnsUsed} turns, ${(estimatedTokens / 1000).toFixed(1)}k tokens, ${durationSec}s)`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function recordRouting(name: string, result: SkillTestResult, expectedSkill: string, actualSkill: string | undefined) {
|
|
85
|
+
evalCollector?.addTest({
|
|
86
|
+
name,
|
|
87
|
+
suite: 'Skill Routing E2E',
|
|
88
|
+
tier: 'e2e',
|
|
89
|
+
passed: actualSkill === expectedSkill,
|
|
90
|
+
duration_ms: result.duration,
|
|
91
|
+
cost_usd: result.costEstimate.estimatedCost,
|
|
92
|
+
transcript: result.transcript,
|
|
93
|
+
output: result.output?.slice(0, 2000),
|
|
94
|
+
turns_used: result.costEstimate.turnsUsed,
|
|
95
|
+
exit_reason: result.exitReason,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// --- Tests ---
|
|
100
|
+
|
|
101
|
+
describeE2E('Skill Routing E2E — Developer Journey', () => {
|
|
102
|
+
afterAll(() => {
|
|
103
|
+
evalCollector?.finalize();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test.concurrent('journey-ideation', async () => {
|
|
107
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-ideation-'));
|
|
108
|
+
try {
|
|
109
|
+
initGitRepo(tmpDir);
|
|
110
|
+
installSkills(tmpDir);
|
|
111
|
+
fs.writeFileSync(path.join(tmpDir, 'README.md'), '# New Project\n');
|
|
112
|
+
spawnSync('git', ['add', '.'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
113
|
+
spawnSync('git', ['commit', '-m', 'initial'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
114
|
+
|
|
115
|
+
const testName = 'journey-ideation';
|
|
116
|
+
const expectedSkill = 'office-hours';
|
|
117
|
+
const result = await runSkillTest({
|
|
118
|
+
prompt: "I've been thinking about building a waitlist management tool for restaurants. The existing solutions are expensive and overcomplicated. I want something simple — a tablet app where hosts can add parties, see wait times, and text customers when their table is ready. Help me think through whether this is worth building and what the key design decisions are.",
|
|
119
|
+
workingDirectory: tmpDir,
|
|
120
|
+
maxTurns: 5,
|
|
121
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
122
|
+
timeout: 60_000,
|
|
123
|
+
testName,
|
|
124
|
+
runId,
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
128
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
129
|
+
|
|
130
|
+
logCost(`journey: ${testName}`, result);
|
|
131
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
132
|
+
|
|
133
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
134
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
135
|
+
} finally {
|
|
136
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
137
|
+
}
|
|
138
|
+
}, 150_000);
|
|
139
|
+
|
|
140
|
+
test.concurrent('journey-plan-eng', async () => {
|
|
141
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-plan-eng-'));
|
|
142
|
+
try {
|
|
143
|
+
initGitRepo(tmpDir);
|
|
144
|
+
installSkills(tmpDir);
|
|
145
|
+
fs.writeFileSync(path.join(tmpDir, 'plan.md'), `# Waitlist App Architecture
|
|
146
|
+
|
|
147
|
+
## Components
|
|
148
|
+
- REST API (Express.js)
|
|
149
|
+
- PostgreSQL database
|
|
150
|
+
- React frontend
|
|
151
|
+
- SMS integration (Twilio)
|
|
152
|
+
|
|
153
|
+
## Data Model
|
|
154
|
+
- restaurants (id, name, settings)
|
|
155
|
+
- parties (id, restaurant_id, name, size, phone, status, created_at)
|
|
156
|
+
- wait_estimates (id, restaurant_id, avg_wait_minutes)
|
|
157
|
+
|
|
158
|
+
## API Endpoints
|
|
159
|
+
- POST /api/parties - add party to waitlist
|
|
160
|
+
- GET /api/parties - list current waitlist
|
|
161
|
+
- PATCH /api/parties/:id/status - update party status
|
|
162
|
+
- GET /api/estimate - get current wait estimate
|
|
163
|
+
`);
|
|
164
|
+
spawnSync('git', ['add', '.'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
165
|
+
spawnSync('git', ['commit', '-m', 'initial'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
166
|
+
|
|
167
|
+
const testName = 'journey-plan-eng';
|
|
168
|
+
const expectedSkill = 'plan-eng-review';
|
|
169
|
+
const result = await runSkillTest({
|
|
170
|
+
prompt: "I wrote up a plan for the waitlist app in plan.md. Can you take a look at the architecture and make sure I'm not missing any edge cases or failure modes before I start coding?",
|
|
171
|
+
workingDirectory: tmpDir,
|
|
172
|
+
maxTurns: 5,
|
|
173
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
174
|
+
timeout: 60_000,
|
|
175
|
+
testName,
|
|
176
|
+
runId,
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
180
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
181
|
+
|
|
182
|
+
logCost(`journey: ${testName}`, result);
|
|
183
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
184
|
+
|
|
185
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
186
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
187
|
+
} finally {
|
|
188
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
189
|
+
}
|
|
190
|
+
}, 150_000);
|
|
191
|
+
|
|
192
|
+
test.concurrent('journey-think-bigger', async () => {
|
|
193
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-think-bigger-'));
|
|
194
|
+
try {
|
|
195
|
+
initGitRepo(tmpDir);
|
|
196
|
+
installSkills(tmpDir);
|
|
197
|
+
fs.writeFileSync(path.join(tmpDir, 'plan.md'), `# Waitlist App Architecture
|
|
198
|
+
|
|
199
|
+
## Components
|
|
200
|
+
- REST API (Express.js)
|
|
201
|
+
- PostgreSQL database
|
|
202
|
+
- React frontend
|
|
203
|
+
- SMS integration (Twilio)
|
|
204
|
+
|
|
205
|
+
## Data Model
|
|
206
|
+
- restaurants (id, name, settings)
|
|
207
|
+
- parties (id, restaurant_id, name, size, phone, status, created_at)
|
|
208
|
+
- wait_estimates (id, restaurant_id, avg_wait_minutes)
|
|
209
|
+
|
|
210
|
+
## API Endpoints
|
|
211
|
+
- POST /api/parties - add party to waitlist
|
|
212
|
+
- GET /api/parties - list current waitlist
|
|
213
|
+
- PATCH /api/parties/:id/status - update party status
|
|
214
|
+
- GET /api/estimate - get current wait estimate
|
|
215
|
+
`);
|
|
216
|
+
spawnSync('git', ['add', '.'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
217
|
+
spawnSync('git', ['commit', '-m', 'initial'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
218
|
+
|
|
219
|
+
const testName = 'journey-think-bigger';
|
|
220
|
+
const expectedSkill = 'plan-ceo-review';
|
|
221
|
+
const result = await runSkillTest({
|
|
222
|
+
prompt: "Actually, looking at this plan again, I feel like we're thinking too small. We're just doing waitlists but what about the whole restaurant guest experience? Is there a bigger opportunity here we should go after?",
|
|
223
|
+
workingDirectory: tmpDir,
|
|
224
|
+
maxTurns: 5,
|
|
225
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
226
|
+
timeout: 120_000,
|
|
227
|
+
testName,
|
|
228
|
+
runId,
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
232
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
233
|
+
|
|
234
|
+
logCost(`journey: ${testName}`, result);
|
|
235
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
236
|
+
|
|
237
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
238
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
239
|
+
} finally {
|
|
240
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
241
|
+
}
|
|
242
|
+
}, 180_000);
|
|
243
|
+
|
|
244
|
+
test.concurrent('journey-debug', async () => {
|
|
245
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-debug-'));
|
|
246
|
+
try {
|
|
247
|
+
initGitRepo(tmpDir);
|
|
248
|
+
installSkills(tmpDir);
|
|
249
|
+
|
|
250
|
+
const run = (cmd: string, args: string[]) =>
|
|
251
|
+
spawnSync(cmd, args, { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
252
|
+
|
|
253
|
+
fs.mkdirSync(path.join(tmpDir, 'src'), { recursive: true });
|
|
254
|
+
fs.writeFileSync(path.join(tmpDir, 'src/api.ts'), `
|
|
255
|
+
import express from 'express';
|
|
256
|
+
const app = express();
|
|
257
|
+
|
|
258
|
+
app.get('/api/waitlist', async (req, res) => {
|
|
259
|
+
const db = req.app.locals.db;
|
|
260
|
+
const parties = await db.query('SELECT * FROM parties WHERE status = $1', ['waiting']);
|
|
261
|
+
res.json(parties.rows);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
export default app;
|
|
265
|
+
`);
|
|
266
|
+
fs.writeFileSync(path.join(tmpDir, 'error.log'), `
|
|
267
|
+
[2026-03-18T10:23:45Z] ERROR: GET /api/waitlist - 500 Internal Server Error
|
|
268
|
+
TypeError: Cannot read properties of undefined (reading 'query')
|
|
269
|
+
at /src/api.ts:5:32
|
|
270
|
+
at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
|
|
271
|
+
[2026-03-18T10:23:46Z] ERROR: GET /api/waitlist - 500 Internal Server Error
|
|
272
|
+
TypeError: Cannot read properties of undefined (reading 'query')
|
|
273
|
+
`);
|
|
274
|
+
|
|
275
|
+
run('git', ['add', '.']);
|
|
276
|
+
run('git', ['commit', '-m', 'initial']);
|
|
277
|
+
run('git', ['checkout', '-b', 'feature/waitlist-api']);
|
|
278
|
+
|
|
279
|
+
const testName = 'journey-debug';
|
|
280
|
+
const expectedSkill = 'investigate';
|
|
281
|
+
const result = await runSkillTest({
|
|
282
|
+
prompt: "The GET /api/waitlist endpoint was working fine yesterday but now it's returning 500 errors. The tests are passing locally but the endpoint fails when I hit it with curl. Can you figure out what's going on?",
|
|
283
|
+
workingDirectory: tmpDir,
|
|
284
|
+
maxTurns: 5,
|
|
285
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
286
|
+
timeout: 60_000,
|
|
287
|
+
testName,
|
|
288
|
+
runId,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
292
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
293
|
+
|
|
294
|
+
logCost(`journey: ${testName}`, result);
|
|
295
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
296
|
+
|
|
297
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
298
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
299
|
+
} finally {
|
|
300
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
301
|
+
}
|
|
302
|
+
}, 150_000);
|
|
303
|
+
|
|
304
|
+
test.concurrent('journey-qa', async () => {
|
|
305
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-qa-'));
|
|
306
|
+
try {
|
|
307
|
+
initGitRepo(tmpDir);
|
|
308
|
+
installSkills(tmpDir);
|
|
309
|
+
|
|
310
|
+
fs.writeFileSync(path.join(tmpDir, 'package.json'), JSON.stringify({ name: 'waitlist-app', scripts: { dev: 'next dev' } }, null, 2));
|
|
311
|
+
fs.mkdirSync(path.join(tmpDir, 'src'), { recursive: true });
|
|
312
|
+
fs.writeFileSync(path.join(tmpDir, 'src/index.html'), '<html><body><h1>Waitlist App</h1></body></html>');
|
|
313
|
+
spawnSync('git', ['add', '.'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
314
|
+
spawnSync('git', ['commit', '-m', 'initial'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
315
|
+
|
|
316
|
+
const testName = 'journey-qa';
|
|
317
|
+
const expectedSkill = 'qa';
|
|
318
|
+
const alternateSkills = ['qa-only', 'browse'];
|
|
319
|
+
const result = await runSkillTest({
|
|
320
|
+
prompt: "I think the app is mostly working now. Can you go through the site and test everything — find any bugs and fix them?",
|
|
321
|
+
workingDirectory: tmpDir,
|
|
322
|
+
maxTurns: 5,
|
|
323
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
324
|
+
timeout: 60_000,
|
|
325
|
+
testName,
|
|
326
|
+
runId,
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
330
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
331
|
+
const acceptable = [expectedSkill, ...alternateSkills];
|
|
332
|
+
|
|
333
|
+
logCost(`journey: ${testName}`, result);
|
|
334
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
335
|
+
|
|
336
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
337
|
+
expect(acceptable, `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
338
|
+
} finally {
|
|
339
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
340
|
+
}
|
|
341
|
+
}, 150_000);
|
|
342
|
+
|
|
343
|
+
test.concurrent('journey-code-review', async () => {
|
|
344
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-code-review-'));
|
|
345
|
+
try {
|
|
346
|
+
initGitRepo(tmpDir);
|
|
347
|
+
installSkills(tmpDir);
|
|
348
|
+
|
|
349
|
+
const run = (cmd: string, args: string[]) =>
|
|
350
|
+
spawnSync(cmd, args, { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
351
|
+
|
|
352
|
+
fs.writeFileSync(path.join(tmpDir, 'app.ts'), '// base\n');
|
|
353
|
+
run('git', ['add', '.']);
|
|
354
|
+
run('git', ['commit', '-m', 'initial']);
|
|
355
|
+
run('git', ['checkout', '-b', 'feature/add-waitlist']);
|
|
356
|
+
fs.writeFileSync(path.join(tmpDir, 'app.ts'), '// updated with waitlist feature\nimport { WaitlistService } from "./waitlist";\n');
|
|
357
|
+
fs.writeFileSync(path.join(tmpDir, 'waitlist.ts'), 'export class WaitlistService {\n async addParty(name: string, size: number) {\n // TODO: implement\n }\n}\n');
|
|
358
|
+
run('git', ['add', '.']);
|
|
359
|
+
run('git', ['commit', '-m', 'feat: add waitlist service']);
|
|
360
|
+
|
|
361
|
+
const testName = 'journey-code-review';
|
|
362
|
+
const expectedSkill = 'review';
|
|
363
|
+
const result = await runSkillTest({
|
|
364
|
+
prompt: "I'm about to merge this into main. Can you look over my changes and flag anything risky before I land it?",
|
|
365
|
+
workingDirectory: tmpDir,
|
|
366
|
+
maxTurns: 5,
|
|
367
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
368
|
+
timeout: 120_000,
|
|
369
|
+
testName,
|
|
370
|
+
runId,
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
374
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
375
|
+
|
|
376
|
+
logCost(`journey: ${testName}`, result);
|
|
377
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
378
|
+
|
|
379
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
380
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
381
|
+
} finally {
|
|
382
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
383
|
+
}
|
|
384
|
+
}, 150_000);
|
|
385
|
+
|
|
386
|
+
test.concurrent('journey-ship', async () => {
|
|
387
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-ship-'));
|
|
388
|
+
try {
|
|
389
|
+
initGitRepo(tmpDir);
|
|
390
|
+
installSkills(tmpDir);
|
|
391
|
+
|
|
392
|
+
const run = (cmd: string, args: string[]) =>
|
|
393
|
+
spawnSync(cmd, args, { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
394
|
+
|
|
395
|
+
fs.writeFileSync(path.join(tmpDir, 'app.ts'), '// base\n');
|
|
396
|
+
run('git', ['add', '.']);
|
|
397
|
+
run('git', ['commit', '-m', 'initial']);
|
|
398
|
+
run('git', ['checkout', '-b', 'feature/waitlist']);
|
|
399
|
+
fs.writeFileSync(path.join(tmpDir, 'app.ts'), '// waitlist feature\n');
|
|
400
|
+
run('git', ['add', '.']);
|
|
401
|
+
run('git', ['commit', '-m', 'feat: waitlist']);
|
|
402
|
+
|
|
403
|
+
const testName = 'journey-ship';
|
|
404
|
+
const expectedSkill = 'ship';
|
|
405
|
+
const result = await runSkillTest({
|
|
406
|
+
prompt: "This looks good. Let's get it deployed — push the code up and create a PR.",
|
|
407
|
+
workingDirectory: tmpDir,
|
|
408
|
+
maxTurns: 5,
|
|
409
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
410
|
+
timeout: 60_000,
|
|
411
|
+
testName,
|
|
412
|
+
runId,
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
416
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
417
|
+
|
|
418
|
+
logCost(`journey: ${testName}`, result);
|
|
419
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
420
|
+
|
|
421
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
422
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
423
|
+
} finally {
|
|
424
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
425
|
+
}
|
|
426
|
+
}, 150_000);
|
|
427
|
+
|
|
428
|
+
test.concurrent('journey-docs', async () => {
|
|
429
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-docs-'));
|
|
430
|
+
try {
|
|
431
|
+
initGitRepo(tmpDir);
|
|
432
|
+
installSkills(tmpDir);
|
|
433
|
+
|
|
434
|
+
const run = (cmd: string, args: string[]) =>
|
|
435
|
+
spawnSync(cmd, args, { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
436
|
+
|
|
437
|
+
fs.writeFileSync(path.join(tmpDir, 'README.md'), '# Waitlist App\nA simple waitlist management tool.\n');
|
|
438
|
+
fs.mkdirSync(path.join(tmpDir, 'src'), { recursive: true });
|
|
439
|
+
fs.writeFileSync(path.join(tmpDir, 'src/api.ts'), '// API code\n');
|
|
440
|
+
run('git', ['add', '.']);
|
|
441
|
+
run('git', ['commit', '-m', 'feat: ship waitlist feature']);
|
|
442
|
+
|
|
443
|
+
const testName = 'journey-docs';
|
|
444
|
+
const expectedSkill = 'document-release';
|
|
445
|
+
const result = await runSkillTest({
|
|
446
|
+
prompt: "We just shipped the waitlist feature. Can you go through the README and any other docs and make sure they match what we actually built?",
|
|
447
|
+
workingDirectory: tmpDir,
|
|
448
|
+
maxTurns: 5,
|
|
449
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
450
|
+
timeout: 60_000,
|
|
451
|
+
testName,
|
|
452
|
+
runId,
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
456
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
457
|
+
|
|
458
|
+
logCost(`journey: ${testName}`, result);
|
|
459
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
460
|
+
|
|
461
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
462
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
463
|
+
} finally {
|
|
464
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
465
|
+
}
|
|
466
|
+
}, 150_000);
|
|
467
|
+
|
|
468
|
+
test.concurrent('journey-retro', async () => {
|
|
469
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-retro-'));
|
|
470
|
+
try {
|
|
471
|
+
initGitRepo(tmpDir);
|
|
472
|
+
installSkills(tmpDir);
|
|
473
|
+
|
|
474
|
+
const run = (cmd: string, args: string[]) =>
|
|
475
|
+
spawnSync(cmd, args, { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
476
|
+
|
|
477
|
+
fs.writeFileSync(path.join(tmpDir, 'api.ts'), 'export function getParties() { return []; }\n');
|
|
478
|
+
run('git', ['add', '.']);
|
|
479
|
+
run('git', ['commit', '-m', 'feat: add parties API', '--date', '2026-03-12T09:30:00']);
|
|
480
|
+
|
|
481
|
+
fs.writeFileSync(path.join(tmpDir, 'ui.tsx'), 'export function WaitlistView() { return <div>Waitlist</div>; }\n');
|
|
482
|
+
run('git', ['add', '.']);
|
|
483
|
+
run('git', ['commit', '-m', 'feat: add waitlist UI', '--date', '2026-03-13T14:00:00']);
|
|
484
|
+
|
|
485
|
+
fs.writeFileSync(path.join(tmpDir, 'README.md'), '# Waitlist App\n');
|
|
486
|
+
run('git', ['add', '.']);
|
|
487
|
+
run('git', ['commit', '-m', 'docs: add README', '--date', '2026-03-14T16:00:00']);
|
|
488
|
+
|
|
489
|
+
const testName = 'journey-retro';
|
|
490
|
+
const expectedSkill = 'retro';
|
|
491
|
+
const result = await runSkillTest({
|
|
492
|
+
prompt: "It's Friday. What did we ship this week? I want to do a quick retrospective on what the team accomplished.",
|
|
493
|
+
workingDirectory: tmpDir,
|
|
494
|
+
maxTurns: 5,
|
|
495
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
496
|
+
timeout: 120_000,
|
|
497
|
+
testName,
|
|
498
|
+
runId,
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
502
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
503
|
+
|
|
504
|
+
logCost(`journey: ${testName}`, result);
|
|
505
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
506
|
+
|
|
507
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
508
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
509
|
+
} finally {
|
|
510
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
511
|
+
}
|
|
512
|
+
}, 150_000);
|
|
513
|
+
|
|
514
|
+
test.concurrent('journey-design-system', async () => {
|
|
515
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-design-system-'));
|
|
516
|
+
try {
|
|
517
|
+
initGitRepo(tmpDir);
|
|
518
|
+
installSkills(tmpDir);
|
|
519
|
+
|
|
520
|
+
const run = (cmd: string, args: string[]) =>
|
|
521
|
+
spawnSync(cmd, args, { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
522
|
+
|
|
523
|
+
fs.writeFileSync(path.join(tmpDir, 'package.json'), JSON.stringify({ name: 'waitlist-app' }, null, 2));
|
|
524
|
+
run('git', ['add', '.']);
|
|
525
|
+
run('git', ['commit', '-m', 'initial']);
|
|
526
|
+
|
|
527
|
+
const testName = 'journey-design-system';
|
|
528
|
+
const expectedSkill = 'design-consultation';
|
|
529
|
+
const result = await runSkillTest({
|
|
530
|
+
prompt: "Before we build the UI, I want to establish a design system — typography, colors, spacing, the whole thing. Can you put together brand guidelines for this project?",
|
|
531
|
+
workingDirectory: tmpDir,
|
|
532
|
+
maxTurns: 5,
|
|
533
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
534
|
+
timeout: 60_000,
|
|
535
|
+
testName,
|
|
536
|
+
runId,
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
540
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
541
|
+
|
|
542
|
+
logCost(`journey: ${testName}`, result);
|
|
543
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
544
|
+
|
|
545
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
546
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
547
|
+
} finally {
|
|
548
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
549
|
+
}
|
|
550
|
+
}, 150_000);
|
|
551
|
+
|
|
552
|
+
test.concurrent('journey-visual-qa', async () => {
|
|
553
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'routing-visual-qa-'));
|
|
554
|
+
try {
|
|
555
|
+
initGitRepo(tmpDir);
|
|
556
|
+
installSkills(tmpDir);
|
|
557
|
+
|
|
558
|
+
const run = (cmd: string, args: string[]) =>
|
|
559
|
+
spawnSync(cmd, args, { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
|
|
560
|
+
|
|
561
|
+
fs.mkdirSync(path.join(tmpDir, 'src'), { recursive: true });
|
|
562
|
+
fs.writeFileSync(path.join(tmpDir, 'src/styles.css'), `
|
|
563
|
+
body { font-family: sans-serif; }
|
|
564
|
+
.header { font-size: 24px; margin: 20px; }
|
|
565
|
+
.card { padding: 16px; margin: 8px; border: 1px solid #ccc; }
|
|
566
|
+
.button { background: #007bff; color: white; padding: 10px 20px; }
|
|
567
|
+
`);
|
|
568
|
+
fs.writeFileSync(path.join(tmpDir, 'src/index.html'), `
|
|
569
|
+
<html>
|
|
570
|
+
<head><link rel="stylesheet" href="styles.css"></head>
|
|
571
|
+
<body>
|
|
572
|
+
<div class="header">Waitlist</div>
|
|
573
|
+
<div class="card">Party of 4 - Smith</div>
|
|
574
|
+
<div class="card">Party of 2 - Jones</div>
|
|
575
|
+
</body>
|
|
576
|
+
</html>
|
|
577
|
+
`);
|
|
578
|
+
run('git', ['add', '.']);
|
|
579
|
+
run('git', ['commit', '-m', 'initial UI']);
|
|
580
|
+
|
|
581
|
+
const testName = 'journey-visual-qa';
|
|
582
|
+
const expectedSkill = 'design-review';
|
|
583
|
+
const result = await runSkillTest({
|
|
584
|
+
prompt: "Something looks off on the site. The spacing between sections is inconsistent and the font sizes don't feel right. Can you audit the visual design and fix anything that doesn't look polished?",
|
|
585
|
+
workingDirectory: tmpDir,
|
|
586
|
+
maxTurns: 5,
|
|
587
|
+
allowedTools: ['Skill', 'Read', 'Bash', 'Glob', 'Grep'],
|
|
588
|
+
timeout: 60_000,
|
|
589
|
+
testName,
|
|
590
|
+
runId,
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
const skillCalls = result.toolCalls.filter(tc => tc.tool === 'Skill');
|
|
594
|
+
const actualSkill = skillCalls.length > 0 ? skillCalls[0]?.input?.skill : undefined;
|
|
595
|
+
|
|
596
|
+
logCost(`journey: ${testName}`, result);
|
|
597
|
+
recordRouting(testName, result, expectedSkill, actualSkill);
|
|
598
|
+
|
|
599
|
+
expect(skillCalls.length, `Expected Skill tool to be called but got 0 calls. Claude may have answered directly without invoking a skill. Tool calls: ${result.toolCalls.map(tc => tc.tool).join(', ')}`).toBeGreaterThan(0);
|
|
600
|
+
expect([expectedSkill], `Expected skill ${expectedSkill} but got ${actualSkill}`).toContain(actualSkill);
|
|
601
|
+
} finally {
|
|
602
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
603
|
+
}
|
|
604
|
+
}, 150_000);
|
|
605
|
+
});
|