Skip to content
All writing

Use AI as a hammer for throwaway scripts

Most small coding problems need one script, not a full project. For a one-off task, AI writes the script and the KISS principle says to skip the framework.

Building a house when you need a hammer

A simple problem is a nail. In code, it might be a data reformatting task, a one-off calculation, or pulling one value from a web page. The straightforward answer is a hammer: write a small script, run it, and move on.

What I see more and more, in experienced developers and newcomers alike, is a plan to build a whole house. A quick script turns into a large React project or a multi-file FastAPI server, with directory structures, virtual environments and deployment pipelines. That is like buying land, drawing blueprints and hiring contractors to hang one picture.

This is not a critique of solid software engineering. That work has its place. It is a call to notice when we overcomplicate things, especially when the goal is a quick fix for an immediate problem.

Why KISS matters more with AI

The "Keep It Simple, Stupid" (KISS) principle has guided design and engineering for decades. AI can build very complex systems, and it is also a good tool for following KISS.

Simple solutions suit quick fixes for four reasons.

  • Simple solutions are faster to create, test and deploy.
  • They are easier to understand, for you and for anyone else, including your future self.
  • They need less setup, fewer dependencies and less mental load.
  • They keep your attention on the problem, not on framework details.

When a small, well-defined problem needs a quick answer that you may use only once or a few times, follow KISS.

AI as the hammer for simple scripts

This is where AI, in my case Google Gemini, is useful in a way people often miss. We often discuss AI building complex applications, and it does that well, as my other posts show. Its value as a hammer for simple tasks is just as large.

You might need a Python script that reads a CSV, filters some rows and writes a new CSV. You might need one HTML page with a little JavaScript for a calculation based on user input. Instead of coding either by hand or setting up a project, you can prompt an AI: "Write a single Python script that does X, Y, and Z."

In my AI-first workflow, the AI is the main coder for these small tasks. My job is to define the problem precisely. The AI follows a short system instruction: "You are a concise script generator. Prioritize single-file solutions using only vanilla technologies unless a specific library is essential for a simple core function." It then delivers the script, which is often right on the first try or needs minor tweaks.

The overengineering trap

The urge to overengineer is strong. We are taught to build for scale, maintenance and change. Those are good goals, but they are not always the most important goals for every task.

For a throwaway script that solves a one-off problem, do you need a carefully abstracted set of classes, a full test suite and a CI/CD pipeline? Probably not. Setting up that infrastructure is often far slower than the time the script saves, because the script has a short life or a narrow scope.

AI helps you avoid this trap for the right problems. It gets you to a working "good enough" solution, and good enough is what the job needs.

Examples of quick fixes

  • To clean up data, ask for "Generate a Python script to parse this log file format and extract all IP addresses."
  • To call a weather API, ask for "Write an HTML/JS page that takes a city name, calls this weather API, and displays the current temperature."
  • To count words, ask for "Create a Python script to read all .txt files in a folder, count word frequencies, and output the top 10."
  • To rename files, ask for "I need a script to rename files in a directory from 'IMG_1234.JPG' to 'Vacation_2025_001.jpg', sequentially."
  • To start a site, ask for "Give me a basic HTML/CSS/JS structure for a single-page portfolio with a header, gallery section, and footer." Then customize it.

These tasks do not need a large framework. A single, well-commented script from AI can be enough.

My AI-first method

When I use this approach with my AI collaborator, I follow five steps.

  1. Define the problem clearly. My prompt names the inputs, the processing and the expected output. Ambiguity is the enemy.
  2. Set up the AI with a short system instruction. I often start with this one: "You are an expert at creating concise, single-file scripts. Prefer vanilla Python/JavaScript. Only suggest external libraries if they are absolutely essential and simplify the core task significantly. Provide the complete script."
  3. The AI generates the script.
  4. Run the script with sample data. If it is not quite right, give specific feedback.
  5. Refine the script. For example: "That was close, but can you modify the script to handle cases where the input file is empty?" Or: "Please add error handling for API call failures." Keep each iteration focused on the simple core task.
AI First Hammer Approach

The goal is not a complex, evolving piece of software. The goal is a working tool for the job at hand, built quickly.

When to use the AI hammer

This approach is not for every project. It works best when:

  • The problem is well defined and small, and it needs a quick fix.
  • The solution will be used once, a few times, or for one narrow purpose. It is a "throwaway app".
  • Formal engineering practice, such as extensive testing, complex design patterns or a full framework setup, is overkill and would slow you down.
  • You want to skip the ceremony of a "proper" project for a simple task.
  • Someone with limited coding experience needs a problem solved. They can describe it to the AI.

The next time you face a simple nail, ask whether you need a blueprint or the AI hammer.