Airsc is free for everyone. If it helps you, support it with $2–$20.

Support
PluginCautionAgent workflow & memorySome setup

ruledoctor

syf2211 · syf2211/ruledoctor

An agent skill that ensures Claude, Codex, and Cursor agents read project rules (CLAUDE.md) before making code changes.

Agent Skill: read CLAUDE.md & project rules before coding. Optional CLI audit + hooks. Claude/Codex/Cursor.

15 stars1License: MITUpdated 4 months ago0 opens

Preview

▍

What you can do with it

  • Ensure your Claude Code agent always reads and adheres to project-specific coding standards defined in `CLAUDE.md`.
  • Prevent your Cursor agent from executing forbidden `git` commands by enforcing pre-defined rules.
  • Get an audit report to verify if your AI agent has followed all required documentation and project guidelines.

Safety check

Caution

Usable, but read the notes first.

  • ●npm package runs a script automatically on install.package.json

Automated scan of the repo files. Always review code you run.

From the README

开源 Agent Skill:让助手先读你的规则,再改代码

一句话:装了 Skill、新开对话后,助手会先读 CLAUDE.md / .cursorrules 和你配置的必读文档,再动手改仓库。

一键安装 · Skill 源文件 · 用户指南 · 宣传图与文案

支持 Claude Code · Codex · Cursor · OpenCode(via npx skills) npm 包 ruledoctor 尚未发布;Skill 安装不依赖 npm。

npx skills add syf2211/ruledoctor@ruledoctor -g -a codex -y

Claude Code 用 -a claude-code,Cursor 用 -a cursor。


为什么需要这个 Skill?

你已经在仓库里写了 CLAUDE.md、.cursor/rules 或 AGENTS.md,但助手仍然可能:

  • 没读就改代码,像规则不存在
  • 嘴上答应「按规范完成」,测试和提交习惯却对不上
  • 聊久了忘记项目禁忌,尤其是上下文被压缩之后

RuleDoctor 把「读规则」变成 Agent 的开场动作:默认只告诉你读了哪些文件、本场几条硬规矩(不长篇刷屏)。需要较真时,还可以用可选工具看规则有没有被遵守、危险命令有没有出现。


这个 Skill 解决什么问题?

你遇到的烦事Skill 帮你
有规则文件但助手不读开场 Read 根规则 + required_reads 清单
开场复述一整篇默认只报:文件列表 + 最多 3 条硬约束
聊久了像忘了规矩你说上下文被压缩 → 重新 Read
不知道规则有没有生效可选 CLI 报告(事后核对)
危险 git push --forceSkill 应拒绝;硬拦见 Hook

安装

npx skills add syf2211/ruledoctor@ruledoctor -g -a codex -y

Claude Code 用 -a claude-code,Cursor 用 -a cursor。

或手动复制 skills/ruledoctor → ~/.claude/skills/、~/.codex/skills/、~/.cursor/skills/。

装好后请新开一场对话,在有规则文件的项目里试一个小任务。
CC Switch:仓库 syf2211/ruledoctor,子目录 skills → 说明。

还没有规则文件?可选:node dist/index.js setup -p . 生成模板(需 clone 仓库并 build)。


怎么确认它在工作?

在有规则文件的项目里新开对话,试三件事:

验证你应看到
小任务:改 README 一行助手先列出已读规则文件 + 最多 3 条硬约束
危险请求:git push origin main --forceSkill 应拒绝;Hook 可硬拦
上下文压缩后继续助手重新 Read 规则文件与 required_reads

宣传轮播图(小红书 7 张):docs/promo/xhs/


Skill / CLI / Hook 分工

层干什么
Skill先读规则、简短汇报、口头拒绝(装这个就够大多数场景)
CLI可选,用会话记录做事后核对
Hook可选,危险 shell 硬拦截;CLI 可用时结束出报告

详见 Hook 是什么? · 用户指南


典型场景

场景助手应表现
项目有 CLAUDE.md先报读了哪些文件 + ≤3 条硬约束,再改代码
规范在 docs/ 深处配置 required_reads 后会 Read
上下文被压缩重新 Read 并简短汇报
要求 force push拒绝(硬拦需 Hook)

参与反馈

  • 真实规则失效案例:#3
  • 真实截图 / Demo GIF 征集:#1
  • 可选 CLI 发布计划:#2

仓库里其它目录(Skill 用户可忽略)

路径用途
skills/ruledoctor/你要安装的 Skill
docs/promo/宣传 PNG、文案、小红书自动化调研
docs/promos/宣传图 HTML 源码 + export-png.mjs
src/、test/可选 CLI
docs/internal/维护者笔记

维护者验证

npm run verify

这会依次跑类型检查、测试、Skill 结构校验和构建。


License

MIT

View source on GitHub