一键导入
add-daemon-endpoint
Add a new daemon REST endpoint with types, handler, web API proxy, and hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new daemon REST endpoint with types, handler, web API proxy, and hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | add-daemon-endpoint |
| description | Add a new daemon REST endpoint with types, handler, web API proxy, and hook. |
| disable-model-invocation | true |
Wire a new REST endpoint through daemon → web API → hook.
$ARGUMENTS[0] — HTTP method and path (e.g., "POST /actions/my-action")$ARGUMENTS[1] — Description of what it doespackages/types/src/index.ts — Add request/response types:
export interface MyActionRequest { ... }
export interface MyActionResponse { ... }
apps/daemons/src/server.ts — Add route handler:
if (method === "POST" && pathname === "/actions/my-action") {
const body = await parseBody<MyActionRequest>(req)
// ... execute action
return json(result)
}
apps/web/src/app/api/my-action/route.ts — Create Next.js API route that proxies to daemon:
const DAEMON_URL = process.env.NEXT_PUBLIC_DAEMON_REST_URL || "http://localhost:4100"
export async function POST(request: Request) {
const body = await request.json()
const res = await fetch(`${DAEMON_URL}/actions/my-action`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
})
const data = await res.json()
return Response.json(data)
}
apps/web/src/hooks/use-*.ts — Add hook method or create new hook:
const myAction = async (params: MyActionRequest) => {
const res = await fetch("/api/my-action", { method: "POST", body: JSON.stringify(params) })
// handle response, toast, etc.
}
Run /verify.
Run full repo verification (lint, typecheck, test, security, diff review) and fix failures.
Audit documentation freshness — find docs that are stale or missing coverage for recent code changes.
Create a new Next.js API route with proper typing and error handling.
Create a new database service following the FXFlow pattern.
Wire a new WebSocket event end-to-end (daemon → types → hook → component).
Refactor code to meet file-size limits and DRY rules without changing behavior.