Command Palette

Search for a command to run...

Назад к скиллам
скилл № 76824

frontend-solidjs-patterns

Use when the user asks about SolidJS forms, createResource and Suspense data fetching, SolidJS component composition, transitions or animation. Produces…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить frontend-solidjs-patterns в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

SolidJS Patterns

Purpose

Apply production patterns to SolidJS applications: async data with createResource, controlled forms with signals and Zod, component composition patterns, and animation.

Agent Protocol

Trigger

Exact user phrases: "SolidJS pattern", "SolidJS form", "SolidJS data fetching", "SolidJS component pattern", "SolidJS animation".

Input Context

Before activating, verify:

  • SolidJS project with solid-js package.
  • Whether @tanstack/solid-form or custom forms are used.
  • If css transitions or Solid Flip is available for animation.

Output Artifact

No file output. Produces code patterns for data fetching, forms, composition, and animation.

Response Format

Code: show resource, form, and composition examples. No imports beyond SolidJS APIs.

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • Data fetching uses createResource with Suspense boundaries.
  • createResource refetches when source signal changes.
  • Forms use controlled inputs with signals and Zod validation.
  • Component composition uses JSX children as functions or slot patterns.
  • Animation uses createTransition, Solid Flip, or CSS transitions with signals.

Max Response Length

Code: 15 lines per example.

Component Architecture / Decision Trees

Architecture Options

Approach Trade-off When to Use
createResource + Suspense Simple async data, loading states API data fetching
createResource with mutate Optimistic updates, cache control Dashboard, live data
Controlled form with signals Full control over validation Complex forms
Children as functions (render props) Flexible composition List, Table, Dropdown
Slot pattern via props Explicit API Card, Layout, Modal
createTransition Pending state for deferred updates Tab switching, navigation

Decision Tree: Data Fetching

Is data needed on page load?
  ├── Yes -> createResource in component
  │    ├── Depends on signal? -> Pass signal as source
  │    └── Static -> Pass constant source
  └── No -> fetch on interaction (event handler)

Decision Tree: Form Complexity

How many fields?
  ├── 1-3 fields -> createSignal per field
  ├── 4-10 fields -> createStore for the form object
  └── 10+ fields or nested -> createStore + field arrays

Decision Tree: Component Composition

Does the component need to customize rendering?
  ├── Yes -> Children as functions or render props
  └── No -> Regular props + children

Does the component have optional sections?
  ├── Yes -> Slot pattern (header, footer, sidebar)
  └── No -> Single children slot

Component Design Patterns

Data Fetching with Loading and Error States

function ProductList() {
  const [products] = createResource(() => '/api/products', fetchProducts)
  return (
    <Suspense fallback={<ProductSkeleton />}>
      <ErrorBoundary fallback={<div>Failed to load products</div>}>
        <For each={products()}>
          {(product) => <ProductCard product={product} />}
        </For>
      </ErrorBoundary>
    </Suspense>
  )
}

createResource with Dependent Fetching

function UserPosts() {
  const params = useParams()
  const userId = () => params.id
  const [user] = createResource(userId, fetchUser)
  const [posts] = createResource(user, (u) => u ? fetchPosts(u.id) : [])
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <h1>{user()?.name}'s Posts</h1>
      <For each={posts()}>{(post) => <PostCard post={post} />}</For>
    </Suspense>
  )
}

Optimistic Update with mutate

function LikeButton(props: { postId: string }) {
  const [liked, setLiked] = createSignal(false)
  const toggleLike = async () => {
    const previous = liked()
    setLiked(!liked()) // optimistic update
    try {
      await api.toggleLike(props.postId)
    } catch {
      setLiked(previous) // rollback
    }
  }
  return <button onClick={toggleLike}>{liked() ? 'Unlike' : 'Like'}</button>
}

Complex Form with createStore

function OrderForm() {
  const [form, setForm] = createStore({
    customer: { name: '', email: '' },
    items: [] as { productId: string; quantity: number }[],
    shipping: { address: '', city: '', zip: '' },
    errors: {} as Record<string, string>,
  })

  const addItem = () => setForm('items', items => [...items, { productId: '', quantity: 1 }])
  const removeItem = (i: number) => setForm('items', items => items.filter((_, idx) => idx !== i))
  const updateItem = (i: number, field: string, value: any) => setForm('items', i, field, value)

  const total = createMemo(() => form.items.reduce((sum, i) => sum + i.quantity * 10, 0))

  const handleSubmit = async (e: Event) => {
    e.preventDefault()
    const result = orderSchema.safeParse(form)
    if (!result.success) {
      setForm('errors', re
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/solid-data.md
  • references/solid-forms.md
  • references/solidjs-routing.md
  • references/solidjs-ssr-streaming.md
  • references/solidjs-state.md
  • references/solidjs-testing-strategy.md
  • references/solidjs-testing.md
  • references/solidjs-ui-patterns.md

FAQ

Что делает скилл frontend-solidjs-patterns?

Use when the user asks about SolidJS forms, createResource and Suspense data fetching, SolidJS component composition, transitions or animation. Produces reusable Solid patterns for an existing app. Not for Solid project structure and reactivity basics (use frontend-solidjs-architecture).

Как установить скилл frontend-solidjs-patterns?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл frontend-solidjs-patterns запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить frontend-solidjs-patterns с