Логотип Diff Review

Diff Review

Сообщество
robbyt
diff-review

Get Codex's code review of git changes via the Codex MCP server. Trigger when user wants a second opinion on code changes ("have Codex review my changes", "get code review from Codex", "review this diff with Codex"), or as a final check before committing.

Обзор

Издательrobbyt
Репозиторийclaude-skills
Название навыкаdiff-review
Звёзды
42
Форки
2
Встроенные файлы
Только инструкции
Ссылки
  • Инструкции в формате Markdown

    Файл SKILL.md, который модель загружает по необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Опубликовано на GitHub: robbyt. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Diff Review в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/robbyt/claude-skills/tree/main/plugins/codex/skills/diff-review
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Новый навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/robbyt/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/plugins/codex/skills/diff-review .claude/skills/diff-review
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Diff Review в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Diff Review, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Diff Review не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими API-ключами.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Diff Review via Codex

Use Codex to review git changes for bugs, security issues, and style problems. Codex consults; Claude writes.

Transport

Always use the MCP tool. The plugin's MCP server (scripts/codex-mcp-server.mjs, started from .mcp.json) runs codex exec for each call. Tool name: mcp__plugin_codex_cli__codex. If the example below errors with an unknown-tool error, run /mcp and substitute the actual prefix (e.g., mcp__codex_cli__codex).

Model

Pin model: "gpt-6-sol" with config: { "model_reasoning_effort": "medium" } for non-trivial diffs. For small diffs (~< 100 changed lines, single function, no security surface) use model: "gpt-6-luna" with config: { "model_reasoning_effort": "low" } to save quota. Security- or performance-focused reviews always stay on gpt-6-sol at medium — don't downgrade. Set model+effort on the opening call only; codex-reply reuses them unless you escalate. See ../references/patterns.md → Models and Reasoning effort. Escalate to gpt-6-astra (pass model + config on the codex-reply) from round 3, when a disagreement survives a round, or when re-reviewing the same diff in a fresh thread — see ../references/patterns.md → Escalating to gpt-6-astra.

Flow

Codex reads files from the project root. Save the diff to a file there first:

bash
git diff --cached > codex-review.diff

Then:

mcp__plugin_codex_cli__codex({
  "prompt": "<task>\nReview codex-review.diff for bugs, security issues, and missing error handling. Read the surrounding source files as needed.\n</task>\n\n<structured_output_contract>\nFindings ordered by severity (critical, high, medium, low). For each: file:line, the problem, why it matters, and a concrete fix. If there are no material findings, say so in one line.\n</structured_output_contract>\n\n<grounding_rules>\nGround every finding in the diff or files you read. Label inferences. Skip style nits unless they hide a bug.\n</grounding_rules>\n\n<dig_deeper_nudge>\nAfter the first issue, check error paths, empty state, retries, and concurrency before finishing.\n</dig_deeper_nudge>",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})

For a large diff, run the review through the codex:consult agent in the background (run_in_background: true); multi-file reviews can take several minutes. To challenge whether the change should ship at all (design, assumptions, failure modes) rather than find defects, use codex:adversarial-review.

Clean up after:

bash
rm codex-review.diff

Patterns

Uncommitted (staged + unstaged):

bash
git diff HEAD > codex-review.diff

git diff never includes untracked files. If git status --short shows new files that belong to the change, run git add -N <file> first so they appear in the diff.

Branch vs base:

bash
git diff main...HEAD > codex-review.diff

Specific commit:

bash
git show <sha> > codex-review.diff

Focused reviews

Security focus:

mcp__plugin_codex_cli__codex({
  "prompt": "Security review of codex-review.diff:\n- XSS vulnerabilities\n- SQL/command injection\n- Sensitive data exposure\n- Auth/authz issues",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})

Performance focus:

mcp__plugin_codex_cli__codex({
  "prompt": "Performance review of codex-review.diff:\n- Inefficient algorithms\n- N+1 queries\n- Memory leaks\n- Blocking operations",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})

Iterative workflow (prefer codex-reply)

When you're still working on the same diff, continue the existing thread rather than starting a new codex call. Codex keeps the diff and its prior findings in context; fresh calls lose that.

