claude-toolkit 0.1.12 → 0.1.18

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.18 (2026-04-05)
4
+
5
+ - docs: update cross-references for vite, playwright, and storybook stacks
6
+
7
+ ## 0.1.17 (2026-04-05)
8
+
9
+ - feat: add storybook stack with interaction testing and visual regression
10
+
11
+ ## 0.1.16 (2026-04-05)
12
+
13
+ - feat: add playwright stack with E2E testing, Page Objects, and CI/CD
14
+
15
+ ## 0.1.15 (2026-04-05)
16
+
17
+ - feat: add vite stack with Vitest testing, coverage, and browser mode
18
+
19
+ ## 0.1.14 (2026-04-05)
20
+
21
+ - docs: add 3-layer testing strategy and shared principles to testing patterns
22
+
23
+ ## 0.1.13 (2026-04-05)
24
+
25
+ - docs: add testing best practices for vitest, playwright, and storybook
26
+
3
27
  ## 0.1.12 (2026-04-05)
4
28
 
5
29
  - docs: update skills and docs to 2026 best practices
package/README.md CHANGED
@@ -50,11 +50,14 @@ export default defineConfig({
50
50
  | Stack | Skills Added |
51
51
  |-------|-------------|
52
52
  | `solidjs` | SolidJS reactivity, signals, components |
53
+ | `vite` | Vite build config, plugins, Vitest testing, coverage, browser mode |
53
54
  | `vanilla-extract` | Type-safe CSS, sprinkles, recipes, themes |
54
55
  | `rust-wasm` | Rust WASM for Cloudflare Workers |
55
56
  | `protobuf` | Protocol Buffers, code generation, contracts |
56
57
  | `cloudflare` | D1 database, KV cache, Wrangler |
57
58
  | `i18n-typesafe` | typesafe-i18n internationalization |
59
+ | `playwright` | Playwright E2E testing, Page Objects, fixtures, CI/CD |
60
+ | `storybook` | Storybook interaction testing, CSF 3, visual regression |
58
61
 
59
62
  ## Core Features (always included)
60
63
 
@@ -11,6 +11,35 @@ description: Generic test-driven development practices and patterns applicable t
11
11
  2. **Green** -- Minimal code to pass. No optimization yet.
12
12
  3. **Refactor** -- Clean up while keeping tests green. Commit at each stage.
13
13
 
14
+ ## 3-Layer Testing Strategy
15
+
16
+ ```
17
+ / E2E \ Real browsers, full user flows
18
+ /----------\
19
+ / Interaction \ Component sandbox, behavior, a11y
20
+ /----------------\
21
+ / Unit \ Pure logic, signals, utilities
22
+ /--------------------\
23
+ ```
24
+
25
+ | Layer | Target Ratio | What to Cover |
26
+ | ----------- | ------------ | ---------------------------------------------------------------------------- |
27
+ | Unit | ~70% | Business logic, utilities, data transforms, reactive primitives, error paths |
28
+ | Interaction | ~20% | Component variants, user interactions, accessibility, visual regression |
29
+ | E2E | ~10% | Critical user journeys, authentication flows, cross-page workflows |
30
+
31
+ ### When to Use Which Layer
32
+
33
+ | Question | Layer |
34
+ | ------------------------------------------------- | -------------------------------------- |
35
+ | Does this logic need a DOM? | **Unit** if no, **Interaction** if yes |
36
+ | Does it involve multiple pages or navigation? | **E2E** |
37
+ | Am I testing a single component's visual states? | **Interaction** |
38
+ | Am I testing a reactive primitive (signal, memo)? | **Unit** |
39
+ | Does it require authentication or real network? | **E2E** |
40
+ | Am I testing component accessibility? | **Interaction** (axe-core) |
41
+ | Does it need the full server running? | **E2E** |
42
+
14
43
  ## Test Behavior, Not Implementation
15
44
 
16
45
  Test *what* code does (public interface, observable outputs), not *how* (internal state, call counts). Implementation-coupled tests break on every refactor.
@@ -31,6 +60,13 @@ New required fields update the factory once, not every test.
31
60
  - Co-locate tests or mirror source structure. One test file per module (`module.test.ext`).
32
61
  - Group with `describe`, name as sentences: `it("rejects expired tokens")`.
33
62
 
63
+ ## Shared Principles
64
+
65
+ - **Prefer role-based queries.** Use `getByRole`, `getByLabel`, `getByText` over test IDs or CSS selectors.
66
+ - **Never sleep.** Use framework-provided waiting mechanisms (`waitFor`, `findBy*`, web-first assertions).
67
+ - **One assertion focus per test.** Multiple assertions are fine if they verify facets of the same behavior.
68
+ - **Isolate tests.** No test should depend on another test's side effects. Reset state between tests.
69
+
34
70
  ## Mocking Rules
35
71
 
36
72
  - Prefer real dependencies (in-memory DB, local server) when feasible.
@@ -69,7 +105,7 @@ Bun supports `describe`, `it`/`test`, `expect`, lifecycle hooks, and snapshot te
69
105
 
70
106
  ## Test Pyramid
71
107
 
72
- Many unit tests (fast, focused) > some integration tests (multi-component) > few E2E tests (full flow).
108
+ See 3-Layer Testing Strategy above. Many unit tests (fast, focused) > some interaction tests (component sandbox) > few E2E tests (full flow). Aim for 70/20/10 distribution.
73
109
 
74
110
  ## Anti-Patterns
75
111
 
package/docs/README.md CHANGED
@@ -42,8 +42,11 @@ Stack-specific skills activated based on your `claude-toolkit.config.ts` configu
42
42
  | Skill | Stack | Description |
43
43
  | -------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------ |
44
44
  | [ct-solidjs-patterns](stacks/solidjs-patterns.md) | `solidjs` | Reactivity, signals, effects, component patterns, and props handling |
45
+ | [ct-vite-vitest-patterns](stacks/vite-vitest-patterns.md) | `vite` | Vite build config, plugins, env vars, Vitest testing, coverage, browser mode |
45
46
  | [ct-vanilla-extract-patterns](stacks/vanilla-extract-patterns.md) | `vanilla-extract` | Type-safe CSS with zero runtime: styles, recipes, themes, sprinkles |
46
47
  | [ct-rust-wasm-patterns](stacks/rust-wasm-patterns.md) | `rust-wasm` | Rust WASM for Cloudflare Workers: routing, handlers, env bindings |
47
48
  | [ct-protobuf-contracts](stacks/protobuf-contracts.md) | `protobuf` | Protocol Buffers for API contracts: schema design, versioning, code generation |
48
49
  | [ct-cloudflare-d1-kv](stacks/cloudflare-d1-kv.md) | `cloudflare` | D1 database and KV cache: queries, migrations, caching patterns |
49
50
  | [ct-i18n-typesafe](stacks/i18n-typesafe.md) | `i18n-typesafe` | Type-safe internationalization with compile-time key checking |
51
+ | [ct-playwright-patterns](stacks/playwright-patterns.md) | `playwright` | E2E testing with Page Objects, fixtures, auth, network mocking, CI/CD |
52
+ | [ct-storybook-patterns](stacks/storybook-patterns.md) | `storybook` | Interaction testing, CSF 3, play functions, a11y, visual regression |
@@ -0,0 +1,84 @@
1
+ # Testing Best Practices
2
+
3
+ > A curated collection of testing best practices for the rendezvous.nz stack, sourced from official documentation, framework maintainers, and the testing community as of 2026.
4
+
5
+ This project uses a **3-layer testing strategy** that maps to the classic testing pyramid. Each layer targets a different scope, runs in a different environment, and catches a different class of bugs.
6
+
7
+ ```
8
+ / E2E \ Playwright (real browsers)
9
+ /----------\ Full user flows, cross-browser
10
+ / Interaction \ Storybook (component sandbox)
11
+ /----------------\ Component behavior, visual, a11y
12
+ / Unit \ Vitest (Node/JSDOM)
13
+ /--------------------\ Pure logic, signals, utilities
14
+ ```
15
+
16
+ ## The Three Layers
17
+
18
+ | Layer | Tool | Scope | Environment | Speed |
19
+ | --------------------------------------- | ---------------- | ------------------------------------ | -------------------------------------- | ----------------- |
20
+ | [Unit](vitest-unit.md) | Vitest 4.x | Functions, signals, hooks, utilities | Node / JSDOM | ~ms per test |
21
+ | [Interaction](storybook-interaction.md) | Storybook 10.x | Component rendering, behavior, a11y | Real browser (via Vitest addon) | ~100ms per story |
22
+ | [E2E](playwright-e2e.md) | Playwright 1.58+ | Full user flows, API integration | Real browser (Chromium/Firefox/WebKit) | ~seconds per test |
23
+
24
+ ## When to Use Which Layer
25
+
26
+ | Question | Layer |
27
+ | --------------------------------------------------------- | -------------------------------------- |
28
+ | Does this logic need a DOM? | **Unit** if no, **Interaction** if yes |
29
+ | Does it involve multiple pages or navigation? | **E2E** |
30
+ | Am I testing a single component's visual states? | **Interaction** |
31
+ | Am I testing a reactive primitive (signal, memo, effect)? | **Unit** |
32
+ | Does it require authentication or real network? | **E2E** |
33
+ | Am I testing component accessibility? | **Interaction** (axe-core addon) |
34
+ | Am I testing cross-browser rendering? | **E2E** (multi-browser projects) |
35
+ | Does it need the Cloudflare Worker running? | **E2E** |
36
+
37
+ ## Distribution Guideline
38
+
39
+ Aim for the pyramid shape -- many fast unit tests at the base, fewer interaction tests in the middle, and a focused set of E2E tests at the top.
40
+
41
+ | Layer | Target Ratio | What to Cover |
42
+ | ----------- | ------------ | ---------------------------------------------------------------------------- |
43
+ | Unit | ~70% | Business logic, utilities, data transforms, reactive primitives, error paths |
44
+ | Interaction | ~20% | Component variants, user interactions, accessibility, visual regression |
45
+ | E2E | ~10% | Critical user journeys, authentication flows, cross-page workflows |
46
+
47
+ ## Shared Principles Across All Layers
48
+
49
+ 1. **Test behavior, not implementation.** Assert what the user sees or what the API returns, not internal state.
50
+ 2. **Prefer role-based queries.** Use `getByRole`, `getByLabel`, `getByText` over test IDs or CSS selectors.
51
+ 3. **Never sleep.** Use framework-provided waiting mechanisms (`waitFor`, `findBy*`, web-first assertions).
52
+ 4. **One assertion focus per test.** A test should verify one behavior. Multiple assertions are fine if they verify facets of the same behavior.
53
+ 5. **Isolate tests.** No test should depend on another test's side effects. Reset state between tests.
54
+ 6. **Mock at boundaries.** Mock network calls and external services, not internal modules.
55
+ 7. **SolidJS reactivity rules apply in tests.** Never destructure props. Use `renderHook` or `createRoot` for signal testing.
56
+
57
+ ## SolidJS-Specific Considerations
58
+
59
+ SolidJS components run once -- only reactive expressions re-execute. This affects testing:
60
+
61
+ - **`render()` takes a callback**: `render(() => <Component />)`, not `render(<Component />)`.
62
+ - **Effects are async**: Use `testEffect` from `@solidjs/testing-library` for effect assertions.
63
+ - **Storybook decorators need `createJSXDecorator`**: Standard decorators cause duplicate DOM elements with SolidJS.
64
+
65
+ ## Technology Versions (as of April 2026)
66
+
67
+ | Tool | Version | Notes |
68
+ | ------------------------ | ------- | ---------------------------------------------------- |
69
+ | Vitest | ^4.1.x | V8 coverage, test tags, builder-pattern fixtures |
70
+ | @solidjs/testing-library | ^0.8.x | SolidJS-specific render, renderHook, testEffect |
71
+ | Storybook | ^10.3.x | ESM-only, `sb.mock`, testing widget |
72
+ | storybook-solidjs-vite | ^10.0.x | Community-maintained SolidJS renderer |
73
+ | @storybook/addon-vitest | ^10.x | Replaces old test-runner, uses Vitest browser mode |
74
+ | Playwright | ^1.58.x | Timeline view, Chrome for Testing, WebSocket mocking |
75
+ | @axe-core/playwright | ^4.x | WCAG 2.1 AA automated accessibility checks |
76
+ | MSW | ^2.x | Network mocking for both Storybook and Vitest |
77
+
78
+ ## Guides
79
+
80
+ | Guide | Summary |
81
+ | --------------------------------------------------------- | ---------------------------------------------------------------------------- |
82
+ | [Vitest Unit Testing](vitest-unit.md) | AAA pattern, signal testing, mocking, coverage, performance, anti-patterns. |
83
+ | [Storybook Interaction Testing](storybook-interaction.md) | CSF 3, play functions, a11y, visual regression, MSW, portable stories. |
84
+ | [Playwright E2E Testing](playwright-e2e.md) | Page Objects, fixtures, auth, network mocking, CI/CD, flaky test prevention. |