review-guard AGENTS.md

Repository instructions for ReviewGuard, a TypeScript service that lets agents review GitHub pull requests under a safety boundary. In its default mode, reviews remain drafts; submitting them requires explicit permission.

In plain words
What is it for?
Use them when developing or reviewing ReviewGuard, especially its GitHub integration, draft and submission modes, GraphQL and REST code, transports, and contribution workflow.
Why use it?
They explain the project's architecture, review restrictions, supported transports, and authoritative documentation. This helps contributors change the service without bypassing safeguards or putting GitHub API code in the wrong place.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/eclipsesource/review-guard/agents-md
Clone the repo
git clone --depth 1 https://github.com/eclipsesource/review-guard

Made for: Codex, OpenCode.

Per session 1,854 This file is loaded in full into every session.
When invoked 1,854 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01854 $0.01854
Opus 5 $0.00927 $0.00927
Sonnet 5 $0.00371 $0.00371
Haiku 4.5 $0.00185 $0.00185

Measured 2d ago against content hash d4822e364a9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

review-guard AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 35 lines

How it starts

The opening of the file, as written. The whole thing — 35 lines — stays where its author put it; the contents beside it link to each section on GitHub.

For everything not covered here, the human-facing docs are authoritative: see README.md for modes, tools, flags, and usage, and CONTRIBUTING.md for the development setup, the script list, and the release process.

Project overview

ReviewGuard MCP (npm package @eclipsesource/review-guard-mcp, binary review-guard-mcp, MCP server name review-guard) is a TypeScript MCP server that lets AI agents work on GitHub PR reviews behind a safety boundary. In the default pending mode agents read PR discussion context and create draft (pending) reviews but cannot submit them. In the opt-in submit mode (--allow-submit) an agent may also submit the review, restricted to an allowed action set and always prefixed with a fixed disclaimer. Two transports: stdio (for IDE-managed lifetime) and HTTP (remote server).

Architecture

  • src/github.ts: GitHubReviewClient class. The ONLY file that touches GitHub APIs. Uses GraphQL for resolved review-thread context and mutations, and REST for review summaries and general PR comments. Review-thread comments (GraphQL reactionGroups) and conversation comments (REST reactions) expose a normalized reactions map (content -> count, e.g. THUMBS_DOWN) so agents can see downvotes. Thread isResolved/resolvedBy are also returned. Review comments, review summaries and conversation comments all carry their GitHub permalink as url, so an agent can link an earlier discussion (a thread's permalink is its first comment's url). The field is named url everywhere even though it comes from GraphQL url for review comments and REST html_url for the REST-sourced ones, since the output shape should be more consistent than the GitHub API is. A pending review comment already carries its final permalink, which starts resolving when the review is submitted, so an agent can cross-link its own findings while drafting. The ReviewComment.url doc comment and the pending tool descriptions say so, and the integration suite asserts that a comment's permalink survives submission unchanged. Safety boundary: comment/thread mutations exclude the event field, a post-creation tripwire verifies PENDING state (its error message tells the agent to stop and alert the human, since many MCP clients do not surface tool errors), and write operations are limited to the authenticated user's review. Submission is gated: submitReview (the only place submitPullRequestReview is called) refuses any action not in the allowSubmit set passed to the constructor, and always prefixes the review body with the fixed submitBody (an optional caller additionalBody is appended below it, never replacing it). Thread resolution is gated too: resolveReviewThread runs only when allowResolve is set AND the thread's first comment is authored by the authenticated user (it refuses others' threads), so a bot can tidy up its own now-fixed findings but not close anyone else's conversations. PR scoping is enforced here too: when the client is constructed with a scope (owner/repo/PR), every public method calls assertInScope and refuses input targeting a different PR/repo, and resolveReviewThread verifies the thread's PR matches the scope. This is the authoritative boundary. The server-side schema change is convenience on top of it.
  • src/server.ts: createMcpServer(client) factory. Registers get_pr_review_context, list_pending_review, add_review_comments, modify_review_comment, and delete_pending_review with Zod schemas. Additionally registers submit only when client.allowedSubmitActions is non-empty (its action enum is restricted to that set), and resolve_review_thread only when client.resolveEnabled (started with --allow-resolve). When client.scopedPullRequest is set, the PR tools omit their owner/repo/pull_number arguments and act on the scoped PR implicitly. Shared by both transports.
  • src/stdio.ts: Stdio transport entry point. Connects the MCP server to stdin/stdout for IDE-managed lifetime (Theia, VS Code).
  • src/http.ts: HTTP transport. A plain node:http server exposing stateless Streamable HTTP at /mcp (POST only, GET/DELETE return 405, other paths 404). No web framework: the MCP transport parses the request body and enforces the Host header itself. Receives { port, host } from the entry point and binds that address (default 127.0.0.1). Validates the Host header of incoming requests (DNS rebinding protection): loopback aliases only for a loopback bind, plus the bind address and the container-runtime host names (host.docker.internal, host.containers.internal) for a non-loopback bind.
  • src/index.ts: Thin dispatcher. Parses the CLI via parseCliOptions, resolves the GitHub token, applies the default submit disclaimer, creates the client, then delegates to --stdio or HTTP mode.
  • src/args.ts: parseCliOptions, the single place that knows every CLI flag. Accepts --flag value and --flag=value. Throws CliUsageError on unknown flags, missing values, or duplicates (the entry point prints it and exits non-zero), so a typo'd hardening flag (e.g. the --repo/--pr scope) can never be silently ignored.
  • test/: vitest suite. args.test.ts covers CLI validation. github.test.ts covers the safety gates (submit refusal, fixed-body prefixing, scope assertion, own-thread resolve, PENDING tripwire) with mocked gql/octokit internals. server.test.ts covers tool registration and dispatch over an in-memory MCP transport. server-json.test.ts covers the MCP Registry entry (see Key conventions). Changes to the safety boundary must keep this coverage. test/integration/review-guard.itest.ts is a manual end-to-end suite (npm run test:integration, own config in vitest.integration.config.ts) that drives every tool against a real GitHub repository with two accounts and verifies the results through direct API reads. It is excluded from npm test and CI, setup is documented in CONTRIBUTING.md.

Read the full file on GitHub · 35 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 35 lines · 1,854 tokens per session scan A d4822e364a9e

Subscribe to this mod's changes

review-guard AGENTS.md is an instructions file published in the GitHub repository eclipsesource/review-guard (4 stars, last pushed 6d ago), licensed MIT. It adds 1,854 tokens to every session, about $0.0093 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens