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.
npx agentmods add rules/tencentcloudcommunity/mcp-server/miniprogram-developmentgit clone --depth 1 https://github.com/TencentCloudCommunity/mcp-serverWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01272 |
| Opus 5 | $0.00000 | $0.00636 |
| Sonnet 5 | $0.00000 | $0.00254 |
| Haiku 4.5 | $0.00000 | $0.00127 |
Grade A, and why
miniprogram-development 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.
How it starts
The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.
微信小程序开发规则
项目结构
- 如果用户需要开发小程序,你会使用微信云开发的各种能力来开发项目,小程序的基础库直接用 latest 即可
- 小程序的项目遵循微信云开发的最佳实践,小程序一般在 miniprogram目录下,如果要开发云函数,则可以存放在 cloudfunctions 目录下,小程序的 project.config.json 需要指定miniprogramRoot这些
- 生成小程序页面的时候,必须包含页面的配置文件例如index.json等,要符合规范,避免编译出错
开发工具
微信开发者工具 CLI 打开项目:
- 当检测到当前项目为小程序项目时,建议用户使用微信开发者工具进行预览调试和发布
- 使用 CLI 命令打开项目(指向 project.config.json 所在目录):
- Windows:
"C:\Program Files (x86)\Tencent\微信web开发者工具\cli.bat" open --project "项目根目录路径" - macOS:
/Applications/wechatwebdevtools.app/Contents/MacOS/cli open --project "/path/to/project/root"
- Windows:
- 项目根目录路径为包含 project.config.json 文件的目录
云开发集成
- 小程序 wx.cloud 的时候,需要指定环境 Id,环境 id 可以通过 envQuery 工具来查询
- 生成小程序代码的时候,如果需要用到素材图片,比如 tabbar 的 iconPath 等地方,可以从 unsplash 通过 url 来下载,可以参考工作流程中的下载远程资源流程,在生成小程序代码的时候,如果用到了iconPath 这些,必须同时帮用户下载图标,避免构建报错
小程序认证特性
重要:小程序云开发天然免登录,严禁生成登录页面或登录流程!
- 免登录特性:小程序云开发不需要用户登录,可以在云函数中通过 wx-server-sdk 获取用户身份
- 用户身份获取:在云函数中通过
cloud.getWXContext().OPENID获取用户的唯一标识 - 用户数据管理:基于 openid 在云函数中进行用户数据管理,无需登录流程
// 云函数中获取用户身份示例
exports.main = async (event, context) => {
const wxContext = cloud.getWXContext();
const openid = wxContext.OPENID;
return { openid: openid };
};
AI 大模型调用
小程序中基础库 3.7.1版本以上已经支持直接调用大模型
// 创建模型实例,这里我们使用 DeepSeek 大模型
const model = wx.cloud.extend.AI.createModel("deepseek");
// 我们先设定好 AI 的系统提示词,这里以七言绝句生成为例
const systemPrompt =
"请严格按照七言绝句或七言律诗的格律要求创作,平仄需符合规则,押韵要和谐自然,韵脚字需在同一韵部。创作内容围绕用户给定的主题,七言绝句共四句,每句七个字;七言律诗共八句,每句七个字,颔联和颈联需对仗工整。同时,要融入生动的意象、丰富的情感与优美的意境,展现出古诗词的韵味与美感。";
// 用户的自然语言输入,如'帮我写一首赞美玉龙雪山的诗'
const userInput = "帮我写一首赞美玉龙雪山的诗";
// 将系统提示词和用户输入,传入大模型
const res = await model.streamText({
data: {
model: "deepseek-v3", // 指定具体的模型
messages: [
{ role: "system", content: systemPrompt },
{ role: "user", content: userInput },
],
},
});
// 接收大模型的响应
// 由于大模型的返回结果是流式的,所以我们这里需要循环接收完整的响应文本。
for await (let str of res.textStream) {
console.log(str);
}
微信步数获取
微信步数获取必须使用CloudID方式(基础库2.7.0+):
- 前端:
wx.getWeRunData()获取cloudID,使用wx.cloud.CloudID(cloudID)传递给云函数 - 云函数:直接使用
weRunData.data获取解密后的步数数据,检查weRunData.errCode处理错误 - 禁止使用session_key手动解密方式,CloudID更安全简单
- 必须实现降级机制(模拟数据)处理cloudID获取失败的情况
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.
- 2d ago First seen · 91 lines · 0 tokens per session scan A 4517faae32af
miniprogram-development is a cursor rule published in the GitHub repository TencentCloudCommunity/mcp-server (28 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,272 tokens. 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-30.
Other cursor rules, from other repositories
project
Top-level rules and information for the project.
atelier
Atelier UI/UX and Backend Architecture Quality Gate.
vision-memory-mcp
This project utilizes vision-memory-mcp to cache visual states, record layout transitions, provide element grounding, and avoid repetitive LLM vision calls.
php-transport-implementation
Guidelines for implementing transport layers in PHP MCP SDK.
php-types-validation
Guidelines for type definitions and validation in PHP MCP SDK.
php-server-implementation
Guidelines for implementing MCP servers in PHP.