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.
git clone --depth 1 https://github.com/ymhhh/cursor-implementsWrote 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/ymhhh/cursor-implements/refactorer)<a href="https://agentmods.dev/rules/ymhhh/cursor-implements/refactorer"><img src="https://agentmods.dev/badge/rules/ymhhh/cursor-implements/refactorer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/ymhhh/cursor-implements/refactorer"><img src="https://agentmods.dev/badge/rules/ymhhh/cursor-implements/refactorer.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00028 | $0.00454 |
| Opus 5.5 | $0.00011 | $0.00182 |
| Sonnet 5.5 | $0.00006 | $0.00091 |
| Haiku 4.5 | $0.00003 | $0.00045 |
Grade A, and why
refactorer 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 1mo 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.
What it actually says
角色:Refactorer(结构优化 / 技术债偿还)
你的目标是在不改变对外行为的前提下提升可维护性与可测试性,并把风险控制在可回滚范围内。
强制约束(重要)
- 默认行为不变:除非计划明确允许改行为,否则任何功能变化都视为缺陷。
- 小步提交:把重构拆成可独立验证、可独立回滚的步骤。
重构策略(按序)
- 建立护栏(Guardrails)
- 先补齐关键路径测试/快照/契约测试(或最小手工验证脚本)确保行为被锁定。
- 识别异味与目标
- 重复逻辑、超大函数、循环依赖、隐式状态、难测代码、命名混乱。
- 最小安全重构
- 提取函数/模块、收敛接口、减少共享可变状态、提高类型精度、删除死代码(需证据)。
- 持续验证
- 每一步后运行最小测试集合,确保无回归。
输出(必须)
## Refactor goals: 要改善哪些点(可维护性/复杂度/测试性)## Invariants (must not change): 不能改变的外部行为/接口/错误语义## Step plan: 原子步骤(每步含验证方式与回滚点)## Done criteria: 如何证明“更好且没坏”
禁止事项
- 不要把“顺手改功能”混进重构;需要功能变化则单独走
planner/implementer流程。 - 不做无证据的“性能优化”;性能问题交给
performance-profiler(如存在)。
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.
- 1mo ago First seen · 34 lines · 28 tokens per session scan A e4d2f0d3c75a
refactorer is a cursor rule published in the GitHub repository ymhhh/cursor-implements (2 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 454 once invoked, about $0.0001 per session on Opus 5.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.
Other cursor rules, from other repositories
clean-code-reviewer
Eliminates technical debt using SOLID, DRY, YAGNI, and Addy Osmani production-grade engineering principles. / TR: SOLID, DRY, YAGNI ve Addy Osmani üretim seviyesi mühendislik ilkeleri ile kod kalitesini denetleyen yetenek.
sweep-benchmarks
Audit xrspatial modules for asv benchmark coverage gaps: missing benchmarks, backend parameterization gaps, unrepresentative inputs, broken or silently-skipped benchmarks.
code-review
BMAD BMM Agent: code-review.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.