arXiv:2610.21421cs.SEOct 2026

Manuscript Offprint

arXiv:2610.21421

The Role of Agentic Instruction Categories for Code Generation: A Study of Five Python Libraries

Warren Gerald Polandra, Yoshiki Higo, Raula Gaikovina Kula

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Warren Gerald Polandra, Yoshiki Higo, Raula Gaikovina Kula

The University of Osaka, Japan

{warrenpo, higo, raula-k}@ist.osaka-u.ac.jp

Abstract—Agentic coding systems increasingly rely on repository-level agent files, such as AGENTS.md, to communicate project knowledge and developer intent. However, it remains unclear which categories of agent instructions enable efficient agent-file generation and accurate code generation. We evaluate five instruction categories—Repository Overview, Function Description, Implementation Detail, Testing, and Reconstruction Steps—across all 31 non-empty combinations using two Large Language Models (LLMs), Gemma 4 and GPT-5.4, and five human-written Python libraries. Our study addresses two research questions, comprising five sub-questions, on agent-file generation and code generation.

Results show that the number of instructions alone does not determine token usage for agent-file generation, with substantial variation across models and libraries. Although most AI-generated libraries compiled successfully regardless of the instruction combination, functional correctness remained limited. No Gemma 4 variant passed all tests, whereas 12.99% of GPT-5.4 variants did. Function Description achieved Gemma 4's highest partial-pass rate, while Reconstruction Steps achieved GPT-5.4's highest full-pass rate. For structural similarity to human-written code, Reconstruction Steps was most frequently associated with libraries closest to the originals in Lines of File and total Cyclomatic Complexity, while Testing and Reconstruction Steps were jointly most frequent for File Count and Function Count.

These findings show that including every instruction category does not reliably reduce agent-file-generation cost or improve generated code quality. Instead, instruction selection should be tailored to the target outcome and the LLM. Our results motivate detailed evaluation of agent instructions within agent files and AI agents that dynamically prioritize relevant instructions.

Index Terms—Agentic SE, Agent Files, Empirical Study

I. INTRODUCTION

Agentic coding in software engineering (SE) enables developers to use artificial intelligence (AI) agents to plan and write code with limited human involvement [1]. However, an agent's autonomy still depends on human-provided instructions. Suri et al. showed that specific context is necessary to guide AI agents in complex code-generation tasks [2]; without sufficiently detailed instructions, agents may encounter conflicts and ambiguity.

To align AI-agent behavior with developer intent, software projects increasingly provide repository-level artifacts written specifically for agents, including AGENTS.md, copilot-instructions.md, and CLAUDE.md [3]. We refer to these artifacts as agent files. They provide repository-specific information that helps agents assist developers [4], such as the project purpose, coding conventions, build and test commands, and technical constraints. We refer to the individual pieces of information within an agent file as agent

Figure

Fig. 1. Overview of our research questions

instructions: they communicate what an agent should know and how it should act within a repository.

Although agent files can improve performance on agentic software-development tasks [5], it remains unclear how particular instruction categories, alone and in combination, affect the cost of generating agent files and the quality of the code subsequently generated from them. This gap is important because low-quality generated code can undermine the productivity gains of generative AI [6]. Therefore, our objective is to examine how categories of agent instructions [7] influence agent-file generation and code generation.

Table I details these instruction categories, which are based on a previous study [8]. The Repository Overview category was selected because it provides a high-level summary of the repository and its key features, making it an appropriate starting point for AI agents to understand the project's purpose. The Function Description category was selected because it describes the repository's key functions and methods, including those inherited from legacy code. The Implementation Detail category provides specific guidance for implementing the code, including coding style conventions, technical constraints, developer preferences, and other instructions intended to maintain consistency across the codebase. The Testing category describes the procedures and commands required to execute automated tests. Finally, we adapted the Development Process category into Reconstruction Steps to align it with

TABLE I AGENT INSTRUCTION CATEGORIES USED IN THIS STUDY (ADAPTED FROM [8])

InstructionLabelDescription
Repository OverviewRepoOvwA brief description of the repository's purpose.
Function DescriptionFuncDecDetailed information about the important functions and methods used in the repository.
Implementation DetailImpDetlA summary of the algorithms, logic, and design patterns used in the repository.
TestingTestCasExamples of test cases or verification methods used to validate the repository.
Reconstruction StepsReConStpInstructions for recreating the repository from scratch.

Figure

Fig. 2. Overview of our research design

our case study. While the Development Process category describes workflows for developing, extending, and maintaining an existing codebase, our task requires agents to reconstruct a software library from scratch. Therefore, Reconstruction Steps provides guidance on the steps needed to recreate the library, rather than on ongoing development practices such as version-control workflows.

In this study, our goal is to understand how different instruction combinations affect agent-file generation and code generation, as shown in Figure 1. We systematically evaluate all 31 non-empty combinations of five instruction categories using AI agents with two Large Language Models (LLMs) across five Python libraries: areyoustillthere, audiodiff, autolink, bitmap, and compactor. We propose the following two research questions (RQs):

RQ 1_{1} : (Agent-file Generation) How do different combinations of instruction categories affect the cost of generating agent files?

To answer this RQ, we systematically prompt AI agents with all non-empty combinations of the five instruction categories and measure the token usage required to generate agent files. This allows us to compare the costs of alternative instruction combinations. Such costs are relevant because agent files may need to be generated or updated as repositories evolve, creating computational and inference costs across agents and models [5]. We use token usage [9]–[11] as the cost measure.

  • RQ1a\mathrm{RQ}_{1\mathrm{a}}: Which instruction combination results in the highest token usage?

  • RQ1b\mathrm{RQ}_{1\mathrm{b}}: Which instruction combination results in the

lowest token usage?

RQ 2_{2} : (Code Generation) How do different combinations of instruction categories affect code generation?

This RQ examines how different instruction combinations influence the code that agents generate. While, we do acknowledge that generating a codebased from scratch is not a typical software engineering task, our motivation was to assess the quality and practicality of the agent files in guiding an agent at a whole repository level.

We assess the generated code in terms of compilability, functional correctness, and structural similarity to human-written code. Because code quality is multifaceted, we use the following three perspectives:

  • RQ2a\mathrm{RQ}_{2\mathrm{a}}: Which instruction combination achieves the highest compilability?

  • RQ2b\mathrm{RQ}_{2\mathrm{b}}: Which instruction combination achieves the highest functional correctness?

  • RQ2c\mathrm{RQ}_{2\mathrm{c}}: Which instruction combination produces structural metrics most similar to human-written code?

Our contributions include a comprehensive dataset and empirical evidence using real-world open source projects, which is feasible. We provide all scripts, dataset samples, and experimental configurations in a replication package to support reproducibility and enable other researchers to replicate the study. Our results show that providing more instructions neither increases agent-file-generation cost nor guarantees higher-quality generated code.