用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/dkolba/bruff --skill scaffold-reducer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | scaffold-reducer |
| description | Scaffold a pure state reducer following the (state, action) => state pattern used in packages/game |
Use when adding a new state transition to the game simulation.
Every state transition is a pure function:
const myReducer = (state: GameState, action: MyAction): GameState => {
switch (action.type) {
case "CASE_A":
return { ...state /* … */ };
case "CASE_B":
return { ...state /* … */ };
default: {
const _exhaustive: never = action;
return _exhaustive;
}
}
};
this.packages/game/lib/state/ as <verb>-<noun>.ts (e.g. update-player.ts, update-enemies.ts).packages/game/lib/state/<verb>-<noun>.ts with the reducer body.packages/game/lib/state/<verb>-<noun>.test.ts with:
case branch.GameState from ../core/types.ts using import type.packages/game/lib/state/advance-game-state.ts if it participates in the main tick.The root deterministic step in advance-game-state.ts chains reducers:
input normalisation → updatePlayer → updateEnemies → … → frameIndex increment
Add new reducers to that chain inside advanceGameState.