Skip to content

chore(claude): add playground builder skill - #285

Draft
greg-olivier wants to merge 5 commits into
refactor/fixtures/extract-plansfrom
chore/claude/add-plaground-builder-skill
Draft

greg-olivier wants to merge 5 commits into
refactor/fixtures/extract-plansfrom
chore/claude/add-plaground-builder-skill

Conversation

@greg-olivier

Copy link
Copy Markdown
Member

Summary

Adds a new Claude Code skill, playground-builder, that scaffolds a local, live-reloading vanilla-DOM playground for visually verifying @alma/widgets changes (payment-plan lists, legal disclosures, ineligible plans, deferred/pay-later/credit scenarios) without hitting the real eligibility API or waiting on backend test data.

  • SKILL.md — skill definition: when to invoke it, why the playground is plain TypeScript + DOM rather than JSX/React/Preact, the build/adapt flow, and that the generated playground directory itself is scratch and never committed.
  • references/gotchas.md — 282-line reference of known pitfalls when building/using the playground (e.g. clearing the sessionStorage eligibility cache before every remount; avoiding DOM moves that blur focus on an already-correctly-positioned node).
  • assets/playground/dom.ts — reusable vanilla-DOM helpers copied into each generated playground: el() (createElement + prop/event wiring) and syncList() (keyed list reconciliation that avoids losing input focus).
  • assets/playground/mockFetch.ts — intercepts only the widget's real eligibility-fetch call at the window.fetch level and answers from in-memory mutable state (plans / simulated error / delay); every other fetch passes through untouched.
  • assets/playground/main.ts — entry point; installs the fetch mock before mounting the widget so its first request hits the mock, not the real API.
  • assets/playground/tsconfig.json — extends the repo's tsconfig, scoped to the playground assets plus the package's .d.ts files.
  • scripts/ensure-setup.sh — idempotent setup script that gitignores /playground/ and /vite.playground.config.ts (root-anchored so it doesn't also match the tracked assets/playground/ directory).
  • .gitignore — adds the same two anchored entries.

Standing up real merchant test data to verify a rendering change is slow and depends on someone else's plan constraints, and reading code alone doesn't reliably predict rendering. This lets the real widget mount through its actual public API with only the eligibility fetch intercepted, so hook/filter/render logic runs unmodified.

No src/ code changes — this is tooling under .claude/skills/ only, with no runtime/behavioral impact on the published package.

Testing

Run the skill in Claude : /playground-builder

Notes

  • The playground artifacts themselves (playground/, vite.playground.config.ts) are intentionally never committed — only the skill definition and reusable scaffolding under .claude/skills/playground-builder/ are tracked. A playground is rebuilt/adapted fresh each session rather than persisted.
  • The .gitignore entries are root-anchored on purpose to avoid shadowing the tracked assets/playground/ directory — worth preserving if this is ever "simplified."

@greg-olivier greg-olivier self-assigned this Sep 14, 2026
@greg-olivier
greg-olivier changed the base branch from master to refactor/fixtures/extract-plans September 14, 2026 13:30
@greg-olivier
greg-olivier changed the base branch from refactor/fixtures/extract-plans to feature/DCC2-adaptation September 14, 2026 13:31
@greg-olivier
greg-olivier changed the base branch from feature/DCC2-adaptation to refactor/fixtures/extract-plans September 14, 2026 13:35
greg-olivier and others added 5 commits September 14, 2026 15:53
…folding for playground assets

Co-Authored-By: Claude <noreply@anthropic.com>
…e playground directory

Co-Authored-By: Claude <noreply@anthropic.com>
… improve skill documentation

Co-Authored-By: Claude <noreply@anthropic.com>
@greg-olivier
greg-olivier force-pushed the chore/claude/add-plaground-builder-skill branch from 8b8b382 to c0306ca Compare September 14, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant