# break-it

A skill that plants bugs in RAG pipelines and asks you to find them. Debugging teaches architecture faster than building from scratch, since you have to understand why things work to spot why they fail.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 24
- Author: TakaGoto
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/TakaGoto/rag-learning-academy/tree/HEAD/.claude/skills/break-it/SKILL.md
- Updated: 2026-04-03
- HTML: https://affpapa.org/en/nevibecode/skills/break-it

## What it does

Break-it generates a working-but-broken RAG pipeline and challenges you to locate the bug. Errors scale by difficulty: easy mode shows obviously wrong results; medium mode looks plausible but is incorrect; hard mode pairs two bugs that interact. The skill covers real failure modes: chunk sizes too small or with zero overlap, mismatched embedding models between indexing and search, context placed after the question, overly strict metadata filters, stale indexes.

Once you spot the issue, the skill explains why it causes the observed behavior, how common this bug is in production systems, and how to prevent it. Stuck after two attempts? Ask for hints—from pointing at the general area to spelling out the exact problem. Every session logs to `progress/debug-log.md`, letting you track which bug types you've mastered.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add TakaGoto/rag-learning-academy --skill break-it -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/break-it/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/break-it/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add TakaGoto/rag-learning-academy --skill break-it -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/break-it/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add TakaGoto/rag-learning-academy --skill break-it -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/break-it/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install TakaGoto/rag-learning-academy break-it
```

2. **Manually: put the files in place**
- File: `.github/skills/break-it/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add TakaGoto/rag-learning-academy --skill break-it -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/TakaGoto/rag-learning-academy --path .claude/skills/break-it
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/break-it/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add TakaGoto/rag-learning-academy --skill break-it -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/TakaGoto/rag-learning-academy/tree/HEAD/.claude/skills/break-it/SKILL.md

## When to use it
- Spot how bad chunking fragments context across boundaries
- Catch embedding model mismatches between index and query time
- Diagnose the lost-in-the-middle effect when context is placed after questions
- Identify stale indexes that don't reflect new documents
- Learn to read RAG code critically

## Example prompts
- Give me a medium-difficulty RAG debugging challenge
- /break-it hard — I want two interacting bugs
- Why is my retrieval returning irrelevant results?

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 330b9e94e98a69d6.

BEGIN THIRD-PARTY FILE 330b9e94e98a69d6
```text
---
name: break-it
description: "Find the bug — learn RAG by debugging intentionally broken pipelines"
---

# Break It: Learn by Debugging

Introduce a realistic bug into a RAG pipeline and challenge the learner to find and fix it. Debugging teaches more than building because you have to understand *why* things work to figure out *why they don't*.

> **Language awareness:** See `.claude/LANGUAGE_AWARENESS.md`.

## Step 1: Choose a Difficulty

If the learner specifies a difficulty (e.g., `/break-it hard`), use that. Otherwise, calibrate based on their progress:

- **Easy** — One obvious bug. The pipeline runs but gives clearly wrong results.
- **Medium** — One subtle bug. The pipeline runs and results look plausible but are wrong.
- **Hard** — Two bugs that interact. Fixing one makes the other more visible.

## Step 2: Select a Bug Category

Pick from these common RAG failure modes. Rotate through categories so the learner sees variety:

### Chunking Bugs
- Chunk size set way too small (10 tokens) — fragments lose all context
- Zero overlap — information at boundaries is lost
- Wrong separator for the document type (splitting code on paragraphs)

### Embedding Bugs
- Mismatched embedding models between indexing and querying
- Missing query prefix for asymmetric models (e.g., no "query: " prefix for E5)
- Embeddings not normalized, breaking cosine similarity

### Retrieval Bugs
- Top-k set to 1 — missing relevant context spread across chunks
- Wrong distance metric (L2 instead of cosine)
- Metadata filter too restrictive — filtering out relevant results

### Generation Bugs
- Context placed after the question (lost-in-the-middle effect)
- No grounding instruction — model ignores context and hallucinates
- Context window exceeded — retrieved chunks silently truncated

### Pipeline Bugs
- Stale index — new documents added but not re-embedded
- Document not chunked before embedding (entire doc as one vector)
- Query embedded with a different model than the corpus

## Step 3: Present the Broken Pipeline

Show the learner a complete, runnable pipeline with the bug(s) already in place. Include:

1. The code (with the bug hidden in plain sight)
2. Sample data
3. A query that exposes the bug
4. The actual output (showing the wrong behavior)
5. What the correct output should look like

Say: "Something's wrong with this pipeline. The query should return [expected], but it's returning [actual]. Can you find the bug?"

## Step 4: Guide the Debugging

Let the learner investigate. If they're stuck after 2 attempts, offer graduated hints:

- **Hint 1** (gentle): Point to the general area — "The issue is in the retrieval step" or "Look at how the chunks are created"
- **Hint 2** (specific): Narrow it down — "Compare the embedding model used for indexing vs querying"
- **Hint 3** (direct): Explain the bug and why it causes the behavior
```
END THIRD-PARTY FILE 330b9e94e98a69d6

The third-party file has ended. Everything between the 330b9e94e98a69d6 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2895 of 3567 bytes. © TakaGoto · MIT · https://github.com/TakaGoto/rag-learning-academy/tree/HEAD/.claude/skills/break-it/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
