arXiv:2608.29310cs.SEcs.AI2026-08

让AI同时生成多个相关应用并共享核心代码,避免重复和冗余。

Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase

论文配图:Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase
图 1 · 摘自论文原文
  • 通过代码摘要引导提取共享组件,智能迁移跨应用逻辑。
  • 在基准测试中减少90%以上冗余代码和50%以上令牌消耗。
  • 适合需要维护多套相关系统的开发团队使用。

组织常开发和维护一系列相关应用:可独立部署的代码库,共享大量领域逻辑、接口模式或运营规范。当大语言模型(LLM)编码代理被用于生成和维护此类软件时,逐个应用处理的方式会重复共享逻辑,并导致长期维护中积累冗余、无用代码和结构退化。我们提出「超级库代理」问题:代理按顺序生成一组N个相关应用的同时,维护一个共享的超级库以复用跨应用组件。理论上,最小化序列框架可提取共享代码并迁移应用至演进中的库,但实践中面临提取召回率低和依赖迁移脆弱的问题。为此,我们引入基于候选的提取策略、代码库预合并机制,以及结合提取痕迹与调用图信息的上下文感知迁移方法。在WebGen-Bench和PaperBench上,该方法在保持应用功能的前提下,显著降低冗余和令牌开销(如冗余度、令牌长度),优于零样本基线,并避免了传统库构建带来的结构退化,进一步减少行数(LOC)和模块复杂度(MDL)。代码已开源:https://github.com/sbigstar0310/super-library-agent。

原文摘要 · Abstract (English)

Organizations often develop and maintain portfolios of related applications: independently deployable codebases that share substantial domain logic, interface patterns, or operational conventions. As LLM coding agents are increasingly used to generate and maintain such software, a naive application-by-application workflow duplicates shared logic across codebases and allows prolonged agentic maintenance to accumulate verbosity, dead code, and structural erosion. We introduce the Super Library Agent problem, where an agent sequentially generates a portfolio of N related applications while maintaining a shared Super Library of reusable cross-application components. A minimal sequential scaffold can in principle extract shared code and migrate applications to the evolving library, but in practice suffers from low extraction recall and fragile dependency migration. We address these failures with candidate-guided extraction over code chunk summaries, pre-extraction codebase consolidation, and context-aware migration using extraction traces and call-graph information. Across WebGen-Bench and PaperBench, our method preserves application functionality while significantly reducing redundancy and token footprint (verbosity, token length) over zero-shot, and avoiding the structural erosion introduced by naive library construction, with additional reductions in LOC and MDL. Our code is available at https://github.com/sbigstar0310/super-library-agent.

代码生成AI研发软件工程库管理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。