Mutative Mutative Principles A product handbook
Contents Keep the solution small
Chapter 02 Read Markdown

Keep the solution small

Make the code easy for the next teammate to understand and change. Prefer clear names, explicit data and direct control flow. Put a decision in one place when several callers need to agree on it.

For example, an interface and a server can share the rule for editing a draft. The actor here comes from an authenticated session with current workspace membership, not from the request body:

js
function canEditDraft(actor, draft) {
  return actor.workspaceId === draft.workspaceId
    && draft.status === "draft"
    && (actor.id === draft.createdBy || actor.role === "owner");
}

The interface uses this decision to explain which actions are available. The server must enforce it too. Sharing a rule reduces disagreement; hiding a button does not prevent a request.

Understand what you ship

Be able to explain a shipped system at a whiteboard without reading its code: how data moves, why this design was chosen over the alternatives, what must remain true, what a malicious actor could do, and where it fails. Explain the important data structures and tradeoffs in terms another teammate can follow.

Using an agent does not transfer responsibility for understanding the result. Tests support that understanding; passing them does not replace it. Disposable experiments can prioritize learning quickly. Before their code becomes part of a shipped product, understand and verify it to the same standard.

Explain the work clearly

Apply the same whiteboard rule to communication. A human or agent reading a pull request, issue, review or handoff should be able to explain the problem, the decision and its consequences without reconstructing a chat or reading every changed file. Write for a capable teammate who has not followed the work. Give them enough understanding to question the decision and take over.

Lead with what matters to that reader. Use concrete actors, actions and results: “Turning digests off fails after the time is cleared” says more than “Fix preferences edge case.” Show a small before-and-after example when it makes the change easier to understand. Then explain the mechanism and why the chosen approach fits. A list of files or implementation terms is not an explanation.

Use familiar words and define a necessary technical term when it first appears. Keep the real constraint, even when it takes another sentence to explain it. Short writing that omits the reason is not simpler. Remove repetition, vague claims and the history of your attempts. Keep an alternative or failed attempt when it explains a meaningful tradeoff or prevents someone repeating a mistake.

Distinguish observation, explanation and uncertainty. A failed request is observed; its suspected cause may still need testing. State what the evidence establishes and what it leaves open. Link the relevant code, reproduction or measurement next to the claim, while keeping the main explanation understandable on its own. Never invent verification to make a description look complete.

Before sending, try explaining it aloud: what happens, why, and how do we know? Could the reader predict a related case from the explanation? If they can only repeat the conclusion, explain the missing cause or constraint. Communication should leave the next person better able to reason about the system.

Write PRs and issues for the next reader

A pull request describes the final change. Give it a title that names the problem solved or behavior introduced. Explain the trigger and previous result, the new behavior, and the reason for any non-obvious choice. Include the checks that support the claim and material limits: untested integrations, compatibility changes or rollout steps when relevant. Rewrite the description if the change's scope changes. The reviewer should not have to infer the final design from outdated comments.

Make the description easy to scan as well as understand. Use a short opening for the main point, descriptive headings to separate the problem, decisions and evidence, and bullets for distinct changes or checks. Number reproduction steps when order matters. Keep the reason with the change it explains; a bullet should carry a useful thought, not just a filename. Let readers find the part they need quickly, then understand it without piecing together fragments. A PR or issue usually needs a compact explanation, not a chapter; scale the structure to the change rather than filling every possible section.

A bug issue describes the failure before prescribing a fix. Include the smallest reproduction, relevant environment or version, expected and observed behavior, and the consequence for the person affected. Label a suspected cause as a hypothesis. For a feature issue, explain who needs what outcome, the constraints that change the solution, and what observable result would satisfy it. Make open decisions explicit; do not present a proposed implementation as an agreed need.

This illustrative issue and PR describe the same problem. They are examples of communication, not reports of a shipped change.

Issue: Turning digests off fails after clearing the delivery time

Reproduce in the local settings demo

  1. Open Digest settings and clear Delivery time.
  2. Select Off, then save.

Expected and observed

  • Expected: Off saves successfully; a delivery time is not needed to stop emails.
  • Observed: the server rejects the save (HTTP 400), leaving the schedule enabled. The time field is now hidden, so the person cannot see what needs correction.

Evidence

The request contains an empty hour. That may explain the rejection, but the server's requirements need checking.

PR: Allow digests to be turned off with an incomplete time draft

Why the save failed

Clearing Delivery time and then selecting Off sent an empty hour. The server requires a complete, valid schedule even when disabled, so it rejected the save.

What changes

  • Send the last saved time for inactive fields. Omitting it would also be rejected.
  • Preserve the unsaved draft so switching back before saving does not lose it.

Verification

  • Against the local test server, clear time → Off → Save succeeds and survives reload.
  • Active time validation and Cancel still work.
  • Sending real emails was not tested.

Review comments should name the location, the condition that causes a problem, and its consequence. Explain the reason behind a suggested change. Distinguish a correctness defect from a preference; ask for missing context when the answer could change your judgment. “Keep the button mounted so a failed save does not discard keyboard focus” teaches more than “Don't rerender this.”

In progress updates and handoffs, state the current result, the evidence, and what remains. Name a blocker and the decision or input needed to resolve it. Leave a concrete next action and enough context to resume without replaying the session. Scale the detail to the work: a small fix may need two paragraphs and a check. Use headings, steps or a diagram when they make the explanation easier to follow; no universal template or long report is required.

Earn each extra part

Use the product’s existing components, tests and libraries when they fit. Add an abstraction when it removes a real source of complexity. A wrapper that hides a single obvious call may make the code harder to follow.

Keep responsibilities focused. Remove dead code and obsolete paths as part of the change that replaces them. Explain intent or a surprising constraint in a comment when the code cannot express it clearly. Avoid comments that merely repeat the next line. Keep hand-maintained source normally formatted and readable; compression belongs in the build output, not the code someone must edit.

The same restraint applies to this handbook, skills and process. Repeated work may deserve a tool. An isolated task may need only a direct check. A new folder, skill or document should make future work easier, not give the current task an appearance of rigor.

Keep contracts intelligible

Give each piece an explicit owner for state, validation and side effects. Represent states so contradictory combinations are difficult to create. Keep stable identifiers separate from display labels; use one domain term for the same thing in the interface, API and documentation.

Treat amounts, units, timestamps and identifiers according to their meaning. Do not put exact decimal amounts through floating-point arithmetic merely to format them. Specify time zones where a deadline depends on them. Distinguish zero, missing, unknown and failed to load; none is a substitute for another.

Use established parsers and platform behavior when they fit. If implementing a format yourself, account for its grammar and limits, not just the first example. Define aggregates with their population and unit: “total” might mean imported rows, matching results or the whole collection. Include an example that settles the meaning. Make public errors and compatibility promises deliberate. A caller should not need knowledge of storage exceptions to recover.

Measure what people wait for

Treat latency and resource use as part of the experience. Measure the paths a change could make slower, using conditions that resemble actual use. Record the dataset, environment and whether the run was cold or warm so the comparison means something.

Remove unnecessary work before adding machinery to make it faster. Fetching, polling or rendering unused data still has a cost. When a tradeoff is worth that cost, explain it with evidence.

Bound work as well as measuring it: payload size, result count, concurrency, retries and retained data need limits appropriate to the task. Cancel or ignore obsolete reads. Avoid polling merely to make a screen look alive; decide how fresh the data must be and refresh accordingly. A slow response must not replace a newer selection or take focus away from the person using the product. Every path updating the same state must obey the same ordering rules: refresh, retry and background reads cannot each invent their own freshness check. Exercise out-of-order responses across those paths, including after a successful write.

Mutative · Principles