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

+40 -22
View File
@@ -1,40 +1,58 @@
# codex-crew
Codex CLI как полноценный сабагент Claude Code: делегирование задач, ревью
кода, второе мнение. Наследует пользовательский `~/.codex/config.toml` (без
сандбоксов и ограничений), сессии resumable, зависания детектятся
детерминированным watchdog'ом.
Codex CLI as a first-class Claude Code subagent: task delegation, code
review, second opinion. Inherits the user's `~/.codex/config.toml` (no
sandboxes, no restrictions), sessions are resumable, hangs are detected by a
deterministic watchdog.
## Состав
## Contents
- `agents/codex.md` — сабагент-транспорт (sonnet). Держит codex-сессию:
follow-up через SendMessage продолжает тот же диалог. В задании обязателен
`cwd:`, опционально `codex options:` (модель/sandbox/effort) и
- `agents/codex.md` — transport subagent (sonnet). Holds the codex session:
follow-ups via SendMessage continue the same dialogue. The task must
include `cwd:`; optional `codex options:` (model/sandbox/effort) and
`review scope:`.
- `skills/codex-agent` — делегировать исполнение.
- `skills/codex-review` — ревью ветки/коммита/uncommitted/файлов.
- `skills/codex-consult` — второе мнение по спеке/плану, итерации до консенсуса.
- `scripts/codex-run.sh` — обвязка `codex exec --json` с watchdog'ом
(`CODEX_STALL_TIMEOUT`, default 600 c стагнации вывода → kill; сессия
продолжается через resume). Тесты: `tests/test-run.sh`.
- `skills/codex-agent` — delegate execution.
- `skills/codex-review` — review a branch/commit/uncommitted/files.
- `skills/codex-consult` — second opinion on a spec/plan, iterate to
consensus.
- `scripts/codex-run.sh` — wrapper around `codex exec --json` with a
watchdog (`CODEX_STALL_TIMEOUT`, default 600s of output stagnation → kill;
the session continues via resume). Tests: `tests/test-run.sh`.
## Установка
## How it works
The orchestrator spawns the `codex` subagent with a task. The subagent
writes a prompt file (transport preamble + task), launches `codex-run.sh`
in the background, and polls the status file.
Review mode: the codex CLI can't combine a scope flag
(`--base`/`--commit`/`--uncommitted`) with a custom prompt, so with a
non-empty prompt file the script translates the scope into prompt text
automatically; with no prompt file the native `codex exec review <scope>`
path is used.
Prompt convention: wrapper instructions outside, the codex task between
`=== TASK FOR CODEX ===` / `=== END TASK ===` markers — the wrapper forwards
only the marked block, so it never mistakes the task for its own job, and
wrapper instructions never leak into the codex prompt.
## Install
```
claude plugin marketplace add ~/Projects/codex-crew
claude plugin marketplace add <path-or-github-url>
claude plugin install codex-crew@codex-crew
```
Требуется codex CLI ≥0.142.
Requires codex CLI ≥0.142.
Обновление после push (CC сам кэш не перекачивает; `plugin update` сверяет
version из plugin.json — без бампа версии контент не подтянется):
Update after push (Claude Code doesn't re-fetch the cache; `plugin update`
compares the version from plugin.json — no version bump, no content update):
```
# 1. бампнуть version в .claude-plugin/plugin.json, закоммитить, запушить
# 1. bump version in .claude-plugin/plugin.json, commit, push
claude plugin marketplace update codex-crew
claude plugin update codex-crew@codex-crew
```
затем `/reload-plugins` или рестарт сессии (определения agents/skills
снапшотятся на reload; горячая правка кэша не работает).
then `/reload-plugins` or restart the session (agent/skill definitions are
snapshotted on reload; hot-patching the cache doesn't work).