What is Vibe Coding?
- Published on
- Authors
- Name
- Spaghetti Code Jungle
- @spagcodejungle

What Is Vibe Coding? (And When to Use It)
You’ve seen it on dev Twitter or in Discord: vibe coding.
It’s not a framework. It’s a mode—the creative, exploratory, slightly feral cousin of disciplined engineering.
Definition (No Buzzword Bingo)
Vibe coding is intentionally entering a flow state to discover the shape of a solution.
You code from intuition first, then bring structure in after the spark catches.
Not: cowboy hacking forever.
Yes: prototyping with taste, then cleaning it up.
Why It Works
- Momentum beats perfection. Empty files don’t ship; prototypes do.
- Tacit knowledge shows up. You know more than your tickets capture.
- Nonlinear discovery. Unexpected patterns reveal themselves only once you touch the code.
When to Use It
- 🧪 Prototyping a new idea (unknown unknowns)
- 🎨 Creative coding (indie games, generative art, demos)
- 🧭 Tech spikes (sketch the integration before you spec it)
- 🧠 Unsticking your brain (context switching back into a codebase)
When Not to Use It
- 🔒 Safety-critical or compliance-bound code
- 📉 High-blast-radius changes in mature systems
- 🧾 Audited paths where traceability is required
The Vibe Loop (A Mini-Framework)
- Set the scene (5 min).
Music on, distractions off, narrow the sandbox: one repo, one branch, one goal. - Constrain the palette (3 choices).
Pick a stack, a data shape, and a UI/CLI shape. No bikeshedding. - Jam (25–50 min).
Code the happy path end-to-end—no tests yet, little polish. - Name the insight (2–3 bullets).
Write findings in aNOTES.mdor commit message. - Shape (25–50 min).
Extract functions, add types, introduce tests around the stabilized shape. - Decide to keep or toss.
If the spike is promising, ticket the follow-ups. If not, archive and move on.
Tip: Use branch prefixes like
spike/orvibe/so everyone knows the intent.
Guardrails That Keep It Honest
- Timer > tunnel vision. Timebox the jam and the shape pass.
- Thin slice > wide swamp. Walk one vertical path; skip edge cases initially.
- Snapshots > novels. Keep short commits; write down insights while they’re fresh.
- Exit ramp > eternal fiddle. Define “good enough to evaluate” before you start.
Anti-Patterns (Don’t Do These)
- “We’ll harden it later” (but later never comes)
- Unowned spikes lingering in
main - Vibes as an excuse to dodge reviews or tests
- The infinite “just one more tweak” spiral
Vibe Coding vs. Other Modes
| Mode | Goal | When to Choose It |
|---|---|---|
| Vibe | Discover the shape | Prototypes, spikes, creative bursts |
| TDD | Specify the shape | Stable domains, regressions, refactors |
| Design Doc | Align on the shape | Multi-team work, high risk, long tail |
| Hackathon | Ship spectacle fast | Time-boxed demos, community energy |
They’re complements, not rivals. Great teams swap modes deliberately.
A Tiny Example (From Vibe to Shape)
// vibe: naive event stream deduping by key + minute bucket
type Event = { id: string; ts: number; key: string }
export function dedupe(events: Event[]) {
const seen = new Set<string>()
return events.filter((e) => {
const bucket = Math.floor(e.ts / 60000) // minute
const k = `${e.key}:${bucket}`
if (seen.has(k)) return false
seen.add(k)
return true
})
}
Shaping pass ideas:
- Make the window size configurable
- Add unit tests with fast clocks
- Replace minute bucket with a sliding window if needed
TL;DR
Vibe coding is creative first, corrective next. Get the spark; then add the scaffolding. Used intentionally, it’s how prototypes become products—without becoming tech debt skeletons.
FAQ
Isn’t this just cowboy coding?
Only if you skip the shaping pass and guardrails.
What about tests?
Write them after the shape emerges—or for the stabilized core during shaping.