Cleaning Skills and Rules for Strong Instruction-Following Models

    When coding agents follow instructions more strictly, skill docs and project-level agent files stop being hints and become constraints. This article explains how to retarget those files from compensating for weak models to task-routed context, so ordinary edits do not load long checklists, duplicate docs, or stall on conflicting rules.

    When a coding agent’s instruction-following is clearly stronger, every sentence in skill descriptions and project-level agent instruction files is no longer “optional advice.” It is closer to a constraint the model will try to execute. Early models often skipped docs and ignored process, so teams used wide triggers and hard pre-steps as compensation. At strong-following, the same wording becomes a regression: ordinary changes get treated as related work; long checklists, references, and multiple architecture docs repeatedly enter context; token use rises; progress slows; the window fills with irrelevant material; hallucination and drift can get worse. Vague, conflicting, or over-broad rules also make the model confirm repeatedly before acting, and can turn a small change that could continue into a human conversation.

    A “cleanup” is not deleting all standards. It is rewriting “forced actions that compensated for a weak model” into a “context strategy routed by task.”

    From compensation strategy to execution burden

    Early agents often failed in two ways: they did not retrieve project docs on their own, and they did not reliably follow local process. Instructions were therefore written as global duties—for example, “use a given skill when handling databases, queries, models, or persistence,” and “before every edit, read the architecture notes, data notes, and release notes.” Those sentences looked safe under weak following because the model often executed only part of them.

    A strong-following model takes coverage literally. “Database, query, model, persistence” can match most backend changes: a mapping field, a query condition, a cache key may all be treated as related to a migration skill. Once the skill fires, migration checklists, rollback steps, and reference snippets are injected together. The task may need a one-line business change; the context is still filled with unrelated process.

    Likewise, “read three long documents before every edit” is executed repeatedly. The first copy change requires a full read; a nearby string change requires another. Repeating the same facts does not make them more accurate; it occupies the window again and crowds out the relevant error, diff, and test output.

    Separate three kinds of context first

    Before cleanup, classify existing rules so you do not delete indiscriminately.

    The first class is always-on, short global constraints: language and framework versions, no committing secrets, non-negotiable style baselines, and the minimum verification commands that must pass. Keep these brief and do not inline an entire design document.

    The second class is topical context loaded by task: service boundaries, data schema, release steps, migration review, permission model. Bind these to a clear task, not to “any related vocabulary.”

    The third class is historical compensation: “read every time” because the old model would not fetch docs; oversized checklists because it skipped steps; contradictory tone stacked over time (for example both “stop on uncertainty” and “do not interrupt the user”). This class is the cleanup focus.

    Narrow skill triggers from domain nouns to task verbs

    Over-wide triggers usually show three signals: a list of domain nouns instead of a task description; “or” chaining many everyday actions; and attached steps and materials far longer than most hits actually need.

    A discouraged trigger intent is: enable the migration skill whenever data, queries, models, or persistence are involved. Preferred wording describes the actual work: add or change a migration, or review its release and rollback. Ordinary query fixes then do not load a migration checklist; the checks enter context only when a migration is really being changed.

    Tighten in four rewrite steps.

    First, write the action the skill is actually responsible for, not nouns it “might touch.” The action should be verifiable from the diff—for example “add a migration file,” “edit an existing migration,” “evaluate rollout order and rollback.”

    Second, state nearby work that should not trigger: changing queries, adjusting mapping-field comments, fixing business logic unrelated to schema. Negative bounds reduce over-generalization on fuzzy relatedness.

    Third, split the skill body into “entry conditions” and “execution steps.” Entry conditions only decide whether to load; steps appear only on a hit. Do not put a long checklist in project-level instructions every session will see.

    Fourth, control the volume of attached material. Point to reference docs with a path and a reading purpose; do not paste whole specs into the trigger text. The model can open the right file when needed.

    A product-neutral sketch:

    1. Skill name: data migration change
    2. Use when: adding or modifying a migration, or reviewing its release, compatibility, and rollback.
    3. Do not use only because a query, mapping, or ordinary persistence logic changed.
    4. On hit, read: schema-change section of the data notes; rollout order in the release notes.
    5. On hit, check: reentrancy, compatibility breakage, rollback path.

    Replace “read every time” with a routing table

    Project-level agent instructions work well as a short context routing table: which task loads which document, and what not to load on a miss. For example: read architecture notes when adjusting service boundaries; read data notes when changing schema; read release notes when preparing a release; do not default-read those long docs when fixing ordinary UI or copy.

    The table should meet four requirements.

    The task column uses observable change types, not abstract domains. File types, directories, or verbs in the user request are best.

    The document column keeps only chapters or files useful for the current decision, not a full-repo read. If a document is long, name section duties in the instruction—for example “read data notes only for field add/remove, constraint changes, or migrations.”

    Write the default path explicitly. Without a default, the model tends to “read more is safer.” For a strong-following model, the safe default is “open on demand when evidence is insufficient,” not “read every spec first.”

    Avoid overlap between routes. If a change touches both schema and release, specify a primary and secondary document, or look at the diff before deciding on a second file—not three documents as parallel mandatory reads.

    An executable routing sketch:

    1. Changing service boundaries or cross-module calls: read boundary and dependency sections of the architecture notes.
    2. Changing table structure, constraints, or migrations: read the schema section of the data notes.
    3. Preparing a release, rollback, or change window: read the release notes.
    4. Only changing copy, styles, or local logic unrelated to the above: do not pre-read those documents; open them on demand if tests or interface contracts show relevance.

    Conflicts, pauses, and blocking

    Another cost of strong following is asking too early. If rules simultaneously say “ask the user whenever uncertain,” “do not read extra files on your own,” and “finish the full checklist before editing,” the model stops when it still lacks information but is forbidden to gather evidence. Give it a path to continue: when relevance is unclear, inspect the current diff and directly related files first; confirm with the user only if the judgment still cannot be made and it affects data or release safety. Do not escalate every uncertainty into a block.

    Merge conflicting rules into one priority. A reasonable order: safety and data-destruction constraints above process preference; the user’s explicit request for this task above a generalized skill; on-demand reading above pre-reading; short verification above long restatement. The priority itself must stay short or it becomes another global burden.

    Delete instructions the current repo cannot satisfy: docs that no longer exist, checks that were retired, processes the team no longer uses. When the model cannot meet those preconditions, it often pauses to explain it cannot continue rather than skip them.

    Control context volume and repeated execution

    Cleanup should check both “is this correct” and “will we pay for it repeatedly.” If the same long document is fully read multiple times in one session, the trigger is usually written as a loop invariant, not a task condition. Change it to: if the session already read a document for this diff, and the diff has not expanded into a new section duty, do not re-read in full; if scope expands, only add the new section.

    Skill steps should also avoid pointless full rechecks. For a migration skill, checking reentrancy, compatibility, and rollback is reasonable; for a string change those checks add no information. Bind checks to post-hit steps, not to every edit, so cost stays on truly risky changes.

    A simple self-test for over-wide rules: sample ten recent small changes. If most of them would fire the same skill or the same set of long docs, the trigger is still too wide. Conversely, if real migration or release changes often miss the matching skill, it is too narrow—restore task verbs rather than falling back to domain nouns.

    Suggested cleanup order

    Inventory project-level instructions, each skill’s trigger sentence, and required reading they attach. Mark global-mandatory, task-routed, and historical-compensation.

    Rewrite triggers: replace domain nouns with verifiable tasks and add explicit non-trigger examples. Keep only steps needed after a hit.

    Turn “read before every edit” into a routing table, including when not to read by default and how to read incrementally when scope changes.

    Merge conflicts, delete pointers to dead docs and retired process, and limit safety pauses to a few cases such as data destruction, permission expansion, and irreversible release.

    Finally replay a few real small changes and real high-risk changes: small changes should not load long migration or release context; high-risk changes should hit the matching docs and checks, without pointless full re-reads in the same task.

    Strong following does not mean fewer engineering standards. It means more precise ones. Move skills and project-level instructions from “run everything just in case” to “route by task, escalate by risk,” so context is left for the diff, tests, and facts that actually affect the decision—not filled with the same long documents over and over.