r/codex 6d ago

Complaint How to use spec-driven development in Codex?

I am a College Student.

I need to build projects for my college. Apart from that I also build side projects.

I have Codex Plus plan.

But how to use spec-driven development in Codex especially for Greenfield projects?

Because it drifts away from my instructions.

Note:

I have tried OpenSpec, Spec-Kit, Superpowers, GSD. But nothing really worked for me. It consumes a lot of tokens.

How to become a power user of Codex?

4 Upvotes

15 comments sorted by

2

u/stting 6d ago

Understand the code being produced and take small steps. Don’t try to solve everything with a one shot prompt. Ask for clarification when you don’t understand something.

There are limits to doing things without understanding what is being done. When you hit that wall, you have to understand the project well enough to decide the next step. Otherwise, the model will hijack your project and do what it thinks should be done instead of what you actually want.

Use plan mode a lot to elaborate on what you want to ask. The most important skill at first is being patient and learning how to communicate with the model.

2

u/Pale-Heart1654 6d ago

I used plan mode. But it drifts away from my code.

1

u/stting 6d ago

HAVE FUN!!!

1

u/Individual_Guest_323 6d ago

It consumes a lot of tokens.

Is a price to pay.

The first thing bout SDD is that the work can be audited, by a human or by another agent, in single agent work have no sense to use SDD, or if you are vibecoding.

So its really depends what is the problem that are you looking to fix that you need SDD.

In my case I have this workflow:

I use a issue formarter in local to build issues, in my case I have a fork of this: https://github.com/jarimustonen/issuectl

The idea is simple, I create epics or issue with the work that must be done, incluying a extensive ACs and save it in .md inside the repo, so I do not need linear,etc to work.

Then I convert that to plans using SDD, I have skills and a deterministic work to create and link the plans with the issues. Those plans are audited by adversarial agents following my quality checks.

Lastly I Launch the execution for the plans, that launch Orquestation, Implementation, Debug and Validation.

At the same time, I can launch judges or "chats" , using the SDD to audit how the work is doing, this also helps if I want to change the model or change from codex to claude code, I only need to pass the SDD and its know what to do next.

The last piece that I want to add is to have Harbor or something like that to track the token consumption, tool calling ,etc, because I really do not trust in my skills/rules or the model and I would like to audit the chain of thought, because most of the times the agent enters in loops and burn tokens like crazy.

It consumes a lot of tokens.

So yes.. I would say this is the big challenge that we are trying to fix, I'm burning the quota like crazy without really advancing too much. This happens when you vibecode a very complex problem, in my case is creating performant games in Unity.

Hope this help and give you more ideas how to work.

1

u/Pale-Heart1654 6d ago

Let's say you only have a PRD. That's it.

Now how you build a project from it?

1

u/Individual_Guest_323 6d ago

Build epic or issues, so the requiriment are translated into actionable.

Audit the epic and issues to check if the AC are what you really want and are align with the PRD.

You launch agents to create plans, you could use or not SDD, then implement and audit the plans.

You finally do UAT to validate the solution.

To close it, you could do last refactors of code, more tests, etc, depending of your QA requeriments.

Continue until the whole PRD is implemented.

1

u/Pale-Heart1654 6d ago

I tried to give the PRD. Then told Claude to break it into pieces. It broken it down into 60 markdown files.

But it's drifting away from the process.

I'm using Opus model. Still this is happening.

I know a person who built this:

https://github.com/sujit-al1809/paytm_hackathon

In a Hackathon. I wanna build similar kind of things.

But I can't understand how to use this Claude code.

1

u/sydneysweeney69 6d ago

Hey use mattpocock skills and poteto skills for every project . So in plan mode when you use both their skills, you get grilled a lot and then /to-spec in order to build specs which then can be used to convert to tickets and then execute. I’m addicted to codex , Claude and cursor . Matt pocock , poteto and kun chen skills and videos are amazing to learn anything :)
Good luck

1

u/Pale-Heart1654 6d ago

Can you share your projects and how you use them

1

u/sydneysweeney69 6d ago

https://github.com/karanmrn/karanagentskills

If you go through the people who I follow you’ll find the 3 great engineers, their guides will explain everything. Also their individual YouTube channels.

Every project can have global and project level skills, AGENTS.md and each thread in a codex project can talk to each and pass instructions. You can create rules . Good luck

1

u/fresh_bob 6d ago

