skillfed
RESEARCH

Repo0: Design-Driven Zero-to-All Code Generation

Most code-generation agents treat architecture as a given. Hand them a repo skeleton and they fill it in. Repo0 attacks the harder problem: build the entire thing from a natural-language requirements document, with no predefined file layout, no module names, no dependency graph.

The central insight is that software architecture is not fully observable from requirements alone. It only becomes legible as implementation proceeds. A component that looks cohesive on paper may turn out to group unrelated responsibilities once its sub-requirements are spelled out; two components that seemed independent may realize nearly identical requirement sets and should be merged. Treating the initial architectural plan as a fixed blueprint—as every prior method does—locks in these mistakes before a line of code is written.

Repo0's answer is a persistent architectural state called a Dual-DAG: one graph encoding requirement-level functional coordination, a second encoding implementation-level component dependencies, and an explicit alignment relation connecting the two. The separation matters. Requirement coordination edges are soft evidence for implementation dependencies, not a direct copy of them. Keeping the two graphs distinct prevents functional reasoning from being contaminated by premature implementation choices.

Structural evolution runs before code generation. In each round, two metrics drive the decisions. Cohesion measures how densely the sub-requirements assigned to a component are functionally coordinated with each other; low cohesion triggers a split. Coupling measures Jaccard similarity between the sub-requirement sets of two components; high coupling with sufficient connectivity triggers a merge candidate, which an LLM then validates. The loop terminates when a full round produces no eligible split or merge—an explicit convergence criterion rather than a fixed budget.

That convergence criterion turns out to be the key differentiator. The paper's RQ3 analysis compares metrics-guided evolution against LLM-decided structural actions with budgets of one, three, and five rounds. The unconstrained LLM variants degrade after the first round: more refinement steps produce more fragmentation, lower coverage, and lower pass rate. The metrics stop the process at the right moment; the LLM alone does not know when to stop.

On the RepoCraft benchmark—six real Python repositories including counterparts of requests, statsmodels, and django—Repo0 improves Functionality Coverage by up to 20.08 percentage points and Pass Rate by up to 29.74 percentage points over RPG, the strongest graph-based baseline. Ablation confirms that removing structural evolution causes the largest single drop across both metrics on every tested repository. The Dual-DAG representation, requirement context during generation, and dependency-aware generation order each contribute additional but smaller gains.

Cost analysis adds a practical note. Under DeepSeek V3.2, Repo0's generation costs are lower than RPG's on two of the three reported repositories, partly because modularity-guided architecture reduces redundant or conflicting code that would otherwise require expensive TDD repair cycles.

The stated limitation is scope: all experiments use Python repositories from a single benchmark. The framework operates at the architectural level rather than at language syntax, so generalization to other languages is plausible but untested. That is honest and the right next question.

Explicit modularity metrics—not more LLM calls—are what make iterative architectural refinement converge rather than spiral.

Sources & links