Agent skill

Frontend Guide

by lightly-ai in lightly-ai/lightly-studio

Read before writing or reviewing any frontend code in lightlystudioview - Svelte, TypeScript, or SvelteKit files.

Apache-2.0Auto-check passedFrontend & Design

Install Frontend Guide

skills CLI
$ npx skills add lightly-ai/lightly-studio --skill frontend-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lightly-ai/lightly-studio frontend-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lightly-ai/lightly-studio.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/frontend-guide .claude/skills/frontend-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
frontend-guide
GitHub stars
896
Token cost
~2.9k tokens
SKILL.md length
790 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
Apache-2.0

At a glance

Read before writing or reviewing any frontend code in lightlystudioview - Svelte, TypeScript, or SvelteKit files.

  • Works in 4 steps: Svelte Context API… → Svelte stores - for truly global state… → $app/state - for server-loaded page data… → …
  • Tasks that involve Design systems
  • SKILL.md covers Key Principles, Framework-agnostic approach, Project structure & naming and Imports, plus 8 more sections
  • Calls make and npm

What it does

Frontend Guide is an agent skill from lightly-ai/lightly-studio. Read before writing or reviewing any frontend code in lightlystudioview - Svelte, TypeScript, or SvelteKit files. Covers component structure and naming, stores vs runes, absolute vs relative imports, Shadcn and Tailwind usage, Svelte 5 syntax, TanStack Query hooks, bundle size limits, Storybook stories, and vitest conventions.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering Design systems, Unit testing and CSS and styling. It works with Svelte, TypeScript, SvelteKit and shadcn/ui. The repository describes itself as: LightlyStudio - The Unified Data Platform for Multimodal ML. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Design systems
  • Tasks that involve Unit testing
  • Tasks that involve CSS and styling

Example prompts

  • “/frontend-guide”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Svelte Context API (setContext/getContext) - for state shared within a component subtree.
  2. Svelte stores - for truly global state (auth, preferences) shared across unrelated trees.
  3. $app/state - for server-loaded page data accessible by any component on the page.
  4. Svelte 5 Snippets (Snippet type) - for UI composition / layout customization without passing content as props.

What it can do on your machine

Read from SKILL.md and the folder at commit 34ffd8c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • svelte.dev
    • vitest.dev
    • kit.svelte.dev
    • next.shadcn-svelte.com
    • bits-ui.com
    • lucide.dev
    • tanstack.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Frontend Guide loads about 2.9k tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 790 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from lightly-ai/lightly-studio at commit 34ffd8c, republished under its Apache-2.0 licence (© lightly-ai). 790 words, ~2,879 tokens.