Typical loop: initial review → Claude implements a fix → codex-reply asking "does the revised code still have the issue?" → Codex confirms or flags new concern → repeat.

Cap at 3–4 rounds total, and run round 3 onward on gpt-6-astra. Diff reviews should converge fast; if you're still going at round 5, stop and surface the remaining disagreement to the user rather than letting the two models debate indefinitely.

threadId is an MCP argument — pass it as the threadId field of codex-reply, not in the prompt text. See ../references/mcp-schema.md for wrong-vs-right examples.

Example — three rounds on the same diff:

# Round 1 — initial review (opening call pins model + effort)
mcp__plugin_codex_cli__codex({
  "prompt": "Review codex-review.diff for bugs, security issues, and missing error handling.",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})
# → threadId: "019da14b-..."  /  flags: "parseToken doesn't handle malformed JWTs — will throw unhandled."

# Round 2 — Claude fixes and re-exports the updated diff
git diff --cached > codex-review.diff
mcp__plugin_codex_cli__codex-reply({
  "threadId": "019da14b-...",
  "prompt": "I've re-written codex-review.diff with a fix — please re-read the file. I added a try/catch around parseToken that returns 401 on any JWT parse error. Does this address your concern?"
})

# Round 3 — triage; escalate to gpt-6-astra (the thread keeps its history)
mcp__plugin_codex_cli__codex-reply({
  "threadId": "019da14b-...",
  "prompt": "Of the remaining issues, which are merge-blockers vs. nits we can defer?",
  "model": "gpt-6-astra",
  "config": { "model_reasoning_effort": "medium" }
})

Start a fresh thread when: reviewing a different diff, the threadId is no longer in context, or the diff has diverged so much that re-priming is cleaner than incremental updates. See ../references/patterns.md.

Built-in codex review subcommand

Don't use this by default — the MCP flow above is the standard path. codex review is a separate, specialized diff-review subcommand that runs in Bash, doesn't go through MCP, and doesn't support --sandbox. Only reach for it when the user explicitly asks for Codex's built-in review output, or when MCP is unavailable:

bash
codex review --uncommitted
codex review --base main
codex review --commit <sha>

Requires dangerouslyDisableSandbox: true.

After the review

Codex's findings are a second opinion, not a merge gate — weigh them, don't rubber-stamp them.

  • Relay what Codex found to the user; don't silently fold its notes into your own review as if they were your conclusions.
  • Verify before fixing. Codex can raise false positives or miss context it never saw (see ../references/patterns.md → Validation). Confirm each issue against the actual code before changing anything.
  • Separate merge-blockers from nits, and surface genuine disagreements to the user rather than looping with Codex to force consensus.
  • Present findings in severity order with Codex's file:line references, then stop and ask the user which ones to fix. Don't apply fixes automatically. See ../references/patterns.md → Presenting results.

Safety

  • Always sandbox: "read-only".
  • Never use workspace-write, danger-full-access, or --dangerously-bypass-approvals-and-sandbox.
  • Remember to clean up the temporary diff file.

Fallback (rare)

If the MCP server is unavailable, see ../references/commands.md for the Bash codex exec form. Requires dangerouslyDisableSandbox: true.

Часто задаваемые вопросы

Что делает навык ИИ Diff Review?

Get Codex's code review of git changes via the Codex MCP server. Trigger when user wants a second opinion on code changes ("have Codex review my changes", "get code review from Codex", "review this diff with Codex"), or as a final check before committing.

Зачем использовать Diff Review в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Diff Review — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Diff Review в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/robbyt/claude-skills/tree/main/plugins/codex/skills/diff-review. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Diff Review?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Diff Review?

С любым количеством. Если модель поддерживает навыки, вы можете использовать с ней Diff Review: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama и другие — всё в TypingMind с вашими собственными ключами API.

Бесплатен ли навык ИИ Diff Review?

Навык опубликован на GitHub автором robbyt. Условия лицензии можно найти в репозитории. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это многоразовый набор инструкций, который объясняет модели ИИ, как выполнять конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты для вызова — код, который где-то выполняется и возвращает результат. Навык ИИ вместо этого даёт модели знания и порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