用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/sunflowermm/XRK-AGT --skill xrk-node-runtime命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | xrk-node-runtime |
| description | 编写或审查 core/src 代码时,确保使用 Node 26 稳定 API,禁止旧写法(fetch/exec/错误/二进制)。AI 改 Core 前必读。 |
docs/node-26-runtime.mddocs/coding-style.md · skill xrk-coding-styledocs/底层架构设计.md §1 工具表package.json engines 与 app.js 启动校验一致。node:ffi,除非用户明确要求)。core/**/*.js)必用| 场景 | 正确写法 | 禁止 |
|---|---|---|
| HTTP 出站 | 全局 fetch(url, { signal: AbortSignal.timeout(ms), ...opts }) | node-fetch、import fetch from ... |
| LLM 代理 | buildFetchOptionsWithProxy(config, opts)(#utils/llm/proxy-utils.js) | https-proxy-agent、options.agent |
| Shell 命令 | import { exec } from '#utils/exec-async.js'(有 # 的 core)或相对路径到 src/utils/exec-async.js | util.promisify(exec)、child_process/promises |
| 流式 Shell | 需 stdout/stderr 实时流时可用 child_process.exec 回调 API(如 remote-command.js) | 在普通 await 场景自写 promisify |
| 判错 | Error.isError(err);需包装时用 normalizeError(err)(#utils/normalize-error.js) | err instanceof Error |
| Buffer 编码 | buf.toBase64()、buf.toHex()、Uint8Array.fromBase64(s) | `buf.toString('base64' |
| Map 初始化 | map.getOrInsert(k, () => ({ ... })) / getOrInsertComputed | map.get(k) || (map.set(k,v), v) 样板(可写时) |
| 下载文件 | fetch + Readable.fromWeb + pipeline(见 subserver-client.fetchSubserverToPath) | 自写 node-fetch pipeline |
| 路径匹配 | new URLPattern({ pathname }) | 手写 regex fallback、globalThis.URLPattern ? |
| URL-safe Base64 | buf.toBase64({ alphabet: 'base64url' })、Uint8Array.fromBase64(s, { alphabet: 'base64url' }) | 手写 base64url 替换 |
| 文件 glob | import { glob } from 'glob'(RuntimeUtil.glob 已封装) | 动态加载 fast-glob、自写 #getGlobLib |
src/**/*.js)util.promisify(exec) 的位置:src/utils/exec-async.js。errorHandler + normalizeError;日志:Error.isError 分支(见 log.js)。import { HttpResponse } from '#utils/http-utils.js';
import { normalizeError } from '#utils/normalize-error.js';
export default {
routes: [{
method: 'GET',
path: '/api/example/ping',
handler: HttpResponse.asyncHandler(async (req, res) => {
const resp = await fetch('https://example.com', {
signal: AbortSignal.timeout(5000)
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
return HttpResponse.success(res, await resp.text());
}, 'example')
}]
};
} catch (err) {
const error = normalizeError(err);
RuntimeUtil.makeLog('error', error.message, 'MyStream');
}
import { exec } from '#utils/exec-async.js';
const { stdout, stderr } = await exec('node --version');
// 至 26.7 仍无 node:child_process/promises — 勿在各文件 promisify(exec)
const fileId = Buffer.from(filePath, 'utf8').toBase64({ alphabet: 'base64url' });
const path = Buffer.from(Uint8Array.fromBase64(fileId, { alphabet: 'base64url' })).toString('utf8');
node-fetch、https-proxy-agentimport ... child_process/promisespromisify(exec)(应用 exec-async.js)AbortController + setTimeout(abort)instanceof Error 作判错(展示类型名除外)URLPattern / Error.isError 存在性检测toString('base64'|'hex') / Buffer.from(s,'base64') 新代码src/infrastructure/、src/utils/(见 xrk-core-code.mdc)基于 SOC 职业分类