refactor: Update all codex commands to use -s danger-full-access and correct syntax

- Move -s parameter to end of command: codex --full-auto exec "..." -s danger-full-access
- Change default sandbox mode from workspace-write to danger-full-access
- Add missing --full-auto parameter to commands requiring autonomous development
- Add missing exec parameter to all codex commands
- Add missing -s danger-full-access parameter to multi-line commands
- Update all documentation and examples to use consistent syntax
- Fix CLAUDE.md detection functionality in detect_changed_modules.sh script

Files updated:
- Core configuration: CLAUDE.md, RELEASE_NOTES_v1.3.0.md
- Documentation: tools-implementation-guide.md, intelligent-tools-strategy.md
- Command files: All .claude/commands/codex/*.md and workflow/*.md files
- Agent templates: action-planning-agent.md
- Scripts: detect_changed_modules.sh

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-16 13:11:13 +08:00
parent 972771d080
commit 1357756295
14 changed files with 89 additions and 84 deletions

View File

@@ -55,7 +55,7 @@ You are a pure execution agent specialized in creating actionable implementation
- **Method Selection**: Use method specified in each step (gemini/codex/manual/auto-detected) - **Method Selection**: Use method specified in each step (gemini/codex/manual/auto-detected)
- **CLI Commands**: - **CLI Commands**:
- **Gemini**: `bash(~/.claude/scripts/gemini-wrapper -p "$(cat template_path) [expanded_action]")` - **Gemini**: `bash(~/.claude/scripts/gemini-wrapper -p "$(cat template_path) [expanded_action]")`
- **Codex**: `bash(codex -s workspace-write --full-auto exec "$(cat template_path) [expanded_action]")` - **Codex**: `bash(codex --full-auto exec "$(cat template_path) [expanded_action]" -s danger-full-access)`
- **Follow Guidelines**: @~/.claude/workflows/intelligent-tools-strategy.md and @~/.claude/workflows/tools-implementation-guide.md - **Follow Guidelines**: @~/.claude/workflows/intelligent-tools-strategy.md and @~/.claude/workflows/tools-implementation-guide.md
### Pre-Execution Analysis ### Pre-Execution Analysis

View File

@@ -37,19 +37,19 @@ Quick analysis tool for codebase insights using intelligent pattern detection an
```bash ```bash
/codex:analyze "authentication patterns" /codex:analyze "authentication patterns"
``` ```
**Executes**: `codex exec "@{**/*auth*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)"` **Executes**: `codex --full-auto exec "@{**/*auth*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)" -s danger-full-access`
### Targeted Analysis ### Targeted Analysis
```bash ```bash
/codex:analyze "React component architecture" /codex:analyze "React component architecture"
``` ```
**Executes**: `codex exec "@{src/components/**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt)"` **Executes**: `codex --full-auto exec "@{src/components/**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt)" -s danger-full-access`
### Security Focus ### Security Focus
```bash ```bash
/codex:analyze "API security vulnerabilities" /codex:analyze "API security vulnerabilities"
``` ```
**Executes**: `codex exec "@{**/api/**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt)"` **Executes**: `codex --full-auto exec "@{**/api/**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt)" -s danger-full-access`
## Codex-Specific Patterns ## Codex-Specific Patterns
@@ -83,25 +83,25 @@ Templates are automatically selected based on analysis type:
### Technology Stack Analysis ### Technology Stack Analysis
```bash ```bash
/codex:analyze "project technology stack" /codex:analyze "project technology stack"
# Executes: codex exec "@{package.json,*.config.*,CLAUDE.md} [analysis prompt]" # Executes: codex --full-auto exec "@{package.json,*.config.*,CLAUDE.md} [analysis prompt]" -s danger-full-access
``` ```
### Code Quality Review ### Code Quality Review
```bash ```bash
/codex:analyze "code quality and standards" /codex:analyze "code quality and standards"
# Executes: codex exec "@{src/**/*,test/**/*,CLAUDE.md} [analysis prompt]" # Executes: codex --full-auto exec "@{src/**/*,test/**/*,CLAUDE.md} [analysis prompt]" -s danger-full-access
``` ```
### Migration Planning ### Migration Planning
```bash ```bash
/codex:analyze "legacy code modernization" /codex:analyze "legacy code modernization"
# Executes: codex exec "@{**/*.{js,jsx,ts,tsx},CLAUDE.md} [analysis prompt]" # Executes: codex --full-auto exec "@{**/*.{js,jsx,ts,tsx},CLAUDE.md} [analysis prompt]" -s danger-full-access
``` ```
### Module-Specific Analysis ### Module-Specific Analysis
```bash ```bash
/codex:analyze "authentication module patterns" /codex:analyze "authentication module patterns"
# Executes: codex exec "@{src/auth/**/*,**/*auth*,CLAUDE.md} [analysis prompt]" # Executes: codex --full-auto exec "@{src/auth/**/*,**/*auth*,CLAUDE.md} [analysis prompt]" -s danger-full-access
``` ```
## Output Format ## Output Format
@@ -117,7 +117,7 @@ Analysis results include:
### Basic Analysis Template ### Basic Analysis Template
```bash ```bash
codex exec "@{inferred_patterns} @{CLAUDE.md,**/*CLAUDE.md} codex --full-auto exec "@{inferred_patterns} @{CLAUDE.md,**/*CLAUDE.md}
Analysis Type: [analysis_type] Analysis Type: [analysis_type]
@@ -125,15 +125,15 @@ Provide:
- Pattern identification and analysis - Pattern identification and analysis
- Code quality assessment - Code quality assessment
- Architecture insights - Architecture insights
- Specific recommendations with file:line references" - Specific recommendations with file:line references" -s danger-full-access
``` ```
### Template-Enhanced Analysis ### Template-Enhanced Analysis
```bash ```bash
codex exec "@{inferred_patterns} @{CLAUDE.md,**/*CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/[template].txt) codex --full-auto exec "@{inferred_patterns} @{CLAUDE.md,**/*CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/[template].txt)
Focus: [analysis_type] Focus: [analysis_type]
Context: [user_description]" Context: [user_description]" -s danger-full-access
``` ```
## Error Prevention ## Error Prevention

