refactor(skills): EN thin wrappers + shared common, discovery section

This commit is contained in:
admin committed 2026-09-01 00:24:21 +00:00
1 parent 66048fd74c
commit 3289804909
4 files changed
+30 -102

No files matched your search

+10 -36
View File
@@ -1,49 +1,23 @@
---
name: codex-agent
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.
description: Delegate execution to Codex — write code, fix bugs, research. Use when user says "delegate to codex", "have codex do", or a plan step is assigned to Codex.
---
# Delegating a task to Codex
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.
Spawn the `codex` subagent. See `../references/common.md` for transport details (path relative to SKILL.md).
## Subagent prompt — required parts
## Subagent prompt — required
- 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.
- `You are a wrapper around the codex CLI: do not solve the task yourself, launch codex and return its answer + thread_id.`
- `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 ...`
- Task in `=== TASK FOR CODEX ===` / `=== END TASK ===` with acceptance criteria + what to return.
- Optional `codex options: -m <model> -s workspace-write ...` (model/effort from discovery, not hardcoded).
## Example
## Discovery
```
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 ===
```
If user asks which Codex models/reasoning are available, run `scripts/codex-models.sh` or `codex debug models | jq '[.models[] | select(.visibility=="list") | {slug, levels: [.supported_reasoning_levels[].effort]}]'` and present table. Default model/reasoning = `~/.codex/config.toml`.
## After completion
## After
- 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.
Verify diff + tests yourself. Refinements via SendMessage to same agent.