frontend-qwik-architecture
Use when the user asks about Qwik, resumability vs hydration, Qwik City (Qwik Router in v2), the $ lazy boundary, Qwik project structure or Qwik vs React…
от j4flmao★ 47 звёзд на GitHub
Установить frontend-qwik-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Qwik Architecture
Purpose
Build instantly interactive web applications with Qwik's resumability model — no hydration, lazy everything, serialized state in HTML, and automatic code splitting per component and per event.
Version Note (2026)
Stable Qwik is still v1 (@builder.io/qwik, @builder.io/qwik-city). Qwik 2 reached release candidate in October 2026 under new package names (@qwik.dev/core, @qwik.dev/router; Qwik City becomes Qwik Router). Use v1 imports for production unless the project already runs v2, and follow the official "Migrating to Qwik v2" guide when upgrading.
Agent Protocol
Trigger
Exact user phrases: "Qwik", "Qwik architecture", "Qwik resumable", "Qwik City", "Qwik component", "$()", "resumable", "lazy loading Qwik", "Qwik vs React".
Input Context
Before activating, verify:
- package.json has @builder.io/qwik + @builder.io/qwik-city (v1) or @qwik.dev/core + @qwik.dev/router (v2).
- Vite config has the Qwik plugins.
- Deployment target (Cloudflare, Vercel, Node).
Output Artifact
No file output. Produces component code, routing patterns, and resumability explanations as text.
Response Format
Code: show component$(), $(), routeLoader$(), routeAction$(). Show serialization and lazy boundaries.
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Components use component$() for lazy loading.
- Event handlers use $ suffix (onClick$).
- Closures use $() for lazy boundaries.
- Data loading uses routeLoader$() in Qwik City.
- Mutations use routeAction$() with Form component.
- State serialized into HTML — no hydration.
- Prefetch strategy enabled via PrefetchServiceWorker.
- Bundle split per component and per event automatically.
Max Response Length
Code: 15 lines per example. Unlimited patterns.
Component Architecture / Decision Trees
Architecture Options
| Approach | Trade-off | When to Use |
|---|---|---|
| Pure component$() + useSignal | Simplest, minimal chunks | Simple interactive widgets |
| Component + useStore() for deep state | More serialization, finer updates | Forms with multiple fields |
| useContext() + useContextProvider() | Shared state without prop drilling | Theme, auth, global filters |
| Inline components (no $) | Eager, no code-splitting | Non-interactive wrapper layouts |
| Server$() + routeLoader$() | Full server-side logic | Data-fetching heavy pages |
Decision Tree: State Management
Do you need shared state across components?
├── No → useSignal() or useStore() locally
└── Yes → Do you need it across routes?
├── No → useContext() + useContextProvider()
└── Yes → useSignal() in root + pass via props
Decision Tree: Component Design
Does the component need to be lazy?
├── No (non-interactive wrapper) → plain function component
└── Yes (has state or handlers) → component$()
Decision Tree: Data Fetching Strategy
Where does data come from?
├── Route-level data → routeLoader$() in route file
├── User action/mutation → routeAction$() + <Form>
├── Component-level data → $() closure called from event
└── Real-time / WebSocket → useVisibleTask$() with WebSocket
Decision Tree: Lazy Boundary Placement
What creates a lazy boundary?
├── A component → component$()
├── An event handler → onClick$(), onInput$(), onSubmit$()
├── A closure → $()
├── A data loader → routeLoader$()
└── An action → routeAction$()
Decision Tree: Effect Strategy
What type of side effect?
├── Data fetch on load → routeLoader$() in parent route
├── DOM measurement → useVisibleTask$() with cleanup
├── Third-party widget init → useVisibleTask$() with NoSerialize
├── Analytics/tracking → useVisibleTask$() with IntersectionObserver
└── Polling/subscription → useVisibleTask$() with cleanup interval
Component Design Patterns
Signal-Based Counter
import { component$, useSignal } from '@builder.io/qwik'
export default component$(() => {
const count = useSignal(0)
const step = useSignal(1)
return (
<div>
<p>Count: {count.value}</p>
<button onClick$={() => count.value += step.value}>Increment</button>
<button onClick$={() => count.value -= step.value}>Decrement</button>
<input type="number" bind:value={step} />
</div>
)
})
Store-Based Form
import { component$, useStore } from '@builder.io/qwik'
interface FormState {
email: string
password: string
errors: { email?: string; password?: string }
}
export default component$(() => {
const form = useStore<FormState>({
email: '',
password: '',
errors: {},
})
const validate = $((field: string) => {
if (field === 'email' && !form.email.includes('@')) {
form.errors.email = 'Invalid email'
} else {
delete form.errors.email
}
})
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/qwik-city-routing.md
- references/qwik-city.md
- references/qwik-deployment-scaling.md
- references/qwik-optimization.md
- references/qwik-resumability.md
- references/qwik-resumable.md
- references/qwik-state-management.md
- references/qwik-testing.md
FAQ
Что делает скилл frontend-qwik-architecture?
Use when the user asks about Qwik, resumability vs hydration, Qwik City (Qwik Router in v2), the $ lazy boundary, Qwik project structure or Qwik vs React. Produces a Qwik app layout with routing, loaders/actions and bundle-splitting rules. Not for useSignal/useStore or prefetch tuning in an existing app (use frontend-qwik-patterns).
Как установить скилл frontend-qwik-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frontend-qwik-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…