Toolverse
All skills

gpui-style-guide

by longbridge

GPUI Component project style guide based on gpui-component code patterns. Use when writing new components, reviewing code, or ensuring consistency with existing gpui-component implementations. Covers component structure, trait implementations, naming conventions, and API

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Category
Frontend

About this skill

GPUI Component project style guide based on gpui-component code patterns. Use when writing new components, reviewing code, or ensuring consistency with existing gpui-component implementations. Covers component structure, trait implementations, naming conventions, and API patterns observed in the actual codebase.

How to use

  1. Zainstaluj skill w swoim projekcie Claude/Copilot, wskazując repozytorium longbridge/gpui-component z katalogu .claude/skills/gpui-style-guide. 2. Przed napisaniem nowego komponentu przejrzyj sekcję Component Structure, aby zrozumieć podstawowy wzorzec — struktura pól (id, base, style, configuration fields, content fields, callbacks), inicjalizacja w metodzie new() oraz builder methods zwracające Self. 3. Podczas implementacji komponentu stosuj konwencje obserwowane w kodzie: używaj #[derive(IntoElement)] dla struktury, definiuj pola konfiguracyjne (size, disabled, selected), pola zawartości (label, children) i callbacki opakowane w Rc dla Clone. 4. Przy przeglądzie kodu istniejących komponentów (Button, Checkbox, Input, Select) porównuj ich strukturę z wytycznymi — sprawdzaj czy trait'y są implementowane konsekwentnie i czy API pattern'y są zgodne z projektem. 5. Gdy napotkasz niezgodności w nazewnictwie lub strukturze, odnieś się do analizy zawartej w skill'u, aby dostosować kod do ustalonych wzorców gpui-component. 6. Wykorzystuj skill jako referencję podczas code review'u — upewnij się, że nowe komponenty podążają za tymi samymi zasadami struktury, trait'ów i API co istniejące implementacje w crates/ui.

Related skills