← All notes

Patch with a prompt

If you're patching an external library, make the patch a prompt. That way you can automatically patch new versions of the library. Normally you can't upgrade a library once you've patched it.

My use case is getting Next.js to export dynamic routes statically, which saves me money on Vercel. The feature is moderately simple with AI, but I also want to be able to upgrade Next for security updates. This way I get the best of both worlds.