Download SKILL.mdSave it as .claude/skills/frontend-guide/SKILL.md (or your agent's skills folder).
name
frontend-guide
description
Read before writing or reviewing any frontend code in lightly_studio_view - Svelte, TypeScript, or SvelteKit files. Covers component structure and naming, stores vs runes, absolute vs relative imports, Shadcn and Tailwind usage, Svelte 5 syntax, TanStack Query hooks, bundle size limits, Storybook stories, and vitest conventions.

Frontend coding guidelines

Coding standards for frontend development in LightlyStudio using SvelteKit and TypeScript.

Key Principles

  • Write concise, technical TypeScript code. Use Svelte-specific features (like runes) only when necessary within Svelte-compiled components.
  • Keep components under 100 lines. Split code into logical, testable parts.
  • Embrace TDD. Use vitest for unit and integration tests.
  • Follow Svelte and SvelteKit official documentation.

Framework-agnostic approach

Minimize framework-specific syntax to reduce coupling and improve testability:

  • Prefer writable/readable/derived stores over runes for state management - stores have explicit imports and clearer dependencies.
  • Use runes only when their specific features are necessary for component-level reactivity.
  • Less framework coupling means easier maintenance, onboarding, and migration.

Project structure & naming

  • PascalCase for component names and their folders (e.g., AuthForm/AuthForm.svelte).
  • camelCase for non-component files, variables, functions, and props (e.g., useAuth.ts, const myVar).
  • Every component and hook lives in its own folder scoping related files together.

Canonical layout:

src/
  components/
    AuthForm/
      AuthForm.svelte
      AuthForm.test.ts
      AuthForm.stories.svelte       # if needed
    UserDashboard/
      UserDashboard.svelte
      UserDashboard.test.ts
      UserDashboard.helpers.ts       # if needed
      UserProfile/                   # subcomponent
        UserProfile.svelte
        UserProfile.test.ts
  lib/
    hooks/
      index.ts                       # barrel exports
      useAuth/
        useAuth.ts
        useAuth.test.ts
      useData/
        useData.ts
        useData.test.ts
  • Use .svelte.ts files for component logic, state machines, and hooks that use TanStack Query (since v6 uses runes internally).
  • Use barrel exports (index.ts) to define a module's public API. Import from module level, not deep paths:
typescript
// ✅ from "$lib/hooks"  - not "$lib/hooks/useData/useData"
import { useData, useAuth } from "$lib/hooks";

Imports

  • Absolute imports for shared modules: from "$lib/hooks", from "$lib/components/ui/button".
  • Relative imports only within the same module folder: from "../UserDashboard.helpers".

TypeScript

  • Use TypeScript for all code.
  • Define interface for component props, function parameters, and return types:
typescript
interface UseDataParams {
  title: string;
  onClick: () => void;
}

interface UseDataReturn {
  data: string;
  isLoading: boolean;
}

export function useData(params: UseDataParams): UseDataReturn {
  return { data: params.title, isLoading: false };
}
  • Avoid exporting/importing types. Derive types from source code using utility types to keep things DRY:
typescript
type UseDataParams = Parameters<typeof useData>[0];
type UseDataReturn = ReturnType<typeof useData>;
type TitleOnly = Pick<UseDataParams, "title">;
type WithoutTitle = Omit<UseDataParams, "title">;

UI and Styling

  • Shadcn components from $lib/components/ui for standard UI elements (buttons, inputs, cards, tabs, alerts, tables).
  • Project-specific components from $lib/components when combining multiple Shadcn components, adding business logic, or needing custom behavior.
  • Bits-UI as the base component library underlying Shadcn.
  • Lucide Icons for all icons - import from @lucide/svelte.
  • Use cn() from $lib/utils for conditional Tailwind class composition.
  • Prefer explicit props over object spreading - components should receive only the specific props they need. Exception: forwarding HTML attributes via ...rest, or intentional wrapper/proxy components.

Performance

Keep JS chunk sizes below 500KB. Use dynamic imports for heavy components:

typescript
<script lang="ts">
  import { onMount } from 'svelte';

  let HeavyChart;

  onMount(async () => {
    const module = await import('$lib/components/HeavyChart.svelte');
    HeavyChart = module.default;
  });
</script>

{#if HeavyChart}
  <svelte:component this={HeavyChart} />
{/if}

When reviewing bundle size:

  • Check build output for chunk-size warnings.
  • Identify heavy dependencies before adding them to eagerly loaded routes.
  • Prefer lazy loading, vendor splitting, or dependency deduplication when a chunk exceeds the limit.

Svelte 5 syntax

Use Svelte 5 patterns in all new code:

Props - use $props() with a typed interface:

typescript
<script lang="ts">
  interface Props {
    value: string;
    placeholder?: string;
    onSearch: (query: string) => void;
    disabled?: boolean;
  }

  let {
    value,
    placeholder = 'Enter text',
    onSearch,
    disabled = false
  }: Props = $props();
</script>

Event handlers - use onclick, onchange, etc. (not on:click, on:change).

Reactive declarations - use $derived or derived() stores, not $:. Do not mix the two approaches - pick one per file/module.

Page state - use $app/state, not $app/stores:

typescript
import { page } from "$app/state";
page.params.sampleId; // no $ prefix needed

Hooks and reactivity - for hooks that wrap TanStack Query, accept a getter function (thunk) for reactive parameters. TanStack Query v6 uses thunks for reactivity — do not pass Svelte stores or $derived values:

typescript
// Hook definition (useFrames.svelte.ts — must be .svelte.ts for TanStack v6)
export const useFrames = (
  getParams: () => { video_frame_collection_id: string; filter: VideoFrameFilter }
) => {
  const query = createInfiniteQuery(() => {
    const { video_frame_collection_id, filter } = getParams();
    return {
      ...getAllFramesInfiniteOptions({
        path: { video_frame_collection_id },
        body: { filter }
      }),
      getNextPageParam: (lastPage) => lastPage.nextCursor || undefined
    };
  });
  return { query };
};

// Consumer (+page.svelte)
const { query } = useFrames(() => ({
  video_frame_collection_id: collectionId,
  filter: currentFilter
}));
// query is a reactive proxy — access query.isSuccess, query.data directly (no $ prefix)

For non-TanStack hooks with static parameters, pass values via SvelteKit's page load function or direct props.

Show full SKILL.md (330 more words)Show less

State management & hooks

Create small, reusable hooks in src/lib/hooks - avoid monolithic stores. We do not use a services folder; hooks handle data fetching and state. Ref: lightly_studio_view/src/lib/hooks/useTags/useTags.ts, lightly_studio_view/src/lib/hooks/useFeatureFlags/useFeatureFlags.ts.

Generic hooks go in src/lib/hooks; component-specific hooks go in the component's folder.

For data fetching and API work:

  • Use TanStack Query for all data fetching. TanStack Query v6 is runes-based — hooks that call createQuery/createInfiniteQuery must be .svelte.ts files.
  • The query result is a reactive proxy (not a Svelte store). Access properties like query.isSuccess, query.data directly — no $ prefix needed.
  • Implement proper request handling and response formatting in API routes.

Store-based hook example (playground):

typescript
// useCounter.ts
import { writable } from 'svelte/store';

const count = writable<number>(0);

export function useCounter() {
  function increment() {
    count.update((c) => c + 1);
  }

  function resetCount() {
    count.set(0);
  }

  return { count, increment, resetCount };
}

// Counter.svelte
<script lang="ts">
  import { useCounter } from './useCounter';
  const { count, increment } = useCounter();
</script>

<button onclick={() => increment()}>Count: {$count}</button>
Avoiding props drilling

Prefer these solutions in order:

  1. Svelte Context API (setContext/getContext) - for state shared within a component subtree.
  2. Svelte stores - for truly global state (auth, preferences) shared across unrelated trees.
  3. $app/state - for server-loaded page data accessible by any component on the page.
  4. Svelte 5 Snippets (Snippet type) - for UI composition / layout customization without passing content as props.

Routing and Pages

  • Use SvelteKit's file-based routing in src/routes/.
  • Use dynamic routes with slug syntax. E.g. sample details at lightly_studio_view/src/routes/datasets/[dataset_id]/[collection_type]/[collection_id]/images/[sampleId]/.
  • Use +layout.svelte for shared layouts. E.g. the collection layout at lightly_studio_view/src/routes/datasets/[dataset_id]/[collection_type]/[collection_id]/+layout.svelte.

Storybook

Use simplified story syntax - no explicit {#snippet children()} for text content:

typescript
<Story name="H1" args={{ variant: 'h1' }}>
    Heading 1 - Large Page Title
</Story>

Testing

Testing levels: Unit tests for isolated components/functions, integration tests for component interactions, end-to-end tests for full application flows.

Unit test example:

typescript
import { render, screen } from "@testing-library/svelte";
import MyComponent from "./MyComponent.svelte";

describe("MyComponent", () => {
  it("renders the title", () => {
    render(MyComponent, { props: { title: "Hello World" } });
    expect(screen.getByText("Hello World")).toBeInTheDocument();
  });
});
Test optimization rules
  • Use defaultProps helper objects to avoid repeating prop definitions across tests. Override individual props with spread: { ...defaultProps, isUploading: true }.
  • No mirror tests for simple boolean toggles - testing the truthy case is sufficient when a single boolean controls the state.
  • Combine related assertions into one test rather than creating separate tests for closely related checks (e.g., placeholder + accessible label).
  • Test behavior, not implementation - don't assert on CSS classes, internal structure, or how hooks are called. Assert on user-visible outcomes.
  • Remove duplicate tests that verify the same behavior with different queries.
Running tests

Before submitting code:

bash
# Static checks (TypeScript, ESLint, Prettier, Svelte check)
make static-checks

# Unit tests
npm run test:unit

All checks must pass before committing.

© lightly-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/frontend-guide of lightly-ai/lightly-studio.

Open the folder on GitHubat commit 34ffd8c

Compare with similar skills

Frontend Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Frontend Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Frontend Guide this skilllightly-ai/lightly-studio896—~2.9kAutomated safety check: PassApache-2.0
Worklog Designregisx001/Worklog261—~3.3kAutomated safety check: PassMIT
Morphous CatalogAmeyanagi/morphos102—~2.1kAutomated safety check: PassApache-2.0
Atlaspacifio/ui154—~2.5kAutomated safety check: PassMIT
Nextjs15 Initbear2u/my-skills933—~2.4kAutomated safety check: PassNone
Weft FrontendWeaveMindAI/weft2k—~8kAutomated safety check: NotesCustom licence

Similar skills

  • Worklog Design

    regisx001/Worklog

    Design and UI skill for the Worklog desktop project manager.

    261 GitHub stars~3.3k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Morphous Catalog

    Ameyanagi/morphos

    Create or refresh Morphous website design-system/theme bundles from animal, insect, plant, landscape, mineral, weather, or other nature motifs.

    102 GitHub stars~2.1k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Atlas

    pacifio/ui

    Atlas — a design language and UI guide system for agent interfaces.

    154 GitHub stars~2.5k tokensUpdated 5 mo ago
    Frontend & DesignAuto-check passed
  • Nextjs15 Init

    bear2u/my-skills

    A skill your agent uses when user wants to create a new Next.js 15 project (Todo/Blog/Dashboard/E-commerce/Custom domain) with App Router, ShadCN, Zustand, Tanstack Query, and modern Next.js stack

    933 GitHub stars~2.4k tokensUpdated 3 mo ago
    Frontend & DesignAuto-check passed
  • Weft Frontend

    WeaveMindAI/weft

    Read when the user wants a page, app or site for the program, and before dispatching the frontend-builder: the verified scaffold commands, the default stack (pnpm, SvelteKit, PostgreSQL, BetterAuth…

    2k GitHub stars~8k tokensUpdated 2 days ago
    Frontend & DesignAuto-check: notes
  • Oma Frontend

    first-fluke/oh-my-agent

    Frontend specialist for React, Next.js, TypeScript with FSD-lite architecture, shadcn/ui, and design system alignment.

    1.3k GitHub stars~2.5k tokensUpdated today
    Frontend & DesignAuto-check passed

More from lightly-ai/lightly-studio

  • Backend Guide

    lightly-ai/lightly-studio

    Read before adding or changing backend code in lightlystudio - FastAPI routes, services, resolvers, SQLModel tables, or database access.

    896 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Python Guide

    lightly-ai/lightly-studio

    Read before writing or reviewing any Python code in this repository.

    896 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Glossary

    lightly-ai/lightly-studio

    Read when naming anything user-facing - GUI text, docs, public Python API names, arguments, docstrings, or error messages.

    896 GitHub stars~482 tokensUpdated today
    Auto-check passed
  • Pull Requests

    lightly-ai/lightly-studio

    Read when opening a pull request, writing a PR description, splitting work into PRs, or deciding whether a change is too large to review.

    896 GitHub stars~709 tokensUpdated today
    Auto-check passed
  • Best Practices

    lightly-ai/lightly-studio

    Read when adding a new function, module, or component, or when a file is growing large enough that splitting it is worth considering.

    896 GitHub stars~424 tokensUpdated today
    Auto-check passed

Questions about Frontend Guide

What does Frontend Guide do?

Read before writing or reviewing any frontend code in lightlystudioview - Svelte, TypeScript, or SvelteKit files. Frontend Guide is an agent skill from lightly-ai/lightly-studio. Read before writing or reviewing any frontend code in lightlystudioview - Svelte, TypeScript, or SvelteKit files.

When should I use Frontend Guide?

Frontend Guide fits situations like: tasks that involve Design systems; tasks that involve Unit testing; tasks that involve CSS and styling.

How do I install Frontend Guide in Claude Code?

Run `npx skills add lightly-ai/lightly-studio --skill frontend-guide -a claude-code`. Or copy the skill folder (.agents/skills/frontend-guide in lightly-ai/lightly-studio) into .claude/skills/frontend-guide in your project. Claude Code loads it when a task matches its description.

How do I install Frontend Guide in Codex?

Run `npx skills add lightly-ai/lightly-studio --skill frontend-guide -a codex`. Or copy the skill folder (.agents/skills/frontend-guide in lightly-ai/lightly-studio) into .agents/skills/frontend-guide in your project. Codex loads it when a task matches its description.

Can I use Frontend Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lightly-ai/lightly-studio --skill frontend-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frontend-guide, .gemini/skills/frontend-guide, .github/skills/frontend-guide and .opencode/skills/frontend-guide in your project.

What does Frontend Guide need to run?

Going by SKILL.md and its folder, Frontend Guide needs the command-line tools its instructions call (make and npm).

Does Frontend Guide access the network?

SKILL.md names 7 domains. As links in the text: svelte.dev, vitest.dev, kit.svelte.dev, next.shadcn-svelte.com, bits-ui.com, lucide.dev and tanstack.com. This is read from the text; nothing was executed.

Is Frontend Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Frontend Guide use?

Frontend Guide is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Frontend Guide use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Frontend Guide?

Skills that share tags, products or a category with Frontend Guide: Worklog Design (regisx001/Worklog, 261 stars), Morphous Catalog (Ameyanagi/morphos, 102 stars), Atlas (pacifio/ui, 154 stars) and Nextjs15 Init (bear2u/my-skills, 933 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Frontend Guide?

lightly-ai (a GitHub organization) maintains it in lightly-ai/lightly-studio, which has 896 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

Source: lightly-ai/lightly-studio on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.