Toolshed Beta
Install Sign in Get started

Software Engineering

Write, review and ship code

free this week

For engineers. Pair programming, review, migration and the unglamorous work AI is genuinely good at.

One of this week's four free kits. The free set rotates, so add it to your account to keep it.

Prompts & skills 3 included

  • prompt

    Review for correctness, not style

    Finds the bug that fires on the third Tuesday, not the missing semicolon.

    Review this diff for correctness only. Anything a linter or formatter would catch — formatting, naming, import order, comment style — is out of scope. If your only findings are stylistic, report NO CORRECTNESS FINDINGS and stop.
    
    Hunt these classes, in this order.
    1. BOUNDARIES AND OFF-BY-ONE. Empty, one, two, maximum. Loop bounds, slice indices, inclusive against exclusive ranges, pagination offsets, anything doing length - 1 or <= on a size.
    2. NULL AND ABSENT. An optional dereferenced, a lookup assumed to hit, a default silently standing in for a real value, the distinction between absent, null, zero and empty string being lost.
    3. ERROR PATHS. An exception leaving state half-written. A caught error logged and swallowed. A failed call whose return value is ignored. Cleanup that cannot run because what it needed was already closed.
    4. CONCURRENCY. Shared mutable state, read-modify-write without atomicity, check-then-act, assumed ordering between callbacks, a lock held across I/O, a non-idempotent handler behind at-least-once delivery.
    5. RESOURCE LIFETIME. Connections, file handles, locks, subscriptions, timers, spawned tasks: who closes it, and does that still happen when the body throws.
    6. UNVALIDATED INPUT. Values crossing a trust boundary into a query, a path, a command, a redirect or a deserialiser. Size and depth limits on anything parsed.
    7. SILENT FAILURE. A wrong answer instead of an error: a truncating cast, a timezone-naive datetime, money in a float, an empty result read as a zero result, a broad except, a default branch that guesses.
    8. CONTRACT DRIFT. A changed signature whose other callers were not updated; a changed response shape, column type or default that something downstream still expects.
    
    For each finding: SEVERITY (wrong answer / data loss / crash / degradation), the input or sequence that triggers it, what happens, the line it comes from, and the smallest fix. If you cannot describe a concrete failure, it is not a finding — leave it out. No speculative "consider whether".
    
    End with UNVERIFIABLE: what you could not check because the diff does not show it — the caller, the schema, the config, the test. Do not guess at code I did not paste.
    
    Diff:
    {{diff}}
  • prompt

    Migration planner

    Turns a large refactor into ordered, individually shippable steps.

    Plan this migration as a sequence of independently shippable steps, running while the system stays live.
    
    Constraints every step must satisfy:
    - It leaves the system working and deployable on its own.
    - It needs no coordinated release of two components, and it survives old and new code running side by side during a rolling deploy.
    - It is reversible by a deploy or a flag flip — or you state plainly that it is not, why, and what makes it acceptable to proceed.
    
    Where data is moving, use this sequence explicitly and do not collapse it:
    1. EXPAND — add the new column, field or table, nullable, written by nobody, read by nobody.
    2. DUAL-WRITE — write both old and new; old stays the source of truth. State what happens when the new write fails: does the request fail, or is the discrepancy queued and reconciled?
    3. BACKFILL — migrate history in batches. Give the batch size, the throttle, how it resumes after a crash, and the query that counts rows not yet migrated.
    4. VERIFY — a comparison running against production that reports disagreement between old and new. Name the disagreement rate you will accept before cutting over.
    5. CUTOVER — reads move to the new path behind a flag, by percentage where possible. Old writes continue.
    6. CONTRACT — stop writing the old path, then after a stated wait, drop it. The wait is what keeps a rollback possible.
    
    For each step: what changes, who deploys it, how to verify it worked in production (the specific query, metric or log line, not "test it"), how to roll it back, and what becomes irreversible from that point. Flag the POINT OF NO RETURN where it falls, and what is lost if a problem appears after it.
    
    Then: which steps can run in parallel, which takes longest in wall-clock time, and any step needing a maintenance window — stated as a window, not buried in a bullet.
    
    If the current or target state is too vague to plan against — unstated row counts, unknown write rate, unclear consistency requirement — ask for those numbers first. A plan built on a guessed table size fails at the backfill.
    
    Current state: {{current}}
    Target state: {{target}}
  • guide

    Prompting for code that compiles

    Giving enough context without pasting the whole repository.

    Getting usable code out of a model depends almost entirely on context. Here is what to give, what to leave out, and how to stop a wrong answer looking like a right one.
    
    WHAT TO GIVE, IN ORDER OF VALUE
    1. THE SIGNATURES IT MUST FIT. Paste the actual types, interfaces and the function it will be called from. Paste, do not describe. A description is lossy compression the model has to decompress by guessing: "a user object with the usual fields" yields plausible field names, and plausible field names do not compile. Twenty lines of real type definitions beat two pages of prose.
    2. ONE REAL EXAMPLE of nearby code doing something similar — a sibling handler, an adjacent test. This is how conventions get matched instead of invented: error handling, logging, how dependencies arrive, whether you go through a repository or touch the ORM directly.
    3. THE VERSIONS. Language, framework and library majors, plus the lockfile line for anything with breaking changes. Most broken output is correct code for a different version.
    4. WHAT IT MUST NOT DO. No new dependencies. No schema change. Nothing blocking the event loop. Do not touch that file. These constraints are invisible in the code, so they have to be said.
    5. THE FAILING TEST, if there is one. A test is an unambiguous specification and a termination condition in one.
    
    WHAT TO LEAVE OUT
    Do not paste the whole repository. Irrelevant context reliably degrades output: the model matches the wrong pattern, revives a deprecated helper, or edits a file you did not mean. Paste the file being changed, its direct collaborators and the types. If you are pasting a directory, you have not yet decided what the change is.
    
    MAKE THE FAILURE LOUD
    The dangerous output is code that runs and is quietly wrong, so ask for a shape that cannot fail quietly.
    - "If a required value is missing, raise; do not substitute a default." The invented fallback is the most common silent bug in generated code.
    - Ban the broad catch by name: "do not wrap this in a try/except that logs and continues".
    - Require the unhappy paths as real branches, and ask which inputs the code will reject.
    - Ask for the assertions rather than a summary. A test you can run beats a paragraph claiming it works.
    - Ask it to list what it assumed about code you did not paste. That list is your review checklist, and it is where the compile errors will be.
    
    THE LOOP THAT WORKS
    Give context, state the constraints, run it, paste the real error back verbatim — the trace carries the line, the type and the version, and your paraphrase carries none of them. One error at a time: a batch of five produces a rewrite instead of a fix.
    
    A LAST CHECK
    Read generated code for what it did not do: the validation it skipped, the error it swallowed, the edge case it assumed away. Models write the happy path well and the margins badly, and the margins are where the incidents come from.

Tools in this kit

The tool list is always free to read — and so are these prompts, this week.