domestic-stack

A set of coding rules for uni-app, WeChat Mini Programs, and Spring Boot, commonly used technologies for Chinese mobile and web applications.

In plain words
What is it for?
It is for building Mini Program and uni-app pages, components, and APIs; handling app, Mini Program, and web differences; and organizing Spring Boot controllers, services, and data-access code.
Why use it?
Code written for ordinary websites may fail in Mini Programs because they do not provide browser objects such as `window` or `document`. The rules also address platform differences, performance limits, deployment settings, and backend structure.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/wade-devcode/awesome-coding-skills-cn/domestic-stack
Any agent
npx skills add Wade-DevCode/awesome-coding-skills-cn --skill domestic-stack
Clone the repo
git clone --depth 1 https://github.com/Wade-DevCode/awesome-coding-skills-cn

Made for: Claude Code, Codex.

Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,034 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00032 $0.03034
Opus 5 $0.00016 $0.01517
Sonnet 5 $0.00006 $0.00607
Haiku 4.5 $0.00003 $0.00303

Measured 2d ago against content hash 7cd8d75007d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

domestic-stack scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/domestic-stack/SKILL.md · 249 lines

How it starts

The opening of the file, as written. The whole thing — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.

国内技术栈适配

何时用

  • 开发微信小程序或 uniapp 项目,涉及页面、组件、API 调用时。
  • 写 uniapp 多端适配逻辑,需要区分 APP / 小程序 / H5 平台差异时。
  • 开发 SpringBoot 后端接口,涉及 Controller / Service / Mapper 分层设计时。
  • 项目上线前检查合规、依赖源、CDN 等国内环境配置时。

核心规则

1. 小程序/uniapp 不照搬 web

规则: 微信小程序和 uniapp 运行在专属运行时,没有 windowdocumentlocalStorage 等 DOM/BOM 对象;setData 是性能敏感操作,频繁调用或传大对象会直接卡顿;整包 + 分包体积有硬性上限(主包 2 MB,总包 20 MB)。

为什么: AI 训练数据以 web 代码为主,极容易写出 document.querySelectorwindow.location.hreflocalStorage.setItem 这类在小程序里直接报 ReferenceError 的代码。对 setData 的误用更隐蔽:AI 常常在循环里每次更新一个字段就调用一次 setData,或者把整个巨型列表塞进去,运行时帧率立刻掉到个位数。

怎么做:

  • 访问本地存储用 wx.setStorageSync / uni.setStorageSync,路由用 wx.navigateTo / uni.navigateTo,DOM 操作改用数据绑定驱动视图。
  • 批量更新时合并成一次 setData,用 path 精确更新而非替换整个对象(见正例)。
  • 拆分包:业务模块放分包,避免主包塞太多资源;图片走 CDN 不打进包里。

2. uniapp 跨端用条件编译

规则: uniapp 跨 APP / 微信小程序 / H5 时,平台差异必须用 #ifdef APP-PLUS / #ifdef MP-WEIXIN / #ifdef H5 等条件编译块处理,不写死只在单端能跑的逻辑。

为什么: AI 在生成 uniapp 代码时经常直接调用 wx.* API 而不加条件编译,在 APP 端或 H5 端运行时这些调用会静默失败或抛异常。反过来也会犯:只写了 plus.* 的 APP 专属逻辑,发布 H5 版时整块功能缺失。这类 bug 在单端开发阶段完全看不出来,到多端上线时才暴露。

怎么做:

  • 平台专属 API 用条件编译包裹,公共逻辑放在块外。
  • 样式差异用 /* #ifdef MP-WEIXIN */ 包裹对应 CSS。
  • 构建产物检查:每次改动后分别在小程序、H5 模式各跑一遍,确认两端都正常。

3. 微信登录走官方流程

规则: 微信登录必须走 wx.login 获取 code,再由后端调用 code2session 换取 openid 和 session_key;openid 和 session_key 不得存在前端,不得绕过授权步骤直接用 union_id 或手机号作为身份标识。

为什么: AI 经常写出把 session_key 存进 wx.setStorageSync 的代码——这违反微信安全规范,session_key 会失效且不能直接暴露给客户端。还有一种常见错误:前端直接拿 getUserInfo 返回的 openid(旧接口早已废弃)当登录凭证,绕过后端校验,既不安全也不符合现行微信能力。

怎么做:

  • 前端只负责:wx.login → 拿到 code → 发给自己后端。
  • 后端用 appid + appsecret + code 请求微信 code2session 接口,换回 openid / session_key,生成自己的登录态 token 返回前端。
  • 前端持久化自己后端颁发的 token,不存 openid,不存 session_key。
  • 需要手机号时走 getPhoneNumber 组件 + 后端解密,不走已废弃的 getUserInfo

4. SpringBoot 分层清晰

规则: Controller 只做参数接收与响应封装,业务逻辑全部下沉到 Service,数据库操作放 Mapper / Repository;统一异常处理用 @ControllerAdvice,参数校验用 @Valid + ConstraintValidator,不在 Controller 里写业务代码。

Read the full file on GitHub · 249 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 249 lines · 32 tokens per session scan A 7cd8d75007d9

Subscribe to this mod's changes

domestic-stack is a skill published in the GitHub repository Wade-DevCode/awesome-coding-skills-cn (6 stars, last pushed 2mo ago), licensed MIT. It adds 32 tokens to every session and 3,034 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

chinese-documentation

中文文档排版参考——中英文空格、全半角标点、术语保留、链接格式、中文文案排版指北约定。仅在用户显式 /chinese-documentation 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 62 tokens

chinese-git-workflow

国内 Git 平台配置参考——Gitee、Coding.net、极狐 GitLab、CNB 的 SSH/HTTPS/凭据/CI 接入差异与镜像同步配置。仅在用户显式 /chinese-git-workflow 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 69 tokens

brainstorming

在任何创造性工作之前必须使用此技能——创建功能、构建组件、添加功能或修改行为。在实现之前先探索用户意图、需求和设计。.

jnMetaCode/superpowers-zh · 40 tokens

chinese-code-review

中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 62 tokens

chinese-commit-conventions

中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 65 tokens

mcp-builder

MCP 服务器构建方法论 — 系统化构建生产级 MCP 工具,让 AI 助手连接外部能力.

jnMetaCode/superpowers-zh · 32 tokens