AI coding becomes much more useful when someone owns the definition of done.

A coding agent can produce a plausible feature quickly. The harder questions are usually about the system around it. Who may access the data? Which existing behaviour must survive the change? What happens when a background job retries? What evidence would convince us that the implementation is correct?

My preferred design for this kind of work is a small AI coding team. A highly capable model acts as the architect, defines the behaviour, writes the Gherkin acceptance scenarios and assigns bounded tasks. More economical models implement those tasks. A separate verification pass checks the integrated result against the agreed contract.

OpenSpec gives that team a shared record of the intended change. The coding environment supplies the agents. The test runner supplies execution evidence. A person remains responsible for the product decisions and release.

The attraction is straightforward: spend expensive reasoning on decisions that affect the whole feature, then make the remaining work specific enough to delegate and verify. This article shows how to set that up, where the power comes from, and what the available evidence actually supports.

Why the architect role matters

Consider the request: “Add invoice exports.”

An implementation model has plenty of room to guess. It might export the current page instead of all matching invoices. It might trust an organization identifier supplied by the browser. It might protect the export request but leave the generated download accessible to another customer.

Each component could look reasonable in isolation. The failure comes from an incomplete contract between them.

I would give the architect responsibility for finding those decisions before assigning the work. It should inspect the existing request path, authorization rules, persistence layer, background jobs and tests. Its proposal should reference the real code. Then it should define the observable behaviour and the invariants that must remain true.

For our example, those invariants include tenant isolation, current authorization at download time, and a CSV containing exactly the records the user is entitled to export.

Once those decisions are explicit, implementing a query, serializer or controller becomes a much smaller reasoning task. That is the opportunity for a lower cost model.

The architect can still misunderstand the business requirement. Its job is to make the interpretation reviewable. A person must resolve questions such as whether revoked access should invalidate an existing export.

Where OpenSpec fits

OpenSpec is a specification workflow for AI coding assistants. Its repository structure separates established specifications from proposed changes. A change can contain a proposal, specification deltas, a technical design and an implementation checklist. The specifications describe behaviour; the design and tasks describe how to deliver it. [1, 2]

For an invoice export, I would use these artifacts:

Artifact What it should answer
proposal.md Why is the export needed, and what is in scope?
specs/invoice-export/spec.md What must users be able to do, and what must be prevented?
design.md Where are authorization, job execution and storage handled?
tasks.md Which bounded changes implement the agreed behaviour?
features/invoice_export.feature Which executable acceptance scenarios check the behaviour?

The first four sit under openspec/changes/add-invoice-export/. The .feature file belongs in the application's test suite; it is an addition to this workflow, not a file that OpenSpec automatically turns into a working test. [2, 9, 10]

This gives each agent something durable to work from. A worker can receive the relevant requirement, interface and task without receiving the entire conversation that led to them. When a requirement changes, the team updates the contract visibly and checks which tasks and scenarios are affected.

Choose models by responsibility

“Ultra” needs a precise definition. In ChatGPT Work and Codex, model choice and reasoning effort are separate controls. Ultra is available only for supported models and eligible accounts, and enables proactive delegation. It is not a universal model name. [6, 7]

A concrete starting arrangement is:

Role Example configuration Responsibility
Architect GPT-6 Astra with Ultra where supported Architecture, requirements, Gherkin scenarios and integration decisions
Repository explorer GPT-6 Luna with High reasoning Find relevant code, interfaces and existing tests
Implementer GPT-6.1 Sol with Medium reasoning Implement a bounded task and focused lower-level tests
Acceptance reviewer A separate GPT-6.1 Sol session with High reasoning Check scenario bindings, the integrated patch and execution evidence
Escalation reviewer Astra when a task warrants it Resolve difficult authorization, migration or cross-component questions

These are starting choices, not a benchmark ranking. OpenAI positions Sol below Astra in cost and Luna for focused work. Check availability in your own account and measure how each configuration handles your repository. [6]

Route by ambiguity and consequence. A small authorization change can deserve the strongest model. A large mechanical transformation may be suitable for a cheaper worker if its rules and checks are clear. Repeated failures are a reason to improve the task or escalate it, rather than keep retrying at the same tier.

For a difficult task, the architect can take over implementation. The roles describe how to allocate work; they should not prevent the strongest model from writing the code that needs its capabilities.

Configure the team in Codex

The example below follows the current local Codex configuration documented at the time of writing. Merge these settings into your existing project configuration. Use a reasoning level actually supported by the selected model and client; inspect the available choices with /model. [6, 8]

In .codex/config.toml:

model = "gpt-6-astra"
model_reasoning_effort = "ultra"

[agents]
enabled = true
max_concurrent_threads_per_session = 3
default_subagent_model = "gpt-6.1-sol"
default_subagent_reasoning_effort = "medium"

The cap excludes the main agent. Explicit worker defaults matter: without overrides, subagents can inherit the parent's model and reasoning effort. A team of inherited premium agents can consume considerably more resources than intended. [7, 8]

Define project agents in standalone TOML files under .codex/agents/. Set both the model and reasoning effort so the role has a deliberate configuration. [7]

For .codex/agents/repo_explorer.toml:

name = "repo_explorer"
description = "Map code and tests relevant to a bounded change."
model = "gpt-6-luna"
model_reasoning_effort = "high"
developer_instructions = """
Inspect without editing. Return file and symbol references,
existing interfaces, relevant tests and unresolved questions.
Do not make product or architecture decisions.
"""

For .codex/agents/implementer.toml:

name = "implementer"
description = "Implement a task from an agreed OpenSpec change."
model = "gpt-6.1-sol"
model_reasoning_effort = "medium"
developer_instructions = """
Work within the assigned scope and owned files.
Follow the agreed specification and interfaces.
Do not weaken acceptance scenarios to make code pass.
Escalate missing decisions or necessary contract changes.
Return the patch, commands run and observed results.
"""

For .codex/agents/acceptance_reviewer.toml:

name = "acceptance_reviewer"
description = "Review acceptance coverage and the integrated patch."
model = "gpt-6.1-sol"
model_reasoning_effort = "high"
developer_instructions = """
Review without editing. Start from the agreed behaviour.
Inspect test bindings, fixtures and the integrated diff.
Check negative paths and identify missing evidence.
Report concrete findings with file references.
Separate observed results from checks that were not run.
"""

These instructions coordinate behaviour. They do not create separate security boundaries: custom agents inherit the parent's permissions and provider. Enforce any required restrictions through the execution environment and repository controls. [7]

Start with a small team. More workers are useful only when there are enough independent tasks to keep them productive.

Initialize OpenSpec and define the change

For the npm installation, the current OpenSpec README requires Node.js 22.12.0 or newer. Run these commands in the terminal, choosing Codex during initialization: [1]

npm install -g @fission-ai/openspec@latest
cd your-project
openspec init
openspec --version

Record the installed version. For a repeatable team setup, pin the version you have tested rather than letting every machine silently adopt a new release.

The current Codex integration installs OpenSpec skills under .agents/skills/. In the Codex conversation, invoke the proposal skill like this: [3]

$openspec-propose add-invoice-export

Follow it with the actual requirement:

Allow organization administrators to export their organization's
invoices as CSV.

Inspect the existing authorization, invoice query, job and storage
paths first. Define the export's columns and record selection.

Specify authorization for requesting and downloading the export,
including access after membership is revoked.

Create the OpenSpec planning artifacts. As architect, also write
Gherkin acceptance scenarios in features/invoice_export.feature.
Identify unresolved business decisions before implementation.

OpenSpec's documentation often uses /opsx:propose as the canonical workflow name. Invocation varies by coding assistant; $openspec-propose is the documented Codex form. The standard profile includes proposing, exploring, applying, updating, syncing and archiving changes. To add verification, select it with openspec config profile, then run openspec update. [3, 5]

Before implementation, review the scope and scenarios. Resolve meaningful business ambiguities together, then let the team handle routine development within the agreed boundaries.

Have the architect write the acceptance scenarios

Gherkin expresses behaviour through an initial state, an action and an expected outcome. The text becomes executable when its steps are connected to code through step definitions. [9]

For this example, we choose these product rules: only active organization administrators may export invoices; every export belongs to one organization; download authorization is checked again; and inaccessible export identifiers return a generic 404. Those are decisions for this example, not OpenSpec defaults.

The architect can write:

Feature: Organization invoice exports

  Background:
    Given Alice is an administrator of organization Alpha
    And Alice has no membership in organization Beta
    And Alice is authenticated

  @EXPORT_01
  Scenario: Export exactly the authorized invoices
    Given Alpha has invoices "A-001" and "A-002"
    And Beta has invoice "B-001"
    When Alice requests an invoice export for Alpha
    And the export job completes
    And Alice downloads the resulting export
    Then the response status should be 200
    And the CSV invoice references should be exactly:
      | reference |
      | A-001     |
      | A-002     |

  @EXPORT_02
  Scenario: Reject another organization's export
    Given Beta has a completed invoice export
    When Alice requests that export's download by its identifier
    Then the response status should be 404
    And the response should contain no invoice data
    And the response should contain no storage download URL

  @EXPORT_03
  Scenario: Reject a download after access is revoked
    Given Alice has a completed invoice export for Alpha
    And Alice's membership in Alpha is revoked
    When Alice requests that export's download by its identifier
    Then the response status should be 404
    And the response should contain no storage download URL

These scenarios expose three different responsibilities: selecting the correct records, authorizing access to the stored artifact, and respecting a change in membership. A successful CSV download alone would tell us little about the last two.

They are a starting set. A complete change also needs the applicable request-authorization, empty-result, pagination, date-boundary, failure and retry cases. If the design uses signed storage URLs, decide what revocation can realistically guarantee after a URL has already been issued. A requirement that conflicts with the storage design must be resolved before claiming the scenario proves it.

Use stable scenario tags to connect requirements, tasks and test results. Keep that mapping short enough to maintain.

Turn the scenarios into execution evidence

For a PHP application, Behat can execute Gherkin scenarios through PHP step definitions. Its documentation describes this as an example-based conversation connected to automated checks. [10]

The test specialist should implement bindings that exercise the real application boundary. For the export, that means authenticated requests, realistic tenant fixtures, deterministic job execution, and parsing the produced CSV.

The word “exactly” matters. The assertion should compare the complete set of invoice references. Checking that a file exists or contains two rows would allow two incorrect rows to pass.

Before implementation, confirm the relevant scenario fails because the behaviour is missing or wrong. An undefined step or broken fixture is a harness problem, not useful evidence of a missing feature. For a critical authorization boundary, a controlled local mutation can also check whether the test detects the defect it is supposed to prevent.

In a repository that already has these tools and bindings configured, a verification sequence might include:

openspec validate add-invoice-export --strict
vendor/bin/behat features/invoice_export.feature --strict
vendor/bin/phpunit

The OpenSpec command checks specification structure and related consistency rules. It does not run the application acceptance suite. Behat needs working bindings, fixtures and application configuration; copying a .feature file does not supply them. Run the project's existing static analysis and relevant integration checks as well. [4, 10]

Make the acceptance suite a required CI check and reject undefined or pending steps. Behat's --strict requires explicitly passing tests; a dry run does not execute them. OpenSpec's verification workflow is an AI review that can report gaps without blocking archival, so the repository must enforce its own acceptance rules. [16, 17]

Keep the acceptance contract under review. Implementation workers may propose corrections, but they should not silently delete or weaken a failing scenario. Review changes to bindings too: a step can keep its reassuring name while its assertion becomes meaningless.

The same model can misunderstand a requirement and write code that perfectly satisfies that misunderstanding. Human review of the examples and a verification pass grounded in the original requirement reduce that risk. Model diversity alone does not establish independent evidence.

Delegate work with a clear contract

Once the design and behaviour are agreed, give the architect an explicit delegation instruction:

Act as architect and coordinator for add-invoice-export.
Keep ownership of the OpenSpec contract and Gherkin semantics.

Use repo_explorer for targeted code discovery. Delegate bounded
implementation tasks to implementer. Give each worker requirement
IDs, relevant interfaces, owned files and completion checks.

Parallelize only tasks with stable, independent boundaries.
Return unresolved business or interface decisions to the architect.
After integration, use acceptance_reviewer for a separate review.

Do not mark work complete from a worker summary alone.
Report the integrated revision, commands actually run, observed
results and any remaining gaps.

In Codex, the application phase is invoked with $openspec-apply-change add-invoice-export. Verification uses $openspec-verify-change add-invoice-export when that workflow is enabled. After review and successful checks, $openspec-archive-change add-invoice-export closes the change and handles the specification update workflow. [2, 3, 5]

Separate working directories or Git worktrees can prevent workers from overwriting each other's edits. They do not eliminate semantic conflicts. The architect still needs to agree shared interfaces, sequence dependent work, integrate patches and run checks against the resulting revision.

For example, building CSV serialization and preparing acceptance fixtures can proceed together once the format is settled. Changing an export job's payload while another worker implements its consumer requires coordination.

Also give workers a resource budget: a bounded investigation, a limit on unproductive retries, and a clear condition for escalation. A smaller model repeatedly reading the whole repository can erase its price advantage.

Why this setup can be powerful

The first benefit is that a good decision becomes reusable. Once tenant ownership and download authorization are defined, every implementation task can refer to the same rules. The architect does not need to rediscover them in every coding session.

The second is that cheaper execution becomes easier to supervise. A worker implementing an agreed serializer has a precise input, output and test target. Its result can be evaluated with much less interpretation than a response to “build the export feature.”

The third is that review has a concrete reference point. You can ask which requirement a change implements, which scenario checks it, and which execution result supports the claim that it works. That is useful when debugging, onboarding another developer or revisiting a decision months later.

There is also a possible speed benefit when work separates cleanly. Exploration, independent implementation tasks and targeted reviews can overlap. The gain depends on the dependency graph and integration work; spawning agents does not make sequential work parallel.

These are engineering reasons to try the approach. The size of any productivity or cost improvement still needs measurement.

What published benchmarks actually show

There is relevant evidence for combining stronger and cheaper models. There is also evidence that poor delegation makes coding more expensive. These studies measure different systems and tasks; none establishes a performance figure for the exact OpenSpec, Astra, Sol and Gherkin configuration described here.

Strong and weak model collaboration can reduce generation cost

An EMNLP 2025 study evaluated collaboration on 300 SWE-bench Lite issues from 11 Python repositories using Agentless Lite. In one configuration, o3-mini produced the initial patch and Qwen2.5-Coder-32B handled subsequent refinement. It resolved 99 of 300 issues, or 33.0%, compared with 101 of 300, or 33.7%, for o3-mini alone, at about 40% lower reported generation cost. [11]

That supports selective delegation. The study's separate strong-planner and weak-generator strategy resolved 25.3% with the same model pairing. The successful configuration still used the stronger model to write the initial code. Its costs excluded the common retrieval stage and human review, and it did not evaluate OpenSpec or Gherkin. These are useful results for designing a team, without establishing a general saving for an architect-only premium model. [11]

A capable manager helped a cheaper coding worker

A March 2026 preprint evaluated a Sonnet 4.6 manager directing a GPT-5-mini worker on 200 SWE-bench Lite instances. The combined system resolved 62%, compared with 60% for the stronger model alone and 51% for the weaker model alone. [12]

The useful finding is that structured direction brought the cheaper worker close to the stronger baseline in this experiment. The two percentage point lead is not evidence of universal superiority. The paper's token-cost figures are estimates from typical prompt sizes and session lengths, not measured API bills. [12]

The cheapest implementation workers are not always economical

An October 2026 preprint studied agent teams on ProgramBench, which asks agents to reconstruct programs from a reference executable and documentation. Teams improved reward but incurred three to seven times the inference cost of solo agents. A carefully allocated team of 17 mixed-model agents came within 1.4 reward points of a five-agent team using stronger models throughout, at 70% lower cost relative to that team. [13]

The qualification matters for this article: cheap workers helped with planning, while cheap implementation workers reduced reward in that setting. This supports a cautious allocation: use inexpensive agents for exploration and well-bounded work, retain capable implementers, and let observed results decide what can move to a cheaper tier. The study used different model generations and a specialized reconstruction benchmark. [13]

Perceived speed needs a reality check

METR's early-2025 randomized study of 16 experienced developers and 246 real repository tasks found that AI access increased completion time by 19%, despite developers believing it helped. That is a historical result for those tools and conditions. [14]

METR's February 2026 follow-up said its newer data suggested more benefit, but recruitment, task selection and time measurement problems made the size unreliable. It would be misleading to present the earlier slowdown as a settled verdict on today's coding agents. The durable lesson is to measure completed work and human effort. [15]

Taken together, the evidence justifies testing a mixed team. It also explains why the contract, worker capability and coordination overhead deserve as much attention as the model names.

Understand the economics before claiming savings

A mixed team is economical only if its total cost falls for an equivalent accepted result.

Here is a deliberately hypothetical example, expressed in normalized cost units. These are assumptions to illustrate the calculation, not vendor prices or measured project results.

Work One premium workflow Mixed team
Architecture and acceptance design 25 25
Implementation 45 20
Verification 20 10
Coordination and rework 10 15
Total 100 70

Under those assumptions, the mixed team costs 30% less. If its retries and coordination add another 40 units, the total becomes 110 and the saving disappears.

That is why I would optimize for cost per independently accepted change. Include the cost of failed attempts, premium escalations, tool execution and human review. For subscriptions, record consumed credits or usage and review time; token prices alone may not describe the bill.

An acceptance suite also has a cost to write and maintain. Its value is greater when the behaviours matter, recur across changes, or protect boundaries where a regression would be expensive.

Benchmark the workflow on your own repository

Choose a representative pilot, perhaps 20 to 30 changes covering ordinary feature work, defects and a few demanding integrations. Treat that as a practical starting sample, not automatic statistical proof.

Compare configurations that answer distinct questions:

Configuration What the comparison investigates
One premium agent with an agreed spec and acceptance suite A disciplined single-agent baseline
An all-premium team with the same contract The effect of delegation
A premium architect with cheaper workers and the same contract The additional effect of model allocation

Keep the starting commits, task definitions, tools, acceptance criteria and budgets comparable. Run each configuration in a clean checkout. Randomize order where practical and repeat enough tasks to see whether a result is stable. Use a reviewer who does not know which configuration produced the patch when feasible.

Record acceptance rate, total model and tool cost, human review minutes, elapsed time to acceptance, rework, and regressions found after acceptance. Include abandoned attempts; otherwise a cheap-looking workflow may simply be failing more often.

Calculate cost per accepted change as total experiment cost, including failures, divided by the number of independently accepted changes. Also report quality and review effort separately. A cheaper workflow that transfers its work to the human reviewer may be a poor trade.

If you also want to measure the effect of OpenSpec or writing acceptance scenarios first, add that as a separate comparison. Changing the models, prompting, specification process and tests simultaneously prevents you from knowing what caused the result.

Where I would use it

I would start with a feature large enough to contain independent work, with an existing test harness and clear business outcomes. An API capability spanning authorization, persistence and a user-visible result is a useful candidate.

A one-line correction rarely needs a team. A deeply uncertain redesign may need more concentrated architectural investigation before delegation helps. High-consequence changes deserve strong review even if their implementation is short.

Gherkin is most valuable where concrete examples help people agree on behaviour. Unit tests remain useful for detailed logic; integration tests verify component interactions; performance and security checks address questions a small acceptance suite cannot settle.

Conclusion

An Ultra architect with lower cost coding specialists is a practical way to concentrate strong reasoning on consequential decisions. OpenSpec keeps those decisions attached to the change. Gherkin makes selected behaviours explicit, and executable tests provide evidence that the implementation satisfies them.

The quality of the arrangement depends on the contract, task boundaries and verification. More agents will not repair an ambiguous requirement, and passing tests cannot prove behaviours nobody thought to specify.

Start with one meaningful feature. Agree the acceptance examples, configure the worker models explicitly, integrate the result and measure the total effort required to accept it. Expand the team when the evidence shows that it helps.

For a team building with coding agents, the engineering responsibility becomes very clear: decide what must be true, make that decision reviewable, and demand evidence before calling the work complete.

If you want an independent assessment of your AI-built product's architecture, data access and change safety, you can discuss a scoped technical review at egircys.com.

Sources

  1. OpenSpec repository and installation

  2. OpenSpec concepts and change artifacts

  3. OpenSpec supported tools and exact invocation syntax

  4. OpenSpec CLI reference

  5. OpenSpec OPSX workflow and profiles

  6. OpenAI model guidance

  7. OpenAI subagents and custom agent configuration

  8. OpenAI configuration reference

  9. Cucumber Gherkin reference

  10. Behat quick start

  11. Gandhi and colleagues, An Empirical Study on Strong-Weak Model Collaboration for Repo-level Code Generation, EMNLP 2025

  12. Liu, Can AI Models Direct Each Other, March 2026 preprint

  13. Samway and colleagues, Scaling Inference-Time Compute with Teams of Coding Agents, October 2026 preprint

  14. METR, Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity

  15. METR, We are Changing our Developer Productivity Experiment Design, February 2026

  16. Behat command-line reference and strict execution

  17. OpenSpec reviewing changes and verification boundaries