Write effective Codex AGENTS.md instructions | DevPrompt Lab

Use scoped AGENTS.md files to explain repository boundaries and verified workflows.

rule · AI tooling · beginner

English Tiếng Việt

A guide for hierarchical Codex instructions that are specific, testable, and safe to maintain.

Reusable content

Write `AGENTS.md` instructions for the directory scope where they apply. Explain architecture boundaries, files or generated outputs to preserve, validated commands, relevant testing requirements, and safety constraints for data or migrations. Keep each rule actionable and avoid repeating the task request. For nested directories, add a more specific file only when its rules differ. Verify that each command works in the intended environment and that child instructions do not conflict with the root.

Repository map: {{REPOSITORY_MAP}}

Verified commands: {{COMMANDS}}

Safety rules: {{SAFETY_RULES}}

How to use it

Follow the current Codex instruction-loading rules for parent and nested AGENTS.md files.

Example

For migration work, verify a restore-tested backup first. Automated DB tests must hard-fail unless APP_ENV=test and DB_NAME=devpromptlab_test.