Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add LegendApp/legend-skills --skill legend-state-best-practicesgit clone --depth 1 https://github.com/LegendApp/legend-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/legendapp/legend-skills/legend-state-best-practices)<a href="https://agentmods.dev/skills/legendapp/legend-skills/legend-state-best-practices"><img src="https://agentmods.dev/badge/skills/legendapp/legend-skills/legend-state-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/legendapp/legend-skills/legend-state-best-practices"><img src="https://agentmods.dev/badge/skills/legendapp/legend-skills/legend-state-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00075 | $0.01821 |
| Opus 5 | $0.00037 | $0.00911 |
| Sonnet 5 | $0.00015 | $0.00364 |
| Haiku 4.5 | $0.00007 | $0.00182 |
Grade A, and why
legend-state-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Legend State Best Practices
Use Legend State to put reactive ownership at the smallest useful boundary.
Verify The Surface
Before changing code:
- Check the installed
@legendapp/stateversion, imports, nearby store helpers, persistence setup, and tests. - Consult the current docs for exact signatures and version-specific migration guidance:
- Search for existing store factories, typed field hooks, reactive components, and naming conventions before adding a new abstraction.
- Identify values that must update rendered UI separately from values read only by commands, callbacks, native bridges, or async work.
This skill is policy, not an API reference. Prefer the installed version's source and types when docs and code differ.
Choose The Mode
- Build: choose observable ownership, render subscriptions, effects, persistence or sync boundaries, and validation before writing code.
- Audit: inspect ownership, subscription breadth, non-reactive reads, React-to-observable mirrors, effects, persistence, and hot paths; report only concrete findings, ranked by impact and confidence.
- Fix: run the same audit and state a ranked plan. Before a non-trivial ownership, persistence, or broad render change, wait for explicit approval such as
go; after approval, change the proven misuse in reviewable slices and verify the affected subscriptions and behavior. Stop when the correct model requires a product decision or materially larger scope.
For audits, trace each finding from the mutation source through the tracked read to the component or effect that updates. Do not label an observable read broad or expensive without identifying the subscribers it wakes and the rendered value they consume.
Ownership
- Use observables for shared UI, session, settings, document, selection, and command state with many narrow consumers.
- Use
useObservablefor component-lifetime state when nested UI needs field-level reactivity or handlers need a stable observable handle. - Keep one-off local UI state in React when it has no broader ownership, imperative-read, or render-fanout need.
- Store canonical data once. Derive display values with a selector, computed observable, or local render calculation.
- Reuse existing observable references. Do not pass an observable to
observableoruseObservable, or place it inside another observable merely for ownership, stability, or context. Nest one only when intentionally creating a link whose reads and writes forward to the source. - Keep one canonical owner; do not mirror between React and observable state. If downstream code needs observable state, replace the originating React state. Bridge only at a true external integration such as native APIs, storage, or measurement.
- Keep routing, file picking, native calls, and other app-specific work outside generic observable stores.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 100 lines · 75 tokens per session scan A 2487697c3f57
legend-state-best-practices is a skill published in the GitHub repository LegendApp/legend-skills (39 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 1,821 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
custom-features
Author a TanStack Table v9 feature plugin across every FeatureMap and API installation surface: state, options, column definitions, table, column, row, cell, header, row-model functions/caches, defaults, prototypes, and table/row/column instance data lifecycles. Load for initTableInstanceData, resetTableInstanceData…
frontend-conventions
Coding conventions, architecture patterns, and testing rules for the SkillHub React frontend. Ensures agents follow Feature-Sliced Design and use the generated OpenAPI types.
fast-typescript-check
Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…
typescript-react
Apply, review, and explain React conventions from the TypeScript Style Guide. Use automatically for TypeScript and TSX tasks involving prop-derived state, prop typing, component responsibilities, data flow, compound components, or client and server state.
typescript-rules
React/TypeScript frontend development rules including type safety, component design, state management, and error handling. Use when implementing React components, TypeScript code, or frontend features.
coding-standards
A set of general coding standards and practical patterns for TypeScript, JavaScript, React, and Node.js. It covers readable naming, simple designs, avoiding repetition, and delaying unnecessary features.