CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

dev-create-component

Use when adding a new UI component to an existing module - handles templates, props, and test scaffolding.

Quality

75%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./packs/svelte/skills/dev-create-component/SKILL.md
SKILL.md
Quality
Evals
Security

Create a Svelte component following docs/ARCHITECTURE.md section 5.

Component: $ARGUMENTS

Steps

  1. Read docs/ARCHITECTURE.md section 5.

  2. Determine the type:

    • Feature component -> src/lib/modules/[module]/components/ComponentName.svelte
    • Shared component -> src/lib/shared/components/ComponentName.svelte
    • Page -> src/routes/[feature]/+page.svelte
  3. Create the component with the Svelte 5 runes template:

<script lang="ts">
  // Imports
  import type { SomeType } from '../types/some.contracts'

  // Props (typed with $props rune)
  interface Props {
    // type all props
    items: SomeType[]
    isLoading?: boolean
    onselect?: (item: SomeType) => void
  }

  let { items, isLoading = false, onselect }: Props = $props()

  // Local state ($state rune)
  let selectedId = $state<string | null>(null)

  // Derived state ($derived rune)
  let isEmpty = $derived(!isLoading && items.length === 0)

  // Handlers
  function handleSelect(item: SomeType) {
    selectedId = item.id
    onselect?.(item)
  }
</script>

<!-- Template with loading/error/empty states -->
{#if isLoading}
  <div>Loading...</div>
{:else if isEmpty}
  <div>No items found</div>
{:else}
  {#each items as item (item.id)}
    <div onclick={() => handleSelect(item)}>{item.name}</div>
  {/each}
{/if}

<style>
  /* scoped styles */
</style>
  1. Checklist:

    • <script lang="ts"> with runes
    • Typed $props() with interface
    • Callback props (not event dispatchers)
    • $state for local reactive state
    • $derived for computed values
    • < 200 lines
    • PascalCase.svelte
  2. Validate: npx svelte-check --tsconfig ./tsconfig.json

Repository

fernandezbaptiste/specialist-agent

Path

packs/svelte/skills/dev-create-component/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.