# ๐Ÿš€ Claude Code Workflow (CCW)
[![Version](https://img.shields.io/badge/version-v2.0.0-blue.svg)](https://github.com/catlog22/Claude-Code-Workflow/releases) [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)]() **Languages:** [English](README.md) | [ไธญๆ–‡](README_CN.md)
--- ## ๐Ÿ“‹ Overview **Claude Code Workflow (CCW)** is a next-generation multi-agent automation framework for software development that orchestrates complex development tasks through intelligent workflow management and autonomous execution. > **๐ŸŽฏ Latest Release v2.0**: Major architectural evolution with enhanced workflow lifecycle, Python-powered backend (`pycli`), comprehensive test workflow generation, plan verification system, and brainstorm artifacts integration. See [CHANGELOG.md](CHANGELOG.md) for details. ### ๐ŸŒŸ Key Innovations - **๐Ÿ”„ Enhanced Workflow Lifecycle**: Complete development cycle: Brainstorm โ†’ Plan โ†’ Verify โ†’ Execute โ†’ Test โ†’ Review - **๐Ÿ Python-Powered Backend**: Advanced `pycli` integration with hierarchical vector database support for semantic context discovery - **๐Ÿงช Automated Test Generation**: Comprehensive test workflow generation (`/workflow:test-gen`) with full coverage planning - **โœ… Plan Verification System**: Pre-execution validation using dual Gemini/Codex analysis (`/workflow:plan-verify`) - **๐ŸŽฏ JSON-First Architecture**: Single source of truth with atomic session management - **๐Ÿ’ก Brainstorm Artifacts**: Multi-perspective planning with synthesis and structured document generation --- ## ๐Ÿ—๏ธ System Architecture ### **๐Ÿ”ง Core Architectural Principles** ```mermaid graph TB subgraph "๐Ÿ–ฅ๏ธ CLI Interface Layer" CLI[CLI Commands] GEM[Gemini CLI] COD[Codex CLI] WRAPPER[Intelligent Gemini Wrapper] end subgraph "๐Ÿ“‹ Session Management" MARKER[".active-session markers"] SESSION["workflow-session.json"] WDIR[".workflow/ directories"] end subgraph "๐Ÿ“Š JSON-First Task System" TASK_JSON[".task/impl-*.json"] HIERARCHY["Task Hierarchy (max 2 levels)"] STATUS["Task Status Management"] DECOMP["Task Decomposition Engine"] end subgraph "๐Ÿค– Multi-Agent Orchestration" PLAN_AGENT[Conceptual Planning Agent] ACTION_AGENT[Action Planning Agent] CODE_AGENT[Code Developer Agent] REVIEW_AGENT[Code Review Agent] MEMORY_AGENT[Memory Gemini Bridge] end CLI --> WRAPPER WRAPPER --> GEM CLI --> COD GEM --> PLAN_AGENT COD --> CODE_AGENT PLAN_AGENT --> TASK_JSON ACTION_AGENT --> TASK_JSON CODE_AGENT --> TASK_JSON TASK_JSON --> DECOMP DECOMP --> HIERARCHY HIERARCHY --> STATUS SESSION --> MARKER MARKER --> WDIR ``` ### ๐Ÿ›๏ธ **Three-Pillar Foundation** | ๐Ÿ—๏ธ **JSON-First Data Model** | โšก **Atomic Session Management** | ๐Ÿงฉ **Adaptive Complexity** | |---|---|---| | Single source of truth | Marker-based session state | Auto-adjusts to project size | | Sub-millisecond queries | Zero-overhead switching | Simple โ†’ Medium โ†’ Complex | | Generated Markdown views | Conflict-free concurrency | Task limit enforcement | | Data consistency guaranteed | Instant context switching | Intelligent decomposition | --- ## โœจ Major Enhancements v2.0 ### ๐Ÿ”„ **Enhanced Workflow Lifecycle** Complete development lifecycle with quality gates at each phase: 1. **๐Ÿ’ก Brainstorm Phase** - Multi-perspective conceptual planning with role-based analysis 2. **๐Ÿ“‹ Plan Phase** - Structured implementation planning with task decomposition 3. **โœ… Verify Phase** - Pre-execution validation using Gemini (strategic) + Codex (technical) 4. **โšก Execute Phase** - Autonomous implementation with multi-agent orchestration 5. **๐Ÿงช Test Phase** - Automated test workflow generation with comprehensive coverage 6. **๐Ÿ” Review Phase** - Quality assurance and completion validation ### ๐Ÿ **Python-Powered Backend (`pycli`)** Advanced semantic context discovery system: ```bash # Hierarchical vector database support pycli --semantic-search "authentication patterns" # Auto-detects parent directory vector DB pycli --context-discovery --inherit-parent # Intelligent file relevance scoring pycli --analyze-relevance "jwt token validation" ``` ### ๐Ÿงช **Automated Test Generation** Comprehensive test workflow creation: - **Implementation Analysis**: Scans completed IMPL-* tasks for test requirements - **Multi-layered Testing**: Unit, Integration, E2E, Performance, Security tests - **Agent Assignment**: Specialized test agents for different test types - **Dependency Mapping**: Test execution follows implementation dependency chains ### โœ… **Plan Verification System** Dual-engine validation before execution: - **Gemini Strategic Analysis**: High-level feasibility and architectural soundness - **Codex Technical Analysis**: Implementation details and technical feasibility - **Cross-Validation**: Identifies conflicts between strategic vision and technical constraints - **Improvement Suggestions**: Actionable recommendations before implementation begins --- ## ๐Ÿ“Š Complexity Management System CCW automatically adapts workflow structure based on project complexity: | **Complexity** | **Task Count** | **Structure** | **Features** | |---|---|---|---| | ๐ŸŸข **Simple** | <5 tasks | Single-level | Minimal overhead, direct execution | | ๐ŸŸก **Medium** | 5-10 tasks | Two-level hierarchy | Progress tracking, automated docs | | ๐Ÿ”ด **Complex** | >10 tasks | Force re-scoping | Multi-iteration planning required | --- ## ๐Ÿ› ๏ธ Complete Command Reference ### ๐ŸŽฎ **Core System Commands** | Command | Function | Example | |---------|----------|---------| | `๐ŸŽฏ /enhance-prompt` | Technical context enhancement | `/enhance-prompt "add auth system"` | | `๐Ÿ“Š /context` | Unified context management | `/context --analyze --format=tree` | | `๐Ÿ“ /update-memory-full` | Complete documentation update | `/update-memory-full` | | `๐Ÿ”„ /update-memory-related` | Smart context-aware updates | `/update-memory-related` | ### ๐Ÿ” **Gemini CLI Commands** (Analysis & Investigation) | Command | Purpose | Usage | |---------|---------|-------| | `๐Ÿ” /gemini:analyze` | Deep codebase analysis | `/gemini:analyze "authentication patterns"` | | `๐Ÿ’ฌ /gemini:chat` | Direct Gemini interaction | `/gemini:chat "explain this architecture"` | | `โšก /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) | Command | Purpose | Usage | |---------|---------|-------| | `๐Ÿ” /codex:analyze` | Development analysis | `/codex:analyze "optimization opportunities"` | | `๐Ÿ’ฌ /codex:chat` | Direct Codex interaction | `/codex:chat "implement JWT auth"` | | `โšก /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** #### ๐Ÿ“‹ Session Management | Command | Function | Usage | |---------|----------|-------| | `๐Ÿš€ /workflow:session:start` | Create new session | `/workflow:session:start "OAuth2 System"` | | `โธ๏ธ /workflow:session:pause` | Pause current session | `/workflow:session:pause` | | `โ–ถ๏ธ /workflow:session:resume` | Resume session | `/workflow:session:resume "OAuth2 System"` | | `๐Ÿ“‹ /workflow:session:list` | List all sessions | `/workflow:session:list --active` | | `๐Ÿ”„ /workflow:session:switch` | Switch sessions | `/workflow:session:switch "Payment Fix"` | #### ๐ŸŽฏ Workflow Operations | Command | Function | Usage | |---------|----------|-------| | `๐Ÿ’ญ /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 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 ### ๐Ÿš€ **Enhanced Workflow Lifecycle** ```mermaid graph TD START[๐ŸŽฏ New Feature Request] --> SESSION["/workflow:session:start 'OAuth2 System'"] 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** #### **๐Ÿš€ Complete Feature Development Workflow** ```bash # 1. Initialize focused session /workflow:session:start "User Dashboard Feature" # 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. Synthesize all perspectives /workflow:brainstorm:synthesis # 4. Create executable implementation plan /workflow:plan "user dashboard with analytics and real-time data" # 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** ```bash # Quick bug fix workflow /workflow:session:start "Payment Processing Fix" /gemini:mode:bug-index "Payment validation fails on concurrent requests" /codex:mode:bug-index "Fix race condition in payment validation" /workflow:review ``` #### **๐Ÿ“Š Architecture Analysis & Refactoring** ```bash # Deep architecture workflow /workflow:session:start "API Refactoring Initiative" /gemini:analyze "current API architecture patterns and technical debt" /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 ``` --- ## ๐Ÿ—๏ธ Project Structure ``` ๐Ÿ“ .claude/ โ”œโ”€โ”€ ๐Ÿค– agents/ # AI agent definitions โ”œโ”€โ”€ ๐ŸŽฏ commands/ # CLI command implementations โ”‚ โ”œโ”€โ”€ ๐Ÿ” gemini/ # Gemini CLI commands โ”‚ โ”œโ”€โ”€ ๐Ÿค– codex/ # Codex CLI commands โ”‚ โ””โ”€โ”€ ๐ŸŽฏ workflow/ # Workflow management โ”œโ”€โ”€ ๐ŸŽจ output-styles/ # Output formatting templates โ”œโ”€โ”€ ๐ŸŽญ planning-templates/ # Role-specific planning โ”œโ”€โ”€ ๐Ÿ’ฌ prompt-templates/ # AI interaction templates โ”œโ”€โ”€ ๐Ÿ”ง scripts/ # Automation utilities โ”‚ โ”œโ”€โ”€ ๐Ÿ“Š gemini-wrapper # Intelligent Gemini wrapper โ”‚ โ”œโ”€โ”€ ๐Ÿ pycli # NEW: Python CLI backend โ”‚ โ”œโ”€โ”€ ๐Ÿ› ๏ธ install_pycli.sh # NEW: Python tools installer โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ read-task-paths.sh # Task path conversion โ”‚ โ””โ”€โ”€ ๐Ÿ—๏ธ get_modules_by_depth.sh # Project analysis โ”œโ”€โ”€ ๐Ÿ› ๏ธ workflows/ # Core workflow documentation โ”‚ โ”œโ”€โ”€ ๐Ÿ›๏ธ workflow-architecture.md # System architecture โ”‚ โ”œโ”€โ”€ ๐Ÿ“Š intelligent-tools-strategy.md # Tool selection guide โ”‚ โ”œโ”€โ”€ ๐Ÿ python-tools-strategy.md # NEW: Python backend strategy โ”‚ โ””โ”€โ”€ ๐Ÿ”ง tools-implementation-guide.md # Implementation details โ””โ”€โ”€ โš™๏ธ settings.local.json # Local configuration ๐Ÿ“ .workflow/ # Session workspace (auto-generated) โ”œโ”€โ”€ ๐Ÿท๏ธ .active-[session] # Active session markers โ””โ”€โ”€ ๐Ÿ“‹ WFS-[topic-slug]/ # Individual sessions โ”œโ”€โ”€ โš™๏ธ workflow-session.json # Session metadata โ”œโ”€โ”€ ๐Ÿ“Š .task/impl-*.json # Task definitions โ”œโ”€โ”€ ๐Ÿ“ IMPL_PLAN.md # Planning documents โ”œโ”€โ”€ โœ… TODO_LIST.md # Progress tracking โ”œโ”€โ”€ ๐Ÿ“š .summaries/ # Completion summaries โ”œโ”€โ”€ ๐Ÿง  .process/ # NEW: Planning artifacts โ”‚ โ””โ”€โ”€ ๐Ÿ“ˆ ANALYSIS_RESULTS.md # Analysis results โ””โ”€โ”€ ๐Ÿงช WFS-test-[session]/ # NEW: Generated test workflows ``` --- ## โšก Performance & Technical Specs ### ๐Ÿ“Š **Performance Metrics** | Metric | Performance | Details | |--------|-------------|---------| | ๐Ÿ”„ **Session Switching** | <10ms | Atomic marker file operations | | ๐Ÿ“Š **JSON Queries** | <1ms | Direct JSON access, no parsing overhead | | ๐Ÿ“ **Doc Updates** | <30s | Medium projects, intelligent targeting | | ๐Ÿ” **Context Loading** | <5s | Complex codebases with caching | | โšก **Task Execution** | 10min timeout | Complex operations with error handling | ### ๐Ÿ› ๏ธ **System Requirements** - **๐Ÿ–ฅ๏ธ OS**: Windows 10+, Ubuntu 18.04+, macOS 10.15+ - **๐Ÿ“ฆ Dependencies**: Git, Node.js (Gemini), Python 3.8+ (Codex) - **๐Ÿ’พ Storage**: ~50MB core + variable project data - **๐Ÿง  Memory**: 512MB minimum, 2GB recommended ### ๐Ÿ”— **Integration Requirements** - **๐Ÿ” 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 --- ## โš™๏ธ Installation & Configuration ### ๐Ÿš€ **Quick Installation** ```powershell Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content ``` ### โœ… **Verify Installation** ```bash /workflow:session list ``` ### โš™๏ธ **Essential Configuration** #### **Gemini CLI Setup** ```json // ~/.gemini/settings.json { "contextFileName": "CLAUDE.md" } ``` #### **Optimized .geminiignore** ```bash # Performance optimization /dist/ /build/ /node_modules/ /.next/ # Temporary files *.tmp *.log /temp/ # Include important docs !README.md !**/CLAUDE.md ``` --- ## ๐Ÿค Contributing ### ๐Ÿ› ๏ธ **Development Setup** 1. ๐Ÿด Fork the repository 2. ๐ŸŒฟ Create feature branch: `git checkout -b feature/enhancement-name` 3. ๐Ÿ“ฆ Install dependencies 4. โœ… Test with sample projects 5. ๐Ÿ“ค Submit detailed pull request ### ๐Ÿ“ **Code Standards** - โœ… Follow existing command patterns - ๐Ÿ”„ Maintain backward compatibility - ๐Ÿงช Add tests for new functionality - ๐Ÿ“š Update documentation - ๐Ÿท๏ธ Use semantic versioning --- ## ๐Ÿ“ž Support & Resources
| Resource | Link | Description | |----------|------|-------------| | ๐Ÿ“š **Documentation** | [Project Wiki](https://github.com/catlog22/Claude-Code-Workflow/wiki) | Comprehensive guides | | ๐Ÿ› **Issues** | [GitHub Issues](https://github.com/catlog22/Claude-Code-Workflow/issues) | Bug reports & features | | ๐Ÿ’ฌ **Discussions** | [Community Forum](https://github.com/catlog22/Claude-Code-Workflow/discussions) | Community support | | ๐Ÿ“‹ **Changelog** | [Release History](CHANGELOG.md) | Version history |
--- ## ๐Ÿ“„ License This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details. ---
**๐Ÿš€ Claude Code Workflow (CCW)** *Professional software development workflow automation through intelligent multi-agent coordination and autonomous execution capabilities.* [![โญ Star on GitHub](https://img.shields.io/badge/โญ-Star%20on%20GitHub-yellow.svg)](https://github.com/catlog22/Claude-Code-Workflow)