solid-standards
Use when building a SolidJS app in a touchstone repo — signals/stores, props, control flow, resources, context, SolidStart SSR/routing/server functions. Triggers on `solid-js`/`@solidjs/start` in package.json, .tsx using Solid (createSignal/createStore), app.config.ts, src/routes. Language-level TS rules live in the typescript skill; for React (VDOM, hooks, re-render) use the react skill.
- License 许可
- MIT
- 最近更新
- 2026-08-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- solid-standards
- license
- MIT
- metadata
- { "author": "touchstone", "version": "0.2.0" }
- description
- Use when building a SolidJS app in a touchstone repo — signals/stores, props, control flow, resources, context, SolidStart SSR/routing/server functions. Triggers on `solid-js`/`@solidjs/start` in package.json, .tsx using Solid (createSignal/createStore), app.config.ts, src/routes. Language-level TS rules live in the typescript skill; for React (VDOM, hooks, re-render) use the react skill.
03 SKILL.md 正文
SolidJS (framework)
Full standard: standards/frameworks/solid.md (layers on standards/languages/typescript.md).
Load-bearing rules:
Always
- The signal is the unit of reactivity, not the component. Components run once; only memos, effects, and JSX expressions re-run. Read signals by calling them (
count()), and keep that read inside the JSX/memo/effect that should react. - Derived state is
createMemo, never acreateEffectthat writes the signal it reads.createStorefor nested/shared trees (path updates,produce/reconcile); signals for leaf values. - Control flow is components:
<For>/<Index>/<Show>/<Switch>, not.map/ternaries. Async data iscreateResource/createAsyncunder<Suspense>+<ErrorBoundary>, Zod-parsed at the fetcher. - SolidStart:
"use server"functions are public endpoints — validate (Zod) + authorize every call; read viaquery+createAsyncfrom a routepreload, mutate viaaction, revalidate thequerykey surgically.
Don't get burned
- Never destructure or spread props into an object — props are getter-backed; destructuring reads them once and severs reactivity. Use
splitPropsto split,mergePropsfor defaults, spread{...rest}only into JSX. Stores have the same rule — never destructure a store. - No render loop. React intuition (deps arrays, re-render,
useEffectsetup) does not transfer — reading a signal once at the top of a factory freezes it; a lost-reactivity bug looks like "slow rendering" but the fix is restoring the getter chain, not memoizing. - Pair every subscription/timer with
onCleanup; one-time DOM setup goes inonMount, notcreateEffect.
Done
biome ci · tsc · vitest (+ @solidjs/testing-library) green; no destructured props/stores; derived state via memos; server functions validate + authorize. See standards/frameworks/solid.md.
04 同仓库更多 Skills
ok-standards
Use when writing shell, per standards/languages/shell.md.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.