Code correctness planner
Give it a tricky function. It writes the rules and edge cases first, then code that keeps them.
Code correctness planner is a free AI skill for the job "Test and fix code". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · CC BY 4.0 licence · Made by sickn33 · Level: expert · Thinking: high
Made by sickn33. See the original on GitHub; we copied it as it is, with its licence.
What it does
A tricky function gets its rules written down before any code, so off-by-one and empty-input bugs get caught early. Tests alone often miss these, because the bug lives in the contract, not the loop body. Before writing a loop or a recursive call, it states the invariant (what stays true on each pass), the base case, why the loop must end, and the awkward inputs: empty, duplicates, boundaries, overflow. Only then does it write the code, and it checks the code keeps each rule it stated. The firm rule is no loop or recursion without a written invariant and a reason it stops.
You give it
- The function you want written or reviewed
- The chosen algorithm (optional)
- Known awkward inputs (optional)
- Codebase (optional)
You get
- Written invariants
- A base case and stop argument
- An edge case list
- Code that matches those rules
Use it when
- You are writing binary search, partition or in-place dedup.
- A function passes tests but you do not trust it.
- You keep hitting off-by-one errors with duplicates or empty lists.
- You think "I know this algorithm" and want a second check.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.