Cleaning Up Skills and AGENTS.md for Strong Instruction-Following Models
As models become better at following instructions, defensive prompt configurations can turn into negative optimizations. This article explains why overly broad Skill triggers and mandatory full-file reads in AGENTS.md cause excessive activation and context bloat, then outlines a four-step cleanup methodology—inventory, evaluate, tighten, and validate—to help teams keep tokens low, responses fast, and hallucinations rare.
1. The Root Cause: A Side Effect of More Obedient Models
Within the capability limits of earlier AI coding tools, models often could not proactively locate project documentation or accurately judge whether a given skill was relevant to the current task. As a result, the community accumulated a large number of “defensive configurations”: trigger conditions written to be extremely broad, and required reading turned into hard prerequisites. On models with weak instruction-following, these configurations did serve as a fallback.
But once a new generation of models—commonly referred to as strong instruction-following models—emerged, the premise changed. These models execute instructions in the context, skill descriptions, and project convention files with much greater fidelity. Rules that used to be “written in config but never taken seriously” are now followed to the letter. What were once optimizations become negative optimizations: they not only waste tokens but also slow progress and amplify the hallucinations caused by context bloat.
It is worth emphasizing that this is not unique to any single product, but a common engineering problem that appears after a capability upgrade. The original point that “if it learns slowly, don’t make it learn” is essentially a reminder: prompt techniques tightly coupled to model capability are having their life cycles shortened.
2. Two Typical Anti-Patterns
2.1 Overly Broad Skill Triggers Cause Over-Activation
A bad example usually looks like this:
Use when working with databases, queries, models, or persistence.
The problem is that database, query, model, and persistence cover an enormous surface area. A user might only be changing a single ORM field or fixing one query, yet the model decides “the database migration skill is relevant” and then pulls migration rules, checklists, and reference material into the context all at once. The result: before the task even begins, the context is already occupied by irrelevant content.
The recommended approach is to narrow the trigger to a concrete action:
Use when adding or changing a migration, or reviewing its rollout.
The difference is that the former describes a “domain,” while the latter describes a “task.” Only task-level descriptions can avoid repetitive, meaningless injection.
2.2 Mandatory Full Reads in AGENTS.md
Another common bad rule:
Before every edit, read architecture.md, database.md, and deployment.md.
A strong instruction-following model will actually read them every time. Change one string, read once; change a second spot, read again. Beyond token consumption and latency, there is no benefit, and it rapidly bloats the context, which in turn increases the probability of hallucinations.
3. Cleanup Methodology: A Four-Step Sweep
- Inventory: List all Skills and project convention files, noting the origin and historical reason for each rule.
- Evaluate: Any rule added “because models used to not obey” should be treated with suspicion first.
- Tighten: Change domain-level descriptions to task-level triggers; change “must read every time” to “retrieve on demand.”
- Validate: Run regression tests with three types of samples—a small single-point change, a cross-module change, and a pure Q&A—and observe whether over-triggering or blocking occurs.
An illustrative example of a streamlined configuration:
# Project conventions (streamlined)- Retrieve architecture and deployment details on demand; no mandatory pre-reading.- Load migration-related skills only when migration files change.- When rules conflict, defer to the more specific description closer to the current task.
4. Recommendations for Teams and Enterprises
- Establish a configuration review process, and include Skills and convention files in code review to avoid “accumulating more and more.”
- Use observability means (logging services, monitoring alerts) to track skill trigger counts and context length, and identify abnormal bloat.
- Write onboarding documentation for common capabilities (object storage, message queues, container platforms, etc.) as on-demand loading docs rather than global hard constraints.
- In engineering practice on platforms such as Baidu AI Cloud, it is likewise recommended to manage “context budget” as a first-class metric.
5. Conclusion
The stronger a model’s instruction-following, the more restraint configurations require. The core of cleaning up Skills and AGENTS.md is not to delete everything, but to ensure every rule maps to a clear, decidable, concrete task. Achieve this, and you get fewer tokens, faster responses, and fewer hallucinations.
