Following this suggestion, I added the following sections to AGENTS.md to make sure that codex always writes subagent-friendly plans and uses subagents more proactively. They worked well.
## Additional Agent Operating Rules
### Context7
- ALWAYS proactively use Context7 when I need library/API documentation, code generation, setup or configuration steps without me having to explicitly ask.
- External libraries/docs/frameworks should be guided by Context7.
### Planning
- All plans MUST include a dependency graph.
- Every task in a plan must declare `depends_on: []` using explicit task IDs such as `T1`, `T2`.
### Execution
- Complete all tasks from a plan without stopping for permission between steps. Use best judgment, keep moving.
- Only stop to ask when a step is destructive/irreversible or there is a genuine blocker.
### Subagents
- Spawn subagents automatically when:
- Parallelizable work (e.g., install + verify, npm test + typecheck, unblocked tasks from plan)
- Long-running or blocking tasks where a worker can run independently.
- Isolation for risky changes or checks
- Code review would be helpful
- If you're launching subagents for parallelization, add this robust context to your prompt:
- **Context**: Share plan file location and info if available
- **Dependencies**: What work/files are completed? Any dependencies?
- **Related tasks**: Any adjacent tasks, files, or agents?
- **Exact task**: Description, file paths/names, acceptance criteria
- **Validation**: How to validate work if possible.
- **Constraints**: Risks, gotchas, things to avoid
- **Be thorough**: Provide ANY/ALL context that will aid success.
- ALWAYS wait for all subagents to complete before yielding.
### Bugs
- Add a regression test when it is appropriate for bug-related changes.