Tutorial
Make a throwaway repository, let Redline onboard it, then write code that breaks the rules and watch Redline catch it, explain it and stop complaining once it is fixed. About fifteen minutes. Nothing is pushed anywhere.
How the pieces fit
Onboarding puts the same rules in three places, and each one catches mistakes at a different moment:
- While the code is written.
AGENTS.md,CLAUDE.md,.github/copilot-instructions.mdand.cursor/rules/are read by your assistant on every request. - Before you push.
reviewruns the rules a checker can decide on your machine, and/redline-reviewasks your assistant to apply the rest. - On the pull request. The gate runs the checker rules again, along with the pull request checklist, the secret scan and dependency review.
What you will do
- Set up a playground, on this page: a new repository on your machine, onboarded by Redline.
- Your first finding: plant four violations and run
npx redlinegate@latest review. - Ask your assistant: the same review inside Claude Code, Copilot or Cursor.
- Explain and fix:
npx redlinegate@latest explain, then make the findings go away properly. - Push and stay current: what happens on the pull request, and how new rules reach you.
What you need
You do not need to install Redline. Every command runs the published package through npx, so you always get the current version.
Set up a playground
Create a repository
A new folder with one file and one commit, on your machine only.
mkdir redline-demo && cd redline-demo
git init -b main
npm init -y
mkdir src && echo 'export const ok = 1' > src/index.ts
git add -A && git commit -m "chore: initial commit"npm: command not found or git: command not found? Install Node (npm comes with it) or git, open a new terminal, and run it again.
Onboard it
Run this on its own. The first time, npx asks Ok to proceed? (y); answer y.
$ npx redlinegate@latest init profile javascript-typescript ▲ this repository has no git remote, so Redline installed the rules and the local review only. The merge gate, branch policy, labels and security floor need a host: add a remote and run redline init again to install them Files 18 written + AGENTS.md + CLAUDE.md + .github/copilot-instructions.md + .claude/commands/redline-review.md + .redline.json … not committed — the files are in your working tree; commit them when you are ready
With no remote there is nowhere for a merge gate to run, so Redline installs what works on your machine and stops: it contacts no host, needs no credential and commits nothing. Add a remote later and run init again, and the gate and repository settings follow. Commit the files:
$ git add -A && git commit -m "chore: onboard redline"
Look at what it wrote
AGENTS.md,CLAUDE.md,.github/copilot-instructions.mdand.cursor/rules/: the rules, in the form each assistant reads..claude/commands/,.github/prompts/and.cursor/commands/: a/redline-reviewcommand for each assistant. Step 2 uses them..redline.json: what was installed and at which version.
Open redline-demo as the workspace folder in your editor, so your assistant finds the rules and the commands. Then go to step 1.
Trying it on a repository you have already onboarded? Skip the playground and follow the steps there. Your profile line and file list will differ from what these pages show, and nothing else changes.