RPG: A Repository Planning Graph for Unified and Scalable Codebase Generation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Luo, Jane, Zhang, Xin, Liu, Steven, Wu, Jie, Liu, Jianfeng, Huang, Yiming, Huang, Yangyu, Yin, Chengyu, Xin, Ying, Zhan, Yuefeng, Sun, Hao, Chen, Qi, Li, Scarlett, Yang, Mao
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866908830795825152
author Luo, Jane
Zhang, Xin
Liu, Steven
Wu, Jie
Liu, Jianfeng
Huang, Yiming
Huang, Yangyu
Yin, Chengyu
Xin, Ying
Zhan, Yuefeng
Sun, Hao
Chen, Qi
Li, Scarlett
Yang, Mao
author_facet Luo, Jane
Zhang, Xin
Liu, Steven
Wu, Jie
Liu, Jianfeng
Huang, Yiming
Huang, Yangyu
Yin, Chengyu
Xin, Ying
Zhan, Yuefeng
Sun, Hao
Chen, Qi
Li, Scarlett
Yang, Mao
contents Large language models excel at generating individual functions or single files of code, yet generating complete repositories from scratch remains a fundamental challenge. This capability is key to building coherent software systems from high-level specifications and realizing the full potential of automated code generation. The process requires planning at two levels: deciding what features and modules to build (proposal stage) and defining their implementation details (implementation stage). Current approaches rely on natural language planning, which often produces unclear specifications, misaligned components, and brittle designs due to its inherent ambiguity and lack of structure. To address these limitations, we introduce the Repository Planning Graph (RPG), a structured representation that encodes capabilities, file structures, data flows, and functions in a unified graph. By replacing free-form natural language with an explicit blueprint, RPG enables consistent long-horizon planning for repository generation. Building on RPG, we develop ZeroRepo, a graph-driven framework that operates in three stages: proposal-level planning, implementation-level construction, and graph-guided code generation with test validation. To evaluate, we construct RepoCraft, a benchmark of six real-world projects with 1,052 tasks. On RepoCraft, ZeroRepo produces nearly 36K Code Lines and 445K Code Tokens, on average 3.9$\times$ larger than the strongest baseline (Claude Code), and 68$\times$ larger than other baselines. It achieves 81.5% coverage and 69.7% test accuracy, improving over Claude Code by 27.3 and 35.8 points. Further analysis shows that RPG models complex dependencies, enables more sophisticated planning through near-linear scaling, and improves agent understanding of repositories, thus accelerating localization. Our data and code are available at https://github.com/microsoft/RPG-ZeroRepo.
format Preprint
id arxiv_https___arxiv_org_abs_2509_16198
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle RPG: A Repository Planning Graph for Unified and Scalable Codebase Generation
Luo, Jane
Zhang, Xin
Liu, Steven
Wu, Jie
Liu, Jianfeng
Huang, Yiming
Huang, Yangyu
Yin, Chengyu
Xin, Ying
Zhan, Yuefeng
Sun, Hao
Chen, Qi
Li, Scarlett
Yang, Mao
Computation and Language
Artificial Intelligence
Software Engineering
Large language models excel at generating individual functions or single files of code, yet generating complete repositories from scratch remains a fundamental challenge. This capability is key to building coherent software systems from high-level specifications and realizing the full potential of automated code generation. The process requires planning at two levels: deciding what features and modules to build (proposal stage) and defining their implementation details (implementation stage). Current approaches rely on natural language planning, which often produces unclear specifications, misaligned components, and brittle designs due to its inherent ambiguity and lack of structure. To address these limitations, we introduce the Repository Planning Graph (RPG), a structured representation that encodes capabilities, file structures, data flows, and functions in a unified graph. By replacing free-form natural language with an explicit blueprint, RPG enables consistent long-horizon planning for repository generation. Building on RPG, we develop ZeroRepo, a graph-driven framework that operates in three stages: proposal-level planning, implementation-level construction, and graph-guided code generation with test validation. To evaluate, we construct RepoCraft, a benchmark of six real-world projects with 1,052 tasks. On RepoCraft, ZeroRepo produces nearly 36K Code Lines and 445K Code Tokens, on average 3.9$\times$ larger than the strongest baseline (Claude Code), and 68$\times$ larger than other baselines. It achieves 81.5% coverage and 69.7% test accuracy, improving over Claude Code by 27.3 and 35.8 points. Further analysis shows that RPG models complex dependencies, enables more sophisticated planning through near-linear scaling, and improves agent understanding of repositories, thus accelerating localization. Our data and code are available at https://github.com/microsoft/RPG-ZeroRepo.
title RPG: A Repository Planning Graph for Unified and Scalable Codebase Generation
topic Computation and Language
Artificial Intelligence
Software Engineering
url https://arxiv.org/abs/2509.16198