跳到正文
cccskills
免费在 GitHub 公开

xstate

Design, implement, and review XState v5 state machines and @xstate/react integrations in TypeScript. Use when modeling finite workflows, async actors, statecharts, guarded transitions, delayed transitions, actor systems, or machine-driven React behavior.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(10)

  • SKILL.md2.6 KB
  • references/actors.md2.5 KB
  • references/callbacks.md978 B
  • references/child-actors.md1.2 KB
  • references/modeling.md2.6 KB
  • references/observables.md905 B
  • references/promises.md2.2 KB
  • references/react.md5.0 KB
  • references/testing.md3.3 KB
  • references/transitions.md3.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

XState

Use XState when the domain has meaningful modes, transitions, async lifecycle, cancellation, guards, delays, or actor boundaries. The goal is not "state management"; the goal is to make the process explicit, typed, inspectable, and hard to misuse.

Core Standard

  • Prefer setup({ types, actors, actions, guards, delays }).createMachine(...) for typed machines with named implementations.
  • Put finite modes in states.
  • Put durable facts in context.
  • Put side effects behind actors, actions, guards, and delays.
  • Put request data in invoke.input.
  • Put UI decisions on snapshots: matches, hasTag, can, and selected context.
  • Initialize each actor instance with input.
  • Define default implementations in setup(...); replace runtime implementations with .provide(...).
  • Model later external changes as keyed remounts, domain events, or subscription actors.

Reading Guide

Read only the references needed for the task:

  • Modeling: states, state types, context, events, guards, tags, delays.
  • Transitions: guarded, eventless, delayed, and pure transitions.
  • Actors: async work, actor choice, invocation, outputs, cancellation.
  • Promises: fromPromise, request input, output, errors, abort signals.
  • Callbacks: subscriptions, imperative APIs, sendBack, receive, cleanup.
  • Observables: observable snapshots and observable event streams.
  • Child Actors: invoke, spawn, spawnChild, child ownership, inspection.
  • React: @xstate/react, .provide(...), actor input, selectors.
  • Testing: actor tests, waitFor, provided implementations, timing.

Working Loop

  1. Name the process and its legal modes.
  2. Define the domain events.
  3. Decide what data survives transitions.
  4. Move effects into actors or named implementations.
  5. Connect UI through actor hooks and snapshot reads.
  6. Test behavior at the actor boundary.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

中文简介正在准备中。当前显示原文说明。

wordbricks/onequery172026年7月30日 更新

A scoring scale for evaluating how well a CLI is designed for AI agents, based on the "Rewrite Your CLI for AI Agents" principles.

中文简介正在准备中。当前显示原文说明。

wordbricks/onequery172026年7月30日 更新

Score a repository's agentic legibility from repo-visible evidence only. Use when Codex needs to audit how easy a codebase is for coding agents to discover, bootstrap, validate, and navigate, especially for harness-engineering reviews, developer-experience audits, repo cleanup, or before/after comparisons after improving docs, tooling, or architectural constraints.

中文简介正在准备中。当前显示原文说明。

wordbricks/onequery172026年7月30日 更新

astro

免费

Expert in Astro framework with static generation and partial hydration patterns

中文简介正在准备中。当前显示原文说明。

wordbricks/onequery172026年7月30日 更新

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.

中文简介正在准备中。当前显示原文说明。

wordbricks/onequery172026年7月30日 更新

Adopt better-result in an existing TypeScript codebase. Use when replacing try/catch, Promise rejection handling, null sentinels, or thrown domain exceptions with typed Result workflows.

中文简介正在准备中。当前显示原文说明。

wordbricks/onequery172026年7月30日 更新

查看 wordbricks 的全部技能

报告此技能的问题