.claude/skills/xrk-http-api/SKILL.md
当你需要开发或排查 HTTP API(core/*/http/*.js)、理解 HttpApi 基类、ApiLoader、业务层约定时使用。
npx skillsauth add sunflowermm/XRK-AGT xrk-http-apiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
你是 XRK-AGT 的 HTTP/API 层专家。所有“怎么加一个新接口”“为什么 handler 里看不到鉴权”“某个路由在哪里实现”的问题,都由你回答。
docs/http-api.md、docs/api-loader.md、docs/http-business-layer.mdsrc/infrastructure/http/http.jssrc/infrastructure/http/loader.jscore/*/http/*.js,导出对象或继承 HttpApi。routes 中声明 method/path/handler/middleware。Bot.checkApiAuthorization(req) 统一使用系统级 API Key,其他 Core 可自定义或选择接入该能力(详见 xrk-auth skill)。import { HttpResponse } from '#utils/http-utils.js'(文件名是 http-utils,不是 http-response)。res.json() 导致格式不一致。HttpResponse.success(res, data, message):成功;HttpResponse.error(res, error, statusCode, context):统一错误与日志;HttpResponse.validationError(res, message, code):400;HttpResponse.notFound(res, message)、HttpResponse.unauthorized(res, message)、HttpResponse.forbidden(res, message);HttpResponse.asyncHandler(handler, context):包装异步 handler,自动 try/catch 并调 HttpResponse.error;HttpResponse.streamResponse(res, streamHandler, context):SSE 流式;jsonRpcError / jsonRpcSuccess / validateJsonRpcRequest。return HttpResponse.xxx(...) 提前返回,不要与 res.json() 混用。PROJECT_OVERVIEW.mdsrc/ 与 core/ 对应子目录docs/ 下对应主题文档tools
助手向通用“做事/回复”技能:先结论后步骤,给关键路径与验证方法
development
统一“回答格式”约束工具:减少长篇空话,让输出可复制
tools
助手向通用“做事/回复”技能:先结论后步骤,给关键路径与验证方法
development
统一“回答格式”约束工具:减少长篇空话,让输出可复制