AI Blocks

Putting the blocks together

This is taking longer than expected.

Try againBrowse the library
AI Blocks · All skills by job · Minds · Mini tools · How it works · From a source · Apps

AI Blocks › Test and fix code

Test type fixer

Point it at your tests. Get unsafe type casts swapped for shoehorn so test data stays typed.

Test type fixer 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 · MIT licence · Made by Matt Pocock · Level: advanced · Thinking: low

Made by Matt Pocock. See the original on GitHub; we copied it as it is, with its licence.

What it does

Test files full of "as" casts hide type mistakes and force you to fake every field of a big object. This skill swaps those casts for the shoehorn library, so your tests pass only the data they care about and TypeScript still checks it. It installs the package, then works through the test files one pattern at a time. A large object with two needed fields becomes a partial. Data that is wrong on purpose, like a missing field you want to test, gets its own helper instead of a double cast. It touches test code only and never edits production files. Afterward it runs the type check to confirm nothing broke.

You give it

You get

Use it when

How to use it

  1. Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
  2. Ask for the job in your own words. Your AI opens the skill when it fits.
  3. It works best when your AI can run code and read your project files.

More for Test and fix code

Every test and fix code skill