Generate a Precise AGENTS.md Routing Map for Codex
Create an AGENTS.md configuration that restricts Codex test execution to specific workspace directories, preventing inefficient repo-wide test runs.
Agent prompt for ChatGPT
Prompt
mkdir -p .agents/skills/generate-a-precise-agents-md-routing-map-for-codex && curl -sL "https://prompts-gpt.com/prompts/generate-a-precise-agents-md-routing-map-for-codex/raw" -o .agents/skills/generate-a-precise-agents-md-routing-map-for-codex/SKILL.md---
name: generate-a-precise-agents-md-routing-map-for-codex
description: "Create an AGENTS.md configuration that restricts Codex test execution to specific workspace directories, preventing inefficient repo-wide test runs."
---
# Generate a Precise AGENTS.md Routing Map for Codex
Create an AGENTS.md configuration that restricts Codex test execution to specific workspace directories, preventing inefficient repo-wide test runs.
## Prompt
```
You are a Senior Infrastructure Engineer. Your job is to generate an AGENTS.md file for a monorepo that routes Codex task execution to specific sub-package test commands. 1. Map every subdirectory in the root to a specific test command prefix. 2. Use a YAML-based structure for the routing table. 3. Include a priority field for each route. 4. Explicitly state that Codex must only trigger tests within the path of the modified files. 5. Do not invent external dependencies or CI tools. Please ask the following 3 questions first and wait for my reply: 1. What are the primary sub-directories in your monorepo? 2. What is the test command for each directory? 3. Do you have any shared utility libraries that require cross-package testing? This is technical configuration for repository automation.
```
## Usage Notes
Use this prompt when working with Codex or ChatGPT to configure agent behavior in a monorepo. Have your directory structure and test scripts ready. Paste the prompt, answer the three questions, and receive the formatted AGENTS.md content.
You are a Senior Infrastructure Engineer. Your job is to generate an AGENTS.md file for a monorepo that routes Codex task execution to specific sub-package test commands. 1. Map every subdirectory in the root to a specific test command prefix. 2. Use a YAML-based structure for the routing table. 3. Include a priority field for each route. 4. Explicitly state that Codex must only trigger tests within the path of the modified files. 5. Do not invent external dependencies or CI tools. Please ask the following 3 questions first and wait for my reply: 1. What are the primary sub-directories in your monorepo? 2. What is the test command for each directory? 3. Do you have any shared utility libraries that require cross-package testing? This is technical configuration for repository automation.Example output
Tips and common edits
Why this works
- Forces path-scoped execution to prevent slow repo-wide test runs.
- Uses a structured YAML format that is easy for agents to parse.
- Includes a priority system to handle critical packages first.
Use this prompt when working with Codex or ChatGPT to configure agent behavior in a monorepo. Have your directory structure and test scripts ready. Paste the prompt, answer the three questions, and receive the formatted AGENTS.md content.
Common edits
- Adjust the priority levels if certain packages are more critical.
- Add new routes if you add more sub-directories to the monorepo.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Draft Security Guardrails for AGENTS.md Configuration
Generate a robust security policy for AGENTS.md to restrict dangerous shell operations, credential access, and destructive commands in automated environments.
Generate Reproducible Bug Fix Specs for Coding Agents
Get a standalone reproduction test script and a precise technical plan to fix a bug, ensuring your AI agent stays focused and avoids unnecessary file changes.
Structure a Multi-Repo Dependency Update Brief for Coding Agents
Generates a structured execution brief for AI coding agents to update shared dependencies across repos without silent breaking changes.
Create Automated Verification Loops for Long-Running Coding Agents
Generate a deterministic shell pipeline that combines linting, isolated unit testing, and diff-budget monitoring to validate AI agent code changes.
Create Selective Pre-Commit Hooks for Claude Code
This prompt generates a bash script that triggers specific tests and typechecks only for packages modified in your current git branch.
Design a Sandbox Security Policy for Autonomous Coding Agents
Generate a rigorous security policy for autonomous agents to define allowed shell commands, file access boundaries, and network restrictions.
- Build an AGENTS.md Routing Map for Monorepo Codex Tests
- Write a Safe Automation Script with Dry Run and Error Handling
- Headless Claude Code Script for CI: claude -p Task With Exit Codes and Output Checks
- Should This Be an Agent? Single Agent, Workflow or Plain Script Decision
- Claude Code Hook Writer: Auto-Run Lint, Typecheck or Tests After Edits
- Automated Dependency Upgrade and Rollback Protocol