Inspiration

Every developer has faced the horror of legacy code. You join a new company, open a repository, and find:

  • 📁 10,000 lines of code with zero comments
  • 👻 The original developer left 3 years ago — no one knows what this does
  • 📜 No documentation — "the code is the documentation" they said
  • 🔥 It works... but nobody dares to touch it

This is a real problem in enterprises worldwide. According to studies, developers spend up to 60% of their time understanding existing code rather than writing new code. Legacy systems cost companies billions in maintenance because institutional knowledge walks out the door when developers leave.

We asked ourselves: What if we could summon the ghost of the original programmer?

Not literally, of course. But what if an AI could roleplay as the developer who wrote the code, claim ownership of it, explain it with the confidence (and sarcasm) of someone who actually built it, and help you migrate it to modern standards?

That's how LegacyBooh was born — turning the fear of legacy code into a supernatural experience where AI "ghosts" guide you through the darkness.


What it does

LegacyBooh is a multi-agent AI system disguised as a horror-themed code analysis tool. It transforms the terrifying experience of dealing with legacy code into an engaging, productive workflow.

🤖 6 Specialized Ghost Agents

Each ghost is a specialized AI persona with unique expertise:

Ghost Specialty Personality
🏛️ Adrian "The Architect" Design Patterns & Architecture Died waiting for PR approval
💀 Marcus "The Hacker" Security & Performance Caffeine overdose during CTF
🖥️ Beatrice "Root" Infrastructure & DevOps Lost in recursive symlinks
🔮 Elena "The Oracle" Data & Machine Learning Infinite hyperparameter loop
📟 Carlos "Legacy" COBOL & Mainframes Y2K bug caught up in 2038
🐛 Sofia "The Debugger" Testing & QA Found a bug no one believed

🎤 Live Voice Chat (Séance)

Using Gemini Live API, you can have a real-time voice conversation with the ghost:

  • Speak naturally — the ghost responds with voice
  • Drag & drop files for instant analysis
  • Live transcription of the conversation
  • Gender-specific voices (male/female ghosts sound different)

💀 Ghostly Linter (Screaming Errors)

A global error detection system that:

  • Analyzes ALL files simultaneously
  • SCREAMS continuously when critical errors exist (yes, actual audio loop!)
  • Stops screaming only when you fix the errors
  • One-click auto-fix for common issues (varlet, anyunknown, etc.)

⚰️ Mass Exorcism (Batch Migration)

Migrate your entire codebase in one ritual:

  • Phase 1: Auto-fix all detected errors
  • Phase 2: Apply migration transformations
  • Phase 3: Generate CHANGES.md documentation

📜 Testament (Project Analysis)

AI-powered documentation generation:

  • Detects tech stack and versions
  • Identifies obsolete patterns
  • Suggests migration paths
  • Lists technical debt
  • Generates DETAIL.md with full analysis

📝 Ghost Editor

Full-featured code editor with horror theme:

  • Syntax highlighting
  • Undo/Redo ("⏪ RESURRECTING..." / "⏩ FAST FORWARDING...")
  • Curse Level Meter (code quality indicator)
  • Context menu (Spellbook) on text selection

How we built it

Tech Stack

  • Frontend: React 18 + TypeScript + Vite
  • Styling: TailwindCSS with custom horror theme
  • AI: Google Gemini API
    • gemini-2.5-flash — Text generation & code analysis
    • gemini-2.5-flash-preview-tts — Text-to-speech for ghost voices
    • gemini-2.5-flash-native-audio-preview — Live API for real-time voice chat
  • Audio: Web Audio API for sound effects and voice processing
  • Visualization: Mermaid.js for code flow diagrams
  • IDE: Built entirely with Kiro (vibe coding, steering docs, specs, hooks)

Kiro Features Used

We leveraged Kiro's full feature set:

Feature Files Purpose
Steering Docs 5 Project context, horror theme, API guidelines, multi-agent architecture
Specs 9 Requirements, design, and tasks for 3 major features
Hooks 5 Automation for linting, file drops, exorcism, agent switching
MCP 3 servers Code analysis, linting, and visualization tools

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                    GHOST AGENT REGISTRY                          │
│  6 personas with unique: identity, expertise, voice, personality │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│              SPECIALIZED SYSTEM PROMPTS                          │
│  Each agent claims ownership: "I WROTE this code. It's MY legacy"│
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                 GEMINI API (Text + Voice)                        │
│  - Analysis & explanation                                        │
│  - Real-time voice conversation                                  │
│  - TTS with gender-specific voices                               │
└─────────────────────────────────────────────────────────────────┘