View File

@@ -127,25 +127,25 @@ When `--save-session` flag is used:
#### Basic Development Chat #### Basic Development Chat
```bash ```bash
/codex:chat "implement password reset functionality" /codex:chat "implement password reset functionality"
# Executes: codex exec "@{CLAUDE.md,**/*CLAUDE.md,**/*auth*,**/*user*} implement password reset functionality" # Executes: codex --full-auto exec "@{CLAUDE.md,**/*CLAUDE.md,**/*auth*,**/*user*} implement password reset functionality" -s danger-full-access
``` ```
#### Architecture Discussion #### Architecture Discussion
```bash ```bash
/codex:chat "how should I structure the user management module?" /codex:chat "how should I structure the user management module?"
# Executes: codex exec "@{CLAUDE.md,**/*CLAUDE.md,**/*user*,src/**/*} how should I structure the user management module?" # Executes: codex --full-auto exec "@{CLAUDE.md,**/*CLAUDE.md,**/*user*,src/**/*} how should I structure the user management module?" -s danger-full-access
``` ```
#### Performance Optimization #### Performance Optimization
```bash ```bash
/codex:chat "optimize React component rendering performance" /codex:chat "optimize React component rendering performance"
# Executes: codex exec "@{CLAUDE.md,**/*CLAUDE.md,src/**/*.{jsx,tsx}} optimize React component rendering performance" # Executes: codex --full-auto exec "@{CLAUDE.md,**/*CLAUDE.md,src/**/*.{jsx,tsx}} optimize React component rendering performance" -s danger-full-access
``` ```
#### Full Auto Mode #### Full Auto Mode
```bash ```bash
/codex:chat "create a complete user dashboard with charts" --full-auto /codex:chat "create a complete user dashboard with charts" --full-auto
# Executes: codex -s workspace-write --full-auto "@{CLAUDE.md,**/*CLAUDE.md,**/*user*,**/*dashboard*} create a complete user dashboard with charts" # Executes: codex --full-auto exec "@{CLAUDE.md,**/*CLAUDE.md,**/*user*,**/*dashboard*} create a complete user dashboard with charts" -s danger-full-access
``` ```
### ⚠️ **Error Prevention** ### ⚠️ **Error Prevention**

View File

