solid-2.0
Installation
Copy the prompt below and send it to your AI assistant (e.g. Claude Code) — it will follow the instructions and install automatically.
Install the "solid-2.0" skill by following the instructions at https://skill123.me/install/solid-2-0?ref=detail
Run in your terminal — downloads and installs to ~/.claude/skills/.
curl -fsSL https://skill123.me/install/solid-2-0.sh?ref=detail | bash
Download the zip and extract it into your skills directory (e.g. ~/.claude/skills/), then restart your session.
⬇ Download v1.0.7de4595 · 10.6 MBNot live-tested yet — this skill is rated on static analysis only.
About this skill
Solid 2.0 primer for coding agents. Use when writing, reviewing or migrating Solid 2.0 code (solid-js 2.x, @solidjs/web). The API differs from Solid 1.x and from React; read this before generating, then check unfamiliar names against node_modules/solid-js/CHEATSHEET.md.
Solid 2.0 for agents
Solid is not React, and 2.0 is not 1.x. Pattern-matching from either is the
dominant bug source. Every name below is a solid-js export unless noted;
DOM APIs (render, hydrate, Portal, dynamic) are in @solidjs/web.
Documentation
Solid 2.0 primer for coding agents. Use when writing, reviewing or migrating Solid 2.0 code (solid-js 2.x, @solidjs/web). The API differs from Solid 1.x and from React; read this before generating, then check unfamiliar names against node_modules/solid-js/CHEATSHEET.md.
Solid 2.0 for agents
Solid is not React, and 2.0 is not 1.x. Pattern-matching from either is the
dominant bug source. Every name below is a solid-js export unless noted;
DOM APIs (render, hydrate, Portal, dynamic) are in @solidjs/web.
Three rules
1. **Props are read, not destructured; pass values, not accessors.**
- Wrong:
function C({ name }) {}and<C value={count} /> - Right:
function C(props) { return <p>{props.name}</p>; }and<C value={count()} />
2. **createEffect takes two functions: compute (tracks), then apply (side effects).**
- Wrong:
createEffect(() => { el.title = count(); }); - Right:
createEffect(() => count(), v => { el.title = v; });
3. **Stores are written through the draft.**
- Wrong:
setStore("user", "name", "B")orsetStore(produce(s => ...)) - Right:
setStore(s => { s.user.name = "B"; });
1.x → 2.0 corrections
Nothing in the left column exists in 2.0.
| Wrong (1.x) | Right (2.0) |
| ---------------------------------------------- | ----------------------------------------------------------------- |
| import { createStore } from "solid-js/store" | import { createStore } from "solid-js" |
| import { render } from "solid-js/web" | import { render } from "@solidjs/web" |
| "jsxImportSource": "solid-js" | "jsxImportSource": "@solidjs/web" |
| createEffect(fn) (one argument) | createEffect(compute, apply) |
| onMount(fn) | onSettled(() => { setup(); return cleanup; }) |
| createEffect(on(dep, fn)) | createEffect(() => dep(), v => fn(v)) |
| const [d] = createResource(id, fetchX) | const d = createMemo(() => fetchX(id())) under <Loading> |
| d.loading / d.error | <Loading> or isPending(() => d()) / <Errored> |
| refetch() | refresh(d) (affects(d); refresh(d) to read as pending) |
| <Suspense> / <SuspenseList> | <Loading> / <Reveal> |
| <ErrorBoundary> | <Errored fallback={(err, reset) => ...}> (heals automatically) |
| <Index each={xs}> | <For each={xs} keyed={false}> |
| batch(fn) | not needed: updates batch per microtask; flush() applies n
View full documentation
ow |
| startTransition / useTransition | built-in transitions: action(...), isPending, optimistic APIs |
| createComputed | createMemo, split createEffect, or createSignal(fn) |
| mergeProps / splitProps / unwrap | merge / omit / snapshot |
| produce, createMutable, modifyMutable | draft setters are the default in createStore |
| createSelector | createProjection (or createStore(fn)) |
| <Ctx.Provider value={v}> | <Ctx value={v}> |
| classList={{ a: x() }} | class={{ a: x() }} or class={["base", { a: x() }]} |
| use:dir={x} / attr: / on: / tabIndex | ref={dir(x)} / plain attributes / onClick / tabindex |
| onError / catchError | <Errored> or createEffect(c, { effect, error }) |
| from(source) / observable | createMemo(() => from(source)); push out with createEffect |
Also:
- Reads lag writes:
setX(1); x()still returns the old value until the
microtask or flush(). In tests, flush() before asserting.
- Effects never compare: when the compute re-runs, apply and the previous
cleanup run again even if compute returned an equal value. To skip work on
an unchanged value, read a memo in the compute:
const active = createMemo(() => status() === "active"); createEffect(() => active(), v => ...).
The memo's equals (default ===) stops the re-run.
- No writes inside a memo, effect compute, or component body (dev throws).
Write from event handlers, onSettled, or actions.
- Writes in one synchronous frame land together: if one starts async work
(a navigation, a refetch), the rest are held with it. To land a write on
its own (close a menu before calling props.onSelect), wrap it in
onFlush(() => setOpen(false)). Not queueMicrotask or setTimeout.
- Hydration adopts server answers without re-asking, but runs each adopted
compute once to track reads with fake Promise/fetch that never settle.
Never store a promise or import() created inside a compute in a cache
that outlives it; cache resolved values, or start the load outside.
- No reactive reads at the top of a component body; read in JSX, a memo, an
effect's compute, or hand a hook an accessor (useThing(() => props.id);
JSX props still take values). Flow
callbacks (<For>, <Show>, <Match>) are owners, not tracking scopes:
read their accessor arguments in JSX, not at the top.
- Never use
untrackto silenceSTRICT_READ_UNTRACKED: the value still
goes stale, and the warning was the only sign. Move the read instead (see
that code's section in the diagnostics skill). Hooks and adapters take
accessors and read them inside their own memos and effects.
<For>: default gives a raw item and an index accessor;keyed={false}
gives an item accessor and a plain number. <Repeat>: i is a number.
onClick={cond() ? a : b}binds once; decide inside a stable handler.on:,oncapture:,attr:,bool:,use:andclassListon a native
element are compile errors; the message names the replacement above.
- Inputs aren't strictly controlled:
value={x()}writes only when the
binding re-runs — and a change to any other dynamic attribute in the same
template re-runs it (dev warns UNCOMMITTED_INPUT_OVERWRITTEN when that
erases typed text). Keep typing in a draft signal (onInput), commit on
onChange/submit; when a handler rejects input, also set
e.currentTarget.value = next (an unchanged signal won't revert the DOM).
Primitives to reach for
| Primitive | Use |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| createSignal(0) / createSignal(() => fetchUser(id())) | plain signal / writable derived value, sync or async; read by calling it |
| createMemo(() => fetchX(id())) | read-only derived value; a Promise result is pending until it lands |
| createProjection(async () => api.list(), [], { key: "id" }) | read-only derived store with keyed reconciliation |
| createOptimisticStore(() => api.list(), []) | store whose optimistic writes revert when the transition settles |
| action(function* (x) { write(); yield api.put(x); refresh(d); }) | mutation with transition coordination; optimistic writes go inside |
| until(() => confirmed(), { timeout }) | Promise that resolves when a predicate turns truthy; yield it in an action |
| isPending(() => d()) | true while a change to d is in flight (input changed or
Score breakdown
Assessment methodology
Version history
— Imported from GitHub solidjs/solid/packages/solid/skills/solid-2.0@7de4595