Challenges we ran into

1. Gemini Live API: Text + Audio Together

The biggest challenge was sending file context (text) along with voice input (audio) in the Live API. The model would sometimes "hallucinate" about files that didn't exist.

Solution: We implemented a sequential injection pattern:

// 1. Send file context FIRST (don't complete turn)
session.sendClientContent({ turns: [...], turnComplete: false });

// 2. Send instruction (complete turn)
session.sendClientContent({ turns: [...], turnComplete: true });

// 3. Audio streams separately
session.sendRealtimeInput({ media: audioBlob });

2. Audio Playback: The Chipmunk Problem

Gemini returns 24kHz PCM audio, but browsers expect different sample rates. Initially, our ghosts sounded like chipmunks!

Solution: We inject a WAV header and use decodeAudioData for proper resampling:

const wavBuffer = addWavHeader(rawBytes, 24000, 1, 16);
const audioBuffer = await audioContext.decodeAudioData(wavBuffer);

3. Scream Loop Without Annoying Users

We wanted the linter to scream continuously while errors exist, but not drive users insane.

Solution:

  • Volume capped at 25%
  • Only triggers for CRITICAL errors (syntax, security)
  • Stops IMMEDIATELY when errors are fixed
  • Visual pulsing animation accompanies audio

4. Multi-Agent Personality Consistency

Each ghost needed to maintain their unique personality while still being helpful.

Solution: Detailed system prompts with:

  • Backstory (how they died)
  • Specialty (what they're expert in)
  • Personality traits (sarcastic, defensive, dark humor)
  • Strict rules (mention file names, max 4-5 sentences, no hallucinating)

Accomplishments that we're proud of

🎤 Real-Time Voice Chat Actually Works

Getting Gemini Live API to work with file context injection was a major achievement. Users can now speak naturally to an AI ghost about their code, and it responds with voice in real-time.

💀 The Screaming Linter is Hilarious AND Useful

What started as a joke ("what if the linter screamed?") became a genuinely useful feature. The audio feedback creates urgency to fix errors, and the auto-fix makes it easy to resolve them.

🤖 6 Distinct AI Personalities

Each ghost feels different. Adrian talks about architecture patterns, Marcus warns about security vulnerabilities, Sofia hunts for bugs. The roleplay makes code review entertaining.

🎨 Cohesive Horror Theme

Every element — colors, fonts, sounds, animations, copy — follows the horror theme. It's not just a gimmick; it makes the tool memorable and fun to use.

📚 Complete Kiro Integration

We used ALL of Kiro's features:

  • 5 steering docs for consistent context
  • 9 spec files across 3 features
  • 5 hooks for automation
  • MCP configuration for tools

What we learned

1. Gemini Live API is Powerful but Tricky

The Live API enables amazing real-time experiences, but requires careful handling of:

  • Turn completion flags
  • Audio format conversion
  • Context injection timing

2. Personality Makes AI More Engaging

Users interact more with an AI that has personality. The sarcastic ghost personas make people want to use the tool, even for mundane tasks like code review.

3. Audio Feedback Changes Behavior

The screaming linter proves that audio feedback creates urgency. Users fix errors faster when there's an annoying sound motivating them.

4. Kiro Accelerates Development

Using Kiro's steering docs and specs kept us focused. The AI understood our project context and made relevant suggestions throughout development.

5. Horror Theme = Perfect Metaphor

Legacy code really IS scary. The horror theme isn't just aesthetic — it resonates with developers who've experienced the fear of touching undocumented code.


What's next for LegacyBooh

🔮 Séance Council Mode

Multiple ghosts discussing code together:

  • Adrian reviews architecture
  • Marcus checks security
  • Sofia finds bugs
  • They argue sarcastically about the best approach

🌐 Browser Extension

Inject LegacyBooh into GitHub/GitLab:

  • Summon a ghost on any repository
  • Get instant analysis of PRs
  • Voice chat about code changes

🗣️ More Languages

  • Support for Portuguese, Japanese, Others
  • Localized ghost personalities
  • Regional humor and references

Built With

Share this project:

Updates