Frontend Component Standards

VerifiedSafe

Apply frontend domain conventions for Svelte components, runes/attachments, route form UX, and testing patterns.

Sby Skills Guide Bot
DevelopmentIntermediate
7/25/2026
Claude Code
#svelte#component-library#sveltekit#frontend-testing#accessibility

Recommended for

Automated summary

This skill applies a project's frontend conventions for Svelte/SvelteKit work: component APIs, runes and attachments, route-level form UX, and testing patterns.

Strengths

  • Gives concrete rules for module-scoped typed props, class merging through cn(), and snippet-based content projection
  • Pushes toward targeted runes ($state, $derived, $bindable, minimal $effect) and requires the svelte-autofixer to come back clean
  • Defines a UI regression matrix (light/dark themes, narrow/wide viewports, empty/active/error states) for critical surfaces
  • Steers form handling to SvelteKit form actions instead of client-side fetch mutations

Limitations

  • Tightly coupled to an internal directory layout and rule files (rules/*.md, tokens.css) that are not shipped with the skill
  • Assumes the svelte MCP server (list-sections, get-documentation, autofixer, playground-link) is available
  • Explicitly excludes pure server, database, and backend integration work
When to use it

Use it when creating or changing a Svelte component, a route interaction, or a frontend test in this codebase.

When not to use it

Skip it for pure server, database, or backend integration tasks with no frontend touch points.

Security analysis

Safe
Quality score85/100

The skill defines frontend component conventions and allowed tools are limited to Svelte MCP helpers plus normal file inspection/editing and test commands. It contains no destructive, exfiltration, obfuscated, or safety-disabling instructions.

No concerns found

How this analysis is made

Examples

New badge variant
Add a new 'warning' variant to the Badge component in src/lib/components, using data-* attributes and tokens.css instead of Tailwind classes, and update its tests.
Fix reactivity
Refactor this Svelte component to use $state and $derived instead of the current $effect, then run the svelte autofixer until it reports clean.
Form action UX
Convert this client-side fetch mutation on the profile route into a SvelteKit form action with explicit success and error states, and add a .svelte.test.ts covering the error state.

name: component-standards description: Apply frontend domain conventions for components, Svelte runes/attachments, route form UX, and testing patterns. allowed-tools:

  • mcp__svelte__list-sections
  • mcp__svelte__get-documentation
  • mcp__svelte__svelte-autofixer
  • mcp__svelte__playground-link
  • Bash
  • Read
  • Edit
  • Write
  • Grep
  • Glob

Component Standards

When to use

  • Creating or modifying components under src/lib/components/**
  • Updating Svelte reactivity, attachments, or form UX behavior in frontend surfaces
  • Implementing route-level UI behavior in src/routes/** that affects component interactions
  • Writing or fixing frontend tests (*.svelte.test.ts, E2E UI flows)

Do not use

  • Pure server/database workflows
  • GitHub integration backends with no frontend touch points

Constraints

  • Follow {baseDir}/rules/component-library.md
  • Follow {baseDir}/rules/svelte-patterns.md and {baseDir}/rules/svelte-routes.md when route behavior is involved
  • Follow {baseDir}/rules/testing.md for frontend test environment selection
  • No Tailwind; use tokens from tokens.css
  • Variants via data-* attributes, not conditional utility classes

Operation modes

1) Component API and variants

  • Define props/types in <script lang="ts" module>
  • Merge external classes with cn() only
  • Use snippets for projected content (children, header, footer)
  • Shared components (cards, badges, headers, controls) must use the canonical implementation; do not fork per-page

2) Reactivity and attachments

  • Prefer $state, $derived, $bindable, and minimal $effect
  • Use {@attach} for DOM behavior and cleanup correctly
  • Re-run mcp__svelte__svelte-autofixer until clean

3) Route and form UX

  • Use SvelteKit form/action patterns with explicit success/error states
  • Ensure cache invalidation and streamed UI behavior are aligned with route rules
  • Avoid client-fetch mutations when form actions fit

4) Frontend testing and accessibility

  • Use the right environment (.svelte.test.ts for browser)
  • Cover keyboard interaction and ARIA expectations in tests
  • Keep deterministic fixtures and avoid brittle timing patterns
  • Critical surfaces must have tests covering light+dark themes, narrow+wide viewports, and empty/active/error states
  • Use documentation/testing/ui-regression-matrix.md permutation template for acceptance criteria

Workflow

  1. Inspect similar components/routes/tests for the existing pattern.
  2. Apply the smallest change that fits component + Svelte + testing rules.
  3. Update tests for the new or changed behavior.
  4. Run autofixer and targeted checks for touched frontend areas.

Verification

  • mcp__svelte__svelte-autofixer returns clean for changed .svelte files.
  • Tests exist or are updated for new props/variants/states.
  • Relevant frontend tests pass (for example bun run --cwd applications/web test:unit:client).
  • For critical surfaces: permutation coverage (theme, viewport, state) is documented in the ticket or pull request.

Additional references

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/frontend-component-standards-mrzxupqi/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/frontend-component-standards-mrzxupqi' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/frontend-component-standards-mrzxupqi/download' --output '.skill-downloads/frontend-component-standards-mrzxupqi/SKILL.md.part' && mv '.skill-downloads/frontend-component-standards-mrzxupqi/SKILL.md.part' '.skill-downloads/frontend-component-standards-mrzxupqi/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/frontend-component-standards-mrzxupqi/SKILL.md' && test -s '.skill-downloads/frontend-component-standards-mrzxupqi/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/component-standards' && cp -R '.skill-downloads/frontend-component-standards-mrzxupqi' '.claude/skills/component-standards'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/frontend-component-standards-mrzxupqi'

openskills read 'frontend-component-standards-mrzxupqi'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/frontend-component-standards-mrzxupqi/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills