Back/Engineering/Codex
AdvancedEngineering

How to Architect Complex Software Projects with OpenAI's Plans.md Technique

Use a reusable Plans.md rubric to make Codex produce a self-contained, milestone based implementation plan for a complex change. Alex plans a Python SDK from an existing TypeScript SDK before asking Codex to build it.

How to Architect Complex Software Projects with OpenAI's Plans.md Technique

Alex copies OpenAI's planning guidance into Plans.md, asks Codex to plan a Python SDK from the TypeScript SDK, reads the resulting 120 line plan, and then invokes it in a new chat.

Before you start

What you need

  • A repository with a complex feature or migration
  • Codex
  • A Plans.md file that defines the expected plan structure
  • Existing implementation or documentation the plan can cite

What you’ll make

A self-contained implementation plan with architecture, milestones, file references, validation commands, and a progress record Codex can execute.

Tools used

  • Codex

    OpenAI's cloud-based AI software engineering agent that can execute code, run tests, and handle complex multi-file tasks autonomously.

    VisitCodex

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

4 steps

Step01

Create a `Plans.md` File

Add a Plans.md file at the repository root using the planning rubric your team wants Codex to follow. Require a self-contained document, milestones, concrete repository references, validation, decisions, and a progress section that stays current during execution.

Step02

Generate the Implementation Plan

Describe the complex goal and ask Codex to use Plans.md. Save the result to a named file in the repository so it can be inspected, revised, and invoked from a clean implementation session.

Example prompt
Using Plans.md, create a self-contained plan for building a Python SDK based on the TypeScript SDK in this repository. Identify the current API surface, naming and error conventions, package structure, tests, documentation, and release setup. Break the work into testable milestones and save the plan to sdk-plan.md.
Step03

Review and Iterate on the Plan

Read the plan for repository specific evidence, architectural choices, milestone boundaries, and test commands. Ask for changes in the same planning chat so Codex retains the analysis that led to the first draft.

Example prompt
Revise sdk-plan.md so each milestone names the source TypeScript files, target Python modules, compatibility decisions, and commands that prove the milestone works. Add an explicit decisions section and unresolved questions. Keep the existing repository conventions.
Step04

Execute the Approved Plan

Start a clean Codex implementation chat and point it to the saved plan. Have it work milestone by milestone, update the progress section, and run the validation commands recorded in the document.

Example prompt
Implement sdk-plan.md milestone by milestone. Keep its progress and decisions sections current as you work. Run the validation commands for each milestone before moving on, and finish with a summary of completed work and any unresolved items.

What good looks like

  • The plan names the existing code and conventions it will reuse.
  • Milestones have concrete deliverables and validation commands.
  • Important decisions and unknowns are explicit.
  • A fresh Codex chat can implement the plan without recovering missing context.

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

The plan could apply to any repository
Ask Codex to cite concrete files, symbols, tests, naming conventions, and package boundaries from the current codebase.
The plan is too large to execute reliably
Split it into milestones with independently testable outputs and identify dependencies between them.
Implementation choices change but the plan does not
Update the plan in the original planning chat so the rationale, milestones, and progress remain aligned before continuing execution.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready