Home › SolidJS › SolidJS rules

SolidJS rules

Cursor rules for SolidJS 1.9 and SolidStart apps that keep fine-grained reactivity intact.

CursorSolidJS

How to use

Save this as .cursor/rules/solid.mdc in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

.cursor/rules/solid.mdcDownload  
---
description: SolidJS conventions
globs: ["src/**/*.{ts,tsx,jsx}"]
alwaysApply: false
---

# SolidJS

Solid is not React. Components run once; signals drive updates.

- State: `createSignal`, derived values as plain functions or `createMemo`, nested state with `createStore` + `produce`/`reconcile`.
- Never destructure props; read `props.x` or use `splitProps`/`mergeProps` so reactivity is kept.
- Read signals by calling them (`count()`) inside JSX or tracked scopes. Reading outside a tracked scope makes them static.
- Control flow: `<Show>`, `<For>` (by reference), `<Index>` (by index), `<Switch>/<Match>`. Don't use `array.map` for lists that change.
- Async data: `createResource`, or in SolidStart `query()` + `createAsync()`; mutations with `action()`.
- Side effects in `createEffect`; cleanup with `onCleanup`. DOM setup in `onMount`.
- Use `class` (not `className`) and `on:` / `onClick` handlers as the codebase already does.

## Don't
- Don't import from `react`, or add `useState`/`useEffect` patterns.
- Don't wrap everything in `createMemo`; plain derived functions are fine.

## Done when
`npm run typecheck`, `npx vitest run`, and `npm run build` pass.

More: all SolidJS rules · all Cursor rules

Related rules

Astro content site rules

Cursor rules for Astro 5 sites with content collections, islands, and zero-JS-by-default pages.

CursorAstro

Chrome extension (Manifest V3) rules

Cursor rules for building Manifest V3 browser extensions with TypeScript and minimal permissions.

CursorChrome extensions

Next.js App Router (TypeScript) rules

Cursor project rules for Next.js 15 App Router apps with TypeScript, Server Components, and Tailwind.

CursorNext.js

Nuxt 3 + Vue rules

Cursor rules for Nuxt 3 / Vue 3 apps using the Composition API, script setup and Pinia.

CursorVue / Nuxt

React Router 7 framework mode rules

Cursor rules for React Router 7 in framework mode (the Remix successor): loaders, actions, and type-safe routes.

CursorReact Router / Remix

React 19 + Vite SPA rules

Cursor rules for React 19 single-page apps on Vite 6+ with TypeScript, hooks, and Vitest.

CursorReact

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.