Instruction Following in Next-Generation Models: A Cleanup Guide for Skills and AGENTS.md

    As new large language models become dramatically better at instruction following, loosely written context rules and Skill definitions can turn into negative optimizations. This article explains why broad triggers, mandatory repeated file reads, and conflicting legacy rules overload stronger models, and lays out four refactoring principles plus an enterprise-level governance workflow for auditing rules, injecting them progressively, and setting token consumption baselines.

    Introduction: When Strong Instruction Following Becomes a Double-Edged Sword

    In the AI coding tool and LLM application development community, there is a joking saying: “If you learn slowly enough, you never have to relearn.” Model release cycles keep proving it right. As the latest generation of large language models makes a significant leap in instruction following, developers are discussing a seemingly contradictory phenomenon: the context rule files and Skill configurations that were meant to boost productivity are becoming a negative optimization for stronger models.

    Early models lacked the ability to proactively explore complex project structures, so developers relied on AGENTS.md and various Skill definitions to “feed” models hard constraints. Now that models can deeply understand and strictly execute every instruction, vague, overly broad, and mutually conflicting legacy rules cause serious engineering side effects. This article starts from the underlying technical logic, analyzes the phenomenon in depth, and provides a systematic guide to cleaning up and refactoring rules.

    1. Why Legacy Rules Become a Burden on Strong Models

    The sensitivity of the new generation of models to in-context instructions rises exponentially. Instead of casually ignoring unreasonable constraints, they execute them earnestly and repeatedly. This leads to three core engineering problems.

    1.1 Overly Broad Triggers Cause Context Pollution

    Many developers define Skills with extremely general trigger conditions. For example, a database migration Skill might be described as “use when working with databases, queries, models, or persistence.”

    In the era of weaker models, such a description was only loosely matched. Under a strong instruction-following model, any task that touches a minor field change in an ORM model, or merely fixes a logic bug in an ordinary query, is judged as highly database-related, forcing the migration Skill to trigger. The result: migration rules, rollback checklists, and large volumes of reference documents flood the context window all at once.

    Bad example:

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

    Refactored version:

    Tighten the trigger to a concrete action and deliverable, and avoid broad domain nouns.

    1. Trigger: Use only when adding or changing a migration script, or reviewing its rollout plan.

    1.2 Mandatory Repeated Reads Waste Tokens and Add Latency

    Early agents often got lost and could not locate project architecture documents on their own. As a result, many teams filled their AGENTS.md with mandatory instructions: “Before every edit, you must read architecture.md, database.md, and deployment.md.”

    When the task only requires changing a single string in the codebase, a strong model follows the instruction strictly and fully loads tens of thousands of words of project documentation. It reads them once for the first edit, then reads them again for the second. This mechanical repetition rapidly consumes the token quota, significantly increases response latency, and, more critically, causes the context to balloon.

    1.3 Context Bloat Amplifies Hallucination

    There is an iron rule in context engineering: the more irrelevant information there is, the more easily the model’s attention mechanism is diluted. When large amounts of redundant legacy rules and over-triggered reference material crowd the window, the model’s ability to distinguish core instructions from background noise declines, the probability of hallucination rises sharply, and output quality ends up worse than using no Skill at all.

    2. Core Practice: Principles for Refactoring Context Rules

    To solve these problems, developers must abandon the old mindset of “defensively piling up rules” and move toward precise context engineering. Here are four core refactoring principles:

    • Principle 1: Action-oriented, not domain-oriented. Trigger words must describe a concrete code change action (such as “add an endpoint” or “modify a config”), and broad tech stack nouns (such as “backend” or “database”) are strictly forbidden.
    • Principle 2: Remove unconditional mandatory constraints. Delete every absolute statement like “you must read a given file before every operation.” Strong models can retrieve information on their own, so prompts should guide them to “consult as needed” rather than force content in.
    • Principle 3: Remove conflicts and enforce single responsibility. Review all rule files to ensure there are no contradictory instructions. One Skill should solve one specific class of engineering problem; avoid all-in-one “universal rules.”
    • Principle 4: Evaluate dynamically and clean up continuously. Model capabilities keep evolving, and rules must slim down accordingly. Periodically remove “patch-style” rules that exist only to compensate for old model deficiencies.

    3. Enterprise Adoption: Building an Automated Rule Governance Process

    For enterprise R&D teams, governing rule files cannot rely on manual work alone and needs engineering support:

    1. Set up a rule audit mechanism: Use logging services and monitoring/alerting systems to track the context loading behavior of AI coding tools during task execution. If a single task loads documents unrelated to the task goal, flag it as a rule trigger anomaly.
    2. Apply progressive rule injection: Do not stuff all project conventions into a global config file at once. Use a container platform or cloud-native development environment, such as those offered by Baidu AI Cloud, to split rules by module and inject them dynamically on demand.
    3. Establish a token consumption baseline: For high-frequency development scenarios (such as bug fixes and copy edits), set a token consumption baseline. If a task consumes far more than the baseline, rules are being over-triggered and the Skill description needs to be revisited and optimized immediately.

    Conclusion

    The arrival of strong instruction-following models marks the shift of AI-assisted development from “coarse feeding” to an era of “fine-grained context engineering.” Developers must recognize that most past AGENTS.md and Skill configurations are technical debt created to compensate for old models’ comprehension gaps. Now is the time for a thorough cleanup: strip away redundant constraints and bring context back to precision and efficiency, so the potential of the new generation of AI coding tools can be fully unlocked.