Stu Mason
Stu Mason

Scope-Locked Vibing

Stu Mason4 min read

Pure vibe coding breaks down on complex projects. Scope-locked vibing is my middle ground - keep the speed, avoid the mess.

Scope-Locked Vibing

I've been experimenting with vibe coding - letting AI models generate entire codebases from natural language descriptions. Works amazingly for simple, self-contained projects. Breaks down spectacularly for anything complex.

The Problem With Pure Vibe Coding

Vibe coding: describe what you want in plain language, let the AI generate code, accept its solutions without necessarily understanding everything.

Coined by Karpathy: https://x.com/karpathy/status/1886192184808149383

This approach has a major flaw. Here's what typically happens:

  1. Describe a complex feature (like an auth system)
  2. AI confidently generates code that looks plausible
  3. Implement it, things seem to work
  4. Add more features, mysterious bugs appear
  5. Neither you nor the AI truly understand the codebase
  6. The fun evaporates, replaced by frustrating debugging sessions

I experienced this trying to create a NextJS + Supabase auth package similar to Laravel Jetstream. What started exciting devolved into a confusing mess of partially-working features and unexplainable bugs.

Scope-Locked Vibing

Rather than abandoning vibe coding, I developed a middle-ground approach. Preserves speed and fun while addressing the limitations.

Key principles:

  1. Lock the scope to what fits in a single context window
  2. Define clear boundaries before you start
  3. Complete and test one feature before moving to the next
  4. Maintain the "vibe" without sacrificing stability

Here's a template I use:

# Scope-Lock: [Feature Name]

## What it does
[2-3 sentences max]

## Boundaries
- Create/modify only: [specific files]
- Don't touch: [anything off-limits]
- Must work with: [critical integration points]

## Success looks like
[How you'll know it works]

Why This Works

Traditional vibe coding falls apart because:

  • Context collapse - AI loses track across multiple exchanges
  • Feature creep - You both keep adding "just one more thing"
  • Untested assumptions - Code gets generated without validation
  • No shared understanding - You don't know what it did, and neither does it

Scope-Locked Vibing creates manageable, self-contained units of work. Each scope lock fits entirely within the AI's context window, has explicit boundaries and integration points, produces code that can be tested before moving on, and results in code you actually understand.

Practical Example

Building that NextJS+Supabase auth package. Instead of "build an auth system like Laravel Jetstream," I break it down:

# Scope-Lock: User Registration Flow

## What it does
Handle the complete user registration process including form validation, Supabase auth call, and success/error states.

## Boundaries
- Create/modify only: components/auth/Register.tsx, hooks/useRegister.ts
- Don't touch: any existing layout or navigation components
- Must work with: existing Supabase client configuration

## Success looks like
- Form with validation for name, email, password, password confirmation
- Proper error handling for all Supabase error cases
- Clear success state and redirect after registration
- Unit tests that verify the flow works

Implement just this feature, test it thoroughly, move to the next scope-locked feature (login flow, password reset, etc.).

Benefits

  1. Maintained momentum - Work stays fun without devolving into debugging hell
  2. Better architecture - Breaking into scope locks naturally produces modular code
  3. Increased confidence - Actually understand what each component does
  4. Easier testing - Each feature can be tested independently
  5. Gradual learning - Building understanding of the codebase as I go

Still Figuring Out

  • What's the ideal scope size for different types of features?
  • How can automated testing be better integrated?
  • What prompt techniques work best for maintaining boundaries?
  • How does this scale to teams?

If you've been frustrated by the limitations of traditional vibe coding, I'd love to hear your approaches. I'm still figuring this out, and I suspect many of us are in the same boat.

Get the Friday email

What I shipped this week, what I learned, one useful thing.

No spam. Unsubscribe anytime. Privacy policy.