Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

component-tests

Skill by anomalyco

Guides writing and debugging Playwright component tests that mount Lab states in the anomalyco repository. It covers the shared Vite-based Lab harness, fixture files, Vite pre-bundling reloads and mobile tests. Written for developers who maintain those tests.

  • Score 90
  • 230k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install component-tests

Built from the published package, never by AI.

git clone --depth 1 https://github.com/anomalyco/opencode /tmp/opencode && mkdir -p ~/.claude/skills && cp -r /tmp/opencode/.opencode/skills/component-tests ~/.claude/skills/component-tests

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install component-tests in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill documents how to write, change, debug and review Playwright component tests in the anomalyco repository. The tests mount Lab pages and states in the app, session-ui and gui-plugins packages. It explains where Lab pages and fixture files live, how the mount helper passes args and globals through the URL, and how to import source modules by URL.

It also covers the shared Lab harness, which is a plain Vite dev server with in-page mocks and no backend. The skill explains Vite dependency pre-bundling and the reloads that cause errors such as "Execution context was destroyed". It describes cold and warm server runs, mobile drawers and touch emulation, and checks to run before pushing. It is aimed at developers who maintain these component tests.

Written from the project's SKILL.md and checked against it.

What it can do

  • Mount Lab statesMounts a Lab page state by ID, with args and globals for theme, direction and locale.
  • Fixture imports by URLImports *.fixture.tsx files to test construction counts, unmount races or cache state.
  • Pre-bundling checksKeeps Vite dependency scan entries complete so cold runs show no optimizer reloads.
  • Cold and warm timingExplains how to judge test cost by warm attempts, since the first test per worker is slower.
  • Mobile and touch testsUses test-scoped options for touch, mobile viewports and tap helpers.
  • Routing unmocked requestsUses page.route for server endpoints and external URLs that the in-page mocks do not answer.

What you need

  • Bun, used to run the Lab dev server
  • Playwright test runner
  • A checkout of the anomalyco monorepo

Try asking

  • Write a Playwright component test that mounts a Lab state in mobile view.
  • Why does my component test fail with Failed to fetch dynamically imported module?
  • Review my new fixture file and check it follows the mount pattern.

Good to know

  • The Lab has no backend, so server, SDK and sync modules are in-page mocks.
  • Reloads lose page state set up after mount, so tests must avoid relying on it.
  • A Lab server on the same port can be reused from another checkout.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .opencode/skills/component-tests/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md18 KB

Alternatives to component-tests

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

component-tests: common questions

Why do component tests fail with Execution context was destroyed?

The source says this usually comes from a Vite dependency reload during the run. It advises fixing the optimizer entries rather than adding retries or timeouts.

Where should a Lab page file go?

Put it next to the production component under src/ in ui, session-ui, app or gui-plugins, named with the *.lab.tsx extension.

Why does a warm local run not show reloads?

A valid Vite cache skips the dependency scan, so new pages are not scanned. The source says to delete packages/lab/node_modules/.vite before judging.

How do I install component-tests?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is component-tests free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is component-tests safe to use?

It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to component-tests?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

component-tests Install

Add to stack

Loading.