Svelte Core Best Practices
rilldata/rill
Rules for writing idiomatic Svelte 5 code: when to reach for runes like state, derived and effect, and how to handle props, attachments and bindings.
Pattern for implementing optimistic UI updates with effect-atom in this codebase.
$ npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install UsefulSoftwareCo/executor effect-atom-optimistic-updates --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/UsefulSoftwareCo/executor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.skills/effect-atom-optimistic-updates .claude/skills/effect-atom-optimistic-updates && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "effect-atom-optimistic-updates" agent skill from https://github.com/UsefulSoftwareCo/executor/tree/main/.skills/effect-atom-optimistic-updates into .claude/skills/effect-atom-optimistic-updates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "effect-atom-optimistic-updates", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/UsefulSoftwareCo/executor/tree/main/.skills/effect-atom-optimistic-updatesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install UsefulSoftwareCo/executor effect-atom-optimistic-updates --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/UsefulSoftwareCo/executor.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.skills/effect-atom-optimistic-updates .agents/skills/effect-atom-optimistic-updates && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "effect-atom-optimistic-updates" agent skill from https://github.com/UsefulSoftwareCo/executor/tree/main/.skills/effect-atom-optimistic-updates into .agents/skills/effect-atom-optimistic-updates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "effect-atom-optimistic-updates", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install UsefulSoftwareCo/executor effect-atom-optimistic-updates --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/UsefulSoftwareCo/executor.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.skills/effect-atom-optimistic-updates .cursor/skills/effect-atom-optimistic-updates && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "effect-atom-optimistic-updates" agent skill from https://github.com/UsefulSoftwareCo/executor/tree/main/.skills/effect-atom-optimistic-updates into .cursor/skills/effect-atom-optimistic-updates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "effect-atom-optimistic-updates", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/UsefulSoftwareCo/executor.git --path .skills/effect-atom-optimistic-updates--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install UsefulSoftwareCo/executor effect-atom-optimistic-updates --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/UsefulSoftwareCo/executor.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.skills/effect-atom-optimistic-updates .gemini/skills/effect-atom-optimistic-updates && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "effect-atom-optimistic-updates" agent skill from https://github.com/UsefulSoftwareCo/executor/tree/main/.skills/effect-atom-optimistic-updates into .gemini/skills/effect-atom-optimistic-updates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "effect-atom-optimistic-updates", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install UsefulSoftwareCo/executor effect-atom-optimistic-updatesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/UsefulSoftwareCo/executor.git skills-src && mkdir -p .github/skills && cp -r skills-src/.skills/effect-atom-optimistic-updates .github/skills/effect-atom-optimistic-updates && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "effect-atom-optimistic-updates" agent skill from https://github.com/UsefulSoftwareCo/executor/tree/main/.skills/effect-atom-optimistic-updates into .github/skills/effect-atom-optimistic-updates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "effect-atom-optimistic-updates", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install UsefulSoftwareCo/executor effect-atom-optimistic-updates --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/UsefulSoftwareCo/executor.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.skills/effect-atom-optimistic-updates .opencode/skills/effect-atom-optimistic-updates && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "effect-atom-optimistic-updates" agent skill from https://github.com/UsefulSoftwareCo/executor/tree/main/.skills/effect-atom-optimistic-updates into .opencode/skills/effect-atom-optimistic-updates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "effect-atom-optimistic-updates", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
effect-atom-optimistic-updatesPattern for implementing optimistic UI updates with effect-atom in this codebase.
Effect Atom Optimistic Updates is an agent skill from UsefulSoftwareCo/executor. Pattern for implementing optimistic UI updates with effect-atom in this codebase. Use when adding optimistic behavior to a query atom + its mutations (action toggles, list adds/removes, inline edits). DO NOT roll your own pending-state with React state, Maps, or custom merge helpers — Atom.optimistic + Atom.optimisticFn already handle racing, refresh, and waiting correctly.
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Frontend & Design, covering State management. The repository describes itself as: The missing integration layer for AI agents. Let them call any OpenAPI / MCP / GraphQL / custom js functions in secure environment. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 27dccb8. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Effect Atom Optimistic Updates loads about 2.5k tokens when it runs. Until then it costs about 103 tokens; SKILL.md has 811 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from UsefulSoftwareCo/executor at commit 27dccb8, republished under its MIT licence (© UsefulSoftwareCo). 811 words, ~2,540 tokens.
.claude/skills/effect-atom-optimistic-updates/SKILL.md (or your agent's skills folder).The @effect-atom/atom-react library ships first-class optimistic support via
Atom.optimistic and Atom.optimisticFn. Use them directly. Do not write a
custom "pending entries" layer (Maps, useState, useRef) on top of useAtomValue
— it will not handle racing updates correctly, and the existing helpers in
packages/react/src/api/optimistic.tsx are legacy patterns kept only for
sources/connections.
Atom.optimistic wraps the query)If you only need the UI to be "eventually consistent" (i.e. you're fine waiting
~200ms for the server response and the existing reactivity refetch), skip
optimistic — just use the mutation directly with reactivityKeys.
The naive approach — track pending: Array<{id, value}> in a separate atom and
merge it with the server result — has a subtle race that bites on rapid edits:
Step 3 is the bug. Fixing it correctly requires per-call entry ids and "last
entry per row id wins" merging — at which point you've reimplemented a worse
version of Atom.optimistic's transition tracking.
Atom.optimistic solves this because the runtime reads the current optimistic
state (including any in-flight transitions) and passes it to your reducer as
current, so B stacks on top of A correctly. When all transitions settle, it
calls refresh(self) to pull the server's authoritative state.
Define optimistic atoms next to the underlying query and mutations in the
atoms.tsx (or equivalent) module. Each scope-keyed list gets a family that
wraps the query with Atom.optimistic, and each mutation gets a family that
pipes the optimistic atom through Atom.optimisticFn with a reducer.
import { Atom, Result } from "@effect-atom/atom-react";
import type { ScopeId, PolicyId, ToolPolicyAction } from "@executor/sdk";
import { ExecutorApiClient } from "./client";
// 1. The plain query atom — same as before.
export const policiesAtom = (scopeId: ScopeId) =>
ExecutorApiClient.query("policies", "list", {
path: { scopeId },
timeToLive: "30 seconds",
reactivityKeys: [ReactivityKey.policies],
});
// 2. Plain mutations — same as before. These are the underlying `fn` for
// the optimistic wrappers below.
export const createPolicy = ExecutorApiClient.mutation("policies", "create");
export const updatePolicy = ExecutorApiClient.mutation("policies", "update");
export const removePolicy = ExecutorApiClient.mutation("policies", "remove");
// 3. Optimistic read atom. `Atom.family` memoizes per-scope so every consumer
// references the same optimistic atom instance and shares transition state.
export const policiesOptimisticAtom = Atom.family((scopeId: ScopeId) =>
Atom.optimistic(policiesAtom(scopeId)),
);
// 4. Optimistic mutation. The reducer takes the same arg as the underlying
// mutation and returns the next list state. `Result.map` keeps the
// Result wrapper intact.
export const updatePolicyOptimistic = Atom.family((scopeId: ScopeId) =>
policiesOptimisticAtom(scopeId).pipe(
Atom.optimisticFn({
reducer: (
current,
arg: {
path: { scopeId: ScopeId; policyId: PolicyId };
payload: { action?: ToolPolicyAction };
reactivityKeys?: ReadonlyArray<unknown>;
},
) =>
Result.map(current, (rows) =>
rows.map((r) =>
r.id === arg.path.policyId && arg.payload.action !== undefined
? { ...r, action: arg.payload.action }
: r,
),
),
fn: updatePolicy,
}),
),
);Read from the optimistic atom; write through the optimistic mutation. The
existing reactivityKeys plumbing still applies — pass them in the call.
import { useAtomValue, useAtomSet } from "@effect-atom/atom-react";
import { policiesOptimisticAtom, updatePolicyOptimistic } from "../api/atoms";
import { policyWriteKeys } from "../api/reactivity-keys";
export function PoliciesPage() {
const scopeId = useScope();
// Read: this Result reflects in-flight optimistic state on top of server data.
const policies = useAtomValue(policiesOptimisticAtom(scopeId));
// Write: same call signature as the underlying mutation.
const doUpdate = useAtomSet(updatePolicyOptimistic(scopeId), { mode: "promise" });
const handleUpdate = async (id: string, action: ToolPolicyAction) => {
await doUpdate({
path: { scopeId, policyId: PolicyId.make(id) },
payload: { action },
reactivityKeys: policyWriteKeys,
});
};
// ...
}current is the FULL Result, not the unwrapped value. Use Result.map
to update inside the success case — the wrapper preserves Initial/Failure
states correctly.current and produce next — don't track
"the previous optimistic value" yourself.{ path, payload, reactivityKeys }) to
both the reducer and the underlying fn. Don't try to build a "nicer" arg
shape unless you also wrap the underlying mutation.Date.now() for stable values,
no random ids unless you need a placeholder row id (see "Adds" below).For create flows the server assigns the canonical id. The reducer inserts a placeholder with a temp id — the post-commit refresh replaces it with the canonical row.
export const createPolicyOptimistic = Atom.family((scopeId: ScopeId) =>
policiesOptimisticAtom(scopeId).pipe(
Atom.optimisticFn({
reducer: (
current,
arg: {
path: { scopeId: ScopeId };
payload: { pattern: string; action: ToolPolicyAction };
reactivityKeys?: ReadonlyArray<unknown>;
},
) =>
Result.map(current, (rows) => [
{
id: PolicyId.make(`pending-${Math.random().toString(36).slice(2)}`),
scopeId,
pattern: arg.payload.pattern,
action: arg.payload.action,
position: -Number.MAX_SAFE_INTEGER, // sort to top
createdAt: Date.now(),
updatedAt: Date.now(),
},
...rows,
]),
fn: createPolicy,
}),
),
);The placeholder doesn't need to roundtrip through the id field unless your
list rendering keys on it (it usually does — <Row key={p.id}>). A unique
prefix like pending- is fine.
export const removePolicyOptimistic = Atom.family((scopeId: ScopeId) =>
policiesOptimisticAtom(scopeId).pipe(
Atom.optimisticFn({
reducer: (
current,
arg: {
path: { scopeId: ScopeId; policyId: PolicyId };
reactivityKeys?: ReadonlyArray<unknown>;
},
) => Result.map(current, (rows) => rows.filter((r) => r.id !== arg.path.policyId)),
fn: removePolicy,
}),
),
);You don't have to think about this — it works — but understanding helps:
Atom.optimistic(self) wraps the underlying atom and tracks a transitions setAtom.optimisticFn call creates one shared transition state per (scope, mutation)reducer(current, arg) → value, sets transition to Success(value, waiting=true), calls the underlying mutation fn with argcurrent — so it stacks on topfn settles, both calls' subscribers fire, the transition flips to non-waiting, and refresh(self) pulls the server stateNet result: rapid edits look smooth, the last edit wins both visually and on the server, no flickers, no manual cleanup.
useState/useRef to hold pending valuesMap / Set of in-flight idsmergePending helperstry/finally blocks that "clear the placeholder" — optimistic clears for youpoliciesAtom directly in the component while writing through updatePolicyOptimistic — they have different transition state, you'll see jumpspackages/react/src/api/atoms.tsx (search for policiesOptimisticAtom) and
packages/react/src/pages/policies.tsx show the full pattern: optimistic
read, optimistic create/update/remove, no custom state.
tools AND policies). Reactivity keys
still handle that — optimistic only paints the list-local change.© UsefulSoftwareCo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .skills/effect-atom-optimistic-updates of UsefulSoftwareCo/executor.
Open the folder on GitHubat commit 27dccb8
Effect Atom Optimistic Updates next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Effect Atom Optimistic Updates this skillUsefulSoftwareCo/executor | 4.1k | — | ~2.5k | Automated safety check: Pass | MIT | |
| Svelte Core Best Practicesrilldata/rill | 2.9k | 4 repos | ~1.8k | Automated safety check: Pass | Apache-2.0 | |
| Dify Component Writing Guidelanggenius/dify | 158k | — | ~626 | Automated safety check: Pass | Custom licence | |
| GPUI Kit Desktop App GuideAprilNEA/OpenLogi | 23k | — | ~5.5k | Automated safety check: Pass | Apache-2.0 | |
| React State Managementinvolvex/youtube-music-cli | 456 | 12 repos | ~3k | Automated safety check: Pass | MIT | |
| Pierre Theming Librarypierrecomputer/pierre | 6.2k | — | ~661 | Automated safety check: Pass | Apache-2.0 |
rilldata/rill
Rules for writing idiomatic Svelte 5 code: when to reach for runes like state, derived and effect, and how to handle props, attachments and bindings.
langgenius/dify
Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…
AprilNEA/OpenLogi
Guides building Rust desktop apps with the gpui-kit crate, covering component selection, state ownership, theming and overlays, plus normative GPUI coding rules.
involvex/youtube-music-cli
Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query.
pierrecomputer/pierre
Explains how to use the @pierre/theming package to list, resolve, select, switch and persist themes, with controller, color and React references.
kurealnum/dotfiles
Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.
UsefulSoftwareCo/executor
Pattern for wrapping third-party SDK clients (Stripe, Resend, AWS, etc.) with Effect.
UsefulSoftwareCo/executor
Runbook for releasing the executor CLI package (stable and beta).
UsefulSoftwareCo/executor
Testing Effect HttpApi services end-to-end. An agent skill from UsefulSoftwareCo/executor.
UsefulSoftwareCo/executor
Use the @executor-js/emulate service emulators (GitHub, Google, Stripe, Resend, WorkOS, …) to test integrations for real — full OpenAPI specs, working OAuth flows, mintable credentials, and a…
UsefulSoftwareCo/executor
Query Executor's production telemetry — Axiom traces (executor-cloud dataset), prod Postgres via PlanetScale, PostHog product analytics — through the Executor MCP.
UsefulSoftwareCo/executor
Build modals/dialogs self-contained: form and in-flight state lives inside, closing unmounts it.
Categories
Pattern for implementing optimistic UI updates with effect-atom in this codebase. Effect Atom Optimistic Updates is an agent skill from UsefulSoftwareCo/executor. Pattern for implementing optimistic UI updates with effect-atom in this codebase.
Effect Atom Optimistic Updates fits situations like: adding optimistic behavior to a query atom + its mutations (action toggles; list adds/removes.
Run `npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a claude-code`. Or copy the skill folder (.skills/effect-atom-optimistic-updates in UsefulSoftwareCo/executor) into .claude/skills/effect-atom-optimistic-updates in your project. Claude Code loads it when a task matches its description.
Run `npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a codex`. Or copy the skill folder (.skills/effect-atom-optimistic-updates in UsefulSoftwareCo/executor) into .agents/skills/effect-atom-optimistic-updates in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add UsefulSoftwareCo/executor --skill effect-atom-optimistic-updates -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/effect-atom-optimistic-updates, .gemini/skills/effect-atom-optimistic-updates, .github/skills/effect-atom-optimistic-updates and .opencode/skills/effect-atom-optimistic-updates in your project.
SKILL.md names no scripts, command-line tools or credentials: Effect Atom Optimistic Updates is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Effect Atom Optimistic Updates is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Effect Atom Optimistic Updates: Svelte Core Best Practices (rilldata/rill, 2.9k stars), Dify Component Writing Guide (langgenius/dify, 158k stars), GPUI Kit Desktop App Guide (AprilNEA/OpenLogi, 23k stars) and React State Management (involvex/youtube-music-cli, 456 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
UsefulSoftwareCo (a GitHub organization) maintains it in UsefulSoftwareCo/executor, which has 4,085 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 7, 2026.
Source: UsefulSoftwareCo/executor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.