agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/frameworks/solidjs/SKILL.md

solidjs

Skill15 starsChanged 42 days agoMITView on GitHub

Expert SolidJS assistance covering fine-grained reactivity, signals, zero Virtual DOM, and SolidStart. Use when building high-performance reactive web applications.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Use createStore for deep nested mutations:

    line 131
  2. Very specific:

    Use <For> and <Show> instead of .map() or ternary operators to minimize unnecessary DOM recreations.

    line 168
  3. Very specific:

    Use createResource for async data loading with <Suspense>.

    line 170
  4. Very specific:

    Call onCleanup inside effects and primitives to clear timers and event listeners.

    line 171
  5. Very specific:

    Update signals inside createMemo.

    line 176
  6. Distinctive:

    Use Virtual DOM assumptions (like re-rendering whole component trees).

    line 177

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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
SKILL.md

SolidJS

SolidJS is a declarative JavaScript library for building user interfaces without a Virtual DOM, compiling templates to direct DOM operations powered by fine-grained Signals reactivity.

When to Use

  • High-Performance Reactive Web Applications: Fine-grained reactivity without Virtual DOM overhead.
  • Real-Time Dashboards & Data Streaming: Rapid UI updates directly mapped to granular DOM mutations.
  • Low-Memory Resource-Constrained Devices: Embedded screens, smart TVs, and low-end mobile devices.
  • SolidStart Full-Stack Web Development: Building SSR/SSG full-stack applications with JSX simplicity.

Quick Start

import { createSignal, onCleanup } from "solid-js";

export function Counter() {
  const [count, setCount] = createSignal(0);
  const timer = setInterval(() => setCount((c) => c + 1), 1000);
  onCleanup(() => clearInterval(timer));

  return <div>Count: {count()}</div>;
}

Core Concepts

Fine-Grained Reactive Primitives: Signals & Memos

Components execute only once; signals trigger targeted DOM node updates:

import { createSignal, createMemo, createEffect, onCleanup } from "solid-js";

export function Counter() {
  const [count, setCount] = createSignal(0);
  const doubleCount = createMemo(() => count() * 2);

  createEffect(() => {
    console.log(`Current count: ${count()}, Doubled: ${doubleCount()}`);
  });

  const timer = setInterval(() => setCount((c) => c + 1), 1000);
  onCleanup(() => clearInterval(timer));

  return (
    <div class="p-4 border rounded">
      <h3>Count: {count()}</h3>
      <p>Double: {doubleCount()}</p>
      <button onClick={() => setCount((c) => c + 1)}>Increment</button>
    </div>
  );
}

Asynchronous Data with createResource & Suspense

Declarative async data fetching with Suspense boundaries:

import { createResource, Suspense } from "solid-js";

interface UserProfile {
  id: number;
  name: string;
}

const fetchUser = async (id: number): Promise<UserProfile> => {
  const res = await fetch(`https://jsonplaceholder.typicode.com/users/${id}`);
  return res.json();
};

export function UserView(props: { userId: number }) {
  const [user] = createResource(() => props.userId, fetchUser);

  return (
    <Suspense fallback={<p>Loading user profile...</p>}>
      <div>
        <h3>{user()?.name}</h3>
        <p>User ID: {user()?.id}</p>
      </div>
    </Suspense>
  );
}

Control Flow with For, Show, and Switch

Optimized DOM rendering primitives replacing array .map():

import { For, Show } from "solid-js";

export function ProductList(props: {
  products: { id: number; name: string; inStock: boolean }[];
}) {
  return (
    <div>
      <Show
        when={props.products.length > 0}
        fallback={<p>No products found.</p>}
      >
        <ul>
          <For each={props.products}>
            {(product) => (
              <li>
                {product.name} -{" "}
                {product.inStock ? "Available" : "Out of Stock"}
              </li>
            )}
          </For>
        </ul>
      </Show>
    </div>
  );
}

Common Patterns

Fine-Grained Reactive Store for Complex Objects

Problem: Re-rendering an entire list when only a single property of one item changed.

Solution: Use createStore for deep nested mutations:

import { createStore } from "solid-js/store";

export function TodoApp() {
  const [todos, setTodos] = createStore([
    { id: 1, text: "Learn SolidJS", done: false },
    { id: 2, text: "Build App", done: false },
  ]);

  const toggleTodo = (id: number) => {
    setTodos(
      (todo) => todo.id === id,
      "done",
      (done) => !done
    );
  };

  return (
    <ul>
      <For each={todos}>
        {(todo) => (
          <li onClick={() => toggleTodo(todo.id)}>
            {todo.text} - {todo.done ? "✓" : "○"}
          </li>
        )}
      </For>
    </ul>
  );
}

Best Practices

Do:

  • Use <For> and <Show> instead of .map() or ternary operators to minimize unnecessary DOM recreations.
  • Remember that Solid components run only once; never destructure props directly (use props.title or mergeProps).
  • Use createResource for async data loading with <Suspense>.
  • Call onCleanup inside effects and primitives to clear timers and event listeners.

Don't:

  • Destructure props in component argument signatures; it breaks fine-grained reactivity tracking.
  • Update signals inside createMemo; memos must remain pure derivation functions.
  • Use Virtual DOM assumptions (like re-rendering whole component trees).

Troubleshooting

ErrorCauseSolution
Signal value not updating in UIDestructuring props or signals, breaking reactive tracking.Access props directly (props.name) or use splitProps().
TypeError: count is not a functionAccessing signal as a raw value instead of calling getter count().Call signal as function: count().
Component function executes only onceSolid components are setup functions, not render functions.Place reactive logic inside effects or JSX getters, not bare component body.

References

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.