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

Daegyu Sung, Yukyeong Lee, Geon Park, Yumin Choi, Sung Ju HwangarXiv 2026

TL;DR

While LLM coding agents excel at building individual applications, using them to independently generate a portfolio of related projects leads to massive code duplication and structural degradation. This paper introduces the Super Library Agent (SLA) framework, which enables agents to sequentially generate multiple applications while automatically maintaining a shared library of reusable components. By leveraging natural language code indexing and call-graph context, their method drastically reduces code redundancy and maintenance overhead without sacrificing application functionality.

What Problem Does This Paper Address?

In real-world software engineering, organizations rarely develop applications in total isolation. Instead, they maintain portfolios of related applications that share substantial domain logic, user interface patterns, or operational conventions.

When modern LLM coding agents are deployed to build these applications one by one, they act like siloed developers. They re-derive the same logic in subtly different ways, violating the fundamental "Don't Repeat Yourself" (DRY) principle. Over extended periods, this independent generation causes codebases to accumulate "slop"—code that is functionally correct but increasingly verbose, redundant, and structurally convoluted.

Simply trying to build a shared library naively fails for two main reasons:

  1. Low Extraction Recall: Functionally identical code blocks often look completely different syntactically, causing standard retrieval mechanisms to miss valid candidates for reuse.
  2. Fragile Migration: Moving local code into a shared library isn't a local edit; it frequently breaks non-local dependencies, import declarations, and call sites across the portfolio.

Methods

The authors propose SLA-FULL, an augmented agentic workflow that splits library management into two specialized roles: a library-extraction agent and a dependency-migration agent.

To overcome the limitations of naive refactoring, SLA-FULL introduces three core strategies:

  • Index-Based Candidate Extraction: Instead of comparing raw code text or embeddings, an LLM summarizes abstract syntax tree (AST) code blocks into concise, one-sentence natural language descriptions. A candidate selector then matches blocks based on what they do semantically rather than how they are written.
  • Pre-Extraction Codebase Consolidation: Before attempting to extract code across different applications, the agent first identifies and refactors duplicate or overlapping implementations within the newly generated application itself.
  • Context-Aware Dependency Migration: To ensure migration correctness, the library-extraction agent generates a structured "extraction trace" that maps exactly where a library component came from and how to use its new API. The dependency-migration agent uses this trace alongside file-level call graphs to safely update all local callers, callees, and imports.
Figure 2: Overview of the proposed workflow. Minimal scaffold SLA-NAIVE (left) vs. SLA-FULL (right).

Datasets

Because no dedicated benchmarks exist for multi-application portfolio maintenance, the authors adapted two popular single-task coding benchmarks into sequential multi-task suites:

  • WebGen-Bench: A benchmark for generating interactive websites from natural language. The authors sampled three disjoint 8-task sequences where applications naturally share UI components, layout primitives, and styling patterns.
  • PaperBench (Code-Dev variant): A benchmark requiring agents to implement machine learning research contributions from ICML papers. They constructed five disjoint 4-task sequences that share core machine learning abstractions like training loops and data pipelines.

Key Insights and Ideas

  • The Power of Semantic Summarization: Code abstraction is hard for LLMs when looking at syntax alone. Translating code blocks into compact natural language summaries allows the agent to recognize high-level behavioral patterns (e.g., identifying that two entirely different custom hooks are both handling local storage persistence).
  • Centralization as a Defense Against Slop: Centralizing shared logic into a single library acts as an architectural defense mechanism. Instead of letting code quality degrade across $N$ independent codebases, the agent concentrates its maintenance surface on a single, well-defined library.
  • Designing for Future Maintenance: The true value of a shared library is revealed during downstream updates. By centralizing shared behavior, a single global policy update can be applied directly to the library, automatically propagating benefits across the entire portfolio with minimal application-level edits.

Key Results

  • Redundancy & Footprint Reduction: On WebGen-Bench, SLA-FULL reduced lines of code (LOC) by 9.0%, token length by 6.7%, and code verbosity by a massive 38.0% compared to a zero-shot baseline, all while preserving application functionality.
  • Preventing Structural Erosion: Naive library construction methods actually increased structural erosion (concentrating complexity poorly). In contrast, SLA-FULL successfully reduced structural erosion by 4.4% on WebGen-Bench and 10.4% on PaperBench.
  • Streamlined Maintenance: When simulating a shared policy update across a portfolio of web apps, SLA-FULL reduced the required patch size (added lines of code) by over 72% compared to the zero-shot approach (256 lines vs 936 lines), demonstrating a massive reduction in maintenance friction.

Limitations and Future Work

  • Synthetic Task Sequences: The evaluation relies on artificially sequenced benchmark tasks rather than real-world software portfolios that feature complex commit histories, diverse developer styles, and production constraints.
  • Single-Round Maintenance Constraints: The post-construction maintenance evaluation only tested a single round of updates. It remains an open question how a shared library holds up over multiple sequential maintenance rounds, or if agent errors will compound over time.
  • Proxy Metrics for Maintainability: The paper relies heavily on static code metrics (LOC, cyclomatic complexity, duplication fractions) as proxies for maintainability. Future work would benefit from human developer studies to evaluate if the resulting codebases are genuinely easier for humans to understand and extend.

Summary updated

BibTeX
@misc{sung2026super,
  author = {Daegyu Sung and Yukyeong Lee and Geon Park and Yumin Choi and Sung Ju Hwang},
  title = {{Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase}},
  year = {2026},
  eprint = {2608.29310},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.29310},
}
Figure