Learn Redline
Take a small TypeScript service from no Redline at all to a merge gate that has earned the right to block. 11 short pages, about 73 minutes. You need no prior knowledge of Redline: each new idea is explained where you first meet it.
redlinegate@0.2.11 is the version on npm's latest tag, published 2026-10-13. Every command on this page installs it.
Redline in one minute
Coding assistants write a lot of code, quickly. A reviewer reading that code cannot hold every rule the team cares about in their head: no secrets in code, validate what comes in from outside, no as unknown as to make the compiler stop complaining. Redline writes those rules down once, and checks them in three places:
- While the code is written. The rules are rendered into the files your assistant reads on every request:
AGENTS.md,CLAUDE.md, the Copilot instructions and the Cursor rules. - Before you push.
redline reviewchecks your change on your machine, and/redline-reviewasks your assistant to do the same. - On the pull request. A merge gate runs the same checks again, plus a few only a pipeline can do: a secret scan, a vulnerable-dependency check, a checklist.
It also counts which rules people act on, so a team can tell the rules that catch real bugs from the ones that only make noise.
What you need
- git and Node 18.11 or later.
- pnpm, or npm, yarn or bun. Every command that differs has a tab for each.
- A GitHub account and the GitHub CLI, signed in with
gh auth login. The gate runs on pull requests, so each step opens one. - An AI assistant, if you have one: Claude Code, GitHub Copilot or Cursor. Steps 02 to 04 run a review inside it. Without one, those steps show what it would say.
How this path works
You follow one real repository, redline-demo. Each step is one pull request there, merged and tagged, from step-00 to step-09. At every step you can see exactly what the repository held.
You do the work in a repository of your own. Step 00 copies the demo's starting files into a new GitHub repository under your account. The demo itself is only ever read from.
From step 01 on, a step ends the same way: commit on a branch, open a pull request, watch the checks, merge, and pull main before the next step. Step 02 is the exception: its pull request stays open, and step 03 fixes and merges it. Rather just read? Every step links the demo's pull request, so you can follow without running anything.
Mark each step complete as you go. Your progress is kept in this browser only.
The steps
- The starting pointGet the starter files into a GitHub repository of your own, and see what it holds.
- OnboardOne command adds the rules, the review commands and a merge gate.
- Your first findingFive broken rules, and which ones your machine, your assistant and the gate each catch.
- Explain and fixFind out why a rule exists, then fix the code instead of silencing it.
- A team ruleWrite your team's own rule once, and every assistant and review picks it up.
- A big change needs an ADRPast 300 changed lines, the pull request links the decision behind it.
- The security floorA vulnerable dependency fails the gate from day one, and nothing waives it.
- Make the gate requiredA red gate disables the merge button, for everyone.
- ExemptionsMerge past a failing check on purpose, with the reason on the record.
- Earn a stricter rungWatch a BLOCKER merge, then see what it takes for the gate to stop the next one.
- Recap and next stepsWhat you built, how new rules reach you, and where to go from here.
Check your understanding
A rule is broken in a pull request. Where can Redline first notice it?