ui-story
Skill4 starsChanged 2 months agoApache-2.0View on GitHub
Create or update Storybook stories that mount a treq component purely from props (no jj repo, Tauri IPC, or NAPI). Use on /ui-story, when asked to add a story or storybook a component, or to give a component a Cloudflare Pages preview.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- treq-dev/treqword for word, first seen Sep 28, 2026
Other versions1 project uses a version of this.
Word for word · 1
- treq-dev/treq★ 4100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- src-tauri/AGENTS.mdAGENTS.md
- test/AGENTS.mdAGENTS.md
- app-qaSkill
- audit-interlinkingSkill
- docs-writingSkill
- explain-to-meSkill
- service-qaSkill
- writingSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 54
Check if the component already separates a presentational piece from a container (e.g.
- Distinctive: line 56
If no such split exists and the component is a good candidate for one (its own logic is small and the hook usage is incidental), propose …
- Very specific: line 64
Model args on the real prop types: Use satisfies Meta<typeof Component> and derive argTypes from the actual variant/size/enum unions in the …
- Very specific: line 82
Do not add global decorators or providers to .storybook/preview.tsx for a single component's needs — keep shared setup shared, keep …
- Very specific: line 88
Don't just confirm build-storybook succeeds — look at the rendered result.
- Very specific: line 106
Read the resulting PNGs yourself (Read tool on the .png paths) — that's the whole point, an agent-written "looks fine" without looking is …
- Distinctive: line 117
When the user asks for variations of a component to pick from (a new look, a redesigned layout, alternative styling for something that …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ui-story (Storybook stories for treq components)
What this skill is for
Storybook here exists to let a reviewer see a changed presentational
component in isolation — different props, different variants, light/dark —
without running the full Tauri app or a real jj repo. It is not a
replacement for /app-qa, which verifies real app behavior against a real
repo. If the component you're working on can't be meaningfully rendered
without live app state (a useQuery hook, invoke() calls, ThemeProvider
context that reads settings from the Rust backend, etc.), that's a signal
it isn't presentational yet — either stub/inject that dependency via props,
or skip Storybook for it and rely on /app-qa instead.
Setup already in place
.storybook/main.ts— stories glob issrc/**/*.stories.@(ts|tsx), framework is@storybook/react-vite..storybook/preview.tsx— importssrc/index.css(Tailwind + the app's CSS variables), and adds a toolbar Theme control that toggles the.darkclass on<html>, matching howuseThemeapplies dark mode in the real app. Stories automatically get real treq styling in both themes without needingThemeProvider.npm run storybook— dev server on port 6006.npm run build-storybook— static build tostorybook-static/(what CI deploys).- Example:
src/components/ui/button.stories.tsx.
Where stories live
Colocate the story next to the component it documents:
src/components/ui/button.tsx → src/components/ui/button.stories.tsx.
Same for components under src/components/** (e.g.
src/components/WorkspacePicker.tsx →
src/components/WorkspacePicker.stories.tsx).
Writing a story
- Read the component first. Identify its props interface and which
props are purely presentational (strings, booleans, enums, render
callbacks) vs. which pull in app state (hooks like
useTheme,useWorkspace, TanStack Query, orinvoke()fromsrc/lib/api). - If the component takes app-state hooks directly (not via props),
don't fight it inside the story. Prefer, in order:
- Check if the component already separates a presentational piece from
a container (e.g.
FooViewvsFoo) — story the presentational one. - If no such split exists and the component is a good candidate for one (its own logic is small and the hook usage is incidental), propose extracting a presentational subcomponent, but confirm with the user before doing a nontrivial refactor — don't do it silently as a side effect of "just adding a story."
- Otherwise, mock only what's needed via a decorator (e.g. wrap in a minimal context provider with fixed values) rather than pulling in the real provider stack.
- Check if the component already separates a presentational piece from
a container (e.g.
- Model args on the real prop types. Use
satisfies Meta<typeof Component>and deriveargTypesfrom the actual variant/size/enum unions in the component (seebutton.stories.tsxfor the pattern withclass-variance-authorityvariants) — don't invent props that don't exist. - Make
Defaulta kitchen sink. Rather than a single instance with default args, giveDefaulta customrenderthat lays out every variant × size (or the component's equivalent axes) in a grid, plus a disabled state where applicable — seebutton.stories.tsx. That's the one screenshot a reviewer looks at to see the whole component at a glance. Setparameters: { controls: { disable: true } }on it since a fixed grid isn't meant to be driven by the args table. Still add separate single-instance stories per notable variant/state (disabled, error, empty, long-content) — those are what the controls panel and autodocs args table drive, and what a reviewer clicks into for a closer look at one case. - Use
tags: ["autodocs"]on the meta so Storybook's docs page is generated for free. - Do not add global decorators or providers to
.storybook/preview.tsxfor a single component's needs — keep shared setup shared, keep component-specific mocking local to that story file.
Verifying: always screenshot the change
Don't just confirm build-storybook succeeds — look at the rendered
result. Every time you add or tweak a story (new story, changed args,
changed component markup/styles), capture it with the screenshot harness
and view the PNGs before telling the user the change is done:
npm run storybook:screenshot -- src/components/ui/button.stories.tsxThis builds Storybook, serves storybook-static/ locally, and uses the
repo's existing headless-Chromium setup (same playwright-core +
PLAYWRIGHT_CHROMIUM_PATH as scripts/screenshot/) to capture each story
in both light and dark to scripts/storybook/.generated/<story-id>.<light|
dark>.png plus a manifest.json. Pass one or more repo-relative
*.stories.tsx paths or exact story ids (from storybook-static/
index.json) as args; no args captures every story, which is slow — scope
it to the story file(s) you touched.
Read the resulting PNGs yourself (Read tool on the .png paths) — that's
the whole point, an agent-written "looks fine" without looking is not
verification. When tweaking an existing component, capture before your
change and after, and compare the two images directly rather than relying
on memory of what it looked like.
scripts/storybook/.generated/ is gitignored scratch output, not part of
the story itself.
Prototyping variations for the user to choose from
When the user asks for variations of a component to pick from (a new look, a redesigned layout, alternative styling for something that doesn't exist yet), don't just write one guess and iterate in place. Produce at least 4 distinct options:
- Make each option a real, separate story (e.g.
Prototype1,Prototype2... or descriptive names likeCompact,Card,Inline,WithIcon— prefer names that describe what's different about each one) inside the component's.stories.tsx, or a dedicated<Component>.prototypes. stories.tsxfile if the component itself doesn't exist yet and you're prototyping a new one from scratch. - Make the options meaningfully different from each other — different layout, density, or visual treatment, not four color tweaks of the same idea — so the screenshots actually help someone decide.
- Screenshot every option with
npm run storybook:screenshot -- <file>(light is usually enough for a first pass; add dark if theme handling is part of what's being decided). - Present the screenshots to the user side by side with a one-line description of what's different about each, and ask which direction to pursue (or if they want to mix elements of a couple).
- Once the user picks (or narrows down), keep the winning story and delete the rejected prototype stories rather than leaving dead options in the file — a merged component shouldn't carry four alternate stories nobody picked.
Shared-components long-term note
web/ (the Docusaurus marketing/docs site) does not yet share components
or Tailwind config with the app. When a component you're storying is
genuinely generic UI (not treq-specific business logic) and you notice it
duplicates something in web/, mention it, but don't attempt the
extraction into a shared package as part of a story-writing task — that's
a separate, larger migration.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

