robin
AGENTS.md65 starsChanged 5 months agoMITView on GitHub
Use this file when adding Robin to another repository. Default (latest): Floating v2 workflow ref: The reusable workflows at main, v2 and v2.12.4 call antongulin/robin@main internally. A workflow tag or SHA pins only that workflow, not the nested action. For a direct action step, antongulin/robin@main follows main and @v2 follows the latest v2 release; an exact action release or full SHA pins its implementation. Do not present a reusable-workflow pin as an implementation pin. Unset agent-mode defaults to auto on…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
Use this file when adding Robin to another repository.
- Distinctive: line 23
Do not present a reusable-workflow pin as an implementation pin.
- Distinctive: line 146
Merge strategy: Use squash merges for cohesive PRs.
- Distinctive: line 149
Verification: Run the existing checks before pushing:
- Very specific: line 160
Keep action inputs, reusable-workflow workflow_call inputs, the with: forwarding in review.yml, the installer template, and the docs in …
- Very specific: line 170
Estimated request budget: Default off (no estimate, provider/model output default).
- Distinctive: line 220
Usage reporting: Keep accounting below both retry loops and observe before extraction or awaited stream progress.
- Very specific: line 226
Only the action output omits model labels: requested_model: null, model_groups: [], with removed groups added to model_groups_omitted.
- Very specific: line 276
Keep the generated format (version heading with compare link, ### Features / ### Bug Fixes / ### Documentation sections).
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Instructions for AI coding agents
Use this file when adding Robin to another repository.
Required workflow reference
Default (latest):
uses: antongulin/robin/.github/workflows/review.yml@mainFloating v2 workflow ref:
uses: antongulin/robin/.github/workflows/review.yml@v2The reusable workflows at main, v2 and v2.12.4 call antongulin/robin@main
internally. A workflow tag or SHA pins only that workflow, not the nested action.
For a direct action step, antongulin/robin@main follows main and @v2 follows
the latest v2 release; an exact action release or full SHA pins its implementation.
Do not present a reusable-workflow pin as an implementation pin.
Unset agent-mode defaults to auto on main and from v2.13.0. Keep the action and
workflow input defaults blank so base-branch .github/robin.yml can select off.
Explicit mode input overrides that config. For weak/local/small-context models,
recommend explicit off until tool behavior, quality and context capacity have been
checked; fallback is bounded and can fail. See migration guidance.
Do not use
@v0,v0, or anyv0release tag — workflows fail or point at stale code.pull_request_target— not supported; security risk with secrets.synchronizeonpull_requestunless the user explicitly wants review on every push.
Required secrets (in the consumer repo)
| Secret | Purpose |
LLM_API_KEY | Provider API key |
LLM_BASE_URL | OpenAI-compatible base URL |
LLM_MODEL | Model id |
Optional custom identity: reusable-workflow callers may pass ROBIN_TOKEN. Omitted
or empty keeps github.token; do not add it to default installer templates. GitHub App
examples must create and use their token in the same job via the direct action, never
pass a masked token through job outputs. See Custom review identity.
Free OpenRouter example:
LLM_BASE_URL:https://openrouter.ai/api/v1LLM_MODEL:openrouter/free
Minimal consumer workflow
Create .github/workflows/robin.yml:
name: Robin
on:
pull_request:
types: [opened, reopened, ready_for_review]
issue_comment:
types: [created]
permissions:
actions: read
contents: read
pull-requests: write
jobs:
review:
uses: antongulin/robin/.github/workflows/review.yml@main
secrets:
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
LLM_MODEL: ${{ secrets.LLM_MODEL }}Permissions
The job needs:
permissions:
actions: read
contents: read
pull-requests: writeactions/checkout is optional for review-only workflows.
Maintainers: project map and verification
Everything above is for adding Robin to a consumer repo. This section is for agents working in this repository. It is a concise operating map, not a task log; keep run evidence in task records outside the tracked tree.
Layout. src/ is the GitHub Action (compiled into the committed dist/index.js).
action.yml is the action input/output contract; .github/workflows/review.yml is the
reusable workflow consumers call; templates/robin.yml, scripts/install.sh, and
bin/robin-review.js are the shipped installer surfaces; docs/ and README.md are the
user documentation; skills/robin/ is the companion chat skill shipped for coding agents.
| Path | Owns |
src/main.ts | Entry point: event/trigger policy, input parsing, orchestration |
src/git-utils.ts, src/native-diff.ts, src/native-process.ts | PR diff API, authenticated native Git fallback, and owned process-group lifecycle; see runner and coverage limits in docs/ADVANCED.md |
src/llm-client.ts, src/llm-retry.ts, src/llm-provider.ts | LLM request shape, retries, provider detection |
src/request-budget.ts | Complete serialized-request estimate, typed preflight rejection and output reserve; guard before physical-attempt accounting |
src/usage-report.ts | Passive per-invocation physical-attempt ledger, safe metric coverage, isolated Actions/local reporting |
src/repo-config.ts | .github/robin.yml parsing and input-vs-config resolvers |
src/agent-review.ts, src/review-tools.ts, src/repo-snapshot.ts | Multi-turn agent review and its read-only tools |
src/prompts/, src/review-parser.ts | Review prompts, JSON schema, response parsing |
action.yml, .github/workflows/review.yml | Action inputs and reusable-workflow schema (forwarded 1:1) |
docs/, README.md, llms.txt | User-facing setup, behavior, and troubleshooting |
docs/assets/brand/, src/brand.ts | Compact artwork copies/provenance and shared GitHub heading |
scripts/release-control.cjs, .github/workflows/release.yml, .github/workflows/publish.yml | Trusted release selection, approval waiting, immutable verification/publication, and npm tag/version guard; maintainer recovery in CONTRIBUTING.md |
src/release-control.test.ts, src/release-workflow.test.ts, testdata/release-tools.cjs | Offline release state/process fixtures and workflow contracts; fixtures must never invoke live publication |
Brand ownership. The website owns artwork masters and deterministic exports at
https://www.robinreview.dev/brand/. Core keeps exact lightweight copies and source
credits in docs/assets/brand/; refresh them from the website build rather than adding
an image generator here. Use the full bird for introductory artwork and the head for
small marks. Every action-authored top-level GitHub body (initial, progress, completed,
failed, skipped, cancelled, superseded, review, summary and help) uses the shared
buildRobinHeader: one decorative bird followed by plain The, linked Robin,
and plain Hood of code review. Only Robin links to https://www.robinreview.dev/;
the decorative image stays outside the link with empty alt text.
A summary suffix may follow the heading. Include the exact ROBIN_SIGNATURE
(:bow_and_arrow: Robin) once in a hidden HTML comment for compatibility; keep
recognition behavior and the reviewer re-export unchanged. Inline finding labels
stay plain, with no decorative image or tagline. CLI/install/setup/update prefixes
use plain Robin:, with no HTML, image or tagline.
Documentation ownership. This root AGENTS.md is the documentation contract for the whole
repository: the source, workflow, docs, and skill surfaces above share this single ownership
boundary, so there are no child AGENTS.md files. Add a child AGENTS.md only when a subtree
grows its own stable contract that the root index no longer covers cleanly. The index follows the
structure guidance of agent0ai/dox at pinned revision
765ae4ac
(MIT, Copyright 2026 Agent Zero).
Merge strategy. Use squash merges for cohesive PRs; squash is the repository's only enabled merge method.
Verification. Run the existing checks before pushing:
npm ci
npm test # Jest + ts-jest
npm run lint # eslint src/**/*.ts
npx --no-install tsc --noEmit
actionlint -shellcheck= -pyflakes= .github/workflows/*.yml testdata/consumer-workflows/*.yml
npm run build # tsc + ncc; commit the regenerated dist/index.jsKeep action inputs, reusable-workflow workflow_call inputs, the with: forwarding in
review.yml, the installer template, and the docs in sync — src/workflow.test.ts guards
that parity. Behavior changes that touch optional request parameters should not silently
drop a user-configured control; surface the provider error instead.
Diff input fails closed: every model request receives the complete filtered diff or the run
fails before that request, reporting the observed size, the cap that applied, and how to fix
it (src/input-limit.ts). Do not reintroduce truncated diff input or claim that agent tools
recover dropped hunks; commit the rebuilt dist/index.js with the change.
Estimated request budget. Default off (no estimate, provider/model output default);
a numeric budget enables utf8-json-div3-v1, which counts ceil(complete final SDK JSON
UTF-8 bytes/3), plus actual output cap and ceil(budget/16) safety. Derived output scales
up to 32000; raw diff caps default 500000. Blank metadata inherits base config; explicit
values, including old 50000, win. Guard every rebuilt body before ledger begin, including
stream/private replay/tools/schema. Typed preflight errors bypass retries; bounded agent
compaction may recover. No diff clipping, no silent output-cap dropping/clamping. Guard
off plus absent explicit output keeps the provider/model request shape. Keep estimates
separate from provider usage; no prompt/private/source text in budget diagnostics. See
docs/ADVANCED.md#estimated-request-budget.
Agent context and deadline. Measure working history as the positive difference in
serialized pretty-JSON UTF-8 bytes between the current conversation and the immutable
system prompt plus original review input; a large diff must never trigger cleanup by
itself. The soft target (DEFAULT_AGENT_CONTEXT_BYTES, 450000) is independent of diff
size. Cleanup elides only tool results a later assistant turn already consumed, then
allows at most one semantic rebuild per evidence epoch. Send the full transcript to the
summary unclipped, accept notes only up to 12000 UTF-8 bytes, and commit only when the
candidate fits the target and is strictly smaller; otherwise keep the previous state.
Bound each logical request to one initial dispatch plus at most two strictly smaller
recovery dispatches, with the target halving mutable history and tightened by an explicit
budget excess. There is no lifetime compaction ceiling, and compactions counts committed
rebuilds only. A default/off run may still send an accepted request above the soft
target; proactive cleanup never fails the review on its own. The total deadline includes a
finalization reserve (min(120000 ms, 10% of the budget)), aborts each in-flight request
at its own deadline, dispatches nothing after it, and gives unrun tool calls explicit
not-executed results. See
docs/ADVANCED.md#agent-mode-multi-turn-review-with-repository-context.
Agent read exclusions and final repair. read_file resolves the path first, so a
missing or outside path keeps its own error, then returns a plain notice (no Error:
prefix) when the lexical requested form or the resolved repository-relative path matches a
built-in DEFAULT_SKIP_PATH_PATTERNS exclusion; the notice names the matched path and
pattern and ends by pointing to the source or manifest, or, for a small text file that
grep can search (not *.min.js/*.min.css, no line over 2000 characters), to grep
with that exact path. resolve() shares that lexical cleanup and stays byte-identical,
grep and list_files keep their walk-based exclusions, and repository skip-paths still
filters only the diff. After a forced final answer that has text but that a silent
ReviewParser.parseDetailed(content, { quiet: true }) plus shouldRetryStructuredReview
rejects, repairFinal sends one extra logical toolChoice: "none" request in the same
conversation with FINAL_REPAIR_PROMPT (with the usual bounded recovery dispatches); a
parseable reply replaces the answer and every failure, deadline or unparseable reply keeps
the original. The natural finish and an empty answer are never repaired. Once attempted,
the repair counts one agent turn in turns (usage: forced-final phase, next
agentTurn), even if a deadline or local budget rejection stops it before dispatch. It
never advances the progress turn number, and logs
exactly one decision line starting with Final review repair (the failure case is the
warning Final review repair failed (...)). A caller cancellation during the repair still
ends the run. See docs/ADVANCED.md#investigation-and-limits.
Usage reporting. Keep accounting below both retry loops and observe before extraction or
awaited stream progress. Pass phase context explicitly; never send it to the provider.
Preserve unknown/nonfinal coverage and preceding attempts; cached/reasoning counts stay
breakdowns. Reporting is passive and nonfatal, with allowlisted metadata only. Keep
usage-report action -> job -> workflow output wiring intact. usage-report-path is a
same-job runner-local ledger, not a caller artifact. See docs/ADVANCED.md#llm-usage-reports.
Only the action output omits model labels: requested_model: null, model_groups: [],
with removed groups added to model_groups_omitted. Preserve all other fields and
counts; summary/local reports retain sanitized model metadata.
Redact explicitly supplied credentials, including short keys. Keep the omitted-key
input blank so the public ollama fallback sent to the SDK does not suppress report identifiers.
Private assistant replay. Preserve a provider-supplied string reasoning_content
as private completion metadata, including empty strings and streamed string deltas.
Replay it unchanged only on its own assistant message: tool turns (including retained
compaction tails and forced-final requests) and, in the final-answer repair request, the
forced final answer that request sends back. Omit absent
or invalid values. Keep it out of summary prompts, progress/status updates, Robin logs, and
visible reviews; use content for review text. Provider error bodies can echo credentials
or replay data: retain native causes internally for classification, but use controlled
failure categories and numeric HTTP status in LLM errors, logs and progress updates. Do not
publish raw provider messages, including compatibility and tool-support errors.
Empty-response logs and failure messages use known completion-reason labels or unknown for
invalid values.
Low-level SDK debug logging can expose raw payloads.
Host-scoped provider handling. A provider-specific request shape or error adaptation keys on
that provider's official endpoint only (OpenCode Go https://opencode.ai/zen/go/v1, Mistral
https://api.mistral.ai/v1); every other host keeps the default shape and today's SDK errors.
Mistral error-body normalization (normalizeMistralErrorBody, applied through the client's SDK
subclass) handles only 400/422 bodies of the form {object:"error", message}, never copies the
input echo, and passes 429/5xx through. Array content is read from text parts only where the
string or tool-call result would otherwise be empty; thinking parts are never published or kept as
reasoning_content. src/llm-mistral.test.ts T2/T8 pin today's request bodies and SDK errors for
non-Mistral hosts; keep them unedited.
Installers preserve complete custom identity workflows (explicit token mappings, App
token steps, or inherited secrets), including their refs, rather than reconstructing
them. Keep the shell and npm preservation tests in sync. The website's public/install.sh
is a shipped copy of scripts/install.sh; publish matching changes in robin-website.
Maintainers: release-notes upkeep (automatic)
Whenever an approved chore: release X.Y.Z PR merges and the workflow publishes
the GitHub release, clean up its notes as part of
the same task — do it automatically, without asking.
- Inspect every release cut during the session:
gh release view <tag> --json body. - Enrich each
feat/fixentry with a one-line plain-language user impact, and credit external contributors (— thanks [@login](https://github.com/login)!). - Catch orphaned commits: a commit that lands on
mainbetween the release PR's snapshot and its merge appears in no changelog. Comparegit log <prev-tag>..<tag> --onelineagainst the notes and add missing entries under the matching section. - Edit only the GitHub release (
gh release edit <tag> --notes '…'). Never rewriteCHANGELOG.mdretroactively — a changelog commit itself triggers another release. - Keep the generated format (version heading with compare link,
### Features/### Bug Fixes/### Documentationsections). Never create tags or releases by hand, and never delete a published release.
Further reading
- README.md — human-friendly setup
- docs/ADVANCED.md — all inputs and patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

