Lessons for engineering teams
Make technical work easier to explain, review and hand over. Use lessons on systems, problem-solving and collaboration to improve the next design discussion or written decision.
Lesson previews
Behavior lock What must stay unchanged during a refactor? The externally visible behavior: return values, side effects, API contract, persisted data, and user-visible outcomes. If one of these changes, switch mental modes and call it feature or bug-fix work. Refactor vs rewrite Which move fits the moment? Prefer refactoring when the behavior must remain and the team can improve structure incrementally. Pressure line We do not have time to refactor; just patch it. Use when a tiny structure move makes the patch safer. Your response I am proposing one local extraction so the patch changes the policy in one named…
5 minSort Refactors by Blast RadiusSort each cleanup idea by blast radius so the verification plan matches the risk. Local micro-refactor Boundary design refactor Architecture migration Rename x to invoiceTotal inside one function Extract taxableSubtotal from a single invoice function Move discount rules behind a PricingPolicy interface used by four callers Inject StorageClient into exporter instead of constructing S3 inside it Route password reset from the old portal to a new service for 10% of users Move one invoice template to a new PDF renderer behind routing config blast-radius-spectrum bucket-grid verification-chips
5 minSort the Safety Net Before RefactoringSort each refactoring situation into the most useful first safety-net check. Unit test Characterization test Integration or contract test End-to-end smoke Extract a pure tax calculation from a long function Remove duplicate money rounding after adding a failing example Refactor a legacy parser where nobody knows every edge case Move a renewal notice formatter with production examples but no spec Swap payment SDK behind a gateway interface Inject a storage adapter that must still write to the real bucket in staging Strangle the checkout route for a small customer segment Move password reset to a new service behind routing config
5 minSort the Smell to the Refactoring MoveSort each code smell into the proportional first refactoring move. Extract shared behavior Introduce named concept Name the literal Delete after evidence Same email-domain validation copied in checkout and admin Three callers repeat the same active-discount condition startDate, endDate, and graceDays travel together through reports Street, city, country, and postal code are passed as a group 86400 appears in cache and renewal calculations 0.875 decides eligibility with no domain name A feature flag has been false for nine months with no reads in logs A branch handles a plan type removed from production last year
5 minSpot When Parameters Want a NameThe repeated date-related parameters are not merely too many values; they are a missing concept with rules attached.
5 minStrangle a Rewrite Into Small ReplacementsRewrite pressure Two missed quarters, one support portal, and a password-reset flow small enough to isolate. The migration needs production learning before total commitment. Migration shape Wrap -> route one slice -> compare -> retire A strangler migration turns replacement into a sequence of small production decisions. Big bang Build everything in parallel and switch all traffic at once. Lower cutover risk and earlier learning. Incremental replacement beats delayed certainty. 01 Boundary 02 Slice 03 Try fresh Create the boundary Step 1
5 minTreat Code Smells as Evidence, Not VerdictsThe signal A smell is a clue, not a conviction. It points to a possible design weakness, but the refactoring decision still depends on context, risk, and expected change. The cost test Translate the smell into cost. Long method: what decision is hidden? Duplicated code: which upcoming change would be repeated? Long parameter list: which concept is being passed around without a name? Once the cost is visible, the fix is easier to size. The restraint Smell chasing becomes waste when the team optimizes code nobody changes or breaks a stable boundary to satisfy a rule. Refactor where the smell…
5 minUse Branch by Abstraction Without a Long-Lived BranchIntegration pressure Payments SDK swap, three teams, daily releases, and no appetite for a six-week merge party. The migration must keep mainline green while implementation changes underneath. Branch in code Abstract -> route old -> add new -> switch -> delete The abstraction gives both implementations a shared contract while callers keep shipping. Long branch Work away from mainline until the final painful merge. Mainline stays releasable. Continuous integration is protected by compatible steps. 01 Contract 02 Switch 03 Try fresh Name the contract Step 1
5 minUse the Mikado Method When Every Change Breaks SomethingRemove a circular dependency where orders imports billing, but direct removal breaks imports and tests. Mikado Method: try the direct goal, roll back on failure, record prerequisites, then implement leaf nodes first. Pushing through a broken refactor creates a half-migrated working tree where every failure has multiple possible causes. Write the goal Top node: orders no longer imports billing. A clear goal keeps discovery focused. Try the direct change Remove the import and run tests; imports fail on InvoiceSummary. The failure is information, not a reason to keep hacking. Rollback and record prerequisite Restore the tree; add node: move summary…
5 minWalk a Legacy Function to a Safe First ChangeLegacy pressure Claims parser, no tests, Thursday deadline, and a production incident already open. The risk is not that refactoring is slow; the risk is changing behavior you cannot see. Safe-change path Characterize -> seam -> small refactor -> new behavior The path narrows uncertainty before it narrows code. Shortcut Edit the parser directly and hope manual QA catches drift. The new claim type lands with a visible safety net. Feedback before courage. 01 Observe 02 Isolate 03 Try fresh Observe current behavior Step 1
5 minReference Mirrors the ThingReference is a map, not a tour. The reader is not asking you to guide them through a workflow. They are asking you to expose a fact in a stable, scannable place. Diataxis makes reference distinct from explanation for exactly this reason. Explanation can interpret. Reference should mostly describe. Minimalism sharpens the standard: neutral labels, exact names, and as little narrative as possible. Docs-as-code turns that discipline into maintainable files aligned with schemas, objects, resources, or commands. Mirror the product If a method belongs to a class in a module, the docs should show the same relationship. Remove interpretation Facts…
5 minAsk the Double-Loop QuestionThe move: fix errors, but test frames. Single-loop learning improves action inside the current frame. Double-loop learning tests whether the frame itself needs to change. Reflective practice needs both. The skill is choosing the right depth for the problem. Use single-loop for contained errors When the cause is clear and the governing rule is sound, improve the step. Update the checklist, clarify the owner, repair the handoff, or change the timing. Use double-loop for recurring patterns When the same issue survives multiple fixes, inspect the assumptions: what must be true for our current approach to work? What are we avoiding…
5 minAssumption Check ReferenceWhat is the first assumption-check question? What am I treating as true right now, and what evidence actually supports it? This exposes the hidden rule before it drives your behavior. Single-loop or double-loop assumption check? If the pattern repeats, move from response improvement to frame testing. I already know why they said that. Your line Maybe. Before I act on that story, I will name one alternative explanation and one question that could test it. Certainty feels efficient when identity is threatened. The response slows defensive certainty and converts the story into a testable inquiry. ATE What does ATE stand…
4 minPick the Right Reflection DepthJordan needs a first move that creates enough distance to learn. Gibbs' cycle points to description and feelings before analysis and action.
5 minSeparate Facts From MeaningThe move: put a speed bump between event and interpretation. Gibbs' cycle helps because it makes reflection layered. A strong reflection does not say only what happened, and it does not skip straight to what you will do. It moves through six layers: description, feelings, evaluation, analysis, conclusion, and action. Description is the anchor Write only what a camera or transcript could capture. Who said what? What changed? What was the timing? Feeling is allowed, but labeled Your reaction matters because it shapes what you notice. Labeling it reduces the chance that it secretly drives the whole reflection. Analysis widens…
5 minSort Single-Loop and Double-Loop MovesSort each response by what it does to learning. Single-loop fixes the step. Double-loop tests the frame. Avoidance reduces discomfort without learning. Single-loop fix Double-loop inquiry Avoidance move Add a required close-date confidence field to the forecast form. Clarify who updates the risk log before the Thursday review. Send a reminder 24 hours before every release-readiness check. Ask whether our incentive system rewards optimistic forecasts over accurate forecasts. Test the assumption that stakeholders only want polished answers, not early uncertainty. Question whether the current goal is speed to decision or quality of decision. Tell the team to be more accountable…
4 minWhen the Fix Keeps FailingThe team has already tried several single-loop fixes. The next reflection should test the frame that makes those fixes seem sufficient.
5 minWrite Registry Metadata People Can TrustFindability without trust still creates duplicate work. Metadata As Due Diligence Feature stores promise reuse, but reuse requires a consumer to trust the feature. Registry metadata should answer three questions: what does this feature mean, when is it valid, and who stands behind it? Datasheets and model cards show the same principle for datasets and models: document intended use and limitations before downstream users infer them. The Small Set That Matters Start with purpose, definition, entity, event timestamp, freshness target, owner, example, consumers, limitations, and deprecation status. These fields cover the main reasons people avoid reuse: unclear meaning, unclear quality,…
5 minRescue a Mixed Install Pagecallout The page today One install page currently carries first-run steps, architecture rationale, failure recovery, and config tables. Every reader is forced through every mode. The method Separate the first-success path from adjacent needs Start by protecting the first run. Then pull out the material that serves different moments. Common shortcut Trim paragraphs but keep all four document jobs in one file. The install path becomes shorter and more trustworthy without losing supporting content. Protect the main user journey first, then relocate adjacent needs into the right document types. The install page gets shorter because the doc set gets smarter.…
5 minRespond When the Data Breaks Your HypothesisMei must respond to evidence that contradicts her preferred explanation. The team will watch whether she defends the old story or uses the tree to update.
5 minResponding with Balance: The PMI MethodThe PMI method (Plus-Minus-Interesting) is a structured way to respond to ideas, proposals, or suggestions with both appreciation and critical perspective. Rather than rejecting ideas outright or accepting them uncritically, PMI ensures you acknowledge genuine strengths (Plus), address real concerns (Minus), and explore creative possibilities (Interesting). This approach maintains psychological safety—people feel heard rather than shut down—while still applying rigorous thinking. When communicating feedback or responses to stakeholders, PMI shows you're thoughtful and open-minded. It's particularly useful in organizational contexts where you need to manage both innovation and risk, and where stakeholder buy-in depends on feeling that their ideas have…
11 minA3 Thinking for a One-Page Ops ProblemA3 is not a prettier incident report; it is a logic test. Start with current condition Use counts, times, locations, and frequency. The current condition answers what is happening now, where, how often, and with what customer or margin impact. Separate target from wish A target condition is specific enough to inspect: pickup late rate below 10 percent for Friday 3:00 to 7:00 p.m. is usable. Improve pickup is not. Make root cause earn the right to exist A cause is not root just because it sounds plausible. It should explain the pattern and connect to observed evidence. Countermeasure only…
5 minChoose the Countermeasure for Repeat StockoutsRepeat miss Size-medium black joggers are empty again. The system shows 14 on hand, but none are on the selling fixture. The team needs a cause that explains recurrence, not a reminder that sounds responsible. 5 Whys Symptom -> Cause chain -> Countermeasure Each why should explain the prior fact and move closer to a process condition the team can change. Reminder Tell apparel to check harder. The fix addresses the condition that made recurrence likely. Stop when the next countermeasure would change the process, not merely motivate the person. 01 Verify 02 Trace 03 Fix First move The shelf…
5 minRewrite a Bloated Tutorial for Momentumcallout A beginner tutorial is slowed by long concept detours between steps. Keep the learner moving and link out for depth. Writers often think “important” means “must appear right here.” In tutorials, important ideas still need the right timing. When theory shows up before the learner can use it, it competes with the next action instead of supporting it. Find interruption points Mark where the learner stops acting and starts reading long theory. These are momentum breaks. Keep only the confidence cue Retain the smallest sentence that helps the learner act safely. The cue preserves confidence without a detour. Link…
5 min