rules
它能做什么
这个工具可以帮助 AI 遵循特定的项目规则。它能确保 AI 理解并应用你设定的重要指令。
适用场景
- ✓想让 AI 遵循特定项目指令时。
- ✓想设置 AI 在某些情况下的行为方式时。
- ✓需要管理 AI 必须遵守的规则时。
技能链接
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/omo-codex/plugin/components/rules/skills/rules/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“AI 在处理项目规则时应该如何表现?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会在每次对话开始时,以及 AI 应用修改之后,插入相应的指令。它还可以读取特定文件中的规则,来指导 AI 的工作。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Codex Rules
Codex Rules is automatic once the plugin is enabled. It injects:
- static project instructions on
SessionStartandUserPromptSubmit - matching file-specific rules after Codex
apply_patchby default
Dynamic PostToolUse output is injected as additional context and is deduplicated per plugin data session. Codex Rules does not rewrite tool output.
Supported project sources:
CONTEXT.md.omo/rules/**/*.md.claude/rules/**/*.md.cursor/rules/**/*.md.github/instructions/**/*.md.github/copilot-instructions.md
Supported environment knobs:
CODEX_RULES_DISABLED=1CODEX_RULES_MODE=both|static|dynamic|offCODEX_RULES_MAX_RULE_CHARS=<number>CODEX_RULES_MAX_RESULT_CHARS=<number>CODEX_RULES_ENABLED_SOURCES=CONTEXT.md,.omo/rules
The legacy PI_RULES_* variables are accepted as fallbacks for users migrating from pi-rules.
常见问题
我可以把 AI 的规则放在哪里?
你可以把规则放在 CONTEXT.md 这类文件中,也可以放在 .omo/rules/、.claude/rules/、.cursor/rules/、.github/instructions/ 等文件夹里。
如何禁用这个工具?
设置环境变量 CODEX_RULES_DISABLED=1 即可禁用。
我可以控制 AI 使用哪些规则吗?
可以。你可以使用环境变量 CODEX_RULES_ENABLED_SOURCES 指定要使用的规则文件或文件夹。
详情
作者的原始描述
Use when the user asks about Codex Rules behavior, injected project rules, supported rule file locations, matching, or environment configuration.
热度
- GitHub 星标
- 70k
- 排名
- #3114
- 许可证
- NOASSERTION
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
comment-checker
70k帮你的智能体理解并回应自动代码检查工具的反馈。适用于处理自动化代码或内容审查的结果。
lcx-contribute-bug-fix
70k帮你的智能体为 LazyCodex 相关项目贡献错误修复。它会创建 issue 或 pull request,保障代码质量。
lcx-doctor
70k让你的智能体检查 LazyCodex 和 Codex CLI 安装的健康状况。当系统在更新或改动后表现异常时很有用。
lcx-report-bug
70k帮你的智能体为 LazyCodex 项目详细报告 bug。它会创建包含有用信息的 issue,方便开发者定位并修复问题。