building-the-toolbar
БесплатноБез исполняемых скриптовНе проверенBuilds, watches, checks and verifies the PostHog toolbar in both of its forms, the floating toolbar that posthog-js loads on customer pages and the browser…
от PostHog★ 41 278 звёзд на GitHubОб этом скилле
Building the toolbar
One source tree, frontend/src/toolbar/, ships in two forms.
Both builds live in frontend/toolbar-config.mjs and share its toolbar module plugin, which swaps app modules for the toolbar's shims and keeps denylisted packages out.
| Form | Entry | Output (under frontend/dist/) |
Runs in |
|---|---|---|---|
| Floating toolbar | src/toolbar/floating/index.tsx |
toolbar.js loader, toolbar/ app chunks |
Customer pages, loaded by posthog-js |
| Browser extension | src/toolbar/extension/panel.tsx, content.tsx |
toolbar-extension/chrome/, plus a zip for the store |
Chrome side panel (Manifest V3) |
Where code goes
| Folder | Holds |
|---|---|
toolbar/shared/ |
The kea logics, the API and auth helpers, the shims, utils, and every component both forms render |
toolbar/floating/ |
The floating toolbar: its entry and loader, the bar, and the menus that bind shared logic to its UI |
toolbar/extension/ |
The extension: the panel, the content script, the page agent, and the panel's own tool components |
Inside floating/ and extension/, only the entry points the build names sit at the top. Everything else goes in a folder:
| Folder | Holds |
|---|---|
components/<feature>/ |
React components, their stories and tests. The feature folders use the names shared/ uses, such as flags |
logics/ |
The form's kea logics and the pure helpers they test. The extension splits them into panel/ and page/ by where they run |
messaging/ |
Extension only: the port, page agent and form sync protocol between the panel, the content script and the page |
browser/ |
Extension only: the wrappers around the extension APIs |
- Put logic in
shared/. A form folder configures shared code for its form: it mounts logics, binds them to its UI, and renders shared components with its own data. - When a component is the same in both forms, it lives in
shared/and takes its data and callbacks as props.WebExperimentVariantis the pattern:floating/components/experiments/ExperimentsTabEditorProvider.tsxandextension/components/experiments/ExtensionExperimentEditorProvider.tsxeach bind it to their own state. shared/never imports fromfloating/orextension/, and the two forms never import each other.toolbar/toolbarLayout.test.tsfails on such an import.- Keep each kea logic's
path([...])as it is when you move its file. The path is the logic's identity and storage key, not its location.
Build both, every time
The extension's content script, extension/content.tsx, runs the shared kea logics and components on the page, such as toolbarConfigLogic, elementsLogic and ElementOverlays.
The panel imports shared modules too, and both go through the same module plugin.
So any change under toolbar/shared/, or in toolbar-config.mjs, can break either form, even when you only meant to touch one.
- Build and check both forms for every toolbar change.
- Fix shared toolbar code in the general way. Do not add an extension-only branch to shared code when a fix that serves both forms exists. When a branch is unavoidable, keep it in one place and say why in a comment.
From frontend/:
pnpm build:toolbar-all # production floating toolbar, then the extension
pnpm watch:toolbar-all # rebuild both on change
To build one form only:
| Form | Build | Watch |
|---|---|---|
| Floating toolbar | pnpm build:toolbar-floating |
pnpm watch:toolbar-floating |
| Browser extension | pnpm build:toolbar-extension |
pnpm watch:toolbar-extension |
The dev stack (hogli start) already runs pnpm watch:toolbar-floating through start-vite.
While it runs, start pnpm watch:toolbar-extension alone, so two watchers don't write the same files.
Run the guards
The guards read toolbar-esbuild-meta.json and dist/toolbar*, which the floating toolbar build writes.
CI runs them on
Установить building-the-toolbar в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл building-the-toolbar?
Builds, watches, checks and verifies the PostHog toolbar in both of its forms, the floating toolbar that posthog-js loads on customer pages and the browser extension that shows the toolbar in a Chrome side panel. Use when changing anything under frontend/src/toolbar/ (floating toolbar or extension), frontend/toolbar-config.mjs, or the toolbar build and guard scripts, or when asked to build, watch, load unpacked, or test the toolbar or the toolbar extension in a browser. Covers `pnpm build:toolbar-all` and `pnpm watch:toolbar-all`, the check-toolbar-size, check-toolbar-graph and check-toolbar-csp-eval guards, why both forms must be built and kept in sync, how to check each one in a real browser, and when an extension change needs a Sampo changeset to reach the Chrome Web Store.
Как установить скилл building-the-toolbar?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл building-the-toolbar запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic