How to Clean Up Your Skills and AGENTS.md in the Era of Stronger Models

    As instruction-following capabilities improve, overly broad Skills and rigid AGENTS.md rules can slow down newer LLMs by triggering irrelevant context. This article explains why vague triggers and mandatory reads cause context bloat, and how to refactor them into task-specific context routing with practical cleanup steps.

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

    As AI coding tools evolve quickly, a counterintuitive problem is emerging: the Skill description files and AGENTS.md project constraints we carefully maintain are now slowing down newer large language models.

    Earlier generations of models had limited instruction-following ability, so developers often relied on broad, catch-all prompts to make sure no critical step was missed. With the jump in model comprehension, however, the industry has widely observed that vague, conflicting, or overly broad context rules make models “too serious.” They strictly block tasks, repeatedly ask users for confirmation, and even pull unrelated checklists into the current context. This is the so-called negative optimization: it wastes tokens and serves no other purpose.

    This article starts from the underlying technical logic to explain why these configuration files need a thorough cleanup, and provides an actionable refactoring methodology.

    1. Root Causes: Over-Triggering and Context Bloat

    Newer models have stronger instruction-following ability, which means they no longer “selectively ignore” your rules but execute all of them. This directly exposes two types of legacy problems.

    1.1 Skills with Overly Broad Semantic Boundaries

    Many developers define Skill trigger conditions with extremely broad wording. For example:

    1. # Bad example: overly broad scope
    2. Use when working with databases, queries, models, or persistence.

    The problem is that “database” and “model” cover 80% of everyday development. When you only want to change an ORM field mapping or optimize an ordinary query, the model judges that this is highly relevant to the “database migration Skill.”

    The consequences are disastrous: not only is the current task routed incorrectly, but the migration rules, rollback checklists, and historical reference material originally meant for schema changes flood into the context window at once. Before the model writes any code, the context is already stuffed with irrelevant information.

    1.2 The “One-Size-Fits-All” Mandatory Constraints of AGENTS.md

    Early agents lacked the awareness to proactively retrieve documentation, so the community circulated many mandatory instructions:

    1. # Bad example: indiscriminate mandatory reading
    2. Before every edit, read architecture.md, database.md, and deployment.md.

    In the era of weaker models, this rule might have been executed only symbolically. Under a stronger model, even if you just change a string literal in the code, it will dutifully read all three documents in full. On the second edit, it reads them again.

    The direct costs of this mechanical execution are:

    • Soaring token costs: paying tens of thousands of tokens of context overhead for a single small change.
    • Stalled progress: the model spends a large amount of reasoning capacity processing irrelevant documents.
    • Worsened hallucinations: rapid context expansion dilutes key information and degrades output quality.

    2. Refactoring Core: From “Mandatory Full Load” to “Context Routing”

    The solution is not to delete all rules, but to transform the configuration from an “imperative checklist” into a “conditional routing table.” The core principle is: bind context loading tightly to the current specific task.

    2.1 Tightening Skill Trigger Conditions

    Replace broad domain words with specific action words. Compare with the officially recommended approach:

    1. # Good example: precise action binding
    2. Trigger when: adding or changing a migration, or reviewing its rollout.

    This wording describes a “specific task” rather than an “involved domain.” The Skill activates only when the user’s intent clearly points to “adding a migration” or “reviewing a rollout,” avoiding false triggers during ordinary logic changes.

    2.2 Building an AGENTS.md Routing Table

    Change “must read every time” to “load on demand.” This is essentially building a simple Context Routing Table:

    1. # Good example: conditional routing
    2. - Use architecture.md when modifying service boundaries.
    3. - Use database.md when applying schema changes.
    4. - Use deployment.md when preparing a deployment.

    The mapping is as follows:

    • Current task: modify service boundaries -> load architecture.md
    • Current task: change the schema -> load database.md
    • Current task: prepare a release -> load deployment.md

    In this way, after receiving an instruction, the model first determines the task type and then precisely pulls the corresponding document, preserving the rigor of the constraints while eliminating context pollution.

    3. Practical Guide: How to Do the Cleanup

    To apply this approach in Baidu AI Cloud or any enterprise development environment, follow these steps:

    1. Audit existing configuration: list all Skill and AGENTS.md entries, and flag rules containing absolute words such as “always,” “every,” “all,” and “any.”
    2. Quantify trigger frequency: review the past two weeks of session logs and count which rules are frequently mis-triggered. Typically, rules with a mis-trigger rate above 30% must be rewritten.
    3. Rewrite around actions: change words that describe “objects” into phrases that describe “action + object.” For example, change “handling errors” to “when catching a specific exception type in async flow.”
    4. Layer and deduplicate: if multiple documents have overlapping content, merge them. Strong models do not need redundant information to “guess” your intent; they need precise instructions.
    5. Keep observing: monitor context-length metrics in your alerting system. If the context input for a single simple task exceeds the expected threshold, some rules are still over-triggering.

    4. Further Thinking: Coordination with Cloud-Native Toolchains

    In a broader engineering practice, this idea of “streamlining context” aligns with cloud-native architecture. Just as microservices emphasize single responsibility, AI context management also needs decoupling.

    Using the standardized environment of a container platform, we can break project documentation into independent configuration sets and track the model’s context-loading behavior through message queues or logging services. When the model calls external tools (such as querying object storage metadata or invoking function compute), pass only the necessary metadata summary rather than the full document. This “pull on demand” pattern is key to improving human-AI collaboration efficiency in the future.

    Conclusion

    “If you learn slowly enough, you never have to learn” is a helpless joke, but in the face of technological evolution, keeping configuration minimal and precise is the lasting solution. Strong models do not need you to “feed” them massive amounts of rules; they need clear routing and explicit boundaries. Start cleaning up your Skills and AGENTS.md now, and save your tokens for the code that truly needs creativity.