feat: Update workflow architecture documentation and clean up scripts

- Update agent definitions with enhanced context and flow control
- Standardize command templates for consistent CLI tool integration
- Improve gemini-wrapper with better token management and path handling
- Simplify qwen-wrapper for streamlined execution
- Enhance intelligent-tools-strategy with directory navigation patterns
- Add proper quoting for Windows path compatibility in all commands
- Update workflow planning documentation with current architectural insights

These changes align the command system with the four-layer architecture
analysis and improve cross-platform compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-28 14:34:50 +08:00
parent 8baca52175
commit b956943f15
14 changed files with 182 additions and 129 deletions

View File

@@ -73,7 +73,7 @@ development_type: feature|component|refactor|debug|testing
### Step 1: Template Discovery
```bash
# Dynamically discover development templates
cd ~/.claude/workflows/cli-templates/prompts && echo "Discovering development templates..." && for dir in development automation analysis integration; do if [ -d "$dir" ]; then echo "=== $dir templates ==="; for template_file in "$dir"/*.txt; do if [ -f "$template_file" ]; then echo "Template: $(basename "$template_file")"; head -10 "$template_file" 2>/dev/null | grep -E "^(name|description|keywords):" || echo "No metadata"; echo; fi; done; fi; done
cd "~/.claude/workflows/cli-templates/prompts" && echo "Discovering development templates..." && for dir in development automation analysis integration; do if [ -d "$dir" ]; then echo "=== $dir templates ==="; for template_file in "$dir"/*.txt; do if [ -f "$template_file" ]; then echo "Template: $(basename "$template_file")"; head -10 "$template_file" 2>/dev/null | grep -E "^(name|description|keywords):" || echo "No metadata"; echo; fi; done; fi; done
```
### Step 2: Dynamic Template Analysis & Selection

View File

@@ -15,7 +15,7 @@ model: sonnet
## Overview
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 --cd XXX --full-auto exec "prompt" -s danger-full-access` or `cd XXX && codex --full-auto exec "@{**/*} prompt" -s danger-full-access`
- **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).

View File

@@ -19,7 +19,7 @@ Automatically analyzes user input to select the most appropriate template and ex
**Directory Analysis Rule**: Intelligent detection of directory context intent - automatically navigate to target directory when analysis scope is directory-specific.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd "[path]" && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**Process**: List Templates → Analyze Input → Select Template → Execute with Context
@@ -72,7 +72,7 @@ keywords: [keyword1, keyword2, keyword3]
### Step 1: Template Discovery
```bash
# Dynamically discover all templates and extract YAML frontmatter
cd ~/.claude/prompt-templates && echo "Discovering templates..." && for template_file in *.md; do echo "=== $template_file ==="; head -6 "$template_file" 2>/dev/null || echo "Error reading $template_file"; echo; done
cd "~/.claude/prompt-templates" && echo "Discovering templates..." && for template_file in *.md; do echo "=== $template_file ==="; head -6 "$template_file" 2>/dev/null || echo "Error reading $template_file"; echo; done
```
### Step 2: Dynamic Template Analysis & Selection
@@ -131,7 +131,7 @@ gemini --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
User Input: [user_input]"
# With --cd parameter
cd [specified_directory] && gemini --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
cd "[specified_directory]" && gemini --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
User Input: [user_input]"
```

View File

@@ -18,7 +18,7 @@ Systematic bug analysis and fix suggestions using expert diagnostic template.
**Directory Analysis Rule**: Intelligent detection of directory context intent - automatically navigate to target directory when analysis scope is directory-specific.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd "[path]" && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
## Usage
@@ -50,7 +50,7 @@ gemini --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
Bug Description: [user_description]"
# With --cd parameter
cd [specified_directory] && gemini --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
cd "[specified_directory]" && gemini --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
Bug Description: [user_description]"
```

View File

@@ -19,7 +19,7 @@ model: sonnet
### Key Features
- **Gemini CLI Integration**: Utilizes Gemini CLI's deep codebase analysis for informed planning decisions
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd "[path]" && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
## Usage
@@ -44,7 +44,7 @@ gemini --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
Planning Topic: [user_description]"
# Directory-specific analysis
cd [directory] && gemini --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
cd "[directory]" && gemini --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
Planning Topic: [user_description]"
```

