How to Simplify Project Rules After a Major LLM Upgrade

    After upgrading to a new coding model, teams often keep adding rules instead of removing outdated ones. This article presents a practical method for auditing existing project rules by the type of mistake each rule prevents. It covers aligning on context window limits, compression targets, model tiers, and evidence boundaries; migrating rules into scripts, acceptance criteria, tool definitions, and type signatures; loading rules in layers; managing context budgets; and building a regression loop to verify that removing a rule is safe. Readers will learn how to keep a shorter rule file without sacrificing delivery quality.

    1. Introduction: Don’t Add Rules Right After a Model Upgrade

    “Run the tests after every change.” If I could keep only one sentence from a project rules file, this would be it—but only if the test command is fixed inside a script and the test result is written into the acceptance criteria. Whether a change can be accepted should not depend on the model’s memory.

    An engineer at a cloud vendor reorganized their assistant “scaffolding” after switching to a new generation of AI coding models: the rule instructions given to the model at the start of each task, tool descriptions, project knowledge, and conversation history. Every sentence once written into the rules file had a reason behind it: a dependency import that was casually deleted, a comment that translated a function name into Chinese, a missing test that only surfaced when the pipeline turned red. But those mistakes happened with the old model. After the switch, does the model still need to read all of them every turn?

    The most useful takeaway from this review is not a specific conclusion, but the method for handling old rules: some can be deleted, some need to be enforced somewhere else, and others must stay where they are. Telling them apart requires asking what kind of mistake each rule was originally meant to prevent.

    2. Align the Premises First: Capability, Context, and Evidence Boundaries

    Before discussing whether a rule can be deleted, align on a few concepts; otherwise, numbers from different sources get mixed together.

    • Context window: The upper limit on the total material a model can read in one pass—think of it as “all the reading material spread out on the table at once.” It determines how much history a long conversation can retain, but it does not equal effective utilization.
    • Compression target: In practice, a working threshold far below the upper limit is often set for the context, leaving room for retrieval results, tool returns, and intermediate artifacts. The upper limit and the threshold come from different sources and are the easiest to confuse when migrating.
    • Model tiers: A model family usually includes a high-capability tier for complex, long-running tasks, a fast tier for everyday execution, and a tier in between for balance; the scheduling layer can split work into “planning” and “execution.” These are common industry tiering patterns, independent of any specific product.
    • Evidence boundary: Long-term personal usage records have reference value, but without reproducible controlled experiments, they should not be treated as universal conclusions. When vendor staff evaluate their own models, their position should also be taken into account.

    Two specific observations in the original text are worth noting: a tool constraint declared only once in the tool definition was still followed in the later part of a long conversation; on-demand skills and lazily loaded tools were triggered with high accuracy. Both point to the same thing—placing a constraint close to where it applies works better than repeating reminders.

    3. Core Method: Classify Rules by the Type of Mistake They Prevent

    Classifying rules by their origin (the pits you have fallen into) is less useful than classifying them by the error mechanism they prevent. Use four quadrants:

    Mistake type Typical rule How to handle it
    Preventing omissions (forgetting to do something) Run tests after changes; run formatting before committing Move to scripts and acceptance criteria
    Preventing misuse (wrong API or parameters) Specifying how to call, directory conventions Put at tool definitions and type signatures
    Preventing boundary violations (touching forbidden areas) Don’t touch production config; don’t delete data Keep in the rules file, and place as early as possible
    Preventing style drift Naming, comment language Hand over to formatting and static checks

    The rule of thumb: what a machine can decide, give to the machine; what needs value judgment, leave to the model; what only holds in a specific scenario, put into that scenario.

    4. Implementation Steps

    1. Inventory: List the rules file item by item, marking “the mistake it originally prevented” and “the last time it actually stopped a problem.” Rules that have not stopped anything for a long time are the first to suspect.
    2. Migrate: Rewrite the omission-prevention rules as executable scripts, and write “tests pass” into the task acceptance criteria.
    1. #!/usr/bin/env bash
    2. set -euo pipefail
    3. # Acceptance entry point: formatting, static checks, unit tests, build
    4. run_checks() {
    5. local scope="${1:-.}"
    6. echo "[check] format & lint: $scope"
    7. # Fill in the actual commands based on the project's tech stack
    8. echo "[check] unit test: $scope"
    9. echo "[check] build: $scope"
    10. }
    11. run_checks "${1:-.}"
    1. Place close to the point of use: Write the misuse-prevention rules into tool descriptions, interface definitions, and examples, so the model sees the constraint “at the moment it reaches out,” instead of reading a long list at the start of the session.
    2. Load in layers: Keep only cross-project red lines in the rules file; retrieve project-specific knowledge on demand; compress long histories into summaries.
    3. Budget constraint: Set a working threshold for the context, for example a compression target far below the upper limit, and define separate quotas for retrieval results and tool returns, to avoid “lots of material, scattered attention.”

    An illustrative rules file structure:

    1. # Global red lines (always loaded, keep as short as possible)
    2. - Do not modify production configuration or permission policies
    3. - Do not perform irreversible deletion; explicit confirmation is required
    4. - Any change must pass the acceptance script
    5. # Project knowledge (retrieved on demand)
    6. - Module boundaries and dependency direction
    7. - Data models and migration conventions
    8. # Scenario rules (loaded when entering the corresponding directory/task)
    9. - Frontend directory: component and style conventions
    10. - Data directory: batch processing and rerun conventions

    5. Context Budget Management

    Degradation in long sessions is often not “can’t remember” but “drowned out.” Three actionable strategies:

    • Quotas: Set separate limits for system red lines, retrieved snippets, and tool returns; when a limit is exceeded, compress the oldest and most verbose content first.
    • Layered summaries: Apply rolling summaries to the conversation history, keeping decisions and constraints and discarding process output.
    • Externalized memory: Write stable facts into repository documentation and tests, so “memory” lives on a verifiable carrier rather than in the conversation.

    6. Evaluation Loop: Don’t Judge “Safe to Delete” by Feeling

    Deleting a rule is a change, so it needs acceptance. Build a small regression set:

    • Case sources: Pitfalls actually encountered in history, with at least one positive and one negative case per rule.
    • Metrics: Constraint compliance rate, false trigger rate, task completion rate, average context usage.
    • Process: Record the baseline first, then delete the rule and run the same set of cases for comparison; restore immediately if a regression appears.
    • Cadence: Run the full set when the model or scaffolding changes; run a subset for routine changes.

    7. Common Pitfalls

    • Treating rules as memory: The model does not guarantee remembering a list across sessions; script whatever can be scripted instead of relying on reminders.
    • Rules keep growing: Every rule has a context cost, and redundant rules dilute attention.
    • Copying others’ conclusions: Other people’s model tiers, toolchains, and project constraints differ, so conclusions need local validation.
    • Only looking at the upper limit, not the threshold: A large context window does not mean long sessions won’t degrade.

    8. Conclusion

    The right way to handle a model upgrade is neither to keep all old rules nor to start over, but to run a “mistake type” audit: turn what a machine can decide into scripts and acceptance criteria, keep what needs judgment in the red lines, and put what is scenario-specific into the scenario. This way, the rules file gets shorter and delivery quality becomes more stable.