[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DEF7XBPRD8P7WYQPKM1JCP":3,"skill-same:01M7DEF7XBPRD8P7WYQPKM1JCP":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7DEF7XBPRD8P7WYQPKM1JCP","xeito-machine",null,"Write or change a Xeito machine, the versioned statechart that runs a task on gen_statem (use Xeito.Machine). Use when adding a machine or a state, transition, guard, action, effect, timeout or typed decision to one, when delegating to another machine, when routing requests to a machine, or when deciding whether a change needs a new machine version.","romeroabelleira\u002Fxeito","romeroabelleira","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108562?v=4","01M7DEES0DQ09Z5M83W75B3J7C","Juan Romero Abelleira","01M7DEES13Q7TFAGMGG4P99S49",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxeito-machine\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: xeito-machine\ndescription: Write or change a Xeito machine, the versioned statechart that runs a task on gen_statem (use Xeito.Machine). Use when adding a machine or a state, transition, guard, action, effect, timeout or typed decision to one, when delegating to another machine, when routing requests to a machine, or when deciding whether a change needs a new machine version.\n---\n\n# Xeito machines\n\nA machine is the only place control flow lives: models never decide what happens next on their own, they only answer typed decisions that a state asks for. The design is in `docs\u002Farchitecture\u002F02-state-machine-core.md`; the DSL is documented in `lib\u002Fxeito\u002Fmachine.ex`. Read `lib\u002Fxeito\u002Fmachines\u002Frun_tests.ex` (the smallest machine) and `lib\u002Fxeito\u002Fmachines\u002Ffix_failing_test.ex` (decisions, nested states, delegation, a human step) before writing one.\n\n## The shape of a machine\n\n```elixir\ndefmodule Xeito.Machines.Example do\n  use Xeito.Machine, version: \"0.1.0\"\n\n  alias Xeito.Effect\n\n  initial :running\n\n  state :running, entry: :run_check, timeout: 600_000 do\n    on :ran, to: :done, guard: :passed?\n    on :ran, to: :failed, action: :record_failure\n  end\n\n  final :done\n  final :failed\n\n  @doc false\n  def run_check(ctx), do: [Effect.bash(ctx.cmd, cwd: ctx.cwd)]\n\n  @doc false\n  def passed?(_ctx, result), do: result.exit_status == 0\n\n  @doc false\n  def record_failure(ctx, result), do: Map.put(ctx, :output, result.output)\nend\n```\n\n- **Entry functions** return effects (`Xeito.Effect`: `bash`, `read`, `write`, `edit`, `chat`, `machine`, `decide`); they never perform them. The runner executes them, and each result comes back as an event: `:ran` for `bash`, `:child_done` for `machine`, `{:decided, value}` for a decision (the table is in `lib\u002Fxeito\u002Feffect.ex`). This is what makes runs replayable from the log and sandboxable.\n- **Guards** (`fun(ctx, data) :: boolean`) must be pure. The first transition whose event matches and whose guard passes is taken, the innermost state's first, in the order written: put the guarded ones first and an unguarded fallback last.\n- **Actions** (`fun(ctx, data) :: ctx`) are pure context updates. Anything with a side effect is an effect of the next state's entry.\n- Guards, entries and actions are named public functions, so the definition stays plain data (exportable as Mermaid or SCXML with `mix xeito.export`). Mark them `@doc false`.\n- **Nested states:** `state :working, initial: :planning do … end` with child states inside.\n\n## What the compiler enforces (`lib\u002Fxeito\u002Fmachine\u002Fvalidator.ex`)\n\n- Every non-final state has a timeout: `timeout: ms` or `{ms, event}`, else the machine's default (5 minutes). An unhandled timeout ends the run in the mandatory `final :failed`.\n- From every state a final state is reachable.\n- A state with `decide Type` handles **every** value of the type and `{:decided, :abstain}`. Abstention is a value, not an error: route it somewhere sensible, usually a human.\n\n## Decisions instead of model text\n\nWhen a step needs judgement (is this test flaky, is this command safe), declare a typed decision in the state rather than parsing model output:\n\n```elixir\nstate :triage do\n  decide(Xeito.Decisions.Triage, input: :triage_input)\n  on {:decided, :flaky}, to: :rerun\n  on {:decided, :code_bug}, to: :working, action: :record_triage\n  on {:decided, :abstain}, to: :ask_human\nend\n```\n\nA new decision type is a module under `lib\u002Fxeito\u002Fdecisions\u002F` (see `lib\u002Fxeito\u002Fdecision.ex` and `docs\u002Farchitecture\u002F03-typed-decisions.md`): closed values with descriptions, rules first, labelled examples in `priv\u002Fdecisions\u002F\u003Ctype>\u002Fexamples.jsonl`, evaluated with `mix xeito.eval` before it decides anything.\n\n## Delegation and humans\n\n- Delegate to another machine with `Effect.machine(Module, input, timeout: ms)`. The child runs as its own logged run; the parent gets only its outcome in the `:child_done` event.\n- A human step is a state waiting for a human event (`:approved`, `:denied`, `:answered`, or a text answer), with a long timeout: the session relays them (`\u002Fapprove`, `\u002Fdeny`, or text).\n\n## Versions\n\nA run pins its machine's version, and recovery refuses to replay a run under a different version. **Bump the version** whenever a run logged with the old code would replay differently: new or renamed states or events, changed transitions or guards, entries that return different effects. A pure refactor that keeps every step the same keeps the version. `mix xeito.log verify` checks that logged runs still replay exactly.\n\n## Registering and routing\n\nA machine that users can start is registered in `lib\u002Fxeito\u002Fsession\u002Frouter.ex`: the registry (name, module, what it does, how requests reach it), and a routing rule from the Intent value and the message if requests should reach it without `\u002Fmachine \u003Cname>`.\n\n## Testing\n\nWork test-first, at three levels:\n1. **Guards and actions** as plain functions on contexts, without a model (as in `test\u002Fxeito\u002Fmachines\u002Fchat_test.exs`).\n2. **Steps** with `Xeito.Machine.Engine.handle(Xeito.Machine.fetch!(Module), state, ctx, event, data)`, which returns the next state, context and effects without running anything.\n3. **Runs** with a scripted runner (`scripted_runner\u002F2` in `test\u002Fsupport\u002Fxeito_case.ex`; examples in `test\u002Fxeito\u002Frun_test.exs`); sessions and routing with the scripted model in `test\u002Fxeito\u002Fharness_test.exs`.\n\n`test\u002Fxeito\u002Farchitecture_test.exs` fails if a machine, or the engine, calls IO, processes, configuration or the runner side directly: return an effect instead.\n\nA machine whose guards decide something that matters (limits, safety, when to stop) belongs in `test\u002Fmutate.exs`, by itself or one `# --- section ---`; see the `xeito-quality-gate` skill.\n","# Xeito machines\n\nA machine is the only place control flow lives: models never decide what happens next on their own, they only answer typed decisions that a state asks for. The design is in `docs\u002Farchitecture\u002F02-state-machine-core.md`; the DSL is documented in `lib\u002Fxeito\u002Fmachine.ex`. Read `lib\u002Fxeito\u002Fmachines\u002Frun_tests.ex` (the smallest machine) and `lib\u002Fxeito\u002Fmachines\u002Ffix_failing_test.ex` (decisions, nested states, delegation, a human step) before writing one.\n\n## The shape of a machine\n\n```elixir\ndefmodule Xeito.Machines.Example do\n  use Xeito.Machine, version: \"0.1.0\"\n\n  alias Xeito.Effect\n\n  initial :running\n\n  state :running, entry: :run_check, timeout: 600_000 do\n    on :ran, to: :done, guard: :passed?\n    on :ran, to: :failed, action: :record_failure\n  end\n\n  final :done\n  final :failed\n\n  @doc false\n  def run_check(ctx), do: [Effect.bash(ctx.cmd, cwd: ctx.cwd)]\n\n  @doc false\n  def passed?(_ctx, result), do: result.exit_status == 0\n\n  @doc false\n  def record_failure(ctx, result), do: Map.put(ctx, :output, result.output)\nend\n```\n\n- **Entry functions** return effects (`Xeito.Effect`: `bash`, `read`, `write`, `edit`, `chat`, `machine`, `decide`); they never perform them. The runner executes them, and each result comes back as an event: `:ran` for `bash`, `:child_done` for `machine`, `{:decided, value}` for a decision (the table is in `lib\u002Fxeito\u002Feffect.ex`). This is what makes runs replayable from the log and sandboxable.\n- **Guards** (`fun(ctx, data) :: boolean`) must be pure. The first transition whose event matches and whose guard passes is taken, the innermost state's first, in the order written: put the guarded ones first and an unguarded fallback last.\n- **Actions** (`fun(ctx, data) :: ctx`) are pure context updates. Anything with a side effect is an effect of the next state's entry.\n- Guards, entries and actions are named public functions, so the definition stays plain data (exportable as Mermaid or SCXML with `mix xeito.export`). Mark them `@doc false`.\n- **Nested states:** `state :working, initial: :planning do … end` with child states inside.\n\n## What the compiler enforces (`lib\u002Fxeito\u002Fmachine\u002Fvalidator.ex`)\n\n- Every non-final state has a timeout: `timeout: ms` or `{ms, event}`, else the machine's default (5 minutes). An unhandled timeout ends the run in the mandatory `final :failed`.\n- From every state a final state is reachable.\n- A state with `decide Type` handles **every** value of the type and `{:decided, :abstain}`. Abstention is a value, not an error: route it somewhere sensible, usually a human.\n\n## Decisions instead of model text\n\nWhen a step needs judgement (is this test flaky, is this command safe), declare a typed decision in the state rather than parsing model output:\n\n```elixir\nstate :triage do\n  decide(Xeito.Decisions.Triage, input: :triage_input)\n  on {:decided, :flaky}, to: :rerun\n  on {:decided, :code_bug}, to: :working, action: :record_triage\n  on {:decided, :abstain}, to: :ask_human\nend\n```\n\nA new decision type is a module under `lib\u002Fxeito\u002Fdecisions\u002F` (see `lib\u002Fxeito\u002Fdecision.ex` and `docs\u002Farchitecture\u002F03-typed-decisions.md`): closed values with descriptions, rules first, labelled examples in `priv\u002Fdecisions\u002F\u003Ctype>\u002Fexamples.jsonl`, evaluated with `mix xeito.eval` before it decides anything.\n\n## Delegation and humans\n\n- Delegate to another machine with `Effect.machine(Module, input, timeout: ms)`. The child runs as its own logged run; the parent gets only its outcome in the `:child_done` event.\n- A human step is a state waiting for a human event (`:approved`, `:denied`, `:answered`, or a text answer), with a long timeout: the session relays them (`\u002Fapprove`, `\u002Fdeny`, or text).\n\n## Versions\n\nA run pins its machine's version, and recovery refuses to replay a run under a different version. **Bump the version** whenever a run logged with the old code would replay differently: new or renamed states or events, changed transitions or guards, entries that return different effects. A pure refactor that keeps every step the same keeps the version. `mix xeito.log verify` checks that logged runs still replay exactly.\n\n## Registering and routing\n\nA machine that users can start is registered in `lib\u002Fxeito\u002Fsession\u002Frouter.ex`: the registry (name, module, what it does, how requests reach it), and a routing rule from the Intent value and the message if requests should reach it without `\u002Fmachine \u003Cname>`.\n\n## Testing\n\nWork test-first, at three levels:\n1. **Guards and actions** as plain functions on contexts, without a model (as in `test\u002Fxeito\u002Fmachines\u002Fchat_test.exs`).\n2. **Steps** with `Xeito.Machine.Engine.handle(Xeito.Machine.fetch!(Module), state, ctx, event, data)`, which returns the next state, context and effects without running anything.\n3. **Runs** with a scripted runner (`scripted_runner\u002F2` in `test\u002Fsupport\u002Fxeito_case.ex`; examples in `test\u002Fxeito\u002Frun_test.exs`); sessions and routing with the scripted model in `test\u002Fxeito\u002Fharness_test.exs`.\n\n`test\u002Fxeito\u002Farchitecture_test.exs` fails if a machine, or the engine, calls IO, processes, configuration or the runner side directly: return an effect instead.\n\nA machine whose guards decide something that matters (limits, safety, when to stop) belongs in `test\u002Fmutate.exs`, by itself or one `# --- section ---`; see the `xeito-quality-gate` skill.\n",{"name":5,"description":7},"main","a13c65918461608e1ea5b3ecb204ef8cf06964b0",".agents\u002Fskills\u002Fxeito-machine","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito","https:\u002F\u002Fgithub.com\u002Fromeroabelleira","2026-11-13 03:05:42",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add romeroabelleira\u002Fxeito --skill xeito-machine",{"tool":36,"command":37},"bunx","bunx skills add romeroabelleira\u002Fxeito --skill xeito-machine",{"tool":39,"command":40},"pnpm","pnpm dlx skills add romeroabelleira\u002Fxeito --skill xeito-machine","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxeito-machine\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7DEG5Y3ZSHKHAG3T4KF4A86","web-search","Search the web and extract the content of the result pages.","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002Fpriv\u002Fskills\u002Fbench\u002Fskills\u002Fweb-search\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7DEG3GVYEGJ1RJP7P4N90MF","video-transcript","Fetch the transcript of a YouTube video for summarization and analysis.","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002Fpriv\u002Fskills\u002Fbench\u002Fskills\u002Fvideo-transcript\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7DEG0BC1AY9R72J1TENYX4G","translate-text","Translate text between languages, keeping formatting and terminology.","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002Fpriv\u002Fskills\u002Fbench\u002Fskills\u002Ftranslate-text\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7DEFY61C36WVQ1Z78NEBSN0","screenshot-ui","Take screenshots of a web app's pages in a browser to check the layout.","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002Fpriv\u002Fskills\u002Fbench\u002Fskills\u002Fscreenshot-ui\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7DEFWX1JQH6BZBWG9B8NKYN","release-notes","Draft release notes from the commits since the last tag.","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002Fpriv\u002Fskills\u002Fbench\u002Fskills\u002Frelease-notes\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7DEFVWS9H75PATHHS8WTF9X","pdf-extract","Extract text and tables from PDF files.","https:\u002F\u002Fgithub.com\u002Fromeroabelleira\u002Fxeito\u002Fblob\u002Fmain\u002Fpriv\u002Fskills\u002Fbench\u002Fskills\u002Fpdf-extract\u002FSKILL.md",[],[]]