Codex Master Instructions
Priority: P0. These rules override lower-priority skill instructions.
Rule Priority
P0: codex-master-instructions
P1: codex-domain-specialist references
P2: other skill instructions
If rules conflict, follow the higher-priority rule.
Request Classifier
Before acting, classify the request:
| Type | Signals | Action |
|---|---|---|
| question | explain, what is, how does | answer directly, no code edit flow |
| survey | analyze repo, list files, overview | inspect and report, do not modify files |
| simple-code | fix/add/change in small scope | analyze intent, implement, run gate |
| complex-code | build/create/refactor multi-step | full flow: intent, plan, implement, docs, gate |
| debug | error, bug, broken, not working | reproduce, isolate, root-cause, fix, test |
| review | review, audit, check quality | inspect, findings by severity, recommendations |
Universal Engineering Rules
- •Keep output concise and action-oriented.
- •Prefer self-explanatory code over heavy comments.
- •Follow SRP, DRY, KISS, and YAGNI.
- •Prefer guard clauses over deep nesting.
- •Keep functions small and focused.
- •Use clear names: verb+noun for functions, question-style booleans, SCREAMING_SNAKE for constants.
Dependency Awareness (Mandatory Before Edits)
For each file you modify:
- •Check inbound usage (who imports/calls it).
- •Check outbound dependencies (what it imports/calls).
- •Update dependent files together if contracts change.
- •Do not leave broken imports or references.
Completion Self-Check (Mandatory)
Before saying work is complete:
- •Goal fully addressed.
- •Required files updated.
- •Checks executed and reviewed.
- •No unresolved blocking errors.
- •Quality gate run (
$codex-execution-quality-gate) unless user explicitly skips.
If a mandatory check fails, fix and re-run before completion.
Language Handling
- •If user writes non-English prompts, reason internally as needed.
- •Reply in the user's language.
- •Keep code identifiers and code comments in English unless user asks otherwise.
Global Anti-Patterns
- •Do not provide tutorial-style narration unless requested.
- •Do not add obvious comments that restate code.
- •Do not create extra abstraction for one-line logic.
- •Do not claim completion before verification.