OpenCode is an open-source AI coding agent that helps developers work on software projects. It includes agents for full-access development, read-only exploration and planning, plus a general subagent for complex searches and multistep tasks; the catalogue add-ons extend its workflows.
Borrowing it
Nothing to install: this file belongs to anomalyco/opencode. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/anomalyco/opencode/dev/.opencode/skills/component-tests/SKILL.mdgit clone --depth 1 https://github.com/anomalyco/opencodeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/anomalyco/opencode/component-tests)<a href="https://agentmods.dev/skills/anomalyco/opencode/component-tests"><img src="https://agentmods.dev/badge/skills/anomalyco/opencode/component-tests/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/anomalyco/opencode/component-tests"><img src="https://agentmods.dev/badge/skills/anomalyco/opencode/component-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00171 | $0.04790 |
| Opus 5.5 | $0.00068 | $0.01916 |
| Sonnet 5.5 | $0.00034 | $0.00958 |
| Haiku 4.5 | $0.00017 | $0.00479 |
Grade C, and why
component-tests scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf packages/storybook/node_modules/.cache How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Component tests
Each package suite starts one Storybook/Vite dev server, and every worker shares it (packages/storybook/playwright/config.ts:17-24; CI uses 2 workers, config.ts:15). With fullyParallel (config.ts:12), the tests of one file run on several workers in any order. There is no backend: server, SDK and sync modules are in-page mocks. Every test gets a fresh context, and mount is a full iframe navigation (packages/storybook/playwright/story.ts:37). Slow or flaky component tests in CI have come from five sources: the shared server's dependency optimizer, module resolution that depended on the install layout, a cold first story, a product race (the mobile drawer), or an action that ran before the UI reached the state it needed.
Read these first rather than repeating them:
packages/storybook/playwright/README.mdcovers layout, run commands and "Adding a test".packages/app/AGENTS.md"Tests" decides whether a test should exist, when theme or direction cases are allowed, and that a regression test must fail before the fix.packages/app/e2e/AGENTS.md"Test Hygiene" applies here unchanged.
Stories and mount
- Location. Put the story next to the production component under
src/ofui,session-ui,apporgui-extensions. Storybook indexes only thestoriesglobs inpackages/storybook/.storybook/main.ts:44-49. - Story ID. It is the meta
idif one is set (packages/session-ui/src/components/session-review.stories.tsx:25). Otherwise it is the kebab-casedtitle, then--, then the kebab-cased export. Check it athttp://127.0.0.1:6006/?path=/story/<id>. A wrong ID never renders, somountwaits out its full 30 s root wait (story.ts:39) and then fails. - URL args can be dropped.
mount(id, { args, globals })writes them into the URL (story.ts:20-36). Storybook drops an arg when the story declares noargs/argTypesentry for its key. It also drops one whose value is not[A-Za-z0-9 _-]*, a number, a hex color orrgb()/hsl(), which rules out paths, URLs and file names with dots. The only trace is the browser console warning "Omitted potentially unsafe URL args.", and the test then passes on the default scenario.- Give every arg a typed default. With
args: { split: false }(session-review.stories.tsx:129),split:falsearrives as a boolean. - Pick punctuated values inside the story, from a
scenario-style arg.
- Give every arg a typed default. With
- Globals are
theme,directionandlocale(packages/storybook/.storybook/preview.tsx:106-122).mountalso setsa11y.manual(story.ts:29-36); caller globals override it. - Portaled UI.
mountreturns#storybook-root. Dialogs, menus and drawers render outside it, so locate them frompage(packages/app/component-tests/composer.spec.ts:101-107). - Server state comes from the
resolve.aliaslist inviteFinal(main.ts:72-94), which points app server, SDK and sync modules atpackages/storybook/.storybook/mocks/app/**. Extend a mock rather than adding a server. Restore mock state inonCleanup(mockProviderAuth,packages/app/src/providers/connect/dialog.stories.tsx:23) so that switching stories in the Storybook UI does not inherit it. Tests reset it on every mount. - Requests the mocks do not answer. Route them with
page.route. That includes server endpoints such as/api/fs/read(packages/session-ui/component-tests/read-image.spec.ts:20) and external URLs such as favicons (packages/session-ui/component-tests/markdown.spec.ts:217).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 118 lines · 171 tokens per session scan C f6efe004f8dd
component-tests is a skill published in the GitHub repository anomalyco/opencode (220,205 stars, last pushed today), licensed MIT. It adds 171 tokens to every session and 4,790 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-16.
Other skills, from other repositories
research-engineer
An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.
tika-eval-compare
Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".
cua-driver
Use Cua Driver for desktop or browser tasks that are awkward or unavailable through Bash/APIs, or when the user explicitly wants GUI interaction: app testing, visual bug reproduction, form filling, calendar entry, screenshots, and demo recording. Also covers Cua setup; not OpenAI Codex Computer Use or web research.
jetson-validate-image
Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.
atmos-validation
Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.
skill-benchmark
Benchmark AI skill effectiveness by measuring implementation quality against legacy constraints.