Why Stronger Instruction Following Requires Cleaning Up Your Skills

    As AI coding tools follow instructions more faithfully, poorly written rules in system prompts, project files, and Skill descriptions are now executed literally instead of being ignored. This article explains two common anti-patterns—overly broad Skill triggers and mandatory read-everything steps—and how they inflate context, dilute instructions, and slow tasks down. It then lays out four engineering principles for context governance, a practical rewrite of AGENTS.md, a lightweight evaluation loop with regression metrics, and a recommended rollout order. The takeaway: stronger instruction following is an opportunity to make implicit conventions explicit, yielding lower cost, shorter paths, and more stable output.

    1. The Problem Isn’t a Dumber Model—It’s Rules Being Taken Literally

    A common misdiagnosis in the industry: when an AI coding tool starts stopping frequently to confirm, repeatedly reading documentation, or stretching a small change into a lengthy process, the first reaction is often “the model has gotten worse.” The reality is usually the opposite. Newer models follow system prompts, project-level instruction files, and Skill descriptions much more faithfully. The side effect is that bad rules the model used to “ignore” are now executed line by line.

    This leads to an engineering conclusion: context rules have shifted from “advisory text” to “executable constraints.” Since they are constraints, they need to be treated like code—with clear boundaries, no duplication, no conflicts, and testable behavior.

    2. Two Typical Anti-Patterns and How They Get Amplified

    2.1 Overly Broad Triggers: Skills Activated Too Often

    If a Skill description is written as a phrase covering a large semantic space—for example, “use when working with databases, queries, models, or persistence”—then almost every backend task will match. A user simply renaming an ORM field or fixing a query gets flagged as relevant, so migration steps, rollback checks, and reference material are all injected into context.

    The amplification chain looks like this:

    1. broad trigger words → high-recall false triggers → Skill body injected
    2. → context bloat → attention dilution → extra confirmations/blocking → slower progress

    The fix is to replace “domain words” with “action words,” so the description points to a concrete, decidable task:

    1. # Bad example: scope too broad
    2. skill: database-migration
    3. when: working with databases, queries, models, or persistence
    4. # Fixed: bound to concrete actions and artifacts
    5. skill: database-migration
    6. when:
    7. - adding or changing a migration file
    8. - reviewing a migration rollout plan
    9. exclude:
    10. - renaming a field in an existing model
    11. - adjusting a read-only query

    2.2 Mandatory Reads and Mandatory Steps: Blind Repetition

    Another common pattern is “before every edit, you must read the architecture, database, and deployment docs.” This rule was born in an early stage when tools did not proactively retrieve documentation—it used a hard constraint to compensate for missing retrieval capability. Once instruction following improved, the model executes it strictly: change one string, read once; make a second change, read again.

    The cost is not just wasted tokens. More importantly, rapid context bloat causes instruction dilution and more hallucinations—the constraints that actually matter get drowned out by large amounts of irrelevant content.

    3. Four Engineering Principles for Context Governance

    1. Minimal and sufficient: Write only information the model does not know and must know. Do not put content that can be derived from code, type definitions, or configuration into prompts.
    2. Decidable: Trigger conditions must be clearly judgeable as true or false. Avoid subjective words like “relevant,” “when necessary,” or “appropriate.”
    3. Single source: Define the same constraint in only one place; reference it elsewhere instead of copying, to prevent rule drift and conflicts.
    4. Layering and caching: Layer by stability. Stable layers can be cached and reused; volatile layers are injected on demand.

    Layering example:

    1. L0 Global constraints (security and collaboration norms, highly stable, cacheable)
    2. L1 Repo-level notes (build, directory conventions, commit standards)
    3. L2 Module/Skill notes (loaded only when a concrete action matches)
    4. L3 Task context (current request, relevant file snippets)

    4. A Practical Way to Rewrite AGENTS.md

    Consider reshaping the project instruction file from a “process manual” into a “fact list + exception list”:

    1. ## Facts
    2. - Build and test commands are in the scripts directory; choose the minimal verification set based on the scope of the change.
    3. - All data access goes through the repository layer; do not concatenate queries in handlers.
    4. ## Confirm proactively
    5. - Changes to data structures, external API signatures, or permission models.
    6. ## Do not
    7. - Do not run the full regression suite for pure copy or comment changes.
    8. - Do not re-read documents that already appeared in the current context.

    There are three key changes: turn “must read every time” into “retrieve on demand and cacheable”; turn broad domain words into concrete actions; and turn mandatory processes into “confirm only for high-risk changes,” removing blocking for low-risk tasks.

    5. A Verification Loop: Make Rules Regressable

    Rules are text, but they can be measured with engineering means. Build a lightweight evaluation set where each case includes a task description, the expected Skill to trigger, the expected set of files to read, and an upper token limit:

    1. Case: change the display name of a field in the user table
    2. Expected Skill: none
    3. Expected reads: target file only
    4. Assertion: Skill hit count = 0, files read ≤ 2

    Continuously track three metrics: Skill false-trigger rate, average injected tokens per task, and mid-task confirmation count. If metrics worsen, the rules are degrading—go back to the minimal-and-sufficient principle and trim again.

    Start by subtracting: delete rules that can be derived from code and duplicate docs. Then tighten: add when/exclude and concrete actions to each Skill. Next, add layering and caching. Finally, add evaluation and monitoring alerts, folding context governance into the daily pipeline. If your team already uses general capabilities such as cloud-based logging and monitoring/alerting, you can turn the metrics above into a dashboard for long-term visibility into rule quality.

    The conclusion is straightforward: stronger instruction following is not a burden, but an opportunity to make implicit conventions explicit. Whoever cleans up their context gets lower cost, a shorter path, and more stable output at the same time.