Agent skill

Xstate

by pedronauck in pedronauck/skills

Comprehensive guide for XState v5 ecosystem including state machines, actors, @xstate/store, and TanStack Query integration.

No licenceAuto-check passedBackend & APIs

Install Xstate

skills CLI
$ npx skills add pedronauck/skills --skill xstate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pedronauck/skills xstate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pedronauck/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/curated/xstate .claude/skills/xstate && rm -rf skills-src

Use ~/.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/

Facts

Skill name
xstate
GitHub stars
634
Token cost
~2.8k tokens
SKILL.md length
805 words
Files
4 (incl. references)
Skills in repo
65
Repo updated
First seen
Licence
None found

At a glance

Comprehensive guide for XState v5 ecosystem including state machines, actors, @xstate/store, and TanStack Query integration.

  • Works in 8 steps: Use setup() for all machines - provides… → Use enums for event types -… → Define actions outside setup() - use… → …
  • Implementing state machines
  • SKILL.md covers Quick Reference, Core Principles, XState State Machines and @xstate/store, plus 5 more sections
  • Calls pnpm

What it does

Xstate is an agent skill from pedronauck/skills. Comprehensive guide for XState v5 ecosystem including state machines, actors, @xstate/store, and TanStack Query integration. Use when implementing state machines, event-driven stores, client state management, or integrating XState with React and TanStack Query for data fetching orchestration.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/machine-patterns.md`, `references/query-patterns.md` and `references/store-patterns.md`).

It sits in Backend & APIs, covering Event-driven systems and State management. It works with TanStack and React. The repository describes itself as: My personal favorite skills.

When your agent uses it

  • Implementing state machines
  • Event-driven stores
  • Client state management
  • Integrating XState with React and TanStack Query for data fetching orchestration

Example prompts

  • “/xstate”

Requirements

  • Pre-approved tools (allowed-tools): Read, Grep, Glob

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Use setup() for all machines - provides superior type inference
  2. Use enums for event types - UPPER_SNAKE_CASE convention
  3. Define actions outside setup() - use type-bound helpers like setup().assign()
  4. Use enqueueActions() for sequential actions - group related actions together
  5. Use .provide() for React integration - override actions with external methods
  6. Initialize context from input - use function form for dynamic initialization
  7. Always spread ...context in stores - preserve other properties
  8. Clean up subscriptions - return cleanup functions from callback actors

What it can do on your machine

Read from SKILL.md and the folder at commit 0422940. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Xstate loads about 2.8k tokens when it runs, and up to ~18k if it reads all its reference files. Until then it costs about 75 tokens; SKILL.md has 805 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~18k

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.

Safety

Auto-check passed

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.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 805 words (~2,823 tokens).

“This skill provides comprehensive guidelines, patterns, and best practices for working with the XState v5 ecosystem in this project, including:”

— opening of SKILL.md by pedronauck
name
xstate
allowed-tools
Read, Grep, Glob

Read the full SKILL.md on GitHub

Files

SKILL.md and 3 other files (references) in skills/curated/xstate of pedronauck/skills.

  • SKILL.md
  • references/machine-patterns.md
  • references/query-patterns.md
  • references/store-patterns.md

Open the folder on GitHubat commit 0422940

Compare with similar skills

Xstate 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.

Xstate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Xstate this skillpedronauck/skills634—~2.8kAutomated safety check: PassNone
Tanstack Query Best PracticesDeckardGer/tanstack-agent-skills2221 repos~1.2kAutomated safety check: PassMIT
Tanstack Querysecondsky/claude-skills227—~7.9kAutomated safety check: PassMIT
Tanstack QueryMindrally/skills269—~3.6kAutomated safety check: PassApache-2.0
Tanstack Querybskimball/tanstack-hono1191 repos~5.4kAutomated safety check: PassMIT
React Native Mmkvmargelo/react-native-skills175—~2.1kAutomated safety check: PassMIT

Similar skills

  • Tanstack Query Best Practices

    DeckardGer/tanstack-agent-skills

    TanStack Query (React Query) best practices for data fetching, caching, mutations, and server state management.

    222 GitHub starsUsed in 1 repo~1.2k tokens
    Backend & APIsAuto-check passed
  • Tanstack Query

    secondsky/claude-skills

    TanStack Query v5 (React Query) server state management. An agent skill from secondsky/claude-skills.

    227 GitHub stars~7.9k tokensUpdated 11 days ago
    Frontend & DesignAuto-check passed
  • Tanstack Query

    Mindrally/skills

    Best practices for TanStack Query v5 (React Query) server state management, including query key factories, the queryOptions helper, mutations, optimistic updates, infinite queries, and Suspense mode.

    269 GitHub stars~3.6k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Tanstack Query

    bskimball/tanstack-hono

    Powerful asynchronous state management, server-state utilities, and data fetching for TS/JS, React, Vue, Solid, Svelte & Angular.

    119 GitHub starsUsed in 1 repo~5.4k tokens
    Frontend & DesignAuto-check passed
  • React Native Mmkv

    margelo/react-native-skills

    Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed).

    175 GitHub stars~2.1k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Official

    Use the shared TestProvider in workflowsmanagement Jest tests instead of hand-wiring KibanaContextProvider, QueryClientProvider, WorkflowsContextProvider, MemoryRouter, I18nProvider, and the Redux…

    21k GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed

More from pedronauck/skills

All 65 skills in this repo
  • Deep Review

    pedronauck/skills

    Review branch diffs, working trees, or PRs in depth with defect, polish and cross-contract coverage.

    634 GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Yc Apply

    pedronauck/skills

    Prepare, review, and package Y Combinator application answers and founder-video notes using the live form and verified founder facts.

    634 GitHub stars~1.3k tokensUpdated 25 days ago
    Auto-check passed
  • Guide technical communication for software developers. An agent skill from pedronauck/skills.

    634 GitHub starsUsed in 3 repos~2.3k tokens
    Auto-check passed
  • Tauri V2

    pedronauck/skills

    Tauri v2+ cross-platform app development with Rust backend. An agent skill from pedronauck/skills.

    634 GitHub starsUsed in 2 repos~4.1k tokens
    Auto-check passed
  • Hormozi Ad Factory

    pedronauck/skills

    Generates 150-750+ ad variations using Alex Hormozi's combinatorial Hook x Meat x CTA framework.

    634 GitHub stars~2.1k tokensUpdated 25 days ago
    Auto-check passed
  • Yt Master

    pedronauck/skills

    Plans and improves YouTube ideas, titles, thumbnail concepts, scripts, retention, channel strategy, and metric-based diagnosis.

    634 GitHub stars~736 tokensUpdated 25 days ago
    Auto-check passed

Works with

Categories

Questions about Xstate

What does Xstate do?

Comprehensive guide for XState v5 ecosystem including state machines, actors, @xstate/store, and TanStack Query integration. Xstate is an agent skill from pedronauck/skills. Comprehensive guide for XState v5 ecosystem including state machines, actors, @xstate/store, and TanStack Query integration.

When should I use Xstate?

Xstate fits situations like: implementing state machines; event-driven stores; client state management; integrating XState with React and TanStack Query for data fetching orchestration.

How do I install Xstate in Claude Code?

Run `npx skills add pedronauck/skills --skill xstate -a claude-code`. Or copy the skill folder (skills/curated/xstate in pedronauck/skills) into .claude/skills/xstate in your project. Claude Code loads it when a task matches its description.

How do I install Xstate in Codex?

Run `npx skills add pedronauck/skills --skill xstate -a codex`. Or copy the skill folder (skills/curated/xstate in pedronauck/skills) into .agents/skills/xstate in your project. Codex loads it when a task matches its description.

Can I use Xstate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pedronauck/skills --skill xstate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xstate, .gemini/skills/xstate, .github/skills/xstate and .opencode/skills/xstate in your project.

What does Xstate need to run?

Going by SKILL.md and its folder, Xstate needs the command-line tools its instructions call (pnpm). Its frontmatter pre-approves these tools: Read, Grep, Glob.

Does Xstate access the network?

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.

Is Xstate safe to install?

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.

What licence does Xstate use?

No licence was found for Xstate or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Xstate use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.

What are the alternatives to Xstate?

Skills that share tags, products or a category with Xstate: Tanstack Query Best Practices (DeckardGer/tanstack-agent-skills, 222 stars), Tanstack Query (secondsky/claude-skills, 227 stars), Tanstack Query (Mindrally/skills, 269 stars) and Tanstack Query (bskimball/tanstack-hono, 119 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Xstate?

pedronauck (a GitHub user) maintains it in pedronauck/skills, which has 634 GitHub stars. The repository holds 65 skills in this directory. The repository was last updated on September 14, 2026.

Source: pedronauck/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.