fix: review mode works with prompts, anti-self-work contract, EN docs

- codex-run.sh review: CLI forbids scope flags + prompt (stdin '-' counts
  as [PROMPT]); translate scope into prompt text, native review only when
  prompt.md is empty. Add --skip-git-repo-check for consistency.
- agents/codex.md: marker contract (=== TASK FOR CODEX === / === END TASK ===,
  legacy RU markers accepted) so wrapper instructions never leak into the
  codex prompt and the wrapper never mistakes the task for its own job;
  self-check against doing the task itself; preamble now states codex is a
  subagent executor and process flows belong to the orchestrator; scope
  flags as separate args; no nohup; Read before rewriting prompt.md.
- skills: wrapper framing line + marker block in prompt templates.
- All instructions and README translated to English (RU trigger phrases
  kept in skill descriptions).
- tests: 3 new review-mode cases, ALL PASS.
- bump 0.1.2.
This commit is contained in:
admin committed 2026-07-28 19:12:19 +05:00
1 parent 0c355c4b9d
commit 54aabcab23
8 files changed
+292 -180

No files matched your search

+30 -22
View File
@@ -1,37 +1,45 @@
---
name: codex-review
description: Ревью кода силами Codex — ветка, коммит, uncommitted-изменения или произвольные файлы. Use when user says «ревью у кодекса», «пусть codex посмотрит ветку/коммит/файл», «codex review», «второй ревьюер».
description: Code review by Codex — branch, commit, uncommitted changes, or arbitrary files. Use when user says «ревью у кодекса», «пусть codex посмотрит ветку/коммит/файл», "codex review", "second reviewer".
---
# Ревью через Codex
# Review via Codex
Спавни сабагента `codex`. Скоуп задаёт режим:
Spawn the `codex` subagent. The scope sets the mode:
- ветка против базы: `review scope: --base main`
- один коммит: `review scope: --commit <sha>`
- незакоммиченное: `review scope: --uncommitted`
- произвольные файлы / абстрактный скоуп: БЕЗ `review scope:` — обычное
задание «сделай ревью файлов X, Y и их производных».
- branch vs base: `review scope: --base main`
- single commit: `review scope: --commit <sha>`
- uncommitted: `review scope: --uncommitted`
- arbitrary files / abstract scope: WITHOUT `review scope:` — a plain task
"review files X, Y and their dependents".
## Промпт сабагенту — обязательные части
## Subagent prompt — required parts
- `cwd: <абсолютный путь репозитория>` (review работает от cwd)
- `review scope: ...` (если применимо)
- Фокус, если есть: безопасность / перфоманс / корректность / всё.
- Формат находок: `file:line — 🔴|🟡|🔵 — проблема — предлагаемый фикс`,
без похвал и пересказа кода.
- First line — framing for the wrapper: "You are a wrapper around the codex
CLI: do not solve the task yourself, launch codex and return its answer +
thread_id".
- `cwd: <absolute repo path>` (review works from cwd)
- `review scope: ...` (if applicable)
- Focus and format — in a block between markers `=== TASK FOR CODEX ===` and
`=== END TASK ===`:
- Focus, if any: security / performance / correctness / everything.
- Findings format: `file:line — 🔴|🟡|🔵 — problem — suggested fix`, no
praise, no code retelling.
## Пример
## Example
```
cwd: /home/smartass/Projects/proxy-gate
You are a wrapper around the codex CLI: do not solve the task yourself, launch codex and return its answer + thread_id.
cwd: /abs/path/to/repo
review scope: --base main
Фокус: корректность и безопасность.
Формат находок: file:line — 🔴|🟡|🔵 — проблема — фикс. Без похвал.
=== TASK FOR CODEX ===
Focus: correctness and security.
Findings format: file:line — 🔴|🟡|🔵 — problem — fix. No praise.
=== END TASK ===
```
## После
## After
- Находки отдай юзеру / обработай по задаче.
- Спорная находка → SendMessage в ту же сессию: попроси обосновать или
показать репро. Не принимай и не отвергай молча.
- Hand the findings to the user / process per the task.
- Contested finding → SendMessage to the same session: ask to justify or
show a repro. Don't silently accept or reject.