frontend-design
Skill79 starsChanged 2 months agoApache-2.0View on GitHub
Capsem frontend design system. Use when building UI components, styling views, choosing colors, or working with Svelte 5 runes and the component library.
189 other projects use a version of this.
Adopted by
Most recently taken up by
- tsukhani/jclawtheir own version, first seen Oct 5, 2026
- kopp0510/claude-ddtheir own version, first seen Oct 5, 2026
- tam159/next-roletheir own version, first seen Oct 4, 2026
- edenfunf/reelmimictheir own version, first seen Oct 4, 2026
- L-X-T/ng-agentic-skillstheir own version, first seen Oct 4, 2026
- jakubsuplicki/codumenttheir own version, first seen Oct 4, 2026
Used with
Projects with it also use file-reading, arrange and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SeifBenayedSkillfile-reading
Use this skill when a file has been uploaded but its content is NOT in your context — only its path at /mnt/user-data/uploads/ is listed in an uploaded_files block. This skill is a router: it tells you which tool to use for each file type (pdf, docx, xlsx, csv, json, images, archives, ebooks) so you read the right amount the right way instead of blindly running cat on a binary. Triggers: any mention of /mnt/user-data/uploads/, an uploaded_files section, a file_path tag, or a user asking about an uploaded file you have not yet read. Do NOT use this skill if the file content is already visible in your context inside a documents block — you already have it.
Also in 7 projects that use this
nikafastovets-langSkillarrange
Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy to create intentional compositions.
Also in 6 projects that use this
mm-mazharSkillcache-components
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR).
Also in 6 projects that use this
SeifBenayedSkillpdf-reading
Use this skill when you need to read, inspect, or extract content from PDF files — especially when file content is NOT in your context and you need to read it from disk. Covers content inventory, text extraction, page rasterization for visual inspection, embedded image/attachment/table/form-field extraction, and choosing the right reading strategy for different document types (text-heavy, scanned, slide-decks, forms, data-heavy). Do NOT use this skill for PDF creation, form filling, merging, splitting, watermarking, or encryption — use the pdf skill instead.
Also in 6 projects that use this
JokerRunSkillcompound-engineering
Compound Engineering workflow for AI-assisted development. Use when planning features, executing work, reviewing code, or codifying learnings. Follows the Plan → Work → Review → Compound loop where each unit of engineering makes subsequent work easier. Triggers on: plan this feature, implement this, review this code, compound learnings, create implementation plan, systematic development.
Also in 5 projects that use this
mtctSkillteach-impeccable
One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
Also in 10 projects that use this
Other versions189 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 189
- anthropics/skills★ 199ksame name
- bytedance/deer-flow★ 83ksame name
- anthropics/claude-plugins-official★ 37ksame name
- anbeime/skill★ 7.5ksame name
- steipete/agent-scripts★ 7.2ksame name
- vercel-labs/open-agents★ 5.8ksame name
- Galaxy-Dawn/claude-scholar★ 5.7ksame name
- cloudflare/vibesdk★ 5.4ksame name
- microsoft/agent-academy★ 3.5ksame name
- jjyaoao/HelloAgents★ 3.2ksame name
179 more not listed
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 repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- asset-pipelineSkill
- build-imagesSkill
- build-initrdSkill
- citadelSkill
- dev-benchmarkSkill
- dev-bug-reviewSkill
- dev-cacheSkill
- dev-capsem-doctorSkill
- dev-capsemSkill
- dev-ciSkill
- dev-debuggingSkill
- dev-gateSkill
- dev-installationSkill
- dev-justSkill
- dev-mcpSkill
- dev-mitm-proxySkill
- dev-rust-patternsSkill
- dev-session-debugSkill
- dev-setupSkill
- dev-skillsSkill
- dev-sprintSkill
- dev-startSkill
- dev-testing-frontendSkill
- dev-testing-hypervisorSkill
- dev-testing-pythonSkill
- dev-testingSkill
- dev-testing-vmSkill
- ironbankSkill
- meta-find-skillsSkill
- meta-organize-skillsSkill
- meta-skill-creationSkill
- release-processSkill
- site-architectureSkill
- site-infraSkill
- site-marketingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 4 are distinctive, and 11 are very specific to this project.
0
Common
Most of the 180 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
After any web/app/ change you intend to test in the desktop app, run just build (chains frontend build + cargo build -p capsem-app).
- Distinctive: line 28
Simplicity and correctness above all else: Every line of frontend code must earn its place.
- Distinctive: line 31
All interactivity via Svelte 5 runes + TypeScript -- no JS plugins, no jQuery, no framework plugins
- Very specific: line 39
Read references/tailwind.md for Tailwind v4 utility patterns, responsive design, and CSS-first config.
- Very specific: line 40
Read references/svelte5.md for Svelte 5 patterns and @sveltejs/mcp CLI doc lookups.
- Very specific: line 41
Read references/astro.md for Astro framework patterns (components, content collections, SSR).
- Very specific: line 69
All 24 terminal themes (12 families x dark/light) must pass WCAG AA 4.5:1 contrast ratio for foreground text and all 6 ANSI colors (red, …
- Very specific: line 75
Use Capsem's semantic token classes for all UI components.
- Very specific: line 84
Do NOT use raw Tailwind colors (bg-gray-200, text-blue-600) for UI chrome.
- Very specific: line 93
Leaf padding: All leaf items inside cards use px-4 for horizontal padding, matching the Appearance rows.
- Very specific: line 95
Warning/error colors: Use text-warning / text-destructive and bg-warning/5 / bg-destructive/10.
- Distinctive: line 113
All components and stores use Svelte 5 runes exclusively.
- Very specific: line 177
Per-session telemetry: use typed routes such as /vms/{id}/stats/detail, /vms/{id}/timeline, /vms/{id}/security/latest, …
- Very specific: line 180
Cross-session state: use dedicated service routes such as /status, /stats, /vms/list, and profile/plugin/MCP routes.
- Distinctive: line 189
Before creating new components, stores, or helpers, check what exists:
“Common” is measured: kept by at least 6 in 10 of the 180 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Frontend Design
Stack
- Astro 7 -- static site generator, renders
index.astroas a thin shell - Svelte 5 -- reactive UI framework, loaded via
client:only="svelte" - Tailwind v4 -- utility-first CSS (via Vite plugin,
@sourcedirectives inglobal.css) - Capsem-owned semantic CSS --
src/styles/capsem-theme.cssowns the complete token contract (bg-primary,text-foreground, and peers). Production code must never install, import, scan, or execute Preline or another component library. Historical component references may inspire class composition only; copy the result into Capsem-owned code.
Loading into capsem-app (Tauri)
tauri::generate_context!() bakes web/app/dist/** into the capsem-app binary at cargo compile time (via the custom-protocol feature). This means:
pnpm run buildalone has no effect on a running./cache/target/**/capsem-app-- the bundle is embedded in the binary.- After any
web/app/change you intend to test in the desktop app, runjust build(chains frontend build +cargo build -p capsem-app). just dev ui(cargo tauri dev) bypasses this by loadinghttp://localhost:5173-- good for iteration, but the production code path goes through the embedded bundle.- The Toolbar shows
build YYYY-MM-DD HH:MM:SSas a quick visual sanity check -- if it's stale after you rebuilt, you forgotcargo build -p capsem-app.
Also: iframe src for bundled pages must end in index.html (e.g. /vm/terminal/index.html). Tauri's custom protocol on macOS does not auto-append index.html for trailing-slash paths the way Vite/Astro dev server does. A /vm/terminal/ src loads fine in Chrome dev mode and silently 404s in the Tauri app.
Design principles
Simplicity and correctness above all else. Every line of frontend code must earn its place.
- Capsem-owned semantic tokens for theming + Tailwind utilities for layout
- All interactivity via Svelte 5 runes + TypeScript -- no JS plugins, no jQuery, no framework plugins
- Custom
@themetokens inglobal.cssfor domain-specific colors (status, providers, charts) - Visual verification required -- every UI change must be verified via Chrome DevTools MCP (see
/dev-testing-frontend) - No component-library dependency -- do not add Preline, DaisyUI, or an equivalent package to production or build dependencies.
Framework references
references/preline.mdandreferences/preline-docs/are historical pattern catalogues only. Their upstream install/import examples are forbidden in Capsem; the checked-in theme and Svelte components are authoritative.- Read
references/tailwind.mdfor Tailwind v4 utility patterns, responsive design, and CSS-first config. - Read
references/svelte5.mdfor Svelte 5 patterns and@sveltejs/mcpCLI doc lookups. - Read
references/astro.mdfor Astro framework patterns (components, content collections, SSR).
Surface hierarchy (global.css overrides)
The UI uses a two-tone surface system. Semantic token names map to specific roles:
| Token | Light | Dark | Role |
--background | #ffffff (white) | #282828 (rgb 40,40,40) | Main canvas (content area) |
--background-1 | #f4f3f2 (rgb 244,243,242) | #282828 | Recessed (address bar, inset panels) |
--background-2 | #f4f3f2 | #282828 | Most recessed (inactive tabs) |
--layer | #ffffff (white) | #3c3c3c (rgb 60,60,60) | Elevated/selected (active tab, toolbar, cards) |
The pattern: selected = white/lighter, inactive = slightly gray/darker. In dark mode, the base is very dark (#282828) and elevated surfaces pop with #3c3c3c. In light mode, the canvas is white and recessed areas use a warm off-white.
These are set in :root and .dark blocks in global.css. All accent themes share the same surfaces -- only --primary-* changes per accent.
Color scheme (firm -- do not deviate)
- Blue = main/positive color (allowed, running, ok states). Use Capsem
primarytokens (bg-primary,text-primary-foreground, etc.) - Purple = negative color (denied, stopped, error states). Keep the owned
destructivetokens purple, not red. - No green or red anywhere in the UI -- use blue for positive, purple for negative
- Chart colors: blue
oklch(0.7 0.15 250)for allowed, purpleoklch(0.65 0.15 300)for denied - Terminal emulation colors (xterm #4ade80 green) are fine -- that's xterm, not UI chrome
- Do NOT hardcode colors in components. Change the owned semantic contract in
capsem-theme.cssor the deliberate surface/accent overrides inglobal.css; theme selection usesdata-themeon<html>.
Terminal theme contrast
All 24 terminal themes (12 families x dark/light) must pass WCAG AA 4.5:1 contrast ratio for foreground text and all 6 ANSI colors (red, green, yellow, blue, magenta, cyan) against their background. This is enforced by theme-contrast.test.ts.
Contrast utilities (parseHex, relativeLuminance, contrastRatio) are exported from themes.ts and used in tests. When adding or modifying terminal themes, run pnpm test to catch any violations.
Component patterns
Use Capsem's semantic token classes for all UI components. Historical pattern references may guide layout, but no upstream CSS or JavaScript may enter the build.
- Buttons:
bg-primary text-primary-foreground hover:bg-primary-hover(solid),bg-layer border border-layer-line text-layer-foreground(white), etc. - Cards:
bg-card border border-card-line rounded-xl, headersbg-surface border-b border-card-divider - Forms:
border-line-2 rounded-lg bg-layer text-foreground focus:border-primary focus:ring-primary - Navigation:
bg-navbar border-navbar-border text-navbar-nav-foreground hover:bg-navbar-nav-hover - Overlays:
bg-overlay border-overlay-border,bg-dropdown text-dropdown-item-foreground - Text hierarchy:
text-foreground(primary),text-muted-foreground-1(secondary),text-muted-foreground(tertiary)
Do NOT use raw Tailwind colors (bg-gray-200, text-blue-600) for UI chrome. Always use semantic tokens so themes work.
Settings section layout (SettingsSection.svelte)
The Appearance section in SettingsPage.svelte is the reference pattern. All dynamic settings sections must match it:
- Section title:
<h2 class="text-xl font-medium text-foreground">(notfont-bold) - Subsection headings:
<h3 class="text-xs font-semibold text-foreground uppercase tracking-wider">(usetext-foreground, nottext-muted-foreground-1) - Cards wrap leaf items only: A non-toggle group wraps children in
bg-card border border-card-line rounded-xlONLY when it has direct leaf/action children. Groups containing only subgroups render flat (heading + children, no card). This prevents nested grey card boxes. - Leaf padding: All leaf items inside cards use
px-4for horizontal padding, matching the Appearance rows. - Toggle-gated groups: Standalone cards with
bg-card border border-card-line rounded-xl mb-3. Never nest inside another card wrapper. - Warning/error colors: Use
text-warning/text-destructiveandbg-warning/5/bg-destructive/10. Never raw Tailwind colors (text-amber-700,text-red-700,bg-amber-50).
Custom design tokens (global.css)
Domain-specific tokens defined in @theme { } block:
| Category | Tokens | Purpose |
| Status | --color-allowed, --color-denied, --color-caution | Decision states |
| Providers | --color-provider-anthropic, -google, -openai, -mistral | Brand identity |
| Token types | --color-token-input, -output, -cache | Usage tracking |
| File actions | --color-file-created, -modified, -deleted | FS events |
| Syntax | --color-json-*, --color-sh-* | Code highlighting |
| Spans | --color-span-thinking, -tool, -answer | Trace viewer |
| Charts | --color-chart-grid, -label | Chart infrastructure |
Svelte 5 rune patterns (mandatory -- no legacy $:)
All components and stores use Svelte 5 runes exclusively. No legacy reactive statements.
$state<T>(initial)-- reactive state declaration$derived(expression)-- derived value (recomputes when deps change)$derived.by(() => { ... })-- derived with complex logic$effect(() => { ... })-- side effect that re-runs on dependency changes$props()-- type-safe component props with destructuring- Class-based stores with
$statefields (singleton pattern,.svelte.tsextension) onMountfor async data loading,onDestroyfor cleanup (intervals, charts)
Store pattern
// stores/example.svelte.ts
class ExampleStore {
items = $state<Item[]>([]);
activeId = $state<string | null>(null);
active = $derived(this.items.find(i => i.id === this.activeId));
async load() { this.items = await api.getItems(); }
setActive(id: string) { this.activeId = id; }
}
export const exampleStore = new ExampleStore();Icon pattern
<script lang="ts">
let { class: cls = 'size-5' }: { class?: string } = $props();
</script>
<svg class={cls}>...</svg>View routing
Chrome browser shell. Tabs = sessions, toolbar = controls. Views switched by tabStore.active.view:
'new-tab'-- session/profile dashboard (NewTabPage), sortable table of real sessions'terminal'-- sandboxed iframe with xterm.js (VMFrame), one iframe per VM'settings'-- appearance, general, security, network, storage, advanced, about- Future: focused typed views for logs/debug surfaces as needed.
Tab store (stores/tabs.svelte.ts): openVM() creates a terminal tab or activates existing.
Data fetching
The frontend talks to the backend through capsem-gateway -- a TCP-to-UDS reverse proxy (default port 19222) that forwards HTTP requests to capsem-service over UDS. Bearer token auth is required (token generated at gateway startup, written to ~/.capsem/run/gateway.token).
Key gateway endpoints:
| Endpoint | Purpose |
GET / | Health check (no auth) |
GET /status | Aggregated VM status (1s cache TTL) |
GET /vms/{id}/stream | capsem.stream.v1 WebSocket (terminal, streaming exec, container attach), tunneled to the service |
| Explicit allowlist | Profile, session, stats, enforcement, detection, plugin, MCP, credential, and debug routes used by the UI/TUI |
The gateway forwards only routes that are deliberately registered in its route table. Unknown, retired, or misspelled routes must return 404 instead of falling through to capsem-service.
Typed data contract:
- Per-session telemetry: use typed routes such as
/vms/{id}/stats/detail,/vms/{id}/timeline,/vms/{id}/security/latest,/vms/{id}/detection/latest, and protocol-specific routes. - Cross-session state: use dedicated service routes such as
/status,/stats,/vms/list, and profile/plugin/MCP routes. - Never add frontend raw SQL helpers. The old Inspector and
/inspectsurfaces are burned; UI code reflects typed API contracts only.
Mocks must exercise the same typed routes the product uses.
Code reuse
Before creating new components, stores, or helpers, check what exists:
- Stores (
web/app/src/lib/stores/): extend existing rune stores - Components (
web/app/src/lib/components/): extend existing patterns - Views (
web/app/src/lib/views/): main view containers with sub-views - Models (
web/app/src/lib/models/): pure TS business logic (no Svelte deps) - Helpers (
api.ts,types.ts): use existing typed route clients, formatters, and types
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.

