feat: Add Codex CLI support as alternative analysis method in workflow system

## Major Changes
- Add --AM flag to /workflow:plan command for analysis method selection
- Support both Gemini CLI (pattern-based) and Codex CLI (autonomous) analysis
- Implement dual marker system: [GEMINI_CLI_REQUIRED] and [CODEX_CLI_REQUIRED]
- Update all 4 agents to handle both analysis markers
- Create analysis method templates for standardized CLI usage

## Files Modified
- workflow-architecture.md: Add Analysis Method Integration section
- plan.md: Add --AM flag and bilingual rule standardization
- execute.md: Update marker mapping logic and standardize to English
- 4 agent files: Add dual CLI support with usage guidelines
- New: analysis-methods/ templates for Gemini and Codex CLI

## Backward Compatibility
- Gemini CLI remains default analysis method
- Existing workflows continue to work unchanged
- Progressive enhancement for autonomous development scenarios

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-12 23:40:12 +08:00
parent 2038d83398
commit 685c0f7f79
7 changed files with 215 additions and 56 deletions

View File

@@ -47,27 +47,31 @@ You will review code changes AND handle test implementation by understanding the
9. **Regression Testing**: Create tests that prevent future regressions
10. **Test Strategy**: Recommend appropriate testing strategies (unit, integration, e2e) based on code changes
## Gemini CLI Context Activation Rules
## Analysis CLI Context Activation Rules
**🎯 GEMINI_CLI_REQUIRED Flag Detection**
When task assignment includes `[GEMINI_CLI_REQUIRED]` flag:
1. **MANDATORY**: Execute Gemini CLI context gathering as first step
2. **REQUIRED**: Use Code Review Context Template from gemini-agent-templates.md
3. **PROCEED**: Only after understanding changes and repository standards
**🎯 Analysis Marker Detection**
When task assignment includes analysis markers:
- **[GEMINI_CLI_REQUIRED]**: Execute Gemini CLI context gathering as first step
- **[CODEX_CLI_REQUIRED]**: Execute Codex CLI autonomous analysis as first step
**Context Gathering Decision Logic**:
```
IF task contains [GEMINI_CLI_REQUIRED] flag:
→ Execute Gemini CLI context gathering (MANDATORY)
→ Use pattern-based code review analysis
ELIF task contains [CODEX_CLI_REQUIRED] flag:
→ Execute Codex CLI autonomous analysis (MANDATORY)
→ Use autonomous development context for review
ELIF reviewing >3 files OR security changes OR architecture modifications:
→ Execute Gemini CLI context gathering (AUTO-TRIGGER)
→ Execute Gemini CLI context gathering (AUTO-TRIGGER, default)
ELSE:
→ Proceed with review using standard quality checks
```
## Context Gathering Phase (Execute When Required)
When GEMINI_CLI_REQUIRED flag is present or complexity triggers apply, gather precise, change-focused context:
### Gemini CLI Context Gathering
When [GEMINI_CLI_REQUIRED] flag is present or complexity triggers apply, gather precise, change-focused context:
Use the targeted review context template:
@~/.claude/workflows/gemini-unified.md
@@ -79,6 +83,19 @@ This executes a change-specific Gemini CLI command that identifies:
- **Test coverage validation**: Whether changes are properly tested
- **Integration verification**: If necessary integration points are handled
### Codex CLI Context Gathering
When [CODEX_CLI_REQUIRED] flag is present, execute autonomous analysis:
Use the autonomous development context template:
@~/.claude/workflows/codex-unified.md
This executes autonomous Codex CLI analysis that provides:
- **Autonomous understanding**: Intelligent discovery of implementation context
- **Code generation insights**: Autonomous development recommendations
- **System-wide impact**: Comprehensive integration analysis
- **Automated testing strategy**: Autonomous test implementation approach
- **Quality assurance**: Self-guided validation and optimization recommendations
**Context Application for Review**:
- Review changes against repository-specific standards for similar code
- Compare implementation approach with established patterns for this type of feature