@@ -53,7 +53,7 @@ model: sonnet
```bash ```bash
/codex:execute "create complete todo application with React and TypeScript" /codex:execute "create complete todo application with React and TypeScript"
``` ```
**Process**: Uses `codex -s workspace-write --full-auto` for autonomous implementation **Process**: Uses `codex --full-auto ... -s danger-full-access` for autonomous implementation
## Context Inference Logic ## Context Inference Logic
@@ -105,7 +105,7 @@ model: sonnet
### User Description Template ### User Description Template
```bash ```bash
codex exec "@{inferred_patterns} @{CLAUDE.md,**/*CLAUDE.md} codex --full-auto exec "@{inferred_patterns} @{CLAUDE.md,**/*CLAUDE.md}
Implementation Task: [user_description] Implementation Task: [user_description]
@@ -113,23 +113,23 @@ Provide:
- Specific implementation code - Specific implementation code
- File modification locations (file:line) - File modification locations (file:line)
- Test cases - Test cases
- Integration guidance" - Integration guidance" -s danger-full-access
``` ```
### Task ID Template ### Task ID Template
```bash ```bash
codex exec "@{task_files} @{brainstorming_refs} @{CLAUDE.md,**/*CLAUDE.md} codex --full-auto exec "@{task_files} @{brainstorming_refs} @{CLAUDE.md,**/*CLAUDE.md}
Task: [task_title] (ID: [task-id]) Task: [task_title] (ID: [task-id])
Type: [task_type] Type: [task_type]
Scope: [task_scope] Scope: [task_scope]
Execute implementation following task acceptance criteria." Execute implementation following task acceptance criteria." -s danger-full-access
``` ```
### Full Auto Template ### Full Auto Template
```bash ```bash
codex -s workspace-write --full-auto "@{**/*} @{CLAUDE.md,**/*CLAUDE.md} codex --full-auto exec "@{**/*} @{CLAUDE.md,**/*CLAUDE.md}
Development Task: [user_description] Development Task: [user_description]
@@ -137,7 +137,7 @@ Autonomous implementation with:
- Architecture decisions - Architecture decisions
- Code generation - Code generation
- Testing - Testing
- Documentation" - Documentation" -s danger-full-access
``` ```
## Auto-Generated Outputs ## Auto-Generated Outputs

View File

@@ -19,7 +19,7 @@ Leverages Codex's `--full-auto` mode for autonomous development with intelligent
**Process**: Analyze Input → Select Templates → Gather Context → Execute Autonomous Development **Process**: Analyze Input → Select Templates → Gather Context → Execute Autonomous Development
⚠️ **Critical Feature**: Uses `codex -s workspace-write --full-auto` for maximum autonomous capability with mandatory `@` pattern requirements. ⚠️ **Critical Feature**: Uses `codex --full-auto ... -s danger-full-access` for maximum autonomous capability with mandatory `@` pattern requirements.
## Usage ## Usage
@@ -137,7 +137,7 @@ END FUNCTION
### Step 3: Execute with Full Auto Mode ### Step 3: Execute with Full Auto Mode
```bash ```bash
# Autonomous development execution with comprehensive context # Autonomous development execution with comprehensive context
codex -s workspace-write --full-auto "@{**/*} @{CLAUDE.md,**/*CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/[selected_template]) codex --full-auto "@{**/*} @{CLAUDE.md,**/*CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/[selected_template])
Development Task: [user_input] Development Task: [user_input]
@@ -146,7 +146,7 @@ Autonomous Implementation Requirements:
- Code generation with best practices - Code generation with best practices
- Automatic testing integration - Automatic testing integration
- Documentation updates - Documentation updates
- Error handling and validation" - Error handling and validation" -s danger-full-access
``` ```
## Essential Codex Auto Patterns ## Essential Codex Auto Patterns

View File

@@ -29,19 +29,19 @@ Systematic bug analysis, debugging, and automated fix implementation using exper
```bash ```bash
/codex:mode:bug-index "authentication error during login" /codex:mode:bug-index "authentication error during login"
``` ```
**Executes**: `codex exec "@{**/*auth*,**/*login*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)"` **Executes**: `codex --full-auto exec "@{**/*auth*,**/*login*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)" -s danger-full-access`
### Comprehensive Bug Investigation ### Comprehensive Bug Investigation
```bash ```bash
/codex:mode:bug-index "React state not updating in dashboard" /codex:mode:bug-index "React state not updating in dashboard"
``` ```
**Executes**: `codex exec "@{src/**/*.{jsx,tsx},**/*dashboard*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)"` **Executes**: `codex --full-auto exec "@{src/**/*.{jsx,tsx},**/*dashboard*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)" -s danger-full-access`
### Production Error Analysis ### Production Error Analysis
```bash ```bash
/codex:mode:bug-index "API timeout issues in production environment" /codex:mode:bug-index "API timeout issues in production environment"
``` ```
**Executes**: `codex exec "@{**/api/**/*,*.config.*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)"` **Executes**: `codex --full-auto exec "@{**/api/**/*,*.config.*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)" -s danger-full-access`
## Codex-Specific Debugging Patterns ## Codex-Specific Debugging Patterns
@@ -65,7 +65,7 @@ codex exec "@{inferred_bug_patterns} @{CLAUDE.md,**/*CLAUDE.md} $(cat ~/.claude/
Context: Comprehensive codebase analysis for bug investigation Context: Comprehensive codebase analysis for bug investigation
Bug Description: [user_description] Bug Description: [user_description]
Fix Implementation: Provide working code solutions" Fix Implementation: Provide working code solutions" -s danger-full-access
``` ```
## Bug Pattern Inference ## Bug Pattern Inference

View File

@@ -15,7 +15,7 @@ model: sonnet
## Overview ## Overview
Comprehensive development planning and implementation strategy using expert planning templates with Codex CLI. Comprehensive development planning and implementation strategy using expert planning templates with Codex CLI.
- **Directory Analysis Rule**: When user intends to analyze specific directory (cd XXX), use: `codex -s workspace-write --cd XXX --full-auto exec "prompt"` or `cd XXX && codex -s workspace-write --full-auto exec "@{**/*} prompt"` - **Directory Analysis Rule**: When user intends to analyze specific directory (cd XXX), use: `codex --cd XXX --full-auto exec "prompt" -s danger-full-access` or `cd XXX && codex --full-auto exec "@{**/*} prompt" -s danger-full-access`
- **Default Mode**: `--full-auto exec` autonomous development mode (RECOMMENDED for all tasks). - **Default Mode**: `--full-auto exec` autonomous development mode (RECOMMENDED for all tasks).
@@ -27,20 +27,20 @@ Comprehensive development planning and implementation strategy using expert plan
```bash ```bash
/codex:mode:plan "design authentication system with implementation" /codex:mode:plan "design authentication system with implementation"
``` ```
**Executes**: `codex -s workspace-write --full-auto exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt) design authentication system with implementation"` **Executes**: `codex --full-auto exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt) design authentication system with implementation" -s danger-full-access`
### Architecture Planning with Context ### Architecture Planning with Context
```bash ```bash
/codex:mode:plan "microservices migration strategy" /codex:mode:plan "microservices migration strategy"
``` ```
**Executes**: `codex -s workspace-write --full-auto exec "@{src/**/*,*.config.*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/migration.txt) microservices migration strategy"` **Executes**: `codex --full-auto exec "@{src/**/*,*.config.*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/migration.txt) microservices migration strategy" -s danger-full-access`
### Feature Implementation Planning ### Feature Implementation Planning
```bash ```bash
/codex:mode:plan "real-time notifications with WebSocket integration" /codex:mode:plan "real-time notifications with WebSocket integration"
``` ```
**Executes**: `codex -s workspace-write --full-auto exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) Additional Planning Context:$(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt) real-time notifications with WebSocket integration"` **Executes**: `codex --full-auto exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) Additional Planning Context:$(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt) real-time notifications with WebSocket integration" -s danger-full-access`
## Codex-Specific Planning Patterns ## Codex-Specific Planning Patterns

View File

