Skillpedia
الأمان41k · #6777

review-agent-setup

ما الذي تفعله

تضمن هذه المهارة أن يوافق إنسان على الإجراءات المهمة للروبوت، أي وكيل الذكاء الاصطناعي، قبل أن تحدث. وتنشئ سجلا آمنا وقابلا للتحقق يوضح من وافق على ماذا.

متى تستخدمها

  • ✓عندما يوشك الروبوت على التعليق على طلب دمج (pull request) أو الموافقة عليه أو دمجه.
  • ✓عندما سيغيّر الروبوت إعدادات التكامل المستمر (CI) المهمة.
  • ✓عندما سينشر الروبوت إصدارات جديدة للمشروع.

رابط المهارة

https://github.com/wshobson/agents/blob/main/plugins/review-agent-governance/skills/review-agent-setup/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/wshobson/agents/blob/main/plugins/review-agent-governance/skills/review-agent-setup/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“من فضلك وافق على المراجعة لهذا الكود.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تحتاج إلى إنشاء ملف خاص قبل إجراء الروبوت، ثم حذفه بعد ذلك. وهذا يعلن موافقتك. ويُنشأ لكل إجراء معتمد إيصال رقمي آمن.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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

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

2. Copy the default policy to your project

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

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 protect-mcp@0.7.4 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)

# 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:

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:

ls -la ./review-receipts/

Verify every receipt offline with the public key:

PUB=$(node -p 'JSON.parse(require("fs").readFileSync("./review-governance.key")).publicKey')
npx @veritasacta/verify@0.9.2 --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

# 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"

…
الأسئلة الشائعة

ما هي «طلبات الدمج» (pull requests)؟

هي طلبات لإضافة الكود أو تغييره في مشروع، وعادة يراجعها آخرون قبل قبولها.

ما هو CI؟

CI اختصار Continuous Integration، أي التكامل المستمر، وهو عملية تلقائية تختبر الكود عند تغييره للتأكد من أن كل شيء يعمل.

كيف أعرف أن الموافقة آمنة؟

كل موافقة تُنشئ إيصالا رقميا موقّعا بتقنية تُسمى Ed25519، يصعب تزويره ويمكن لأي شخص التحقق منه بالمفتاح العام.

التفاصيل

الوصف الأصلي من المؤلف

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.

repo: wshobson/agents

الشعبية

نجوم GitHub
41k
الترتيب
#6777
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة