Published
I've been deep in vibecoding recently, but I came across a number of prompts to improve things
Correctness
Implicit state machines
good prompt "find all of the implicit state machines in my app"
This one is particularly useful for code that builds UI.
Unstable object references
Good prompt: "Find every object in this codebase that's referenced without a stable, canonical ID."
Invariants
Steve's is so good.
Here's another "find every invariant my app relies on but doesn't explicitly enforce"
Performance
today's prompt requires crowd involvement so people understand how useful it is. do it and then post before/after tables or graphs.
create a load testing script/suite/etc for the database schema. the goal is to run a bunch of queries using various dimensions (scale all data relationships by 10x, 100x, 1000x) so we can see which queries will fail at scale. use real queries and real relationships. profile the before, fix, profile the after, be statistically significant, and show me a visualization of the output
some things I often say to claude when doing perf optimization work:
how do we rewrite this to better leverage data-oriented design principles
can you replace those hash tables with a flat array? can we make the pointers an index into the array? can we pack the most commonly used data into upper bits of the index?
caching is cope for a slow design. do not add caches and delete all existing caches. instead, redesign it to be faster
should this be a structure of arrays instead of an array of structures?
use this prompt on your favorite codebase where you don't hate your users:
do a deep scan of all hot paths and fix any unnecessary sequential async functions calls
the diffs are very easy to review and almost always find some bangers