View File

@@ -19,7 +19,7 @@ Automatically analyzes user input to select the most appropriate template and ex
**Directory Analysis Rule**: Intelligent detection of directory context intent - automatically navigate to target directory when analysis scope is directory-specific.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && qwen --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd "[path]" && qwen --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**Process**: List Templates → Analyze Input → Select Template → Execute with Context
@@ -72,7 +72,7 @@ keywords: [keyword1, keyword2, keyword3]
### Step 1: Template Discovery
```bash
# Dynamically discover all templates and extract YAML frontmatter
cd ~/.claude/prompt-templates && echo "Discovering templates..." && for template_file in *.md; do echo "=== $template_file ==="; head -6 "$template_file" 2>/dev/null || echo "Error reading $template_file"; echo; done
cd "~/.claude/prompt-templates" && echo "Discovering templates..." && for template_file in *.md; do echo "=== $template_file ==="; head -6 "$template_file" 2>/dev/null || echo "Error reading $template_file"; echo; done
```
### Step 2: Dynamic Template Analysis & Selection
@@ -131,7 +131,7 @@ qwen --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
User Input: [user_input]"
# With --cd parameter
cd [specified_directory] && qwen --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
cd "[specified_directory]" && qwen --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
User Input: [user_input]"
```

View File

@@ -18,7 +18,7 @@ Systematic bug analysis and fix suggestions using expert diagnostic template.
**Directory Analysis Rule**: Intelligent detection of directory context intent - automatically navigate to target directory when analysis scope is directory-specific.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && qwen --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd "[path]" && qwen --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
## Usage
@@ -50,7 +50,7 @@ qwen --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
Bug Description: [user_description]"
# With --cd parameter
cd [specified_directory] && qwen --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
cd "[specified_directory]" && qwen --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
Bug Description: [user_description]"
```

View File

@@ -19,7 +19,7 @@ model: sonnet
### Key Features
- **qwen CLI Integration**: Utilizes qwen CLI's deep codebase analysis for informed planning decisions
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && qwen --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd "[path]" && qwen --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
## Usage
@@ -44,7 +44,7 @@ qwen --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
Planning Topic: [user_description]"
# Directory-specific analysis
cd [directory] && qwen --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
cd "[directory]" && qwen --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
Planning Topic: [user_description]"
```

View File

@@ -41,7 +41,7 @@ The command performs comprehensive analysis through:
- **Simple tasks** (≤3 modules): Direct CLI tools with intelligent path navigation and multi-round analysis
```bash
# Analyze specific directory
~/.claude/scripts/gemini-wrapper -C src/auth -p "
cd "src/auth" && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: Analyze authentication patterns
TASK: Review auth implementation for security patterns
CONTEXT: Focus on JWT handling and user validation
@@ -106,7 +106,7 @@ The following pre_analysis steps are generated for agent execution:
{
"step": "analyze_patterns",
"action": "Analyze codebase patterns and architecture using CLI tools with directory context",
"command": "bash(~/.claude/scripts/gemini-wrapper -C [target_directory] -p \"PURPOSE: Analyze existing patterns TASK: Identify implementation patterns for [task_type] CONTEXT: [planning_context] [dependency_context] EXPECTED: Pattern analysis and recommendations RULES: Focus on architectural consistency\")",
"command": "bash(cd \"[target_directory]\" && ~/.claude/scripts/gemini-wrapper -p \"PURPOSE: Analyze existing patterns TASK: Identify implementation patterns for [task_type] CONTEXT: [planning_context] [dependency_context] EXPECTED: Pattern analysis and recommendations RULES: Focus on architectural consistency\")",
"output_to": "pattern_analysis",
"on_error": "skip_optional"
},