mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-13 02:41:50 +08:00
feat: Add multi-tool support for CLAUDE.md documentation generation (v3.4.1)
Add flexible tool selection (gemini/qwen/codex) for documentation updates, allowing users to choose the best tool for their analysis needs. Changes: - Add --tool parameter to /update-memory-full and /update-memory-related - Enhance update_module_claude.sh with tool routing (gemini|qwen|codex) - Update command documentation with tool selection examples - Add CHANGELOG entry for v3.4.1 Tool features: - Gemini (default): Documentation generation, pattern recognition - Qwen: Architecture analysis, system design (direct command, no wrapper) - Codex: Implementation validation, code quality analysis Backward compatible: Commands default to gemini without --tool parameter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,33 +1,46 @@
|
|||||||
---
|
---
|
||||||
name: update-memory-full
|
name: update-memory-full
|
||||||
description: Complete project-wide CLAUDE.md documentation update
|
description: Complete project-wide CLAUDE.md documentation update
|
||||||
usage: /update-memory-full
|
usage: /update-memory-full [--tool <gemini|qwen|codex>]
|
||||||
|
argument-hint: "[--tool gemini|qwen|codex]"
|
||||||
examples:
|
examples:
|
||||||
- /update-memory-full # Full project documentation update
|
- /update-memory-full # Full project documentation update (gemini default)
|
||||||
|
- /update-memory-full --tool qwen # Use Qwen for architecture analysis
|
||||||
|
- /update-memory-full --tool codex # Use Codex for implementation validation
|
||||||
---
|
---
|
||||||
|
|
||||||
### 🚀 Command Overview: `/update-memory-full`
|
### 🚀 Command Overview: `/update-memory-full`
|
||||||
|
|
||||||
Complete project-wide documentation update using depth-parallel execution.
|
Complete project-wide documentation update using depth-parallel execution.
|
||||||
|
|
||||||
|
**Tool Selection**:
|
||||||
|
- **Gemini (default)**: Documentation generation, pattern recognition, architecture review
|
||||||
|
- **Qwen**: Architecture analysis, system design documentation
|
||||||
|
- **Codex**: Implementation validation, code quality analysis
|
||||||
|
|
||||||
### 📝 Execution Template
|
### 📝 Execution Template
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Complete project-wide CLAUDE.md documentation update
|
# Complete project-wide CLAUDE.md documentation update
|
||||||
|
|
||||||
# Step 1: Code Index architecture analysis
|
# Step 1: Parse tool selection (default: gemini)
|
||||||
|
tool="gemini"
|
||||||
|
[[ "$*" == *"--tool qwen"* ]] && tool="qwen"
|
||||||
|
[[ "$*" == *"--tool codex"* ]] && tool="codex"
|
||||||
|
|
||||||
|
# Step 2: Code Index architecture analysis
|
||||||
mcp__code-index__search_code_advanced(pattern="class|function|interface", file_pattern="**/*.{ts,js,py}")
|
mcp__code-index__search_code_advanced(pattern="class|function|interface", file_pattern="**/*.{ts,js,py}")
|
||||||
mcp__code-index__find_files(pattern="**/*.{md,json,yaml,yml}")
|
mcp__code-index__find_files(pattern="**/*.{md,json,yaml,yml}")
|
||||||
|
|
||||||
# Step 2: Cache git changes
|
# Step 3: Cache git changes
|
||||||
Bash(git add -A 2>/dev/null || true)
|
Bash(git add -A 2>/dev/null || true)
|
||||||
|
|
||||||
# Step 3: Get and display project structure
|
# Step 4: Get and display project structure
|
||||||
modules=$(Bash(~/.claude/scripts/get_modules_by_depth.sh list))
|
modules=$(Bash(~/.claude/scripts/get_modules_by_depth.sh list))
|
||||||
count=$(echo "$modules" | wc -l)
|
count=$(echo "$modules" | wc -l)
|
||||||
|
|
||||||
# Step 3: Analysis handover → Model takes control
|
# Step 5: Analysis handover → Model takes control
|
||||||
# BASH_EXECUTION_STOPS → MODEL_ANALYSIS_BEGINS
|
# BASH_EXECUTION_STOPS → MODEL_ANALYSIS_BEGINS
|
||||||
|
|
||||||
# Pseudocode flow:
|
# Pseudocode flow:
|
||||||
@@ -35,6 +48,8 @@ count=$(echo "$modules" | wc -l)
|
|||||||
# → Task "Complex project full update" subagent_type: "memory-gemini-bridge"
|
# → Task "Complex project full update" subagent_type: "memory-gemini-bridge"
|
||||||
# ELSE:
|
# ELSE:
|
||||||
# → Present plan and WAIT FOR USER APPROVAL before execution
|
# → Present plan and WAIT FOR USER APPROVAL before execution
|
||||||
|
#
|
||||||
|
# Pass tool parameter to update_module_claude.sh: "$tool"
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🧠 Model Analysis Phase
|
### 🧠 Model Analysis Phase
|
||||||
@@ -56,6 +71,8 @@ After the bash script completes the initial analysis, the model takes control to
|
|||||||
Model will present detailed plan:
|
Model will present detailed plan:
|
||||||
```
|
```
|
||||||
📋 Update Plan:
|
📋 Update Plan:
|
||||||
|
Tool: [gemini|qwen|codex] (from --tool parameter)
|
||||||
|
|
||||||
NEW CLAUDE.md files (X):
|
NEW CLAUDE.md files (X):
|
||||||
- ./src/components/CLAUDE.md
|
- ./src/components/CLAUDE.md
|
||||||
- ./src/services/CLAUDE.md
|
- ./src/services/CLAUDE.md
|
||||||
@@ -84,7 +101,7 @@ depth_modules = organize_by_depth(modules)
|
|||||||
FOR depth FROM max_depth DOWN TO 0:
|
FOR depth FROM max_depth DOWN TO 0:
|
||||||
FOR each module IN depth_modules[depth]:
|
FOR each module IN depth_modules[depth]:
|
||||||
WHILE active_jobs >= 4: wait(0.1)
|
WHILE active_jobs >= 4: wait(0.1)
|
||||||
Bash(~/.claude/scripts/update_module_claude.sh "$module" "full" &)
|
Bash(~/.claude/scripts/update_module_claude.sh "$module" "full" "$tool" &)
|
||||||
wait_all_jobs()
|
wait_all_jobs()
|
||||||
|
|
||||||
# Step 6: Safety check and restore staging state
|
# Step 6: Safety check and restore staging state
|
||||||
@@ -105,7 +122,7 @@ Bash(git status --short)
|
|||||||
The model will delegate to the memory-gemini-bridge agent using the Task tool:
|
The model will delegate to the memory-gemini-bridge agent using the Task tool:
|
||||||
```
|
```
|
||||||
Task "Complex project full update"
|
Task "Complex project full update"
|
||||||
prompt: "Execute full documentation update for [count] modules using depth-parallel execution"
|
prompt: "Execute full documentation update for [count] modules using [tool] with depth-parallel execution"
|
||||||
subagent_type: "memory-gemini-bridge"
|
subagent_type: "memory-gemini-bridge"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
---
|
---
|
||||||
name: update-memory-related
|
name: update-memory-related
|
||||||
description: Context-aware CLAUDE.md documentation updates based on recent changes
|
description: Context-aware CLAUDE.md documentation updates based on recent changes
|
||||||
usage: /update-memory-related
|
usage: /update-memory-related [--tool <gemini|qwen|codex>]
|
||||||
|
argument-hint: "[--tool gemini|qwen|codex]"
|
||||||
examples:
|
examples:
|
||||||
- /update-memory-related # Update documentation based on recent changes
|
- /update-memory-related # Update documentation based on recent changes (gemini default)
|
||||||
|
- /update-memory-related --tool qwen # Use Qwen for architecture analysis
|
||||||
|
- /update-memory-related --tool codex # Use Codex for implementation validation
|
||||||
---
|
---
|
||||||
|
|
||||||
### 🚀 Command Overview: `/update-memory-related`
|
### 🚀 Command Overview: `/update-memory-related`
|
||||||
|
|
||||||
Context-aware documentation update for modules affected by recent changes.
|
Context-aware documentation update for modules affected by recent changes.
|
||||||
|
|
||||||
|
**Tool Selection**:
|
||||||
|
- **Gemini (default)**: Documentation generation, pattern recognition, architecture review
|
||||||
|
- **Qwen**: Architecture analysis, system design documentation
|
||||||
|
- **Codex**: Implementation validation, code quality analysis
|
||||||
|
|
||||||
|
|
||||||
### 📝 Execution Template
|
### 📝 Execution Template
|
||||||
|
|
||||||
@@ -17,23 +25,28 @@ Context-aware documentation update for modules affected by recent changes.
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Context-aware CLAUDE.md documentation update
|
# Context-aware CLAUDE.md documentation update
|
||||||
|
|
||||||
# Step 1: Code Index refresh and architecture analysis
|
# Step 1: Parse tool selection (default: gemini)
|
||||||
|
tool="gemini"
|
||||||
|
[[ "$*" == *"--tool qwen"* ]] && tool="qwen"
|
||||||
|
[[ "$*" == *"--tool codex"* ]] && tool="codex"
|
||||||
|
|
||||||
|
# Step 2: Code Index refresh and architecture analysis
|
||||||
mcp__code-index__refresh_index()
|
mcp__code-index__refresh_index()
|
||||||
mcp__code-index__search_code_advanced(pattern="class|function|interface", file_pattern="**/*.{ts,js,py}")
|
mcp__code-index__search_code_advanced(pattern="class|function|interface", file_pattern="**/*.{ts,js,py}")
|
||||||
|
|
||||||
# Step 2: Detect changed modules (before staging)
|
# Step 3: Detect changed modules (before staging)
|
||||||
changed=$(Bash(~/.claude/scripts/detect_changed_modules.sh list))
|
changed=$(Bash(~/.claude/scripts/detect_changed_modules.sh list))
|
||||||
|
|
||||||
# Step 3: Cache git changes (protect current state)
|
# Step 4: Cache git changes (protect current state)
|
||||||
Bash(git add -A 2>/dev/null || true)
|
Bash(git add -A 2>/dev/null || true)
|
||||||
|
|
||||||
# Step 3: Use detected changes or fallback
|
# Step 5: Use detected changes or fallback
|
||||||
if [ -z "$changed" ]; then
|
if [ -z "$changed" ]; then
|
||||||
changed=$(Bash(~/.claude/scripts/get_modules_by_depth.sh list | head -10))
|
changed=$(Bash(~/.claude/scripts/get_modules_by_depth.sh list | head -10))
|
||||||
fi
|
fi
|
||||||
count=$(echo "$changed" | wc -l)
|
count=$(echo "$changed" | wc -l)
|
||||||
|
|
||||||
# Step 4: Analysis handover → Model takes control
|
# Step 6: Analysis handover → Model takes control
|
||||||
# BASH_EXECUTION_STOPS → MODEL_ANALYSIS_BEGINS
|
# BASH_EXECUTION_STOPS → MODEL_ANALYSIS_BEGINS
|
||||||
|
|
||||||
# Pseudocode flow:
|
# Pseudocode flow:
|
||||||
@@ -41,6 +54,8 @@ count=$(echo "$changed" | wc -l)
|
|||||||
# → Task "Complex project related update" subagent_type: "memory-gemini-bridge"
|
# → Task "Complex project related update" subagent_type: "memory-gemini-bridge"
|
||||||
# ELSE:
|
# ELSE:
|
||||||
# → Present plan and WAIT FOR USER APPROVAL before execution
|
# → Present plan and WAIT FOR USER APPROVAL before execution
|
||||||
|
#
|
||||||
|
# Pass tool parameter to update_module_claude.sh: "$tool"
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🧠 Model Analysis Phase
|
### 🧠 Model Analysis Phase
|
||||||
@@ -62,6 +77,8 @@ After the bash script completes change detection, the model takes control to:
|
|||||||
Model will present detailed plan for affected modules:
|
Model will present detailed plan for affected modules:
|
||||||
```
|
```
|
||||||
📋 Related Update Plan:
|
📋 Related Update Plan:
|
||||||
|
Tool: [gemini|qwen|codex] (from --tool parameter)
|
||||||
|
|
||||||
CHANGED modules affecting CLAUDE.md:
|
CHANGED modules affecting CLAUDE.md:
|
||||||
|
|
||||||
NEW CLAUDE.md files (X):
|
NEW CLAUDE.md files (X):
|
||||||
@@ -91,7 +108,7 @@ depth_modules = organize_by_depth(changed_modules)
|
|||||||
FOR depth FROM max_depth DOWN TO 0:
|
FOR depth FROM max_depth DOWN TO 0:
|
||||||
FOR each module IN depth_modules[depth]:
|
FOR each module IN depth_modules[depth]:
|
||||||
WHILE active_jobs >= 4: wait(0.1)
|
WHILE active_jobs >= 4: wait(0.1)
|
||||||
Bash(~/.claude/scripts/update_module_claude.sh "$module" "related" &)
|
Bash(~/.claude/scripts/update_module_claude.sh "$module" "related" "$tool" &)
|
||||||
wait_all_jobs()
|
wait_all_jobs()
|
||||||
|
|
||||||
# Step 6: Safety check and restore staging state
|
# Step 6: Safety check and restore staging state
|
||||||
@@ -112,7 +129,7 @@ Bash(git diff --stat)
|
|||||||
The model will delegate to the memory-gemini-bridge agent using the Task tool:
|
The model will delegate to the memory-gemini-bridge agent using the Task tool:
|
||||||
```
|
```
|
||||||
Task "Complex project related update"
|
Task "Complex project related update"
|
||||||
prompt: "Execute context-aware update for [count] changed modules using depth-parallel execution"
|
prompt: "Execute context-aware update for [count] changed modules using [tool] with depth-parallel execution"
|
||||||
subagent_type: "memory-gemini-bridge"
|
subagent_type: "memory-gemini-bridge"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Update CLAUDE.md for a specific module with automatic layer detection
|
# Update CLAUDE.md for a specific module with automatic layer detection
|
||||||
# Usage: update_module_claude.sh <module_path> [update_type]
|
# Usage: update_module_claude.sh <module_path> [update_type] [tool]
|
||||||
# module_path: Path to the module directory
|
# module_path: Path to the module directory
|
||||||
# update_type: full|related (default: full)
|
# update_type: full|related (default: full)
|
||||||
|
# tool: gemini|qwen|codex (default: gemini)
|
||||||
# Script automatically detects layer depth and selects appropriate template
|
# Script automatically detects layer depth and selects appropriate template
|
||||||
|
|
||||||
update_module_claude() {
|
update_module_claude() {
|
||||||
local module_path="$1"
|
local module_path="$1"
|
||||||
local update_type="${2:-full}"
|
local update_type="${2:-full}"
|
||||||
|
local tool="${3:-gemini}"
|
||||||
|
|
||||||
# Validate parameters
|
# Validate parameters
|
||||||
if [ -z "$module_path" ]; then
|
if [ -z "$module_path" ]; then
|
||||||
@@ -63,7 +65,7 @@ update_module_claude() {
|
|||||||
local module_name=$(basename "$module_path")
|
local module_name=$(basename "$module_path")
|
||||||
|
|
||||||
echo "⚡ Updating: $module_path"
|
echo "⚡ Updating: $module_path"
|
||||||
echo " Layer: $layer | Type: $update_type | Files: $file_count"
|
echo " Layer: $layer | Type: $update_type | Tool: $tool | Files: $file_count"
|
||||||
echo " Template: $(basename "$template_path") | Strategy: $analysis_strategy"
|
echo " Template: $(basename "$template_path") | Strategy: $analysis_strategy"
|
||||||
|
|
||||||
# Generate prompt with template injection
|
# Generate prompt with template injection
|
||||||
@@ -108,29 +110,48 @@ update_module_claude() {
|
|||||||
echo " 🔄 Starting update..."
|
echo " 🔄 Starting update..."
|
||||||
|
|
||||||
if cd "$module_path" 2>/dev/null; then
|
if cd "$module_path" 2>/dev/null; then
|
||||||
# Execute gemini command with layer-specific analysis strategy
|
local tool_result=0
|
||||||
local gemini_result=0
|
local final_prompt="$base_prompt
|
||||||
|
|
||||||
|
Module Information:
|
||||||
|
- Name: $module_name
|
||||||
|
- Path: $module_path
|
||||||
|
- Layer: $layer
|
||||||
|
- Tool: $tool
|
||||||
|
- Analysis Strategy: $analysis_strategy"
|
||||||
|
|
||||||
|
# Execute with selected tool
|
||||||
|
case "$tool" in
|
||||||
|
qwen)
|
||||||
if [ "$analysis_strategy" = "--all-files" ]; then
|
if [ "$analysis_strategy" = "--all-files" ]; then
|
||||||
gemini --all-files --yolo -p "$base_prompt
|
qwen --all-files --yolo -p "$final_prompt" 2>&1
|
||||||
|
tool_result=$?
|
||||||
Module Information:
|
|
||||||
- Name: $module_name
|
|
||||||
- Path: $module_path
|
|
||||||
- Layer: $layer
|
|
||||||
- Analysis Strategy: $analysis_strategy" 2>&1
|
|
||||||
gemini_result=$?
|
|
||||||
else
|
else
|
||||||
gemini --yolo -p "$analysis_strategy $base_prompt
|
qwen --yolo -p "$analysis_strategy $final_prompt" 2>&1
|
||||||
|
tool_result=$?
|
||||||
Module Information:
|
|
||||||
- Name: $module_name
|
|
||||||
- Path: $module_path
|
|
||||||
- Layer: $layer
|
|
||||||
- Analysis Strategy: $analysis_strategy" 2>&1
|
|
||||||
gemini_result=$?
|
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
codex)
|
||||||
|
if [ "$analysis_strategy" = "--all-files" ]; then
|
||||||
|
codex --full-auto exec "$final_prompt" --skip-git-repo-check -s danger-full-access 2>&1
|
||||||
|
tool_result=$?
|
||||||
|
else
|
||||||
|
codex --full-auto exec "$final_prompt CONTEXT: $analysis_strategy" --skip-git-repo-check -s danger-full-access 2>&1
|
||||||
|
tool_result=$?
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
gemini|*)
|
||||||
|
if [ "$analysis_strategy" = "--all-files" ]; then
|
||||||
|
gemini --all-files --yolo -p "$final_prompt" 2>&1
|
||||||
|
tool_result=$?
|
||||||
|
else
|
||||||
|
gemini --yolo -p "$analysis_strategy $final_prompt" 2>&1
|
||||||
|
tool_result=$?
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if [ $gemini_result -eq 0 ]; then
|
if [ $tool_result -eq 0 ]; then
|
||||||
local end_time=$(date +%s)
|
local end_time=$(date +%s)
|
||||||
local duration=$((end_time - start_time))
|
local duration=$((end_time - start_time))
|
||||||
echo " ✅ Completed in ${duration}s"
|
echo " ✅ Completed in ${duration}s"
|
||||||
|
|||||||
50
CHANGELOG.md
50
CHANGELOG.md
@@ -5,6 +5,56 @@ All notable changes to Claude Code Workflow (CCW) will be documented in this fil
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [3.4.1] - 2025-10-04
|
||||||
|
|
||||||
|
### 🎯 Multi-Tool Support for Documentation Updates
|
||||||
|
|
||||||
|
This release adds flexible tool selection for CLAUDE.md documentation generation, allowing users to choose between Gemini, Qwen, or Codex based on their analysis needs.
|
||||||
|
|
||||||
|
#### Added
|
||||||
|
|
||||||
|
**Multi-Tool Support**:
|
||||||
|
- **`/update-memory-full --tool <gemini|qwen|codex>`**: Choose tool for full project documentation update
|
||||||
|
- **`/update-memory-related --tool <gemini|qwen|codex>`**: Choose tool for context-aware documentation update
|
||||||
|
- **Default**: Gemini (documentation generation, pattern recognition)
|
||||||
|
- **Qwen**: Architecture analysis, system design documentation
|
||||||
|
- **Codex**: Implementation validation, code quality analysis
|
||||||
|
|
||||||
|
**Script Enhancement** (`update_module_claude.sh`):
|
||||||
|
- Added third parameter for tool selection: `<module_path> [update_type] [tool]`
|
||||||
|
- Support for three tools with consistent parameter syntax:
|
||||||
|
- `gemini --all-files --yolo -p` (default)
|
||||||
|
- `qwen --all-files --yolo -p` (direct command, no wrapper)
|
||||||
|
- `codex --full-auto exec` (with danger-full-access)
|
||||||
|
- Automatic tool routing via case statement
|
||||||
|
- Improved logging with tool information display
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
**Command Documentation**:
|
||||||
|
- Updated `/update-memory-full.md` with tool selection usage and examples
|
||||||
|
- Updated `/update-memory-related.md` with tool selection usage and examples
|
||||||
|
- Added tool selection strategy and rationale documentation
|
||||||
|
|
||||||
|
#### Technical Details
|
||||||
|
|
||||||
|
**Tool Execution Patterns**:
|
||||||
|
```bash
|
||||||
|
# Gemini (default)
|
||||||
|
gemini --all-files --yolo -p "$prompt"
|
||||||
|
|
||||||
|
# Qwen (architecture analysis)
|
||||||
|
qwen --all-files --yolo -p "$prompt"
|
||||||
|
|
||||||
|
# Codex (implementation validation)
|
||||||
|
codex --full-auto exec "$prompt" --skip-git-repo-check -s danger-full-access
|
||||||
|
```
|
||||||
|
|
||||||
|
**Backward Compatibility**:
|
||||||
|
- ✅ Existing commands without `--tool` parameter default to Gemini
|
||||||
|
- ✅ All three tools support Layer 1-4 template system
|
||||||
|
- ✅ No breaking changes to existing workflows
|
||||||
|
|
||||||
## [3.3.0] - 2025-10-04
|
## [3.3.0] - 2025-10-04
|
||||||
|
|
||||||
### 🚀 CLI Tool Enhancements & Codex Multi-Step Execution
|
### 🚀 CLI Tool Enhancements & Codex Multi-Step Execution
|
||||||
|
|||||||
Reference in New Issue
Block a user