One of the callers I reviewed could treat a refused request as a success. It made the request and never checked the response status. Elsewhere in the same codebase, shared helpers handled some of the same errors, but callers kept finding and copying older ways to fetch data.
The cleanup put direct fetches behind a shared HTTP layer. We added a lint rule, migrated existing callers and deleted the old helpers. I could flag a copied helper in review. With the rule in place, a new caller that fetched outside the shared layer could fail a check before it reached review.
Establishing what the rule should protect
In the code I reviewed, similar-looking helpers covered different subsets of errors. Some callers parsed responses directly, while others delegated that work to shared code.
An HTTP request can complete while the server returns an error. Each caller that handles the response on its own has to get that distinction right.
A useful rule expresses where that responsibility belongs. Restricting direct fetching to a shared HTTP layer gives callers one supported approach to request and error handling.
The shared implementation needs to cover the cases being migrated. Otherwise, enforcing its use pushes missing behaviour into wrappers around it. Reviewing existing callers helps define the supported approach and distinguish required behaviour from unnecessary variation.
Migrating with an exception list
Turning on a prohibition across an established repository can create more failures than one change can reasonably resolve. An exception list allows existing violations to remain temporarily while new code follows the rule.
The list must only shrink. Migrating a caller removes its exception. A new violation fails the check instead of becoming another entry by default.
In the cleanup I worked on, batches of migrations cleared the exception list and sharply reduced direct fetching outside the shared layer. That result concerns the code itself. It does not establish a production reliability improvement or isolate the effect of lint from the migration work.
The exception list and source inventory answer different questions. Clearing the list establishes that its configured exceptions are no longer needed. A separate source inventory is still necessary to inspect remaining occurrences and their context.
For a similar migration, I would keep the exceptions explicit and review changes to the list alongside changes to callers. A broad directory exclusion would make it difficult to tell whether the migration was progressing or new violations were being added.
Removing obsolete examples
Documenting a preferred approach leaves old helpers available to import. Their callers also provide examples that an agent can copy from neighbouring code.
Deleting obsolete helpers reduces the number of supported choices. Once their callers have moved, preserving the old exports leaves both implementations available to future changes. Deletion forms part of completing the migration.
The same consideration applies to shared UI components. When two generations remain in use, a reviewer has to establish which is appropriate for each change. Removing the older implementation after migration makes that choice explicit in the source.
Deletion needs its own checks. A replacement may change error handling, cancellation or another behaviour that callers depend on. The migration has to verify those requirements before the old implementation can be removed.
Keeping judgement in the review
The review skill I use asks the agent to identify recurring findings that could become automated checks. Some findings are easier to encode than others. Restricting a direct API call to a designated module gives a checker a concrete boundary. Deciding whether a route-local component should become shared requires understanding its responsibilities and consumers.
I would automate the API boundary once the intended rule is clear. A proposed component move needs a review of actual usage and an explanation of why the move would help. A generic interface alone does not establish that a component belongs in a shared directory.
Review also remains useful when a shared component almost covers a requirement. Adding an option may be appropriate, but that decision needs to account for existing consumers. A blanket requirement to reuse a component cannot establish that its behaviour fits.
A branch review has another limit: inconsistencies already on the main branch may be outside its diff. A focused folder audit can examine those files directly. Keeping the audit bounded makes the resulting work easier to assess without expanding every feature change into a repository-wide cleanup.
Maintaining the instructions alongside the code
Review instructions can become another source of obsolete examples. My personal review skill still described a completed migration and named a removed component. A planned check had never been added to it. Following those instructions would preserve assumptions that no longer matched the source.
Instructions therefore need to be updated with the implementation they describe. Reading the current shared folders helps, but the review method itself can still preserve an outdated assumption about what should exist.
A personal skill also has limited reach. Other contributors and agents may never load it. Rules intended to apply across the repository need to be available through the shared development workflow, with automated enforcement where the condition can be checked reliably.
Choose a rule you can enforce
I’d apply the same approach to a recurring finding once the shared implementation covers the callers’ real needs. A check can tell whether a direct fetch sits outside the HTTP layer. A reviewer still has to decide whether two callers genuinely need different error handling. The rule keeps new direct fetches out while the migration deals with those differences. Once the last caller moves, deleting the old helper also removes the example the next agent might have copied.