跳到正文
Skillpedia
技术文档70k · #3114

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/omo-codex/plugin/components/rules/skills/rules/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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 SessionStart and UserPromptSubmit
  • matching file-specific rules after Codex apply_patch by 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=1
  • CODEX_RULES_MODE=both|static|dynamic|off
  • CODEX_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.

repo: code-yeongyu/oh-my-openagent

热度

GitHub 星标
70k
排名
#3114
许可证
NOASSERTION
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能