Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

writing-ui-components

БесплатноБез исполняемых скриптовНе проверен

Structure and abstraction rules for PostHog UI code — any React component or frontend file under `frontend/src/` or `products/*/frontend/`. Use ALWAYS before…

PostHogот PostHog★ 41 278 звёзд на GitHub

Об этом скилле

Writing UI components

How UI code is structured: which file a component lives in, when duplication becomes a shared component, what a rename must sweep, and what every component renders before its data resolves. Applies to everything under frontend/src/ and products/*/frontend/.

Each section leads with its gate question. If you can answer the gate honestly, the details below it usually follow on their own.

Use this skill when

  • Creating a new component, scene, view, hook, or frontend module
  • Splitting or restructuring an existing component file, or moving one between folders
  • Extracting a repeated shape into a shared/generic component, or promoting one toward lib/
  • Renaming a frontend symbol, file, or feature vocabulary
  • Adding loading/empty/error handling to a view
  • Reviewing a PR that does any of the above

Companion rules (do not duplicate)

This skill owns structure. These own their own territory — link to them, don't restate them:

Survey precedent before you build

Gate: which existing scene or component are you modeling this on — and does that model itself follow these rules?

Brand consistency comes from imitation, not invention. Before building any new UI, read how 2–3 comparable scenes or components are implemented — component choice, density, layout, file structure, logic wiring, data-attr naming — and name the precedent you're following. A new surface that matches its compliant neighbors is on-brand by construction.

But filter precedent through the conventions. The codebase carries legacy that predates these rules — clickable divs, hand-rolled tables, new-style-banned LemonMenus, whole-scene ProductIntroduction panels where the scene gate belongs, re-export shims, slop styling. An existing violation is history, not license: this skill and frontend/src/AGENTS.md outrank precedent. When the nearest example violates the rules, follow the rules — and if the violation is cheap to fix, convert it while you're there (references/anti-patterns.md).

Telling good precedent from bad:

  • Prefer reference implementations named in skills — e.g. MCP analytics for empty states, the migrated scenes listed in scene-menu-bar — and recently-touched code (git log) over untouched corners.
  • Prefer current primitives: quill menus/comboboxes over LemonMenu/Radix menus, the ProductEmptyState gate over a whole-scene ProductIntroduction, generated *Api types over handwritten ones.
  • When they conflict, the priority order is conventions > compliant precedent > invention. Inventing a new pattern when a compliant precedent exists is itself a reuse violation.

Code organization

Gate: can a reader find this code by name, from the folder tree alone?

  • One component per file. A file exports the component its name promises — nothing else. A private sub-piece may stay only when it is unexported, has a single consumer in the same file, is small (a few lines of markup, not a second real component), and is inseparable from the parent (mode-variants of the same export). The moment it's exported, it moves to its own file. Named exports only, never default (handbook rule).
  • One concern per file. When a file accumulates a second concern, split it: pure decision functions come out of logics and components into a sibling module and get tested directly (see writing-tests — extract, don't escalate); a dialog opened by a button is not part of the button. Copy stays inline where reviewers see it in rendering context — extract only long-form copy blocks or copy shared across components.
  • Folders mirror the feature. A flow is a shell plus a steps/ folder; reusable pieces in components/; shared helpers in utils.ts (or the layer's existing helpers.ts). The tree should read like a table of contents. Files are named after their main
Полный SKILL.md на GitHub

Установить writing-ui-components в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/anti-patterns.md

FAQ

Что делает скилл writing-ui-components?

Structure and abstraction rules for PostHog UI code — any React component or frontend file under `frontend/src/` or `products/*/frontend/`. Use ALWAYS before creating, moving, splitting, or restructuring a component or frontend file, extracting a shared/generic component, promoting a component to `lib/`, renaming a frontend symbol or feature, or reviewing a diff that does any of these. Covers file and folder organization (one component per file, one home per symbol, no re-export shims or barrels), when duplication becomes a component and when a generic is premature, rename sweeps and the frozen-strings contract (event names, properties, flag keys, `data-attr` values are API), UI resolution states (loading, empty, and error are three different screens), and visual discipline (design tokens, on-brand custom components with no AI slop, real interactive elements, reduced motion, Storybook). Component choice (Lemon vs quill) lives in `frontend/src/AGENTS.md` Rule 1; state management in `/writing-kea-logics`.

Как установить скилл writing-ui-components?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл writing-ui-components запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить writing-ui-components с