agentleFS
solidjssolidjs/solid/.cursor/rules/signals.mdc

solid / rules

Cursor rule37k starsChanged 12 days agoMITView on GitHub

Signals engine internals — core reactivity, async, stores, optimistic lanes, and the size/testing discipline for changing them

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 7 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the solidjs/solid repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about solidjs/solid

The biggest 5 of 21 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 21

Talked about on YouTube, Hacker News, GitHub and Bluesky (21 times).

On YouTube · 7

2 more on YouTube

On Hacker News · 5

On GitHub · 5

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 4,373 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

We split this signals.mdc into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Downstream tests consume built dist: After changing signals, pnpm --filter @solidjs/signals build and pnpm --filter solid-js build BEFORE …

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
signals.mdc
---
description: Signals engine internals — core reactivity, async, stores, optimistic lanes, and the size/testing discipline for changing them
globs: packages/signals/**
alwaysApply: false
---

# Solid Signals (`@solidjs/signals`)

## Source Map

- **`src/core/`** — the engine: `core.ts` (nodes, read/write, recompute), `scheduler.ts` + `heap.ts` (height-ordered flush), `effect.ts`, `async.ts` (promise/iterable protocols, `handleAsync`), `verdict.ts` (`isPending`/`latest`, pending-signal companions, latest shadows), `optimistic.ts` + `lanes.ts` (optimistic lane engine — pay-for-use, installed on first use), `owner.ts`/`context.ts`, `error.ts` (`NotReadyError`), `constants.ts` (STATUS_* flags), `invariants.ts` (dev checks).
- **`src/store/next/`** — the store: `store.ts` (proxy traps, targets, folds), `projection.ts`, `optimistic.ts`, `reconcile.ts`, `target.ts`.
- **`src/signals.ts`**, `boundaries.ts`, `affects.ts`, `map.ts` — public primitives layered on core.

## Load-Bearing Semantics (pinned by tests and rulings — don't relearn these)

- **Where the async rules live.** Read them in this order and let the earlier tier win: `docs/RULES-FUNDAMENTALS.md` (eleven immutable statements of visible behavior, `F-<n>`) → `docs/RULES-DERIVED.md` (how each applies to a shape, `D-<n>`) → `docs/SCENARIOS.md` (the screens, `S-<n>`). `docs/SPEC-ASYNC-SEMANTICS.md` is the frozen archive: the old ruling log. Never cite its A/B/C/V ids in new code, tests or PRs; cite the F-/D- successor from its banner table, and an archive entry never overrides a fundamental or a derived rule. A case that seems to need a contradiction goes to the maintainer as a screen sequence in `docs/OPEN-QUESTIONS.md`, not as a quiet amendment.
- **Suspension**: an unresolved async read throws `NotReadyError`; `STATUS_UNINITIALIZED` marks never-resolved nodes and is repeatedly special-cased — first flight is NOT a refetch (no truth to keep on screen). Uninitialized sources suspend even across optimistic lanes (#3276); initialized ones serve committed stale.
- **`latest()`**: subscribes through an `optimisticComputed` shadow (the reader becomes a lane consumer). Serves committed truth; suspends for tracked readers when the source is uninitialized.
- **Store targets**: `.v` committed backing, `.pb` pending (draft) backing. Plain objects fold via prototype **overlay** in place; families (projection/optimistic) and arrays fold via the **clone path** (swap + parent-slot CAS). A fold finding its container privatized mid-batch must MERGE written keys onto it, not swap (#3271). `wk` is the written-keys bound (`WK_ALL` = poisoned by array length writes); `tentativePBs` marks draft-owned backings for the compose gate (#2951).
- **Optimistic**: user writes become node-level overrides; drafts seed from the optimistic view (compose, not clobber). Landings staged under retaining transactions fold atomically (#3164).

## Changing This Package — Checklist

1. **Bundle size is budgeted.** Scenarios and ratcheted caps live in `scripts/size/scenarios.js`, bundled with Rolldown (run `npm run size` from `scripts/size/` after `pnpm build:js`); the floor and page caps in `scripts/size/floor-caps.json` are frozen. Every cap bump needs an audit note there. Restructuring golf is measured NO-WIN (brotli compresses repeats free; indirection adds unique tokens — 2026-09-04 notes). The winning move is **relocation into pay-for-use modules** (e.g. the optimistic module) so floor bundles don't pay.
2. **Two gates, three tiers.** Checks (strict reads, invariants, forbidden scopes, console reporting, dev-only error text) go under `__DEV__` — dev builds only. Wiring (attribution hook call sites, `_name` labels, graph edge counters, `emitDiagnostic`) goes under `__OBSERVE__` — dev AND the `dist/observe` tier, which production observability consumers select via the `observe` export condition. `__DEV__` implies `__OBSERVE__` (dev.ts asserts it). Prod folds both — free. The observe tier has its own size scenario; the prod scenarios must not move because of it. Public surface: `OBSERVE` (diagnostics channel + the attribution hook slot and interaction frame, observe-legal) vs `DEV` (devtools hooks, graph getters, console face). The attribution ENGINE is the separate `@solidjs/signals/attribution` entry (`src/attribution.ts`; prod resolves the inert `src/attribution.prod.ts`): nothing in the core may import `core/attribution.ts`, or the observe tier ships the engine to consumers that never enable it. Every build has two entries (`index` + `attribution`) sharing one module instance — the flat dev build is code-split for exactly this. Artifacts are ESM only (`dist/prod/`, `dist/observe/`, `dist/dev*.js`; no `.cjs`, no `require` branch): Node >= 22.12 `require()`s ESM, so a CJS host gets the same files — which is why no shipped module may contain a top-level `await` (`tests/dist-artifacts.test.ts` scans for it and `require`s each tier). See `documentation/archive/plans/observe-tier-plan.md`.
3. **Downstream tests consume built dist.** After changing signals, `pnpm --filter @solidjs/signals build` and `pnpm --filter solid-js build` BEFORE running `packages/solid` or `packages/web` tests — stale dist has caused false regression alarms repeatedly.
4. **Facades mirror types.** Store/signal API type changes must be applied in `packages/solid/src/client/hydration.ts` and `packages/solid/src/server/signals.ts` too.
5. Internal fields are mangled at build (`scripts/mangle-props.mjs`) in the prod and observe trees; keep the `_`-prefix convention. `_name` is the one reserved (unmangled) field — solid-js writes component labels onto signals' owners through it. `check-pure` verifies `/*#__PURE__*/` annotation count.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.