solid
SolidJS reactive UI library. Covers signals, effects, and fine-grained reactivity. USE WHEN: user mentions "SolidJS", "Solid", "createSignal", "createEffect", "createMemo", "fine-grained reactivity", asks about "Solid patterns", "reactive primitives" DO NOT USE FOR: React - use `frontend-react` (different API despite similar JSX), Vue - use `vue-composition`, Svelte - use `svelte`, Angular - use `angular`
What this skill does
# SolidJS Core Knowledge
> **Full Reference**: See [advanced.md](advanced.md) for WebSocket primitive, context provider, chat component, room management, Socket.IO integration, and store patterns.
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `solid` for comprehensive documentation.
## When NOT to Use This Skill
Skip this skill when:
- Working with React (use `frontend-react` - APIs are different)
- Building Vue applications (use `vue-composition`)
- Using Svelte (use `svelte`)
- Working with Angular (use `angular`)
- Need server-side only logic (no framework needed)
## Component Structure
```tsx
import { createSignal, createEffect, createMemo } from 'solid-js';
interface Props {
name: string;
count?: number;
}
function Counter(props: Props) {
const [localState, setLocalState] = createSignal('');
const doubled = createMemo(() => (props.count ?? 0) * 2);
createEffect(() => {
console.log('Count changed:', props.count);
});
return (
<div>
<h1>Hello {props.name}</h1>
<p>Doubled: {doubled()}</p>
<button onClick={() => setLocalState('clicked')}>
Click
</button>
</div>
);
}
```
## Reactivity Primitives
| API | Purpose |
|-----|---------|
| `createSignal` | Reactive state |
| `createMemo` | Cached computation |
| `createEffect` | Side effects |
| `createResource` | Async data fetching |
| `createStore` | Nested reactive objects |
## Key Differences from React
- **No Virtual DOM** - fine-grained updates
- **Props are getters** - access via `props.name`
- **No dependency arrays** - auto-tracking
- **Components run once** - not on every render
- **JSX compiles differently** - expressions are reactive
## Control Flow
```tsx
import { Show, For, Switch, Match } from 'solid-js';
<Show when={isLoggedIn()} fallback={<Login />}>
<Dashboard />
</Show>
<For each={items()}>{(item) => <Item data={item} />}</For>
```
## Anti-Patterns
| Anti-Pattern | Why It's Bad | Correct Approach |
|--------------|--------------|------------------|
| Destructuring props | Loses reactivity | Access via `props.name` |
| Using React patterns | Different paradigm | Use Solid primitives |
| Not using `<Show>` component | Manual conditional logic | Use `<Show when={}>` |
| Recreating signals in components | Components run once | Create outside or use stores |
| Using `innerHTML` without sanitization | XSS vulnerability | Use DOMPurify |
| Not cleaning up in `onCleanup` | Memory leaks | Add cleanup logic |
## Quick Troubleshooting
| Issue | Likely Cause | Solution |
|-------|--------------|----------|
| Props not reactive | Destructured props | Access via `props.name` |
| Signal not updating | Forgot to call setter | Use `setCount(newValue)` |
| Effect not running | Not tracking signal | Call signal inside effect: `count()` |
| Component re-running | Treating like React | Components run once, use signals |
| List not updating | Using array methods | Use `produce()` from solid-js/store |
| Memory leaks | No cleanup | Use `onCleanup()` |
## Production Readiness
### Error Handling
```tsx
import { ErrorBoundary } from 'solid-js';
function App() {
return (
<ErrorBoundary
fallback={(err, reset) => (
<div>
<p>Error: {err.message}</p>
<button onClick={reset}>Retry</button>
</div>
)}
>
<MainContent />
</ErrorBoundary>
);
}
```
### Performance
```tsx
// Lazy loading components
const HeavyComponent = lazy(() => import('./HeavyComponent'));
function App() {
return (
<Suspense fallback={<Loading />}>
<HeavyComponent />
</Suspense>
);
}
// Batch updates (rarely needed)
import { batch } from 'solid-js';
batch(() => {
setCount(count() + 1);
setName('New Name');
});
```
### Store Patterns
```tsx
import { createStore, produce } from 'solid-js/store';
const [state, setState] = createStore({
users: [] as User[],
filters: { active: true },
});
// Immutable-style updates with produce
function addUser(user: User) {
setState(produce((s) => {
s.users.push(user);
}));
}
// Path-based updates
setState('users', (users) => [...users, newUser]);
setState('filters', 'active', false);
```
### Testing
```tsx
import { render, screen } from '@solidjs/testing-library';
import userEvent from '@testing-library/user-event';
import Counter from './Counter';
describe('Counter', () => {
it('increments on click', async () => {
const user = userEvent.setup();
render(() => <Counter initial={0} />);
const button = screen.getByRole('button');
await user.click(button);
expect(screen.getByText('Count: 1')).toBeInTheDocument();
});
});
```
### Security
```tsx
// innerHTML - only with trusted content
<div innerHTML={sanitizedHtml} />
// Prefer text content
<div>{userInput}</div> // Safe - auto-escaped
// XSS prevention
import DOMPurify from 'dompurify';
function SafeHtml(props: { html: string }) {
const clean = () => DOMPurify.sanitize(props.html);
return <div innerHTML={clean()} />;
}
```
### Monitoring Metrics
| Metric | Target |
|--------|--------|
| Bundle size | < 30KB |
| First Contentful Paint | < 1s |
| Time to Interactive | < 1.5s |
| Memory usage | Stable |
### Checklist
- [ ] ErrorBoundary for error handling
- [ ] Suspense for async operations
- [ ] Lazy loading for code splitting
- [ ] createStore for complex state
- [ ] Virtual lists for large data
- [ ] No innerHTML with user input
- [ ] Testing with @solidjs/testing-library
- [ ] SSR with SolidStart
- [ ] Fine-grained updates (no unnecessary re-renders)
- [ ] Bundle analysis
## Reference Documentation
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `solid` for comprehensive documentation.
- [Primitives Cheatsheet](quick-ref/primitives-cheatsheet.md)
- [React Migration Guide](quick-ref/react-migration.md)
Related 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.