global_rules

Global Cursor rules for an AI assistant that helps manage WeReply, a WeChat reply-suggestion tool. They define Chinese communication requirements and a development process for code changes.

In plain words
What is it for?
Use them when working on WeReply features, bugs, or documentation, especially changes involving WeChat monitoring, DeepSeek API calls, or communication between its Rust and platform components.
Why use it?
They give the assistant consistent project context, planning rules, testing expectations, and quality checks before it changes code.

Cursor rule for Cursor

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 rules/cacr92/wereply/global_rules
Clone the repo
git clone --depth 1 https://github.com/cacr92/WeReply

Made for: Cursor.

Per session 3,510 This file is loaded in full into every session.
When invoked 3,510 The same file — it is already loaded in full.
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.03510 $0.03510
Opus 5 $0.01755 $0.01755
Sonnet 5 $0.00702 $0.00702
Haiku 4.5 $0.00351 $0.00351

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

Security

Grade A, and why

global_rules 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.

.cursor/rules/global_rules.mdc · 387 lines

How it starts

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

WeReply - 微信回复建议助手 - Cursor 规则

快速参考: 本文件包含核心工作流和编程规范。详细技术规范请参考 .claude/rules/ 目录。


AI 行为准则

对话启动要求

每次新对话开始时,AI 必须:

  1. 重新完整阅读并理解本规则文件的所有内容
  2. 在回复用户之前,内化所有编码准则和执行协议
  3. 严格按照本规则文件中定义的开发流程执行任务
  4. 在整个对话过程中始终遵守这些规则,不得偏离

沟通规范

  • 问候语: 对话开始时,以"你好,主人!我是+模型名字"作为开场白
  • 沟通语言: 必须使用中文进行交流
  • 专业性: 保持专业、客观、技术导向的沟通风格

任务处理流程

非开发任务(咨询、解释、分析)

  1. 需求分析 - 列出需求点
  2. 任务分解 - 分解为具体子任务
  3. 执行说明 - 说明正在执行的操作
  4. 标记进度 - 实时标记完成状态

开发任务(代码修改、新功能、Bug修复)

必须执行开发流程(6步核心 + 可选步骤),详见下方。


开发流程

核心原则

  • Plan-First Workflow - 先计划后编码(复杂任务)
  • 使用 feature 分支开发 - 永不直接修改 main 分支
  • 灵活执行 - 简单任务可跳过部分步骤
  • TDD 优先 - 先写测试后写代码
  • 质量保障 - 完成前必须验证

阶段 1:计划与设计(复杂任务时)

步骤 1:需求分析

触发时机: 新功能、复杂任务、不清楚的需求

作用:

  • 探索用户意图和需求
  • 澄清技术实现细节(WeReply 特定:微信监听、DeepSeek API、IPC 通信等)
  • 讨论设计方案和权衡
  • 确定功能范围

何时跳过:

  • 简单的 bug 修复
  • 文档更新
  • 明确的小改动
  • 单文件样式调整

步骤 2:编写实现计划

触发时机: 复杂功能、重构任务、跨模块修改

作用:

  • 生成详细的实施计划
  • 识别关键文件和依赖(参考 .claude/rules/01-project-overview.md
  • 考虑架构权衡(Rust Orchestrator ↔ Platform Agent ↔ DeepSeek API)
  • 用户审批后执行

何时跳过:

  • 单文件修改
  • 明确的 API 调整
  • 简单的样式更新
  • UI 文本修改

WeReply 特定考虑:

  • Agent 通信影响
  • DeepSeek API 调用变更
  • 微信监听逻辑修改

阶段 2:开发实施

步骤 3:创建功能分支(强制执行)

所有涉及代码修改的任务都必须执行

git checkout -b feat/your-feature-name
# 或
git checkout -b fix/bug-description

分支命名规范:

  • feat/ - 新功能(如:feat/add-voice-reply-support
  • fix/ - Bug 修复(如:fix/agent-timeout-issue
  • refactor/ - 重构(如:refactor/ipc-protocol
  • perf/ - 性能优化(如:perf/optimize-deepseek-cache
  • test/ - 测试相关(如:test/agent-communication

绝对禁止: 直接在 main 分支上修改代码


步骤 4:TDD 实现(强制执行)

所有新功能和 bug 修复都必须执行

TDD 流程:

  1. 编写测试 - 先写失败的测试
  2. 实现代码 - 编写最小可用代码
  3. 运行测试 - 确保测试通过
  4. 重构 - 优化代码质量
  5. 重复 - 循环直到功能完成

覆盖率要求:

  • 整体覆盖率:≥ 80%
  • 核心业务逻辑:≥ 90%
  • 工具函数:≥ 95%

WeReply 特定测试重点:

  • Agent 通信异常测试(超时、崩溃、格式错误)
  • DeepSeek API 调用失败测试(网络错误、超时、限流)
  • IPC 消息验证测试(恶意消息、格式错误)
  • 微信监听去重测试

Read the full file on GitHub · 387 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 · 387 lines · 3,510 tokens per session scan A 83b12db7f2ae

Subscribe to this mod's changes

global_rules is a cursor rule published in the GitHub repository cacr92/WeReply (6 stars, last pushed 7mo ago), licensed MIT. It adds 3,510 tokens to every session, about $0.0175 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.