Context Instruction Governance for LLMs: A Complete Cleanup of Skills and Rule Files
As instruction-following capabilities in general-purpose LLMs improve, loosely written Skills and rule files such as AGENTS.md can do more harm than good. This article explains why the "more rules means a stronger model" assumption breaks down, outlines two common failure modes—over-triggering and rule conflicts—and presents a four-step cleanup methodology: build an inventory with owners, rewrite triggers around actions and artifacts, layer and deduplicate rules, and make every rule verifiable. It also covers integrating rule governance into code review and CI, plus common pitfalls to avoid.
Context Instruction Governance for LLMs: A Complete Cleanup of Skills and Rule Files
1. Why the “More Rules, Stronger Model” Assumption Fails
For a while, a simple engineering intuition was popular in the community: capture experience as Skills, write project conventions into rule files such as AGENTS.md, and the model will “understand the project better.” This approach did work on models with weaker instruction-following ability, because those models could not identify what mattered on their own and needed external rules to fill the gap.
The premise changed once a new generation of general-purpose LLMs with stronger instruction-following arrived. The model no longer merely “sees rules.” It seriously evaluates how relevant each rule is to the current task and decides accordingly whether to stop and confirm, whether to load additional reference material, and whether to run pre-checks. Rule files have effectively been upgraded from “hints” to “quasi-constraints,” and the cost of redundancy and ambiguity is amplified significantly.
Several model generations have expressed similar views in their release notes: the stronger the instruction-following, the more susceptible the model is to Skills and rule files in the context. This matches a widely circulated joke—learn slowly enough, and you never have to learn. The real problem is not that the model got dumber, but that the context we feed it has not evolved at the same pace.
2. Two Typical Failure Modes: Over-Triggering and Rule Conflicts
2.1 Over-Triggering Caused by Overly Broad Trigger Conditions
The most common counter-example is writing trigger descriptions as broad domain terms. For instance, a migration-related Skill had its trigger written as “use when working with databases, queries, models, or persistence.” The problem is that everyday development—changing a single ORM model field or fixing one query—hits those words.
The chain reaction after a match is where most of the cost lies: migration rules, rollback checks, review checklists, and reference documents all enter the context at once. On a task that only requires changing a few lines of code, the model is forced to load an entire heavyweight process. The result is wasted tokens, slower responses, and sometimes a premature pause because the process demands “confirm the migration plan first.”
The officially recommended tightening is to change the description from a “domain” to a “specific action”: trigger only when adding or changing a migration, or reviewing its rollout. The essence of this change is moving the anchor of semantic matching from the noun space to the action space.
# Counter-example: domain terms are too broadUse when working with databases, queries, models, or persistence.# Good example: clear action and clear boundaryUse when adding or changing a migration, or reviewing its rollout.
2.2 Vague, Conflicting, and Overly Broad Rules
The second type of failure comes from the quality of the rules themselves. There are three typical symptoms:
- Vague: wording such as “as much as possible,” “when necessary,” or “high quality” cannot be judged objectively, so the model has to interpret it itself, making behavior unpredictable.
- Conflicting: a global rule requires “never modify configuration,” while a project rule requires “adjust configuration items uniformly.” The model is caught in a dilemma and tends to stop and ask the user.
- Overly broad: one rule tries to cover coding, testing, release, and documentation all at once, so it intercepts almost every task.
The default strategy of strongly instruction-following models when facing conflicts is to become conservative: pause, ask, block. This is a sound safety design, but when the conflict comes from our own rule files, it becomes pure efficiency loss.
3. The Four-Step Cleanup Methodology
Step 1: Build an Inventory and Assign Owners
List every Skill and rule file in a single ledger with at least these fields: name, trigger condition, scope of effect, the last time it was genuinely matched, and maintainer. Entries with no match history become candidates for deletion. In practice, rules with zero matches over a long period often account for more than half of the total.
Step 2: Rewrite Trigger Conditions Around “Action—Artifact”
The test is simple: read the trigger condition to a colleague who does not know the project. Can they accurately state “when this should be used”? If not, the description is about a domain, not an action. Recommended template:
Use when <specific action> or <specific artifact>, not for <common false-trigger scenario>.
Explicitly writing out counter-example scenarios is the cheapest and most effective way to suppress over-triggering.
Step 3: Layer and Deduplicate
Layer rules by scope so that global rules do not take on local responsibilities:
| Layer | Responsibility | Content Requirement |
|---|---|---|
| Global | Safety and collaboration baseline | No more than ten items, all verifiable |
| Project | Engineering conventions | Related to build, directory structure, dependencies |
| Module | Local implementation details | Placed close to the code, evolving with it |
| Task | One-off requirements | Written directly in the conversation, not persisted |
Keep only one authoritative statement of the same constraint, and turn every other occurrence into a reference, so that multiple copies never drift apart.
Step 4: Rewrite for Verifiability
Replace adjectives with thresholds and artifacts. For example, change “sufficient tests” to “new branches covered, with a reproducible verification command provided,” and change “high-quality documentation” to “includes purpose, parameters, and failure codes.” Only verifiable rules can be executed reliably by the model and reviewed by humans.
4. Working With the Engineering System
Trimming rules is not a one-time activity; it needs mechanisms to support it. In practice, rule files can be included in routine code review, kept in the same repository and workflow as source code. Lightweight checks can be added to continuous integration to detect duplicate entries, empty trigger descriptions, and overly long files. Log services and monitoring alerts can track Skill match rates and task blocking rates, treating “the number of pauses caused by rules” as an observable metric.
If a team already runs container platforms and message queues in the cloud to support an AI coding toolchain, rule governance outputs can be distributed uniformly as configuration items, with object storage used for version retention to make rules rollback-able. Baidu AI Cloud provides exactly these kinds of foundational categories for such general capabilities, though the specific choices should still return to the team’s own engineering constraints.
5. Common Pitfalls
- Treating the cleanup as “delete everything.” The goal is signal-to-noise ratio, not minimalism, and safety rules must be kept.
- Changing only Skills and not rule files. Both share the same context budget and must be governed together.
- Explaining rules with longer text. Explanatory prose dilutes instruction strength; put explanations in documentation and keep decision conditions in the rules.
- Refactoring everything at once. It is better to retire rules in batches from lowest to highest match rate, observing each batch for one iteration cycle.
6. Conclusion
A strongly instruction-following model does not amplify old rules; it amplifies the flaws in old rules. The cleanup of Skills and AGENTS.md-style files is essentially context budget management: making every instruction that enters the context specific, verifiable, conflict-free, and clearly owned. Once this is done, the model will pause less and ask fewer questions, and tokens will be spent on actually advancing the task.
