RPG: A Repository Planning Graph for Unified and Scalable Codebase
  Generation
Large language models excel at function- and file-level code generation, yet
generating complete repositories from scratch remains a fundamental challenge.
This process demands coherent and reliable planning across proposal- and
implementation-level stages, while natural language, due to its ambiguity and
verbosity, is ill-suited for faithfully representing complex software
structures. To address this, we introduce the Repository Planning Graph (RPG),
a persistent representation that unifies proposal- and implementation-level
planning by encoding capabilities, file structures, data flows, and functions
in one graph. RPG replaces ambiguous natural language with an explicit
blueprint, enabling long-horizon planning and scalable repository generation.
Building on RPG, we develop ZeroRepo, a graph-driven framework for repository
generation from scratch. It operates in three stages: proposal-level planning
and implementation-level refinement to construct the graph, followed by
graph-guided code generation with test validation. To evaluate this setting, we
construct RepoCraft, a benchmark of six real-world projects with 1,052 tasks.
On RepoCraft, ZeroRepo produces repositories averaging nearly 36K LOC, roughly
3.9times the strongest baseline (Claude Code) and about 64times other
baselines. It attains 81.5% functional coverage and a 69.7% pass rate,
exceeding Claude Code by 27.3 and 35.8 percentage points, respectively. Further
analysis shows that RPG models complex dependencies, enables progressively more
sophisticated planning through near-linear scaling, and enhances LLM
understanding of repositories, thereby accelerating agent localization.
68d0a4e08adc5cd018d15a70
Jane Luo
claimed_verified
2025-09-22T10:31:51.371Z
66adf5cc0c6056d9f4dc308f
https://cdn-avatars.huggingface.co/v1/production/uploads/66adf5cc0c6056d9f4dc308f/mVKo06P7M1qf6RYNG-c2i.jpeg
Jane Luo
user
Luo2003
68d0a4e08adc5cd018d15a71
Xin Zhang
68d0a4e08adc5cd018d15a72
Steven Liu
68d0a4e08adc5cd018d15a73
Jie Wu
68d0a4e08adc5cd018d15a74
Yiming Huang
claimed_verified
2025-09-23T02:42:09.917Z
6514599ee31c0e2e3dfb5c9c
/avatars/3c3ebd14d228c4c439da542cf8ff20a8.svg
ymh233
user
ymh233
68d0a4e08adc5cd018d15a75
Yangyu Huang
68d0a4e08adc5cd018d15a76
Chengyu Yin
admin_assigned
2025-09-22T02:53:31.177Z
68088b850a4295fe95b4c798
https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/sGikPWke7wL3f7t4LUBwL.png
ChengYu Yin
user
Cipherxzc
68d0a4e08adc5cd018d15a77
Ying Xin
68d0a4e08adc5cd018d15a78
Jianfeng Liu
68d0a4e08adc5cd018d15a79
Yuefeng Zhan
68d0a4e08adc5cd018d15a7a
Hao Sun
68d0a4e08adc5cd018d15a7b
Qi Chen
68d0a4e08adc5cd018d15a7c
Scarlett Li
68d0a4e08adc5cd018d15a7d
Mao Yang
RPG: A Repository Planning Graph for Unified and Scalable Codebase
  Generation
Large language models excel at function- and file-level code generation, yet
generating complete repositories from scratch remains a fundamental challenge.
This process demands coherent and reliable planning across proposal- and
implementation-level stages, while natural language, due to its ambiguity and
verbosity, is ill-suited for faithfully representing complex software
structures. To address this, we introduce the Repository Planning Graph (RPG),
a persistent representation that unifies proposal- and implementation-level
planning by encoding capabilities, file structures, data flows, and functions
in one graph. RPG replaces ambiguous natural language with an explicit
blueprint, enabling long-horizon planning and scalable repository generation.
Building on RPG, we develop ZeroRepo, a graph-driven framework for repository
generation from scratch. It operates in three stages: proposal-level planning
and implementation-level refinement to construct the graph, followed by
graph-guided code generation with test validation. To evaluate this setting, we
construct RepoCraft, a benchmark of six real-world projects with 1,052 tasks.
On RepoCraft, ZeroRepo produces repositories averaging nearly 36K LOC, roughly
3.9times the strongest baseline (Claude Code) and about 64times other
baselines. It attains 81.5% functional coverage and a 69.7% pass rate,
exceeding Claude Code by 27.3 and 35.8 percentage points, respectively. Further
analysis shows that RPG models complex dependencies, enables progressively more
sophisticated planning through near-linear scaling, and enhances LLM
understanding of repositories, thereby accelerating agent localization.
A graph-driven framework called ZeroRepo uses the Repository Planning Graph (RPG) to generate complete software repositories from scratch, significantly outperforming existing baselines in terms of code size, functional coverage, and test pass rate.
Repository Planning Graph RPG ZeroRepo graph-driven framework proposal-level planning implementation-level refinement graph-guided code generation RepoCraft functional coverage test pass rate agent localization