
Workshop · DevFest Warsaw 2026 · Classroom
Привітання. 45 хвилин, ~40 людей, у кожного ноутбук. Кажу одразу: ми будуємо, а не слухаємо. Усе, що треба скопіювати, є на слайдах з кнопкою Copy. Натисніть P, щоб бачити ці нотатки.
Say: Welcome. In 45 minutes you will build an AI code reviewer that comments on a real pull request. Everything you need to copy has a Copy button.
Before we start
DevDigest is a personal open-source tool built for educational purposes, not affiliated with Netflix.
All views in this workshop are my own and do not represent Netflix.
Results for CodeRabbit, Greptile, Claude, Codex and other tools come from my own runs on a demo PR. They are subjective and may not reflect how these tools work for you.
Prices are public list prices as of November 2026. Your plan, discounts or contract terms may differ.
Дисклеймер без змін із доповіді: інструмент особистий, відкритий, освітній; погляди мої.
Say: This is a personal open-source project, built for education. Views are my own.

About me
Senior Engineer (UI) at Netflix
Independent AI consultant
Engineer and team lead at unicorn companies DataRobot, Gelato
Developing AI tools since 2019: data preparation and feature discovery
Using AI engineering tools daily since early 2024
5+ AI products in daily use at printing companies, 2 autonomous agents
Ironman full-distance finisher
Enduro, rally, ultra-distance cycling
Про мене, 20–30 секунд. Netflix лише як місце роботи, без його процесів і команд. Консалтинг і всі приклади тут з особистих проєктів.
Say: I am Ivan: a UI engineer at Netflix and an independent AI consultant. Everything you will see today comes from my personal open-source projects.
The goal · 45 minutes from now
What
It comments on a real pull request and turns the check red.
Why build it yourself
So you know what to trust: the model is one stage, the rest is plain code.
Who decides
The reviewer only advises.
Rationale: why this breaks. Suggestion: how to fix it.
Illustration, not real output
Що і навіщо. Показую кінцевий результат одразу: PR із зеленою збіркою, але червоною перевіркою AI review та inline-коментарями. Навіщо будувати самим: бачимо кожну ланку і знаємо, чому їй можна довіряти. Мердж робить людина.
Say: By the end, a pull request in your own fork turns red with inline comments, and a human still decides to merge.
The plan · four steps
Це схема всього воркшопу: сім ланок зліва направо. Модель — лише одна з них, решту (контекст, перевірка, гейт, публікація) робить звичайний код. Під ланками видно, який крок яку ланку будує: крок 1 — Prompt, Model, Grounding; крок 2 — Context; крок 3 — Gate і публікація; крок 4 — кілька рев’юерів на тому самому конвеєрі. Ця ж схема стоїть угорі кожного кроку, з підсвіченою ланкою. Таймінг: Setup 4 хв, крок 1 — 8, крок 2 — 8, крок 3 — 9, крок 4 — 7, показ і завершення — 6. Кожен крок: пояснюю, вони будують агентом за промптом і специфікацією, перевіряють тестами. Якщо відстаємо, крок 4 скорочуємо до демо.
Say: The model is one box out of seven. The other six are plain code, and that is where trust comes from. You will see this map on every step.
The app · QuickBlog
Site
Admin
Analytics
Коротко знайомимо з цільовим застосунком QuickBlog: сайт зі статтями й коментарями та адмінка. У ролику: створюємо блог, публікуємо, лишаємо коментар і схвалюємо його. Analytics лише згадуємо, її покажемо на наступному слайді. Не затримуємось: це лише контекст для PR.
Say: This is QuickBlog, the app we review. A site with stories and comments, and an admin to write and moderate. Nothing more to learn here, it is just the target.
The target · QuickBlog · a public demo PR
planted defects + 3 traps
In the diff
Only against the spec
POST /view is never called.
Same PR as in the talk.
Це той самий PR із доповіді: 28 підкладених дефектів і 3 пастки. Частину видно в diff, частину видно лише порівнянням зі специфікацією. Саме це ми й відтворимо.
Say: Same PR as the talk. Defects are planted by hand, so we can count what each reviewer catches.
How the repo is organised
The rule
The start command is on every “Your turn” slide.
Fell behind?
git stash && git checkout <branch>The exact command is the Lost? line on each step.
Гілки — це контрольні точки. main — старт; step-N-* — готове рішення кроку N; final — повна функціональність; stretch/mcp — MCP-інструмент. Старт кроку N дорівнює готовому кроку N-1. Якщо відстали — git stash && git checkout потрібної гілки (точна команда є в Lost? на слайді кроку).
Say: Every step has a solution branch. If you fall behind, stash and check out the branch of the step you missed.
Setup · 4 min · do it with me
https://github.com/burnjohn/ai-code-reviewer-workshop/generategit clone https://github.com/<you>/ai-code-reviewer-workshop && cd ai-code-reviewer-workshopcp .env.example .envnpm cinpm run review:mocknpm run uiЧотири хвилини. Усі команди копіюються кнопкою Copy. Після clone одразу cd у папку (команда вже з cd). Template: галочка Include all branches, назву ai-code-reviewer-workshop не змінюємо і лишаємо Public — CI на кроці 3 бере рев’юер саме з
Say: Copy each command with its button. The key is in the chat. If review:mock prints findings, you are ready.
Step 1of 4 · Findings you can trust · 8 min
The problem
One comment on a line outside the diff, and GitHub rejects the whole review.
What we build
json_schema gives every finding a file, lines and a severity. Code drops what is not in the diff.
What you will see
Every dropped finding prints its reason in your terminal.
Фаза пояснення кроку 1 (~2 хв). Проблема: вільний текст не прив’язати до рядка, а модель вигадує місця. Рішення: json_schema, три правила в промпті (шкала severity, семантика verdict, дисципліна findings) і перевірка в коді: finding поза diff відкидаємо з причиною.
Say: Do not trust the model, check its output. Every finding gets a shape, and a finding that points outside the diff is dropped with a reason.
Step 1your turn · about 6 min
git checkout mainImplement Step 1. Read specs/step-1-findings.md and follow it exactly. Do not change tests, fixtures or any other file. Verify: run `npm test -- schema grounding` until 10 passed. Then run `npm run review:mock` and show me the findings.
specs/step-1-findings.md
src/schema.tssrc/prompt.tssrc/grounding.tsnpm test -- schema groundinggit stash && git checkout step-1-findingsGoal. The model answers with a typed object, and every finding is checked against the diff before anyone sees it. Why. The schema is the contract between model and code. Models hallucinate locations, and a comment on a line outside the diff cannot even be posted.
src/schema.tsFindingSchema, after end_line: severity (Severity), category (z.enum of security, correctness, performance, spec, maintainability), title, rationale, suggestion.title, rationale and suggestion are strings with .describe(). suggestion is '' when there is none.Finding and Review types with z.infer of their schemas.src/prompt.tsReplace the three TODO blocks and keep their headings.
SEVERITY_RUBRIC: one concrete line each for CRITICAL, WARNING, SUGGESTION.VERDICT_SEMANTICS: request_changes = at least one CRITICAL, comment = only WARNING/SUGGESTION, approve = no findings.FINDINGS_DISCIPLINE: only added or changed lines, cite NEW-side line numbers as printed, one finding per root cause, zero findings is valid.INJECTION_GUARD or wrapUntrusted.src/grounding.tsImplement groundFindings(findings, diff). Use buildLineIndex(diff), which is already written.
file '<path>' is not in the diff.lo / hi = min / max of start_line and end_line. No line of lo..hi is in the index → dropped, reason lines <lo>-<hi> do not touch any hunk in '<path>'.TODO and keep the injection guard.npm test -- schema grounding → 10 passed (full npm test: 23 failed | 22 passed, those are steps 2–4).
git checkout mainnpm test -- schema groundingnpm run review:mock (or npm run review / npm run ui): no undefined; each DROPPED line has a reason.# Step 1 · Findings you can trust **Goal.** The model answers with a typed object, and every finding is checked against the diff before anyone sees it. **Why.** The schema is the contract between model and code. Models hallucinate locations, and a comment on a line outside the diff cannot even be posted. ## What to build ### 1. The shape of a finding · `src/schema.ts` - Add five fields to `FindingSchema`, after `end_line`: `severity` (`Severity`), `category` (`z.enum` of `security`, `correctness`, `performance`, `spec`, `maintainability`), `title`, `rationale`, `suggestion`. - `title`, `rationale` and `suggestion` are strings with `.describe()`. `suggestion` is `''` when there is none. - Replace the temporary `Finding` and `Review` types with `z.infer` of their schemas. ### 2. The rules in the prompt · `src/prompt.ts` Replace the three TODO blocks and keep their headings. - `SEVERITY_RUBRIC`: one concrete line each for CRITICAL, WARNING, SUGGESTION. - `VERDICT_SEMANTICS`: `request_changes` = at least one CRITICAL, `comment` = only WARNING/SUGGESTION, `approve` = no findings. - `FINDINGS_DISCIPLINE`: only added or changed lines, cite NEW-side line numbers as printed, one finding per root cause, zero findings is valid. - Do not touch `INJECTION_GUARD` or `wrapUntrusted`. ### 3. The grounding check · `src/grounding.ts` Implement `groundFindings(findings, diff)`. Use `buildLineIndex(diff)`, which is already written. - The file is not in the index → dropped, reason `file '<path>' is not in the diff`. - `lo` / `hi` = min / max of `start_line` and `end_line`. No line of `lo..hi` is in the index → dropped, reason `lines <lo>-<hi> do not touch any hunk in '<path>'`. - Otherwise kept. ## Constraints - Do not change tests, fixtures or any other file. ## Acceptance 1. WHEN a finding has an unknown category or no severity, the schema SHALL reject it. 2. WHEN a finding's file is not in the diff, or its lines miss every hunk, the reviewer SHALL drop it with the exact reason above. 3. WHEN a range partly overlaps a hunk, or start is after end, the reviewer SHALL keep it. 4. WHEN the prompt is built, it SHALL contain no `TODO` and keep the injection guard. ## Done when `npm test -- schema grounding` → `10 passed` (full `npm test`: `23 failed | 22 passed`, those are steps 2–4). ## Steps 1. `git checkout main` 2. Paste the prompt into your coding agent. 3. `npm test -- schema grounding` 4. `npm run review:mock` (or `npm run review` / `npm run ui`): no `undefined`; each `DROPPED` line has a reason. ## Prompt ```text Implement Step 1. Read specs/step-1-findings.md and follow it exactly. Do not change tests, fixtures or any other file. Verify: run `npm test -- schema grounding` until 10 passed. Then run `npm run review:mock` and show me the findings. ``` ## Start from `git checkout main` ## Lost? `git stash && git checkout step-1-findings`
Практика кроку 1 (~5-6 хв). Три дії: команда старту, короткий промпт у свого агента, перевірка тестами. Поруч із промптом окремий блок специфікації: Read відкриває її в модальному вікні, Copy і Download віддають markdown. Уся інструкція живе у специфікації, промпт лише відсилає до неї агента. Stuck? — стрибок на готове рішення кроку. Після тестів: npm run review:mock — без undefined, кожен DROPPED має причину.
Say: Run the start command, paste the prompt into your coding agent, and stop when the check passes. Lost? jumps to the solution.
Implement Step 1. Read specs/step-1-findings.md and follow it exactly. Do not change tests, fixtures or any other file. Verify: run `npm test -- schema grounding` until 10 passed. Then run `npm run review:mock` and show me the findings.
git stash && git checkout step-1-findings
Step 1 · what you should see
Code checks the model’s output, not the model.
Що вони мають побачити після кроку 1: у терміналі severities і рядки DROPPED із причиною. Схема ілюстративна, точний формат виводу — у їхньому репо.
Say: This is why grounding matters: one invented line number can fail the whole review.
Step 2of 4 · Repository context · 8 min
The problem
The diff is only the changed lines. Nothing in it says the client never calls POST /view.
What we build
gatherContext()Project rules, the linked spec, full changed files and callers. Within a budget, wrapped as untrusted.
What you will see
Run it with and without --no-context and compare.
Пояснення кроку 2. Diff показує лише змінені рядки, тому дефект «клієнт ніколи не викликає POST /view» у diff не видно: немає рядка. Збираємо контекст у бюджеті токенів і загортаємо як недовірений (prompt injection).
Say: The diff cannot show what is missing. Give the model the spec and the callers, within a budget, and mark all of it as untrusted.
Step 2 · how much context is enough
■ green = the four rungs we build in step 2
Сходи контексту — від дешевого до дорогого. Кожен щабель додає токени, шум і поверхню для prompt injection. У кроці 2 ми беремо щаблі 1, 2, 3 і 5 (підсвічені зеленим). Репо-мапа, retrieval та агентний доступ — наступні рівні («What’s next»).
Say: More context is not free: tokens, noise, and more text an attacker can write into. Climb only as far as the bug needs.
Step 2your turn · about 6 min
git stash && git checkout step-1-findingsImplement Step 2. Read specs/step-2-context.md and follow it exactly. Do not change tests, src/source.ts or src/index.ts. Verify: run `npm test -- context` until 16 passed. Then run `npm run review:mock -- --dry-run`, show me the context log, and run it again with --no-context.
specs/step-2-context.md
extractLinkedDocs(body)extractSymbols(rawDiff)findCallers(symbols, files, maxHits)assembleContext(candidates, budget)gatherContext(source, opts)npm test -- contextgit stash && git checkout step-2-contextGoal. The reviewer sees more than the diff: project rules, the spec, the full files the PR changes, and callers of what it touches, within a fixed budget. Why. A diff cannot show a missing check, a broken project rule or a broken caller. The model can only reason about what is in its prompt.
Everything is in src/context.ts. Replace the TODOs; the types, constants, changedFiles and mapLimit are given.
extractLinkedDocs(body)MAX_LINKED_DOCS unique paths that end in .md and contain a /, in the order they appear in the PR body./blob/<ref>/<path>.md URL gives <path>. Other URLs, node_modules/ and ../ are ignored. Strip a leading ./.extractSymbols(rawDiff)DATA_PATH files.function x, const x = (...) =>, class x, def x) and from the text after the second @@ of a hunk header.STOP_SYMBOLS (given), max MAX_SYMBOLS.findCallers(symbols, files, maxHits)maxHits overall, 5 per symbol.text = the trimmed line, cut to 160 chars.assembleContext(candidates, budget)PRIORITY: rules > spec > file > callers.room = min(maxChars, budget - used). When room < MIN_USEFUL, skip the block and log ✗ … skipped (budget exhausted).room, with TRUNCATED appended.`### ${HEADING[kind]}: ${label}\n${wrapUntrusted(`${kind}:${label}`, text)}`
✓ (added), ~ (cut from N) or ✗ (skipped), then a final context: N block(s), X / BUDGET chars (~T tokens).{ blocks, log, chars, budget }.gatherContext(source, opts)RULES_FILES.docs/**/*.md + extraDocs, max MAX_LINKED_DOCS + 2, each up to MAX_DOC_CHARS.CODE_EXT, not NOT_REVIEWABLE or DATA_PATH), smallest first, each up to MAX_FILE_CHARS.source.list() files outside the diff (up to source.scanLimit), skipping node_modules, as one block with maxChars 4000: label = the symbols joined with , , one line per hit as <path>:<line> [<symbol>] <text>.src/source.ts or src/index.ts.docs/**/*.md, the reviewer SHALL add it as a spec block.node_modules.MIN_USEFUL, in priority order, and log it.npm test -- context → 16 passed (full npm test: 10 failed | 35 passed, steps 3–4).
git stash && git checkout step-1-findingsnpm test -- contextnpm run review:mock -- --dry-run: the log lists CLAUDE.md and docs/specs/analytics-dashboard-spec.md, then context: N block(s), X / 60,000 chars.--no-context and compare the prompt size (or use npm run ui).# Step 2 · Repository context
**Goal.** The reviewer sees more than the diff: project rules, the spec, the full files the PR changes, and callers of what it touches, within a fixed budget.
**Why.** A diff cannot show a missing check, a broken project rule or a broken caller. The model can only reason about what is in its prompt.
## What to build
Everything is in `src/context.ts`. Replace the TODOs; the types, constants, `changedFiles` and `mapLimit` are given.
### 1. Linked docs · `extractLinkedDocs(body)`
- Up to `MAX_LINKED_DOCS` unique paths that end in `.md` and contain a `/`, in the order they appear in the PR body.
- A `/blob/<ref>/<path>.md` URL gives `<path>`. Other URLs, `node_modules/` and `../` are ignored. Strip a leading `./`.
### 2. Changed symbols · `extractSymbols(rawDiff)`
- Skip new files and `DATA_PATH` files.
- Take names from added lines (`function x`, `const x = (...) =>`, `class x`, `def x`) and from the text after the second `@@` of a hunk header.
- 4+ chars, unique, not in `STOP_SYMBOLS` (given), max `MAX_SYMBOLS`.
### 3. Callers · `findCallers(symbols, files, maxHits)`
- Whole-word match per line. Max `maxHits` overall, 5 per symbol.
- `text` = the trimmed line, cut to 160 chars.
### 4. The budget · `assembleContext(candidates, budget)`
- Sort by `PRIORITY`: rules > spec > file > callers.
- `room = min(maxChars, budget - used)`. When `room < MIN_USEFUL`, skip the block and log `✗ … skipped (budget exhausted)`.
- Longer text is cut to fit `room`, with `TRUNCATED` appended.
- Every block is wrapped as untrusted data:
```ts
`### ${HEADING[kind]}: ${label}\n${wrapUntrusted(`${kind}:${label}`, text)}`
```
- Log one line per candidate: `✓` (added), `~` (cut from N) or `✗` (skipped), then a final `context: N block(s), X / BUDGET chars (~T tokens)`.
- Return `{ blocks, log, chars, budget }`.
### 5. Putting it together · `gatherContext(source, opts)`
- Rules: `RULES_FILES`.
- Docs: linked docs + changed `docs/**/*.md` + `extraDocs`, max `MAX_LINKED_DOCS + 2`, each up to `MAX_DOC_CHARS`.
- Files: modified code files (`CODE_EXT`, not `NOT_REVIEWABLE` or `DATA_PATH`), smallest first, each up to `MAX_FILE_CHARS`.
- Callers: usages of the symbols in `source.list()` files outside the diff (up to `source.scanLimit`), skipping `node_modules`, as one block with `maxChars` 4000: label = the symbols joined with `, `, one line per hit as `<path>:<line> [<symbol>] <text>`.
## Constraints
- Do not change tests, `src/source.ts` or `src/index.ts`.
## Acceptance
1. WHEN the PR body links a doc, or the diff touches `docs/**/*.md`, the reviewer SHALL add it as a spec block.
2. WHEN the diff changes a function, the reviewer SHALL list its usages outside the diff and skip `node_modules`.
3. WHEN the total exceeds the budget, the reviewer SHALL cut a block to the room left, or skip it when the room is under `MIN_USEFUL`, in priority order, and log it.
4. WHEN blocks are built, every one SHALL be wrapped as untrusted data.
## Done when
`npm test -- context` → `16 passed` (full `npm test`: `10 failed | 35 passed`, steps 3–4).
## Steps
1. `git stash && git checkout step-1-findings`
2. Paste the prompt into your coding agent.
3. `npm test -- context`
4. `npm run review:mock -- --dry-run`: the log lists `CLAUDE.md` and `docs/specs/analytics-dashboard-spec.md`, then `context: N block(s), X / 60,000 chars`.
5. Add `--no-context` and compare the prompt size (or use `npm run ui`).
## Prompt
```text
Implement Step 2.
Read specs/step-2-context.md and follow it exactly.
Do not change tests, src/source.ts or src/index.ts.
Verify: run `npm test -- context` until 16 passed.
Then run `npm run review:mock -- --dry-run`, show me the
context log, and run it again with --no-context.
```
## Start from
`git stash && git checkout step-1-findings`
## Lost?
`git stash && git checkout step-2-context`
Практика кроку 2. Після тестів запустити npm run review:mock -- --dry-run: у лозі CLAUDE.md і docs/specs/analytics-dashboard-spec.md, потім рядок context: N block(s). Далі додати --no-context і порівняти розмір промпту (або npm run ui). Спец-дефекти мають з’явитися лише з контекстом.
Say: Run the reviewer with and without context and compare. The spec-only bugs only show up with context.
Implement Step 2. Read specs/step-2-context.md and follow it exactly. Do not change tests, src/source.ts or src/index.ts. Verify: run `npm test -- context` until 16 passed. Then run `npm run review:mock -- --dry-run`, show me the context log, and run it again with --no-context.
git stash && git checkout step-2-context
Step 3of 4 · Gate + GitHub Action · 9 min
The problem
It can say “approve” while listing a CRITICAL finding.
What we build
Count blockers by severity, post one inline review, exit 1 when there are blockers.
What you will see
Inline comments in your QuickBlog fork in 2–3 min. A human still merges.
Пояснення кроку 3. Verdict від моделі ігноруємо: гейт рахує blockers за severity у коді та повертає exit code. Workflow читає ворожий текст (заголовок, опис PR), тому безпека workflow — наступний слайд.
Say: Pass or fail is arithmetic over findings, in code. The workflow itself reads untrusted PR text, so we lock it down.
Step 3 · the workflow reads hostile text
1Trigger
pull_request, never pull_request_target
on: pull_request2Permissions
Least privilege: only what posting a review needs
permissions: {contents: read, pull-requests: write}3Fork guard
Skip runs from forks: no secrets for strangers
if: github.event.pull_request.head.repo.full_name == github.repository4No PR text in run:
Never put ${{ }} with PR text into a script. Pass it through env:
env: { TITLE: ${{ github.event.pull_request.title }} }Чотири правила безпеки workflow. 1) pull_request, а не pull_request_target — другий дає токен із правами запису коду з форку. 2) Мінімальні permissions. 3) Guard на форки. 4) Жодного тексту PR усередині run: через ${{ }} — це shell-ін’єкція; передавати через env. У специфікації ще persist-credentials: false на обох checkout.
Say: The PR title is attacker-controlled text. Never paste it into a shell command.
Step 3your turn · about 6 min
git stash && git checkout step-2-contextImplement Step 3. Read specs/step-3-github-action.md and follow it exactly. Do not change tests or any other file. Do not push, commit or touch any remote. Verify: run `npm test -- gate workflow` until 9 passed. Then show me the final workflow file.
specs/step-3-github-action.md
src/gate.tsexamples/quick-blog-workflow.ymlnpm test -- gate workflowgit stash && git checkout step-3-gate-actionGoal. Pass or fail is decided by code, and the reviewer runs on every PR in your QuickBlog fork with inline comments and a red or green check. Why. A model can say "approve" while listing a CRITICAL finding. And the workflow that holds your secrets must be safe against code from a pull request.
src/gate.tscountBlockers(findings, failOn) returns how many findings have RANK[f.severity] >= MIN_RANK[failOn]. Both tables are in the file.critical → only CRITICAL; warning → CRITICAL and WARNING; any → all; never → 0.verdict.void / return 0 placeholder and its TODO.examples/quick-blog-workflow.ymlReplace the three TODO comments.
permissions: block with contents: read and pull-requests: write.if: github.event.pull_request.head.repo.full_name == github.repository.persist-credentials: false in the with: of both actions/checkout steps (one TODO covers both).Keep what is already right: the trigger is on: pull_request (never pull_request_target), and no PR text goes inside ${{ }} in a run: line.
failOn is critical, the reviewer SHALL count only CRITICAL; for warning and any it SHALL count lower severities too; for never, zero.Gate: FAIL and exit 1.blockers > 0.npm test -- gate workflow → 9 passed (full npm test: 4 failed | 41 passed, step 4).
git stash && git checkout step-2-contextnpm test -- gate workflow.burnjohn/quick-blog (untick "Copy the main branch only"); in the fork enable Actions, then add your OpenRouter key: Settings → Secrets and variables → Actions → New repository secret, name OPENROUTER_API_KEY, value = the key from your .env..github/workflows/ai-review.yml, paste your examples/quick-blog-workflow.yml, commit to main (you do this, not the agent). CI takes about 2–3 minutes. CI runs your reviewer repo's final branch; to run your own code, push it to a new branch and set the Actions variable REVIEWER_REF to it.main, compare analytics (gh pr create -R <you>/quick-blog -B main -H analytics -t Analytics -b ""). Check the Actions tab and "Files changed".# Step 3 · Gate + GitHub Action
**Goal.** Pass or fail is decided by code, and the reviewer runs on every PR in your QuickBlog fork with inline comments and a red or green check.
**Why.** A model can say "approve" while listing a CRITICAL finding. And the workflow that holds your secrets must be safe against code from a pull request.
## What to build
### 1. The gate · `src/gate.ts`
- `countBlockers(findings, failOn)` returns how many findings have `RANK[f.severity] >= MIN_RANK[failOn]`. Both tables are in the file.
- `critical` → only CRITICAL; `warning` → CRITICAL and WARNING; `any` → all; `never` → 0.
- Never read the model's `verdict`.
- Remove the `void` / `return 0` placeholder and its TODO.
### 2. The workflow · `examples/quick-blog-workflow.yml`
Replace the three TODO comments.
- A top-level `permissions:` block with `contents: read` and `pull-requests: write`.
- A fork guard on the review job: `if: github.event.pull_request.head.repo.full_name == github.repository`.
- `persist-credentials: false` in the `with:` of both `actions/checkout` steps (one TODO covers both).
Keep what is already right: the trigger is `on: pull_request` (never `pull_request_target`), and no PR text goes inside `${{ }}` in a `run:` line.
## Constraints
- Do not change tests or any other file.
- Do not push, commit or touch any remote. You push the workflow yourself.
## Acceptance
1. WHEN `failOn` is `critical`, the reviewer SHALL count only CRITICAL; for `warning` and `any` it SHALL count lower severities too; for `never`, zero.
2. WHEN the workflow file is read, it SHALL follow the four security rules in its header.
3. WHEN blockers exist, the reviewer SHALL print `Gate: FAIL` and exit 1.
4. WHEN the PR is opened in your fork, the workflow SHALL post one review with inline comments, red exactly when `blockers` > 0.
## Done when
`npm test -- gate workflow` → `9 passed` (full `npm test`: `4 failed | 41 passed`, step 4).
## Steps
1. `git stash && git checkout step-2-context`
2. Paste the prompt into your coding agent, then `npm test -- gate workflow`.
3. Fork `burnjohn/quick-blog` (untick "Copy the main branch only"); in the fork enable Actions, then add your OpenRouter key: Settings → Secrets and variables → Actions → New repository secret, name `OPENROUTER_API_KEY`, value = the key from your `.env`.
4. In your fork on GitHub: Add file → Create new file, name `.github/workflows/ai-review.yml`, paste your `examples/quick-blog-workflow.yml`, commit to `main` (you do this, not the agent). CI takes about 2–3 minutes. CI runs your reviewer repo's `final` branch; to run your own code, push it to a new branch and set the Actions variable `REVIEWER_REF` to it.
5. Open a PR in your fork: base `main`, compare `analytics` (`gh pr create -R <you>/quick-blog -B main -H analytics -t Analytics -b ""`). Check the Actions tab and "Files changed".
## Prompt
```text
Implement Step 3.
Read specs/step-3-github-action.md and follow it exactly.
Do not change tests or any other file.
Do not push, commit or touch any remote.
Verify: run `npm test -- gate workflow` until 9 passed.
Then show me the final workflow file.
```
## Start from
`git stash && git checkout step-2-context`
## Lost?
`git stash && git checkout step-3-gate-action`
Практика кроку 3, частина 1: гейт і workflow-файл локально, тести зелені. Агент нічого не пушить — пушимо самі на наступному слайді.
Say: Make the gate pass locally first. The agent does not push anything: you do, on the next slide.
Implement Step 3. Read specs/step-3-github-action.md and follow it exactly. Do not change tests or any other file. Do not push, commit or touch any remote. Verify: run `npm test -- gate workflow` until 9 passed. Then show me the final workflow file.
git stash && git checkout step-3-gate-action
Step 3 of 4 · your turn · run it in CI
https://github.com/burnjohn/quick-blog“I understand my workflows, go ahead and enable them”OPENROUTER_API_KEY.github/workflows/ai-review.ymlgh pr create -R <you>/quick-blog -B main -H analytics -t Analytics -b ""Підготовка форку QuickBlog. Критично: зняти галочку «Copy the main branch only», інакше гілки analytics не буде. Далі Actions → enable workflows. Ключ OpenRouter у GitHub: Settings → Secrets and variables → Actions → New repository secret, імʼя OPENROUTER_API_KEY, значення — той самий ключ, що в .env (без нього крок review впаде). Workflow додаємо прямо в GitHub: у форку Add file → Create new file, імʼя .github/workflows/ai-review.yml (кнопка Copy), вставляємо вміст свого examples/quick-blog-workflow.yml, commit у main. PR — командою gh з -R (інакше gh або веб-форма запропонують базою burnjohn/quick-blog замість вашого форку). CI іде ~2–3 хв (DeepSeek, три агенти паралельно): поки чекаємо — відкриваємо вкладку Actions і дивимось, як іде job.
Say: Fork QuickBlog, untick copy-main-only, add the secret, create the workflow file in the GitHub UI, open the PR, and watch the Actions tab: the red check lands in 2–3 minutes.
Step 4of 4 · More reviewers · 7 min
The problem
In the talk, 8 diff agents and 1 spec agent each found 22 of 28, and their finds barely overlap.
What we build
Security and spec-conformance run in parallel. The same file, lines and title merge into one finding.
What you will see
Findings, tokens and cost for each agent, then the total after dedup.
Пояснення кроку 4. Один універсальний рев’юер пропускає цілі класи. У доповіді вісім diff-агентів дорівнювали одному spec-агенту (22/28), а знахідки майже не перетиналися; разом 27/28. Агенти — це .md файли; дедуп по file+lines+title; модель можна обрати на агента.
Say: Agents are just markdown files. Run several, dedup the overlap, and look at what each one costs.
Step 4your turn · about 6 min
git stash && git checkout step-3-gate-actionImplement Step 4. Read specs/step-4-more-reviewers.md and follow it exactly. Do not change tests or src/ files other than src/dedup.ts. Verify: run `npm test` until 45 passed. Then run `npm run review:mock -- --dry-run` and show me the three agents.
specs/step-4-more-reviewers.md
.reviewer/agents/src/dedup.tsnpm testgit stash && git checkout step-4-more-reviewersGoal. Three agents (general, security, spec-conformance) run together, and their duplicate findings are merged before the review is posted. Why. Spec-only defects have no wrong line in the diff: something required is missing. A reviewer that reasons from the spec finds them. Three agents also report one bug three times, so you need a merge step and a cost line per agent.
.reviewer/agents/An agent file is frontmatter (name, model, fail_on, optional spec:) plus a system prompt. The file name is the agent id.
fixtures/agents/security.md and fixtures/agents/spec-conformance.md to .reviewer/agents/, with the same file names.security.md: keep its narrow scope, its negative list and its cap of 5 findings, worst first. Add one rule: every finding names the attacker input.spec-conformance.md: keep the spec: docs/specs/analytics-dashboard-spec.md line, the rule that the AC id (AC-x.y) comes first in the title, category spec, and "missing code counts". Add a negative list: style, and requirements the PR does not touch.src/dedup.tsImplement dedupFindings(perAgent).
sameProblem(merged, finding). The helper checks the file, overlapping ranges and title similarity.{ ...finding, agents: [agent] }.RANK, copy the new finding over the merged one and keep the agents list. On equal severity the first report stays.RANK descending, then file and start_line ascending.The parallel run, the AGENTS=… filter, REVIEW_MODEL, and tokens and cost per agent.
src/ other than src/dedup.ts.<id>.md is in .reviewer/agents/, the reviewer SHALL run it as an agent.spec: line, the reviewer SHALL put that doc into the context.npm test → 45 passed.
git stash && git checkout step-3-gate-actionnpm testnpm run review:mock -- --dry-run: three agents, and the spec in the context log.npm run review (or npm run ui): three ■ sections with cost, then Findings per agent: … → N after dedup.# Step 4 · More reviewers
**Goal.** Three agents (general, security, spec-conformance) run together, and their duplicate findings are merged before the review is posted.
**Why.** Spec-only defects have no wrong line in the diff: something required is missing. A reviewer that reasons from the spec finds them. Three agents also report one bug three times, so you need a merge step and a cost line per agent.
## What to build
### 1. Two agent files · `.reviewer/agents/`
An agent file is frontmatter (`name`, `model`, `fail_on`, optional `spec:`) plus a system prompt. The file name is the agent id.
- Copy `fixtures/agents/security.md` and `fixtures/agents/spec-conformance.md` to `.reviewer/agents/`, with the same file names.
- `security.md`: keep its narrow scope, its negative list and its cap of 5 findings, worst first. Add one rule: every finding names the attacker input.
- `spec-conformance.md`: keep the `spec: docs/specs/analytics-dashboard-spec.md` line, the rule that the AC id (`AC-x.y`) comes first in the title, category `spec`, and "missing code counts". Add a negative list: style, and requirements the PR does not touch.
### 2. The merge step · `src/dedup.ts`
Implement `dedupFindings(perAgent)`.
- Walk the agents in order. For each finding, look for an already merged one with `sameProblem(merged, finding)`. The helper checks the file, overlapping ranges and title similarity.
- No match: push `{ ...finding, agents: [agent] }`.
- Match: add the agent if it is not listed. If the new severity is higher by `RANK`, copy the new finding over the merged one and keep the `agents` list. On equal severity the first report stays.
- Return the list sorted by `RANK` descending, then `file` and `start_line` ascending.
### 3. Already wired, nothing to write
The parallel run, the `AGENTS=…` filter, `REVIEW_MODEL`, and tokens and cost per agent.
## Constraints
- Do not change tests, or any file in `src/` other than `src/dedup.ts`.
## Acceptance
1. WHEN two agents report the same file, overlapping lines and a similar title, the reviewer SHALL merge them, keep the highest severity and list both agents.
2. WHEN a file `<id>.md` is in `.reviewer/agents/`, the reviewer SHALL run it as an agent.
3. WHEN the spec agent has a `spec:` line, the reviewer SHALL put that doc into the context.
4. WHEN all agents finish, the reviewer SHALL print tokens and cost per agent and a deduped total.
## Done when
`npm test` → `45 passed`.
## Steps
1. `git stash && git checkout step-3-gate-action`
2. Paste the prompt into your coding agent.
3. `npm test`
4. `npm run review:mock -- --dry-run`: three agents, and the spec in the context log.
5. `npm run review` (or `npm run ui`): three `■` sections with cost, then `Findings per agent: … → N after dedup`.
## Prompt
```text
Implement Step 4.
Read specs/step-4-more-reviewers.md and follow it exactly.
Do not change tests or src/ files other than src/dedup.ts.
Verify: run `npm test` until 45 passed.
Then run `npm run review:mock -- --dry-run` and show me
the three agents.
```
## Start from
`git stash && git checkout step-3-gate-action`
## Lost?
`git stash && git checkout step-4-more-reviewers`
Практика кроку 4: додати агентів-файлів, запустити всі, подивитись таблицю по агентах: npm run review (або npm run ui) — три секції з вартістю і рядок «Findings per agent … → N after dedup». Після — показуємо результат на екрані.
Say: Add an agent, run all of them, and compare the table.
Implement Step 4. Read specs/step-4-more-reviewers.md and follow it exactly. Do not change tests or src/ files other than src/dedup.ts. Verify: run `npm test` until 45 passed. Then run `npm run review:mock -- --dry-run` and show me the three agents.
git stash && git checkout step-4-more-reviewers
Step 4 · from the talk · same PR · 28 core defects
Their finds barely overlap, so dedup + union wins.
Source: DevDigest talk, same QuickBlog PR, 28 core defects
Підсумок із доповіді: вісім diff-агентів і один spec-агент дають по 22 з 28, але знаходять різне; разом 27 з 28. Тому цінність у різноманітності рев’юерів, а не в кількості однакових.
Say: Eight copies of the same idea find the same bugs. One different idea finds new ones.
Show · 6 minutes
At home
claude mcp add ai-reviewer -- npx tsx mcp/server.tsПоказ (~4 хв): той самий двигун через чотири «двері». Живе демо MCP: у репо рев’юера на гілці stretch/mcp (npm ci, claude mcp add ai-reviewer -- npx tsx mcp/server.ts) внести маленьку зміну з багом і попросити Claude Code «Review my changes with ai-reviewer, agents: general» — перевірено, ~20 с. Сервер дивиться git diff HEAD і .reviewer/agents у поточній папці, тому працює саме в репо рев’юера. Праворуч — запис UI (npm run ui, mock): це план B, якщо мережа підведе. Вдома — команда внизу: спершу git switch stretch/mcp && npm ci у репо рев’юера, потім claude mcp add.
Say: The engine does not care who calls it. CLI, CI, MCP and a UI are four adapters.
Where it grows
DevDigest studio — це те, у що виростає той самий двигун. Показуємо запис, не наживо. Наш мінімальний UI з репо — маленька версія цього.
Say: This is where the same engine grows. It is a recording, not a live run.
After today
More context
Give the model the structure of the repo, not only the changed files.
A skeptic
A second agent tries to refute each finding before it is posted.
A score
Plant defects in PRs, count what you catch, watch it over time.
Що далі: repo map (щабель 4 драбини контексту), verifier-агент (спростовує знахідки перед публікацією), evals на PR із підкладеними дефектами — так вимірюємо, чи стало краще.
Say: Three next moves: more context, a skeptic, and a score.

Thank you · questions?
Workshop repo
https://github.com/burnjohn/ai-code-reviewer-workshopQuickBlog (the target)
https://github.com/burnjohn/quick-blogWorkshop repo
Завершення: репозиторій і QuickBlog з кнопками Copy, QR на репо воркшопу. Питання.
Say: Thank you. The repo and the target PR are yours to keep.
Thank you
Контакти: LinkedIn, Instagram і репозиторій воркшопу. Лишаю на екрані, поки відповідаю на питання.
Say: If you want to keep in touch: LinkedIn, Instagram, and the repo is yours to keep.