AI Workflow · Module 3
The Specification Framework
"Every ambiguity in your prompt is a coin flip on quality."
Most developers think a detailed prompt takes longer to write. The data says the opposite: a 2-minute specification eliminates the 20-minute refinement loop that follows every vague request.
The paradox of prompting is that investing more upfront saves you far more time overall. When you give the AI every piece of information it needs to succeed, it succeeds. When you leave gaps, the AI fills them with its best guess — and its guesses are based on the most common patterns in training data, not your specific codebase, team conventions, or business requirements.
This article gives you the 5-part Specification Framework that eliminates ambiguity before the AI writes a single line.
The Precision Paradox: Why Vague Prompts Cost More Time
Compare these two prompts for the same task:
→ No mention of your existing User model
→ Inconsistent error handling format
→ Needs 5–10 refinement prompts
Total time: 35–50 minutes
→ Uses your existing User model
→ Handles all edge cases you specified
→ Ready to commit on first output
Total time: 4–6 minutes
The 5-Part Specification Architecture
Every gap you leave in a prompt is a place where the AI guesses. This framework closes every gap.
Full Example: From Vague to Specification
The task: Build a data table component.
Layer 1 — Vague (what most people write):
"Create a data table component."
Layer 2 — With technology:
"Create a data table component using React 18 and TypeScript with TanStack Table v8."
Layer 3 — Add performance constraint:
"...that handles 10,000+ rows without lag, using virtualization."
Layer 4 — Add style rules:
"...following our existing shadcn/ui patterns, no new UI dependencies."
Layer 5 — Full Specification (what actually produces great code):
CONTEXT:
- React 18, TypeScript 5, TanStack Table v8
- Existing project uses shadcn/ui — no new UI library dependencies
- State management via React Query — no Zustand or Redux
- Team convention: named exports only, no default exports
REQUIREMENTS:
- DataTable<T> generic component accepting any row type
- Accepts: columns (ColumnDef<T>[]), data (T[]), optional onRowClick
- Sortable columns (click header to sort, click again to reverse)
- Filterable via a search input above the table (client-side)
- Pagination: 10/25/50 rows per page selector + prev/next buttons
- Loading state: show skeleton rows (5 rows, 3 columns) when isLoading prop is true
- Empty state: show "No results found" message with optional empty action slot
CONSTRAINTS:
- Must handle 10,000+ rows with virtualization (use @tanstack/react-virtual)
- WCAG 2.1 AA compliance — table must be keyboard-navigable
- All copy must be in a strings prop (not hardcoded) for i18n
- Do NOT use any inline styles — CSS Modules only
- Column widths must be configurable per column definition
EXAMPLES:
- <DataTable columns={userColumns} data={users} onRowClick={(row) => navigate(`/users/${row.id}`)} />
- <DataTable columns={orderColumns} data={[]} isLoading={true} strings={{ empty: "No orders yet" }} />
SUCCESS CRITERIA:
- Sorts 10,000 rows in under 100ms
- Passes keyboard navigation test (Tab to search, Tab to headers, Enter to sort)
- Renders skeleton correctly when isLoading
- Empty state renders when data.length === 0 and isLoading is false
That specification took roughly 3 minutes to write. The result is a component that's ready to ship.
Constraint Layering for Complex Features
When a feature is large, don't write the full specification at once. Build it in layers across a conversation.
Each prompt has one clear scope. The AI keeps the context from previous turns. You remain in architectural control throughout — never handing over the entire feature in one shot.
Three Advanced Patterns
Once you've mastered the basic specification, add these to your toolkit:
Input: {raw: '2026-03-19T14:30:00Z'}
Output: {date: 'Mar 19', time: '2:30 PM'}
Handle null → {date: '—', time: '—'}"
The One-Sentence Test
Before sending any prompt, ask yourself: Could two different developers interpret this prompt differently and produce two different, incompatible outputs?
If yes — add more specification. If no — you're ready.
The developers who get extraordinary output from AI are not the ones with the best tools. They're the ones who learned that every vague word in a prompt is an open decision handed to the AI. The Specification Framework is how you keep those decisions where they belong — with you.
Next: The Confident Junior — How AI Fails and How to Catch It → — Understanding AI's failure modes before they make it into your codebase.