Prompting Guide for Next-Generation Instruction-Following Models: Practical Cleanup of Skills and AGENTS.md
As models improve at following instructions, old prompt rules can start causing real problems. This article explains why vague or overly broad rules backfire, how to identify common negative optimizations in Skills and AGENTS.md, and how to restructure context rules around decidable triggers, minimal necessity, layered loading, and on-demand retrieval. It also outlines a step-by-step cleanup process and common pitfalls to avoid.
1. Why Stronger Instruction Following Breaks Old Rules
A recurring pattern appears whenever a new generation of large models improves its instruction-following ability: the community starts reporting that old prompts and old rules have collectively stopped working. The reason is not mysterious. Earlier models often ignored soft constraints in the context selectively. As a result, many rough, verbose, and overlapping rules were written down but rarely enforced, so they appeared harmless.
Once a model begins to take every instruction in the context seriously, those legacy rules are actually triggered, and their negative costs become visible.
These costs show up in three main ways:
- Token and latency cost: Repeated, meaningless reads and checks lengthen the task chain.
- Context bloat: Irrelevant content crowds the context window, dilutes key information, and increases the probability of hallucination.
- Task blocking: Rules that are too broad or conflict with each other can make the model pause early, repeatedly ask the user for confirmation, or stall the entire workflow.
For this reason, giving Skills and AGENTS.md a thorough cleanup is not a joke. It is a necessary engineering step when migrating to a model with strong instruction following.
2. How Two Types of Negative-Optimization Rules Emerge
2.1 Skills with Overly Broad Triggers
A common anti-pattern is to describe a Skill’s scope with broad domain terms, such as “use when working with databases, queries, models, or persistence.” The problem is that many everyday development tasks touch these areas slightly: changing an ORM field, fixing a query, or adjusting a return structure can all be judged as “relevant.” Once the Skill is falsely triggered, the attached migration standards, checklists, and reference material all enter the context, creating a heavy process that was never requested.
The fix is to change the description from a domain to specific actions and artifacts:
# Anti-pattern (too broad)Use when working with databases, queries, models, or persistence.# Improved (scoped to a concrete task)Use when adding or changing a migration, or reviewing its rollout.
The subject of the first version is a set of technical nouns. The subject of the second version is a decidable task boundary. When the model judges relevance, the second version leaves almost no room for ambiguity.
2.2 AGENTS.md That Forces Full Reads
Another frequent problem is a hard constraint such as “read all architecture documents before every edit.” This rule was born in an earlier stage when agents did not proactively retrieve project material. It was a stopgap that compensated for weak retrieval ability with brute force. On a model with proactive retrieval and tool-calling ability, this rule is executed literally: read once to change a string, read again for the next change. Besides consuming tokens and slowing progress, it quickly drives up context usage.
3. Principles for Restructuring Context Rules
- Decidability first: Every rule should be clearly judged as applicable or not applicable. Avoid adjectives and broad domain words.
- Minimum necessary: Keep only the rules that change model behavior, and delete entries that look professional but never take effect.
- Layered loading: Separate always-loaded content from on-demand content, and separate global constraints from project constraints.
- No conflicts: Keep only one authoritative statement per topic, and avoid different wording across multiple documents.
- Measurable: Establish observation of hit rate and token cost for rules, and use data to decide what to keep or delete.
A simple layered structure:
global/ # Cross-project: code style, commit conventions, security baselineproject/ # Project-level: directory conventions, build method, test requirementsmodules/ # Module-level: on-demand specialized standards and reference material
4. Implementation Steps: A Thorough Cleanup
Step 1: Inventory. List all Skill descriptions and project constraint files together, and mark the source and last modification time of each rule. Rules that have not taken effect for a long time should go to the deletion candidate list first.
Step 2: Rewrite trigger conditions. Replace “domain word + generic verb” with “action + artifact + stage.” For example, change “use when handling configuration” to “use when adding or changing a configuration item definition and backward compatibility is required.”
Step 3: Deduplicate and merge. Keep only one place for the same constraint and turn the rest into references. For conflicting entries, make a choice and keep the one that matches the current technology stack.
Step 4: Switch to on-demand reading. Replace full reads with retrieval:
# Anti-patternBefore every edit, read architecture.md, database.md and deployment.md.# ImprovedWhen the change touches persistence, retrieve only the relevant sectionsof the persistence guide before editing.
Step 5: Canary release and observation. Enable the new rules in low-risk repositories first, and observe task completion rate, average number of turns, context length, and the number of manual confirmations. Then roll out gradually.
5. Common Pitfalls
- Making rules longer and longer: Length does not equal binding force. Redundancy only enlarges the surface for false triggers.
- Stacking prohibitions for safety: Too many “do not” statements increase the probability of blocking. Use clear goals and acceptance criteria instead.
- Replacing everything at once: Without canary release and rollback, a migration period can easily cause a collective drop in efficiency.
- Ignoring version governance: If rules are not placed under version control and review, conflicts will keep coming back.
6. Conclusion
Improving a model’s instruction-following ability essentially turns context quality into a direct amplifier of execution quality. If rules are vague, the model executes them repeatedly and vaguely. If rules are precise, the model acts stably within boundaries. Narrowing Skill triggers to concrete tasks, replacing forced reads with on-demand retrieval, and merging scattered constraints into layered, single-source authoritative statements is the most cost-effective engineering cleanup after migrating to a new generation of models. In engineering practice on platforms such as Baidu AI Cloud, this kind of context governance can also be quantified with common capabilities such as log services and monitoring alerts, so that every addition or removal of a rule is backed by data rather than stacked by intuition.
