フィールドガイド / 19 分
Subagents から安全な Automation へ拡張する
Independent evidence を parallelize し、stable workflow を codex exec/CI へ。
Subagents は noisy exploration を main thread から分離し、independent read-heavy work を並行化します。codex exec は default read-only、progress は stderr、final は stdout。JSONL/schema が machine consumer を支え、GitHub Actions は公式 action と least privilege を使います。
CLI
検証済みターミナル手順
- ›
/agent - $
codex exec "summarize the repository structure" - $
codex exec --ephemeral "triage this repository" - $
codex exec --json "summarize the repo structure" | jq - $
codex exec resume --last "continue the task"
A
作業原則
Independence を parallelize
Exploration/tests/triage/review から。writes は ownership 必須。
Child inherits boundary
Parent sandbox/live overrides を継承。
Stable contract only
Prompt/input/permission/output/failure が repeatable 後 automate。
B
フィールド手順
- 01
Bounded reads delegate
Concern ごと agent、wait、concise evidence。
- 02
Threads inspect
/agent で status/result。
- 03
codex exec prototype
Read-only/ephemeral から。
- 04
Machine output
--json/schema、compatible state だけ resume。
- 05
Harden CI
openai/codex-action@v1、trusted trigger、minimal permission、separate write job。
PASS / FAIL
受入チェック
- Subtasks independent。
- Parent least privilege。
- Non-zero/malformed handled。
- Write credential isolated。
WATCH / REJECT
失敗パターン
- Tightly coupled writes parallel。
- Deprecated --full-auto。
- Job-wide API key exposure。