Governing Context Instructions: Skills and AGENTS.md in the Era of Large Language Models

    As large language models evolve, the extensive context rules and patch-like instructions accumulated during early development phases are increasingly becoming liabilities. This article explores typical failure modes of context instructions—such as rule accumulation, overly broad scopes, redundant directives, and conflicting priorities. It further provides an actionable cleanup process covering inventory, deletion testing, compression, validation, and continuous governance. By treating context instruction governance as technical debt repayment, developers can optimize agent systems for more stable, efficient, and predictable model behaviors.

    1. Why “Old Habits” Are Becoming Liabilities

    In early large language model (LLM) practices, instruction-following capabilities were relatively weak. Developers commonly constrained model behavior by stacking massive rules in the context: detailed persona settings, step-by-step thinking frameworks, hundreds of lines of rule files, and patch-like instructions for various edge cases. These practices were indeed effective at the time because they essentially used external rules to compensate for gaps in the model’s internal capabilities.

    However, model capabilities continue to evolve. Once new-generation models possess stronger instruction parsing, conflict resolution, and task planning capabilities, the historically accumulated rule systems can become a burden. The reasons are as follows:

    First, redundant rules consume the context budget. Every rule occupies context window space, squeezing out room for genuinely valuable code, documentation, and task descriptions. For scenarios billed by context or affected by response latency, this consumption is a direct waste of resources.

    Second, “patches” from the weak model era may conflict with the model’s built-in behaviors. For example, some early popular prompt techniques required the model to execute a fixed, multi-stage self-check process before answering. Under strong models, such processes often duplicate or contradict the model’s internally optimized reasoning paths. The actual effect is negative optimization—yielding zero benefits while consuming output tokens.

    Third, ambiguous and conflicting rules trigger uncertain model behaviors. The stronger the model’s instruction-following capability, the more strictly it understands and executes rules in the context. When rules contain ambiguous phrasing, contradict each other, or apply overly broad limitations, the model is more likely to pause to ask the user for clarification, or even block the task entirely. In practice, this manifests as the model repeatedly confirming a simple request or refusing to perform an operation it should be capable of completing.

    Some developers joke: “As long as you learn slowly enough, you don’t have to learn.” Behind this jest lies a serious technical judgment: techniques optimized for weak models will fail or even backfire as models progress.

    2. Typical Failure Modes of Context Instructions

    Before cleaning up, you must be able to identify the problems. Here are the most common failure modes in practice:

    1. Accumulation of Patch-like Rules

    Rule files are rarely designed all at once; they bloat incrementally by “adding a rule whenever a problem is encountered.” For instance, if a model behaves unexpectedly during a task, a prohibitive rule is appended. After dozens of iterations, the file is filled with rules targeting scenarios that no longer exist, often harboring implicit conflicts among them.

    2. Overly Broad Scopes

    Global rules like “never modify configuration files” or “always ask before taking action” seem safe but actually cause the model to pause and repeatedly confirm in numerous scenarios where it could have acted autonomously. The scope of a rule should match its actual intent: if a limitation targets a specific directory or operation type, its scope should be explicitly stated rather than enforced as a blanket global ban.

    3. Redundant Instructions Repeating Default Behaviors

    Many rules teach the model “to do what it already does.” For example, instructing the model to “pay attention to error handling when writing code” or “explain clearly.” Modern models exhibit stable performance in these areas. Repeating these statements is not only ineffective but also dilutes the weight of truly critical instructions—when everything in the context is emphasized, nothing is emphasized.

    4. Conflicting Priorities

    A typical example: Rule A requires “always provide a complete alternative solution,” while Rule B requires “the answer must be brief.” A strong model will attempt to satisfy both, resulting in either erratic behavior or active pausing for clarification when a decision cannot be made. The presence of conflicting rules significantly degrades the stability of model outputs.

    3. An Actionable Cleanup Process

    It is recommended to treat the governance of context instructions as a formal repayment of technical debt, executing it through the following steps:

    Step 1: Inventory and Classification. Export all active rule files, skill descriptions, and system prompts. Classify them into four categories based on function: behavioral constraints, workflow definitions, knowledge supplements, and historical patches.

    Step 2: Deletion Testing. Ask three questions for each rule: If deleted, would the current strong model still make this mistake? Does this rule conflict with or duplicate another? Does it describe a capability the model possesses by default? If any question points to “not needed,” move it to the deletion list.

    Step 3: Compression and Merging. Retained rules should be rewritten into concise, clear, and unambiguous statements. Prioritize decidable conditional statements, for example:

    1. # Anti-pattern (ambiguous, overly broad)
    2. Be careful when modifying code and pay attention to quality.
    3. # Best practice (clear, decidable)
    4. Before modifying a public API signature, list all affected call sites.
    5. Directly modifying config/production.yaml is prohibited.

    Step 4: Small-Scale Validation. Run a round of regression tests on typical daily tasks using the cleaned configuration to observe whether model behavior degrades. Focus on checking if historical issues previously covered by “patches” recur—if they do, the rule still has value and should be retained with a more precise scope; if not, confirm the deletion.

    Step 5: Establish Continuous Governance. Integrate changes to rule files into the code review process. Newly added rules must specify their trigger scenarios and expected invalidation conditions (e.g., “can be removed when the model version reaches a certain capability level”), preventing the cleanup results from being eroded by disorderly accumulation again.

    4. Extended Thoughts

    Rule density is inversely proportional to model capability. A healthy signal is that as the capability of the model used increases, your context instructions should become progressively shorter. If your rule files only grow and never shrink, it likely indicates a lack of governance rather than the model genuinely needing so many constraints.

    Leave the “gray areas” to the model’s judgment. The value of a strong model lies precisely in handling scenarios not explicitly defined. Overly detailed regulations suppress this capability, degrading the model into a mechanical executor. Instructions should delineate clear hard boundaries (safety red lines, irreversible operations) and leave the rest to the model’s autonomous decision-making.

    Cleanup is the means, observability is the goal. It is recommended to log the historical purpose of each deleted rule during the cleanup process, forming a “rule evolution log.” When model behavior becomes abnormal, this log can quickly help locate whether the issue is due to a missing rule or a conflicting one.

    Context is the most precious resource in instruction-driven agent systems. Conducting a regular “spring cleaning” of your rule system is essentially a performance optimization of the entire collaborative system—trading more refined instructions for more stable, efficient, and predictable model behaviors.