No slash command · from session-orchestrator
Executes web tests via the canonical Playwright npm package. Captures AX-tree snapshots, screenshots, and console output, then exits with deterministic JSON for orchestrator parsing.
Ships in session-orchestrator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before anything else, read and internalize soul.md in this skill directory. It defines WHO you are — a thin executor, not an orchestrator. Every action in this session should reflect that identity.
Read skills/_shared/bootstrap-gate.md and execute the gate check. If GATE_CLOSED, invoke skills/bootstrap/SKILL.md and wait for completion. If GATE_OPEN, continue.
The PRD originally referenced @playwright/cli — that wording is WRONG. Do not use it.
| Package | Version (2026-05-14) | Status |
|---|---|---|
playwright | 1.60.0 | Canonical — use this |
@playwright/test | 1.60.0 | Test framework (same release train) |
@playwright/cli | 0.1.13 | Unrelated, unstable — DO NOT USE |
@playwright/mcp | 0.0.75 | MCP adapter — R5 hard-gate blocks this |
Verified via npm view playwright version → 1.60.0 (2026-05-14 probe). The binary the orchestrator dispatches is named playwright (not playwright-cli), and it is deliberately the TARGET repo's own @playwright/test dependency — the driver never relies on a globally installed binary, so scripts/lib/playwright-driver/runner.mjs aborts with exit 2 when the target cannot resolve Playwright locally rather than letting npx download it mid-run. Use playwright@^1.60.0 for compatible-minor updates or pin to [email protected] for reproducibility.
Install into the TARGET repo — that is the only install this driver uses, in CI and locally alike:
npm install --save-dev @playwright/[email protected]
npx playwright install chromium # download browser binaries
Both commands run in the target repo, so npx resolves the local binary. A global install is neither used nor sufficient: the driver's preflight requires @playwright/test (or playwright) under the target's own node_modules.
The orchestrator (skills/test-runner/) dispatches this driver via Bash. Session naming follows the artifact-paths contract:
RUN_ID="${pid}-${ms_timestamp}" # from scripts/lib/test-runner/artifact-paths.mjs:makeRunId()
RUN_DIR=".orchestrator/metrics/test-runs/${RUN_ID}"
# Output paths via env vars (Playwright canonical):
# PLAYWRIGHT_HTML_OUTPUT_DIR=${RUN_DIR}/report
# PLAYWRIGHT_JSON_OUTPUT_FILE=${RUN_DIR}/results.json
# PLAYWRIGHT_HTML_OPEN=never
PLAYWRIGHT_HTML_OUTPUT_DIR="${RUN_DIR}/report" \
PLAYWRIGHT_JSON_OUTPUT_FILE="${RUN_DIR}/results.json" \
PLAYWRIGHT_HTML_OPEN=never \
playwright test \
--output "${RUN_DIR}/test-results" \
--reporter html,json \
--trace on \
--project chromium
Canonical: see https://playwright.dev/docs/test-reporters — reporter names are comma-separated; paths flow via env vars. See
scripts/lib/playwright-driver/runner.mjsfor the canonical invocation.
The orchestrator provides RUN_ID and RUN_DIR via environment variables, plus the resolved navigation URL TARGET_URL and expected pages for the selected scope in driver context. The driver executes Playwright and ensures the per-page capture contract below before handing artifacts to the evaluator. --target still names the target repository; it is not the navigation URL.
All artifacts land under ${RUN_DIR}/. Structure:
.orchestrator/metrics/test-runs/<run-id>/
results.json # Playwright JSON reporter output — orchestrator parses this
report/
index.html # HTML report (served via `playwright show-report ${RUN_DIR}/report`)
test-results/
<test-name>/
trace.zip # Playwright trace bundle (open via `playwright show-trace`)
screenshots/ # pre-created by runner.mjs; content written by test fixtures
<page-slug>-w1440.png # desktop screenshot
<page-slug>-w390.png # mobile screenshot; additional per-step captures may coexist
ax-snapshots/ # pre-created by runner.mjs; content written by test fixtures
<page-slug>-w1440.yaml # desktop aria snapshot
<page-slug>-w390.yaml # mobile aria snapshot
axe-<route-slug>-<timestamp>.json # axe-core JSON output (written by test fixture using @axe-core/playwright, NOT by driver)
console.log # NDJSON console output (written by test fixture via page.on('console', ...), NOT by driver)
Division of responsibility:
playwright test, sets reporter env vars (PLAYWRIGHT_HTML_OUTPUT_DIR, PLAYWRIGHT_JSON_OUTPUT_FILE, PLAYWRIGHT_HTML_OPEN), pre-creates ax-snapshots/ and screenshots/ directories before spawn so test fixtures can write into them without racing, captures the process exit code, and routes reporter output to results.json / report/.TARGET_URL, capture the required page pairs, run axe-core scans, and append console NDJSON — all under the provided RUN_DIR.Token discipline: NEVER inline AX-tree dumps into the coordinator context — they balloon to 50–200K tokens. Always write to disk under ${RUN_DIR}/ax-snapshots/. The ux-evaluator agent reads from disk, not from prompt context.
For every page in the selected scope, capture both widths, including intermediate journey pages rather than only the final page of a test. Use exactly the rubric-v2 convention ax-snapshots/<page-slug>-w<viewport>.yaml and the matching screenshots/<page-slug>-w<viewport>.png. Assign a stable, unique slug per page (/start → start, / → index); pass the page/slug inventory to the evaluator so omitted pages cannot disappear from completeness checks.
Use the target's installed Playwright in its capture harness; no new dependency is needed. At each page's settled state, apply this pattern (with page, its unique pageSlug, absolute runDir, and page-specific readyLocator supplied by the harness):
import fs from 'node:fs/promises';
import path from 'node:path';
await fs.mkdir(path.join(runDir, 'screenshots'), { recursive: true });
await fs.mkdir(path.join(runDir, 'ax-snapshots'), { recursive: true });
for (const width of [1440, 390]) {
await page.setViewportSize({ width, height: 900 });
// Wait for this page's responsive content to settle using its ready locator.
await readyLocator.waitFor({ state: 'visible' });
const stem = `${pageSlug}-w${width}`;
await page.screenshot({ path: path.join(runDir, 'screenshots', `${stem}.png`), fullPage: true });
await fs.writeFile(
path.join(runDir, 'ax-snapshots', `${stem}.yaml`),
await page.locator('body').ariaSnapshot(),
);
// Evidence for the target label (test-runner Phase 1): the URL actually driven, per page and viewport.
visited.push({ route, slug: pageSlug, viewport: width, url: page.url(), screenshot: `screenshots/${stem}.png`, ax: `ax-snapshots/${stem}.yaml` });
}
// After the last page: write the visited-URL record next to the artifacts.
await fs.writeFile(path.join(runDir, 'visited-urls.json'), JSON.stringify(visited, null, 2));
visited is one array per capture pass (declare it before the first page) and route is the page's route (/start); test-runner grants LIVE RUN / PRODUCTION-BUILD RUN only when every recorded url has the origin of TARGET_URL, so a pass that writes no visited-urls.json always reports as a dev-server run.
Prefer locator.ariaSnapshot() because it includes link targets for the dead-link check. Resize before each capture and use the same page state for its screenshot and AX snapshot. Never copy a desktop snapshot into a mobile file. Avoid parallel writers for the same page slug.
Before returning, verify all four non-empty artifacts for every expected page. If existing fixtures omit them, execute a capture pass with the same navigation URL, authentication, and page-ready conditions. If a page or viewport cannot be captured, report that exact gap and retain it in the expected-page inventory; the evaluator must leave the report incomplete (BLOCKED). Do not treat the Playwright exit code as proof of captures. AX contents stay on disk, never in coordinator context.
To capture console output as NDJSON:
// in test or fixture
page.on('console', (msg) => {
const entry = JSON.stringify({
ts: Date.now(),
type: msg.type(),
text: msg.text(),
location: msg.location(),
});
fs.appendFileSync(path.join(process.env.RUN_DIR, 'console.log'), entry + '\n');
});
Default: headless (CI-friendly). Operator override via profile:
playwright test --headed # local debugging
playwright test --debug # opens Playwright Inspector
playwright show-trace "${RUN_DIR}/test-results/<test>/trace.zip"
playwright show-report "${RUN_DIR}/report"
The test-runner profile registry (.orchestrator/policy/test-profiles.json) controls headed/headless and browser selection — the driver stays simple and reads these from environment variables set by the orchestrator.
# Output paths via env vars (Playwright canonical):
# PLAYWRIGHT_HTML_OUTPUT_DIR=${RUN_DIR}/report
# PLAYWRIGHT_JSON_OUTPUT_FILE=${RUN_DIR}/results.json
# PLAYWRIGHT_HTML_OPEN=never
bash -c "PLAYWRIGHT_HTML_OUTPUT_DIR=${RUN_DIR}/report \
PLAYWRIGHT_JSON_OUTPUT_FILE=${RUN_DIR}/results.json \
PLAYWRIGHT_HTML_OPEN=never \
playwright test \
--output ${RUN_DIR}/test-results \
--reporter html,json \
--trace on \
--project ${PROFILE_PROJECT:-chromium}"
Canonical: see https://playwright.dev/docs/test-reporters — reporter names are comma-separated; paths flow via env vars. See
scripts/lib/playwright-driver/runner.mjsfor the canonical invocation.
| Code | Meaning | Orchestrator Action |
|---|---|---|
| 0 | All tests passed | Record pass, continue |
| 1 | At least one test failed | Failures become findings (non-fatal) |
| 2 | Framework error (network, browser-install), or no local Playwright in the target repo (preflight) | Surface as driver error, halt run |
${RUN_DIR}/results.json — Playwright JSON reporter format (testRun.{expected,unexpected,skipped,status})${RUN_DIR}/test-results/**/trace.zip — trace bundles, one per test${RUN_DIR}/screenshots/**/*.png — per-step screenshots${RUN_DIR}/console.log — captured console as NDJSON${RUN_DIR}/ax-snapshots/<page-slug>-w<viewport>.yaml — per-page aria snapshots at 1440 and 390, paired with matching screenshots${RUN_DIR}/ax-snapshots/axe-*.json — axe-core violation reports from @axe-core/playwright (written by test fixtures; consumed by ux-evaluator Check 2)Pinned: [email protected] (verified 2026-05-14). The 1.x line is the long-term stable track — Playwright has not announced a v2. Upper-bound advisory: re-validate this skill when upstream crosses 1.65; check for behavioral shifts in JSON reporter format and trace bundle schema before re-pinning.
| Subcommand | Purpose |
|---|---|
playwright test | Run test suite |
playwright codegen <url> | Record tests interactively |
playwright install | Download browser binaries |
playwright show-report <dir> | Serve HTML report locally |
playwright show-trace <zip> | Open trace viewer |
playwright screenshot <url> | Single-shot screenshot |
playwright open <url> | Open browser with inspector |
@playwright/mcp for browser drive — 4× token cost. R5 grep-canary blocks this at validate-plugin time.${RUN_DIR}/ax-snapshots/.npx playwright per-test in a loop — install once, dispatch the local binary.RUN_ID everywhere.@playwright/[email protected] — that is an unrelated, low-version package. Use [email protected].${RUN_DIR} — single source of truth for the orchestrator.| File | Purpose |
|---|---|
soul.md | Driver identity: thin wrapper, not orchestrator |
What SKILL.md sets; muted values are Claude Code's defaults
haikuThree short reads, in order
npx claudepluginhub kanevry/session-orchestrator --plugin session-orchestrator55 skills in this plugin
/architectureUse when the user asks to improve architecture, find refactoring opportunities, surface deepening opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable. Surfaces shallow modules and hypothetical seams using a precise vocabulary (Module / Interface / Implementation / Depth / Seam / Adapter / Leverage / Locality from LANGUAGE.md)./autopilotUse this skill when running an autonomous session-orchestration loop. Chains session-start → session-plan → wave-executor → session-end for N iterations with all 10 kill-switches (SPIRAL, FAILED wave, carryover > 50%, max-hours, max-sessions, resource-overload, token-budget, stall-timeout, sub-threshold confidence, user-abort). Reads Mode-Selector output (Phase B) to decide auto-execute vs. fallback. Writes one autopilot.jsonl record per loop run. Phase C scaffold (issue #277); implementation lives in scripts/lib/autopilot.mjs (Phase C-1 follow-up).
/backlogUse when a repository's issue backlog needs refinement so agents can start work without asking back. Measures the tracker with scripts/backlog-refine.mjs (labels, readiness of status:ready issues, size, dependencies, epics, closed-issue hygiene), then proposes splits, epics, merges, fills and closings for approval and applies them through gitlab-ops. Triggered by /backlog [repo], "refine the backlog", "is the backlog ready for agents", "Backlog aufräumen". Not for finding code defects (use discovery), not for cross-repo dashboards (use portfolio), and not for creating issues from scratch./bootstrapUse this skill when scaffolding the minimum repository structure required by session-orchestrator. Invoked automatically by the Bootstrap Gate when CLAUDE.md, Session Config, or bootstrap.lock is missing. Also available as /bootstrap for manual invocation. Three intensity tiers: fast (demos/spikes), standard (MVPs), deep (production/team).
/brainstormUse when you have a feature idea but the scope or UX is still ambiguous — runs a lightweight Socratic design dialogue (3-5 AUQ rounds) and writes a spec markdown file. Use BEFORE /plan feature when product intent needs validation; skip to /plan feature when scope is already clear. HARD-GATE prevents any code work until the design is user-approved./claude-md-drift-checkUse when detecting drift between CLAUDE.md (or AGENTS.md, the Codex CLI alias) / _meta narrative and live repository state. Ten checks: absolute-path resolution, 01-projects/ count claims, issue-reference freshness, session-file existence, command-count sync, session-config-parity (mandatory template keys = error, opt-in gaps = note, unknown local keys = warning), vault-dir-parity (CLAUDE.md vs AGENTS.md), generated-rule-staleness (WARN-only), rule-scoping (paths:/globs: frontmatter defects, dangling rule citations, zero-match globs), and docs-parity (docs/components.md count-claims vs on-disk counts, template-vs-reference config-key parity, stale .claude/metrics/ paths). Full per-check spec in the body table. Invoked as an opt-in session-end phase; mirrors vault-sync's lean JSON+exit-code contract.
Other plugins' skills for the same job