Papers
Topics
Authors
Recent
Search
2000 character limit reached

ZeroRepo: Graph-Driven Repository Synthesis

Updated 21 October 2025
  • ZeroRepo is a graph-driven framework that uses a persistent Repository Planning Graph to systematically translate functional specifications into validated codebases.
  • It employs a three-stage process—proposal-level planning, implementation-level refinement, and graph-guided synthesis—to integrate code structures and manage dependencies.
  • Empirical results show ZeroRepo achieves superior performance with 81.5% functional coverage and repositories averaging ~36,000 lines of code on the RepoCraft benchmark.

ZeroRepo is a graph-driven automated framework for scalable software repository generation, utilizing a persistent structural representation known as the Repository Planning Graph (RPG). By encoding capability hierarchies, code structures, and inter-component dependencies, ZeroRepo enables the systematic translation of high-level functional specifications into complete, validated codebases. Its three-stage process—proposal-level planning, implementation-level refinement, and graph-guided code synthesis—addresses fundamental challenges in long-horizon repository construction and coherence, yielding empirically superior performance over prior methods.

1. Repository Planning Graph: Structure and Principles

The Repository Planning Graph (RPG) is a persistent, explicit graph that unifies functional decomposition with file and dependency structure. Its nodes represent both high-level capabilities and concrete code artifacts:

  • Functional Nodes: Abstract modules or features, descended hierarchically into subcomponents and then into leaf nodes (e.g., functions, classes).
  • Structural Nodes: Organize the concrete repository, mapping root nodes to folders, interior nodes to files, and leaves to implementation units.

Edges encode two key relations:

  • Inter-module dependencies ("data flow"): Solid black arrows connect modules, capturing information transfer and execution ordering between files.
  • Intra-module sequencing ("file ordering"): Dashed gray arrows (per Figure 1 in (Luo et al., 19 Sep 2025)) enforce ordering of definitions so that outputs are propagated downstream.

By maintaining both levels throughout planning, the RPG acts as a unified blueprint that is incrementally extended as the repository specification evolves. Coverage metrics are computed as:

Coverage=1∣C∣∑j=1K1[∃gi∈G such that f(gi)=cj]\text{Coverage} = \frac{1}{|\mathcal{C}|} \sum_{j=1}^K \mathbb{1}[\exists g_i \in \mathcal{G} \text{ such that } f(g_i) = c_j]

where C\mathcal{C} are reference functionalities, G\mathcal{G} are generated nodes, and ff is a matching function.

2. ZeroRepo Framework: Process and Algorithms

ZeroRepo operates in three principal stages:

  • Proposal-Level Planning: Natural language specifications are transformed into a functional graph using retrieval from a large, hierarchical feature tree (e.g., EpiCoder with 1.5M nodes). Features are selected via an explore–exploit algorithm then grouped into modules reflecting real-world application domains.
  • Implementation-Level Refinement: The abstract graph is enriched with folder, file, and code skeleton metadata. Topological sorting is performed on data-flow edges; abstract nodes are resolved into base interfaces, concrete classes, etc., producing an executable, dependency-respecting repository skeleton.
  • Graph-Guided Code Generation: The RPG is traversed topologically. For each leaf node, code and associated tests are generated. An iterative test-driven loop resolves implementation errors until tests pass, ensuring correspondence of planned and realized capabilities.

This persistent RPG blueprint guarantees alignment between intent and deliverable, minimizing fragmentation and inconsistencies witnessed in prior natural-language-driven approaches.

3. Empirical Performance: RepoCraft Benchmark Analysis

Empirical evaluation is centered on the RepoCraft benchmark, comprising six real-world projects and 1,052 tasks (Luo et al., 19 Sep 2025). ZeroRepo yields repositories with near 36,000 lines of code—approximately 3.9×\times larger than Claude Code and about 64×\times larger than other baselines—with demonstrably increased fidelity:

Baseline Functional Coverage Pass Rate Average LOC
ZeroRepo 81.5% 69.7% ~36,000
Claude Code 54.2% 33.9% ~9,230
Other Baselines ≤17% ≤7% ≤560

Coverage is measured by reference alignment, pass rate by successful test execution, and code size by normalized LOC (as reported in RepoCraft). The RPG-based approach models complex dependency structures and supports scalable planning—enabling the generation of sophisticated repositories with near-linear growth in functionality and organizational depth.

4. Structured Representation: Impact on LLMs and Agent Localization

Replacing natural language with an explicit RPG blueprint enhances LLM comprehension of codebase architecture:

  • Clarity of Hierarchy: Hierarchical nodes and explicit dependencies enable LLMs to disambiguate module boundaries and understand execution/data flows.
  • Efficient Localization: Graph-guided agent tools (e.g., dependency exploration routines) reduce the number of steps needed to identify target files or functions by 30–50% compared to ambiguous natural language search.
  • Improved Debugging and Testing: The persistent graph structure facilitates incremental development and test integration, centralizing error detection within topologically sorted modules.

A plausible implication is that future repository synthesis platforms will benefit substantially from persistent topological planning, both for LLM interfacing and agent-based code navigation.

5. Limitations, Challenges, and Future Research Directions

ZeroRepo’s capabilities are shaped by several limitations and open challenges:

  • Feature Tree Dependence: The EpiCoder Feature Tree forms the foundation for capability retrieval—any incompleteness or bias in this source constrains planning diversity.
  • Parameter Sensitivity: The explore–exploit selection and iterative graph construction process require precision in parameter tuning to maintain stable scaling and breadth versus precision at expanding repository horizons.
  • Semantic-Implementation Alignment: While RPG mitigates ambiguity, occasional discontinuities persist between semantic intent and implementation detail, especially in interface design and cross-module abstractions.

Future research avenues include:

  • Dynamic Graph Adaptation: Integrating runtime feedback for RPG refinement and error-driven graph restructuring.
  • Automated Interface and Abstraction Mechanisms: Extending RPG to model reusable interfaces and advanced base class hierarchies.
  • Sophisticated Self-Repair: Developing graph-guided self-repair routines to further close the gap to human-engineered codebases.
  • Extending to Multi-Agent/Distributed Settings: Exploring RPG as a scaffold for orchestrating agent collaboration across large design and development efforts.

6. Significance in Automated and Scalable Repository Generation

ZeroRepo demonstrates that persistent, explicit planning graphs are fundamental to unified, scalable, and accurate automated codebase synthesis. It bridges the gap between ambiguous specifications and structured implementations, with empirical superiority in scale, coverage, and correctness. RPG supports long-horizon planning, dependency resolution, and agent navigation, establishing a robust methodological foundation for future automated software engineering systems in both research and production contexts.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to ZeroRepo.