solidjs-solidstart-expert
Expert-level SolidJS and SolidStart development skill with 20+ years senior/lead engineer mindset. Comprehensive guidance for building production-ready, scalable web applications with fine-grained reactivity. Use when Claude needs to: (1) Create new SolidJS/SolidStart projects, (2) Implement TanStack Query/Router/Table/Form integration, (3) Build reactive components with signals/stores/resources, (4) Handle SSR/SSG/streaming with SolidStart, (5) Implement authentication and API routes, (6) Optimize bundle size and performance, (7) Debug reactivity issues and memory leaks, (8) Structure large-scale applications, (9) Implement type-safe patterns with TypeScript, (10) Handle error boundaries and suspense, (11) Build accessible UI components, (12) Deploy to Vercel/Netlify/Cloudflare. Triggers: "solid", "solidjs", "solidstart", "createSignal", "createStore", "createResource", "tanstack solid", "vinxi", "fine-grained reactivity".
What this skill does
# SolidJS & SolidStart Expert Development Skill
Senior/Lead engineer-level guidance for building production-ready applications with fine-grained reactivity.
## Core Philosophy (KISS, Less is More)
```
1. Signals are primitive. Don't wrap unnecessarily.
2. Derived values > effects. Let reactivity flow naturally.
3. Components are functions called ONCE. Closures handle updates.
4. SSR first, hydrate smart. SolidStart handles this elegantly.
5. Type everything. TypeScript is non-negotiable.
```
## Project Initialization
### SolidStart (Recommended for 95% of projects)
```bash
# Latest SolidStart with TypeScript
npm create solid@latest my-app
# Select: SolidStart, TypeScript, TailwindCSS
# Or with pnpm (recommended)
pnpm create solid@latest my-app
```
### Vanilla SolidJS (Client-only SPAs)
```bash
npx degit solidjs/templates/ts my-app
```
**Decision matrix**: Use SolidStart unless you're building: embeddable widgets, micro-frontends, or have strict no-server requirements.
## Project Structure (Production-Ready)
```
src/
├── routes/ # File-based routing (SolidStart)
│ ├── index.tsx # / route
│ ├── about.tsx # /about route
│ ├── users/
│ │ ├── index.tsx # /users
│ │ ├── [id].tsx # /users/:id (dynamic)
│ │ └── [...all].tsx # /users/* (catch-all)
│ └── api/ # API routes
│ └── users.ts # /api/users endpoint
├── components/
│ ├── ui/ # Primitives (Button, Input, Modal)
│ ├── features/ # Feature-specific (UserCard, PostList)
│ └── layouts/ # Layout components (MainLayout, AuthLayout)
├── lib/
│ ├── api/ # API client, fetchers
│ ├── stores/ # Global stores (createStore)
│ ├── signals/ # Shared signals
│ └── utils/ # Pure utility functions
├── hooks/ # Custom reactive primitives
├── types/ # TypeScript types/interfaces
├── styles/ # Global styles, Tailwind config
└── entry-server.tsx # Server entry (SolidStart)
└── entry-client.tsx # Client entry (SolidStart)
```
## Reactivity Fundamentals
### Signals (Atomic State)
```typescript
import { createSignal, createEffect, createMemo } from 'solid-js';
// ✅ CORRECT: Simple, atomic state
const [count, setCount] = createSignal(0);
const [user, setUser] = createSignal<User | null>(null);
// ✅ Derived state with createMemo (NOT createEffect!)
const doubleCount = createMemo(() => count() * 2);
const isLoggedIn = createMemo(() => user() !== null);
// ✅ Effects for side effects ONLY
createEffect(() => {
console.log('Count changed:', count());
// Side effect: localStorage, analytics, DOM manipulation
});
// ❌ WRONG: Don't derive state in effects
createEffect(() => {
setDoubleCount(count() * 2); // Anti-pattern!
});
```
### Stores (Complex State)
```typescript
import { createStore, produce, reconcile } from 'solid-js/store';
interface AppState {
user: User | null;
todos: Todo[];
settings: Settings;
}
const [state, setState] = createStore<AppState>({
user: null,
todos: [],
settings: { theme: 'dark', lang: 'id' },
});
// ✅ Fine-grained updates with produce (Immer-like)
const addTodo = (todo: Todo) => {
setState(produce((s) => {
s.todos.push(todo);
}));
};
// ✅ Path-based updates (more performant)
const updateTodo = (id: string, text: string) => {
setState('todos', (t) => t.id === id, 'text', text);
};
// ✅ Replace entire array with reconcile (smart diffing)
const setTodos = (newTodos: Todo[]) => {
setState('todos', reconcile(newTodos));
};
// ✅ Nested path updates
setState('settings', 'theme', 'light');
```
### Resources (Async Data)
```typescript
import { createResource, Suspense, ErrorBoundary } from 'solid-js';
// ✅ Basic resource
const [user] = createResource(() => fetchUser(userId()));
// ✅ With source signal (refetches on change)
const [userId, setUserId] = createSignal('1');
const [user, { mutate, refetch }] = createResource(userId, fetchUser);
// ✅ Resource with initial value (SSR-friendly)
const [posts] = createResource(
() => fetchPosts(),
{ initialValue: [] }
);
// ✅ Usage in components
function UserProfile() {
return (
<ErrorBoundary fallback={(err) => <ErrorDisplay error={err} />}>
<Suspense fallback={<Skeleton />}>
<Show when={user()} fallback={<NotFound />}>
{(u) => <UserCard user={u()} />}
</Show>
</Suspense>
</ErrorBoundary>
);
}
```
## TanStack Integration
### TanStack Query (Server State)
```typescript
// lib/query.ts
import { QueryClient, QueryClientProvider } from '@tanstack/solid-query';
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 5 * 60 * 1000,
gcTime: 10 * 60 * 1000,
retry: 2,
refetchOnWindowFocus: false,
},
},
});
// hooks/useUsers.ts
import { createQuery, createMutation, useQueryClient } from '@tanstack/solid-query';
export function useUsers() {
return createQuery(() => ({
queryKey: ['users'],
queryFn: () => api.getUsers(),
}));
}
export function useUser(id: Accessor<string>) {
return createQuery(() => ({
queryKey: ['users', id()],
queryFn: () => api.getUser(id()),
enabled: !!id(),
}));
}
export function useCreateUser() {
const queryClient = useQueryClient();
return createMutation(() => ({
mutationFn: (data: CreateUserDTO) => api.createUser(data),
onSuccess: () => queryClient.invalidateQueries({ queryKey: ['users'] }),
onError: (error) => toast.error(error.message),
}));
}
// ✅ Optimistic updates
export function useUpdateUser() {
const queryClient = useQueryClient();
return createMutation(() => ({
mutationFn: ({ id, data }: { id: string; data: UpdateUserDTO }) =>
api.updateUser(id, data),
onMutate: async ({ id, data }) => {
await queryClient.cancelQueries({ queryKey: ['users', id] });
const previous = queryClient.getQueryData(['users', id]);
queryClient.setQueryData(['users', id], (old: User) => ({ ...old, ...data }));
return { previous };
},
onError: (_err, { id }, context) => {
queryClient.setQueryData(['users', id], context?.previous);
},
onSettled: (_, __, { id }) => {
queryClient.invalidateQueries({ queryKey: ['users', id] });
},
}));
}
```
### TanStack Table
```typescript
import {
createSolidTable, getCoreRowModel, getSortedRowModel,
getFilteredRowModel, getPaginationRowModel, flexRender,
} from '@tanstack/solid-table';
function UsersTable() {
const [sorting, setSorting] = createSignal<SortingState>([]);
const [globalFilter, setGlobalFilter] = createSignal('');
const table = createSolidTable({
get data() { return users() ?? []; },
columns,
state: {
get sorting() { return sorting(); },
get globalFilter() { return globalFilter(); },
},
onSortingChange: setSorting,
onGlobalFilterChange: setGlobalFilter,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
getFilteredRowModel: getFilteredRowModel(),
getPaginationRowModel: getPaginationRowModel(),
});
return (
<table>
<thead>
<For each={table.getHeaderGroups()}>
{(headerGroup) => (
<tr>
<For each={headerGroup.headers}>
{(header) => (
<th onClick={header.column.getToggleSortingHandler()}>
{flexRender(header.column.columnDef.header, header.getContext())}
</th>
)}
</For>
</tr>
)}
</For>
</thead>
<tbody>
<For each={table.getRowModel().rows}>
{(row) => (
<tr>
<For each={row.getVisibleCells()}>
{(cell) => <td>{flexRender(cell.column.columnDef.cell, cell.getContext())}</td>}
</For>
</tr>
)}
</For>
</tboRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.