원클릭으로
add-route
Add a new route to the Arizona router configuration. Use when creating new pages or endpoints.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add a new route to the Arizona router configuration. Use when creating new pages or endpoints.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
| name | add-route |
| description | Add a new route to the Arizona router configuration. Use when creating new pages or endpoints. |
| argument-hint | ["path"] |
| allowed-tools | Read, Edit, Grep, Glob |
Add a route for path $ARGUMENTS to the router configuration.
Search for compile_routes calls to locate where routes are defined (typically in the app module or config).
Choose the appropriate route type based on the user's intent:
Live page (most common):
{live, Path, Handler, Opts}
Path -- route pattern, e.g. <<"/">> or <<"/users/:id">>Handler -- a handler module that includes arizona_stateful.hrl and exports mount/1, render/1Opts -- map with optional keys:
bindings => map() -- initial bindings passed to mount/1 (default #{})layout => {LayoutMod, LayoutFun} -- layout to wrap the page (optional)on_mount => [Hook] -- on_mount hooks run before the handler's mount/1middlewares => [fun((az:request(), map()) -> {cont, az:request(), map()} | {halt, az:request()})]WebSocket endpoint:
{ws, Path, Opts}
Static assets:
{asset, Path, {priv_dir, App, SubDir}}
{asset, Path, {dir, AbsoluteDir}}
Controller (HTTP, method-gated; reached via arizona_js:fetch/2):
{post, Path, Handler, Opts} %% also get/put/patch/delete/head/options
{match, Spec, Path, Handler, Opts} %% multi/custom/any-method (Spec: verb | [verbs] | binary | '*')
Opts is controller_opts(): #{state, action, middlewares, check_origin} (action
defaults to handle). A wrong-verb request gets 405 + Allow.
Also scaffold the handler module using the /new-handler skill pattern (choose "route-level page"):
arizona_stateful.hrlmount/1 takes (Bindings) and must set id => <<"page">> (or appropriate view id); request
data (path bindings, query params) arrives via middlewares => [arizona_middleware:extract([...])]render/1 with ?html(...)handle_event/3 if interactiveAfter adding the route, check that:
layout is specified in optsScaffold a new Arizona handler module. Ask whether it's a route-level view or an embeddable stateful component.
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.
SOC 직업 분류 기준