From d347793c1dc32f0f26a680edff626499d8e2a696 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sun, 28 Sep 2025 11:31:59 +0800 Subject: [PATCH] feat: Update workflow architecture documentation and clean up scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Major updates: - Enhanced workflow lifecycle with 6-phase development process - Updated README.md with comprehensive CLI command documentation - Updated README_CN.md with Chinese documentation reflecting v2.0 features - Added Qwen CLI commands and improved Gemini/Codex command descriptions - Enhanced brainstorming role commands and workflow session management - Updated integration requirements for all three CLI tools Script cleanup: - Removed unused Python CLI scripts (install_pycli.sh, pycli, pycli.conf) - Removed deprecated path reading scripts (read-paths.sh, read-task-paths.sh) - Removed tech-stack-loader.sh - Kept core scripts: gemini-wrapper, qwen-wrapper, get_modules_by_depth.sh Architecture improvements: - JSON-First data model as single source of truth - Atomic session management with marker files - Multi-agent coordination for complex task execution - Role-based brainstorming with synthesis capabilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/scripts/install_pycli.sh | 294 ------------------ .claude/scripts/pycli | 225 -------------- .claude/scripts/pycli.conf | 159 ---------- .claude/scripts/read-paths.sh | 35 --- .claude/scripts/read-task-paths.sh | 56 ---- .claude/scripts/tech-stack-loader.sh | 101 ------ .../workflows/intelligent-tools-strategy.md | 6 +- README.md | 150 ++++++--- README_CN.md | 197 ++++++++---- 9 files changed, 240 insertions(+), 983 deletions(-) delete mode 100644 .claude/scripts/install_pycli.sh delete mode 100644 .claude/scripts/pycli delete mode 100644 .claude/scripts/pycli.conf delete mode 100644 .claude/scripts/read-paths.sh delete mode 100644 .claude/scripts/read-task-paths.sh delete mode 100644 .claude/scripts/tech-stack-loader.sh diff --git a/.claude/scripts/install_pycli.sh b/.claude/scripts/install_pycli.sh deleted file mode 100644 index b7c0731e..00000000 --- a/.claude/scripts/install_pycli.sh +++ /dev/null @@ -1,294 +0,0 @@ -#!/bin/bash - -#============================================================================== -# pycli Installation Script -# -# This script installs the pycli bash wrapper and configuration files -# to the ~/.claude directory structure. -#============================================================================== - -set -euo pipefail - -# Colors for output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -# Print colored output -print_status() { - echo -e "${BLUE}[INFO]${NC} $1" -} - -print_success() { - echo -e "${GREEN}[SUCCESS]${NC} $1" -} - -print_warning() { - echo -e "${YELLOW}[WARNING]${NC} $1" -} - -print_error() { - echo -e "${RED}[ERROR]${NC} $1" -} - -#============================================================================== -# Configuration -#============================================================================== - -SOURCE_DIR="$(cd "$(dirname "$0")" && pwd)" -INSTALL_BASE="$HOME/.claude" -INSTALL_DIR="$INSTALL_BASE/scripts" -PYTHON_SCRIPT_DIR="$INSTALL_BASE/python_script" -VECTOR_DB_DIR="$INSTALL_BASE/vector_db" -CONFIG_DIR="$INSTALL_BASE/config" -LOGS_DIR="$INSTALL_BASE/logs" - -#============================================================================== -# Pre-installation Checks -#============================================================================== - -print_status "Starting pycli installation..." -print_status "Source directory: $SOURCE_DIR" -print_status "Install directory: $INSTALL_DIR" - -# Check if source files exist -if [[ ! -f "$SOURCE_DIR/pycli" ]]; then - print_error "pycli script not found in $SOURCE_DIR" - exit 1 -fi - -if [[ ! -f "$SOURCE_DIR/pycli.conf" ]]; then - print_error "pycli.conf not found in $SOURCE_DIR" - exit 1 -fi - -# Check if Python script directory exists -if [[ ! -d "$PYTHON_SCRIPT_DIR" ]]; then - print_warning "Python script directory not found: $PYTHON_SCRIPT_DIR" - print_status "Please ensure the Python scripts are installed in ~/.claude/python_script/" - read -p "Continue installation anyway? (y/N): " -n 1 -r - echo - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - print_status "Installation cancelled." - exit 0 - fi -fi - -#============================================================================== -# Create Directory Structure -#============================================================================== - -print_status "Creating directory structure..." - -# Create all required directories -directories=( - "$INSTALL_BASE" - "$INSTALL_DIR" - "$VECTOR_DB_DIR" - "$CONFIG_DIR" - "$LOGS_DIR" -) - -for dir in "${directories[@]}"; do - if [[ ! -d "$dir" ]]; then - mkdir -p "$dir" - print_status "Created directory: $dir" - else - print_status "Directory exists: $dir" - fi -done - -#============================================================================== -# Install Files -#============================================================================== - -print_status "Installing pycli files..." - -# Backup existing files if they exist -if [[ -f "$INSTALL_DIR/pycli" ]]; then - backup_file="$INSTALL_DIR/pycli.backup.$(date +%Y%m%d_%H%M%S)" - cp "$INSTALL_DIR/pycli" "$backup_file" - print_warning "Backed up existing pycli to: $backup_file" -fi - -if [[ -f "$INSTALL_DIR/pycli.conf" ]]; then - backup_file="$INSTALL_DIR/pycli.conf.backup.$(date +%Y%m%d_%H%M%S)" - cp "$INSTALL_DIR/pycli.conf" "$backup_file" - print_warning "Backed up existing pycli.conf to: $backup_file" -fi - -# Copy files -cp "$SOURCE_DIR/pycli" "$INSTALL_DIR/" -cp "$SOURCE_DIR/pycli.conf" "$INSTALL_DIR/" - -# Make executable -chmod +x "$INSTALL_DIR/pycli" - -print_success "Files installed successfully" - -#============================================================================== -# Configuration Updates -#============================================================================== - -print_status "Updating configuration..." - -# Detect Python path -PYTHON_CANDIDATES=( - "/usr/bin/python3" - "/usr/local/bin/python3" - "/opt/conda/bin/python" - "$(which python3 2>/dev/null || echo "")" - "$(which python 2>/dev/null || echo "")" -) - -DETECTED_PYTHON="" -for candidate in "${PYTHON_CANDIDATES[@]}"; do - if [[ -n "$candidate" ]] && [[ -x "$candidate" ]]; then - # Test if it's Python 3 - if "$candidate" -c "import sys; exit(0 if sys.version_info >= (3, 6) else 1)" 2>/dev/null; then - DETECTED_PYTHON="$candidate" - break - fi - fi -done - -if [[ -n "$DETECTED_PYTHON" ]]; then - print_success "Detected Python: $DETECTED_PYTHON" - - # Update configuration file - sed -i.bak "s|^PYTHON_PATH=.*|PYTHON_PATH=\"$DETECTED_PYTHON\"|" "$INSTALL_DIR/pycli.conf" - print_status "Updated PYTHON_PATH in configuration" -else - print_warning "Could not detect Python 3.6+. Please manually update PYTHON_PATH in:" - print_warning " $INSTALL_DIR/pycli.conf" -fi - -#============================================================================== -# Shell Integration Setup -#============================================================================== - -print_status "Setting up shell integration..." - -# Detect shell -SHELL_RC="" -if [[ -n "${BASH_VERSION:-}" ]] || [[ "$SHELL" == *"bash"* ]]; then - SHELL_RC="$HOME/.bashrc" -elif [[ -n "${ZSH_VERSION:-}" ]] || [[ "$SHELL" == *"zsh"* ]]; then - SHELL_RC="$HOME/.zshrc" -fi - -# Function to add alias/path to shell config -add_to_shell_config() { - local config_file="$1" - local content="$2" - - if [[ -f "$config_file" ]]; then - if ! grep -q "pycli" "$config_file"; then - echo "" >> "$config_file" - echo "# pycli - Python CLI Wrapper" >> "$config_file" - echo "$content" >> "$config_file" - print_success "Added pycli to $config_file" - return 0 - else - print_warning "pycli already configured in $config_file" - return 1 - fi - fi - return 1 -} - -# Add pycli to PATH -PATH_ADDED=false - -if [[ -n "$SHELL_RC" ]]; then - # Add pycli directory to PATH - if add_to_shell_config "$SHELL_RC" "export PATH=\"\$PATH:$INSTALL_DIR\""; then - PATH_ADDED=true - print_success "Added $INSTALL_DIR to PATH in $SHELL_RC" - fi -fi - -#============================================================================== -# Test Installation -#============================================================================== - -print_status "Testing installation..." - -# Test that the script is executable -if [[ -x "$INSTALL_DIR/pycli" ]]; then - print_success "pycli script is executable" -else - print_error "pycli script is not executable" - exit 1 -fi - -# Test configuration loading -if "$INSTALL_DIR/pycli" --help >/dev/null 2>&1; then - print_success "pycli configuration loads correctly" -else - print_warning "pycli configuration test failed - check Python path" -fi - -#============================================================================== -# Installation Summary -#============================================================================== - -print_success "Installation completed successfully!" -echo -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "📁 Installation Summary:" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo " • Executable: $INSTALL_DIR/pycli" -echo " • Config: $INSTALL_DIR/pycli.conf" -echo " • Vector DB: $VECTOR_DB_DIR/" -echo " • Logs: $LOGS_DIR/" -echo - -echo "🚀 Quick Start:" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - -if [[ "$PATH_ADDED" == true ]]; then - echo " 1. Reload your shell configuration:" - echo " source $SHELL_RC" - echo - echo " 2. Initialize vector DB for a project:" - echo " cd /path/to/your/project" - echo " pycli --init" - echo - echo " 3. Start analyzing code:" - echo " pycli --analyze --query \"authentication patterns\" --tool gemini" -else - echo " 1. Add pycli to your PATH manually:" - echo " echo 'export PATH=\"\$PATH:$INSTALL_DIR\"' >> $SHELL_RC" - echo " source $SHELL_RC" - echo - echo " 2. Or create a symlink (alternative):" - echo " sudo ln -sf $INSTALL_DIR/pycli /usr/local/bin/pycli" - echo - echo " 3. Initialize vector DB for a project:" - echo " cd /path/to/your/project" - echo " pycli --init" - echo - echo " 4. Start analyzing code:" - echo " pycli --analyze --query \"authentication patterns\" --tool gemini" -fi - -echo -echo "📚 Documentation:" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo " • Help: pycli --help" -echo " • Strategy: ~/.claude/workflows/python-tools-strategy.md" -echo -echo "⚙️ Configuration:" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo " • Edit config: $INSTALL_DIR/pycli.conf" -echo " • pycli location: $INSTALL_DIR/pycli" - -if [[ -z "$DETECTED_PYTHON" ]]; then - echo " • ⚠️ Please update PYTHON_PATH in pycli.conf" -fi - -echo -print_success "Installation complete! Now you can use 'pycli' command directly! 🎉" \ No newline at end of file diff --git a/.claude/scripts/pycli b/.claude/scripts/pycli deleted file mode 100644 index 775292a6..00000000 --- a/.claude/scripts/pycli +++ /dev/null @@ -1,225 +0,0 @@ -#!/bin/bash - -#============================================================================== -# pycli - Python CLI Wrapper with Hierarchical Vector Database Support -# -# This script provides a bash wrapper for the Python-based analysis CLI, -# with intelligent hierarchical vector database management. -# -# Features: -# - Hierarchical vector database support (subdirs use parent's DB) -# - Configurable Python environment -# - Central vector database storage -# - Smart project root detection -#============================================================================== - -set -euo pipefail - -# Load configuration -CONFIG_FILE="$(dirname "$0")/pycli.conf" -if [[ -f "$CONFIG_FILE" ]]; then - source "$CONFIG_FILE" -else - echo "Error: Configuration file not found: $CONFIG_FILE" - echo "Please ensure pycli.conf exists in the same directory as this script." - exit 1 -fi - -# Validate required configuration -if [[ -z "${PYTHON_PATH:-}" ]]; then - echo "Error: PYTHON_PATH not set in configuration" - exit 1 -fi - -if [[ -z "${PYTHON_SCRIPT_DIR:-}" ]]; then - echo "Error: PYTHON_SCRIPT_DIR not set in configuration" - exit 1 -fi - -if [[ -z "${VECTOR_DB_ROOT:-}" ]]; then - echo "Error: VECTOR_DB_ROOT not set in configuration" - exit 1 -fi - -# Check if Python is available -if ! command -v "$PYTHON_PATH" &> /dev/null; then - echo "Error: Python not found at $PYTHON_PATH" - echo "Please update PYTHON_PATH in $CONFIG_FILE" - exit 1 -fi - -# Check if Python script directory exists -if [[ ! -d "$PYTHON_SCRIPT_DIR" ]]; then - echo "Error: Python script directory not found: $PYTHON_SCRIPT_DIR" - exit 1 -fi - -# Get current directory (will be used as project root for indexing) -CURRENT_DIR=$(pwd) - -#============================================================================== -# Helper Functions -#============================================================================== - -# Convert current path to vector DB path -# e.g., /home/user/project/subdir -> ~/.claude/vector_db/home_user_project_subdir -get_vector_db_path() { - local path="$1" - # Replace / with _ and remove leading / - local safe_path="${path//\//_}" - safe_path="${safe_path#_}" - # Handle Windows paths (C: -> C_) - safe_path="${safe_path//:/_}" - echo "$VECTOR_DB_ROOT/$safe_path" -} - -# Find nearest parent with existing vector DB -find_project_root() { - local dir="$CURRENT_DIR" - local max_depth=10 # Prevent infinite loops - local depth=0 - - while [[ "$dir" != "/" ]] && [[ "$depth" -lt "$max_depth" ]]; do - local db_path=$(get_vector_db_path "$dir") - - # Check if vector DB exists and has required files - if [[ -d "$db_path" ]] && ([[ -f "$db_path/embeddings.pkl" ]] || [[ -f "$db_path/index.json" ]]); then - echo "$dir" - return 0 - fi - - # Move to parent directory - local parent_dir=$(dirname "$dir") - if [[ "$parent_dir" == "$dir" ]]; then - break # Reached root - fi - dir="$parent_dir" - ((depth++)) - done - - # No parent vector DB found, use current directory - echo "$CURRENT_DIR" -} - -# Show help message -show_help() { - cat << EOF -pycli - Python CLI Wrapper with Hierarchical Vector Database Support - -USAGE: - pycli [OPTIONS] - -INITIALIZATION: - --init Initialize vector DB for current directory - --rebuild-index Rebuild file index from scratch - --update-embeddings Update vector embeddings for changed files - -ANALYSIS: - --analyze Run analysis with tool - --query TEXT Semantic search query for context discovery - -p, --prompt TEXT Direct prompt for analysis - --tool [gemini|codex|both] Which tool to use (default: $DEFAULT_TOOL) - --top-k INTEGER Number of similar files to find (default: $DEFAULT_TOP_K) - -STATUS: - --status Show system status - --test-search Test vector search functionality - -EXAMPLES: - # Initialize vector DB for current project - pycli --init - - # Smart analysis with context discovery - pycli --analyze --query "authentication patterns" --tool gemini - - # Direct analysis with known prompt - pycli --analyze --tool codex -p "implement user login" - - # Update embeddings after code changes - pycli --update-embeddings - - # Check system status - pycli --status - -For more information, see: ~/.claude/workflows/python-tools-strategy.md -EOF -} - -#============================================================================== -# Main Logic -#============================================================================== - -# Handle help -if [[ "${1:-}" == "--help" ]] || [[ "${1:-}" == "-h" ]] || [[ $# -eq 0 ]]; then - show_help - exit 0 -fi - -# Determine action based on arguments -case "${1:-}" in - --init|--rebuild-index) - # For initialization, always use current directory - PROJECT_ROOT="$CURRENT_DIR" - echo "Initializing vector database for: $PROJECT_ROOT" - ;; - *) - # For other operations, find nearest project root - PROJECT_ROOT=$(find_project_root) - if [[ "$PROJECT_ROOT" != "$CURRENT_DIR" ]]; then - echo "Using existing vector database from: $PROJECT_ROOT" - fi - ;; -esac - -VECTOR_DB_PATH=$(get_vector_db_path "$PROJECT_ROOT") - -# Create vector DB directory if needed -mkdir -p "$VECTOR_DB_PATH" - -# Determine which Python script to call -if [[ "${1:-}" == "--update-embeddings" ]] || [[ "${1:-}" == "--rebuild-index" ]] || [[ "${1:-}" == "--init" ]]; then - # Use indexer.py for indexing operations - PYTHON_SCRIPT="$PYTHON_SCRIPT_DIR/indexer.py" - - # Map --init to --rebuild-index --update-embeddings - if [[ "${1:-}" == "--init" ]]; then - set -- "--rebuild-index" "--update-embeddings" - fi - - if [[ ! -f "$PYTHON_SCRIPT" ]]; then - echo "Error: indexer.py not found at $PYTHON_SCRIPT" - exit 1 - fi -else - # Use cli.py for analysis operations - PYTHON_SCRIPT="$PYTHON_SCRIPT_DIR/cli.py" - - if [[ ! -f "$PYTHON_SCRIPT" ]]; then - echo "Error: cli.py not found at $PYTHON_SCRIPT" - exit 1 - fi -fi - -#============================================================================== -# Environment Setup and Execution -#============================================================================== - -# Set environment variables for Python scripts -export PYCLI_VECTOR_DB_PATH="$VECTOR_DB_PATH" -export PYCLI_PROJECT_ROOT="$PROJECT_ROOT" -export PYCLI_CONFIG_FILE="$CONFIG_FILE" - -# Add some debugging info in verbose mode -if [[ "${PYCLI_VERBOSE:-}" == "1" ]]; then - echo "Debug: PROJECT_ROOT=$PROJECT_ROOT" - echo "Debug: VECTOR_DB_PATH=$VECTOR_DB_PATH" - echo "Debug: PYTHON_SCRIPT=$PYTHON_SCRIPT" - echo "Debug: Arguments: $*" -fi - -# Execute Python script with all arguments -echo "Executing: $PYTHON_PATH $PYTHON_SCRIPT --root-path \"$PROJECT_ROOT\" $*" - -exec "$PYTHON_PATH" "$PYTHON_SCRIPT" \ - --root-path "$PROJECT_ROOT" \ - "$@" \ No newline at end of file diff --git a/.claude/scripts/pycli.conf b/.claude/scripts/pycli.conf deleted file mode 100644 index 7dbdcc65..00000000 --- a/.claude/scripts/pycli.conf +++ /dev/null @@ -1,159 +0,0 @@ -#============================================================================== -# pycli Configuration File -# -# This file contains configuration settings for the pycli bash wrapper. -# Modify these settings according to your environment. -#============================================================================== - -#------------------------------------------------------------------------------ -# Python Environment Configuration -#------------------------------------------------------------------------------ - -# Path to Python interpreter -# Examples: -# - System Python: /usr/bin/python3 -# - Conda: /opt/conda/bin/python -# - Virtual env: /home/user/.virtualenvs/myenv/bin/python -# - Windows: /c/Python39/python.exe -PYTHON_PATH="/usr/bin/python3" - -# Alternative Python paths for different environments -# Uncomment and modify as needed: -# PYTHON_PATH="/opt/conda/bin/python" # Conda -# PYTHON_PATH="$HOME/.pyenv/versions/3.11.0/bin/python" # pyenv -# PYTHON_PATH="/c/Python311/python.exe" # Windows - -#------------------------------------------------------------------------------ -# Directory Configuration -#------------------------------------------------------------------------------ - -# Python script location (should point to ~/.claude/python_script) -PYTHON_SCRIPT_DIR="$HOME/.claude/python_script" - -# Central vector database storage location -VECTOR_DB_ROOT="$HOME/.claude/vector_db" - -# Cache directory for temporary files -CACHE_DIR="$HOME/.claude/cache" - -#------------------------------------------------------------------------------ -# Default Tool Settings -#------------------------------------------------------------------------------ - -# Default tool to use when not specified -# Options: gemini, codex, both -DEFAULT_TOOL="gemini" - -# Default number of similar files to return in vector search -DEFAULT_TOP_K="10" - -# Default similarity threshold for vector search (0.0-1.0) -SIMILARITY_THRESHOLD="0.3" - -# Default timeout for tool execution (seconds) -TOOL_TIMEOUT="300" - -#------------------------------------------------------------------------------ -# Vector Database Configuration -#------------------------------------------------------------------------------ - -# Enable hierarchical vector database mode -# When true, subdirectories will use parent directory's vector database -HIERARCHICAL_MODE="true" - -# Maximum depth to search for parent vector databases -MAX_SEARCH_DEPTH="10" - -# Minimum files required to create a separate vector database -MIN_FILES_FOR_SEPARATE_DB="50" - -#------------------------------------------------------------------------------ -# Performance Settings -#------------------------------------------------------------------------------ - -# Enable verbose output for debugging -# Set to "1" to enable, "0" to disable -PYCLI_VERBOSE="0" - -# Enable caching of analysis results -ENABLE_CACHING="true" - -# Cache TTL in seconds (1 hour default) -CACHE_TTL="3600" - -#------------------------------------------------------------------------------ -# Integration Settings -#------------------------------------------------------------------------------ - -# Gemini wrapper compatibility mode -# Set to "true" to enable compatibility with existing gemini-wrapper scripts -GEMINI_COMPAT_MODE="true" - -# Codex integration settings -CODEX_COMPAT_MODE="true" - -# Auto-build index if not found -AUTO_BUILD_INDEX="true" - -# Auto-update embeddings when files change -AUTO_UPDATE_EMBEDDINGS="true" - -#------------------------------------------------------------------------------ -# Logging Configuration -#------------------------------------------------------------------------------ - -# Log level: DEBUG, INFO, WARNING, ERROR -LOG_LEVEL="INFO" - -# Log file location -LOG_FILE="$HOME/.claude/logs/pycli.log" - -# Enable log rotation -ENABLE_LOG_ROTATION="true" - -# Maximum log file size (MB) -MAX_LOG_SIZE="10" - -#------------------------------------------------------------------------------ -# Advanced Configuration -#------------------------------------------------------------------------------ - -# Custom configuration file for Python scripts -# Leave empty to use default config.yaml -PYTHON_CONFIG_FILE="" - -# Additional Python path directories -# Uncomment and modify if you need to add custom modules -# ADDITIONAL_PYTHON_PATH="/path/to/custom/modules" - -# Environment variables to pass to Python scripts -# Uncomment and modify as needed -# CUSTOM_ENV_VAR1="value1" -# CUSTOM_ENV_VAR2="value2" - -#------------------------------------------------------------------------------ -# Platform-Specific Settings -#------------------------------------------------------------------------------ - -# Windows-specific settings -if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then - # Adjust paths for Windows - VECTOR_DB_ROOT="${VECTOR_DB_ROOT//\\//}" - PYTHON_SCRIPT_DIR="${PYTHON_SCRIPT_DIR//\\//}" -fi - -# macOS-specific settings -if [[ "$OSTYPE" == "darwin"* ]]; then - # macOS-specific optimizations - export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES -fi - -#------------------------------------------------------------------------------ -# User Customization -#------------------------------------------------------------------------------ - -# Load user-specific configuration if it exists -USER_CONFIG="$HOME/.claude/config/pycli.user.conf" -if [[ -f "$USER_CONFIG" ]]; then - source "$USER_CONFIG" -fi \ No newline at end of file diff --git a/.claude/scripts/read-paths.sh b/.claude/scripts/read-paths.sh deleted file mode 100644 index 540aef02..00000000 --- a/.claude/scripts/read-paths.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# read-paths.sh - Simple path reader for gemini format -# Usage: read-paths.sh - -PATHS_FILE="$1" - -# Check file exists -if [ ! -f "$PATHS_FILE" ]; then - echo "❌ File not found: $PATHS_FILE" >&2 - exit 1 -fi - -# Read valid paths -valid_paths=() -while IFS= read -r line; do - # Skip comments and empty lines - [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue - - # Clean and add path - path=$(echo "$line" | xargs) - [ -n "$path" ] && valid_paths+=("$path") -done < "$PATHS_FILE" - -# Check if we have paths -if [ ${#valid_paths[@]} -eq 0 ]; then - echo "❌ No valid paths found in $PATHS_FILE" >&2 - exit 1 -fi - -# Output gemini format @{path1,path2,...} -printf "@{" -printf "%s" "${valid_paths[0]}" -printf ",%s" "${valid_paths[@]:1}" -printf "}" \ No newline at end of file diff --git a/.claude/scripts/read-task-paths.sh b/.claude/scripts/read-task-paths.sh deleted file mode 100644 index ac091743..00000000 --- a/.claude/scripts/read-task-paths.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# Read paths field from task JSON and convert to Gemini @ format -# Usage: read-task-paths.sh [task-json-file] - -TASK_FILE="$1" - -if [ -z "$TASK_FILE" ]; then - echo "Usage: read-task-paths.sh [task-json-file]" >&2 - exit 1 -fi - -if [ ! -f "$TASK_FILE" ]; then - echo "Error: Task file '$TASK_FILE' not found" >&2 - exit 1 -fi - -# Extract paths field from JSON -paths=$(grep -o '"paths":[[:space:]]*"[^"]*"' "$TASK_FILE" | sed 's/"paths":[[:space:]]*"\([^"]*\)"/\1/') - -if [ -z "$paths" ]; then - # No paths field found, return empty @ format - echo "@{}" - exit 0 -fi - -# Convert semicolon-separated paths to comma-separated @ format -formatted_paths=$(echo "$paths" | sed 's/;/,/g') - -# For directories, append /**/* to get all files -# For files (containing .), keep as-is -IFS=',' read -ra path_array <<< "$formatted_paths" -result_paths=() - -for path in "${path_array[@]}"; do - # Trim whitespace - path=$(echo "$path" | xargs) - - if [ -n "$path" ]; then - # Check if path is a directory (no extension) or file (has extension) - if [[ "$path" == *.* ]]; then - # File path - keep as is - result_paths+=("$path") - else - # Directory path - add wildcard expansion - result_paths+=("$path/**/*") - fi - fi -done - -# Output Gemini @ format -printf "@{" -printf "%s" "${result_paths[0]}" -for i in "${result_paths[@]:1}"; do - printf ",%s" "$i" -done -printf "}" \ No newline at end of file diff --git a/.claude/scripts/tech-stack-loader.sh b/.claude/scripts/tech-stack-loader.sh deleted file mode 100644 index cb184555..00000000 --- a/.claude/scripts/tech-stack-loader.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash -# tech-stack-loader.sh - DMSFlow Tech Stack Guidelines Loader -# Returns tech stack specific coding guidelines and best practices for Claude processing - -set -e - -# Define paths -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -TEMPLATE_DIR="${SCRIPT_DIR}/../tech-stack-templates" - -# Parse arguments -COMMAND="$1" -TECH_STACK="$2" - -# Handle version check -if [ "$COMMAND" = "--version" ] || [ "$COMMAND" = "-v" ]; then - echo "DMSFlow tech-stack-loader v2.0" - echo "Semantic-based development guidelines system" - exit 0 -fi - -# List all available guidelines -if [ "$COMMAND" = "--list" ]; then - echo "Available Development Guidelines:" - echo "=================================" - for file in "$TEMPLATE_DIR"/*.md; do - if [ -f "$file" ]; then - # Extract name and description from YAML frontmatter - name=$(grep "^name:" "$file" | head -1 | cut -d: -f2 | sed 's/^ *//' | sed 's/ *$//') - desc=$(grep "^description:" "$file" | head -1 | cut -d: -f2- | sed 's/^ *//' | sed 's/ *$//') - - if [ -n "$name" ] && [ -n "$desc" ]; then - printf "%-20s - %s\n" "$name" "$desc" - fi - fi - done - exit 0 -fi - -# Load specific guidelines -if [ "$COMMAND" = "--load" ] && [ -n "$TECH_STACK" ]; then - TEMPLATE_PATH="${TEMPLATE_DIR}/${TECH_STACK}.md" - - if [ -f "$TEMPLATE_PATH" ]; then - # Output content, skipping YAML frontmatter - awk ' - BEGIN { in_yaml = 0; yaml_ended = 0 } - /^---$/ { - if (!yaml_ended) { - if (in_yaml) yaml_ended = 1 - else in_yaml = 1 - next - } - } - yaml_ended { print } - ' "$TEMPLATE_PATH" - else - >&2 echo "Error: Development guidelines '$TECH_STACK' not found" - >&2 echo "Use --list to see available guidelines" - exit 1 - fi - exit 0 -fi - -# Handle legacy usage (direct tech stack name) -if [ -n "$COMMAND" ] && [ "$COMMAND" != "--help" ] && [ "$COMMAND" != "--list" ] && [ "$COMMAND" != "--load" ]; then - TEMPLATE_PATH="${TEMPLATE_DIR}/${COMMAND}.md" - - if [ -f "$TEMPLATE_PATH" ]; then - # Output content, skipping YAML frontmatter - awk ' - BEGIN { in_yaml = 0; yaml_ended = 0 } - /^---$/ { - if (!yaml_ended) { - if (in_yaml) yaml_ended = 1 - else in_yaml = 1 - next - } - } - yaml_ended { print } - ' "$TEMPLATE_PATH" - exit 0 - else - >&2 echo "Error: Development guidelines '$COMMAND' not found" - >&2 echo "Use --list to see available guidelines" - exit 1 - fi -fi - -# Show help -echo "Usage:" -echo " tech-stack-loader.sh --list List all available guidelines with descriptions" -echo " tech-stack-loader.sh --load Load specific development guidelines" -echo " tech-stack-loader.sh Load specific guidelines (legacy format)" -echo " tech-stack-loader.sh --help Show this help message" -echo " tech-stack-loader.sh --version Show version information" -echo "" -echo "Examples:" -echo " tech-stack-loader.sh --list" -echo " tech-stack-loader.sh --load javascript-dev" -echo " tech-stack-loader.sh python-dev" \ No newline at end of file diff --git a/.claude/workflows/intelligent-tools-strategy.md b/.claude/workflows/intelligent-tools-strategy.md index 2517e02b..1fc2597d 100644 --- a/.claude/workflows/intelligent-tools-strategy.md +++ b/.claude/workflows/intelligent-tools-strategy.md @@ -37,7 +37,7 @@ type: strategic-guideline ### Standard Format (REQUIRED) ```bash # Gemini Analysis -~/.claude/scripts/gemini-wrapper [-C directory] -p " +~/.claude/scripts/gemini-wrapper -C [directory] -p " PURPOSE: [clear analysis goal] TASK: [specific analysis task] CONTEXT: [file references and memory context] @@ -46,7 +46,7 @@ RULES: [template reference and constraints] " # Qwen Architecture & Code Generation -~/.claude/scripts/qwen-wrapper [-C directory] -p " +~/.claude/scripts/qwen-wrapper -C [directory] -p " PURPOSE: [clear architecture/code goal] TASK: [specific architecture/code task] CONTEXT: [file references and memory context] @@ -55,7 +55,7 @@ RULES: [template reference and constraints] " # Codex Development -codex [-C directory] --full-auto exec " +codex -C [directory] --full-auto exec " PURPOSE: [clear development goal] TASK: [specific development task] CONTEXT: [file references and memory context] diff --git a/README.md b/README.md index fee3af1d..12c99ca6 100644 --- a/README.md +++ b/README.md @@ -164,9 +164,23 @@ CCW automatically adapts workflow structure based on project complexity: |---------|---------|-------| | `🔍 /gemini:analyze` | Deep codebase analysis | `/gemini:analyze "authentication patterns"` | | `💬 /gemini:chat` | Direct Gemini interaction | `/gemini:chat "explain this architecture"` | -| `⚡ /gemini:execute` | Intelligent execution | `/gemini:execute task-001` | -| `🎯 /gemini:mode:auto` | Auto template selection | `/gemini:mode:auto "analyze security"` | -| `🐛 /gemini:mode:bug-index` | Bug analysis workflow | `/gemini:mode:bug-index "payment fails"` | +| `⚡ /gemini:execute` | Intelligent execution with YOLO permissions | `/gemini:execute "implement task-001"` | +| `🎯 /gemini:mode:auto` | Auto template selection | `/gemini:mode:auto "analyze security vulnerabilities"` | +| `🐛 /gemini:mode:bug-index` | Bug analysis and fix suggestions | `/gemini:mode:bug-index "payment processing fails"` | +| `📋 /gemini:mode:plan` | Project planning and architecture | `/gemini:mode:plan "microservices architecture"` | +| `🎯 /gemini:mode:plan-precise` | Precise path planning analysis | `/gemini:mode:plan-precise "complex refactoring"` | + +### 🔮 **Qwen CLI Commands** (Architecture & Code Generation) + +| Command | Purpose | Usage | +|---------|---------|-------| +| `🔍 /qwen:analyze` | Architecture analysis and code quality | `/qwen:analyze "system architecture patterns"` | +| `💬 /qwen:chat` | Direct Qwen interaction | `/qwen:chat "design authentication system"` | +| `⚡ /qwen:execute` | Intelligent implementation with YOLO permissions | `/qwen:execute "implement user authentication"` | +| `🚀 /qwen:mode:auto` | Auto template selection and execution | `/qwen:mode:auto "build microservices API"` | +| `🐛 /qwen:mode:bug-index` | Bug analysis and fix suggestions | `/qwen:mode:bug-index "memory leak in service"` | +| `📋 /qwen:mode:plan` | Architecture planning and analysis | `/qwen:mode:plan "design scalable database"` | +| `🎯 /qwen:mode:plan-precise` | Precise architectural planning | `/qwen:mode:plan-precise "complex system migration"` | ### 🤖 **Codex CLI Commands** (Development & Implementation) @@ -174,9 +188,10 @@ CCW automatically adapts workflow structure based on project complexity: |---------|---------|-------| | `🔍 /codex:analyze` | Development analysis | `/codex:analyze "optimization opportunities"` | | `💬 /codex:chat` | Direct Codex interaction | `/codex:chat "implement JWT auth"` | -| `⚡ /codex:execute` | Controlled development | `/codex:execute "refactor user service"` | -| `🚀 /codex:mode:auto` | **PRIMARY**: Full autonomous | `/codex:mode:auto "build payment system"` | -| `🐛 /codex:mode:bug-index` | Autonomous bug fixing | `/codex:mode:bug-index "fix race condition"` | +| `⚡ /codex:execute` | Autonomous implementation with YOLO permissions | `/codex:execute "refactor user service"` | +| `🚀 /codex:mode:auto` | **PRIMARY**: Full autonomous development | `/codex:mode:auto "build payment system"` | +| `🐛 /codex:mode:bug-index` | Autonomous bug fixing and implementation | `/codex:mode:bug-index "fix race condition"` | +| `📋 /codex:mode:plan` | Development planning and implementation | `/codex:mode:plan "implement API endpoints"` | ### 🎯 **Workflow Management** @@ -192,59 +207,105 @@ CCW automatically adapts workflow structure based on project complexity: #### 🎯 Workflow Operations | Command | Function | Usage | |---------|----------|-------| -| `💭 /workflow:brainstorm:*` | **NEW**: Multi-perspective planning | `/workflow:brainstorm:system-architect "microservices"` | -| `🎨 /workflow:brainstorm:artifacts` | **NEW**: Generate planning documents | `/workflow:brainstorm:artifacts --synthesis` | -| `📋 /workflow:plan` | Convert to executable plans | `/workflow:plan --from-brainstorming` | -| `✅ /workflow:plan-verify` | **NEW**: Pre-execution validation | `/workflow:plan-verify --dual-analysis` | -| `⚡ /workflow:execute` | Implementation phase | `/workflow:execute --autonomous` | -| `🧪 /workflow:test-gen` | **NEW**: Generate test workflows | `/workflow:test-gen --coverage=comprehensive` | -| `🔍 /workflow:review` | Quality assurance | `/workflow:review --auto-fix` | +| `💭 /workflow:brainstorm:*` | Multi-perspective planning with role experts | `/workflow:brainstorm:system-architect "microservices"` | +| `🤝 /workflow:brainstorm:synthesis` | Synthesize all brainstorming perspectives | `/workflow:brainstorm:synthesis` | +| `🎨 /workflow:brainstorm:artifacts` | Generate structured planning documents | `/workflow:brainstorm:artifacts "topic description"` | +| `📋 /workflow:plan` | Convert to executable implementation plans | `/workflow:plan "description" \| file.md \| ISS-001` | +| `🔍 /workflow:plan-deep` | Deep technical planning with Gemini analysis | `/workflow:plan-deep "requirements description"` | +| `✅ /workflow:plan-verify` | Pre-execution validation using dual analysis | `/workflow:plan-verify` | +| `⚡ /workflow:execute` | Coordinate agents for implementation | `/workflow:execute` | +| `🔄 /workflow:resume` | Intelligent workflow resumption | `/workflow:resume [--from TASK-ID] [--retry]` | +| `📊 /workflow:status` | Generate on-demand views from task data | `/workflow:status [task-id] [format] [validation]` | +| `🧪 /workflow:test-gen` | Generate comprehensive test workflows | `/workflow:test-gen WFS-session-id` | +| `🔍 /workflow:review` | Execute review phase for quality validation | `/workflow:review` | +| `📚 /workflow:docs` | Generate hierarchical documentation | `/workflow:docs "architecture" \| "api" \| "all"` | #### 🏷️ Task Management | Command | Function | Usage | |---------|----------|-------| -| `➕ /task:create` | Create implementation task | `/task:create "User Authentication"` | -| `🔄 /task:breakdown` | Decompose into subtasks | `/task:breakdown IMPL-1 --depth=2` | -| `⚡ /task:execute` | Execute specific task | `/task:execute IMPL-1.1 --mode=auto` | -| `📋 /task:replan` | Adapt to changes | `/task:replan IMPL-1 --strategy=adjust` | +| `➕ /task:create` | Create implementation task with context | `/task:create "User Authentication System"` | +| `🔄 /task:breakdown` | Intelligent task decomposition | `/task:breakdown task-id` | +| `⚡ /task:execute` | Execute tasks with appropriate agents | `/task:execute task-id` | +| `📋 /task:replan` | Replan tasks with detailed input | `/task:replan task-id ["text" \| file.md \| ISS-001]` | + +#### 🧠 Brainstorming Role Commands +| Role | Command | Purpose | +|------|---------|---------| +| 🏗️ **System Architect** | `/workflow:brainstorm:system-architect` | Technical architecture analysis | +| 🔒 **Security Expert** | `/workflow:brainstorm:security-expert` | Security and threat analysis | +| 📊 **Product Manager** | `/workflow:brainstorm:product-manager` | User needs and business value | +| 🎨 **UI Designer** | `/workflow:brainstorm:ui-designer` | User experience and interface | +| 📈 **Business Analyst** | `/workflow:brainstorm:business-analyst` | Process optimization analysis | +| 🔬 **Innovation Lead** | `/workflow:brainstorm:innovation-lead` | Emerging technology opportunities | +| 📋 **Feature Planner** | `/workflow:brainstorm:feature-planner` | Feature development planning | +| 🗄️ **Data Architect** | `/workflow:brainstorm:data-architect` | Data modeling and analytics | +| 👥 **User Researcher** | `/workflow:brainstorm:user-researcher` | User behavior analysis | +| 🚀 **Auto Selection** | `/workflow:brainstorm:auto` | Dynamic role selection | --- ## 🎯 Complete Development Workflows -### 🚀 **Complex Feature Development** +### 🚀 **Enhanced Workflow Lifecycle** ```mermaid graph TD START[🎯 New Feature Request] --> SESSION["/workflow:session:start 'OAuth2 System'"] - SESSION --> BRAINSTORM["/workflow:brainstorm --perspectives=system-architect,security-expert"] - BRAINSTORM --> PLAN["/workflow:plan --from-brainstorming"] - PLAN --> EXECUTE["/workflow:execute --type=complex"] - EXECUTE --> REVIEW["/workflow:review --auto-fix"] - REVIEW --> DOCS["/update-memory-related"] + SESSION --> BRAINSTORM["/workflow:brainstorm:system-architect topic"] + BRAINSTORM --> SYNTHESIS["/workflow:brainstorm:synthesis"] + SYNTHESIS --> PLAN["/workflow:plan description"] + PLAN --> VERIFY["/workflow:plan-verify"] + VERIFY --> EXECUTE["/workflow:execute"] + EXECUTE --> TEST["/workflow:test-gen WFS-session-id"] + TEST --> REVIEW["/workflow:review"] + REVIEW --> DOCS["/workflow:docs all"] DOCS --> COMPLETE[✅ Complete] ``` +### ⚡ **Workflow Session Management** + +```mermaid +graph LR + START[📋 Session Start] --> MARKER[🏷️ .active-session marker] + MARKER --> JSON[📊 workflow-session.json] + JSON --> TASKS[🎯 .task/IMPL-*.json] + TASKS --> PAUSE[⏸️ Pause: Remove marker] + PAUSE --> RESUME[▶️ Resume: Restore marker] + RESUME --> SWITCH[🔄 Switch: Change active session] +``` + ### 🔥 **Quick Development Examples** -#### **🚀 Full Stack Feature Implementation** +#### **🚀 Complete Feature Development Workflow** ```bash # 1. Initialize focused session /workflow:session:start "User Dashboard Feature" -# 2. Multi-perspective analysis -/workflow:brainstorm "dashboard analytics system" \ - --perspectives=system-architect,ui-designer,data-architect +# 2. Multi-perspective brainstorming +/workflow:brainstorm:system-architect "dashboard analytics system" +/workflow:brainstorm:ui-designer "dashboard user experience" +/workflow:brainstorm:data-architect "analytics data flow" -# 3. Generate executable plan with task decomposition -/workflow:plan --from-brainstorming +# 3. Synthesize all perspectives +/workflow:brainstorm:synthesis -# 4. Autonomous implementation -/codex:mode:auto "Implement user dashboard with analytics, charts, and real-time data" +# 4. Create executable implementation plan +/workflow:plan "user dashboard with analytics and real-time data" -# 5. Quality assurance and deployment -/workflow:review --auto-fix -/update-memory-related +# 5. Verify plan before execution +/workflow:plan-verify + +# 6. Execute implementation with agent coordination +/workflow:execute + +# 7. Generate comprehensive test suite +/workflow:test-gen WFS-user-dashboard-feature + +# 8. Quality assurance and review +/workflow:review + +# 9. Generate documentation +/workflow:docs "all" ``` #### **⚡ Rapid Bug Resolution** @@ -252,17 +313,20 @@ graph TD # Quick bug fix workflow /workflow:session:start "Payment Processing Fix" /gemini:mode:bug-index "Payment validation fails on concurrent requests" -/codex:mode:auto "Fix race condition in payment validation with proper locking" -/workflow:review --auto-fix +/codex:mode:bug-index "Fix race condition in payment validation" +/workflow:review ``` #### **📊 Architecture Analysis & Refactoring** ```bash -# Deep architecture work +# Deep architecture workflow /workflow:session:start "API Refactoring Initiative" /gemini:analyze "current API architecture patterns and technical debt" -/workflow:plan-deep "microservices transition" --complexity=high --depth=3 -/codex:mode:auto "Refactor monolith to microservices following the analysis" +/workflow:plan-deep "microservices transition strategy" +/workflow:plan-verify +/qwen:mode:auto "Refactor monolith to microservices architecture" +/workflow:test-gen WFS-api-refactoring-initiative +/workflow:review ``` --- @@ -325,10 +389,12 @@ graph TD - **🧠 Memory**: 512MB minimum, 2GB recommended ### 🔗 **Integration Requirements** -- **🔍 Gemini CLI**: Required for analysis workflows -- **🤖 Codex CLI**: Required for autonomous development -- **📂 Git Repository**: Required for change tracking +- **🔍 Gemini CLI**: Required for analysis and strategic planning workflows +- **🤖 Codex CLI**: Required for autonomous development and bug fixing +- **🔮 Qwen CLI**: Required for architecture analysis and code generation +- **📂 Git Repository**: Required for change tracking and version control - **🎯 Claude Code IDE**: Recommended for optimal experience +- **🐍 Python 3.8+**: Required for advanced pycli backend features --- diff --git a/README_CN.md b/README_CN.md index 97e97fa5..4d5e73ef 100644 --- a/README_CN.md +++ b/README_CN.md @@ -148,18 +148,32 @@ sequenceDiagram ## 完整开发工作流示例 -### 🚀 **复杂功能开发流程** +### 🚀 **增强的工作流生命周期** + ```mermaid graph TD - START[新功能请求] --> SESSION["/workflow:session:start 'OAuth2系统'"] - SESSION --> BRAINSTORM["/workflow:brainstorm --perspectives=system-architect,security-expert"] + START[🎯 新功能请求] --> SESSION["/workflow:session:start 'OAuth2系统'"] + SESSION --> BRAINSTORM["/workflow:brainstorm:system-architect 主题"] BRAINSTORM --> SYNTHESIS["/workflow:brainstorm:synthesis"] - SYNTHESIS --> PLAN["/workflow:plan --from-brainstorming"] - PLAN --> EXECUTE["/workflow:execute --type=complex"] - EXECUTE --> TASKS["/task:breakdown impl-1 --depth=2"] - TASKS --> IMPL["/task:execute impl-1.1"] - IMPL --> REVIEW["/workflow:review --auto-fix"] - REVIEW --> DOCS["/update-memory-related"] + SYNTHESIS --> PLAN["/workflow:plan 描述"] + PLAN --> VERIFY["/workflow:plan-verify"] + VERIFY --> EXECUTE["/workflow:execute"] + EXECUTE --> TEST["/workflow:test-gen WFS-session-id"] + TEST --> REVIEW["/workflow:review"] + REVIEW --> DOCS["/workflow:docs all"] + DOCS --> COMPLETE[✅ 完成] +``` + +### ⚡ **工作流会话管理** + +```mermaid +graph LR + START[📋 会话开始] --> MARKER[🏷️ .active-session 标记] + MARKER --> JSON[📊 workflow-session.json] + JSON --> TASKS[🎯 .task/IMPL-*.json] + TASKS --> PAUSE[⏸️ 暂停:删除标记] + PAUSE --> RESUME[▶️ 恢复:恢复标记] + RESUME --> SWITCH[🔄 切换:更改活跃会话] ``` ### 🎯 **规划方法选择指南** @@ -226,32 +240,45 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat | 命令 | 语法 | 描述 | |------|------|------| -| `/enhance-prompt` | `/enhance-prompt <输入>` | 用技术上下文和结构增强用户输入 | -| `/context` | `/context [任务ID\|--filter] [--analyze] [--format=tree\|list\|json]` | 统一上下文管理,自动数据一致性 | -| `/update-memory-full` | `/update-memory-full` | 完整的项目级CLAUDE.md文档更新 | -| `/update-memory-related` | `/update-memory-related` | 针对变更模块的上下文感知文档更新 | +| `🎯 /enhance-prompt` | `/enhance-prompt "添加认证系统"` | 技术上下文增强 | +| `📊 /context` | `/context --analyze --format=tree` | 统一上下文管理 | +| `📝 /update-memory-full` | `/update-memory-full` | 完整文档更新 | +| `🔄 /update-memory-related` | `/update-memory-related` | 智能上下文感知更新 | -### Gemini CLI命令(分析与调查) +### 🔍 Gemini CLI命令(分析与调查) | 命令 | 语法 | 描述 | |------|------|------| -| `/gemini:analyze` | `/gemini:analyze <查询> [--all-files] [--save-session]` | 深度代码库分析和模式调查 | -| `/gemini:chat` | `/gemini:chat <查询> [--all-files] [--save-session]` | 无模板的直接Gemini CLI交互 | -| `/gemini:execute` | `/gemini:execute <任务ID\|描述> [--yolo] [--debug]` | 智能执行,自动上下文推断 | -| `/gemini:mode:auto` | `/gemini:mode:auto "<描述>"` | 基于输入分析的自动模板选择 | -| `/gemini:mode:bug-index` | `/gemini:mode:bug-index <错误描述>` | 专门的错误分析和诊断工作流 | -| `/gemini:mode:plan` | `/gemini:mode:plan <规划主题>` | 架构和规划模板执行 | +| `🔍 /gemini:analyze` | `/gemini:analyze "认证模式"` | 深度代码库分析 | +| `💬 /gemini:chat` | `/gemini:chat "解释这个架构"` | 直接Gemini交互 | +| `⚡ /gemini:execute` | `/gemini:execute "实现任务-001"` | 智能执行(YOLO权限) | +| `🎯 /gemini:mode:auto` | `/gemini:mode:auto "分析安全漏洞"` | 自动模板选择 | +| `🐛 /gemini:mode:bug-index` | `/gemini:mode:bug-index "支付处理失败"` | 错误分析和修复建议 | +| `📋 /gemini:mode:plan` | `/gemini:mode:plan "微服务架构"` | 项目规划和架构 | +| `🎯 /gemini:mode:plan-precise` | `/gemini:mode:plan-precise "复杂重构"` | 精确路径规划分析 | -### Codex CLI命令(开发与实现) +### 🔮 Qwen CLI命令(架构与代码生成) | 命令 | 语法 | 描述 | |------|------|------| -| `/codex:analyze` | `/codex:analyze <查询> [模式]` | 开发导向的代码库分析 | -| `/codex:chat` | `/codex:chat <查询> [模式]` | 直接Codex CLI交互 | -| `/codex:execute` | `/codex:execute <任务描述> [模式]` | 受控的自主开发 | -| `/codex:mode:auto` | `/codex:mode:auto "<任务描述>"` | **主要模式**: 完全自主开发 | -| `/codex:mode:bug-index` | `/codex:mode:bug-index <错误描述>` | 自主错误修复和解决 | -| `/codex:mode:plan` | `/codex:mode:plan <规划主题>` | 开发规划和架构 | +| `🔍 /qwen:analyze` | `/qwen:analyze "系统架构模式"` | 架构分析和代码质量 | +| `💬 /qwen:chat` | `/qwen:chat "设计认证系统"` | 直接Qwen交互 | +| `⚡ /qwen:execute` | `/qwen:execute "实现用户认证"` | 智能实现(YOLO权限) | +| `🚀 /qwen:mode:auto` | `/qwen:mode:auto "构建微服务API"` | 自动模板选择和执行 | +| `🐛 /qwen:mode:bug-index` | `/qwen:mode:bug-index "服务内存泄漏"` | 错误分析和修复建议 | +| `📋 /qwen:mode:plan` | `/qwen:mode:plan "设计可扩展数据库"` | 架构规划和分析 | +| `🎯 /qwen:mode:plan-precise` | `/qwen:mode:plan-precise "复杂系统迁移"` | 精确架构规划 | + +### 🤖 Codex CLI命令(开发与实现) + +| 命令 | 语法 | 描述 | +|------|------|------| +| `🔍 /codex:analyze` | `/codex:analyze "优化机会"` | 开发分析 | +| `💬 /codex:chat` | `/codex:chat "实现JWT认证"` | 直接Codex交互 | +| `⚡ /codex:execute` | `/codex:execute "重构用户服务"` | 自主实现(YOLO权限) | +| `🚀 /codex:mode:auto` | `/codex:mode:auto "构建支付系统"` | **主要模式**: 完全自主开发 | +| `🐛 /codex:mode:bug-index` | `/codex:mode:bug-index "修复竞态条件"` | 自主错误修复和实现 | +| `📋 /codex:mode:plan` | `/codex:mode:plan "实现API端点"` | 开发规划和实现 | ### 工作流管理命令 @@ -268,11 +295,18 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat #### 工作流操作 | 命令 | 语法 | 描述 | |------|------|------| -| `/workflow:brainstorm` | `/workflow:brainstorm <主题> [--perspectives=角色1,角色2,...]` | 多智能体概念规划 | -| `/workflow:plan` | `/workflow:plan [--from-brainstorming] [--skip-brainstorming]` | 将概念转换为可执行计划 | -| `/workflow:plan-deep` | `/workflow:plan-deep <主题> [--complexity=high] [--depth=3]` | 深度架构规划与综合分析 | -| `/workflow:execute` | `/workflow:execute [--type=simple\|medium\|complex] [--auto-create-tasks]` | 进入实现阶段 | -| `/workflow:review` | `/workflow:review [--auto-fix]` | 质量保证和验证 | +| `💭 /workflow:brainstorm:*` | `/workflow:brainstorm:system-architect "微服务"` | 角色专家的多视角规划 | +| `🤝 /workflow:brainstorm:synthesis` | `/workflow:brainstorm:synthesis` | 综合所有头脑风暴视角 | +| `🎨 /workflow:brainstorm:artifacts` | `/workflow:brainstorm:artifacts "主题描述"` | 生成结构化规划文档 | +| `📋 /workflow:plan` | `/workflow:plan "描述" \| file.md \| ISS-001` | 转换为可执行实现计划 | +| `🔍 /workflow:plan-deep` | `/workflow:plan-deep "需求描述"` | Gemini分析的深度技术规划 | +| `✅ /workflow:plan-verify` | `/workflow:plan-verify` | 双分析的执行前验证 | +| `⚡ /workflow:execute` | `/workflow:execute` | 协调智能体进行实现 | +| `🔄 /workflow:resume` | `/workflow:resume [--from TASK-ID] [--retry]` | 智能工作流恢复 | +| `📊 /workflow:status` | `/workflow:status [task-id] [format] [validation]` | 从任务数据生成按需视图 | +| `🧪 /workflow:test-gen` | `/workflow:test-gen WFS-session-id` | 生成全面测试工作流 | +| `🔍 /workflow:review` | `/workflow:review` | 执行质量验证审查阶段 | +| `📚 /workflow:docs` | `/workflow:docs "architecture" \| "api" \| "all"` | 生成分层文档 | #### 问题管理 | 命令 | 语法 | 描述 | @@ -286,10 +320,24 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat | 命令 | 语法 | 描述 | |------|------|------| -| `/task:create` | `/task:create "<标题>" [--type=类型] [--priority=级别] [--parent=父ID]` | 创建带层次结构的实现任务 | -| `/task:breakdown` | `/task:breakdown <任务ID> [--strategy=auto\|interactive] [--depth=1-3]` | 将任务分解为可管理的子任务 | -| `/task:execute` | `/task:execute <任务ID> [--mode=auto\|guided] [--agent=类型]` | 执行任务并选择智能体 | -| `/task:replan` | `/task:replan [任务ID\|--all] [--reason] [--strategy=adjust\|rebuild]` | 使任务适应变更需求 | +| `➕ /task:create` | `/task:create "用户认证系统"` | 创建带上下文的实现任务 | +| `🔄 /task:breakdown` | `/task:breakdown task-id` | 智能任务分解 | +| `⚡ /task:execute` | `/task:execute task-id` | 用适当的智能体执行任务 | +| `📋 /task:replan` | `/task:replan task-id ["text" \| file.md \| ISS-001]` | 用详细输入重新规划任务 | + +#### 🧠 头脑风暴角色命令 +| 角色 | 命令 | 目的 | +|------|---------|----------| +| 🏗️ **系统架构师** | `/workflow:brainstorm:system-architect` | 技术架构分析 | +| 🔒 **安全专家** | `/workflow:brainstorm:security-expert` | 安全和威胁分析 | +| 📊 **产品经理** | `/workflow:brainstorm:product-manager` | 用户需求和商业价值 | +| 🎨 **UI设计师** | `/workflow:brainstorm:ui-designer` | 用户体验和界面 | +| 📈 **业务分析师** | `/workflow:brainstorm:business-analyst` | 流程优化分析 | +| 🔬 **创新负责人** | `/workflow:brainstorm:innovation-lead` | 新兴技术机会 | +| 📋 **功能规划师** | `/workflow:brainstorm:feature-planner` | 功能开发规划 | +| 🗄️ **数据架构师** | `/workflow:brainstorm:data-architect` | 数据建模和分析 | +| 👥 **用户研究员** | `/workflow:brainstorm:user-researcher` | 用户行为分析 | +| 🚀 **自动选择** | `/workflow:brainstorm:auto` | 动态角色选择 | ### 头脑风暴角色命令 @@ -308,46 +356,57 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat ## 使用工作流 -### 复杂功能开发 +### 完整功能开发工作流 ```bash -# 1. 初始化工作流会话 -/workflow:session:start "OAuth2认证系统" +# 1. 初始化专注会话 +/workflow:session:start "用户仪表盘功能" -# 2. 多视角分析 -/workflow:brainstorm "OAuth2实现策略" \ - --perspectives=system-architect,security-expert,data-architect +# 2. 多视角头脑风暴 +/workflow:brainstorm:system-architect "仪表盘分析系统" +/workflow:brainstorm:ui-designer "仪表盘用户体验" +/workflow:brainstorm:data-architect "分析数据流" -# 3. 生成实现计划 -/workflow:plan --from-brainstorming +# 3. 综合所有视角 +/workflow:brainstorm:synthesis -# 4. 创建任务层次结构 -/task:create "后端认证API" -/task:breakdown IMPL-1 --strategy=auto --depth=2 +# 4. 创建可执行实现计划 +/workflow:plan "用户仪表盘与分析和实时数据" -# 5. 执行开发任务 -/codex:mode:auto "实现JWT令牌管理系统" -/codex:mode:auto "创建OAuth2提供商集成" +# 5. 执行前验证计划 +/workflow:plan-verify -# 6. 审查和验证 -/workflow:review --auto-fix +# 6. 智能体协调执行实现 +/workflow:execute -# 7. 更新文档 -/update-memory-related +# 7. 生成全面测试套件 +/workflow:test-gen WFS-user-dashboard-feature + +# 8. 质量保证和审查 +/workflow:review + +# 9. 生成文档 +/workflow:docs "all" ``` -### 错误分析和解决 +### 快速错误解决 ```bash -# 1. 创建专注会话 -/workflow:session:start "支付处理错误修复" - -# 2. 分析问题 +# 快速错误修复工作流 +/workflow:session:start "支付处理修复" /gemini:mode:bug-index "并发请求时支付验证失败" +/codex:mode:bug-index "修复支付验证竞态条件" +/workflow:review +``` -# 3. 实现解决方案 -/codex:mode:auto "修复支付验证逻辑中的竞态条件" - -# 4. 验证解决方案 -/workflow:review --auto-fix +### 架构分析与重构 +```bash +# 深度架构工作流 +/workflow:session:start "API重构倡议" +/gemini:analyze "当前API架构模式和技术债务" +/workflow:plan-deep "微服务转换策略" +/workflow:plan-verify +/qwen:mode:auto "重构单体架构为微服务架构" +/workflow:test-gen WFS-api-refactoring-initiative +/workflow:review ``` ### 项目文档管理 @@ -411,10 +470,12 @@ cd src/api && /update-memory-related - **内存**: 最低512MB,复杂工作流推荐2GB ### 集成要求 -- **Gemini CLI**: 分析工作流必需 -- **Codex CLI**: 自主开发必需 -- **Git仓库**: 变更跟踪和文档更新必需 -- **Claude Code IDE**: 推荐用于最佳命令集成 +- **🔍 Gemini CLI**: 分析和战略规划工作流必需 +- **🤖 Codex CLI**: 自主开发和错误修复必需 +- **🔮 Qwen CLI**: 架构分析和代码生成必需 +- **📂 Git仓库**: 变更跟踪和版本控制必需 +- **🎯 Claude Code IDE**: 推荐用于最佳体验 +- **🐍 Python 3.8+**: 高级pycli后端功能必需 ## 配置