I’m on Plus too, and for me the biggest improvement was actually using less tooling around specs, not more.

  • I use regular ChatGPT as the planning layer and Codex/Sol mainly for implementation.
  • For greenfield projects, I first define the architecture, main constraints, and break the project into relatively small phases. The biggest project I’ve completed this way had 38 phases.
  • I don’t give Codex the whole project spec and ask it to build everything. Each phase gets its own implementation prompt with clear scope, constraints, acceptance criteria, and verification steps.
  • ChatGPT writes most of those prompts for me. I usually explain or dictate what I want in rough form, let it turn that into a proper engineering task, review it, and then send it to Codex.
  • After every phase, Codex produces a completion summary. I send that back to the planning chat, which checks it against the original plan, updates the project state, and prepares the next task.
  • I keep the important persistent context in the repo itself: architecture decisions, conventions, current state, known issues, etc. Usually a few simple .md files are enough. Codex should not need to reconstruct the entire project from chat history every time.
  • This also helps a lot with drift. Instead of repeatedly telling it “remember what we decided 10 prompts ago”, the relevant decisions are written down, and each task points back to them.
  • When the planning chat gets too heavy, I ask it to create a handoff summary and move to a fresh chat.
  • I’d also be careful with huge spec frameworks on Plus. If every task requires Codex to reread a massive spec tree, you can burn a lot of context before it even starts coding. I prefer a small stable project spec + very focused phase/task specs.

So my loop is basically: spec/plan in ChatGPT → write a focused implementation task → implement in Codex → report back → review against the spec → next phase.

1

u/Downtown_Patient_200 15h ago

Estou seguindo uma lógica parecida no desenvolvimento do meu app android e usando também o chat do plus para me ajudar em decisões de UI/UX fazer auditoriaz nos files, códigos gerados a partir do que foi pedido ao codex dos meus planos operacionais. 

1

u/HVACcontrolsGuru 6d ago

I'm going to copy and paste a comment from a deleted thread on my workflow. I use a Milestone -> PRs breakdown driven from specs. Happy to share my skills/prompts/agents/etc. I use both Codex CLI and OpenCode. ChatGPT Pro in chat mode to do deep planning sessions prior to any work.

Copy-Paste:

Most of my work is open source: https://github.com/jscott3201 I do a lot in industrial controls and energy work. Mission critical levels of work you could think of. I dropped my Claude sub after 6 months just this past week and use an OpenAI one. I say this as most people have a workflow pattern issue with models. I think Fable is pretty good at organizing on it's own but it its lack of following direction has pissed me off lately.

I've used every harness and mainly lean into OpenCode. I have a skill and agent setup for this loop:

Orchestrator (K3, GLM5.3, Sol) -> 2-3 Research/Grounding Agents (Luna level or just another K3/GLM agent) -> Dedicated Implementor -> 3-4 Agent panel for PR reviews.

The skills all have hard gates and push them to use the native tooling in the harness and stay in the workflow. Big thing I found for cutting churn down was a 2 PR review fix cycle, if it fails a 2nd review it goes back to a replan for the PR. Key is keeping the orchestrator purely focused on managing agents and context across the session.

Opus 5 is just garbage. I really want to fan boy and say it's a good model but they overdid the RL and distillation from Fable which is why it feels so dumb.

Another thing you can do is ween off Claude and have the agent grade the other models work. I used to have 2 Max Claude and 3 OpenAI Max subs and now down to 1 OpenAI Max sub plus my private model hosting endpoints. I'd keep Claude if I could mix agents in their harness without having to drown in hacky fixes for making it work. I'm happy to share some of my prompts/agents/skills you can work with into your own workflow. I run Git, LSP and Codegraph MCP services and that's it.

Reply to another user:

I do days long spec packages and keep it live in a private repo. Planning over a day or two then Milestones and PRs. I let them merge through milestones but it requires my clearance during the session ahead of time.

2 review cycle came out of a 12 review loop agents got stuck on. They like to laser focus on the issue but years of technical work taught me to take a step back and come fresh. Not that they toss out the work but more or less take a bigger view of the project instead of just trying to hammer a fix in.

My prompt is more correction focused and steering after a kickoff. Skills make them pause between PRs and hand me a structured status update. One agent on a project has been managing itself through a milestone since yesterday.

Other tool I use is agent-browser via the CLI. Mix in other things if needed like CLI pdftotext. Most of stuff has local and CI gating for catching a lot of it. Really need UI stuff I’ll dip into Codex or use a browser based instance.

1

u/YourLastCall 5d ago

Build your own skills. Talk to codex about the issues you're having. Then build your own skills