一键导入
new-handler
Scaffold a new Arizona handler module. Ask whether it's a route-level view or an embeddable stateful component.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new Arizona handler module. Ask whether it's a route-level view or an embeddable stateful component.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add a new route to the Arizona router configuration. Use when creating new pages or endpoints.
Trace an event through the full Arizona stack from client click to DOM patch. Use when debugging event handling.
Profile Arizona hot paths with eprof/fprof. Use when investigating performance or picking the next optimization.
Add tests for an Arizona module. Use when creating CT suites, inline EUnit tests, or E2E tests.
Format, check, test, and commit changes. Use before committing any code changes.
Debug Arizona stream operations. Use when investigating stream insert/delete/update/move/sort/reset behavior.
| name | new-handler |
| description | Scaffold a new Arizona handler module. Ask whether it's a route-level view or an embeddable stateful component. |
| argument-hint | ["module_name"] |
| allowed-tools | Write, Glob |
Scaffold a new handler module named $ARGUMENTS in src/. First ask the user which kind it is:
arizona_stateful.hrl,
mount/1 (request data arrives as bindings via arizona_middleware:extract/1 middlewares)?stateful(Handler, Props)) → arizona_stateful.hrl, mount/1-module($ARGUMENTS).
-include("arizona_stateful.hrl").
-export([mount/1, render/1, handle_event/3]).
mount(Bindings) ->
{maps:merge(#{id => <<"$ARGUMENTS">>}, Bindings), #{}}.
render(Bindings) ->
?html({'div', [{id, ?get(id)}], [
<<"$ARGUMENTS">>
]}).
handle_event(_Event, _Payload, Bindings) ->
{Bindings, #{}, []}.
-module($ARGUMENTS).
-include("arizona_stateful.hrl").
-export([mount/1, render/1, handle_event/3]).
mount(Bindings) ->
{maps:merge(#{id => <<"$ARGUMENTS">>}, Bindings), #{}}.
render(Bindings) ->
?html({'div', [{id, ?get(id)}], [
<<"$ARGUMENTS">>
]}).
handle_event(_Event, _Payload, Bindings) ->
{Bindings, #{}, []}.
Rules:
src/$ARGUMENTS.erlmount returns {Bindings, Resets} where Resets is typically #{}render/1 returns a ?html(...) template; the root element must use {id, ?get(id)}handle_event/3 returns {Bindings, Resets, Effects}