mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-25 19:48:33 +08:00
feat: convert all codex agent definitions from .md to .toml format
Convert 20 agent .md files to Codex-native .toml format with proper metadata (name, description, model, sandbox_mode, developer_instructions). Update all 19 skill files to use agent_type references instead of .md file paths. Remove "Read role definition" bootstrapping step from spawn messages since TOML developer_instructions replaces it. Agent format: YAML frontmatter + body → TOML with inline instructions Calling schema: agent: "path.md" → agent_type: "toml_name" Sandbox: read-only for exploration agents, workspace-write for executors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ Interactive brainstorming workflow with **documented thought evolution**. Expand
|
||||
|
||||
**Codex-Specific Features**:
|
||||
- Parallel subagent execution via `spawn_agent` + batch `wait({ ids: [...] })`
|
||||
- Role loading via path (agent reads `~/.codex/agents/*.md` itself)
|
||||
- Role loading via TOML agent definition (agent_type parameter in spawn_agent)
|
||||
- Deep interaction with `send_input` for multi-round refinement within single agent
|
||||
- Explicit lifecycle management with `close_agent`
|
||||
|
||||
@@ -208,12 +208,10 @@ Generate key questions that guide the brainstorming exploration. Use a subagent
|
||||
|
||||
```javascript
|
||||
const vectorAgent = spawn_agent({
|
||||
agent_type: "cli_explore_agent",
|
||||
message: `
|
||||
## TASK ASSIGNMENT
|
||||
|
||||
### MANDATORY FIRST STEPS (Agent Execute)
|
||||
1. **Read role definition**: ~/.codex/agents/cli-explore-agent.md (MUST read first)
|
||||
|
||||
---
|
||||
|
||||
## Context
|
||||
@@ -302,9 +300,9 @@ Spawn 3 perspective agents in parallel: Creative + Pragmatic + Systematic.
|
||||
|
||||
| Perspective | Role File | Focus |
|
||||
|-------------|-----------|-------|
|
||||
| Creative | `~/.codex/agents/cli-explore-agent.md` | Innovation, cross-domain inspiration, challenging assumptions |
|
||||
| Pragmatic | `~/.codex/agents/cli-explore-agent.md` | Implementation feasibility, effort estimates, blockers |
|
||||
| Systematic | `~/.codex/agents/cli-explore-agent.md` | Problem decomposition, patterns, scalability |
|
||||
| Creative | `cli_explore_agent` | Innovation, cross-domain inspiration, challenging assumptions |
|
||||
| Pragmatic | `cli_explore_agent` | Implementation feasibility, effort estimates, blockers |
|
||||
| Systematic | `cli_explore_agent` | Problem decomposition, patterns, scalability |
|
||||
|
||||
**Parallel Subagent Execution**:
|
||||
|
||||
@@ -353,13 +351,13 @@ const perspectives = [
|
||||
// Parallel spawn - all agents start immediately
|
||||
const agentIds = perspectives.map(perspective => {
|
||||
return spawn_agent({
|
||||
agent_type: "cli_explore_agent",
|
||||
message: `
|
||||
## TASK ASSIGNMENT
|
||||
|
||||
### MANDATORY FIRST STEPS (Agent Execute)
|
||||
1. **Read role definition**: ~/.codex/agents/cli-explore-agent.md (MUST read first)
|
||||
2. Run: `ccw spec load --category "exploration planning"`
|
||||
3. Read project tech context from loaded specs
|
||||
1. Run: `ccw spec load --category "exploration planning"`
|
||||
2. Read project tech context from loaded specs
|
||||
|
||||
---
|
||||
|
||||
@@ -560,13 +558,13 @@ const deepDiveResult = wait({ ids: [perspectiveAgent], timeout_ms: 600000 })
|
||||
|
||||
```javascript
|
||||
const deepDiveAgent = spawn_agent({
|
||||
agent_type: "cli_explore_agent",
|
||||
message: `
|
||||
## TASK ASSIGNMENT
|
||||
|
||||
### MANDATORY FIRST STEPS (Agent Execute)
|
||||
1. **Read role definition**: ~/.codex/agents/cli-explore-agent.md (MUST read first)
|
||||
2. Read: ${sessionFolder}/perspectives.json (prior findings)
|
||||
3. Run: `ccw spec load --category "exploration planning"`
|
||||
1. Read: ${sessionFolder}/perspectives.json (prior findings)
|
||||
2. Run: `ccw spec load --category "exploration planning"`
|
||||
|
||||
---
|
||||
|
||||
@@ -606,12 +604,12 @@ When user selects "challenge", spawn a dedicated challenge agent.
|
||||
|
||||
```javascript
|
||||
const challengeAgent = spawn_agent({
|
||||
agent_type: "cli_explore_agent",
|
||||
message: `
|
||||
## TASK ASSIGNMENT
|
||||
|
||||
### MANDATORY FIRST STEPS (Agent Execute)
|
||||
1. **Read role definition**: ~/.codex/agents/cli-explore-agent.md (MUST read first)
|
||||
2. Read: ${sessionFolder}/perspectives.json (ideas to challenge)
|
||||
1. Read: ${sessionFolder}/perspectives.json (ideas to challenge)
|
||||
|
||||
---
|
||||
|
||||
@@ -659,12 +657,12 @@ When user selects "merge", synthesize complementary ideas.
|
||||
|
||||
```javascript
|
||||
const mergeAgent = spawn_agent({
|
||||
agent_type: "cli_explore_agent",
|
||||
message: `
|
||||
## TASK ASSIGNMENT
|
||||
|
||||
### MANDATORY FIRST STEPS (Agent Execute)
|
||||
1. **Read role definition**: ~/.codex/agents/cli-explore-agent.md (MUST read first)
|
||||
2. Read: ${sessionFolder}/perspectives.json (source ideas)
|
||||
1. Read: ${sessionFolder}/perspectives.json (source ideas)
|
||||
|
||||
---
|
||||
|
||||
@@ -888,7 +886,7 @@ Dimensions guide brainstorming scope and focus:
|
||||
```javascript
|
||||
// Safe parallel execution with error handling
|
||||
try {
|
||||
const agentIds = perspectives.map(p => spawn_agent({ message: buildPrompt(p) }))
|
||||
const agentIds = perspectives.map(p => spawn_agent({ agent_type: "cli_explore_agent", message: buildPrompt(p) }))
|
||||
|
||||
const results = wait({ ids: agentIds, timeout_ms: 600000 })
|
||||
|
||||
@@ -1014,7 +1012,7 @@ Final synthesis:
|
||||
|
||||
### Codex Subagent Best Practices
|
||||
|
||||
1. **Role Path, Not Content**: Pass `~/.codex/agents/*.md` path in message, let agent read itself
|
||||
1. **Agent Type, Not Path**: Use `agent_type` parameter in spawn_agent, not manual file path reading
|
||||
2. **Parallel for Perspectives**: Use batch spawn + wait for 3 perspective agents
|
||||
3. **Delay close_agent for Refinement**: Keep perspective agents alive for `send_input` reuse
|
||||
4. **Batch wait**: Use `wait({ ids: [a, b, c] })` for parallel agents, not sequential waits
|
||||
|
||||
Reference in New Issue
Block a user