Files
wehub-resource-sync 23f7624596
ADR-166 MCP Bridge Security Lock / Static-source security lock (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / Compose default binds loopback + Mongo has auth (push) Failing after 2s
CodeQL Advanced / Analyze (rust) (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / plugin-agent-federation bindHost default (push) Failing after 1s
ADR-166 MCP Bridge Security Lock / Runtime behavior — 401 + terminal gate + fail-closed (push) Failing after 4s
business-pods-smoke / smoke (push) Failing after 1s
all-plugins-smoke / smoke-all (push) Failing after 2s
CI/CD Pipeline / Security & Code Quality (push) Failing after 1s
CI/CD Pipeline / Test Suite (ubuntu-latest) (push) Failing after 1s
CI/CD Pipeline / Build & Package (macos-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (ubuntu-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (windows-latest) (push) Has been skipped
CI/CD Pipeline / Documentation & Examples (push) Failing after 1s
Clone Tracker (14-day rolling) / Snapshot clones for ruflo ecosystem (push) Failing after 1s
CodeQL Advanced / Analyze (actions) (push) Failing after 1s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1s
federation-peer-rust / stable-noop (push) Failing after 1s
metaharness-ci / score (push) Failing after 1s
metaharness-ci / router-compat (push) Failing after 0s
metaharness-ci / similarity-tests (push) Failing after 0s
no-agentbbs-smoke / smoke-without-agentbbs (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (windows-latest) (push) Has been skipped
codex-integration-audit / Codex integration audit (push) Failing after 1s
helpers-manifest-guard / guard (push) Failing after 1s
🔗 Cross-Agent Integration Tests / 🤝 Agent Coordination Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🧠 Memory Sharing Integration (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🛡️ Fault Tolerance Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / ⚡ Performance Integration Tests (push) Has been skipped
metaharness-ci / mcp-scan (push) Failing after 1s
metaharness-ci / eject-dryrun (push) Failing after 1s
metaharness-ci / metaharness-real-data (push) Failing after 0s
no-cli-optdep-bloat-2561 / guard (push) Failing after 1s
no-metaharness-smoke / smoke-without-metaharness (push) Failing after 1s
no-phantom-agentic-flow-subpath / guard (push) Failing after 1s
🔄 Automated Rollback Manager / 🚨 Failure Detection (push) Failing after 1s
V3 CI/CD Pipeline / Plugin hooks smoke / ubuntu-latest / Node 22 (push) Failing after 1s
V3 CI/CD Pipeline / ruflo-graph-intelligence build + test smoke (#2044, ADR-123) (push) Failing after 1s
CVE Audit Gate / Audit root (critical-blocking) (push) Failing after 2s
cost-tracker-smoke / smoke (push) Failing after 3s
oia-audit-weekly / audit (push) Failing after 2s
ruflo-agent-smoke / ruflo-agent structural smoke (push) Failing after 1s
📊 Status Badges Update / 📊 Update Status Badges (push) Failing after 1s
V3 CI/CD Pipeline / Static regression guards (#2267 YAML + (push) Failing after 1s
V3 CI/CD Pipeline / Test V3 Packages (push) Failing after 0s
V3 CI/CD Pipeline / agent_execute provider routing smoke (#2042) (push) Failing after 0s
CVE Audit Gate / Audit v3 (critical-blocking) (push) Failing after 1s
federation-peer-rust / stable-native (push) Failing after 2s
🔗 Cross-Agent Integration Tests / 🚀 Integration Test Setup (push) Failing after 2s
neural-trader-smoke / runtime-smoke (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (macos-latest) (push) Has been skipped
V3 CI/CD Pipeline / Build V3 (ubuntu-latest) (push) Has been skipped
V3 CI/CD Pipeline / Type Check V3 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 24 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 22 (push) Failing after 2s
V3 CI/CD Pipeline / browser rvf create flag smoke (#2015) (push) Failing after 0s
V3 CI/CD Pipeline / Dependency review (#2046) (push) Has been skipped
V3 CI/CD Pipeline / Supply-chain audit (#2046) (push) Failing after 0s
V3 CI/CD Pipeline / witness marker drift smoke (#2021) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader portfolio CG smoke (#2068, ADR-126 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader backtest signing smoke (#2068, ADR-126 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / kg-extract type-import classification smoke (#2049) (push) Failing after 0s
V3 CI/CD Pipeline / witness verify precondition smoke (#1880) (push) Failing after 2s
V3 CI/CD Pipeline / neural-trader pipeline risk-gate smoke (#2068, ADR-126 Phase 5) (push) Failing after 0s
V3 CI/CD Pipeline / neural-trader feature attribution smoke (#2068, ADR-126 Phase 6) (push) Failing after 0s
V3 CI/CD Pipeline / plugin-registry signature verification smoke (#1922, CWE-347) (push) Failing after 4s
V3 CI/CD Pipeline / memory stats legacy-DB smoke (#2120) (push) Failing after 4s
V3 CI/CD Pipeline / github deprecated actions smoke (#2089, ADR-127 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / graph query + pathfinder smoke (ADR-130 P2+P5) (push) Has been skipped
V3 CI/CD Pipeline / graph trajectory hooks smoke (ADR-130 P3) (push) Has been skipped
V3 CI/CD Pipeline / graph plugin adapter smoke (ADR-130 P4) (push) Has been skipped
V3 CI/CD Pipeline / graph benchmark (ADR-130 P6) (push) Has been skipped
V3 CI/CD Pipeline / statusline generator delegation smoke (#2195) (push) Failing after 1s
V3 CI/CD Pipeline / wizard init regression guard (#2206 (push) Failing after 1s
V3 CI/CD Pipeline / memory no-stray-db smoke (ADR-125 P7) (push) Failing after 1s
V3 CI/CD Pipeline / github-safe injection smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github actions pin smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github attribution opt-in smoke (#2089, ADR-127 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / pre-bash hook safety smoke (#2017) (push) Failing after 1s
V3 CI/CD Pipeline / Memory import smoke / ubuntu-latest (push) Failing after 0s
V3 CI/CD Pipeline / MCP protocol smoke / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / ruvllm WASM auto-init smoke (#2086) (push) Failing after 4s
V3 CI/CD Pipeline / MCP paired-tool round-trip smoke (#1889) (push) Failing after 1s
V3 CI/CD Pipeline / Plugin package install-safety (#1902/#1903/#1904) (push) Failing after 1s
V3 CI/CD Pipeline / Tool description discoverability (ADR-112) (push) Failing after 3s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (22) (push) Failing after 1s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (24) (push) Failing after 1s
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Vector-index dimension audit (#1947) (push) Failing after 0s
V3 CI/CD Pipeline / Hook-command install safety (#1921) (push) Failing after 1s
V3 CI/CD Pipeline / ToolOutputGuardrail smoke (ADR-131, (push) Failing after 1s
V3 CI/CD Pipeline / init-bundle invariants smoke (#2095, ADR-128 Phase 5) (push) Failing after 1s
V3 CI/CD Pipeline / wasm provider bridge smoke (ADR-129 P1) (push) Failing after 2s
V3 CI/CD Pipeline / wasm gallery CRUD smoke (ADR-129 P3) (push) Failing after 1s
V3 CI/CD Pipeline / wasm plugin bridge smoke (ADR-129 P4) (push) Failing after 0s
V3 CI/CD Pipeline / wasm compose smoke (ADR-129 P2) (push) Failing after 4s
V3 CI/CD Pipeline / graph schema smoke (ADR-130 P1) (push) Failing after 0s
Validate Marketplace / validate (push) Failing after 1s
🔍 Verification Pipeline / 🚀 Setup Verification (push) Failing after 1s
🔍 Verification Pipeline / 🛡️ Security Verification (push) Has been skipped
🔍 Verification Pipeline / 📝 Code Quality (push) Has been skipped
🔍 Verification Pipeline / 🧪 Test Verification (${{ matrix.os }}, Node ${{ matrix.node }}) (push) Has been skipped
🔍 Verification Pipeline / 🏗️ Build Verification (push) Has been skipped
🔍 Verification Pipeline / 📚 Documentation Verification (push) Has been skipped
CVE Audit Gate / High-severity report (warn only) (push) Has been cancelled
🔄 Automated Rollback Manager / 🔄 Execute Rollback (push) Has been cancelled
🔄 Automated Rollback Manager / ✅ Post-Rollback Verification (push) Has been cancelled
🔄 Automated Rollback Manager / 📊 Rollback Monitoring (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / windows-latest (push) Has been cancelled
🔄 Automated Rollback Manager / ⏳ Manual Rollback Approval (push) Has been cancelled
V3 CI/CD Pipeline / MCP protocol smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Memory import smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / ubuntu-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Publish to npm (alpha) (push) Has been cancelled
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / macos-latest / Node 22 (push) Has been cancelled
V3 CI/CD Pipeline / Plugin hooks smoke / macos-latest / Node 22 (push) Has been cancelled
CI/CD Pipeline / Deploy & Release (push) Has been cancelled
CI/CD Pipeline / CI Status (push) Has been cancelled
🔗 Cross-Agent Integration Tests / 📊 Integration Test Report (push) Has been cancelled
🔄 Automated Rollback Manager / 🔍 Pre-Rollback Validation (push) Has been cancelled
🔍 Verification Pipeline / ⚡ Performance Verification (push) Has been cancelled
🔍 Verification Pipeline / 📊 Verification Report (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:02:19 +08:00

23 KiB

ADR-027 Supplement: Codex Template Specifications

Branding Note: This package is published as @claude-flow/codex and is the first step in transitioning to the coflow brand. The future umbrella package will be npm/npx coflow.

Overview

This document provides the complete template specifications for all Codex-generated artifacts, including AGENTS.md, SKILL.md files, and config.toml configurations.

Package Information

Property Value
Package Name @claude-flow/codex
Location v3/@claude-flow/codex/
Future Umbrella coflow
CLI Command npx @claude-flow/codex init
Integration Works with @claude-flow/cli via --codex flag

AGENTS.md Templates

Default Template (Full)

# Claude Flow V3

> Multi-agent orchestration framework for agentic coding

## Project Overview

{{PROJECT_DESCRIPTION}}

**Tech Stack**: {{TECH_STACK}}
**Architecture**: Domain-Driven Design with bounded contexts

## Quick Start

### Installation
```bash
npm install

Build

{{BUILD_COMMAND}}

Test

{{TEST_COMMAND}}

Development

{{DEV_COMMAND}}

Agent Coordination

Swarm Configuration

This project uses hierarchical swarm coordination for complex tasks:

Setting Value Purpose
Topology hierarchical Queen-led coordination (anti-drift)
Max Agents 8 Optimal team size
Strategy specialized Clear role boundaries
Consensus raft Leader-based consistency

When to Use Swarms

Invoke swarm for:

  • Multi-file changes (3+ files)
  • New feature implementation
  • Cross-module refactoring
  • API changes with tests
  • Security-related changes
  • Performance optimization

Skip swarm for:

  • Single file edits
  • Simple bug fixes (1-2 lines)
  • Documentation updates
  • Configuration changes

Available Skills

Use $skill-name syntax to invoke:

Skill Use Case
$swarm-orchestration Multi-agent task coordination
$memory-management Pattern storage and retrieval
$sparc-methodology Structured development workflow
$security-audit Security scanning and CVE detection
$performance-analysis Profiling and optimization
$github-automation CI/CD and PR management

Agent Types

Type Role Use Case
researcher Requirements analysis Understanding scope
architect System design Planning structure
coder Implementation Writing code
tester Test creation Quality assurance
reviewer Code review Security and quality

Code Standards

File Organization

  • NEVER save to root folder
  • /src - Source code files
  • /tests - Test files
  • /docs - Documentation
  • /config - Configuration files

Quality Rules

  • Files under 500 lines
  • No hardcoded secrets
  • Input validation at boundaries
  • Typed interfaces for public APIs
  • TDD London School (mock-first) preferred

Commit Messages

<type>(<scope>): <description>

[optional body]

Co-Authored-By: claude-flow <ruv@ruv.net>

Types: feat, fix, docs, style, refactor, perf, test, chore

Security

Critical Rules

  • NEVER commit secrets, credentials, or .env files
  • NEVER hardcode API keys
  • Always validate user input
  • Use parameterized queries for SQL
  • Sanitize output to prevent XSS

Path Security

  • Validate all file paths
  • Prevent directory traversal (../)
  • Use absolute paths internally

CVE Remediation

Active monitoring for:

  • CVE-1: Command injection prevention
  • CVE-2: Path traversal protection
  • CVE-3: Input validation enforcement

Performance Targets

Metric Target Notes
HNSW Search 150x-12,500x faster Vector operations
Memory Reduction 50-75% Int8 quantization
MCP Response <100ms API latency
CLI Startup <500ms Cold start

Testing

Running Tests

# Unit tests
npm test

# Integration tests
npm run test:integration

# Coverage
npm run test:coverage

Test Philosophy

  • TDD London School (mock-first)
  • Unit tests for business logic
  • Integration tests for boundaries
  • E2E tests for critical paths

Memory System

Storing Patterns

npx claude-flow@v3alpha memory store \
  --key "pattern-name" \
  --value "pattern description" \
  --namespace patterns

Searching Memory

npx claude-flow@v3alpha memory search \
  --query "search terms" \
  --namespace patterns

Learning Protocol

  1. Before task: Search memory for similar patterns
  2. During task: Use retrieved patterns
  3. After task: Store successful patterns for future use

MCP Integration

Claude Flow exposes tools via MCP:

# Start MCP server
npx claude-flow@v3alpha mcp start

Available Tools

  • swarm_init - Initialize swarm coordination
  • agent_spawn - Spawn new agents
  • memory_store - Store in AgentDB
  • memory_search - Semantic search
  • task_orchestrate - Task coordination

Hooks System

Claude Flow uses hooks for automation:

Hook Purpose
pre-task Get context before starting
post-task Record completion for learning
pre-edit Validate before file changes
post-edit Train neural patterns

Example

npx claude-flow@v3alpha hooks pre-task \
  --description "implementing authentication"

### Minimal Template

```markdown
# {{PROJECT_NAME}}

## Setup
```bash
npm install && npm run build

Test

npm test

Code Standards

  • Files under 500 lines
  • No hardcoded secrets
  • Input validation at boundaries

Skills

  • $swarm-orchestration - Multi-agent tasks
  • $memory-management - Pattern storage

Security

  • Never commit .env files
  • Validate all inputs
  • Prevent path traversal

### AGENTS.override.md Template (Local Overrides)

```markdown
# Local Development Overrides

## Environment
- Development mode: full-auto
- Sandbox: workspace-write
- Web search: live

## Personal Preferences
[User can add their specific preferences here]

## Debug Settings
Enable verbose logging for development.

## Notes
This file is gitignored and contains local-only settings.

SKILL.md Templates

swarm-orchestration/SKILL.md

---
name: swarm-orchestration
description: >
  Multi-agent swarm coordination for complex tasks.
  Use when: 3+ files need changes, new features, refactoring.
  Skip when: single file edits, simple fixes, documentation.
---

# Swarm Orchestration Skill

## Purpose
Coordinate multiple specialized agents to work on complex tasks in parallel.

## When to Trigger
- Multi-file changes (3+ files)
- New feature implementation
- Cross-module refactoring
- Performance optimization
- Security audits

## Agent Routing

| Task Type | Agents |
|-----------|--------|
| Bug Fix | researcher, coder, tester |
| Feature | architect, coder, tester, reviewer |
| Refactor | architect, coder, reviewer |
| Performance | perf-engineer, coder |
| Security | security-architect, auditor |

## Execution Steps

### 1. Initialize Swarm
```bash
npx claude-flow@v3alpha swarm init \
  --topology hierarchical \
  --max-agents 8 \
  --strategy specialized

2. Route Task

npx claude-flow@v3alpha hooks route --task "[task description]"

3. Monitor Status

npx claude-flow@v3alpha swarm status

Memory Integration

Before Starting

npx claude-flow@v3alpha memory search --query "[task keywords]"

After Completion

npx claude-flow@v3alpha memory store \
  --key "[pattern-name]" \
  --value "[what worked]" \
  --namespace patterns

Anti-Drift Configuration

Use these settings to prevent agent drift:

topology = "hierarchical"
max_agents = 8
strategy = "specialized"
consensus = "raft"

Best Practices

  1. Start with memory search for existing patterns
  2. Use hierarchical topology for tight coordination
  3. Keep team size to 6-8 agents
  4. Store successful patterns after completion

### memory-management/SKILL.md

```yaml
---
name: memory-management
description: >
  AgentDB memory system with HNSW vector search.
  Use when: need to store/retrieve patterns, search semantically.
  Skip when: no learning or pattern matching needed.
---

# Memory Management Skill

## Purpose
Interact with the AgentDB memory system for pattern storage, retrieval, and semantic search.

## Capabilities

| Operation | Performance |
|-----------|-------------|
| Store | ~1ms |
| Retrieve | ~0.5ms |
| Search (HNSW) | 150x-12,500x faster than brute force |

## Commands

### Store Data
```bash
npx claude-flow@v3alpha memory store \
  --key "unique-key" \
  --value "data to store" \
  --namespace patterns \
  --tags "tag1,tag2"

Search Data

npx claude-flow@v3alpha memory search \
  --query "semantic search terms" \
  --namespace patterns \
  --limit 10

Retrieve Specific Entry

npx claude-flow@v3alpha memory retrieve \
  --key "unique-key" \
  --namespace patterns

List All Entries

npx claude-flow@v3alpha memory list \
  --namespace patterns \
  --limit 50

Namespaces

Namespace Purpose
patterns Successful code patterns
solutions Bug fix solutions
architectures Design decisions
optimizations Performance improvements

Learning Protocol

Before Task

  1. Search for similar past tasks
  2. Retrieve relevant patterns
  3. Apply learned optimizations

After Task

  1. Store successful patterns
  2. Record any new learnings
  3. Update optimization strategies

HNSW Indexing

The memory system uses HNSW (Hierarchical Navigable Small World) indexing:

  • 150x faster for small datasets
  • 12,500x faster for large datasets
  • Approximate nearest neighbor search
  • Configurable accuracy/speed tradeoff

Best Practices

  1. Use descriptive keys
  2. Organize with namespaces
  3. Add tags for categorization
  4. Search before creating new patterns

### sparc-methodology/SKILL.md

```yaml
---
name: sparc-methodology
description: >
  SPARC development workflow (Specification, Pseudocode, Architecture, Refinement, Completion).
  Use when: starting new features, complex implementations.
  Skip when: simple fixes, documentation.
---

# SPARC Methodology Skill

## Purpose
Structured development workflow ensuring thorough planning before implementation.

## Phases

### 1. Specification
Define requirements and acceptance criteria.

```bash
npx claude-flow@v3alpha hooks route --task "specification: [requirements]"

2. Pseudocode

Design algorithm in plain language.

npx claude-flow@v3alpha hooks route --task "pseudocode: [algorithm design]"

3. Architecture

Plan system structure and components.

npx claude-flow@v3alpha hooks route --task "architecture: [system design]"

4. Refinement

Iterate and improve implementation.

npx claude-flow@v3alpha hooks route --task "refinement: [improvements]"

5. Completion

Final validation and documentation.

npx claude-flow@v3alpha hooks route --task "completion: [validation]"

Agent Mapping

Phase Primary Agent Support
Specification researcher architect
Pseudocode architect coder
Architecture architect security-architect
Refinement coder reviewer
Completion tester documenter

Workflow Example

1. SPECIFICATION
   └─ Define: "User authentication with JWT"
   └─ Criteria: Secure, Scalable, <100ms latency

2. PSEUDOCODE
   └─ Login flow algorithm
   └─ Token refresh mechanism
   └─ Session management

3. ARCHITECTURE
   └─ Component diagram
   └─ API contracts
   └─ Security boundaries

4. REFINEMENT
   └─ TDD implementation
   └─ Security hardening
   └─ Performance optimization

5. COMPLETION
   └─ Integration tests
   └─ Documentation
   └─ Deployment checklist

Best Practices

  1. Complete each phase before moving on
  2. Document decisions at each stage
  3. Store patterns in memory for reuse
  4. Use TDD during refinement

### security-audit/SKILL.md

```yaml
---
name: security-audit
description: >
  Security scanning and vulnerability detection.
  Use when: security review needed, handling sensitive data.
  Always trigger for: authentication, authorization, payment processing.
---

# Security Audit Skill

## Purpose
Comprehensive security analysis including vulnerability scanning, CVE detection, and code review.

## Automatic Triggers
Always invoke for:
- Authentication systems
- Authorization/permissions
- Payment processing
- User data handling
- External API integrations
- File uploads

## Security Checks

### 1. Input Validation
```bash
npx claude-flow@v3alpha security scan --check input-validation

2. Path Security

npx claude-flow@v3alpha security scan --check path-traversal

3. Command Injection

npx claude-flow@v3alpha security scan --check command-injection

4. Full Audit

npx claude-flow@v3alpha security scan --depth full

CVE Monitoring

CVE Risk Mitigation
CVE-1 Command Injection Input sanitization
CVE-2 Path Traversal Path validation
CVE-3 Input Validation Zod schemas

Security Patterns

Input Validation (Zod)

const userSchema = z.object({
  email: z.string().email(),
  password: z.string().min(8),
});

Path Validation

const safePath = await validatePath(userInput);
if (!safePath.isValid) throw new PathTraversalError();

Command Safety

const safeExec = new SafeExecutor();
await safeExec.run(command, { sanitize: true });

Best Practices

  1. Validate all inputs at boundaries
  2. Never trust user data
  3. Use parameterized queries
  4. Sanitize output for XSS prevention
  5. Log security events
  6. Regular dependency audits

## config.toml Templates

### Default Configuration

```toml
# Claude Flow V3 - Codex Configuration
# Generated by: claude-flow init --codex
# Documentation: https://github.com/ruvnet/claude-flow

# =============================================================================
# Core Settings
# =============================================================================

# Model selection
model = "gpt-5.3-codex"

# Approval policy: untrusted | on-failure | on-request | never
approval_policy = "on-request"

# Sandbox mode: read-only | workspace-write | danger-full-access
sandbox_mode = "workspace-write"

# Web search: disabled | cached | live
web_search = "cached"

# =============================================================================
# Project Documentation
# =============================================================================

# Maximum bytes to read from AGENTS.md files
project_doc_max_bytes = 65536

# Fallback filenames if AGENTS.md not found
project_doc_fallback_filenames = [
  "AGENTS.md",
  "TEAM_GUIDE.md",
  ".agents.md"
]

# =============================================================================
# Features
# =============================================================================

[features]
# Enable child AGENTS.md guidance
child_agents_md = true

# Cache shell environment for faster repeated commands
shell_snapshot = true

# Smart approvals based on request context
request_rule = true

# Enable remote compaction for large histories
remote_compaction = true

# =============================================================================
# MCP Servers
# =============================================================================

[mcp_servers.claude-flow]
command = "npx"
args = ["-y", "@claude-flow/cli@latest"]
enabled = true
tool_timeout_sec = 120

[mcp_servers.ruv-swarm]
command = "npx"
args = ["-y", "ruv-swarm", "mcp", "start"]
enabled = true
tool_timeout_sec = 120

# =============================================================================
# Skills Configuration
# =============================================================================

[[skills.config]]
path = ".agents/skills/swarm-orchestration"
enabled = true

[[skills.config]]
path = ".agents/skills/memory-management"
enabled = true

[[skills.config]]
path = ".agents/skills/sparc-methodology"
enabled = true

[[skills.config]]
path = ".agents/skills/security-audit"
enabled = true

[[skills.config]]
path = ".agents/skills/performance-analysis"
enabled = true

[[skills.config]]
path = ".agents/skills/github-automation"
enabled = true

# =============================================================================
# Profiles
# =============================================================================

# Development profile - more permissive for local work
[profiles.dev]
approval_policy = "never"
sandbox_mode = "danger-full-access"
web_search = "live"

# Safe profile - maximum restrictions
[profiles.safe]
approval_policy = "untrusted"
sandbox_mode = "read-only"
web_search = "disabled"

# CI profile - for automated pipelines
[profiles.ci]
approval_policy = "never"
sandbox_mode = "workspace-write"
web_search = "cached"

# =============================================================================
# History
# =============================================================================

[history]
# Save all session transcripts
persistence = "save-all"

# Maximum history file size (optional)
# max_bytes = 10485760

# =============================================================================
# Shell Environment
# =============================================================================

[shell_environment_policy]
# Inherit environment variables
inherit = "core"

# Exclude sensitive variables
exclude = ["*_KEY", "*_SECRET", "*_TOKEN", "*_PASSWORD"]

# =============================================================================
# Sandbox Workspace Write Settings
# =============================================================================

[sandbox_workspace_write]
# Additional writable paths beyond workspace
writable_roots = []

# Allow network access
network_access = true

# Exclude temp directories
exclude_slash_tmp = false

Minimal Configuration

# Claude Flow V3 - Minimal Codex Configuration

model = "gpt-5.3-codex"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[mcp_servers.claude-flow]
command = "npx"
args = ["-y", "@claude-flow/cli@latest"]
enabled = true

CI/CD Configuration

# Claude Flow V3 - CI/CD Pipeline Configuration

model = "gpt-5.3-codex"
approval_policy = "never"
sandbox_mode = "workspace-write"
web_search = "disabled"

[features]
shell_snapshot = false
remote_compaction = false

[mcp_servers.claude-flow]
command = "npx"
args = ["-y", "@claude-flow/cli@latest"]
enabled = true

[history]
persistence = "none"

Directory Structure Generated

project/
├── AGENTS.md                          # Main project instructions
├── .agents/
│   ├── config.toml                    # Project-level Codex config
│   └── skills/
│       ├── swarm-orchestration/
│       │   ├── SKILL.md
│       │   ├── scripts/
│       │   │   └── init-swarm.sh
│       │   └── references/
│       │       └── topology-guide.md
│       ├── memory-management/
│       │   ├── SKILL.md
│       │   └── references/
│       │       └── hnsw-guide.md
│       ├── sparc-methodology/
│       │   ├── SKILL.md
│       │   └── references/
│       │       └── sparc-phases.md
│       ├── security-audit/
│       │   ├── SKILL.md
│       │   └── scripts/
│       │       └── security-scan.sh
│       ├── performance-analysis/
│       │   ├── SKILL.md
│       │   └── scripts/
│       │       └── benchmark.sh
│       └── github-automation/
│           ├── SKILL.md
│           └── scripts/
│               ├── create-pr.sh
│               └── run-ci.sh
├── .codex/                            # User-local overrides (gitignored)
│   ├── config.toml                    # Personal config overrides
│   └── AGENTS.override.md             # Local instruction overrides
└── .claude-flow/                      # Runtime data (shared)
    ├── config.yaml
    ├── data/
    └── logs/

openai.yaml for Skills (Optional)

# .agents/skills/swarm-orchestration/agents/openai.yaml

interface:
  display_name: "Swarm Orchestration"
  short_description: "Multi-agent task coordination"
  icon_small: "./assets/swarm-icon-sm.svg"
  icon_large: "./assets/swarm-icon-lg.png"
  brand_color: "#7C3AED"
  default_prompt: "Coordinate multiple agents to work on this task"

dependencies:
  tools:
    - type: "mcp"
      value: "claude-flow"
      description: "Claude Flow MCP server for swarm coordination"
      transport: "stdio"
      command: "npx"
      args: ["-y", "@claude-flow/cli@latest"]

Generation API

// Usage in claude-flow CLI or standalone
// Package: @claude-flow/codex (first step toward coflow rebranding)

import {
  generateAgentsMd,
  generateSkillMd,
  generateConfigToml,
  CodexInitializer
} from '@claude-flow/codex';

// Or via the CLI
// npx @claude-flow/codex init
// npx @claude-flow/codex generate-skill --name my-skill

// Generate AGENTS.md
const agentsMd = await generateAgentsMd({
  projectName: 'my-project',
  description: 'Project description',
  buildCommand: 'npm run build',
  testCommand: 'npm test',
  template: 'default' // 'default' | 'minimal' | 'full'
});

// Generate a skill
const skill = await generateSkillMd({
  name: 'custom-skill',
  description: 'Custom skill description',
  triggers: ['when to use'],
  skipWhen: ['when to skip']
});

// Generate config.toml
const config = await generateConfigToml({
  model: 'gpt-5.3-codex',
  approvalPolicy: 'on-request',
  sandboxMode: 'workspace-write',
  mcpServers: [
    { name: 'claude-flow', command: 'npx', args: ['-y', '@claude-flow/cli@latest'] }
  ],
  skills: [
    { path: '.agents/skills/swarm-orchestration', enabled: true }
  ]
});

// Full initialization
const initializer = new CodexInitializer();
const result = await initializer.initialize({
  projectPath: '/path/to/project',
  template: 'default',
  skills: ['swarm', 'memory', 'sparc', 'security'],
  force: false
});

This completes the template specifications for the Codex integration.

CLI Commands

The @claude-flow/codex package provides the following commands:

# Initialize a new Codex project
npx @claude-flow/codex init

# Initialize with specific template
npx @claude-flow/codex init --template minimal

# Generate a new skill
npx @claude-flow/codex generate-skill --name custom-skill

# Migrate from Claude Code to Codex
npx @claude-flow/codex migrate --from claude.md

# Validate AGENTS.md and skills
npx @claude-flow/codex validate

# Generate dual-platform setup (Claude Code + Codex)
npx @claude-flow/codex init --dual

Integration with @claude-flow/cli

When using the main CLI, Codex support is available via:

# Initialize with Codex support
npx claude-flow@v3alpha init --codex

# Initialize with dual-platform support
npx claude-flow@v3alpha init --dual

# Future (after coflow rebrand)
npx coflow init --codex
npx coflow init --dual