agentleFS
sunflowermmsunflowermm/XRK-AGT/.cursor/skills/xrk-www-compat/SKILL.md

xrk-www-compat

Skill140 starsChanged 8 months agoMITView on GitHub

编写或审查 core/*/www 静态页、校园 WebView 兼容、HttpResponse 前端解包时使用。Core www 走浏览器兼容层(xrk-www-compat)。含零配置静态与有 sign.json(纯静态/产物/反代,sign↔server 合并)挂载。

The file

Files
SKILL.md

Core www 浏览器兼容 + 挂载

语义权威:core/system-Core/www/xrk/src/utils/http.js
挂载权威:docs/www-mount.md · www-app-resolve.js / mount-core-www.js
响应形状:skill xrk-http-api · HttpResponse.success

一层边界

环境超时 / ID / 克隆HttpResponse
Node(core/*/http、src/)AbortSignal.timeout;xrk-node-runtime只写响应
浏览器 www/abortTimeout / randomId / deepCloneunwrapSuccess 或读顶层

用法(强制,与 Core 一致)

场景做法
/xrk 控制台import { … } from '@/utils/http.js'
其它产品 Core只内联同语义;禁止依赖 /shared 或跨应用 /xrk/...
经典 <script>内联,注释写「对齐 xrk/src/utils/http.js」
导出浏览器勿裸用
randomIdcrypto.randomUUID()
unwrapSuccess默认 json.data.字段
abortTimeoutAbortSignal.timeout
deepClone无降级 structuredClone
copyText裸 navigator.clipboard(HTTP 公网页常失败)
downloadBlob手写 a[download] 且不统一 revoke

新能力:先改 src/utils/http.js,再同步各产品内联份。

www 两类 + 有 sign 时的模式

判定行为
零配置静态无 signURL=/${文件夹名},挂目录本体
有 sign · 纯静态staticRoot: "." 等挂目录本体;可改 URL / static / rateLimit
有 sign · 产物enabled: false挂载不启进程;挂 dist(启动过程仅 stale 时再编)
有 sign · 反代enabled: true启进程 + 反代

/xrk dist:维护者改 src 后建议 pnpm build 并把 dist/ 提交入库;也支持用户自行 build / 启动 stale 编(失败仍挂仓内 dist)。见 docs/www-mount.md「/xrk 控制台:dist 与自建」。

与主服合并:sign 已写优先,未写回落 server.yaml(www-sign-merge.js)。详见 docs/www-mount.md。Vite base = proxy.mount。

审查

  • 无裸 randomUUID / AbortSignal.timeout / 无降级 structuredClone
  • 产品页未 import /shared 或跨应用 /xrk/... 的兼容层
  • 未使用保留目录名 shared
  • 有 sign.json 的工程:URL 与 proxy.mount / Vite base 一致
  • tests/framework/www-web-compat.test.mjs · mount-core-www.test.mjs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.