К основному содержанию
скилл Claude Code CX Codex Cursor

review-agent-setup — скилл Claude Code: что делает и как установить

Скилл настраивает подтверждение действий ИИ-агента человеком перед ревью, слиянием PR и правкой CI. Каждое одобрение или отказ фиксируется криптографической подписью Ed25519.

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add wshobson/agents
/plugin install review-agent-governance@claude-code-workflows
Открыть на GitHub

Что делает review-agent-setup

Скилл внедряет авторизационные политики Cedar и хук PreToolUse для фильтрации действий агента. Под запрет попадают команды gh pr merge и любые правки файлов в .github/workflows/. По умолчанию доступ закрыт. Агент не сможет опубликовать релиз или оставить отзыв к пулреквесту без явного разрешения человека.

Для одобрения действия создается флаг touch ./.review-approved либо вызывается команда /approve-review. Чтобы подписывать квитанции, нужен ключ ./review-governance.key, создаваемый через npx [email protected] init. Успешные операции сохраняются в ./review-receipts/receipts.jsonl. Проверить их цепочку оффлайн позволяет утилита @veritasacta/[email protected]. Заблокированные попытки не выполняются, а их список выводит команда /list-pending.

Если агент занят только локальными правками кода и запуском тестов, инструмент окажется избыточным. Для базовых вызовов инструментов автор советует плагин protect-mcp. Настраивать этот скилл стоит тогда, когда ИИ отправляет команды в GitHub CLI или пушит код в ветку main.

Какие задачи решает

  • заблокировать несанкционированные вызовы gh pr review и gh pr merge
  • требовать ручное подтверждение перед изменением пайплайнов в .github/workflows/
  • формировать проверяемые квитанции с подписью Ed25519 для аудита действий агента
  • просматривать список заблокированных вызовов через команду /list-pending

Примеры запросов агенту

  • /approve-review "Reviewing PR #123 authored by contributor X"
  • /list-pending
  • Настрой политики review-agent-governance и сгенерируй ключ в ./review-governance.key

Как установить review-agent-setup

1Через маркетплейс плагинов

/plugin marketplace add wshobson/agents
/plugin install review-agent-governance@claude-code-workflows

2Через Skills CLI (Vercel)

npx skills add wshobson/agents --skill review-agent-setup -a claude-code

3Вручную: положить файлы

~/.claude/skills/review-agent-setup/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/review-agent-setup/

Похожие

git-guardrails-claude-code Matt Pocock Скилл ставит хук Claude Code, который останавливает опасные Git-команды до их запуска. Нужен, если агент не должен делать push или удалять изменения. Claude Code 499 069установок java-springboot официальный github Задаёт практики разработки Spring Boot-приложений: от структуры проекта до тестов и безопасности. Пригодится, когда Copilot пишет или проверяет Java-код. GitHub Copilot 21 272установок sql-code-review официальный github Проверяет SQL-код на проблемы безопасности, производительности и поддержки. Пригодится перед ревью запросов или схемы базы данных. GitHub Copilot 14 060установок postgresql-code-review официальный github Проверяет SQL и схему на ошибки, характерные для PostgreSQL. Пригодится перед ревью миграций, функций и запросов с JSONB. GitHub Copilot 12 608установок make-repo-contribution официальный github Скилл проверяет правила репозитория перед issue, веткой, коммитом или PR и помогает пройти процесс контрибьюции без пропуска обязательных шагов. GitHub Copilot 11 073установок agent-governance официальный github Добавляет шаблоны политик и проверок для ИИ-агентов с доступом к API, базам данных и файловой системе. Нужен, когда действия агента требуется ограничивать и журналировать. GitHub Copilot 9 623установок

Вопросы о review-agent-setup

Как установить review-agent-setup в Claude Code?

Введи /plugin marketplace add wshobson/agents и выполни /plugin install review-agent-governance@claude-code-workflows, либо запусти команду npx skills add wshobson/agents --skill review-agent-setup -a claude-code.

Что делает review-agent-setup?

Он блокирует критические операции агента вроде слияния PR, создания релизов или изменения CI-конфигураций. Действие выполняется только после ручного одобрения человеком.

Как проверить подписанные квитанции аудита?

Прочитай публичный ключ из ./review-governance.key и запусти npx @veritasacta/[email protected] --replay-chain ./review-receipts/receipts.jsonl --key "$PUB". Код возврата 0 подтверждает, что цепочка не была изменена.

Исходный текст

SKILL.md · MIT
---
name: review-agent-setup
description: Configure human-in-the-loop gating for AI agent review actions in Claude Code. Use when setting up a project where an agent may post PR reviews, comments, merges, or edit CI configuration, and you want a cryptographically auditable approval trail with Cedar-enforced gates.
---

# review-agent-governance — Setup

Gate AI agent review actions (PR reviews, comments, merges, CI edits) behind
explicit human approval. Every attempt, approved or denied, produces an
Ed25519-signed receipt.

## When to use this plugin

Install it in projects where a Claude Code agent:

