원클릭으로
test
Run tests, write new tests, and verify code changes. Use when implementing features, fixing bugs, or before committing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Run tests, write new tests, and verify code changes. Use when implementing features, fixing bugs, or before committing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Audit place resolution against a real database to find outliers — places that resolve to the wrong country, state, or sub-region. Use when investigating bad map pins, validating new gazetteers, or debugging "why did Richmond, Kalifornien USA land in Canada?". Pairs with the `gazetteers` skill (build/extend) — this skill is for *testing* placement on real data.
Use whenever dispatching subagents in this project — implementer, spec-reviewer, or code-quality-reviewer. Wraps the upstream `superpowers:subagent-driven-development` skill with project-local prompt templates that center user goals (not just spec compliance) and require the dispatcher to verify user-observable outcomes before marking work done.
Decide which Playwright tier to run, capture the right evidence for plan close-out, and route work into the right project. Use when finishing a plan (gate before archive), when adding an e2e test (which project gets the spec), when CI fails on `[boot]` / `[crud]` / `[panels]` / `[reactivity]` / `[imports]` and you need to know which user-goal it protects, or when the question is "is `npm run test:e2e` enough or do I need `:full`?".
Extend the Släktforskning MCP server — add new tools to createProdServer.ts / createDevServer.ts, wire window.api bindings in tauri-window-api.ts + static-api stubs, test via tests/unit/mcp.test.ts, debug agent-facing IPC. Also covers the dev MCP HTTP bridge (src-tauri/src/ui_server.rs) used by ui_screenshot / ui_click / ui_eval / chart_*. Use when modifying anything in src/mcp/, src/renderer/tauri-window-api.ts, or src-tauri/src/ui_server.rs. Distinct from `slaktforskning-mcp` (which is for an agent *using* the MCP tools to do genealogy work for the user).
Build, extend, and debug gazetteers for place resolution. Use when adding new country gazetteers, modifying build scripts, debugging place matching, or questions about the gazetteer system (types, resolver, normalization, data sources).
Use when actually doing genealogy research with the Släktforskning MCP — building real family trees end-to-end, exporting/round-tripping, attaching media + face tags, importing custom gazetteers for places not in the bundled set. Pairs with `slaktforskning-mcp` (which lists the tools). Distinct from `slaktforskning-mcp-dev` (extending the MCP server itself). Triggers on real research workflows, "research X family", "test the app end-to-end", "set up a Bernadotte-style demo".
| name | test |
| description | Run tests, write new tests, and verify code changes. Use when implementing features, fixing bugs, or before committing. |
Three layers: Vitest unit + component tests, Playwright e2e against the packaged Tauri binary, and manual/MCP-driven UI verification for changes the test suite can't see.
npm test # Vitest unit + component (~4000 tests, 80% coverage threshold on src/api/)
npm test -- --coverage # Coverage report (v8, src/api/ only)
npm run test:watch # Watch mode
npm run test:e2e # Tier 1 Playwright: boot, crud, website-export, duplicates (gates CI/merge, <5 min)
npm run test:e2e:full # Tier 1 + Tier 2: panels, reactivity, imports (plan close-out)
npx playwright test --project=boot # One project (the `pretest:e2e` script builds the bundle for you)
npm run lint # ESLint (must pass 0 errors)
Full verify before commit: npm run lint && npm test. E2E runs in CI on PRs; for direct-to-main pushes the executor runs the appropriate tier locally and captures the summary in the commit message (see e2e-evidence skill).
tests/unit/<entity>.test.ts mirrors src/api/<entity>.ts. Fresh in-memory SQLite per test via createTestDb().
import { describe, it, expect, beforeEach } from 'vitest';
import { createTestDb } from './helpers';
import { createThing, getThing, listThings } from '../../src/api/things';
let db: any;
beforeEach(() => { db = createTestDb(); });
describe('things', () => {
it('creates a thing', () => {
const thing = createThing(db, { name: 'test' });
expect(thing.id).toBeDefined();
expect(thing.name).toBe('test');
});
});
Rules:
src/api/ functions directly; never IPC, never Vue components, never mocks.db.get() returns undefined not null; parameter binding via arrays (see rules/api.md).src/api/) are enforced by vitest.config.mts.?? null)const report = importGedcom(db, gedcomString);
expect(listPersons(db)).toHaveLength(3); // query the DB
expect(listPlaces(db)).toHaveLength(2);
expect(getEventsForPerson(db, id)).toHaveLength(1);
Why: when the transform and the fixture share the same wrong assumption (e.g. a misnamed column), a fixture-only comparison silently passes while the bug exists. DB-level assertions catch this — the EVENT_PLACE column-name bug is the canonical case.
Any change to color tokens in tokens.css or shared.css is guarded by tests/unit/wcagContrast.test.ts. Parses both CSS files, builds the effective palette for every (theme × appearance) combination (Forest/Nordic/Twilight × light/dark/high-contrast), asserts every text-on-bg pair against its WCAG threshold:
Run npx vitest run tests/unit/wcag* after any color-token edit.
tests/components/exportTextColorInvariance.test.ts proves PDF/SVG/print render identically regardless of current theme. Inlines tokens.css + shared.css with @media print unwrapped, wraps text in .export-scope, toggles html classes across all theme × appearance combos, asserts getComputedStyle(el).color identical everywhere. Includes a sanity test that bare elements outside the scope do drift. Run after any edit to tokens.css, shared.css, or useChartColors.ts.
tests/components/ — Vue components with Happy DOM (no real browser). Use for components with significant interaction logic.
Worth component-testing: form components with validation/debounce (DateInput, PersonPicker, PlacePicker); modal workflows (EventModal, CitationModal, PersonModal with relatedTo); chart/layout components; keyboard/a11y logic.
Not worth: presentational components (AppBadge, AppAvatar, AppButton) — e2e covers them; simple list/table views — e2e covers CRUD flows.
tests/e2e/ runs Playwright against the packaged Tauri binary, driven by the dev MCP HTTP bridge inside the running app. rules/tests.md is canonical — it lists every project, the two tiers, fixture-driven shapes (panels.ts, reactivity-triples.ts, imports.spec.ts CASES), and adding-a-new-X guidance. e2e-evidence skill decides which tier to run and what to capture for plan close-out.
When writing e2e specs, follow the existing fixture-driven shape — append a PanelDescriptor / ReactivityTriple / CASES entry rather than creating new spec files for one-off scenarios.
Unit and component tests don't cover the rendering stack, modal lifecycle, Vue Router behavior, or visual correctness. Verify in the running app via the slaktforskning-dev MCP before committing UI changes.
ui_navigate { path: '/your-route' }
ui_screenshot { selector: '.your-target' } # crops to the element; <1 KB PNG if scoped
ui_query_styles { selector: '.your-target' } # computed styles + bounding rect
ui_get_dom { selector: '.your-target' } # outerHTML of one element
ui_click { selector: 'button.btn-add' }
ui_fill { selector: 'input.name', value: 'X' }
ui_aria_audit # ARIA findings against WCAG
See tauri-dev for launching the app under the dev MCP, dom-first-debugging for the read-DOM-before-reasoning discipline. The Chrome DevTools MCPs are not the right tool here — Tauri uses the system WebView, not Chromium with CDP; chrome-devtools list_pages returns only about:blank.
Use UI verification: after any Vue component / modal / routing change; when reproducing a reported bug visually; to confirm an IPC binding wires end-to-end; to validate a fix before committing.
db.get() returns undefined, parameter binding uses arrays.src/api/*.ts → npm testnpm test -- --coverage (thresholds must still pass)tauri-window-api.ts → npm run test:e2e (boot + crud)npm run test:e2e:fullnpm run lint && npm test