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/neoshopcn/neo-admin/16-wechat-sdkgit clone --depth 1 https://github.com/neoshopcn/neo-adminWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/neoshopcn/neo-admin/16-wechat-sdk)<a href="https://agentmods.dev/rules/neoshopcn/neo-admin/16-wechat-sdk"><img src="https://agentmods.dev/badge/rules/neoshopcn/neo-admin/16-wechat-sdk.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.04124 | $0.04124 |
| Opus 5 | $0.02062 | $0.02062 |
| Sonnet 5 | $0.00825 | $0.00825 |
| Haiku 4.5 | $0.00412 | $0.00412 |
Grade A, and why
16-wechat-sdk 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 4d 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 — 404 lines — stays where its author put it; the contents beside it link to each section on GitHub.
微信 SDK
微信相关接口使用 w7corp/easywechat 6.17+。
composer require w7corp/easywechat:^6.17
参考文档:EasyWeChat 6.x 总览
架构约定(必须实现)
业务代码不得直接使用 EasyWeChat SDK,必须通过以下封装访问:
| 路径 | 职责 |
|---|---|
App\Support\WechatManager |
统一入口;进程内单例缓存 Application / 封装实例 |
App\Support\Wechat\ConfigMapper |
将 config_center('api.wechat.*') 映射为 EasyWeChat 配置数组 |
App\Support\Wechat\MiniProgram |
小程序 |
App\Support\Wechat\Payment |
支付(下单、退款、回调) |
App\Support\Wechat\OfficialAccount |
公众号 |
WechatManager 对外静态方法(固定命名):
WechatManager::miniProgram(); // → MiniProgram
WechatManager::payment(); // → Payment
WechatManager::officialAccount(); // → OfficialAccount
WechatManager::forgetInstances(); // 测试 / Octane / 配置变更后清缓存
配置读取
微信配置必须通过配置中心读取:
config_center('api.wechat.mini', []); // 小程序
config_center('api.wechat.mp', []); // 公众号
config_center('api.wechat.pay', []); // 微信支付
配置项定义见 database/seeders/Admin/ConfigCenterDataSeeder.php → seedWechatConfig()。
禁止:
config('wechat')或 Laravel 静态配置文件承载密钥- 业务层手写
ConfigItem::query()查微信密钥 - 硬编码 appid、secret、mch_id、PEM 等
配置变更后:ConfigCenter::forgetCache() + WechatManager::forgetInstances()。
配置中心 → EasyWeChat 映射
由 ConfigMapper 集中完成,业务代码禁止散落映射逻辑。
| 配置中心 key | EasyWeChat key | 说明 |
|---|---|---|
appid |
app_id |
小程序 / 公众号 |
secret |
secret |
|
token |
token |
服务端消息校验,可选 |
encoding_aes_key |
aes_key |
消息加解密,可选 |
mch_id |
mch_id |
商户号 |
secret_key |
secret_key |
APIv3 密钥 |
private_key |
private_key |
商户 API 私钥 |
certificate |
certificate |
商户 API 证书 |
platform_cert_id + platform_cert |
platform_certs |
[id => pem],见下文 |
notify_url |
— | 仅作为下单/退款请求字段,不是 Application 构造参数 |
小程序 / 公众号 Application 额外建议:
'http' => ['throw' => true, 'timeout' => 5.0, 'retry' => true],
支付 Application 额外建议:
'http' => ['throw' => true, 'timeout' => 5.0], // 支付模块禁止开启 retry
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.
- 4d ago First seen · 404 lines · 4,124 tokens per session scan A bb38e207ce6b
16-wechat-sdk is a cursor rule published in the GitHub repository neoshopcn/neo-admin (12 stars, last pushed 2mo ago), licensed MIT. It adds 4,124 tokens to every session, about $0.0206 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-30.
Other cursor rules, from other repositories
owl-admin
🎈 Owl Admin : 基于 laravel 和 amis 开发的后台框架, 友好的组件使用体验, 可轻松实现复杂页面, 内置代码生成器, 让开发者快速搭建后台管理系统.
vue
Cursor rule "vue" from un-pany/v3-admin-vite, covering vue 开发规范, 代码风格, 命名, api and props.
ts
Cursor rule "ts" from un-pany/v3-admin-vite, covering ts 开发规范, 类型, 命名, 代码组织 and 错误处理.
project
Cursor rule "project" from un-pany/v3-admin-vite, covering 项目开发规范, 导入, 编码, 代码检查 and 本地环境.
index
你是一位高级前端工程师,精通前端架构,精通 Vue3、Vue Router、Pinia 等前端框架,精通 TS、JS 等前端语言,精通 Git 操作.
git
辅助生成 Git 提交信息和执行 Git 命令.