solid-optimizer
Skill1 starsChanged 8 days agoMITView on GitHub
Audit and optimize SolidJS and SolidStart apps (Solid 1.9 stable, SolidStart 2.2, Solid Router 1, Vite 8/9, Node 24+) for signal/effect misuse, lost prop reactivity, resource and query waterfalls, SSR/prerender/SPA choices, router cache/actions/revalidation, bundle size, hydration and deployment, with real before/after measurement. Also flags legacy SolidStart v1/Vinxi and the Solid 2.0 RC migration path. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow Solid app, SolidStart, createSignal/createMemo/createEffect, createResource, query/createAsync/action, lost reactivity, SSR/prerender/SPA, hydration mismatch, bundle size, SolidStart v1 to v2, Vite/Nitro deployment, or "optimize my Solid code" -- even if they never say "audit" or "optimize".
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architecture-optimizerSkill
- csharp-optimizerSkill
- cpp-optimizerSkill
- c-optimizerSkill
- go-optimizerSkill
- node-service-optimizerSkill
- ruby-optimizerSkill
- rust-optimizerSkill
- docker-optimizerSkill
- kubernetes-optimizerSkill
- terraform-optimizerSkill
- animate-cssSkill
- animejsSkill
- auto-animateSkill
- gsapSkill
- lenisSkill
- magicuiSkill
- motionSkill
- react-moveSkill
- react-springSkill
- react-three-fiberSkill
- theatrejsSkill
- threejsSkill
- optimizer-routerSkill
- bootstrap-optimizerSkill
- pandacss-optimizerSkill
- sass-scss-optimizerSkill
- stylex-optimizerSkill
- tailwindcss-optimizerSkill
- twind-optimizerSkill
- unocss-optimizerSkill
- vanilla-extract-optimizerSkill
- angular-optimizerSkill
- astro-optimizerSkill
- ui-components-optimizerSkill
- nextjsSkill
- node-optimizerSkill
- nuxt-optimizerSkill
- react-optimizerSkill
- remix-optimizerSkill
- svelte-optimizerSkill
- tanstack-start-optimizerSkill
- vue-optimizerSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Run python <skill-dir>/scripts/audit.py <project-root> -- static scan of package.json, vite.config.*, app.config.*, routes, data modules …
- Very specific: line 17
Read references/tooling.md once: what can be measured here (vite build, vite preview, Solid DevTools, Network, Lighthouse).
- Very specific: line 43
Use plan mode: EnterPlanMode (load with ToolSearch if deferred), write the plan, present with ExitPlanMode.
- Distinctive: line 60
Components run once: Don't hunt for re-renders.
- Very specific: line 61
Props are getters: Never destructure props; read props.x (or mergeProps/splitProps) so updates stay reactive.
- Distinctive: line 69
Docs move: Check docs.solidjs.com for the installed Solid/SolidStart version, not memory.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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.
Files
Solid Optimizer
Audit a Solid/SolidStart codebase, report what is slow or fragile and why, agree a plan with the user, then fix it. Order: evidence, approval, edits. Solid components run once and update through fine-grained signals, so most "render" optimizations do not apply; the real risks are lost reactivity, effect loops, async waterfalls, SSR/hydration choices and router cache behavior. Nothing is edited before approval.
Workflow
1. Scope (quick)
- Find the root (
package.jsonwithsolid-jsand/or@solidjs/start). Record: Solid major (1.9 stable; 2.0 RC is experimental), SolidStart version (2.x current; v1 uses Vinxi), router version, Vite version, Node runtime, rendering mode (SSR/prerender/SPA), deployment plugin (Nitro/Cloudflare/Netlify), and whether Solid Routerquery/actionis used. - Run
python <skill-dir>/scripts/audit.py <project-root>-- static scan ofpackage.json,vite.config.*,app.config.*, routes, data modules and components for legacy Vinxi/v1, lost props, effect/resource waterfalls, server-only leakage, query/action misuse and bundle risks, with file:line evidence. Use--jsonto post-process. - Classify the pain: slow first load (SSR/bundle), slow navigation (query/preload/cache), slow mutations (actions), hydration/CLS, server latency, or code health/migration. Ask which hurts if unclear.
- Read
references/tooling.mdonce: what can be measured here (vite build,vite preview, Solid DevTools, Network, Lighthouse).
2. Audit
The script finds cheap leads; you find the rest by reading. Read vite.config.*, src/routes (the hot routes), the data modules with query/action, the root app/entry files, and any component with effects or resources. Load only what applies:
| Area | Reference |
| Signals, memos, effects, props, stores, lists, resources | references/reactivity.md |
| File routes, API routes, middleware, sessions, prerender | references/solidstart.md |
| query/createAsync/action, cache/revalidation, SSR data | references/data-router.md |
| Vite build, code splitting, assets, SSR/hydration, deploy | references/bundle-ssr.md |
| XSS, server-only/client-only, auth/CSRF, types/tests, v1→v2 | references/safety-quality.md |
| Solid 2.0 RC and Start mode migration | references/solid-2.md |
| Measurement and honest reporting | references/tooling.md |
Measure, never guess. Build and run the production server (vite build + vite preview, or the Nitro/Cloudflare/Netlify preview), then measure that. Dev mode and a single warm route are not evidence. Record route JS, SSR TTFB/HTML, query/action timings, hydration and LCP/CLS.
Mark each finding Confirmed (build output, network/profiler, code evidence) or Suspected (needs measuring).
3. Report
Fill assets/report-template.md, save it as SOLID_OPTIMIZATION_REPORT.md in the project root, and show the user. Five-line summary, findings table by impact/effort, then per-finding detail (evidence, why it hurts, fix, risk, behavior impact). Group near-duplicates.
4. Plan -- then stop for approval
Use plan mode: EnterPlanMode (load with ToolSearch if deferred), write the plan, present with ExitPlanMode; if unavailable show it in chat and wait for an explicit "go". Structure:
- Quick wins -- route
preloadfor hot data, query keys/revalidation,deferStream,For/Indexcorrections, props access instead of destructuring, remove effect-driven derived state, lazy-load heavy widgets, preload the LCP image/font, prerender static routes. Low risk. - Structural -- move fetch out of effects/components into
query/action, split slow routes, stream non-critical data with Suspense, batch N+1 queries, addserver-onlyboundaries, move session/auth into server functions, migrate middleware order. Name each behavior change. - Heavy -- SolidStart v1/Vinxi to v2, Vite/Nitro v3 deployment migration, Solid 2.0 RC adoption, Start mode, bundler/architecture change. Separately approved. Each step: files touched, expected effect, how to verify, how to roll back.
5. Fix
Only approved items, in small groups. After each: typecheck (tsc --noEmit), lint, tests, vite build, then the production preview/server. A break must trace to one change. Do not mix a SolidStart/Solid major upgrade with optimization edits. If a change moves auth/session/server data across the client boundary, changes SSR/prerender output, or alters a query cache key, stop and ask.
6. Verify and wrap up
Re-measure the same routes: route JS, SSR TTFB, query/action latency, navigation requests, hydration, LCP/INP/CLS. State plainly what could not be measured. End with deferred items and one suggested next step.
Principles
- Components run once. Don't hunt for re-renders; hunt for unnecessary effects, lost reactivity and expensive computations.
- Props are getters. Never destructure props; read
props.x(ormergeProps/splitProps) so updates stay reactive. - Derive with memos, not effects. Effects are for external side effects; an effect that writes state is usually a derived value.
- Data belongs in the router.
query+createAsync+route.preloadfor reads,actionfor writes; resource/fetch in components creates waterfalls. - Server code stays server.
"use server",server-only, and@solidjs/start/httpmust not reach client components. - Cache keys are correctness. A query name/argument change changes the cache key; revalidate the keys a mutation affects.
- Prerender what can be static. SSR/prerender first; SPA adds round trips before content.
- Ship less JavaScript. Route-level code splitting, lazy heavy widgets, per-import libraries.
- Versions move. Solid 1.9 + SolidStart 2.2 is the stable stack; Solid 2 RC and Start mode are migration projects, not drop-in tweaks.
- Docs move. Check docs.solidjs.com for the installed Solid/SolidStart version, not memory.
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
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.

