Build Anything with AI — Part 1: The Workflow
Welcome to Part 1 of a 6-part build-along series.
You're reading this on a site I shipped over a handful of evenings, with maybe 20% of the code typed by my own fingers. The other 80% came from AI — Claude and Gemini doing the heavy lifting, me steering and stitching.
By the end of this series you'll have built six small AI projects, each one practical, each one shippable, each one a step harder than the last. Today's job is the first one: a command-line tool that reads any text file and prints a 3-bullet AI summary.
If you can write a for loop and remember what git push does, you're qualified.
A short tour of this site
Every piece of this portfolio is also a future post in this series:
- The chat at the bottom of the home page. Wired to Google Gemini's free tier. Ask it about my projects, my work, where I went to school. (We'll build this in Part 2.)
- The Projects page is a 3D page-flipping book —
rotateYCSS transforms with Framer Motion. (Part 3.) - The Certificate of Awesomeness at the bottom of
/certifications. Nobody asked me to put it there; that's the point of a personal site. - This MDX blog, which auto-deploys when I push to GitHub. (Part 4.)
Stack: Next.js 16, TypeScript, Tailwind CSS v4, Framer Motion, Gemini 2.5 Flash, Vercel. Repo on GitHub. Every push to main triggers a production deploy in ~90 seconds.
I'm laying out the scope so you know we're not doing Hello World. Now — how it actually got built.
The shift that changes everything
If you've used ChatGPT, Claude, or Gemini before, you've probably used them like a search engine — ask a question, get an answer, copy what's useful.
That's not how you build with AI.
When you're building, the AI is a teammate. You bring intent and judgment. The AI brings keystrokes and scaffolding. The work is a conversation, not a query.
When I wanted the projects book to flip in 3D, I didn't ask "how do I make a book flip?" I said:
"I want a single-page book where each page shows one project. Tapping the right edge flips to the next project. Use Framer Motion's
rotateYwithAnimatePresenceso old pages exit and new ones enter. Aspect ratio 5:7. Should fit phone screens. Add a small drop-cap on the long description."
The AI wrote 200 lines of TypeScript that mostly worked. Two passes of "the bookmark is hiding the year" and "the page is too tall on laptops" got it where I wanted. Maybe ten minutes total.
The lesson: be specific about intent, vague about implementation. Tell the AI what you want, not how to write it.
The five-step loop
This is the workflow you'll use for every task in this series:
- Write a one-line goal. Not "build me a portfolio." Try: "I want a contact form that emails me when someone submits."
- Add the context. "Next.js 16 App Router with TypeScript. Server action, not a client-side fetch. Use Resend for the email."
- Read the output. Don't just paste it. Did it import a package you don't have? An API that doesn't exist (yes, this happens)? If you can't follow the code, ask the AI to explain it. Force it to teach you.
- Run it. Paste the error back. When something breaks, paste the exact error message into the chat. AI is much better at fixing real errors than guessing.
- Refactor only after it works. "This works but feels long. Can we simplify?" — fine second-pass prompt. Don't ask for elegance until you have correctness.
Three traps
The AI invents APIs. It will confidently write import { thing } from "package" where thing doesn't exist. Always run the code. Always check the docs.
The AI is six months out of date. Defaults to old patterns. Tell it your version number in the prompt. Better — point it at the actual docs if your tool can.
Pretty code, broken behaviour. AI optimises for "looks like a senior engineer wrote it." That doesn't mean it works. Run it. Click the buttons. Test the edges.
Today's build: an AI summariser in 60 lines of Python
Difficulty: Medium. Plan for 60–90 minutes if you've never used an AI API.
What you'll have at the end: a command-line tool you run as python summarise.py article.txt and get back three bullet points.
What you'll need: a computer, an internet connection, and ~$0 — Gemini's free tier covers everything.
Follow exactly. If something doesn't work, paste the error into Gemini, Claude, or ChatGPT before asking anyone else.
Step 1 — Get a free Gemini API key (5 min)
- Go to https://aistudio.google.com/apikey in your browser.
- Sign in with a Google account.
- Click "+ Create API key" (top right). If asked, choose "Create API key in new project."
- Copy the key — it starts with
AIza.... Treat it like a password. Don't paste it in screenshots, don't commit it to GitHub. Anyone who has it can spend your free quota.
Step 2 — Make sure Python is installed (5 min)
Open a terminal:
- Windows:
Win+R, typepowershell, hit Enter. - Mac:
Cmd+Space, type "Terminal", hit Enter. - Linux: you know.
Type:
python --versionIf you see Python 3.10.x or higher, you're set. If you get "command not found":
- Windows: download from https://python.org/downloads. During install, tick "Add Python to PATH" — that's the box people miss.
- Mac:
brew install python(install Homebrew first from https://brew.sh if you haven't). - Re-open your terminal after installing.
Step 3 — Make a project folder (2 min)
mkdir ai-summariser
cd ai-summariserStep 4 — Install the libraries (3 min)
Two packages: the Gemini SDK, and a helper for env vars.
pip install google-genai python-dotenvIf pip says "command not found", try pip3 instead. Same outcome.
Step 5 — Save your API key safely (3 min)
In the project folder, create a file called .env (yes, the dot is part of the filename). Inside, put one line:
GOOGLE_API_KEY=AIza...paste-your-actual-key-here
No quotes, no spaces around the =. This file should never be committed to GitHub. If you're using git, also create a .gitignore with one line: .env.
Step 6 — Write the script (20 min)
Create a file called summarise.py in the same folder. Paste this:
import os
import sys
from dotenv import load_dotenv
from google import genai
load_dotenv()
if len(sys.argv) < 2:
print("Usage: python summarise.py <path-to-text-file>")
sys.exit(1)
filepath = sys.argv[1]
with open(filepath, "r", encoding="utf-8") as f:
text = f.read()
client = genai.Client(api_key=os.environ["GOOGLE_API_KEY"])
response = client.models.generate_content(
model="gemini-2.5-flash",
contents=(
"Summarise the following text in exactly 3 bullet points, "
"each one sentence long. Output only the bullets — no preamble.\n\n"
f"{text}"
),
)
print(response.text)Read every line. What does each one do? If a line is a mystery, ask Gemini chat: "in this Python script, what does sys.argv mean?" Force it to teach you. The whole point of the loop is that you understand what you're shipping.
Step 7 — Test it (10 min)
Get something to summarise. Easiest: a Wikipedia article.
curl -s https://en.wikipedia.org/wiki/Coffee | head -c 5000 > sample.txt(On Windows PowerShell, use Invoke-WebRequest instead — your AI knows the syntax, ask it.)
Now run:
python summarise.py sample.txtYou should see three bullet points about coffee.
If not, don't move on until you've fixed it. Paste the exact error message into Gemini chat with: "I'm building a Python summariser. Here's the error. What does it mean and how do I fix it?" That's the entire debugging skill in one move.
Stretch goals (when it works)
Pick one:
- Add a
--styleflag: technical / casual / for-a-five-year-old. - Make it work on a URL instead of a file (use
requeststo fetch the page). - Save the output to a
summary-<date>.txtfile alongside the input. - Wrap it in a Streamlit UI:
pip install streamlit, write a 20-lineapp.py, runstreamlit run app.py— and you have a real web tool.
Each is a perfect "small task" to practise the 5-step loop on.
When you finish
Send me a screenshot of your terminal showing the summary you generated, plus the article you summarised. My email's in the sidebar.
The series ahead
Six posts. Each builds on the last. Each ends with a task you actually ship.
| # | Title | What you'll build |
|---|---|---|
| 1 | The Workflow (you are here) | A CLI text summariser |
| 2 | Make It a Chat | An interactive AI chatbot with memory |
| 3 | Make It Visual | A 3D flip-card component for the web |
| 4 | Make It Live | Deploy your project to a real URL — for free |
| 5 | Give It Tools | An AI that calls APIs and takes actions |
| 6 | Make It Trustworthy | Evaluating your AI app — does it actually work? |
By Part 6 you'll have shipped six things. None of them are toys. All of them you can fork, build on, or use as templates for whatever you do next.
See you in Part 2.