# Standards-Guided and Dependency-Aware Code-Level Documentation Generation

DevFeed: [Standards-Guided and Dependency-Aware Code-Level Documentation Generation](<https://devfeed.tech/articles/standards-guided-and-dependency-aware-code-level-documentation-generation-93701.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.27634>)

Author: Tingxu Han, Wei Song, Ziming Li, Yuchen Chen, Weisong Sun, Zhenpeng Chen, Chunrong Fang, Zhenyu Chen, Yang Liu

Published: 2026-10-21T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [generative-ai-tools](<https://devfeed.tech/topics/generative-ai-tools.md>), [Static code analysis](<https://devfeed.tech/topics/static-code-analysis.md>), [AI Prompt Templates](<https://devfeed.tech/topics/ai-prompt-templates.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [ai code review](<https://devfeed.tech/topics/ai-code-review.md>), [Spec Driven Development](<https://devfeed.tech/topics/spec-driven-development.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [code-documentation](<https://devfeed.tech/tags/code-documentation.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [feedback](<https://devfeed.tech/tags/feedback.md>), [framework](<https://devfeed.tech/tags/framework.md>), [generation](<https://devfeed.tech/tags/generation.md>), [improvements](<https://devfeed.tech/tags/improvements.md>), [llm-as-a-judge](<https://devfeed.tech/tags/llm-as-a-judge.md>), [long-context](<https://devfeed.tech/tags/long-context.md>), [python](<https://devfeed.tech/tags/python.md>), [standards](<https://devfeed.tech/tags/standards.md>), [study](<https://devfeed.tech/tags/study.md>)

## AI overview

CODEDOC generates and evaluates code-level documentation against reusable criteria drawn from authoritative standards and style guides. It uses static call-graph and AST analysis to identify dependencies, then builds structured prompts from local code, repository paths, and those criteria. An interactive LLM-as-a-judge protocol provides criterion-aligned feedback for refinement. In experiments across ten open-source Python repositories, CODEDOC scored higher than RepoAgent and a long-context baseline under standards-aligned evaluation, with reported relative improvements of 11.6%-17.0% and 21.4%-29.6%, respectively; it used roughly an order of magnitude fewer tokens per entity than the long-context baseline. A human study found substantial alignment with LLM judgments (Spearman's ρ = 0.72), and relative results held across different judge LLMs.

## Source excerpt

arXiv:2610.27634v1 Announce Type: new Abstract: Automatically generating high-quality documentation for software repositories remains challenging: existing approaches largely treat documentation as unconstrained text generation, lacking explicit quality specifications, depending heavily on long-context prompts over raw code, and offering limited support for reproducible evaluation. We argue that code-level documentation generation should instead be a standards-guided software engineering task, in which documentation is generated and assessed against explicit, reusable quality requirements derived from authoritative standards. We define code documentation as natural-language descriptions of repository functions and classes, organized by source-code path. We present CODEDOC, a standards-guided and dependency-aware framework that identifies dependencies between code entities via static call-graph and AST analysis and constructs dependency-aware structured prompts combining local code context, repository paths, and documentation criteria drawn from authoritative standards and style guides. We further introduce an interactive LLM-as-a-judge protocol that supplies criterion-aligned feedback to refine generated documentation along fine-grained dimensions from formal and practice-oriented standards. Experiments on ten open-source Python repositories show that CODEDOC produces higher-quality documentation than RepoAgent and a long-context baseline under standards-aligned evaluation, with relative improvements of 11.6%-17.0% and 21.4%-29.6%, respectively, while consuming roughly an order of magnitude fewer tokens per documentation entity than the long-context baseline. A human study confirms substantial alignment between LLM-based and human judgments (Spearman's rho = 0.72), and the relative findings hold across different judge LLMs. Code is available at https://github.com/ControllableModel/CodeDoc.