@@ -113,7 +113,7 @@ Task(subagent_type="code-developer",
Output: pattern_analysis Output: pattern_analysis
Step 3 (implement): Implement JWT based on analysis Step 3 (implement): Implement JWT based on analysis
Command: codex -s workspace-write --full-auto exec 'Implement JWT using analysis: [pattern_analysis] and context: [dependency_context]' Command: codex --full-auto exec 'Implement JWT using analysis: [pattern_analysis] and context: [dependency_context]' -s danger-full-access
Session Context: Session Context:
- Workflow Directory: .workflow/WFS-user-auth/ - Workflow Directory: .workflow/WFS-user-auth/

View File

@@ -163,16 +163,16 @@ cd [module] && ~/.claude/scripts/gemini-wrapper -p "Find 3+ similar [feature_typ
#### Codex Analysis Templates #### Codex Analysis Templates
```bash ```bash
# Architectural analysis # Architectural analysis
codex -s workspace-write --full-auto exec "analyze [scope] architecture and identify optimization opportunities" codex --full-auto exec "analyze [scope] architecture and identify optimization opportunities" -s danger-full-access
# Pattern-based development # Pattern-based development
codex -s workspace-write --full-auto exec "analyze existing patterns for [feature] implementation with concrete examples" codex --full-auto exec "analyze existing patterns for [feature] implementation with concrete examples" -s danger-full-access
# Project understanding # Project understanding
codex -s workspace-write --full-auto exec "analyze project structure, conventions, and development requirements" codex --full-auto exec "analyze project structure, conventions, and development requirements" -s danger-full-access
# Modernization analysis # Modernization analysis
codex -s workspace-write --full-auto exec "identify modernization opportunities and refactoring priorities" codex --full-auto exec "identify modernization opportunities and refactoring priorities" -s danger-full-access
``` ```
### Context Accumulation & Inheritance ### Context Accumulation & Inheritance

View File

@@ -55,7 +55,9 @@ detect_changed_modules() {
local types=$(find "$dir" -maxdepth 1 -type f -name "*.*" 2>/dev/null | \ local types=$(find "$dir" -maxdepth 1 -type f -name "*.*" 2>/dev/null | \
grep -E '\.[^/]*$' | sed 's/.*\.//' | sort -u | tr '\n' ',' | sed 's/,$//') grep -E '\.[^/]*$' | sed 's/.*\.//' | sort -u | tr '\n' ',' | sed 's/,$//')
echo "depth:$depth|path:$dir|files:$file_count|types:[$types]|status:changed" local has_claude="no"
[ -f "$dir/CLAUDE.md" ] && has_claude="yes"
echo "depth:$depth|path:$dir|files:$file_count|types:[$types]|has_claude:$has_claude|status:changed"
fi fi
done done
fi fi
@@ -69,7 +71,9 @@ detect_changed_modules() {
if [ -d "$dir" ]; then if [ -d "$dir" ]; then
local depth=$(echo "$dir" | tr -cd '/' | wc -c) local depth=$(echo "$dir" | tr -cd '/' | wc -c)
if [ "$dir" = "." ]; then depth=0; fi if [ "$dir" = "." ]; then depth=0; fi
echo "$depth:$dir" local claude_indicator=""
[ -f "$dir/CLAUDE.md" ] && claude_indicator=" [✓]"
echo "$depth:$dir$claude_indicator"
fi fi
done | sort -n | awk -F: ' done | sort -n | awk -F: '
{ {

View File

@@ -17,7 +17,7 @@ type: strategic-guideline
**Codex** (Development & Implementation): **Codex** (Development & Implementation):
```bash ```bash
codex -s workspace-write --full-auto exec "implement user authentication system" codex --full-auto exec "implement user authentication system" -s danger-full-access
``` ```
### ⚠️ CRITICAL Command Differences ### ⚠️ CRITICAL Command Differences
@@ -25,7 +25,7 @@ codex -s workspace-write --full-auto exec "implement user authentication system"
| Tool | Command | Has Wrapper | Key Feature | | Tool | Command | Has Wrapper | Key Feature |
|------|---------|-------------|-------------| |------|---------|-------------|-------------|
| **Gemini** | `~/.claude/scripts/gemini-wrapper` | ✅ YES | Large context window, pattern recognition | | **Gemini** | `~/.claude/scripts/gemini-wrapper` | ✅ YES | Large context window, pattern recognition |
| **Codex** | `codex -s workspace-write --full-auto exec` | ❌ NO | Autonomous development, math reasoning | | **Codex** | `codex --full-auto exec ... -s danger-full-access` | ❌ NO | Autonomous development, math reasoning |
**❌ NEVER use**: `~/.claude/scripts/codex` - this wrapper does not exist! **❌ NEVER use**: `~/.claude/scripts/codex` - this wrapper does not exist!
@@ -34,10 +34,10 @@ codex -s workspace-write --full-auto exec "implement user authentication system"
Codex requires the `-s` (sandbox) parameter for write operations: Codex requires the `-s` (sandbox) parameter for write operations:
- **`-s read-only`**: Safe analysis mode, no file modifications - **`-s read-only`**: Safe analysis mode, no file modifications
- **`-s workspace-write`**: Standard development mode, can modify project files (RECOMMENDED for development tasks) - **`-s workspace-write`**: Standard development mode, can modify project files
- **`-s danger-full-access`**: Full system access (use with extreme caution) - **`-s danger-full-access`**: Full system access (RECOMMENDED for development tasks)
**Default Choice**: Use `-s workspace-write` for all development and implementation tasks. **Default Choice**: Use `-s danger-full-access` for all development and implementation tasks.
## 🎯 Tool Selection Matrix ## 🎯 Tool Selection Matrix
@@ -52,7 +52,7 @@ Codex requires the `-s` (sandbox) parameter for write operations:
- Large codebase understanding - Large codebase understanding
### When to Use Codex ### When to Use Codex
- **Command**: `codex -s workspace-write --full-auto exec "prompt"` - **Command**: `codex --full-auto exec "prompt" -s danger-full-access`
- **Strengths**: Mathematical reasoning, autonomous development - **Strengths**: Mathematical reasoning, autonomous development
- **Best For**: - **Best For**:
- Complex algorithm analysis - Complex algorithm analysis
@@ -121,13 +121,13 @@ cd src && ~/.claude/scripts/gemini-wrapper -p "review overall architecture"
### Codex Quick Commands ### Codex Quick Commands
```bash ```bash
# Feature development # Feature development
codex -s workspace-write --full-auto exec "implement JWT authentication with refresh tokens" codex --full-auto exec "implement JWT authentication with refresh tokens" -s danger-full-access
# Performance optimization # Performance optimization
codex -s workspace-write --full-auto exec "optimize database queries in user service" codex --full-auto exec "optimize database queries in user service" -s danger-full-access
# Security enhancement # Security enhancement
codex -s workspace-write --full-auto exec "add input validation and sanitization" codex --full-auto exec "add input validation and sanitization" -s danger-full-access
``` ```
## 📋 Implementation Guidelines ## 📋 Implementation Guidelines
@@ -148,7 +148,7 @@ For comprehensive syntax, patterns, and advanced usage:
|---------|--------|-------| |---------|--------|-------|
| **Command Syntax** | Has wrapper script | Direct command only | | **Command Syntax** | Has wrapper script | Direct command only |
| **File Loading** | `--all-files` available | `@` patterns required | | **File Loading** | `--all-files` available | `@` patterns required |
| **Default Mode** | Interactive analysis | `-s workspace-write --full-auto exec` automation | | **Default Mode** | Interactive analysis | `--full-auto exec ... -s danger-full-access` automation |
| **Primary Use** | Analysis & planning | Development & implementation | | **Primary Use** | Analysis & planning | Development & implementation |
| **Context Window** | Very large | Standard with smart discovery | | **Context Window** | Very large | Standard with smart discovery |
| **Automation Level** | Manual implementation | Autonomous execution | | **Automation Level** | Manual implementation | Autonomous execution |

View File

@@ -232,14 +232,15 @@ gemini -p "@{**/*.ts} @{**/*.js} @{CLAUDE.md} Analyze authentication patterns"
Codex requires the `-s` (sandbox) parameter to control file modification permissions: Codex requires the `-s` (sandbox) parameter to control file modification permissions:
- **`-s read-only`**: Safe analysis mode, no file modifications allowed - **`-s read-only`**: Safe analysis mode, no file modifications allowed
- **`-s workspace-write`**: Standard development mode, can modify project files (**RECOMMENDED for development tasks**) - **`-s workspace-write`**: Standard development mode, can modify project files
- **`-s danger-full-access`**: Full system access (**RECOMMENDED for development tasks**)
- **`-s danger-full-access`**: Full system access, use with extreme caution - **`-s danger-full-access`**: Full system access, use with extreme caution
**Default Choice**: Always use `-s workspace-write` for development and implementation tasks. **Default Choice**: Always use `-s danger-full-access` for development and implementation tasks.
### ⭐ CRITICAL: Default to `--full-auto` Mode ### ⭐ CRITICAL: Default to `--full-auto` Mode
**🎯 Golden Rule**: Always start with `codex -s workspace-write --full-auto exec "task description"` for maximum autonomous capabilities. **🎯 Golden Rule**: Always start with `codex --full-auto exec "task description" -s danger-full-access` for maximum autonomous capabilities.
**Why `--full-auto` Should Be Your Default**: **Why `--full-auto` Should Be Your Default**:
- **🧠 Intelligent File Discovery**: Auto-identifies relevant files without manual `@` patterns - **🧠 Intelligent File Discovery**: Auto-identifies relevant files without manual `@` patterns
@@ -258,16 +259,16 @@ Codex requires the `-s` (sandbox) parameter to control file modification permiss
**Basic Structure** (Priority Order): **Basic Structure** (Priority Order):
```bash ```bash
codex -s workspace-write --full-auto exec "autonomous development task" # DEFAULT & RECOMMENDED codex --full-auto exec "autonomous development task" -s danger-full-access # DEFAULT & RECOMMENDED
codex -s workspace-write --full-auto exec "prompt with @{patterns}" # For specific control needs codex --full-auto exec "prompt with @{patterns}" -s danger-full-access # For specific control needs
``` ```
**⚠️ NEVER use**: `~/.claude/scripts/codex` - this wrapper script does not exist! **⚠️ NEVER use**: `~/.claude/scripts/codex` - this wrapper script does not exist!
**Key Commands** (In Order of Preference): **Key Commands** (In Order of Preference):
- `codex -s workspace-write --full-auto exec "..."`**PRIMARY MODE** - Full autonomous development - `codex --full-auto exec "..." -s danger-full-access`**PRIMARY MODE** - Full autonomous development
- `codex -s workspace-write --cd /path --full-auto exec "..."` - Directory-specific autonomous development - `codex --cd /path --full-auto exec "..." -s danger-full-access` - Directory-specific autonomous development
- `codex -s workspace-write --cd /path --full-auto exec "@{patterns} ..."` - Directory-specific with patterns - `codex --cd /path --full-auto exec "@{patterns} ..." -s danger-full-access` - Directory-specific with patterns
### 📦 Codex Usage Patterns ### 📦 Codex Usage Patterns
@@ -276,24 +277,24 @@ codex -s workspace-write --full-auto exec "prompt with @{patterns}" # For s
**Basic Development**: **Basic Development**:
```bash ```bash
# RECOMMENDED: Let Codex handle everything autonomously # RECOMMENDED: Let Codex handle everything autonomously
codex -s workspace-write --full-auto exec "Implement user authentication with JWT tokens" codex --full-auto exec "Implement user authentication with JWT tokens" -s danger-full-access
# Directory-specific autonomous development # Directory-specific autonomous development
codex -s workspace-write --cd src/auth --full-auto exec "Refactor authentication module using latest patterns" codex --cd src/auth --full-auto exec "Refactor authentication module using latest patterns" -s danger-full-access
# Complex feature development # Complex feature development
codex -s workspace-write --full-auto exec "Create a complete todo application with React and TypeScript" codex --full-auto exec "Create a complete todo application with React and TypeScript" -s danger-full-access
``` ```
**Template-Enhanced Development**: **Template-Enhanced Development**:
```bash ```bash
# Autonomous mode with template guidance # Autonomous mode with template guidance
codex -s workspace-write --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt)
## Task: User Authentication System ## Task: User Authentication System
- JWT token management - JWT token management
- Role-based access control - Role-based access control
- Password reset functionality" - Password reset functionality" -s danger-full-access
``` ```
#### 🛠️ Controlled Development (When Explicit Control Needed) #### 🛠️ Controlled Development (When Explicit Control Needed)
@@ -301,24 +302,24 @@ codex -s workspace-write --full-auto exec "$(cat ~/.claude/workflows/cli-templat
**Module-Specific with Patterns**: **Module-Specific with Patterns**:
```bash ```bash
# Explicit patterns when autonomous mode needs guidance # Explicit patterns when autonomous mode needs guidance
codex -s workspace-write --full-auto exec "@{src/auth/**/*,CLAUDE.md} Refactor authentication module using latest patterns" codex --full-auto exec "@{src/auth/**/*,CLAUDE.md} Refactor authentication module using latest patterns" -s danger-full-access
# Alternative: Directory-specific execution with explicit patterns # Alternative: Directory-specific execution with explicit patterns
codex -s workspace-write --cd src/auth --full-auto exec "@{**/*,../../CLAUDE.md} Refactor authentication module" codex --cd src/auth --full-auto exec "@{**/*,../../CLAUDE.md} Refactor authentication module" -s danger-full-access
``` ```
**Debugging & Analysis**: **Debugging & Analysis**:
```bash ```bash
# Autonomous debugging mode # Autonomous debugging mode
codex -s workspace-write --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt) codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)
## Issue: Performance degradation in user dashboard ## Issue: Performance degradation in user dashboard
- Identify bottlenecks in the codebase - Identify bottlenecks in the codebase
- Propose and implement optimizations - Propose and implement optimizations
- Add performance monitoring" - Add performance monitoring" -s danger-full-access
# Alternative: Explicit patterns for controlled analysis # Alternative: Explicit patterns for controlled analysis
codex -s workspace-write --full-auto exec "@{src/**/*,package.json,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)" codex --full-auto exec "@{src/**/*,package.json,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)" -s danger-full-access
``` ```
### 📂 Codex File Pattern Rules - CRITICAL ### 📂 Codex File Pattern Rules - CRITICAL
@@ -345,26 +346,26 @@ codex -s workspace-write --full-auto exec "@{src/**/*,package.json,CLAUDE.md} $(
```bash ```bash
# Phase 1: Autonomous Analysis # Phase 1: Autonomous Analysis
codex -s workspace-write --full-auto exec "Analyze current architecture for payment system integration" codex --full-auto exec "Analyze current architecture for payment system integration" -s danger-full-access
# Phase 2: Autonomous Implementation (RECOMMENDED APPROACH) # Phase 2: Autonomous Implementation (RECOMMENDED APPROACH)
codex -s workspace-write --full-auto exec "Implement Stripe payment integration based on the analyzed architecture" codex --full-auto exec "Implement Stripe payment integration based on the analyzed architecture" -s danger-full-access
# Phase 3: Autonomous Testing # Phase 3: Autonomous Testing
codex -s workspace-write --full-auto exec "Generate comprehensive tests for the payment system implementation" codex --full-auto exec "Generate comprehensive tests for the payment system implementation" -s danger-full-access
# Alternative: Explicit control when needed # Alternative: Explicit control when needed
codex -s workspace-write --full-auto exec "@{**/*,CLAUDE.md} Analyze current architecture for payment system integration" codex --full-auto exec "@{**/*,CLAUDE.md} Analyze current architecture for payment system integration" -s danger-full-access
``` ```
#### 🌐 Cross-Project Learning #### 🌐 Cross-Project Learning
```bash ```bash
# RECOMMENDED: Autonomous cross-project pattern learning # RECOMMENDED: Autonomous cross-project pattern learning
codex -s workspace-write --full-auto exec "Implement feature X by learning patterns from ../other-project/ and applying them to the current codebase" codex --full-auto exec "Implement feature X by learning patterns from ../other-project/ and applying them to the current codebase" -s danger-full-access
# Alternative: Explicit pattern specification # Alternative: Explicit pattern specification
codex -s workspace-write --full-auto exec "@{../other-project/src/**/*,src/**/*,CLAUDE.md} Implement feature X using patterns from other-project" codex --full-auto exec "@{../other-project/src/**/*,src/**/*,CLAUDE.md} Implement feature X using patterns from other-project" -s danger-full-access
``` ```
#### 📊 Development Workflow Integration #### 📊 Development Workflow Integration
@@ -372,17 +373,17 @@ codex -s workspace-write --full-auto exec "@{../other-project/src/**/*,src/**/*,
**Pre-Development Analysis**: **Pre-Development Analysis**:
```bash ```bash
# RECOMMENDED: Autonomous pattern analysis # RECOMMENDED: Autonomous pattern analysis
codex -s workspace-write --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)
Analyze the existing codebase patterns and conventions before implementing new features." Analyze the existing codebase patterns and conventions before implementing new features." -s danger-full-access
``` ```
**Quality Assurance**: **Quality Assurance**:
```bash ```bash
# RECOMMENDED: Autonomous testing and validation # RECOMMENDED: Autonomous testing and validation
codex -s workspace-write --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/testing.txt) codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/testing.txt)
Generate comprehensive tests and perform validation for the entire codebase." Generate comprehensive tests and perform validation for the entire codebase." -s danger-full-access
``` ```
### ⚠️ Codex Best Practices ### ⚠️ Codex Best Practices
@@ -394,7 +395,7 @@ Generate comprehensive tests and perform validation for the entire codebase."
- **Be selective**: Use specific patterns like `@{src/**/*.ts}` for targeted analysis - **Be selective**: Use specific patterns like `@{src/**/*.ts}` for targeted analysis
**Default Automation Mode** (CRITICAL GUIDANCE): **Default Automation Mode** (CRITICAL GUIDANCE):
- **`codex -s workspace-write --full-auto exec` is PRIMARY choice**: Use for 90% of all tasks - maximizes autonomous capabilities - **`codex --full-auto exec ... -s danger-full-access` is PRIMARY choice**: Use for 90% of all tasks - maximizes autonomous capabilities
- **Explicit patterns only when necessary**: Reserve for cases where you need explicit file pattern control - **Explicit patterns only when necessary**: Reserve for cases where you need explicit file pattern control
- **Trust the autonomous intelligence**: Codex excels at file discovery, context gathering, and architectural decisions - **Trust the autonomous intelligence**: Codex excels at file discovery, context gathering, and architectural decisions
- **Start with full-auto always**: If it doesn't meet needs, then consider explicit patterns - **Start with full-auto always**: If it doesn't meet needs, then consider explicit patterns
@@ -428,4 +429,4 @@ Generate comprehensive tests and perform validation for the entire codebase."
**Remember**: **Remember**:
- **Gemini excels at understanding** - use `~/.claude/scripts/gemini-wrapper` for analysis and pattern recognition - **Gemini excels at understanding** - use `~/.claude/scripts/gemini-wrapper` for analysis and pattern recognition
- **Codex excels at building** - use `codex -s workspace-write --full-auto exec` for autonomous development and implementation - **Codex excels at building** - use `codex --full-auto exec ... -s danger-full-access` for autonomous development and implementation

