Your First Spec in 10 Minutes
The best way to learn Intent Engineering is to do it. You don't need Pathmode for this—just a text editor and an AI coding agent (Cursor, Windsurf, or GitHub Copilot Workspace).
The Goal: We're going to specify a simple feature: A "Copy to Clipboard" button.
The One-Liner (1 Minute)
Start with the naive request. Write this at the top of a new file called spec.md.
Goal: Add a copy button to the code snippets on the blog.If you stopped here, the agent would guess the icon, the position, and the feedback behavior. It might even include a third-party library you don't want.
Define Behavior (3 Minutes)
Add acceptance criteria. Don't write prose; write a checklist of true/false statements.
## Behavior
- [ ] Button appears in the top-right corner of every `pre` code block
- [ ] Icon is `Clipboard` from Heroicons (matching our system)
- [ ] Default state: "Copy" (or icon)
- [ ] Active state: detailed feedback required
- On click: Write content to clipboard
- Change icon to `Check`
- Change text to "Copied!"
- Revert to default state after 2000msNow the animation timing and states are rigorous. The agent doesn't have to be creative; it just has to be obedient.
Inject Context (3 Minutes)
Tell the agent where it is working.
## Context
- File: `components/CodeBlock.tsx` (create if doesn't exist)
- Tech Stack: React, Tailwind CSS, Lucide React (for icons)
- Constraints:
- No new dependencies (use `navigator.clipboard`)
- Must be accessible (add `aria-label`)This prevents the classic "I installed a 50kb library to do a 3-line function" problem.
The Build (3 Minutes)
Now, the magic trick.
- Open your AI code editor.
- Open your
spec.mdfile. - Type: "Implement this spec."
Watch what happens.
Because you defined the states (default/active), the timing (2000ms), and the tools (navigator.clipboard), the agent will write near-perfect code on the first try.
The Comparison
Without Spec:
- You ask: "Add copy button."
- Agent builds it.
- You review: "Oh, it doesn't show feedback."
- Agent fixes.
- You review: "Wait, use the check icon."
- Agent fixes.
- Total time: 15 mins of back-and-forth.
With Spec:
- You write spec (7 mins).
- Agent builds perfect version (1 min).
- Total time: 8 mins.
That's the leverage. Intent Engineering shifts the effort left—from debugging code to defining behavior.