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 › Build and ship software

Safe shutdown code writer

Point it at your server or worker. Get code that finishes live work and exits cleanly when stopped.

Safe shutdown code writer is a free AI skill for the job "Build and ship software". 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: advanced

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

What it does

Code that lets your server or worker stop without dropping live requests or losing half-done jobs. Point it at your service and get a shutdown routine for when it receives a stop signal. The pattern runs in order. Catch the stop signals early and set a flag, ignoring repeats. Stop taking new connections or queue jobs right away. Let current work finish within a time limit. Close database connections and other resources. Then exit with the right code. It also adds health check endpoints so a load balancer stops sending traffic first, and notes for Kubernetes and Docker, which send the signal before they kill. Examples are given in TypeScript, and the same steps apply to other languages.

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 read and edit your project files.

More for Build and ship software

Every build and ship software skill