Agent Skills › NicholasFlemmer/styx-app › state-machine-change

state-machine-change

GitHub

指导修改会话或授权状态机,包括更新状态/事件联合、转换表及效应数据。要求编写全量覆盖的表格驱动测试,验证不变性,并同步更新 Mermaid 图与审计报告,确保代码完备性与正确性。

.claude/skills/state-machine-change/SKILL.md NicholasFlemmer/styx-app

Trigger Scenarios

修改状态机状态或事件定义 变更状态转换逻辑 新增状态机效应处理 需要补充状态机测试用例

Install

npx skills add NicholasFlemmer/styx-app --skill state-machine-change -g -y
More Options

Non-standard path

npx skills add https://github.com/NicholasFlemmer/styx-app/tree/main/.claude/skills/state-machine-change -g -y

Use without installing

npx skills use NicholasFlemmer/styx-app@state-machine-change

指定 Agent (Claude Code)

npx skills add NicholasFlemmer/styx-app --skill state-machine-change -a claude-code -g -y

安装 repo 全部 skill

npx skills add NicholasFlemmer/styx-app --all -g -y

预览 repo 内 skill

npx skills add NicholasFlemmer/styx-app --list

SKILL.md

Frontmatter
{
    "name": "state-machine-change",
    "description": "Modify the Session or Grant state machine in packages\/core with exhaustive transition tables and tests. Use whenever a state, event, guard, or effect changes.",
    "allowed-tools": "Read, Grep, Edit, Write, Bash(pnpm:*)",
    "argument-hint": "<session|grant> <change summary>"
}

State machine change: $ARGUMENTS

  1. Quote the spec §1 rule being implemented (/spec-lookup 1).
  2. Update the State/Event unions and the transition table in packages/core/src/machines/<name>.ts (object-literal table, not if-chains) so exhaustiveness errors surface missing cells. Invalid pairs return null.
  3. Effects are data ({ type: 'startExpiryTimer', grantId, at }), executed by main.
  4. Tests: table-driven over every (state, event) pair incl. invalid; invariants: needs-you never times out; always never expires; one open grant ask per session.
  5. Update the Mermaid diagram in docs/state-machines.md.
  6. Run pnpm test -F @styx/core --coverage (100% on machines) and the state-machine-auditor subagent.

Version History

  • 1d72019 Current 2026-10-18 15:23

Same Skill Collection

.claude/skills/db-migration/SKILL.md
.claude/skills/ipc-command/SKILL.md
.claude/skills/port-screen/SKILL.md
.claude/skills/provider-adapter/SKILL.md
.claude/skills/release/SKILL.md
.claude/skills/run-app/SKILL.md
.claude/skills/spec-lookup/SKILL.md
.claude/skills/ui-component/SKILL.md
.claude/skills/visual-diff/SKILL.md

Metadata

Files
0
Version
9538e51
Hash
faf15795
Indexed
2026-10-18 15:23

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-07 08:46
浙ICP备14020137号-1