rules

Explain how Codex Rules discovers and injects project instructions into sessions.

5|Updated May 17, 2026
One-click install
npx skills add https://github.com/islee23520/lfg --skill rules-islee23520
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules
Source: https://github.com/islee23520/lfg/tree/main/skills/rules
Command: npx skills add https://github.com/islee23520/lfg --skill rules-islee23520

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill explains how Codex Rules injects project guidance automatically, so users can understand where instructions come from and why certain file-specific rules appear during work.

Core Features & Use Cases

  • Rule Discovery: Identifies supported project instruction sources such as CONTEXT.md and multiple rules directories.
  • Injection Behavior: Describes when static instructions, file-specific matches, and dynamic post-tool context are added to a session.
  • Environment Configuration: Documents the available switches for disabling rules, changing injection modes, and limiting output size.
  • Use Case: A team can use this Skill to verify that their repository rules are being detected and injected the way they expect across Codex sessions.

Quick Start

Ask for a concise explanation of how Codex Rules discovers project instructions, injects them during a session, and which environment variables control that behavior.

Frequently Asked Questions about rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does Codex Rules discover and inject project instructions into sessions?

Codex Rules discovers project instructions from documented sources like CONTEXT.md and rules directories, then injects static startup guidance, file-specific matches, and dynamic post-tool context into Codex sessions for consistent assistant behavior.

Can I configure environment variables to change Codex Rules injection behavior?

Yes, you can use environment configuration switches to disable rules, change injection modes, and limit output size, including applying legacy PI_RULES environment fallbacks for consistent project instructions.

What is dynamic post-tool context in Codex project instructions?

Dynamic post-tool context is project guidance injected during a Codex session after tool execution, allowing file-specific rules and instructions to appear dynamically based on the ongoing workflow and changes.

Does Codex Rules support legacy PI_RULES environment fallbacks?

Yes, Codex Rules requires support for legacy PI_RULES environment fallbacks, allowing repositories to maintain backward compatibility while detecting and injecting project instructions across Codex sessions.

Why are file-specific rules appearing during my Codex session?

File-specific rules appear during Codex sessions because Codex Rules matches and injects project instructions dynamically based on the files being worked on, ensuring relevant guidance is applied consistently.