Ever stare at a blank page, asking an AI for "a blog post about X," only to get a generic, soulless draft back? The issue isn't the AI, it's the context. This applies to coding as well.
To get a great first draft, you can't just send a request; you have to send a complete brief.
For a recent technical post about HTMX, I decided to treat Gemini like a true creative partner. Instead of a simple prompt, I uploaded a "context bomb": four screen recordings showing the functionality, the raw Python helper script I used, a voice transcription of my thoughts and goals, and even a PDF copy of The Guide To Going Viral to act as a style and tone guide (book as context idea came from to Hamel Husain). The goal is to give Gemini the full picture:
Visuals
Logic
Intent
Desired voice
By providing rich, multi-modal context, Gemini can move beyond just assembling facts in a way you don’t like. It sees the flow from the screen recordings, understands the logic from the code, and grasps the narrative goal from your voice. The result? A nuanced first draft that requires much fewer edits before shipping. It still needs edits, but it gets the right shape.
The same is true of coding agents. To get the best results for coding, the agent needs to understand:
Intent: The "why" behind the code. What business problem does this solve? Who is the end-user? What are the acceptance criteria?
Logic: The specific "how." This includes as much detail as you can provide on the interactions with other parts of the codebase and your specific ideas for how to solve the business problem
Style: The established conventions of the project. This covers everything from formatting and naming conventions to architectural patterns and the specific libraries or frameworks to use.
All of that must be available to get the best results, and figuring out how to provide that to you agent in a specification or configuration file requires some thought and structure, it’s one key component in our course on AI Assisted Coding
A bad prompt may be:
This project is a web app for expense tracking. It is to help florist track expenses.
In our course, one of the techniques we teach is spec driven development which assists in creating much better prompts (or `agent.md` file) to include much more detail, and can be created with the help of a model. Ask it to create a comprehensive plan based on your voice transcribed thoughts, then edit that. Here’s a better example:
# **BloomExpense Project Specification**
## **Project Overview**
This project implements BloomExpense, the ultimate expense-tracking web app for independent florists in the midlands.
BloomExpense focuses on intuitive UI that guides florists as they file their expenses with clear explanations and instant save, to ensure that they can't miss crucial fields or lose information.
BloomExpense is designed for busy florists who often need to track expenses in short sessions in between serving their customers. It works on both desktop web browsers and on mobile browsers and is optimised for switching between devices with perfect continuity.
## **Business Intent**
**Target Users**: Independent florists running small businesses (1-5 employees) who currently track expenses in Excel spreadsheets. They have limited accounting knowledge but need proper expense tracking for VAT returns and tax compliance. They're comfortable with basic technology but need guidance on accounting principles.
**Core Problem**: Florists lose receipts, miscategorize expenses for VAT, and struggle with Excel formulas. They need to quickly capture expenses between serving customers, often on mobile devices while purchasing supplies. Year-end accounting becomes a scramble to organize scattered records.
## **Key Features**
**Educational Expense Entry**: Each expense field includes contextual help explaining VAT implications, what qualifies as business expenses, and common examples from the floristry industry.
**Instant Save with Visual Feedback**: Every field change triggers an automatic save after 500ms
**Mobile-First Responsive Design**: Optimized for quick entry on phones while buying supplies, with mobile-specific features like receipt photo capture. Desktop view adds enhanced reporting and bulk entry capabilities.
## **Technical Implementation**
**Tech Stack**:
* Air framework for Python web development
* DaisyUI component library UI
* PostgreSQL with strongly-typed data models
* Primarily Functional programming approach with PEP8 compliance
**Core Design Principles**:
* Type hints throughout for maintainability
* Comprehensive inline documentation
This seems like spam, I'm not sure why I got an email for it.