- Reviews, comments on, or merges pull requests (`gh pr review`, `gh pr merge`)
- Triages issues (`gh issue comment`, `gh issue close`)
- Publishes releases (`gh release create`)
- Modifies CI configuration (`.github/workflows/`, `.gitlab-ci.yml`)
- Pushes to protected branches (`main`, `master`, `release`, `production`)
- Posts to external notification surfaces (Slack webhooks, Discord), once you
  add a rule for the command that posts (the default policy does not gate them)

If the agent is only doing local file edits and running tests, this plugin is
overkill. Use `protect-mcp` for general tool-call policy enforcement and skip
this one.

## One-time setup

### 1. Install the plugin

```bash
claude plugin install wshobson/agents/review-agent-governance
```

### 2. Copy the default policy to your project

```bash
cp .claude/plugins/review-agent-governance/policies/review-agent-governance.cedar \
   ./review-governance.cedar
```

You can edit this file to match your project's specific rules. See
`../agents/review-policy-author.md` for guidance on authoring review
policies.

### 3. Create a receipts directory and sign key

```bash
mkdir -p ./review-receipts
echo "/review-receipts/" >> .gitignore
echo "/review-governance.key" >> .gitignore
echo "/.review-approved" >> .gitignore
if [ ! -e ./review-governance.key ]; then
  d=$(mktemp -d) && npx [email protected] init --dir "$d" && mv "$d/keys/gateway.json" ./review-governance.key
fi
```

protect-mcp 0.7.4 `sign` does not create the key, so the last command creates
it, and it never replaces an existing key. Without a key, the receipts are
unsigned. To rotate the key, archive `./review-governance.key` and
`./review-receipts/receipts.jsonl` first, then run the command again. Give auditors the `publicKey`
value from `./review-governance.key`. Do not commit the file, because it also
holds the private key.

## Per-session workflow

The Cedar policy denies review-surface actions unconditionally. To approve
a specific action, open an approval window before it and close it after.

### Flag file (simplest)

```bash
# Before the action you want to approve
touch ./.review-approved

# Let Claude Code run the review / comment / merge

# Immediately after
rm ./.review-approved
```

### Slash command (from within Claude Code)

```
/approve-review "Reviewing PR #123 authored by contributor X"
```

This creates `./.review-approved` with the given reason embedded as a note,
and records the reason in an unsigned approval log under
`./review-receipts/approvals/`. A follow-up `rm` is still needed to close the
window.

### Dry-run everything (force full policy evaluation)

If you want every tool call to go through Cedar with no approval bypass:

```bash
export REVIEW_APPROVAL_FLAG=./.never-approve
```

Any tool call matching a forbid rule will be denied; approved windows have
no effect. Useful for CI or for a locked-down audit run.

## Verifying the receipts

List all receipts:

```bash
ls -la ./review-receipts/
```

Verify every receipt offline with the public key:

```bash
PUB=$(node -p 'JSON.parse(require("fs").readFileSync("./review-governance.key")).publicKey')
npx @veritasacta/[email protected] --replay-chain ./review-receipts/receipts.jsonl --key "$PUB"
```

Exit 0 means every receipt verified. Exit 1 means a receipt failed
verification, because it was tampered with, the key is wrong, or a line is
malformed. Exit 2 means the receipts file could not be read.

A denied call never runs, so it has no receipt. To see what the policy
blocked, run this inside Claude Code:

```
/list-pending
```

It lists the tool calls that the PreToolUse hook blocked in the current
session, with the tool name and the command or path.

## Example: approving a PR review

```bash
# 1. Human reviews the agent's proposed comment
$ /list-pending
  Blocked in this session:
  - Bash "gh pr review 42 --approve --body 'LGTM'"
  - Bash "gh pr comment 42 --body 'Looking good'"

# 2. Human decides the first one is appropriate, approves it
$ /approve-review "Approving LGTM on PR 42 after visual inspection"
  ./.review-approved created

# 3. Agent retries the action; this time it succeeds
$ agent: gh pr review 42 --approve --body "LGTM"
  [receipt appended to ./review-receipts/receipts.jsonl, decision=allow]

# 4. Human closes the window
$ rm ./.review-approved
```

The allowed call has a signed receipt that anyone with the public key can
verify offline. The denied attempt has no receipt, and the approval log is
not signed, so keep both in mind when you show the trail to an auditor.

## Composing with protect-mcp

If both plugins are installed, each plugin's `hooks/hooks.json` registers its
own PreToolUse hook, and Claude Code runs both on every tool call:

```json
{ "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/hooks/evaluate.sh" }
```

Each `evaluate.sh` reads `tool_name` and `tool_input` from the hook payload on
stdin (Claude Code sets no `TOOL_NAME` variable) and evaluates its own policy:
`./protect.cedar` for protect-mcp and `./review-governance.cedar` here.

Both hooks must pass for the tool call to proceed. Cedar deny in either
policy blocks it.

## Standards

- **Ed25519** — RFC 8032 (digital signatures)
- **JCS** — RFC 8785 (deterministic JSON canonicalization)
- **Cedar** — AWS's open authorization policy language
- **IETF draft** — [draft-farley-acta-signed-receipts](https://datatracker.ietf.org/doc/draft-farley-acta-signed-receipts/)

© Tom Farley · MIT · wshobson/agents

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой