Adaptors
Each AI assistant reads its instructions from its own files. redline init writes the organisation's standard into the files your assistants read, so Copilot, Claude, Cursor and Codex all review against the same rules and cite the same rule ids.
Which files Redline writes for your tool
| You use | Redline writes | What the files do |
|---|---|---|
| GitHub Copilot | .github/copilot-instructions.md, one .github/instructions/redline-<stack>.instructions.md per stack, and .github/prompts/redline-*.prompt.md | The core rules on every request, each stack's rules on matching files, and three prompts |
| Claude Code | CLAUDE.md, AGENTS.md and .claude/commands/redline-*.md | CLAUDE.md imports AGENTS.md, which holds every rule. Three slash commands |
| Cursor | .cursor/rules/redline-core.mdc, one .cursor/rules/redline-<stack>.mdc per stack, and .cursor/commands/redline-*.md | The core rules always, each stack's rules on matching files, and three commands |
| OpenAI Codex, and any agent that reads AGENTS.md | AGENTS.md | Every rule in one always-on file |
<stack> is each stack in the repository's profile, such as typescript. The three commands are redline-init, redline-review and redline-verify. Redline rewrites its part of these files on every run, so do not edit it; text of your own outside the marker block stays. Put your team's own rules in .redline/local.md.
Why one standard needs several files
The organisation writes its rules once, in standards/. No assistant reads that folder, and each one has its own file and its own way of scoping rules to some file types. Copies kept by hand drift apart, and then a finding from one assistant cannot be compared with a finding from another.
An adaptor is the part of redline init that writes the standard into one assistant's files. Every adaptor writes the same rule text with the same rule ids, so a finding tagged [core/customer-data-in-logs] means the same thing whichever assistant posted it.
Each adaptor has a vendor id: the name you pass to --vendors, and the name .redline.json records. Pass the full list you want:
$ pnpm redline init --vendors copilot,claude,cursor
$ npx redlinegate init --vendors copilot,claude,cursor
$ yarn redline init --vendors copilot,claude,cursor
$ bun run redline init --vendors copilot,claude,cursor
What each adaptor writes
Always on means the tool loads the file for every request. By glob means it loads the file only when the files in play match the globs in its frontmatter.
| Vendor id | Files written | Read by | How it activates |
|---|---|---|---|
copilot | .github/copilot-instructions.md.github/instructions/redline-<stack>.instructions.md | GitHub Copilot: code review, chat and the coding agent | Repository-wide file always on; stack files by glob (applyTo:) |
agents | AGENTS.md | Any agent that reads AGENTS.md: Codex, the Copilot coding agent, Jules, Cursor's agent, Devin | Always on; each stack section states its globs in an _Applies to:_ line |
codex | AGENTS.md (the same file as agents) | OpenAI Codex | As agents |
claude | CLAUDE.mdAGENTS.md (the same file as agents) | Claude Code, and Claude in GitHub | Always on; CLAUDE.md imports AGENTS.md |
cursor | .cursor/rules/redline-core.mdc.cursor/rules/redline-<stack>.mdc | Cursor | Core always on (alwaysApply: true); stack files by glob (globs:) |
copilot, claude and cursor also get the three Redline slash commands; see Slash commands and prompts.
GitHub Copilot
Copilot reads two kinds of instruction file, and Redline writes both:
- Repository-wide:
.github/copilot-instructions.md. Copilot reads it for every request in the repository. Redline puts the core standard here, inside a marker block, so anything your team already wrote in the file stays. - Path-specific: one
.github/instructions/redline-<stack>.instructions.mdper stack. Copilot reads one only when the files it is working on match itsapplyTo:globs, so the TypeScript rules are not applied to a Go file. Redline owns these files whole and rewrites them on every run.
Copilot code review reads both kinds: the repository-wide file for every pull request, and each path-specific file whose globs match a changed file. applyTo: is one quoted string, with the stack's globs joined by commas:
---
applyTo: "**/*.ts,**/*.tsx,**/*.mts,**/*.cts"
---
<!-- Redline v0.2.2 · profile: javascript-typescript · stacks: typescript -->
# TypeScript Review Rules
…Review on every pull request. On GitHub, the branch ruleset Redline installs sets automatic_copilot_code_review_enabled: true, so Copilot reviews every pull request without anyone requesting it. That ruleset is the merge-policy capability. If you skip it with --skip merge-policy, there is no ruleset, and you request Copilot's review yourself or turn on automatic review in your own ruleset. Copilot code review itself has to be available to your account or organisation; Redline does not switch it on.
AGENTS.md
AGENTS.md is a convention many agents share: the Copilot coding agent, Jules, Cursor's agent, Devin and OpenAI Codex all read it from the repository root. One file reaches all of them.
The file has no frontmatter and no glob mechanism, so the whole file is always on. Redline writes the core standard, then a # Stack rules heading, then each stack's rules with its headings moved down one level. Each stack ends with an _Applies to:_ line listing its globs, which tells the model where the section applies:
<!-- REDLINE:BEGIN — generated by Redline. Do not edit inside this block. -->
<!-- Redline v0.2.2 · profile: javascript-typescript · stacks: javascript, typescript -->
# Redline — Core Engineering Standards
…
---
# Stack rules
## JavaScript Review Rules
…
_Applies to: `**/*.js`, `**/*.jsx`, `**/*.mjs`, `**/*.cjs`, `**/*.vue`, `**/*.svelte`_
---
## TypeScript Review Rules
…
_Applies to: `**/*.ts`, `**/*.tsx`, `**/*.mts`, `**/*.cts`_
<!-- REDLINE:END -->Everything is inside the marker block. Write your repository's own context, such as how to build it or where things live, above or below the block, and it stays.
OpenAI Codex
Codex reads AGENTS.md, so the codex adaptor writes exactly what agents writes, with the same renderer. It is a separate id so that someone looking for Codex in the menu or in --vendors finds it by name. Selecting codex, agents, claude, or any mix of them writes one AGENTS.md with identical content. Neither codex nor agents gets slash commands.
Claude
Claude Code loads CLAUDE.md at the start of every session. Rather than a second copy of the rules, Redline writes a short pointer that imports AGENTS.md with Claude Code's @ import syntax:
<!-- REDLINE:BEGIN — generated by Redline. Do not edit inside this block. -->
Engineering standards and review rules for this repository are defined by Redline
and rendered into `AGENTS.md`. They are binding for all work in this repo.
@AGENTS.md
<!-- REDLINE:END -->So Claude sees exactly the rules every AGENTS.md reader sees.
- Selecting
claudebringsAGENTS.mdwith it. The adaptor writes both files, so--vendors claudeon its own, or a repository detected asclaudealone, never leaves the import pointing at nothing. Selectingagentsorcodexas well writes the sameAGENTS.mdonce. - Org context sections and
.redline/local.mdare rendered intoCLAUDE.md's block as well as intoAGENTS.md.
The adaptor also writes .claude/commands/redline-init.md, redline-review.md and redline-verify.md, which Claude Code offers as /redline-init, /redline-review and /redline-verify.
Cursor
Cursor reads rule files from .cursor/rules/, and each file's frontmatter says when it applies. The core standard is always on:
---
description: Redline core standards
alwaysApply: true
---
<!-- Redline v0.2.2 · profile: javascript-typescript · stacks: javascript, typescript -->
# Redline — Core Engineering Standards
…Each stack gets its own file, attached only when a file matching its globs is in play. globs: is the stack's globs joined by commas, not quoted:
---
description: Redline TypeScript rules
globs: **/*.ts,**/*.tsx,**/*.mts,**/*.cts
alwaysApply: false
---
# TypeScript Review Rules
…Cursor needs the frontmatter at the very top of the file, so these files have no marker block: Redline owns them whole and rewrites them on every run. Keep your own Cursor rules in files without the redline- prefix. Org context and .redline/local.md go into redline-core.mdc. Cursor's agent also reads AGENTS.md when that adaptor is selected.
The marker block
AGENTS.md, CLAUDE.md and .github/copilot-instructions.md are files a team may already have, so Redline does not own them. It owns one block inside them:
<!-- REDLINE:BEGIN — generated by Redline. Do not edit inside this block. -->
…
<!-- REDLINE:END -->- Every run replaces what is between the markers and leaves the rest of the file byte for byte. A file with no block gets one appended at the end.
- An edit inside the block is lost on the next run. That is what the marker line says, and why team rules go in
.redline/local.mdinstead. - If the markers are ambiguous (two
BEGINlines, anENDwithout aBEGIN, or markers below an unclosed code fence), Redline does not guess. It stops, names the file, and changes nothing in it.
The repository's own rules
.redline/local.md is yours: Redline reads it and never writes it. On every run it renders the file's content at the end of the block, after any org context sections, under a heading that tells the assistant which rules win:
---
# Repository-local rules
The rules below come from this repository's own `.redline/local.md`, not from the org
standard. Where one of them conflicts with anything above, the repository's own rules win
here. Everything above that they do not contradict still applies.
…your rules, as you wrote them…It goes into the always-on files: .github/copilot-instructions.md, AGENTS.md, CLAUDE.md and .cursor/rules/redline-core.mdc. The per-stack files do not carry it. Learn step 04 writes a team rule end to end.
The redline- prefix and pruning
Every file Redline owns whole has a name starting redline-. That prefix is what makes clean-up safe. On every run, Redline deletes any .github/instructions/redline-*.instructions.md or .cursor/rules/redline-*.mdc that the run did not produce: the stack left the profile, or the vendor was deselected. A file without the prefix in those folders is never touched.
A deselected vendor's shared file is handled differently: Redline takes its block out of AGENTS.md, CLAUDE.md or .github/copilot-instructions.md, and deletes the file only if nothing else is left in it. A file another selected vendor still writes is kept: deselect agents while claude stays, and AGENTS.md stays too. Slash command files follow the same rule.
How init picks the vendors
init takes the first of these that gives an answer:
--vendors, if you passed it.- The
vendorslist in.redline.json, if the repository was onboarded before. - Detection: the files the repository already has.
- Every vendor the organisation has enabled, if detection finds none of them.
Detection checks whether any of these paths exists:
| If the repository has | Selected |
|---|---|
.github/copilot-instructions.md or .github/instructions | copilot |
CLAUDE.md or .claude | claude |
AGENTS.md | agents |
.cursor/rules | cursor |
codex is never detected, because its file is AGENTS.md, which selects agents. The output is the same. A repository with only CLAUDE.md is detected as claude, which writes AGENTS.md as well. To add or drop a vendor later, re-run init with the full list you want; the new list replaces the recorded one.
Vendors the organisation turns off
Each vendor has an entry in standards/manifest.json, with a title and an enabled flag:
"cursor": {
"title": "Cursor rules",
"enabled": true
}enabled is a ceiling, checked on every render. A vendor set to false is never rendered, whatever --vendors or .redline.json says. The init menu still lists it, marked as not enabled for this organisation, so nobody wonders whether Redline forgot it. A repository that had it gets its files removed on the next run, by the same rules as a deselect. All five ship enabled; an organisation that publishes its own standards can switch one off there.
Slash commands and prompts
Redline ships three commands: redline-init, redline-review and redline-verify. Each adaptor that has a command format gets them in that format:
| Vendor id | Files | Frontmatter |
|---|---|---|
copilot | .github/prompts/redline-<name>.prompt.md | mode: agent, description |
claude | .claude/commands/redline-<name>.md | description |
cursor | .cursor/commands/redline-<name>.md | none |
agents and codex have no command format, so they get none. The body of every command file is the same, inside a marker block. The frontmatter sits above it, because the tools read it from the first line, with a comment saying the file is Redline's:
---
mode: agent
description: Review the current change against this repository's Redline standards and list the issues
# Managed by Redline; regenerate with `redline init` rather than editing here.
---
<!-- REDLINE:BEGIN — generated by Redline. Do not edit inside this block. -->
Review the engineer's change against the standards this repository carries, …
<!-- REDLINE:END -->If your team already has a command at one of these paths, Redline keeps your text and adds its block beside it, rather than overwriting it.
A local model is not an adaptor
redline review reviews a change on your machine. It builds its own prompt from the same standard, limited to the stacks your change touches, and with --engine api it sends that prompt to a model endpoint you name, which can be a local one such as Ollama. It does not depend on any assistant reading a file, so it has no vendor id. See Reviewing before you push. The home page shows the result: Copilot, Claude and a local model each report the same problem, tagged with the same rule id.
Related
- The output contract: the
Redline/<SEVERITY> [rule-id]:line every adaptor's rules tell the assistant to write. - Distribution and drift: how a standards change reaches these files in every repository, and how
redline verifynotices when they fall behind. - Add a vendor: write an adaptor for an assistant Redline does not support yet.