Agent Skills
› NicholasFlemmer/styx-app
› state-machine-change
state-machine-change
GitHub指导修改会话或授权状态机,包括更新状态/事件联合、转换表及效应数据。要求编写全量覆盖的表格驱动测试,验证不变性,并同步更新 Mermaid 图与审计报告,确保代码完备性与正确性。
Trigger Scenarios
修改状态机状态或事件定义
变更状态转换逻辑
新增状态机效应处理
需要补充状态机测试用例
Install
npx skills add NicholasFlemmer/styx-app --skill state-machine-change -g -y
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
- Quote the spec §1 rule being implemented (
/spec-lookup 1). - Update the
State/Eventunions and the transition table inpackages/core/src/machines/<name>.ts(object-literal table, not if-chains) so exhaustiveness errors surface missing cells. Invalid pairs returnnull. - Effects are data (
{ type: 'startExpiryTimer', grantId, at }), executed by main. - Tests: table-driven over every (state, event) pair incl. invalid; invariants: needs-you never times out;
alwaysnever expires; one open grant ask per session. - Update the Mermaid diagram in
docs/state-machines.md. - Run
pnpm test -F @styx/core --coverage(100% on machines) and thestate-machine-auditorsubagent.
Version History
- 1d72019 Current 2026-10-18 15:23


