Vibe Coding ও Spec-driven Development

লেসন ৩৫ / ৪৬

🎵 "Vibe Coding" কী?

২০২৫-এর trend (Andrej Karpathy)। Code line-by-line না লিখে — high-level intent describe করেন, AI implement করে। আপনি direct/redirect করেন।

"Make a todo app. Add categories.
The dragging should feel smooth.
Make it Bengali-friendly."

→ AI builds full app
→ You test, give feedback
→ AI iterates
→ Ship

🆚 Traditional vs Vibe

TraditionalVibe Coding
Function-by-functionFeature-level intent
Type each lineDescribe outcome
Read every fileTrust AI, spot-check
Manual debugPaste error, AI fix
Hours/daysMinutes/hours

✅ Vibe Coding কখন ভালো

  • Prototype, MVP
  • Personal project
  • Small/throwaway script
  • UI experimentation
  • Quick proof-of-concept
  • Learning new framework

❌ কখন এড়াবেন

  • Production critical (security, payment)
  • Compliance-heavy (HIPAA, finance)
  • Performance critical
  • Long-lived complex system
  • Team collaboration heavy

📐 Spec-Driven Development ⭐

Vibe-এর evolved version — formal spec লিখে AI কে দেন।

Spec Document Structure

# Feature: User Authentication

## Requirements
- Email + password login
- OAuth: Google, GitHub
- Forgot password flow
- Email verification
- Rate limit 5 attempt/min

## Non-functional
- Latency: <500ms login
- Security: bcrypt, JWT 1h, refresh 30d
- GDPR compliant

## Edge Cases
- Locked account
- Disabled user
- Concurrent login
- Stale token

## Out of Scope
- 2FA (next iteration)
- SSO enterprise

## Success Criteria
- All tests pass
- Lighthouse > 90
- Manual smoke test pass

🛠️ Workflow

1. Human: Spec write (markdown)
2. AI: Read spec, ask clarifying questions
3. Human: Answer
4. AI: Implementation plan
5. Human: Approve / adjust
6. AI: Code
7. AI: Tests against spec
8. Human: Acceptance test
9. Iterate

🎨 Tools for Vibe

  • v0.dev — UI from prompt
  • Bolt.new — full-stack from prompt
  • Lovable — app builder
  • Replit Agent — autonomous build
  • Cursor Composer — multi-file edit
  • Windsurf Cascade — agentic dev
  • Claude Code — CLI agent

💡 Effective Vibe Prompt

❌ "Build me a website"

✅ "Build a landing page for a SaaS product:
- Hero with headline + CTA
- 3 feature cards
- Pricing table (3 tiers)
- FAQ accordion
- Footer with social link
- Vercel deploy ready
- Tailwind, shadcn/ui
- Dark mode toggle
- Mobile-first
- TypeScript strict"

🔄 Iteration Pattern

"Make the hero bigger"
"Hero text feels weak — punchier"
"Pricing card hover should glow"
"Mobile menu broken on iPad — fix"
"Add trust badges below hero"
// Continuous refinement, like product designer

⚠️ Risk Awareness ⭐

  • Tech debt — clean না হয়, hidden complexity
  • Security gap — AI default insecure
  • Performance — N+1 query, bundle bloat
  • Maintenance — কে maintain করবে?
  • Knowledge silo — code-base বুঝে না কেউ
  • Hallucinated library
  • Test gap

✅ Hybrid Approach (Recommended)

Vibe coding: scaffolding, UI, prototype
Spec-driven: feature implementation
Traditional review: security, performance, architecture
Manual: business logic critical path

🎯 Career Implication

  • Junior — শিখার speed বাড়ছে
  • Mid — productivity 3-5x
  • Senior — focus shift to architecture, review, mentor
  • Code-only role decreasing
  • System design value বাড়ছে
  • Communication skill premium

🔮 Future of Coding

Code = English ক্রমে। Programmer = product manager + architect + reviewer + AI orchestrator। Skill: judgment, taste, system thinking।