/testitWrites tests for the code in context — including the edge cases the original author forgot.
Category: Coding & Technical
Before / After
Write tests for this function.
/testit [paste function]
What changes in Claude's response
Beyond happy-path tests, /testit explicitly tests: empty input, null input, max-size input, off-by-one boundaries, concurrent access if relevant, and the 'this should error' cases. It also names tests descriptively — `should_return_empty_array_when_input_is_null` instead of `test1`. You can read the test file and understand what the function does without reading the function.
When NOT to use /testit
Don't /testit code you're about to refactor. You'll write tests against the wrong shape and have to redo them.
Codes that stack with /testit
/testit is one of 120 tested prompt prefixes. The full cheat sheet has before/after examples, warnings, combos, and 10 workflow playbooks.
See the full cheat sheet — from $5More Coding & Technical codes
/debugFinds the bug and tells you exactly where it is, not what bugs look like in general.
REFACTORCleans up messy code without changing what it does. Tells you what changed and why.
/shipitAdds the production-readiness layer Claude usually skips: error handling, edge cases, types, logging.
ARCHITECTDesigns system structure before any code is written. Forces decisions, doesn't just list options.
/convertRewrites code in another language idiomatically — not transliterated.