Matt Pocock shares expand/contract trick: split one-way-door PRs to de-risk big changes

mattpocockuk · x · 2026-10-27

Matt Pocock shares a practical engineering pattern: when a PR contains a "one-way door" (hard-to-revert) change, split it into two stacked PRs — one implementing everything but easily revertible (a two-way door), and a follow-up PR that actually crosses the one-way door, using feature flags as needed.

This de-risks huge changes by letting most of the work be tested in production before the irreversible step lands. Also known as expand/contract, it pairs well with AI coding agents generating large diffs.

Original post →

More from coding & agent

coding & agent channel →