with one click
xrk-infrastructure
当需要理解或扩展基础设施层(加载器、基类、路径、错误处理)等底层开发时使用。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
当需要理解或扩展基础设施层(加载器、基类、路径、错误处理)等底层开发时使用。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
当你需要从“应用视角”看 XRK-AGT(启动流程、Web 控制台、前后端协作、典型技术栈组合)时使用。
当你需要开发或排查 HTTP API(core/*/http/*.js)、理解 HttpApi 基类、HttpApiLoader、业务层约定时使用。
编写或审查 core/*/www 静态页、校园 WebView 兼容、HttpResponse 前端解包时使用。浏览器环境 ≠ Node 26。
编写或审查 core/src 代码时的写法与性能规范(全局裸名、状态、I/O、异步、HTTP)。改 Core 前必读。
当你需要快速理解 system-Core 提供哪些 HTTP API/工作流/插件/Tasker/Web 控制台能力,或定位某个模块在哪实现时使用。
当需要从整体理解 XRK-AGT 的架构、目录、运行流程和技术栈时使用。
| name | xrk-infrastructure |
| description | 当需要理解或扩展基础设施层(加载器、基类、路径、错误处理)等底层开发时使用。 |
docs/底层架构设计.mddocs/runtime-surface.mddocs/框架可扩展性指南.md| 扩展点 | 基类 | 加载器 | 扫描目录 |
|---|---|---|---|
| 插件 | #infrastructure/plugins/plugin-base.js | plugins/loader.js | core/*/plugin/*.js |
| HTTP | #infrastructure/http/http.js | http/loader.js | core/*/http/*.js |
| 工作流 | #infrastructure/ai-workflow/ai-workflow.js | ai-workflow/loader.js | core/*/workflow/*.js |
| Tasker | — | tasker/loader.js | core/*/tasker/*.js |
| 事件 | #infrastructure/listener/base.js | listener/loader.js | core/*/events/*.js |
| 配置 | #infrastructure/commonconfig/commonconfig.js | commonconfig/loader.js | core/*/commonconfig/*.js |
| 渲染器 | #infrastructure/renderer/Renderer.js | renderer/loader.js | src/renderers/* |
浏览器截图实现继承 src/infrastructure/renderer/browser-renderer-base.js(Puppeteer/Playwright 共用 lock、Redis WS、截图槽位等)。
| 模块 | 路径 | 说明 |
|---|---|---|
| DB 连接 | #utils/db-connect-utils.js | Redis/Mongo 共用 retry、URL 脱敏、ARM64 检测 |
| HTTP 业务 API 约定 | docs/http-api.md | 路由、HttpResponse、InputValidator |
| Loader 共享约定 | docs/infrastructure-shared.md | 热重载、FileLoader、批加载 |
| 基类契约 | docs/base-classes.md | plugin/HttpApi/AiWorkflow/ConfigBase/Event |
| 配置种子 | src/infrastructure/config/config-seed.js | 端口配置模板复制 |
| 运行时挂载 | #utils/runtime-globals.js | setRuntimeGlobal / getRuntimeGlobal |
# 别名#utils/*、#infrastructure/*、#factory/*、#config/*、#data/*、#core/*、#renderers/*、#modules/*。业务用裸名 msgSegment、AgentRuntime(勿 global.);Core 业务用裸名,框架内可 import { msgSegment } from '#utils/msg-segment.js'。
core/;改 src/ 仅限基类/加载器/工具。RuntimeUtil.makeLog;HTTP 响应:HttpResponse(#utils/http-utils.js);错误:#utils/error-handler.js + normalizeError。runtimeConfig.aiWorkflow → data/server_bots/{port}/ai-workflow.yaml(非 server_bots 根目录)。xrk-node-runtime;禁止在 Core 中引入 node-fetch、promisify(exec)、instanceof Error 判错等旧写法。exec-async.js、normalize-error.js、proxy-utils.js,勿在 Core 重复封装。