google/dev-testing-frontend
Testing the Capsem frontend (Astro 7 + Svelte 5 + Tailwind v4 + Capsem-owned semantic CSS). Use when writing frontend tests, running type checks, debugging UI issues, or doing visual verification with Chrome DevTools MCP. Covers vitest, svelte-check, astro check, mock mode, and systematic visual verification workflow.
npx skills add https://github.com/google/capsem --skill dev-testing-frontend
Astro 7 + Svelte 5 (runes only) + Tailwind v4 + Capsem-owned semantic CSS + LayerChart v2.
cd frontend
pnpm run check # astro check + svelte-check (type errors)
npx vitest run --coverage # Unit tests with coverage
pnpm run build # Production build (catches bundling issues dev misses)
All three run as part of just test. The production build is important -- Tailwind v4's Vite plugin can miss client:only components in the SSR module graph, so @source directives in global.css must explicitly include .svelte and .ts files.
Tests live in frontend/src/lib/__tests__/. Use vitest with standard patterns:
import { describe, it, expect } from 'vitest';
When window.__TAURI_INTERNALS__ is absent (browser via just dev ui), api.ts auto-switches all IPC calls to return fake data from mock.ts. Settings data comes from mock-settings.generated.ts (auto-generated from config/settings/ui-metadata.generated.json by the builder). Other mock data (MCP servers, VM state, logs) lives in mock.ts.
This means you can test the full UI without a VM by running just dev ui.
Generated mock data: mock-settings.generated.ts is produced by scripts/generate_schema.py from config/settings/ui-metadata.generated.json. It runs as part of just exec and just test via the _generate-settings recipe. Never hand-edit this file.
Every UI change requires visual verification via Chrome DevTools MCP. No exceptions. Type checks and unit tests pass on broken UIs all the time. The only way to know the UI actually works is to look at it.
just dev ui (if not already running)navigate_page to http://localhost:5173list_console_messages types=["error","warn"] -- expect zerotake_screenshot each affected view -- visually confirm it renders correctlyClick through every section (AI Providers, Repositories, Security, VM, Appearance). Verify:
config/settings/ui-metadata.generated.json are present(currently 68 leaf settings)
When modifying config/settings/ui-metadata.generated.json or regenerating mock-settings.generated.ts:
just _generate-settings (or let just exec/just test do it)just dev uimockSettings.find in generated file)info) = positive (allowed, running, ok). No green in UI chrome.secondary) = negative (denied, stopped, error). No red in UI chrome.Read references/svelte5.md for Svelte 5 patterns and the @sveltejs/mcp CLI for doc lookups.
vm-state-changed payload is { state, trigger } (object), not a plain string<svelte:component this={item.icon} />, not <item.icon />client:only: needs @source directives to scan Svelte filessrc/styles/capsem-theme.css; tests must reject any Preline package, node_modules/preline scan, upstream CSS import, JS plugin, data-hs-* attribute, or HSStaticMethods use.Take google/dev-testing-frontend from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.