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 warn
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.00023 | $0.01552 |
| Opus 5.5 | $0.00009 | $0.00621 |
| Sonnet 5.5 | $0.00005 | $0.00310 |
| Haiku 4.5 | $0.00002 | $0.00155 |
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 1mo 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 — 92 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: inspect the relevant ownership and subscription path, then implement and verify within the scope already authorized by the conversation. Ask only for an unresolved product decision, materially larger scope, or an unauthorized external action.
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
2 files 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.
- 1mo ago Changed e7b456e25aab
- 2mo ago Changed · -8 lines · -52 tokens per session b39783ccaf28
- 3mo 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 (40 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 1,552 once invoked, about $0.0001 per session on Opus 5.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.
legend-state-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| legend-state-best-practicesLegendApp/legend-skills | Skill | 40 | 1mo ago | MIT | A | 23 | Codex |
| custom-featuresTanStack/table | Skill | 29k | yesterday | MIT | A | 35 | Claude Code, Codex |
| fast-typescript-checkinternet-development/www-sacred | Skill | 1.6k | 16d ago | MIT | A | 84 | Claude Code, Codex |
| port-sacred-terminal-ui-to-typescript-cliinternet-development/www-sacred | Skill | 1.6k | 16d ago | MIT | A | 0 | Claude Code, Codex |
| weapp-vite-react-best-practicesweapp-vite/weapp-vite | Skill | 532 | today | MIT | A | 103 | Codex |
| senior-frontendroedyrustam/vibes-plug | Skill | 132 | today | MIT | A | 52 | Cursor |
| react-generate-skilljiushiwon/wg-skills | Skill | 154 | 9d ago | Apache-2.0 | A | 145 | Claude Code, Codex |