让AI从零构建完整项目,自动设计模块结构并保证代码质量。
Repo0: Design-Driven Zero-to-All Code Generation

- 用双有向图动态规划代码模块边界,实现结构自演化。
- 在真实项目上提升功能覆盖率20.08%,通过率提升29.74%。
- 适合需要全自动代码生成与架构设计的工程场景。
大型语言模型代理在代码生成方面取得显著进展,但多数系统依赖预设的仓库架构。在从零到全的代码生成任务中,代理需直接从自然语言需求构建整个软件项目,并在整个开发过程中保持模块化架构。本文提出Repo0,一种面向零到全代码生成的连续结构演化框架。Repo0通过显式维护双有向无环图(Dual-DAG)表示架构状态,包含需求级与组件级的双重图及其对齐关系。从自然语言需求出发,代理通过模块化度量引导的结构操作,迭代演化组件边界直至结构收敛,随后以收敛架构指导测试驱动的代码生成。我们在RepoCraft上的六个真实仓库数据集上,使用GPT-5 mini和DeepSeek V3.2进行评估,Repo0在所有设置下均达到最高功能覆盖率与通过率。相比最强基线RPG,其功能覆盖率最高提升20.08个百分点,通过率最高提升29.74个百分点。消融实验与结构演化分析进一步验证了Dual-DAG架构状态、模块化引导的结构演化以及显式结构收敛的重要性。
原文摘要 · Abstract (English)
Large language model agents have made substantial progress in code generation, yet most existing systems assume a predefined repository architecture. This assumption does not hold in zero-to-all code generation, where an agent must construct an entire software project directly from natural-language requirements while maintaining a modular repository architecture throughout development. We present Repo0, a continuous structural evolution framework for zero-to-all code generation. Repo0 maintains an explicit architectural state instantiated as a Dual-Directed-Acyclic-Graph (Dual-DAG), consisting of a requirement-level DAG, a component-level DAG, and their alignment relation. Starting from natural-language requirements, it iteratively evolves component boundaries through structural actions guided by modularity metrics until structural convergence, after which the converged architecture guides test-driven development code generation. We evaluate Repo0 on six real-world repositories from RepoCraft using GPT-5 mini and DeepSeek V3.2. Repo0 achieves the highest Functionality Coverage and Pass Rate across all settings. Compared with RPG, the strongest repository-planning baseline, Repo0 improves Functionality Coverage by up to 20.08 percentage points and Pass Rate by up to 29.74 percentage points. Ablation and structural-evolution analyses further demonstrate the importance of the Dual-DAG architectural state, modularity-guided structural evolution, and explicit structural convergence.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。