Skills and AGENTS.md Need to Get Leaner in the Era of Stronger Models

    As models get better at following instructions, large Skill libraries and rigid AGENTS.md rules can become a performance drag. This article explains why overly broad triggers and unconditional reading rules cause context pollution, token waste, and task blocking in strong models, and shows how to refactor them into conditional context routing with practical cleanup steps.

    Introduction: When Strong Instruction Following Becomes a Performance Bottleneck

    As intelligent coding tools and code agents evolve quickly, the developer community has noticed a counterintuitive trend: the Skill libraries and AGENTS.md constraints that were carefully built to compensate for models that “forgot rules” and “never checked documentation proactively” have become a negative optimization in front of a new generation of stronger models. There is an old joke in the industry: if you learn slowly enough, you never have to learn at all. In the field of context engineering, this has been proven repeatedly—every leap in a model’s instruction-following ability quickly renders a batch of “patch-style rules” obsolete.

    A cloud vendor explicitly points out in the official prompt guide for its new-generation model that because the new model follows instructions significantly better, it is more susceptible to various custom instructions in the context. When rules are vague, conflict with each other, or cover too broad a scope, the model does not “ignore” them; instead, it executes them extremely seriously, leading to premature pauses, repeated confirmation with the user, and even blocking the entire task.

    This article starts from the underlying mechanism to analyze the causes of this phenomenon and provides a complete methodology for refactoring Skills and AGENTS.md.

    1. Root Cause: Why Stronger Models Are More Easily Dragged Down by “Bad Rules”

    The typical problems of early models were “instruction forgetting” and “lack of initiative.” They often failed to read the architecture description in the project root directory and would not proactively search for database design documents. Therefore, developers’ response was simple: use mandatory constraints to stuff all possible context in.

    But the behavior of new-generation models has fundamentally changed: they have strong instruction-weight allocation ability and treat every rule in the context as a high-priority task. This leads to two direct consequences.

    The first is over-triggering. A broad Skill description is judged by the model as highly relevant to the current task, pulling large amounts of irrelevant reference material into the context.

    The second is rigid execution. “Must read before every edit” written in AGENTS.md is executed literally, even when the current task is only to change a copy string.

    The final result: the context window is quickly filled with low-value information, token consumption multiplies, response latency increases, and more fatally—context expansion directly dilutes the weight of key information, increasing the probability of hallucinations.

    2. Typical Anti-Pattern Breakdown: Two Types of “Historical Baggage” That Must Be Cleaned Up

    2.1 Overly Broad Skill Trigger Conditions

    The counter-example given in a cloud vendor’s official documentation is highly representative. A database migration Skill writes its trigger condition as:

    1. Use when working with databases, queries, models, or persistence.

    The problem is that the semantic coverage of words like database, query, and model is extremely broad. When a developer merely modifies an ORM entity field or fixes a boundary condition of a query, the model judges the Skill as relevant to the task. Then, the migration process specification, rollback checklist, and historical reference materials all enter the context, causing serious context pollution.

    2.2 Unconditional Mandatory Reading in AGENTS.md

    Another common bad rule is:

    1. Before every edit, read architecture.md, database.md, and deployment.md.

    This rule was born in an era when models lacked proactive retrieval ability. But under strong models, even if only one string is changed, the model reads all three documents in full; on the second edit, it reads them all again. The whole process produces no benefit other than token waste and stalled progress.

    3. Refactoring Methodology: From “Rule Piling” to “Context Routing Table”

    The solution is not to delete rules, but to rewrite them from “unconditional mandatory” to “conditional routing.” The officially recommended rewrite clearly reflects this idea.

    3.1 Changing Broad Triggers to Specific Task Descriptions

    Tighten the trigger condition of the database Skill to:

    1. adding or changing a migration, or reviewing its rollout

    This describes not a broad domain but a clear set of actions. Ordinary logic changes will not trigger it, and the context stays clean.

    3.2 Changing Mandatory Reading to a Context Routing Table

    Rewrite unconditional reading as:

    1. Use architecture.md for service boundaries,
    2. database.md for schema changes,
    3. and deployment.md when preparing a deployment.

    This essentially builds a lightweight routing table in the prompt:

    Current Task Type Context to Load
    Changing service boundaries Architecture document
    Changing data structures Database design document
    Preparing a release Deployment document
    Ordinary UI bug fix No document needed

    4. Implementation Checklist: Do a Thorough Cleanup of Existing Configuration

    Developers are advised to perform a comprehensive check following these four steps.

    1. Audit trigger words. Check the scope description of each Skill one by one, delete broad expressions like “anything related to a certain domain,” and replace them with specific, determinable actions.
    2. Eliminate unconditional constraints. Search AGENTS.md for all absolute expressions containing “every time,” “always,” and “all tasks,” and change them to routing by task type.
    3. Detect rule conflicts. When multiple Skills hit the same task at the same time, the model falls into trade-offs or even blocking; priority or mutual exclusion should be clarified.
    4. Establish the minimal context principle. Context is not better when there is more; it is better when it is more accurate. Only load information strongly related to the current action.

    5. Further Thinking: A New Paradigm of Context Engineering

    This change marks the entry of context engineering into a refined stage. In the past, the competition was about whose rule library was more complete; now it is about whose rules are more precise. In the engineering practice of cloud platforms such as Baidu AI Cloud, combining the context routing idea with observability capabilities such as log services and monitoring alerts can quantify the actual token consumption and hit situation of each task, thereby continuously iterating rule quality.

    For teams, this means a structural shift in maintenance costs: from constantly adding patches to regularly doing subtraction. The health of the rule library is becoming a core metric for measuring whether an intelligent coding workflow is mature.