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:
catlog22
2026-03-24 17:39:29 +08:00
parent a525db14c7
commit d693f05b69
39 changed files with 299 additions and 431 deletions

View File

@@ -50,7 +50,7 @@ Unified multi-dimensional code review orchestrator with dual-mode (session/modul
3. **Progressive Phase Loading**: Phase docs are read on-demand when that phase executes, not all at once
4. **Auto-Continue**: All phases run autonomously without user intervention between phases
5. **Subagent Lifecycle**: Explicit lifecycle management with spawn_agent → wait → close_agent
6. **Role Path Loading**: Subagent roles loaded via path reference in MANDATORY FIRST STEPS
6. **Role via agent_type**: Subagent roles loaded via TOML `agent_type` parameter in spawn_agent (e.g., `"cli_explore_agent"`)
7. **Optional Fix Pipeline**: Phase 6-9 triggered only by explicit `--fix` flag or user confirmation after Phase 5
8. **Content Preservation**: All agent prompts, code, schemas preserved verbatim from source commands
@@ -298,12 +298,12 @@ Create a new subagent with task assignment.
```javascript
const agentId = spawn_agent({
agent_type: "{agent_type}", // TOML agent definition name (e.g., "cli_explore_agent")
message: `
## TASK ASSIGNMENT
### MANDATORY FIRST STEPS (Agent Execute)
1. **Read role definition**: ~/.codex/agents/{agent-type}.md (MUST read first)
2. Execute: ccw spec load --category "exploration execution"
1. Execute: ccw spec load --category "exploration execution"
---

View File

@@ -85,17 +85,17 @@ const dimensions = ['security', 'architecture', 'quality', 'action-items', 'perf
dimensions.forEach(dimension => {
const agentId = 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 review state: ${reviewStateJsonPath}
3. Get target files: Read resolved_files from review-state.json
4. Validate file access: bash(ls -la ${targetFiles.join(' ')})
5. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference)
6. Execute: ccw spec load --category "exploration execution" (technology stack and constraints)
7. Execute: ccw spec load --category review (review standards and checklists)
1. Read review state: ${reviewStateJsonPath}
2. Get target files: Read resolved_files from review-state.json
3. Validate file access: bash(ls -la ${targetFiles.join(' ')})
4. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference)
5. Execute: ccw spec load --category "exploration execution" (technology stack and constraints)
6. Execute: ccw spec load --category review (review standards and checklists)
---
@@ -124,7 +124,7 @@ Use **Deep Scan mode** for this review:
## Expected Deliverables
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 5, follow schema exactly
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 4, follow schema exactly
1. Dimension Results JSON: ${outputDir}/dimensions/${dimension}.json
@@ -207,18 +207,18 @@ const dimensions = ['security', 'architecture', 'quality', 'action-items', 'perf
dimensions.forEach(dimension => {
const agentId = 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 session metadata: ${sessionMetadataPath}
3. Read completed task summaries: bash(find ${summariesDir} -name "IMPL-*.md" -type f)
4. Get changed files: bash(cd ${workflowDir} && git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u)
5. Read review state: ${reviewStateJsonPath}
6. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference)
7. Execute: ccw spec load --category "exploration execution" (technology stack and constraints)
8. Execute: ccw spec load --category review (review standards and checklists)
1. Read session metadata: ${sessionMetadataPath}
2. Read completed task summaries: bash(find ${summariesDir} -name "IMPL-*.md" -type f)
3. Get changed files: bash(cd ${workflowDir} && git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u)
4. Read review state: ${reviewStateJsonPath}
5. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference)
6. Execute: ccw spec load --category "exploration execution" (technology stack and constraints)
7. Execute: ccw spec load --category review (review standards and checklists)
---
@@ -247,7 +247,7 @@ Use **Deep Scan mode** for this review:
## Expected Deliverables
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 6, follow schema exactly
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 5, follow schema exactly
1. Dimension Results JSON: ${outputDir}/dimensions/${dimension}.json
@@ -326,18 +326,18 @@ reviewAgents.forEach(id => close_agent({ id }));
```javascript
// Spawn deep-dive agent
const deepDiveAgentId = 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 original finding: ${dimensionJsonPath}
3. Read affected file: ${file}
4. Identify related code: bash(grep -r "import.*${basename(file)}" ${projectDir}/src --include="*.ts")
5. Read test files: bash(find ${projectDir}/tests -name "*${basename(file, '.ts')}*" -type f)
6. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
7. Execute: ccw spec load --category "exploration execution" (technology stack and constraints for remediation)
8. Execute: ccw spec load --category review (review standards and checklists)
1. Read original finding: ${dimensionJsonPath}
2. Read affected file: ${file}
3. Identify related code: bash(grep -r "import.*${basename(file)}" ${projectDir}/src --include="*.ts")
4. Read test files: bash(find ${projectDir}/tests -name "*${basename(file, '.ts')}*" -type f)
5. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
6. Execute: ccw spec load --category "exploration execution" (technology stack and constraints for remediation)
7. Execute: ccw spec load --category review (review standards and checklists)
---
@@ -372,7 +372,7 @@ Then apply **Deep Scan mode** for semantic analysis:
## Expected Deliverables
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 6, follow schema exactly
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 5, follow schema exactly
1. Deep-Dive Results JSON: ${outputDir}/iterations/iteration-${iteration}-finding-${findingId}.json

View File

@@ -79,18 +79,18 @@ const deepDiveAgents = [];
selectedFindings.forEach(finding => {
const agentId = 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 original finding: ${dimensionJsonPath}
3. Read affected file: ${finding.file}
4. Identify related code: bash(grep -r "import.*${basename(finding.file)}" ${projectDir}/src --include="*.ts")
5. Read test files: bash(find ${projectDir}/tests -name "*${basename(finding.file, '.ts')}*" -type f)
6. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
7. Read: ${projectRoot}/.workflow/project-tech.json (technology stack and architecture context)
8. Read: ${projectRoot}/.workflow/specs/*.md (user-defined constraints for remediation compliance)
1. Read original finding: ${dimensionJsonPath}
2. Read affected file: ${finding.file}
3. Identify related code: bash(grep -r "import.*${basename(finding.file)}" ${projectDir}/src --include="*.ts")
4. Read test files: bash(find ${projectDir}/tests -name "*${basename(finding.file, '.ts')}*" -type f)
5. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
6. Read: ${projectRoot}/.workflow/project-tech.json (technology stack and architecture context)
7. Read: ${projectRoot}/.workflow/specs/*.md (user-defined constraints for remediation compliance)
---
@@ -125,7 +125,7 @@ Then apply **Deep Scan mode** for semantic analysis:
## Expected Deliverables
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 6, follow schema exactly
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 5, follow schema exactly
1. Deep-Dive Results JSON: ${outputDir}/iterations/iteration-${iteration}-finding-${finding.id}.json
@@ -190,18 +190,18 @@ const deepDiveAgents = [];
selectedFindings.forEach(finding => {
const agentId = 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 original finding: ${dimensionJsonPath}
3. Read affected file: ${finding.file}
4. Identify related code: bash(grep -r "import.*${basename(finding.file)}" ${workflowDir}/src --include="*.ts")
5. Read test files: bash(find ${workflowDir}/tests -name "*${basename(finding.file, '.ts')}*" -type f)
6. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
7. Read: ${projectRoot}/.workflow/project-tech.json (technology stack and architecture context)
8. Read: ${projectRoot}/.workflow/specs/*.md (user-defined constraints for remediation compliance)
1. Read original finding: ${dimensionJsonPath}
2. Read affected file: ${finding.file}
3. Identify related code: bash(grep -r "import.*${basename(finding.file)}" ${workflowDir}/src --include="*.ts")
4. Read test files: bash(find ${workflowDir}/tests -name "*${basename(finding.file, '.ts')}*" -type f)
5. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
6. Read: ${projectRoot}/.workflow/project-tech.json (technology stack and architecture context)
7. Read: ${projectRoot}/.workflow/specs/*.md (user-defined constraints for remediation compliance)
---
@@ -237,7 +237,7 @@ Then apply **Deep Scan mode** for semantic analysis:
## Expected Deliverables
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 6, follow schema exactly
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 5, follow schema exactly
1. Deep-Dive Results JSON: ${outputDir}/iterations/iteration-${iteration}-finding-${finding.id}.json

View File

@@ -100,12 +100,12 @@ for (let i = 1; i <= aggregatedPlan.groups.length; i++) {
```javascript
// Spawn planning agent for a batch
const agentId = spawn_agent({
agent_type: "cli_planning_agent",
message: `
## TASK ASSIGNMENT
### MANDATORY FIRST STEPS (Agent Execute)
1. **Read role definition**: ~/.codex/agents/cli-planning-agent.md (MUST read first)
2. Execute: ccw spec load --category planning
1. Execute: ccw spec load --category planning
---

View File

@@ -55,12 +55,12 @@ if (result.passRate < 100%) {
```javascript
// Spawn execution agent for a group
const execAgentId = spawn_agent({
agent_type: "cli_execution_agent",
message: `
## TASK ASSIGNMENT
### MANDATORY FIRST STEPS (Agent Execute)
1. **Read role definition**: ~/.codex/agents/cli-execution-agent.md (MUST read first)
2. Execute: ccw spec load --category execution
1. Execute: ccw spec load --category execution
---