# Rules

Use when the user asks about Codex Rules behavior, injected project rules, supported...

- Repository: https://github.com/code-yeongyu/oh-my-openagent (70577 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add code-yeongyu/oh-my-openagent --skill rules -g -a claude-code -y`
Codex: `npx skills add code-yeongyu/oh-my-openagent --skill rules -g -a codex -y`
Cursor: `npx skills add code-yeongyu/oh-my-openagent --skill rules -g -a cursor -y`
Gemini CLI: `npx skills add code-yeongyu/oh-my-openagent --skill rules -g -a gemini-cli -y`

## Description

Use when the user asks about Codex Rules behavior, injected project rules, supported rule file locations, matching, or environment configuration.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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`.

