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:
1 parent
0c355c4b9d
commit
54aabcab23
8 files changed
+292
-180
No files matched your search
+36
-22
@@ -1,35 +1,49 @@
|
||||
---
|
||||
name: codex-agent
|
||||
description: Делегировать Codex'у исполнение — написать код, починить баг, исследовать. Use when user says «отдай кодексу», «пусть codex сделает/напишет/починит», «делегируй в codex», or when a plan step is assigned to Codex as the implementer.
|
||||
description: Delegate execution to Codex — write code, fix a bug, research. Use when user says «отдай кодексу», «пусть codex сделает/напишет/починит», «делегируй в codex», "delegate to codex", or when a plan step is assigned to Codex as the implementer.
|
||||
---
|
||||
|
||||
# Делегация задачи Codex
|
||||
# Delegating a task to Codex
|
||||
|
||||
Спавни сабагента `codex` (Agent tool). Он держит живую codex-сессию:
|
||||
доработки и ответы на его вопросы — SendMessage тому же агенту, НЕ новый спавн.
|
||||
Spawn the `codex` subagent (Agent tool). It keeps a live codex session:
|
||||
refinements and answers to its questions go via SendMessage to the same
|
||||
agent, NOT a new spawn.
|
||||
|
||||
## Промпт сабагенту — обязательные части
|
||||
## Subagent prompt — required parts
|
||||
|
||||
- `cwd: <абсолютный путь проекта>`
|
||||
- Задание: что сделать. Конкретно, с релевантными файлами/путями.
|
||||
- Критерии приёмки: что должно работать, какие тесты/команды пройти.
|
||||
- Что вернуть: отчёт, список тронутых файлов, как проверено.
|
||||
- Опционально: `codex options: -m o3 -s read-only ...`
|
||||
- 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". Without it the wrapper may take the task as its own and do it
|
||||
instead of codex.
|
||||
- `cwd: <absolute project path>`
|
||||
- The task — in a block between markers `=== TASK FOR CODEX ===` and
|
||||
`=== END TASK ===`: the wrapper forwards only this block to codex, so your
|
||||
wrapper instructions don't leak into the prompt. Inside the block:
|
||||
- Task: what to do. Concrete, with relevant files/paths.
|
||||
- Acceptance criteria: what must work, which tests/commands must pass.
|
||||
- What to return: report, list of touched files, how verified.
|
||||
- Optional: `codex options: -m o3 -s read-only ...`
|
||||
|
||||
## Пример
|
||||
## Example
|
||||
|
||||
```
|
||||
cwd: /home/smartass/Projects/nomcrm-api
|
||||
Задание: почини N+1 в эндпоинте GET /orders — queries лог показывает
|
||||
по запросу на каждую позицию заказа. Смотри app/controllers/OrdersController.php.
|
||||
Критерии: существующие тесты проходят (composer test), запросов к БД ≤ 3 на запрос.
|
||||
Верни: список изменённых файлов, суть фикса, вывод composer test.
|
||||
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/project
|
||||
=== TASK FOR CODEX ===
|
||||
Task: fix the N+1 in GET /orders — the queries log shows one query per order
|
||||
line item. See app/controllers/OrdersController.php.
|
||||
Acceptance: existing tests pass (composer test), ≤3 DB queries per request.
|
||||
Return: list of changed files, the essence of the fix, composer test output.
|
||||
=== END TASK ===
|
||||
```
|
||||
|
||||
## После завершения
|
||||
## After completion
|
||||
|
||||
- Ответ codex = отчёт + `thread_id: ...`. Не верь на слово: проверь diff,
|
||||
прогони тесты сам.
|
||||
- Замечания → SendMessage тому же сабагенту (та же codex-сессия, контекст цел).
|
||||
- Codex закончил вопросом (блокер) → ответь через SendMessage, он продолжит.
|
||||
- Пока работает, можно спросить статус SendMessage'ем — не прерывает.
|
||||
- Codex answer = report + `thread_id: ...`. Don't take it on faith: check
|
||||
the diff, run the tests yourself.
|
||||
- Remarks → SendMessage to the same subagent (same codex session, context
|
||||
intact).
|
||||
- Codex ended with a question (blocker) → answer via SendMessage, it
|
||||
continues.
|
||||
- While it's working you can ask for status via SendMessage — doesn't
|
||||
interrupt.
|
||||
Reference in new issue
Block a user