# ๐Ÿš€ Claude Code Workflow (CCW)
[![Version](https://img.shields.io/badge/version-v1.3.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 v1.3**: Enhanced task decomposition standards, advanced search strategies with bash command combinations, free exploration phases for agents, and comprehensive workflow system improvements. See [CHANGELOG.md](CHANGELOG.md) for details. ### ๐ŸŒŸ Key Innovations - **๐Ÿง  Intelligent Task Decomposition**: New core standards prevent over-fragmentation with functional completeness principles - **๐Ÿ” Advanced Search Strategies**: Powerful command combinations using ripgrep, grep, find, awk, sed for comprehensive analysis - **โšก Free Exploration Phase**: Agents can gather supplementary context after structured analysis - **๐ŸŽฏ JSON-First Architecture**: Single source of truth with atomic session management - **๐Ÿค– Dual CLI Integration**: Gemini for analysis, Codex for autonomous development --- ## ๐Ÿ—๏ธ 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 v1.3 ### ๐ŸŽฏ **Core Task Decomposition Standards** Revolutionary task decomposition system with four core principles: 1. **๐ŸŽฏ Functional Completeness Principle** - Complete, runnable functional units 2. **๐Ÿ“ Minimum Size Threshold** - 3+ files or 200+ lines minimum 3. **๐Ÿ”— Dependency Cohesion Principle** - Tightly coupled components together 4. **๐Ÿ“Š Hierarchy Control Rule** - Flat โ‰ค5, hierarchical 6-10, re-scope >10 ### ๐Ÿ” **Advanced Search Strategies** Powerful command combinations for comprehensive codebase analysis: ```bash # Pattern discovery with context rg -A 3 -B 3 'authenticate|login|jwt' --type ts --type js | head -50 # Multi-tool analysis pipeline find . -name '*.ts' | xargs rg -l 'auth' | head -15 # Interface extraction with awk rg '^\\s*interface\\s+\\w+' --type ts -A 5 | awk '/interface/{p=1} p&&/^}/{p=0;print}' ``` ### ๐Ÿš€ **Free Exploration Phase** Agents can enter supplementary context gathering using bash commands (grep, find, rg, awk, sed) after completing structured pre-analysis steps. ### ๐Ÿง  **Intelligent Gemini Wrapper** Smart automation with token management and approval modes: - **Analysis Detection**: Keywords trigger `--approval-mode default` - **Development Detection**: Action words trigger `--approval-mode yolo` - **Auto Token Management**: Handles `--all-files` based on project size - **Error Logging**: Comprehensive error tracking and recovery --- ## ๐Ÿ“Š 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 | `/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"` | ### ๐Ÿค– **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` | 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"` | ### ๐ŸŽฏ **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-agent planning | `/workflow:brainstorm "microservices architecture"` | | `๐Ÿ“‹ /workflow:plan` | Convert to executable plans | `/workflow:plan --from-brainstorming` | | `๐Ÿ” /workflow:plan-deep` | Deep architectural planning | `/workflow:plan-deep "API redesign" --complexity=high` | | `โšก /workflow:execute` | Implementation phase | `/workflow:execute --type=complex` | | `โœ… /workflow:review` | Quality assurance | `/workflow:review --auto-fix` | #### ๐Ÿท๏ธ 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` | --- ## ๐ŸŽฏ Complete Development Workflows ### ๐Ÿš€ **Complex Feature Development** ```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"] DOCS --> COMPLETE[โœ… Complete] ``` ### ๐Ÿ”ฅ **Quick Development Examples** #### **๐Ÿš€ Full Stack Feature Implementation** ```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 # 3. Generate executable plan with task decomposition /workflow:plan --from-brainstorming # 4. Autonomous implementation /codex:mode:auto "Implement user dashboard with analytics, charts, and real-time data" # 5. Quality assurance and deployment /workflow:review --auto-fix /update-memory-related ``` #### **โšก 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:auto "Fix race condition in payment validation with proper locking" /workflow:review --auto-fix ``` #### **๐Ÿ“Š Architecture Analysis & Refactoring** ```bash # Deep architecture work /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" ``` --- ## ๐Ÿ—๏ธ 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 โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ 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 โ”‚ โ””โ”€โ”€ ๐Ÿ”ง 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 ``` --- ## โšก 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 workflows - **๐Ÿค– Codex CLI**: Required for autonomous development - **๐Ÿ“‚ Git Repository**: Required for change tracking - **๐ŸŽฏ Claude Code IDE**: Recommended for optimal experience --- ## โš™๏ธ 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)