View File

@@ -19,7 +19,7 @@ For all CLI tool usage, command syntax, and integration guidelines:
Bash(cd [module] && ~/.claude/scripts/gemini-wrapper -p "analyze [scope] architecture") Bash(cd [module] && ~/.claude/scripts/gemini-wrapper -p "analyze [scope] architecture")
Bash(codex -s workspace-write --full-auto exec "analyze [scope] architecture") Bash(codex --full-auto exec "analyze [scope] architecture" -s danger-full-access)
**Context Requirements**: **Context Requirements**:
- Identify 3+ existing similar patterns before implementation - Identify 3+ existing similar patterns before implementation

View File

@@ -166,10 +166,10 @@ cd [module] && ~/.claude/scripts/gemini-wrapper -p "Analyze patterns, convention
#### **Codex Analysis Templates** #### **Codex Analysis Templates**
```bash ```bash
# Architectural analysis # Architectural analysis
codex -s workspace-write --full-auto exec "analyze [scope] architecture and identify optimization opportunities" codex --full-auto exec "analyze [scope] architecture and identify optimization opportunities" -s danger-full-access
# Pattern-based development # Pattern-based development
codex -s workspace-write --full-auto exec "analyze existing patterns for [feature] implementation with examples" codex --full-auto exec "analyze existing patterns for [feature] implementation with examples" -s danger-full-access
``` ```
### **Improved Command Structure** ### **Improved Command Structure**