agentleFS
teispaceteispace/teitunnel/.claude/skills/building-ui/SKILL.md

building-ui

Skill2 starsChanged 49 days agoMITView on GitHub

Builds or changes screens and components in Teitunnel's React desktop UI (apps/desktop/src) so they feel native on macOS, Windows and Linux, using the design system's tokens, primitives and patterns, TanStack Query data hooks, accessibility, light and dark screenshots and the component gallery. Use for any visual or interaction change in the desktop app.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Reuse before you build: Look in components/ui and components/patterns first.

    line 26
  2. Very specific:

    Keyboard: every action is reachable from the keyboard.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Building UI

Teitunnel should feel like it shipped with the operating system. The rules are in docs/DESIGN.md; read §1 (hard rules) before any UI change, and the section for what you touch (§4 colour, §7 motion, §8 components, §10 copy, §11 accessibility).

Where things are

src/components/ui/        primitives: Button, Sheet, Dialog, Switch, Select, SegmentedControl…
src/components/patterns/  patterns: ListPane, SplitView, GroupedList, EmptyState, ErrorState,
                          CopyField, KeyValueGrid, LogViewer, TimeSeriesChart, ConfirmDialog…
src/features/<area>/      a feature: components/, queries.ts, model.ts (pure), index.ts
src/routes/               TanStack Router file routes
src/styles/tokens.css     every colour, radius and shadow, light and dark
src/dev/                  the gallery (/dev/gallery) and the IPC mocks

Rules

  • Reuse before you build. Look in components/ui and components/patterns first. A new primitive or pattern gets a gallery entry in src/dev/gallery.tsx.
  • Semantic tokens only: Tailwind classes mapped to tokens (bg-surface-content, text-secondary). No hex, rgb(), arbitrary colours or static style={{}}.
  • Never: gradients, glows, fake glass, emoji, a hand cursor on buttons or rows, a modal for primary work, a spinner for local state, layout shift while loading.
  • Data only through hooks in features/<area>/queries.ts (see adding-ipc-commands). Server state in TanStack Query, UI state in Zustand or the URL, form state in the component (useState), validated in the feature's model.ts. No useEffect for fetching or derived state.
  • Text from locales/en.json through t() (see writing-user-facing-text).
  • Keyboard: every action is reachable from the keyboard; frequent ones get a menu item and shortcut. Icon-only controls have an aria-label. Status is never shown by colour alone.
  • Pure logic in model.ts with unit tests; components stay presentational. Split a file that grows past ~250 lines or a second responsibility.
  • Performance: lists that can grow are virtualized with @tanstack/react-virtual, as the Inspector list is; memoize rows with stable callbacks; format numbers with numberFormat() from lib/format.ts (it caches Intl formatters).
  • Platforms: macOS gets vibrancy and the native title bar; Windows and Linux use solid surfaces (styles/platform-*.css). Check both.

Workflow

- [ ] 1. Find the pattern to reuse; sketch states: loading, empty, error, populated
- [ ] 2. Build with primitives and tokens; text from the catalog
- [ ] 3. Mock data in src/dev so the screen renders without a backend
- [ ] 4. Tests: model.ts units, component tests with mockIPC
- [ ] 5. Screenshots in light and dark (and Windows/Linux chrome if it differs)
- [ ] 6. Accessibility audit
- [ ] 7. pnpm verify

Screenshots render the real UI on the mocked backend in WebKit:

pnpm --filter @teitunnel/desktop shoot /tmp/shots /routes
pnpm --filter @teitunnel/desktop shoot /tmp/shots "/routes?platform=windows"
SHOOT_ACTIONS='role=button[name="Add Route"]' pnpm --filter @teitunnel/desktop shoot /tmp/shots /routes

SHOOT_ACTIONS, SHOOT_FILL, SHOOT_THEN, SHOOT_KEYS, SHOOT_SIZE, SHOOT_CONTRAST=more and SHOOT_REDUCED_MOTION=1 are documented at the top of apps/desktop/scripts/shoot.ts. Look at every screenshot: alignment, truncation, contrast in both themes.

pnpm --filter @teitunnel/desktop a11y /routes     # axe, light and dark, both contrast modes

Native materials and window behaviour only show in a packaged build: pnpm build.

Attach the light and dark screenshots to the pull request, and go through DESIGN §12 (the UI review checklist).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.