From 9fa872a1f008d864708a164dc19adc552084e9a9 Mon Sep 17 00:00:00 2001 From: cexll Date: Mon, 1 Dec 2025 00:11:31 +0800 Subject: [PATCH] update codex skill dependencies --- skills/codex/SKILL.md | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/skills/codex/SKILL.md b/skills/codex/SKILL.md index f6478f1..ad2c366 100644 --- a/skills/codex/SKILL.md +++ b/skills/codex/SKILL.md @@ -182,24 +182,48 @@ EOF For multiple independent or dependent tasks, use `--parallel` mode with delimiter format: +**Typical Workflow (analyze → implement → test, chained in a single parallel call)**: ```bash codex-wrapper --parallel - <<'EOF' ---TASK--- id: analyze_1732876800 workdir: /home/user/project ---CONTENT--- -analyze requirements @spec.md +analyze @spec.md and summarize API and UI requirements ---TASK--- id: implement_1732876801 workdir: /home/user/project dependencies: analyze_1732876800 ---CONTENT--- -implement feature based on analyze_1732876800 analysis +implement features from analyze_1732876800 summary in backend @services and frontend @ui ---TASK--- -id: docs_1732876802 -workdir: /home/user/project/docs +id: test_1732876802 +workdir: /home/user/project +dependencies: implement_1732876801 ---CONTENT--- -independent task runs in parallel with analyze_1732876800 +add and run regression tests covering the new endpoints and UI flows +EOF +``` +A single `codex-wrapper --parallel` call schedules all three stages concurrently, using `dependencies` to enforce sequential ordering without multiple invocations. + +```bash +codex-wrapper --parallel - <<'EOF' +---TASK--- +id: backend_1732876800 +workdir: /home/user/project/backend +---CONTENT--- +implement /api/orders endpoints with validation and pagination +---TASK--- +id: frontend_1732876801 +workdir: /home/user/project/frontend +---CONTENT--- +build Orders page consuming /api/orders with loading/error states +---TASK--- +id: tests_1732876802 +workdir: /home/user/project/tests +dependencies: backend_1732876800, frontend_1732876801 +---CONTENT--- +run API contract tests and UI smoke tests (waits for backend+frontend) EOF ``` @@ -216,6 +240,12 @@ EOF - `---CONTENT---`: Separates metadata from task content - Task content: Any text, code, special characters (no escaping needed) +**Dependencies Best Practices** + +- Avoid multiple invocations: Place "analyze then implement" in a single `codex-wrapper --parallel` call, chaining them via `dependencies`, rather than running analysis first and then launching implementation separately. +- Naming convention: Use `_` format (e.g., `analyze_1732876800`, `implement_1732876801`), where action names map to features/stages and timestamps ensure uniqueness and sortability. +- Dependency chain design: Keep chains short; only add dependencies for tasks that truly require ordering, let others run in parallel, avoiding over-serialization that reduces throughput. + **Resume Failed Tasks**: ```bash # Use session_id from previous output to resume