Compare commits

...

10 Commits

Author SHA1 Message Date
catlog22
3a78dac919 release: v3.3.0 - CLI Tool Enhancements & Codex Multi-Step Execution
 Features:
- New /cli:codex-execute command for automated multi-step task execution
- Codex resume mechanism (codex exec "..." resume --last) for context continuity
- TodoWrite progress tracking for subtask execution
- Optional Git verification after each subtask (--verify-git flag)
- Automatic task JSON detection and loading
- Enhanced Codex agent configuration (.codex/AGENTS.md v2.1.0)

📚 Documentation:
- Streamlined CLI documentation (60% reduction in redundancy)
- Updated /cli:analyze, /cli:chat, /cli:execute commands
- Enhanced intelligent-tools-strategy.md with Codex resume patterns
- Unified command templates for Gemini/Qwen vs Codex
- Added Codex -i parameter documentation for image attachment

🔧 Technical:
- Multi-task prompt format (Single-Task & Multi-Task)
- Subtask coordination guidelines and best practices
- Enhanced MODE: auto with subtask execution flow
- Progress reporting for multi-step workflows

📦 Updates:
- Version bumped to 3.3.0 in README.md, README_CN.md
- Created .claude/version.json for version tracking
- Comprehensive CHANGELOG.md entry with all changes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 00:51:34 +08:00
catlog22
4b578285ea refactor: Enhance tool write protection and lower Bash requirement
- Add explicit write operation protection in intelligent-tools-strategy
  - Require MODE=write or MODE=auto for local codebase modifications
  - Default all tools to read-only analysis mode
  - Convert all Chinese text to English for consistency
- Lower Bash version requirement from 4.0 to 2.0 in Install-Claude.sh
  - Align with install-remote.sh requirements
  - Improve compatibility with older systems

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 00:09:17 +08:00
catlog22
5c66e268ec fix: Clarify auto-continue workflow execution model in plan command
- Replace sequential execution model with explicit auto-continue pattern
- Document that each phase returns to user before auto-continuing
- Use TodoList state for progress tracking (no external state files)
- Store parsed data (sessionId, contextPath) in memory between phases
- Clarify error handling keeps phase in_progress without proceeding

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 23:56:09 +08:00
catlog22
de4914f046 fix: Lower Bash version requirement from 4.0 to 2.0
Based on Gemini analysis, all script features (double brackets, local keyword,
BASH_VERSINFO array) are supported in Bash 2.0+. This change improves
compatibility with older systems while maintaining full functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 21:23:23 +08:00
catlog22
00d1be60cb refactor: Rename DMS directory to memory and update references
- Renamed .claude/workflows/cli-templates/prompts/dms/ to memory/
- Updated all path references in update_module_claude.sh
- Updated terminology in INSTALL.md and INSTALL_CN.md
- Changed DMS system references to memory system

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:46:44 +08:00
catlog22
f549dfcc9b release: v3.2.3 - Version Management System
Add comprehensive version management and upgrade notification system:

New Features:
- Add /version command for checking installed versions
- GitHub API integration for latest release detection
- Automatic upgrade notifications and recommendations
- Version tracking in both local and global installations
- Quick version check with comprehensive status display

Documentation Updates:
- Update CHANGELOG.md with v3.2.3 release notes
- Update README.md version badge to v3.2.3
- Update README_CN.md with Chinese version documentation
- Add RELEASE_NOTES_v3.2.3.md with detailed release information
- Add /version command to command reference tables

Cleanup:
- Remove old release notes (RELEASE_NOTES_v2.0.md, RELEASE_NOTES_v3.2.1.md)

Version Files:
- Update ~/.claude/version.json to v3.2.3

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:09:37 +08:00
catlog22
c5c36a23ea fix: Optimize version command API calls and data extraction
- Change API endpoint from /branches/main to /commits/main for reliable commit info
- Add 30-second timeout to all network calls for slow connections
- Extract release name and published date from latest release
- Extract commit message (first line only) using improved parsing
- Add commit date extraction from main branch
- Update documentation with API endpoints and timeout configuration
- Fix commit message extraction to handle JSON escape sequences

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:00:06 +08:00
catlog22
a03415bfeb feat: Add version tracking and upgrade check system
- Add /version command to check installed and latest versions
- Create version.json metadata file during installation
- Pass version and branch info from install-remote.ps1 to Install-Claude.ps1
- Support version comparison and upgrade recommendations
- Track installation mode (Global/Path) and source branch

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 12:46:44 +08:00
catlog22
06772c675e docs: Enhance core coding principles with engineering best practices
Integrated five fundamental engineering principles at the start of Core Beliefs:
- Good taste: eliminate edge cases for elegant logic
- Extreme simplicity: complexity as root cause of issues
- Pragmatism: solve real problems, not hypothetical ones
- Data structures first: prioritize data design over code
- Backward compatibility: preserve existing functionality

These principles complement existing guidelines while emphasizing foundational software engineering wisdom.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 12:24:29 +08:00
catlog22
8c062f3611 docs: Update README files for v3.2.2 release
Update both English and Chinese README files to reflect v3.2.2 changes:

Version Updates:
- Bump version badge from v3.2.1 to v3.2.2
- Update "What's New" section with v3.2.2 features

Key Documentation Changes:
- Independent test session architecture (WFS-test-[source])
- Automatic cross-session context gathering via metadata
- Integrated concept-enhanced analysis (Gemini + Codex parallel)
- Reuses IMPL-*.json format with meta.type="test-fix"
- 4-phase workflow: session → context → analysis → task generation

Command Reference Updates:
- Updated /workflow:test-gen description to reflect independent workflow creation
- Updated Phase 4 examples to show new usage: /workflow:test-gen WFS-auth

Changes in Both Files:
- README.md: English version updated
- README_CN.md: Chinese version updated with matching content

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 12:07:35 +08:00
28 changed files with 1600 additions and 965 deletions

View File

@@ -17,185 +17,68 @@ allowed-tools: SlashCommand(*), Bash(*), TodoWrite(*), Read(*), Glob(*)
Execute CLI tool analysis on codebase patterns, architecture, or code quality.
**Supported Tools**: codex, gemini (default), qwen
**Reference**: @~/.claude/workflows/intelligent-tools-strategy.md for complete tool details
## Execution Flow
1. **Parse tool selection**: Extract `--tool` flag (default: gemini)
2. **If `--enhance` flag present**: Execute `/enhance-prompt "[analysis-target]"` and use enhanced output
3. Parse analysis target (original or enhanced)
4. Detect analysis type (pattern/architecture/security/quality)
5. Build command for selected tool with template
6. Execute analysis
7. Return results
## Core Rules
1. **Tool Selection**: Use `--tool` value or default to gemini
2. **Enhance First (if flagged)**: Execute `/enhance-prompt` before analysis when `--enhance` present
3. **Execute Immediately**: Build and run command without preliminary analysis
4. **Template Selection**: Auto-select template based on keywords
5. **Context Inclusion**: Always include CLAUDE.md in context
6. **Direct Output**: Return tool output directly to user
## Tool Selection
| Tool | Wrapper | Best For | Permissions |
|------|---------|----------|-------------|
| **gemini** (default) | `~/.claude/scripts/gemini-wrapper` | Analysis, exploration, documentation | Read-only |
| **qwen** | `~/.claude/scripts/qwen-wrapper` | Architecture, code generation | Read-only for analyze |
| **codex** | `codex --full-auto exec` | Development analysis, deep inspection | `-s danger-full-access --skip-git-repo-check` |
1. Parse tool selection (default: gemini)
2. If `--enhance`: Execute `/enhance-prompt` first
3. Detect analysis type and select template
4. Build and execute command
5. Return results
## Enhancement Integration
**When `--enhance` flag present**:
**When `--enhance` flag present**: Execute `/enhance-prompt "[analysis-target]"` first, then use enhanced output (INTENT/CONTEXT/ACTION) to build the analysis command.
## Command Template
**Gemini/Qwen**:
```bash
# Step 1: Enhance the prompt
SlashCommand(command="/enhance-prompt \"[analysis-target]\"")
# Step 2: Use enhanced output as analysis target
# Enhanced output provides:
# - INTENT: Clear technical goal
# - CONTEXT: Session memory + patterns
# - ACTION: Implementation steps
# - ATTENTION: Critical constraints
```
**Example**:
```bash
# User: /gemini:analyze --enhance "fix auth issues"
# Step 1: Enhance
/enhance-prompt "fix auth issues"
# Returns:
# INTENT: Debug authentication failures
# CONTEXT: JWT implementation in src/auth/, known token expiry issue
# ACTION: Analyze token lifecycle → verify refresh flow → check middleware
# ATTENTION: Preserve existing session management
# Step 2: Analyze with enhanced context
cd . && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: Debug authentication failures (from enhanced: JWT token lifecycle)
TASK: Analyze token lifecycle, refresh flow, and middleware integration
CONTEXT: @{src/auth/**/*} @{CLAUDE.md} Session context: known token expiry issue
EXPECTED: Root cause analysis with file references
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt) | Focus on JWT token handling
"
```
## Analysis Types
| Type | Keywords | Template | Context |
|------|----------|----------|---------|
| **pattern** | pattern, hooks, usage | analysis/pattern.txt | Matched files + CLAUDE.md |
| **architecture** | architecture, structure, design | analysis/architecture.txt | Full codebase + CLAUDE.md |
| **security** | security, vulnerability, auth | analysis/security.txt | Matched files + CLAUDE.md |
| **quality** | quality, test, coverage | analysis/quality.txt | Source + test files + CLAUDE.md |
## Command Templates
### Gemini (Default)
```bash
cd [target-dir] && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: [analysis goal from user input]
TASK: [specific analysis task]
cd [dir] && ~/.claude/scripts/[gemini|qwen]-wrapper -p "
PURPOSE: [analysis goal]
TASK: [specific task]
CONTEXT: @{[file-patterns]} @{CLAUDE.md}
EXPECTED: [expected output format]
EXPECTED: [output format]
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt) | [constraints]
"
```
### Qwen
**Codex**:
```bash
cd [target-dir] && ~/.claude/scripts/qwen-wrapper -p "
PURPOSE: [analysis goal from user input]
TASK: [specific analysis task]
codex -C [dir] --full-auto exec "
PURPOSE: [analysis goal]
TASK: [specific task]
CONTEXT: @{[file-patterns]} @{CLAUDE.md}
EXPECTED: [expected output format]
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt) | [constraints]
"
```
### Codex
```bash
codex -C [target-dir] --full-auto exec "
PURPOSE: [analysis goal from user input]
TASK: [specific analysis task]
CONTEXT: @{[file-patterns]} @{CLAUDE.md}
EXPECTED: [expected output format]
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt) | [constraints]
EXPECTED: [output format]
RULES: [constraints]
" --skip-git-repo-check -s danger-full-access
# With image attachment (e.g., UI screenshots, diagrams)
codex -C [dir] -i screenshot.png --full-auto exec "..." --skip-git-repo-check -s danger-full-access
```
## Examples
**Pattern Analysis (Gemini - default)**:
```bash
cd . && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: Analyze authentication patterns
TASK: Identify auth implementation patterns and conventions
CONTEXT: @{**/*auth*} @{CLAUDE.md}
EXPECTED: Pattern summary with file references
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | Focus on security
"
```
**Architecture Review (Qwen)**:
```bash
# User: /cli:analyze --tool qwen "component architecture"
cd . && ~/.claude/scripts/qwen-wrapper -p "
PURPOSE: Review component architecture
TASK: Analyze component structure and dependencies
CONTEXT: @{src/**/*} @{CLAUDE.md}
EXPECTED: Architecture diagram and integration points
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt) | Focus on modularity
"
```
**Deep Inspection (Codex)**:
```bash
# User: /cli:analyze --tool codex "performance bottlenecks"
codex -C . --full-auto exec "
PURPOSE: Identify performance bottlenecks
TASK: Deep analysis of performance issues
CONTEXT: @{src/**/*} @{CLAUDE.md}
EXPECTED: Performance metrics and optimization recommendations
RULES: Focus on computational complexity and memory usage
" --skip-git-repo-check -s danger-full-access
/cli:analyze "authentication patterns" # Gemini (default)
/cli:analyze --tool qwen "component architecture" # Qwen architecture
/cli:analyze --tool codex "performance bottlenecks" # Codex deep analysis
/cli:analyze --enhance "fix auth issues" # Enhanced prompt first
```
## File Pattern Logic
**Keyword Matching**:
Auto-detect file patterns from keywords:
- "auth" → `@{**/*auth*}`
- "component" → `@{src/components/**/*}`
- "API" → `@{**/api/**/*}`
- "test" → `@{**/*.test.*}`
- Generic → `@{src/**/*}` or `@{**/*}`
- Generic → `@{src/**/*}`
## Session Integration
**Detect Active Session**: Check for `.workflow/.active-*` marker file
**If Session Active**:
- Save results to `.workflow/WFS-[id]/.chat/analysis-[timestamp].md`
- Include session context in analysis
**If No Session**:
- Return results directly to user
## Output Format
Return Gemini's output directly, which includes:
- File references (file:line format)
- Code snippets
- Pattern analysis
- Recommendations
## Error Handling
- **Missing Template**: Use generic analysis prompt
- **No Context**: Use `@{**/*}` as fallback
- **Command Failure**: Report error and suggest manual command
- **Active Session**: Save results to `.workflow/WFS-[id]/.chat/analysis-[timestamp].md`
- **No Session**: Return results directly to user

View File

@@ -12,150 +12,81 @@ allowed-tools: SlashCommand(*), Bash(*)
model: sonnet
---
### 🚀 **Command Overview: `/cli:chat`**
## Purpose
- **Type**: CLI Tool Wrapper for Interactive Analysis
- **Purpose**: Direct interaction with CLI tools for codebase analysis
- **Supported Tools**: codex, gemini (default), qwen
Direct interaction with CLI tools for codebase analysis and Q&A.
### 📥 **Parameters & Usage**
**Supported Tools**: codex, gemini (default), qwen
**Reference**: @~/.claude/workflows/intelligent-tools-strategy.md for complete tool details
- **`<inquiry>` (Required)**: Your question or analysis request
- **`--tool <codex|gemini|qwen>` (Optional)**: Select CLI tool (default: gemini)
- **`--enhance` (Optional)**: Enhance inquiry with `/enhance-prompt` before execution
- **`--all-files` (Optional)**: Includes the entire codebase in the analysis context
- **`--save-session` (Optional)**: Saves the interaction to current workflow session directory
- **File References**: Specify files or patterns using `@{path/to/file}` syntax
## Parameters
### 🔄 **Execution Workflow**
- `<inquiry>` (Required): Question or analysis request
- `--tool <codex|gemini|qwen>` (Optional): Select CLI tool (default: gemini)
- `--enhance` (Optional): Enhance inquiry with `/enhance-prompt` first
- `--all-files` (Optional): Include entire codebase in context
- `--save-session` (Optional): Save interaction to workflow session
`Parse Tool` **->** `Parse Input` **->** `[Optional] Enhance` **->** `Assemble Context` **->** `Construct Prompt` **->** `Execute CLI Tool` **->** `(Optional) Save Session`
## Execution Flow
### 🛠️ **Tool Selection**
1. Parse tool selection (default: gemini)
2. If `--enhance`: Execute `/enhance-prompt` first
3. Assemble context (files + CLAUDE.md)
4. Execute CLI tool
5. Optional: Save to session
| Tool | Best For | Wrapper |
|------|----------|---------|
| **gemini** (default) | General analysis, exploration | `~/.claude/scripts/gemini-wrapper` |
| **qwen** | Architecture, design patterns | `~/.claude/scripts/qwen-wrapper` |
| **codex** | Development queries, deep analysis | `codex --full-auto exec` |
## Enhancement Integration
### 🔄 **Original Execution Workflow**
**When `--enhance` flag present**: Execute `/enhance-prompt "[inquiry]"` first, then use enhanced output (INTENT/CONTEXT/ACTION) to build the chat command.
`Parse Input` **->** `[Optional] Enhance` **->** `Assemble Context` **->** `Construct Prompt` **->** `Execute Gemini CLI` **->** `(Optional) Save Session`
## Context Assembly
### 🎯 **Enhancement Integration**
Context gathered from:
1. **Project Guidelines**: `@{CLAUDE.md,**/*CLAUDE.md}` (always)
2. **User-Explicit Files**: Files specified by user
3. **All Files Flag**: `--all-files` includes entire codebase
**When `--enhance` flag present**:
## Command Template
**Gemini/Qwen**:
```bash
# Step 1: Enhance the inquiry
SlashCommand(command="/enhance-prompt \"[inquiry]\"")
# Step 2: Use enhanced output for chat
# Enhanced output provides enriched context and structured intent
```
**Example**:
```bash
# User: /gemini:chat --enhance "fix the login"
# Step 1: Enhance
/enhance-prompt "fix the login"
# Returns:
# INTENT: Debug login authentication failure
# CONTEXT: JWT auth in src/auth/, session state issue
# ACTION: Check token validation → verify middleware → test flow
# Step 2: Chat with enhanced context
gemini -p "Debug login authentication failure. Focus on JWT token validation
in src/auth/, verify middleware integration, and test authentication flow.
Known issue: session state management"
```
### 📚 **Context Assembly**
Context is gathered from:
1. **Project Guidelines**: Always includes `@{CLAUDE.md,**/*CLAUDE.md}`
2. **User-Explicit Files**: Files specified by the user (e.g., `@{src/auth/*.js}`)
3. **All Files Flag**: The `--all-files` flag includes the entire codebase
### 📝 **Prompt Format**
**Core Guidelines**: @~/.claude/workflows/intelligent-tools-strategy.md
```bash
cd [directory] && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: [clear analysis/inquiry goal]
TASK: [specific analysis or question]
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md} @{target_files}
EXPECTED: [expected response format]
RULES: [constraints or focus areas]
cd [dir] && ~/.claude/scripts/[gemini|qwen]-wrapper -p "
PURPOSE: [inquiry goal]
TASK: [specific question]
CONTEXT: @{CLAUDE.md} @{target_files}
EXPECTED: [response format]
RULES: [constraints]
"
# With --all-files
cd [dir] && ~/.claude/scripts/[gemini|qwen]-wrapper --all-files -p "..."
```
### ⚙️ **Execution Implementation**
**Standard Template**:
**Codex**:
```bash
cd . && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: [user inquiry goal]
TASK: [specific question or analysis]
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md} @{inferred_or_specified_files}
EXPECTED: Analysis with file references and code examples
RULES: [focus areas based on inquiry]
"
codex -C [dir] --full-auto exec "
PURPOSE: [inquiry goal]
TASK: [specific question]
CONTEXT: @{CLAUDE.md} @{target_files}
EXPECTED: [response format]
RULES: [constraints]
" --skip-git-repo-check -s danger-full-access
# With image attachment
codex -C [dir] -i screenshot.png --full-auto exec "..." --skip-git-repo-check -s danger-full-access
```
**With --all-files flag**:
## Examples
```bash
cd . && ~/.claude/scripts/gemini-wrapper --all-files -p "
PURPOSE: [user inquiry goal]
TASK: [specific question or analysis]
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md} [entire codebase]
EXPECTED: Comprehensive analysis across all files
RULES: [focus areas based on inquiry]
"
/cli:chat "analyze the authentication flow" # Gemini (default)
/cli:chat --tool qwen "optimize React component" # Qwen
/cli:chat --tool codex "review security vulnerabilities" # Codex
/cli:chat --enhance "fix the login" # Enhanced prompt
/cli:chat --all-files "find all API endpoints" # Full codebase
```
**Example - Authentication Analysis**:
```bash
cd . && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: Understand authentication flow implementation
TASK: Analyze authentication flow and identify patterns
CONTEXT: @{**/*auth*,**/*login*} @{CLAUDE.md}
EXPECTED: Flow diagram, security assessment, integration points
RULES: Focus on security patterns and JWT handling
"
```
## Session Persistence
**Example - Performance Optimization**:
```bash
cd src/components && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: Optimize React component performance
TASK: Identify performance bottlenecks in component rendering
CONTEXT: @{**/*.{jsx,tsx}} @{CLAUDE.md}
EXPECTED: Specific optimization recommendations with file:line references
RULES: Focus on re-render patterns and memoization opportunities
"
```
### 💾 **Session Persistence**
When `--save-session` flag is used:
- Check for existing active session (`.workflow/.active-*` markers)
- Save to existing session's `.chat/` directory or create new session
- File format: `chat-YYYYMMDD-HHMMSS.md`
- Include query, context, and response in saved file
**Session Template:**
```markdown
# Chat Session: [Timestamp]
## Query
[Original user inquiry]
## Context
[Files and patterns included in analysis]
## Gemini Response
[Complete response from Gemini CLI]
```
- **Active Session**: Save to `.workflow/WFS-[id]/.chat/chat-[timestamp].md`
- **No Session**: Return results directly

View File

@@ -0,0 +1,309 @@
---
name: codex-execute
description: Automated task decomposition and execution with Codex using resume mechanism
usage: /cli:codex-execute [--verify-git] <task-description|task-id>
argument-hint: "[--verify-git] task description or task-id"
examples:
- /cli:codex-execute "implement user authentication system"
- /cli:codex-execute --verify-git "refactor API layer"
- /cli:codex-execute IMPL-001
allowed-tools: SlashCommand(*), Bash(*), TodoWrite(*), Read(*), Glob(*)
---
# CLI Codex Execute Command (/cli:codex-execute)
## Purpose
Automated task decomposition and sequential execution with Codex, using `codex exec "..." resume --last` mechanism for continuity between subtasks.
**Input**: User description or task ID (automatically loads from `.task/[ID].json` if applicable)
**Reference**: @~/.claude/workflows/intelligent-tools-strategy.md for Codex details
## Core Workflow
```
Task Input → Decompose into Subtasks → TodoWrite Tracking →
For Each Subtask:
1. Execute with Codex
2. [Optional] Git verification
3. Mark complete in TodoWrite
4. Resume next subtask with `codex resume --last`
→ Final Summary
```
## Parameters
- `<input>` (Required): Task description or task ID (e.g., "implement auth" or "IMPL-001")
- If input matches task ID format, loads from `.task/[ID].json`
- Otherwise, uses input as task description
- `--verify-git` (Optional): Verify git status after each subtask completion
## Execution Flow
### Phase 1: Input Processing & Decomposition
1. **Parse Input**:
- Check if input matches task ID pattern (e.g., `IMPL-001`, `TASK-123`)
- If yes: Load from `.task/[ID].json` and extract requirements
- If no: Use input as task description directly
2. **Analyze & Decompose**:
- Analyze task complexity and scope
- Break down into 3-8 subtasks
- Create TodoWrite tracker with all subtasks
- Display decomposition for user review
**Decomposition Criteria**:
- Each subtask: 5-15 minutes completable
- Clear, testable outcomes
- Explicit dependencies
- Focused file scope (1-5 files per subtask)
### Phase 2: Sequential Execution
**For First Subtask**:
```bash
# Initial execution (no resume needed)
codex -C [dir] --full-auto exec "
PURPOSE: [task goal]
TASK: [subtask 1 description]
CONTEXT: @{relevant_files} @{CLAUDE.md}
EXPECTED: [specific deliverables]
RULES: [constraints]
Subtask 1 of N: [subtask title]
" --skip-git-repo-check -s danger-full-access
```
**For Subsequent Subtasks** (using resume --last):
```bash
# Resume previous session for context continuity
codex exec "
CONTINUE TO NEXT SUBTASK:
Subtask N of M: [subtask title]
PURPOSE: [continuation goal]
TASK: [subtask N description]
CONTEXT: Previous work completed, now focus on @{new_relevant_files}
EXPECTED: [specific deliverables]
RULES: Build on previous subtask, maintain consistency
" resume --last --skip-git-repo-check -s danger-full-access
```
### Phase 3: Verification (if --verify-git enabled)
After each subtask completion:
```bash
# Check git status
git status --short
# Verify expected changes
git diff --stat
# Optional: Check for untracked files that should be committed
git ls-files --others --exclude-standard
```
**Verification Checks**:
- Files modified match subtask scope
- No unexpected changes in unrelated files
- No merge conflicts or errors
- Code compiles/runs (if applicable)
### Phase 4: TodoWrite Tracking
**Initial Setup**:
```javascript
TodoWrite({
todos: [
{ content: "Subtask 1: [description]", status: "in_progress", activeForm: "Executing subtask 1" },
{ content: "Subtask 2: [description]", status: "pending", activeForm: "Executing subtask 2" },
{ content: "Subtask 3: [description]", status: "pending", activeForm: "Executing subtask 3" },
// ... more subtasks
{ content: "Final verification and summary", status: "pending", activeForm: "Verifying and summarizing" }
]
})
```
**After Each Subtask**:
```javascript
TodoWrite({
todos: [
{ content: "Subtask 1: [description]", status: "completed", activeForm: "Executing subtask 1" },
{ content: "Subtask 2: [description]", status: "in_progress", activeForm: "Executing subtask 2" },
// ... update status
]
})
```
## Codex Resume Mechanism
**Why `codex resume --last`?**
- Maintains conversation context across subtasks
- Codex remembers previous decisions and patterns
- Reduces context repetition
- Ensures consistency in implementation style
**How It Works**:
1. First subtask creates new Codex session
2. After completion, session is saved
3. Subsequent subtasks use `codex resume --last` to continue
4. Each subtask builds on previous context
5. Final subtask completes full task
**Image Support**:
```bash
# First subtask with design reference
codex -C [dir] -i design.png --full-auto exec "..." --skip-git-repo-check -s danger-full-access
# Resume for next subtask (image context preserved)
codex exec "CONTINUE TO NEXT SUBTASK: ..." resume --last --skip-git-repo-check -s danger-full-access
```
## Error Handling
**Subtask Failure**:
1. Mark subtask as blocked in TodoWrite
2. Report error details to user
3. Pause execution for manual intervention
4. User can choose to:
- Retry current subtask
- Continue to next subtask
- Abort entire task
**Git Verification Failure** (if --verify-git):
1. Show unexpected changes
2. Pause execution
3. Request user decision:
- Continue anyway
- Rollback and retry
- Manual fix
**Codex Session Lost**:
1. Detect if `codex exec "..." resume --last` fails
2. Attempt retry with fresh session
3. Report to user if manual intervention needed
## Output Format
**During Execution**:
```
📋 Task Decomposition:
1. [Subtask 1 description]
2. [Subtask 2 description]
...
▶️ Executing Subtask 1/N: [title]
Codex session started...
[Codex output]
✅ Subtask 1 completed
🔍 Git Verification:
M src/file1.ts
A src/file2.ts
✅ Changes verified
▶️ Executing Subtask 2/N: [title]
Resuming Codex session...
[Codex output]
✅ Subtask 2 completed
...
✅ All Subtasks Completed
📊 Summary: [file references, changes, next steps]
```
**Final Summary**:
```markdown
# Task Execution Summary: [Task Description]
## Subtasks Completed
1. ✅ [Subtask 1]: [files modified]
2. ✅ [Subtask 2]: [files modified]
...
## Files Modified
- src/file1.ts:10-50 - [changes]
- src/file2.ts - [changes]
## Git Status
- N files modified
- M files added
- No conflicts
## Next Steps
- [Suggested follow-up actions]
```
## Examples
**Example 1: Simple Task**
```bash
/cli:codex-execute "implement user authentication system"
# Decomposes into:
# 1. Create user model and database schema
# 2. Implement JWT token generation
# 3. Create authentication middleware
# 4. Add login/logout endpoints
# 5. Write tests for auth flow
```
**Example 2: With Git Verification**
```bash
/cli:codex-execute --verify-git "refactor API layer to use dependency injection"
# After each subtask, verifies:
# - Only expected files modified
# - No breaking changes in unrelated code
# - Tests still pass
```
**Example 3: With Task ID**
```bash
/cli:codex-execute IMPL-001
# Loads task from .task/IMPL-001.json
# Decomposes based on task requirements
```
## Best Practices
1. **Subtask Granularity**: Keep subtasks small and focused
2. **Clear Boundaries**: Each subtask should have well-defined input/output
3. **Git Hygiene**: Use `--verify-git` for critical refactoring
4. **Context Continuity**: Let `codex resume --last` maintain context
5. **Recovery Points**: TodoWrite provides clear progress tracking
6. **Image References**: Attach design files for UI tasks
## Input Processing
**Automatic Detection**:
- Input matches task ID pattern → Load from `.task/[ID].json`
- Otherwise → Use as task description
**Task JSON Structure** (when loading from file):
```json
{
"task_id": "IMPL-001",
"title": "Implement user authentication",
"description": "Create JWT-based auth system",
"acceptance_criteria": [...],
"scope": {...},
"brainstorming_refs": [...]
}
```
**Save Results**:
- Execution log: `.chat/codex-execute-[timestamp].md` (if workflow active)
- Summary: `.summaries/[TASK-ID]-summary.md` (if task ID provided)
- TodoWrite tracking embedded in session
## Notes
**vs. `/cli:execute`**:
- `/cli:execute`: Single-shot execution with Gemini/Qwen/Codex
- `/cli:codex-execute`: Multi-stage Codex execution with automatic task decomposition and resume mechanism
**Input Flexibility**: Accepts both freeform descriptions and task IDs (auto-detects and loads JSON)
**Context Window**: `codex exec "..." resume --last` maintains conversation history, ensuring consistency across subtasks without redundant context injection.

View File

@@ -14,222 +14,98 @@ model: sonnet
# CLI Execute Command (/cli:execute)
## Overview
## Purpose
**⚡ YOLO-enabled execution**: Auto-approves all confirmations for streamlined implementation workflow.
**Purpose**: Execute implementation tasks using intelligent context inference and CLI tools with full permissions.
Execute implementation tasks with YOLO permissions (auto-approves all confirmations).
**Supported Tools**: codex, gemini (default), qwen
**Reference**: @~/.claude/workflows/intelligent-tools-strategy.md for complete tool details
**Core Guidelines**: @~/.claude/workflows/intelligent-tools-strategy.md
## YOLO Permissions
## 🚨 YOLO Permissions
Auto-approves: file pattern inference, execution, file modifications, summary generation
**All confirmations auto-approved by default:**
- ✅ File pattern inference confirmation
- ✅ Gemini execution confirmation
- ✅ File modification confirmation
- ✅ Implementation summary generation
## Enhancement Integration
## 🎯 Enhancement Integration
**When `--enhance` flag present** (Description Mode only): Execute `/enhance-prompt "[description]"` first, then use enhanced output (INTENT/CONTEXT/ACTION) for execution.
**When `--enhance` flag present** (for Description Mode only):
```bash
# Step 1: Enhance the description
SlashCommand(command="/enhance-prompt \"[description]\"")
# Step 2: Use enhanced output for execution
# Enhanced output provides:
# - INTENT: Clear technical goal
# - CONTEXT: Session memory + codebase patterns
# - ACTION: Specific implementation steps
# - ATTENTION: Critical constraints
```
**Example**:
```bash
# User: /gemini:execute --enhance "fix login"
# Step 1: Enhance
/enhance-prompt "fix login"
# Returns:
# INTENT: Debug authentication failure in login flow
# CONTEXT: JWT auth in src/auth/, known token expiry issue
# ACTION: Fix token validation → update refresh logic → test flow
# ATTENTION: Preserve existing session management
# Step 2: Execute with enhanced context
gemini --all-files -p "@{src/auth/**/*} @{CLAUDE.md}
Implementation: Debug authentication failure in login flow
Focus: Token validation, refresh logic, test flow
Constraints: Preserve existing session management"
```
**Note**: `--enhance` only applies to Description Mode. Task ID Mode uses task JSON directly.
**Note**: Task ID Mode uses task JSON directly (no enhancement).
## Execution Modes
### 1. Description Mode (supports --enhance)
**Input**: Natural language description
```bash
/gemini:execute "implement JWT authentication with middleware"
/gemini:execute --enhance "implement JWT authentication with middleware"
```
**Process**: [Optional: Enhance] → Keyword analysis → Pattern inference → Context collection → Execution
**1. Description Mode** (supports `--enhance`):
- Input: Natural language description
- Process: [Optional: Enhance] → Keyword analysis → Pattern inference → Execute
### 2. Task ID Mode (no --enhance)
**Input**: Workflow task identifier
```bash
/gemini:execute IMPL-001
```
**Process**: Task JSON parsing → Scope analysis → Context integration → Execution
**2. Task ID Mode** (no `--enhance`):
- Input: Workflow task identifier (e.g., `IMPL-001`)
- Process: Task JSON parsing → Scope analysis → Execute
## Context Inference Logic
## Context Inference
**Auto-selects relevant files based on:**
Auto-selects files based on:
- **Keywords**: "auth" → `@{**/*auth*,**/*user*}`
- **Technology**: "React" → `@{src/**/*.{jsx,tsx}}`
- **Task Type**: "api" → `@{**/api/**/*,**/routes/**/*}`
- **Always includes**: `@{CLAUDE.md,**/*CLAUDE.md}`
- **Always**: `@{CLAUDE.md,**/*CLAUDE.md}`
## Command Options
## Options
| Option | Purpose |
|--------|---------|
| `--debug` | Verbose execution logging |
| `--save-session` | Save complete execution session to workflow |
- `--debug`: Verbose logging
- `--save-session`: Save execution to workflow session
## Workflow Integration
### Session Management
⚠️ **Auto-detects active session**: Checks `.workflow/.active-*` marker file
**Session Management**: Auto-detects `.workflow/.active-*` marker
- **Active**: Save to `.workflow/WFS-[id]/.chat/execute-[timestamp].md`
- **None**: Create new session
**Session storage:**
- **Active session exists**: Saves to `.workflow/WFS-[topic]/.chat/execute-[timestamp].md`
- **No active session**: Creates new session directory
**Task Integration**: Load from `.task/[TASK-ID].json`, update status, generate summary
### Task Integration
## Command Template
**Gemini/Qwen** (with YOLO approval):
```bash
# Execute specific workflow task
/gemini:execute IMPL-001
# Loads from: .task/IMPL-001.json
# Uses: task context, brainstorming refs, scope definitions
# Updates: workflow status, generates summary
```
## Execution Templates
**Core Guidelines**: @~/.claude/workflows/intelligent-tools-strategy.md
### Permission Requirements
**Gemini Write Access** (when file modifications needed):
- Add `--approval-mode yolo` flag for auto-approval
- Required for: file creation, modification, deletion
### User Description Template
```bash
cd [target-directory] && ~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
PURPOSE: [clear implementation goal from description]
TASK: [specific implementation task]
CONTEXT: @{inferred_patterns} @{CLAUDE.md,**/*CLAUDE.md}
EXPECTED: Implementation code with file:line locations, test cases, integration guidance
RULES: [template reference if applicable] | [constraints]
cd [dir] && ~/.claude/scripts/[gemini|qwen]-wrapper --approval-mode yolo -p "
PURPOSE: [implementation goal]
TASK: [specific task]
MODE: write
CONTEXT: @{inferred_patterns} @{CLAUDE.md}
EXPECTED: Implementation with file:line references
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt) | [constraints]
"
```
**Example**:
**Codex**:
```bash
cd . && ~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
PURPOSE: Implement JWT authentication with middleware
TASK: Create authentication system with token validation
CONTEXT: @{**/*auth*,**/*middleware*} @{CLAUDE.md}
EXPECTED: Auth service, middleware, tests with file modifications
RULES: Follow existing auth patterns | Security best practices
"
codex -C [dir] --full-auto exec "
PURPOSE: [implementation goal]
TASK: [specific task]
MODE: auto
CONTEXT: @{inferred_patterns} @{CLAUDE.md}
EXPECTED: Implementation with file:line references
RULES: [constraints]
" --skip-git-repo-check -s danger-full-access
# With image attachment
codex -C [dir] -i design.png --full-auto exec "..." --skip-git-repo-check -s danger-full-access
```
### Task ID Template
```bash
cd [task-directory] && ~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
PURPOSE: [task_title]
TASK: Execute [task-id] implementation
CONTEXT: @{task_files} @{brainstorming_refs} @{CLAUDE.md,**/*CLAUDE.md}
EXPECTED: Complete implementation following acceptance criteria
RULES: $(cat [task_template]) | Task type: [task_type], Scope: [task_scope]
"
```
## Examples
**Example**:
```bash
cd .workflow/WFS-123 && ~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
PURPOSE: Implement user profile editing
TASK: Execute IMPL-001 implementation
CONTEXT: @{src/user/**/*} @{.brainstorming/product-owner/analysis.md} @{CLAUDE.md}
EXPECTED: Profile edit API, UI components, validation, tests
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) | Type: feature, Scope: user module
"
/cli:execute "implement JWT authentication with middleware" # Description mode
/cli:execute --enhance "implement JWT authentication" # Enhanced
/cli:execute IMPL-001 # Task ID mode
/cli:execute --tool codex "optimize database queries" # Codex execution
```
## Auto-Generated Outputs
### 1. Implementation Summary
**Location**: `.summaries/[TASK-ID]-summary.md` or auto-generated ID
- **Summary**: `.summaries/[TASK-ID]-summary.md`
- **Session**: `.chat/execute-[timestamp].md`
```markdown
# Task Summary: [Task-ID] [Description]
## Notes
## Implementation
- **Files Modified**: [file:line references]
- **Features Added**: [specific functionality]
- **Context Used**: [inferred patterns]
## Integration
- [Links to workflow documents]
```
### 2. Execution Session
**Location**: `.chat/execute-[timestamp].md`
```markdown
# Execution Session: [Timestamp]
## Input
[User description or Task ID]
## Context Inference
[File patterns used with rationale]
## Implementation Results
[Generated code and modifications]
## Status Updates
[Workflow integration updates]
```
## Error Handling
- **Task ID not found**: Lists available tasks
- **Pattern inference failure**: Uses generic `src/**/*` pattern
- **Execution failure**: Attempts fallback with simplified context
- **File modification errors**: Reports specific file/permission issues
## Performance Features
- **Smart caching**: Frequently used pattern mappings
- **Progressive inference**: Precise → broad pattern fallback
- **Parallel execution**: When multiple contexts needed
- **Directory optimization**: Switches to optimal execution path
## Integration Workflow
**Typical sequence:**
1. `workflow:plan` → Creates tasks
2. `/gemini:execute IMPL-001` → Executes with YOLO permissions
3. Auto-updates workflow status and generates summaries
4. `workflow:review` → Final validation
**vs. `/gemini:analyze`**: Execute performs analysis **and implementation**, analyze is read-only.
**vs. `/cli:analyze`**: Execute performs implementation, analyze is read-only.

261
.claude/commands/version.md Normal file
View File

@@ -0,0 +1,261 @@
---
name: version
description: Display version information and check for updates
usage: /version
examples:
- /version
allowed-tools: Bash(*)
---
# Version Command (/version)
## Purpose
Display local and global installation versions, check for the latest updates from GitHub, and provide upgrade recommendations.
## Execution Flow
1. **Local Version Check**: Read version information from `./.claude/version.json` if it exists.
2. **Global Version Check**: Read version information from `~/.claude/version.json` if it exists.
3. **Fetch Remote Versions**: Use GitHub API to get the latest stable release tag and the latest commit hash from the main branch.
4. **Compare & Suggest**: Compare installed versions with the latest remote versions and provide upgrade suggestions if applicable.
## Step 1: Check Local Version
### Check if local version.json exists
```bash
bash(test -f ./.claude/version.json && echo "found" || echo "not_found")
```
### Read local version (if exists)
```bash
bash(cat ./.claude/version.json)
```
### Extract version with jq (preferred)
```bash
bash(cat ./.claude/version.json | grep -o '"version": *"[^"]*"' | cut -d'"' -f4)
```
### Extract installation date
```bash
bash(cat ./.claude/version.json | grep -o '"installation_date_utc": *"[^"]*"' | cut -d'"' -f4)
```
**Output Format**:
```
Local Version: 3.2.1
Installed: 2025-10-03T12:00:00Z
```
## Step 2: Check Global Version
### Check if global version.json exists
```bash
bash(test -f ~/.claude/version.json && echo "found" || echo "not_found")
```
### Read global version
```bash
bash(cat ~/.claude/version.json)
```
### Extract version
```bash
bash(cat ~/.claude/version.json | grep -o '"version": *"[^"]*"' | cut -d'"' -f4)
```
### Extract installation date
```bash
bash(cat ~/.claude/version.json | grep -o '"installation_date_utc": *"[^"]*"' | cut -d'"' -f4)
```
**Output Format**:
```
Global Version: 3.2.1
Installed: 2025-10-03T12:00:00Z
```
## Step 3: Fetch Latest Stable Release
### Call GitHub API for latest release (with timeout)
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null, timeout: 30000)
```
### Extract tag name (version)
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null | grep -o '"tag_name": *"[^"]*"' | head -1 | cut -d'"' -f4, timeout: 30000)
```
### Extract release name
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null | grep -o '"name": *"[^"]*"' | head -1 | cut -d'"' -f4, timeout: 30000)
```
### Extract published date
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null | grep -o '"published_at": *"[^"]*"' | cut -d'"' -f4, timeout: 30000)
```
**Output Format**:
```
Latest Stable: v3.2.2
Release: v3.2.2: Independent Test-Gen Workflow with Cross-Session Context
Published: 2025-10-03T04:10:08Z
```
## Step 4: Fetch Latest Main Branch
### Call GitHub API for latest commit on main (with timeout)
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null, timeout: 30000)
```
### Extract commit SHA (short)
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null | grep -o '"sha": *"[^"]*"' | head -1 | cut -d'"' -f4 | cut -c1-7, timeout: 30000)
```
### Extract commit message (first line only)
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null | grep '"message":' | cut -d'"' -f4 | cut -d'\' -f1, timeout: 30000)
```
### Extract commit date
```bash
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null | grep -o '"date": *"[^"]*"' | head -1 | cut -d'"' -f4, timeout: 30000)
```
**Output Format**:
```
Latest Dev: a03415b
Message: feat: Add version tracking and upgrade check system
Date: 2025-10-03T04:46:44Z
```
## Step 5: Compare Versions and Suggest Upgrade
### Normalize versions (remove 'v' prefix)
```bash
bash(echo "v3.2.1" | sed 's/^v//')
```
### Compare two versions
```bash
bash(printf "%s\n%s" "3.2.1" "3.2.2" | sort -V | tail -n 1)
```
### Check if versions are equal
```bash
# If equal: Up to date
# If remote newer: Upgrade available
# If local newer: Development version
```
**Output Scenarios**:
**Scenario 1: Up to date**
```
✅ You are on the latest stable version (3.2.1)
```
**Scenario 2: Upgrade available**
```
⬆️ A newer stable version is available: v3.2.2
Your version: 3.2.1
To upgrade:
PowerShell: iex (iwr -useb https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1)
Bash: bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
```
**Scenario 3: Development version**
```
✨ You are running a development version (3.3.0-dev)
This is newer than the latest stable release (v3.2.2)
```
## Simple Bash Commands
### Basic Operations
```bash
# Check local version file
bash(test -f ./.claude/version.json && cat ./.claude/version.json)
# Check global version file
bash(test -f ~/.claude/version.json && cat ~/.claude/version.json)
# Extract version from JSON
bash(cat version.json | grep -o '"version": *"[^"]*"' | cut -d'"' -f4)
# Extract date from JSON
bash(cat version.json | grep -o '"installation_date_utc": *"[^"]*"' | cut -d'"' -f4)
# Fetch latest release (with timeout)
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null, timeout: 30000)
# Extract tag name
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4, timeout: 30000)
# Extract release name
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null | grep -o '"name": *"[^"]*"' | head -1 | cut -d'"' -f4, timeout: 30000)
# Fetch latest commit (with timeout)
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null, timeout: 30000)
# Extract commit SHA
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null | grep -o '"sha": *"[^"]*"' | head -1 | cut -d'"' -f4 | cut -c1-7, timeout: 30000)
# Extract commit message (first line)
bash(curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null | grep '"message":' | cut -d'"' -f4 | cut -d'\' -f1, timeout: 30000)
# Compare versions
bash(printf "%s\n%s" "3.2.1" "3.2.2" | sort -V | tail -n 1)
# Remove 'v' prefix
bash(echo "v3.2.1" | sed 's/^v//')
```
## Error Handling
### No installation found
```
WARNING: Claude Code Workflow not installed
Install using:
PowerShell: iex (iwr -useb https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1)
```
### Network error
```
ERROR: Could not fetch latest version from GitHub
Check your network connection
```
### Invalid version.json
```
ERROR: version.json is invalid or corrupted
```
## Design Notes
- Uses simple, direct bash commands instead of complex functions
- Each step is independent and can be executed separately
- Fallback to grep/sed for JSON parsing (no jq dependency required)
- Network calls use curl with error suppression and 30-second timeout
- Version comparison uses `sort -V` for accurate semantic versioning
- Use `/commits/main` API instead of `/branches/main` for more reliable commit info
- Extract first line of commit message using `cut -d'\' -f1` to handle JSON escape sequences
## API Endpoints
### GitHub API Used
- **Latest Release**: `https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest`
- Fields: `tag_name`, `name`, `published_at`
- **Latest Commit**: `https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main`
- Fields: `sha`, `commit.message`, `commit.author.date`
### Timeout Configuration
All network calls should use `timeout: 30000` (30 seconds) to handle slow connections.
## Related Commands
- `/cli:cli-init` - Initialize CLI configurations
- `/workflow:session:list` - List workflow sessions

View File

@@ -15,13 +15,22 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
## Coordinator Role
**This command is a pure orchestrator**: Execute 4 slash commands in sequence, parse their outputs, pass context between them, and ensure complete execution.
**This command is a pure orchestrator**: Execute 4 slash commands in sequence, parse their outputs, pass context between them, and ensure complete execution through **automatic continuation**.
**Execution Flow**:
1. Initialize TodoWrite → Execute Phase 1 → Parse output → Update TodoWrite
2. Execute Phase 2 with Phase 1 data → Parse output → Update TodoWrite
3. Execute Phase 3 with Phase 2 data → Parse output → Update TodoWrite
4. Execute Phase 4 with Phase 3 validation → Update TodoWrite → Return summary
**Execution Model - Auto-Continue Workflow**:
Each phase executes and returns to user, then **automatically continues** to next phase:
1. **User triggers**: `/workflow:plan "task"`
2. **Phase 1 executes** → Returns to user with results
3. **Auto-continue to Phase 2** → Returns to user with results
4. **Auto-continue to Phase 3** → Returns to user with results
5. **Auto-continue to Phase 4** → Returns final summary
**Auto-Continue Mechanism**:
- Read TodoList to determine current phase status
- Execute next pending phase based on TodoList state
- No external state files needed - TodoList tracks progress
**Execution Modes**:
- **Manual Mode** (default): Use `/workflow:tools:task-generate`
@@ -32,9 +41,8 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
1. **Start Immediately**: First action is TodoWrite initialization, second action is Phase 1 command execution
2. **No Preliminary Analysis**: Do not read files, analyze structure, or gather context before Phase 1
3. **Parse Every Output**: Extract required data from each command's output for next phase
4. **Sequential Execution**: Each phase depends on previous phase's output
5. **Complete All Phases**: Do not return to user until Phase 4 completes
6. **Track Progress**: Update TodoWrite after every phase completion
4. **Auto-Continue via TodoList**: Check TodoList status to execute next pending phase automatically
5. **Track Progress**: Update TodoWrite after every phase completion
## 4-Phase Execution
@@ -64,6 +72,8 @@ CONTEXT: Existing user database schema, REST API endpoints
**TodoWrite**: Mark phase 1 completed, phase 2 in_progress
**After Phase 1**: Return to user showing Phase 1 results, then auto-continue to Phase 2
---
### Phase 2: Context Gathering
@@ -83,6 +93,8 @@ CONTEXT: Existing user database schema, REST API endpoints
**TodoWrite**: Mark phase 2 completed, phase 3 in_progress
**After Phase 2**: Return to user showing Phase 2 results, then auto-continue to Phase 3
---
### Phase 3: Intelligent Analysis
@@ -99,6 +111,8 @@ CONTEXT: Existing user database schema, REST API endpoints
**TodoWrite**: Mark phase 3 completed, phase 4 in_progress
**After Phase 3**: Return to user showing Phase 3 results, then auto-continue to Phase 4
---
### Phase 4: Task Generation
@@ -227,23 +241,23 @@ Return summary to user
- **Parsing Failure**: If output parsing fails, retry command once, then report error
- **Validation Failure**: If validation fails, report which file/data is missing
- **Command Failure**: Keep phase `in_progress`, report error to user, do not proceed
- **Command Failure**: Keep phase `in_progress`, report error to user, do not proceed to next phase
## Coordinator Checklist
✅ **Pre-Phase**: Convert user input to structured format (GOAL/SCOPE/CONTEXT)
✅ Initialize TodoWrite before any command
✅ Execute Phase 1 immediately with structured description
✅ Parse session ID from Phase 1 output
✅ Parse session ID from Phase 1 output, store in memory
✅ Pass session ID and structured description to Phase 2 command
✅ Parse context path from Phase 2 output
✅ Parse context path from Phase 2 output, store in memory
✅ Pass session ID and context path to Phase 3 command
✅ Verify ANALYSIS_RESULTS.md after Phase 3
✅ Select correct Phase 4 command based on --agent flag
✅ Pass session ID to Phase 4 command
✅ Verify all Phase 4 outputs
✅ Update TodoWrite after each phase
Return summary only after Phase 4 completes
After each phase, automatically continue to next phase based on TodoList status
## Structure Template Reference

View File

@@ -40,22 +40,22 @@ update_module_claude() {
if [ "$module_path" = "." ]; then
# Root directory
layer="Layer 1 (Root)"
template_path="$HOME/.claude/workflows/cli-templates/prompts/dms/claude-layer1-root.txt"
template_path="$HOME/.claude/workflows/cli-templates/prompts/memory/claude-layer1-root.txt"
analysis_strategy="--all-files"
elif [[ "$clean_path" =~ ^[^/]+$ ]]; then
# Top-level directories (e.g., .claude, src, tests)
layer="Layer 2 (Domain)"
template_path="$HOME/.claude/workflows/cli-templates/prompts/dms/claude-layer2-domain.txt"
template_path="$HOME/.claude/workflows/cli-templates/prompts/memory/claude-layer2-domain.txt"
analysis_strategy="@{*/CLAUDE.md}"
elif [[ "$clean_path" =~ ^[^/]+/[^/]+$ ]]; then
# Second-level directories (e.g., .claude/scripts, src/components)
layer="Layer 3 (Module)"
template_path="$HOME/.claude/workflows/cli-templates/prompts/dms/claude-layer3-module.txt"
template_path="$HOME/.claude/workflows/cli-templates/prompts/memory/claude-layer3-module.txt"
analysis_strategy="@{*/CLAUDE.md}"
else
# Deeper directories (e.g., .claude/workflows/cli-templates/prompts)
layer="Layer 4 (Sub-Module)"
template_path="$HOME/.claude/workflows/cli-templates/prompts/dms/claude-layer4-submodule.txt"
template_path="$HOME/.claude/workflows/cli-templates/prompts/memory/claude-layer4-submodule.txt"
analysis_strategy="--all-files"
fi

7
.claude/version.json Normal file
View File

@@ -0,0 +1,7 @@
{
"version": "3.3.0",
"installation_mode": "Local",
"installation_path": "D:\\Claude_dms3\\.claude",
"source_branch": "main",
"installation_date_utc": "2025-10-04T00:00:00Z"
}

View File

@@ -1,4 +1,4 @@
Analyze project structure for DMS hierarchy optimization:
Analyze project structure for memory hierarchy optimization:
## Required Analysis:
1. Assess project complexity and file organization patterns

View File

@@ -18,6 +18,7 @@ type: strategic-guideline
- **Default to tools** - Use specialized tools for most coding tasks, no matter how small
- **Lower barriers** - Engage tools immediately when encountering any complexity
- **Context optimization** - Based on user intent, determine whether to use `-C [directory]` parameter for focused analysis to reduce irrelevant context import
- **⚠️ Write operation protection** - For local codebase write/modify operations, require EXPLICIT user confirmation unless user provides clear instructions containing MODE=write or MODE=auto
### Quick Decision Rules
1. **Exploring/Understanding?** → Start with Gemini
@@ -33,15 +34,19 @@ type: strategic-guideline
- **Override When Needed**: Specify custom timeout for longer operations
### Permission Framework
- **Gemini/Qwen Write Access**: Use `--approval-mode yolo` when tools need to create/modify files
- **Codex Write Access**: Always use `-s danger-full-access` and `--skip-git-repo-check` for development and file operations
- **Auto-approval Protocol**: Enable automatic tool approvals for autonomous workflow execution
- **⚠️ WRITE PROTECTION**: Local codebase write/modify requires EXPLICIT user confirmation
- **Analysis Mode (default)**: Read-only, safe for auto-execution
- **Write Mode**: Requires user explicitly states MODE=write or MODE=auto in prompt
- **Exception**: User provides clear instructions like "modify", "create", "implement"
- **Gemini/Qwen Write Access**: Use `--approval-mode yolo` ONLY when MODE=write explicitly specified
- **Codex Write Access**: Use `-s danger-full-access` and `--skip-git-repo-check` ONLY when MODE=auto explicitly specified
- **Default Behavior**: All tools default to analysis/read-only mode without explicit write permission
## 🎯 Universal Command Template
### Standard Format (REQUIRED)
```bash
# Gemini Analysis (全权限)
# Gemini Analysis (read/write capable)
cd [directory] && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: [clear analysis goal]
TASK: [specific analysis task]
@@ -51,7 +56,7 @@ EXPECTED: [expected output]
RULES: [template reference and constraints]
"
# Qwen Architecture Analysis (仅分析)
# Qwen Architecture Analysis (read-only analysis)
cd [directory] && ~/.claude/scripts/qwen-wrapper -p "
PURPOSE: [clear architecture goal]
TASK: [specific analysis task]
@@ -84,16 +89,18 @@ RULES: [template reference and constraints]
The MODE field controls execution behavior and file permissions:
**For Gemini** (全权限,可读写):
- `analysis` (default) - 分析 + 可生成文档
- `write` - 创建/修改文件(自动启用 --approval-mode yolo
**For Gemini**:
- `analysis` (default) - Read-only analysis and documentation generation
- `write` - ⚠️ Create/modify codebase files (requires explicit specification, auto-enables --approval-mode yolo)
**For Qwen** (仅分析):
- `analysis` (default) - 仅架构分析,不生成代码
**For Qwen**:
- `analysis` (default) - Architecture analysis only, no code generation/modification (read-only)
- `write` - ⚠️ Code generation (requires explicit specification, disabled by default)
**For Codex**:
- `auto` (default) - 自主开发,全文件操作
- `write` - 测试生成和文件修改
- `auto` - ⚠️ Autonomous development with full file operations (requires explicit specification, enables -s danger-full-access)
- `write` - ⚠️ Test generation and file modification (requires explicit specification)
- **Default**: No default mode, MODE must be explicitly specified
### Directory Context
Tools execute in current working directory:
@@ -235,26 +242,34 @@ For every development task:
## 🎯 Key Features
### Gemini (全权限)
### Gemini
- **Command**: `~/.claude/scripts/gemini-wrapper`
- **Strengths**: Large context window, pattern recognition
- **Best For**: Analysis, documentation generation, code exploration
- **Permissions**: 可读写MODE=write 时自动启用 --approval-mode yolo
- **Default MODE**: `analysis`
- **Permissions**: Default read-only analysis, MODE=write requires explicit specification (auto-enables --approval-mode yolo)
- **Default MODE**: `analysis` (read-only)
- **⚠️ Write Trigger**: Only when user explicitly requests "generate documentation", "modify code", or specifies MODE=write
### Qwen (仅分析)
### Qwen
- **Command**: `~/.claude/scripts/qwen-wrapper`
- **Strengths**: Architecture analysis, pattern recognition
- **Best For**: System design analysis, architectural review
- **Permissions**: 仅分析,不生成代码
- **Default MODE**: `analysis`
- **Permissions**: Architecture analysis only, no automatic code generation
- **Default MODE**: `analysis` (read-only)
- **⚠️ Write Trigger**: Explicitly prohibited from auto-calling write mode
### Codex
- **Command**: `codex --full-auto exec`
- **Strengths**: Autonomous development, mathematical reasoning
- **Best For**: Implementation, testing, automation
- **Required**: `-s danger-full-access` and `--skip-git-repo-check` for development
- **Default MODE**: `auto`
- **Permissions**: Requires explicit MODE=auto or MODE=write specification
- **Default MODE**: No default, must be explicitly specified
- **⚠️ Write Trigger**: Only when user explicitly requests "implement", "modify", "generate code" AND specifies MODE
- **Session Management**:
- `codex resume` - Resume previous interactive session (picker by default)
- `codex exec "task" resume --last` - Continue most recent session with new task (maintains context)
- `codex -i <image_file>` - Attach image(s) to initial prompt (useful for UI/design references)
- **Multi-task Pattern**: First task uses `exec`, subsequent tasks use `exec "..." resume --last` for context continuity
### File Patterns
- All files: `@{**/*}`

View File

@@ -6,6 +6,8 @@
## Prompt Structure
### Single-Task Format
**Receive prompts in this format**:
```
@@ -17,11 +19,37 @@ EXPECTED: [deliverables]
RULES: [constraints and templates]
```
### Multi-Task Format (Subtask Execution)
**First subtask** (creates new session):
```
PURPOSE: [overall goal]
TASK: [subtask 1 description]
MODE: auto
CONTEXT: [file patterns]
EXPECTED: [subtask deliverables]
RULES: [constraints]
Subtask 1 of N: [subtask title]
```
**Subsequent subtasks** (continues via `resume --last`):
```
CONTINUE TO NEXT SUBTASK:
Subtask N of M: [subtask title]
PURPOSE: [continuation goal]
TASK: [subtask N description]
CONTEXT: Previous work completed, now focus on [new files]
EXPECTED: [subtask deliverables]
RULES: Build on previous subtask, maintain consistency
```
## Execution Requirements
### ALWAYS
- **Parse all six fields** - Understand PURPOSE, TASK, MODE, CONTEXT, EXPECTED, RULES
- **Parse all fields** - Understand PURPOSE, TASK, MODE, CONTEXT, EXPECTED, RULES
- **Detect subtask format** - Check for "Subtask N of M" or "CONTINUE TO NEXT SUBTASK"
- **Follow MODE strictly** - Respect execution boundaries
- **Study CONTEXT files** - Find 3+ similar patterns before implementing
- **Apply RULES** - Follow templates and constraints exactly
@@ -29,6 +57,7 @@ RULES: [constraints and templates]
- **Commit incrementally** - Small, working commits
- **Match project style** - Follow existing patterns exactly
- **Validate EXPECTED** - Ensure all deliverables are met
- **Report context** (subtasks) - Summarize key info for next subtask
### NEVER
@@ -49,7 +78,7 @@ RULES: [constraints and templates]
- Run tests and builds
- Commit code incrementally
**Execute**:
**Execute (Single Task)**:
1. Parse PURPOSE and TASK
2. Analyze CONTEXT files - find 3+ similar patterns
3. Plan implementation approach
@@ -60,7 +89,17 @@ RULES: [constraints and templates]
8. Validate all EXPECTED deliverables
9. Report results
**Use For**: Feature implementation, bug fixes, refactoring
**Execute (Multi-Task/Subtask)**:
1. **First subtask**: Follow single-task flow above
2. **Subsequent subtasks** (via `resume --last`):
- Recall context from previous subtask(s)
- Build on previous work (don't repeat)
- Maintain consistency with previous decisions
- Focus on current subtask scope only
- Test integration with previous subtasks
- Report subtask completion status
**Use For**: Feature implementation, bug fixes, refactoring, multi-step tasks
### MODE: write
@@ -119,7 +158,7 @@ RULES: [constraints and templates]
## Progress Reporting
### During Execution
### During Execution (Single Task)
```
[1/5] Analyzing existing code patterns...
@@ -129,7 +168,17 @@ RULES: [constraints and templates]
[5/5] Running validation...
```
### On Success
### During Execution (Subtask)
```
[Subtask N/M: Subtask Title]
[1/4] Recalling context from previous subtasks...
[2/4] Implementing current subtask...
[3/4] Testing integration with previous work...
[4/4] Validating subtask completion...
```
### On Success (Single Task)
```
✅ Task completed
@@ -146,6 +195,26 @@ Validation:
Next Steps: [recommendations]
```
### On Success (Subtask)
```
✅ Subtask N/M completed
Changes:
- Created: [files]
- Modified: [files]
Integration:
✅ Compatible with previous subtasks
✅ Tests: [count] passing
✅ Build: Success
Context for next subtask:
- [Key decisions made]
- [Files created/modified]
- [Patterns established]
```
### On Partial Completion
```
@@ -178,6 +247,60 @@ Recommendation: [next steps]
- Graceful degradation
- Don't expose sensitive info
## Multi-Step Task Execution
### Context Continuity via Resume
When executing subtasks via `codex exec "..." resume --last`:
**Advantages**:
- Session memory preserves previous decisions
- Maintains implementation style consistency
- Avoids redundant context re-injection
- Enables incremental testing and validation
**Best Practices**:
1. **First subtask**: Establish patterns and architecture
2. **Subsequent subtasks**: Build on established patterns
3. **Test integration**: After each subtask, verify compatibility
4. **Report context**: Summarize key decisions for next subtask
5. **Maintain scope**: Focus only on current subtask goals
### Subtask Coordination
**DO**:
- Remember decisions from previous subtasks
- Reuse patterns established earlier
- Test integration with previous work
- Report what's ready for next subtask
**DON'T**:
- Re-implement what previous subtasks completed
- Change patterns established earlier (unless explicitly requested)
- Skip testing integration points
- Assume next subtask's requirements
### Example Flow
```
Subtask 1: Create data models
→ Establishes: Schema patterns, validation approach
→ Delivers: Models with tests
→ Context for next: Model structure, validation rules
Subtask 2: Implement API endpoints (resume --last)
→ Recalls: Model structure from subtask 1
→ Builds on: Uses established models
→ Delivers: API with integration tests
→ Context for next: API patterns, error handling
Subtask 3: Add authentication (resume --last)
→ Recalls: API patterns from subtask 2
→ Integrates: Auth middleware into existing endpoints
→ Delivers: Secured API
→ Final validation: Full integration test
```
## Philosophy
- **Incremental progress over big bangs** - Small, testable changes
@@ -186,6 +309,7 @@ Recommendation: [next steps]
- **Clear intent over clever code** - Boring, obvious solutions
- **Simple over complex** - Avoid over-engineering
- **Follow existing style** - Match project patterns exactly
- **Context continuity** - Leverage resume for multi-step consistency
## Execution Checklist
@@ -211,5 +335,6 @@ Recommendation: [next steps]
---
**Version**: 2.0.0
**Last Updated**: 2025-10-02
**Version**: 2.1.0
**Last Updated**: 2025-10-04
**Changes**: Added multi-step task execution support with resume mechanism

View File

@@ -5,6 +5,241 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.3.0] - 2025-10-04
### 🚀 CLI Tool Enhancements & Codex Multi-Step Execution
This release streamlines CLI tool documentation and introduces automated multi-step task execution with Codex.
#### Added
**New Command: `/cli:codex-execute`**:
- **Purpose**: Automated task decomposition and sequential execution with Codex
- **Features**:
- Automatic task breakdown into 3-8 manageable subtasks
- Sequential execution using `codex exec "..." resume --last` mechanism
- TodoWrite progress tracking for each subtask
- Optional Git verification after each subtask (`--verify-git` flag)
- Supports both freeform descriptions and workflow task IDs
- Automatic detection and loading of task JSON files
- Context continuity across subtasks via resume mechanism
- Integration with workflow system (optional)
**Codex Resume Mechanism**:
- **First Subtask**: Creates new Codex session with `codex exec`
- **Subsequent Subtasks**: Continues with `codex exec "..." resume --last`
- **Benefits**:
- Session memory preserves previous decisions
- Maintains implementation style consistency
- Avoids redundant context re-injection
- Enables incremental testing and validation
**Enhanced Codex Agent Configuration** (`.codex/AGENTS.md`):
- Added multi-task prompt format (Single-Task & Multi-Task)
- Enhanced MODE: auto with subtask execution flow
- New "Multi-Step Task Execution" section with:
- Context continuity best practices
- Subtask coordination guidelines
- Example 3-subtask workflow demonstration
- Updated progress reporting for subtasks
- Version 2.1.0 with multi-step task execution support
#### Changed
**CLI Documentation Optimization**:
- **Streamlined Documentation**: Reduced redundancy by referencing `intelligent-tools-strategy.md`
- **Updated Commands**:
- `/cli:analyze` - Simplified from ~200 to ~78 lines
- `/cli:chat` - Simplified from ~161 to ~92 lines
- `/cli:execute` - Simplified from ~235 to ~111 lines
- **Unified Command Templates**:
- Separated Gemini/Qwen (uses `-p` parameter) from Codex (uses `exec` command)
- Added Codex `-i` parameter documentation for image attachment
- Consistent template structure across all CLI commands
**Intelligent Tools Strategy Updates**:
- Enhanced Codex session management documentation
- Added `codex exec "..." resume --last` syntax explanation
- Documented multi-task execution pattern
- Clarified image attachment workflow with resume
**Command Template Improvements**:
- **Gemini/Qwen**: `cd [dir] && ~/.claude/scripts/[tool]-wrapper -p "..."`
- **Codex**: `codex -C [dir] --full-auto exec "..." --skip-git-repo-check -s danger-full-access`
- **Codex with Resume**: `codex exec "..." resume --last --skip-git-repo-check -s danger-full-access`
- **Image Support**: `codex -C [dir] -i image.png --full-auto exec "..."`
#### Technical Details
**Multi-Step Execution Flow**:
```
Input → Parse (Description/Task ID) → Decompose into Subtasks → TodoWrite Tracking →
For Each Subtask:
1. Execute with Codex (first: exec, subsequent: exec resume --last)
2. [Optional] Git verification
3. Mark complete in TodoWrite
→ Final Summary
```
**Subtask Decomposition Criteria**:
- Each subtask: 5-15 minutes completable
- Clear, testable outcomes
- Explicit dependencies
- Focused file scope (1-5 files per subtask)
**Error Handling**:
- Subtask failure: Pause for user intervention
- Git verification failure: Request user decision
- Codex session lost: Attempt retry with fresh session
**Integration Features**:
- Automatic task ID detection (e.g., `IMPL-001`, `TASK-123`)
- JSON task loading from `.task/[ID].json`
- Execution logging to `.chat/codex-execute-[timestamp].md`
- Summary generation to `.summaries/[TASK-ID]-summary.md`
#### Benefits
**Developer Experience**:
- 🚀 Automated task breakdown reduces planning overhead
- 📊 Clear progress tracking with TodoWrite integration
- 🔄 Context continuity improves code consistency
- ✅ Optional Git verification ensures code quality
- 🎯 Focused subtask execution reduces complexity
**Code Quality**:
- 🧪 Incremental testing after each subtask
- 🔍 Git verification catches unexpected changes
- 📝 Comprehensive execution logs for audit trail
- 🎨 Image attachment support for UI/design tasks
**Documentation**:
- 📚 Reduced documentation redundancy by ~60%
- 🔗 Clear references to master documentation
- ✨ Consistent command structure across all CLI tools
- 📖 Better separation of concerns (strategy vs. command docs)
---
## [3.2.3] - 2025-10-03
### ✨ Version Management System
This release introduces a comprehensive version management and upgrade notification system.
#### Added
**New Command: `/version`**:
- **Purpose**: Display version information and check for updates from GitHub
- **Features**:
- Shows local and global installation versions
- Fetches latest stable release from GitHub API
- Displays latest development commit from main branch
- Compares installed versions with remote versions
- Provides upgrade recommendations with installation commands
- Supports both stable and development version tracking
**Version Information Display**:
- **Local Version**: Shows project-specific installation (if exists)
- **Global Version**: Shows `~/.claude` installation with tracking mode
- **Latest Stable**: Displays latest release tag, name, and publish date
- **Latest Dev**: Shows latest commit hash, message, and date
- **Status Assessment**: Automatic version comparison and upgrade suggestions
**Version Tracking Files**:
- **`.claude/version.json`**: Local project version tracking
- **`~/.claude/version.json`**: Global installation version tracking
- **Fields**:
- `version`: Version number or "latest" for main branch tracking
- `installation_mode`: "Local" or "Global"
- `installation_path`: Installation directory
- `source_branch`: Source branch (usually "main")
- `installation_date_utc`: ISO 8601 timestamp
**GitHub API Integration**:
- **Latest Release**: `https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest`
- Extracts: `tag_name`, `name`, `published_at`
- **Latest Commit**: `https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main`
- Extracts: `sha`, `commit.message`, `commit.author.date`
- **Timeout**: 30-second timeout for slow connections
- **Error Handling**: Graceful fallback for network errors
**Command Output Scenarios**:
1. **Up to date**:
```
✅ You are on the latest stable version (3.2.3)
```
2. **Upgrade available**:
```
⬆️ A newer stable version is available: v3.2.3
Your version: 3.2.2
To upgrade:
PowerShell: iex (iwr -useb https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1)
Bash: bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
```
3. **Development version**:
```
✨ You are running a development version (3.3.0-dev)
This is newer than the latest stable release (v3.2.3)
```
#### Changed
**Documentation Updates**:
- Added `/version` command reference to README.md
- Added version management documentation to README_CN.md
- Created comprehensive `.claude/commands/version.md` implementation guide
- Updated command tables with version management examples
**Installation Scripts Enhancement**:
- Installation scripts now create `version.json` files automatically
- Track installation mode (local vs global)
- Record installation timestamp
- Support version tracking for both stable and development installations
#### Technical Details
**Implementation**:
- Uses simple bash commands (no jq dependency required)
- Fallback to grep/sed for JSON parsing
- Network calls with curl and error suppression
- Version comparison using `sort -V` for semantic versioning
- Cross-platform compatible (Windows Git Bash, Linux, macOS)
**Command Structure**:
```bash
/version # Display version and check for updates
```
**No parameters required** - command automatically:
1. Checks local version file (`./.claude/version.json`)
2. Checks global version file (`~/.claude/version.json`)
3. Fetches latest release from GitHub
4. Fetches latest commit from main branch
5. Compares versions and provides recommendations
#### Benefits
**User Experience**:
- 🔍 Quick version check with single command
- 📊 Comprehensive version information display
- 🔄 Automatic upgrade notifications
- 📈 Development version tracking support
- 🌐 GitHub API integration for latest updates
**DevOps**:
- 📁 Version tracking in both local and global installations
- 🕐 Installation timestamp for audit trails
- 🔀 Support for both stable and development branches
- ⚡ Fast execution with 30-second network timeout
- 🛡️ Graceful error handling for offline scenarios
---
## [3.2.0] - 2025-10-02
### 🔄 Test-Fix Workflow & Agent Architecture Simplification

View File

@@ -19,11 +19,14 @@ For all CLI tool usage, command syntax, and integration guidelines:
### Core Beliefs
- **Pursue good taste** - Eliminate edge cases to make code logic natural and elegant
- **Embrace extreme simplicity** - Complexity is the root of all evil
- **Be pragmatic** - Code must solve real-world problems, not hypothetical ones
- **Data structures first** - Bad programmers worry about code; good programmers worry about data structures
- **Never break backward compatibility** - Existing functionality is sacred and inviolable
- **Incremental progress over big bangs** - Small changes that compile and pass tests
- **Learning from existing code** - Study and plan before implementing
- **Pragmatic over dogmatic** - Adapt to project reality
- **Clear intent over clever code** - Be boring and obvious
- **Simple solutions over complex architectures** - Avoid over-engineering and premature optimization
- **Follow existing code style** - Match import patterns, naming conventions, and formatting of existing codebase
### Simplicity Means

View File

@@ -186,7 +186,7 @@ cd Dmsflow
.\Install-Claude.ps1 -Global
# 4. Start using Claude Code with Agent workflows!
# Use /workflow commands and DMS system for development
# Use /workflow commands and memory system for development
```
## Verification
@@ -207,7 +207,7 @@ After installation, verify:
- Check that global `.claude` directory is recognized
- Verify workflow commands and DMS commands are available
- Test `/workflow` commands for agent coordination
- Test `/dmsflow version` to check version information
- Test `/workflow version` to check version information
## Troubleshooting

View File

@@ -162,7 +162,7 @@ cd Dmsflow
.\Install-Claude.ps1 -Global
# 4. 开始使用 Claude Code Agent 工作流!
# 使用 /workflow 命令和 DMS 系统进行开发
# 使用 /workflow 命令和内存系统进行开发
```
## 验证
@@ -181,9 +181,9 @@ cd Dmsflow
2. **测试 Claude Code**
- 在项目中打开 Claude Code
- 检查全局 `.claude` 目录是否被识别
- 验证工作流命令和 DMS 命令是否可用
- 验证工作流命令和内存命令是否可用
- 测试 `/workflow` 命令的 Agent 协调功能
- 测试 `/dmsflow version` 检查版本信息
- 测试 `/workflow version` 检查版本信息
## 故障排除

View File

@@ -59,7 +59,11 @@ param(
[switch]$BackupAll,
[switch]$NoBackup
[switch]$NoBackup,
[string]$SourceVersion = "",
[string]$SourceBranch = ""
)
# Set encoding for proper Unicode support
@@ -622,6 +626,37 @@ function Merge-DirectoryContents {
return $true
}
function Create-VersionJson {
param(
[string]$TargetClaudeDir,
[string]$InstallationMode
)
# Determine version from source or default
$versionNumber = if ($SourceVersion) { $SourceVersion } else { $Version }
$sourceBranch = if ($SourceBranch) { $SourceBranch } else { "unknown" }
# Create version.json content
$versionInfo = @{
version = $versionNumber
installation_mode = $InstallationMode
installation_path = $TargetClaudeDir
installation_date_utc = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
source_branch = $sourceBranch
}
$versionJsonPath = Join-Path $TargetClaudeDir "version.json"
try {
$versionInfo | ConvertTo-Json | Out-File -FilePath $versionJsonPath -Encoding utf8 -Force
Write-ColorOutput "Created version.json: $versionNumber ($InstallationMode)" $ColorSuccess
return $true
} catch {
Write-ColorOutput "WARNING: Failed to create version.json: $($_.Exception.Message)" $ColorWarning
return $false
}
}
function Install-Global {
Write-ColorOutput "Installing Claude Code Workflow System globally..." $ColorInfo
@@ -682,6 +717,10 @@ function Install-Global {
Write-ColorOutput "Merging .gemini directory contents..." $ColorInfo
$geminiMerged = Merge-DirectoryContents -Source $sourceGeminiDir -Destination $globalGeminiDir -Description ".gemini directory contents" -BackupFolder $backupFolder
# Create version.json in global .claude directory
Write-ColorOutput "Creating version.json..." $ColorInfo
Create-VersionJson -TargetClaudeDir $globalClaudeDir -InstallationMode "Global"
if ($backupFolder -and (Test-Path $backupFolder)) {
$backupFiles = Get-ChildItem $backupFolder -Recurse -File -ErrorAction SilentlyContinue
if (-not $backupFiles -or ($backupFiles | Measure-Object).Count -eq 0) {
@@ -819,6 +858,14 @@ function Install-Path {
Write-ColorOutput "Merging .gemini directory contents to local location..." $ColorInfo
$geminiMerged = Merge-DirectoryContents -Source $sourceGeminiDir -Destination $localGeminiDir -Description ".gemini directory contents" -BackupFolder $backupFolder
# Create version.json in local .claude directory
Write-ColorOutput "Creating version.json in local directory..." $ColorInfo
Create-VersionJson -TargetClaudeDir $localClaudeDir -InstallationMode "Path"
# Also create version.json in global .claude directory
Write-ColorOutput "Creating version.json in global directory..." $ColorInfo
Create-VersionJson -TargetClaudeDir $globalClaudeDir -InstallationMode "Global"
if ($backupFolder -and (Test-Path $backupFolder)) {
$backupFiles = Get-ChildItem $backupFolder -Recurse -File -ErrorAction SilentlyContinue
if (-not $backupFiles -or ($backupFiles | Measure-Object).Count -eq 0) {

View File

@@ -87,8 +87,8 @@ function show_header() {
function test_prerequisites() {
# Test bash version
if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
write_color "ERROR: Bash 4.0 or higher is required" "$COLOR_ERROR"
if [ "${BASH_VERSINFO[0]}" -lt 2 ]; then
write_color "ERROR: Bash 2.0 or higher is required" "$COLOR_ERROR"
write_color "Current version: ${BASH_VERSION}" "$COLOR_ERROR"
return 1
fi

View File

@@ -2,7 +2,7 @@
<div align="center">
[![Version](https://img.shields.io/badge/version-v3.2.1-blue.svg)](https://github.com/catlog22/Claude-Code-Workflow/releases)
[![Version](https://img.shields.io/badge/version-v3.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)]()
[![MCP Tools](https://img.shields.io/badge/🔧_MCP_Tools-Experimental-orange.svg)](https://github.com/modelcontextprotocol)
@@ -15,13 +15,15 @@
**Claude Code Workflow (CCW)** is a next-generation multi-agent automation framework that orchestrates complex software development tasks through intelligent workflow management and autonomous execution.
> **🎉 Latest: v3.2.0** - Simplified agent architecture with "Tests Are the Review" philosophy. See [CHANGELOG.md](CHANGELOG.md) for details.
> **🎉 Latest: v3.3.0** - CLI tool enhancements & Codex multi-step execution. See [CHANGELOG.md](CHANGELOG.md) for details.
>
> **What's New in v3.2.0**:
> - 🔄 Simplified from 3 agents to 2 core agents (`@code-developer`, `@test-fix-agent`)
> - ✅ "Tests Are the Review" - Passing tests = approved code
> - 🧪 Enhanced test-fix workflow with automatic execution and fixing
> - 📦 Interactive installation with version selection menu
> **What's New in v3.3.0**:
> - 🚀 New `/cli:codex-execute` command for automated multi-step task execution
> - 🔄 Codex resume mechanism (`codex exec "..." resume --last`) for context continuity
> - 📋 TodoWrite progress tracking for subtask execution
> - 📚 Streamlined CLI documentation (60% reduction in redundancy)
> - 🔧 Enhanced Codex agent configuration for multi-task workflows
> - ✅ Optional Git verification after each subtask completion
---
@@ -94,17 +96,51 @@ Select version to install (1-3, default: 1):
> 💡 **Pro Tip**: The installer automatically detects and displays the latest version numbers and release dates from GitHub. Just press Enter to select the recommended stable release.
### **📦 Local Installation (Install-Claude.ps1)**
For local installation without network access, use the bundled PowerShell installer:
**Installation Modes:**
```powershell
# Interactive mode with prompts (recommended)
.\Install-Claude.ps1
# Quick install with automatic backup
.\Install-Claude.ps1 -Force -BackupAll
# Non-interactive install
.\Install-Claude.ps1 -NonInteractive -Force
```
**Installation Options:**
| Mode | Description | Installs To |
|------|-------------|-------------|
| **Global** | System-wide installation (default) | `~/.claude/`, `~/.codex/`, `~/.gemini/` |
| **Path** | Custom directory + global hybrid | Local: `agents/`, `commands/`<br>Global: `workflows/`, `scripts/` |
**Backup Behavior:**
- **Default**: Automatic backup enabled (`-BackupAll`)
- **Disable**: Use `-NoBackup` flag (⚠️ overwrites without backup)
- **Backup location**: `claude-backup-{timestamp}/` in installation directory
**⚠️ Important Warnings:**
- `-Force -BackupAll`: Silent file overwrite (with backup)
- `-NoBackup -Force`: Permanent file overwrite (no recovery)
- Global mode modifies user profile directories
### **✅ Verify Installation**
After installation, run the following command to ensure CCW is working:
```bash
/workflow:session:list
```
> **📝 Important Notes:**
> **📝 Installation Notes:**
> - The installer will automatically install/update `.codex/` and `.gemini/` directories
> - **Global mode**: Installs to `~/.codex` and `~/.gemini`
> - **Path mode**: Installs to your specified directory (e.g., `project/.codex`, `project/.gemini`)
> - Existing files will be backed up automatically before installation
> - **Backup**: Existing files are backed up by default to `claude-backup-{timestamp}/`
> - **Safety**: Use interactive mode for first-time installation to review changes
---
@@ -142,9 +178,9 @@ After installation, run the following command to ensure CCW is working:
**Phase 4: Testing & Quality Assurance**
```bash
# Generate comprehensive test suite (standard workflow)
/workflow:test-gen
/workflow:execute
# Generate independent test-fix workflow (v3.2.2+)
/workflow:test-gen WFS-auth # Creates WFS-test-auth session
/workflow:execute # Runs test validation
# OR verify TDD compliance (TDD workflow)
/workflow:tdd-verify
@@ -217,7 +253,7 @@ After installation, run the following command to ensure CCW is working:
| `/workflow:tdd-plan` | Create a Test-Driven Development workflow with Red-Green-Refactor cycles. |
| `/workflow:execute` | Execute the current workflow plan autonomously. |
| `/workflow:status` | Display the current status of the workflow. |
| `/workflow:test-gen` | Automatically generate a test plan from the implementation. |
| `/workflow:test-gen` | Create independent test-fix workflow for validating completed implementation. |
| `/workflow:tdd-verify` | Verify TDD compliance and generate quality report. |
| `/workflow:review` | **Optional** manual review (only use when explicitly needed - passing tests = approved code). |
@@ -228,6 +264,7 @@ After installation, run the following command to ensure CCW is working:
| `/task:*` | Manage individual tasks (`create`, `breakdown`, `execute`, `replan`). |
| `/update-memory-full` | Re-index the entire project documentation. |
| `/update-memory-related` | Update documentation related to recent changes. |
| `/version` | Display version information and check for updates from GitHub. |
---
@@ -275,7 +312,7 @@ Configure Gemini CLI for optimal integration:
```json
// ~/.gemini/settings.json
{
"contextFileName": "CLAUDE.md"
"contextFileName": ["CLAUDE.md", "GEMINI.md"]
}
```
@@ -306,7 +343,7 @@ MCP (Model Context Protocol) tools provide advanced codebase analysis. **Complet
| MCP Server | Purpose | Installation Guide |
|------------|---------|-------------------|
| **Exa MCP** | External API patterns & best practices | [Install Guide](https://github.com/exa-labs/exa-mcp-server) |
| **Exa MCP** | External API patterns & best practices | [Install Guide](https://smithery.ai/server/exa) |
| **Code Index MCP** | Advanced internal code search | [Install Guide](https://github.com/johnhuang316/code-index-mcp) |
#### Benefits When Enabled

View File

@@ -2,7 +2,7 @@
<div align="center">
[![Version](https://img.shields.io/badge/version-v3.2.1-blue.svg)](https://github.com/catlog22/Claude-Code-Workflow/releases)
[![Version](https://img.shields.io/badge/version-v3.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)]()
[![MCP工具](https://img.shields.io/badge/🔧_MCP工具-实验性-orange.svg)](https://github.com/modelcontextprotocol)
@@ -15,13 +15,15 @@
**Claude Code Workflow (CCW)** 是一个新一代的多智能体自动化开发框架,通过智能工作流管理和自主执行来协调复杂的软件开发任务。
> **🎉 最新版本: v3.2.0** - 采用"测试即审查"理念简化智能体架构。详见 [CHANGELOG.md](CHANGELOG.md)。
> **🎉 最新版本: v3.3.0** - CLI 工具增强与 Codex 多步骤执行。详见 [CHANGELOG.md](CHANGELOG.md)。
>
> **v3.2.0 版本新特性**:
> - 🔄 从 3 个智能体简化为 2 个核心智能体(`@code-developer`、`@test-fix-agent`
> - ✅ "测试即审查" - 测试通过 = 代码批准
> - 🧪 增强的测试修复工作流,支持自动执行和修复
> - 📦 交互式安装,包含版本选择菜单
> **v3.3.0 版本新特性**:
> - 🚀 新增 `/cli:codex-execute` 命令,实现自动化多步骤任务执行
> - 🔄 Codex resume 机制(`codex exec "..." resume --last`),保持上下文连续性
> - 📋 TodoWrite 进度跟踪,监控子任务执行状态
> - 📚 精简 CLI 文档(减少 60% 冗余内容)
> - 🔧 增强 Codex 智能体配置,支持多任务工作流
> - ✅ 可选的 Git 验证,每个子任务完成后检查代码变更
---
@@ -94,17 +96,51 @@ bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflo
> 💡 **提示**:安装程序会自动从 GitHub 检测并显示最新的版本号和发布日期。只需按 Enter 键即可选择推荐的稳定版本。
### **📦 本地安装 (Install-Claude.ps1)**
无需网络访问时,使用内置的 PowerShell 安装脚本:
**安装模式:**
```powershell
# 交互式安装(推荐)
.\Install-Claude.ps1
# 快速安装(自动备份)
.\Install-Claude.ps1 -Force -BackupAll
# 非交互式安装
.\Install-Claude.ps1 -NonInteractive -Force
```
**安装选项:**
| 模式 | 描述 | 安装位置 |
|------|------|----------|
| **Global** | 系统级安装(默认) | `~/.claude/``~/.codex/``~/.gemini/` |
| **Path** | 自定义目录 + 全局混合 | 本地:`agents/``commands/`<br>全局:`workflows/``scripts/` |
**备份行为:**
- **默认**:自动备份启用(`-BackupAll`
- **禁用**:使用 `-NoBackup` 标志(⚠️ 无备份覆盖)
- **备份位置**:安装目录中的 `claude-backup-{timestamp}/`
**⚠️ 重要警告:**
- `-Force -BackupAll`:静默文件覆盖(带备份)
- `-NoBackup -Force`:永久文件覆盖(无法恢复)
- Global 模式会修改用户配置目录
### **✅ 验证安装**
安装后,运行以下命令以确保 CCW 正常工作:
```bash
/workflow:session:list
```
> **📝 重要说明:**
> **📝 安装说明:**
> - 安装程序将自动安装/更新 `.codex/` 和 `.gemini/` 目录
> - **全局模式**:安装到 `~/.codex` 和 `~/.gemini`
> - **路径模式**:安装到指定目录(例如 `project/.codex`、`project/.gemini`
> - 安装前会自动备份现有文件
> - **备份**:默认自动备份现有文件到 `claude-backup-{timestamp}/`
> - **安全**:首次安装建议使用交互式模式以审查更改
---
@@ -142,15 +178,12 @@ bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflo
**阶段 4测试与质量保证**
```bash
# 生成全面测试套件(标准工作流
/workflow:test-gen
/workflow:execute
# 生成独立测试修复工作流v3.2.2+
/workflow:test-gen WFS-auth # 创建 WFS-test-auth 会话
/workflow:execute # 运行测试验证
# 或验证 TDD 合规性TDD 工作流)
/workflow:tdd-verify
# 可选:手动审查(仅在明确需要时使用)
# /workflow:review # 测试通过 = 代码已批准
```
### 简单任务快速入门
@@ -220,7 +253,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflo
| `/workflow:tdd-plan` | 创建测试驱动开发工作流,包含 Red-Green-Refactor 循环。 |
| `/workflow:execute` | 自主执行当前的工作流计划。 |
| `/workflow:status` | 显示工作流的当前状态。 |
| `/workflow:test-gen` | 从实现中自动生成测试计划。 |
| `/workflow:test-gen` | 创建独立测试修复工作流,用于验证已完成的实现。 |
| `/workflow:tdd-verify` | 验证 TDD 合规性并生成质量报告。 |
| `/workflow:review` | **可选** 手动审查(仅在明确需要时使用,测试通过即代表代码已批准)。 |
@@ -231,6 +264,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflo
| `/task:*` | 管理单个任务(`create`, `breakdown`, `execute`, `replan`)。 |
| `/update-memory-full` | 重新索引整个项目文档。 |
| `/update-memory-related` | 更新与最近更改相关的文档。 |
| `/version` | 显示版本信息并检查 GitHub 更新。 |
---
@@ -278,7 +312,7 @@ npm install -g @google/gemini-cli @openai/codex @qwen-code/qwen-code
```json
// ~/.gemini/settings.json
{
"contextFileName": "CLAUDE.md"
"contextFileName": ["CLAUDE.md", "GEMINI.md"]
}
```
@@ -309,7 +343,7 @@ MCP (模型上下文协议) 工具提供高级代码库分析。**完全可选**
| MCP 服务器 | 用途 | 安装指南 |
|------------|------|---------|
| **Exa MCP** | 外部 API 模式和最佳实践 | [安装指南](https://github.com/exa-labs/exa-mcp-server) |
| **Exa MCP** | 外部 API 模式和最佳实践 | [安装指南](https://smithery.ai/server/exahttps://smithery.ai/server/exa) |
| **Code Index MCP** | 高级内部代码搜索 | [安装指南](https://github.com/johnhuang316/code-index-mcp) |
#### 启用后的好处

View File

@@ -1,264 +0,0 @@
# 🚀 Claude Code Workflow (CCW) v2.0.0 Release Notes
**Release Date**: September 28, 2025
**Release Type**: Major Version Release
**Repository**: https://github.com/catlog22/Claude-Code-Workflow
---
## 📋 Overview
Claude Code Workflow v2.0 represents a **major architectural evolution** with significant enhancements to the multi-agent automation framework. This release introduces a comprehensive four-layer architecture, enhanced workflow lifecycle management, and intelligent tech stack detection.
> **🎯 Upgrade Recommendation**: This is a **breaking change release** with significant architectural improvements. Review the breaking changes section before upgrading.
---
## 🌟 Major Features & Enhancements
### 🏗️ **Four-Layer Architecture (NEW)**
CCW now operates through four distinct architectural layers with defined responsibilities and data contracts:
| Layer | Components | Data Flow | Integration Points |
|-------|------------|-----------|-------------------|
| **🖥️ Interface Layer** | CLI Commands, Gemini/Codex/Qwen Wrappers | User input → Commands → Agents | External CLI tools, approval modes |
| **📋 Session Layer** | `.active-[session]` markers, `workflow-session.json` | Session state → Task discovery | Atomic session switching |
| **📊 Task/Data Layer** | `.task/impl-*.json`, hierarchy management | Task definitions → Agent execution | JSON-first model, generated views |
| **🤖 Orchestration Layer** | Multi-agent coordination, dependency resolution | Agent outputs → Task updates | Intelligent execution flow |
### 🔄 **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
### 🧪 **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
### 🧠 **Smart Tech Stack Detection**
Intelligent task-based loading of technology guidelines:
- **Automatic Detection**: Only loads tech stacks for development and code review tasks
- **Multi-Language Support**: TypeScript, React, Python, Java, Go, JavaScript
- **Performance Optimized**: Skips detection for non-relevant tasks
- **Context-Aware**: Applies appropriate tech stack principles to development work
### 🔮 **Qwen CLI Integration**
Full integration of Qwen CLI for architecture analysis and code generation:
- **Architecture Analysis**: System design patterns and code quality assessment
- **Code Generation**: Implementation scaffolding and component creation
- **Intelligent Modes**: Auto template selection and precise architectural planning
---
## 📊 New Commands & Capabilities
### **Issue Management Commands**
- ` /workflow:issue:create` - Create new project issues with priority and type
- `📋 /workflow:issue:list` - List and filter issues by status and assignment
- `📝 /workflow:issue:update` - Update existing issue status and assignments
- `✅ /workflow:issue:close` - Close completed issues with resolution reasons
### **Enhanced Workflow Commands**
- `✅ /workflow:plan-verify` - Pre-execution validation using dual analysis
- `🧪 /workflow:test-gen` - Generate comprehensive test workflows
- `🎨 /workflow:brainstorm:artifacts` - Generate structured planning documents
- `🔍 /workflow:plan-deep` - Deep technical planning with Gemini analysis
### **Qwen CLI Commands**
- `🔍 /qwen:analyze` - Architecture analysis and code quality assessment
- `💬 /qwen:chat` - Direct Qwen interaction for design discussions
- `⚡ /qwen:execute` - Intelligent implementation with YOLO permissions
- `🚀 /qwen:mode:auto` - Auto template selection and execution
- `🐛 /qwen:mode:bug-index` - Bug analysis and fix suggestions
- `📋 /qwen:mode:plan` - Architecture planning and analysis
---
## 🔧 Technical Improvements
### **Script & Tool Enhancements**
- **gemini-wrapper**: Improved token management and path handling
- **qwen-wrapper**: Streamlined execution and simplified interface
- **Cross-Platform**: Enhanced Windows path compatibility with proper quoting
- **Directory Navigation**: Intelligent context optimization for focused analysis
### **Agent Improvements**
- **Flow Control**: Enhanced sequential execution with context accumulation
- **Context Assessment**: Smart tech stack loading for relevant tasks only
- **Error Handling**: Improved per-step error strategies
- **Variable Passing**: Context transfer between execution steps
### **Documentation Overhaul**
- **Unified Structure**: Aligned English and Chinese documentation
- **Command Standardization**: Consistent syntax across all commands
- **Architecture Clarity**: Clear data flow and integration point descriptions
- **Version Synchronization**: Both language versions now reflect v2.0 features
---
## 📈 Performance & Compatibility
### **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
---
## ⚠️ Breaking Changes
### **Removed Components**
- **Python CLI Backend**: All `pycli` references and related scripts removed
- **Deprecated Scripts**: `install_pycli.sh`, `pycli`, `pycli.conf`, `tech-stack-loader.sh`
- **Legacy Commands**: Old path reading scripts and unused Python tools
### **Command Syntax Changes**
- **Session Commands**: `/workflow:session list``/workflow:session:list`
- **File Naming**: Standardized to lowercase `.task/impl-*.json`
- **Session Markers**: Unified format `.active-[session]`
### **Architecture Changes**
- **Data Model**: Migrated to JSON-first architecture
- **Session Management**: Atomic marker-based system
- **Task Structure**: Standardized hierarchy and status management
### **Configuration Updates**
Required Gemini CLI configuration:
```json
{
"contextFileName": "CLAUDE.md"
}
```
---
## 🚀 Migration Guide
### **From v1.x to v2.0**
1. **Update Configuration**:
```bash
# Update Gemini CLI settings
echo '{"contextFileName": "CLAUDE.md"}' > ~/.gemini/settings.json
```
2. **Clean Legacy Files**:
```bash
# Remove old Python CLI references
rm -f .claude/scripts/pycli*
rm -f .claude/scripts/install_pycli.sh
```
3. **Update Command Usage**:
```bash
# Old syntax
/workflow:session list
# New syntax
/workflow:session:list
```
4. **Verify Installation**:
```bash
/workflow:session:list
```
---
## 📚 Documentation & Resources
### **Updated Documentation**
- **README.md**: Complete v2.0 feature documentation
- **README_CN.md**: Chinese documentation with v2.0 alignment
- **Architecture Guides**: Four-layer system documentation
- **Command Reference**: Comprehensive CLI command tables
### **Quick Start**
```bash
# Install CCW v2.0
Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content
# Verify installation
/workflow:session:list
# Start first workflow
/workflow:session:start "My First Project"
```
---
## 🤝 Contributing & Support
### **Development**
- **GitHub**: https://github.com/catlog22/Claude-Code-Workflow
- **Issues**: https://github.com/catlog22/Claude-Code-Workflow/issues
- **Discussions**: https://github.com/catlog22/Claude-Code-Workflow/discussions
### **Community**
- **Documentation**: [Project Wiki](https://github.com/catlog22/Claude-Code-Workflow/wiki)
- **Changelog**: [Release History](CHANGELOG.md)
- **License**: MIT License
---
## 🙏 Acknowledgments
Special thanks to the community for feedback and contributions that made v2.0 possible. This release represents a significant step forward in automated development workflow capabilities.
---
**🚀 Claude Code Workflow v2.0**
*Professional software development workflow automation through intelligent multi-agent coordination and autonomous execution capabilities.*
---
## 📝 Commit History Summary
This release includes 15+ commits spanning major architectural improvements:
- **5d08c53**: Smart tech stack detection for agents
- **b956943**: Workflow architecture documentation updates
- **8baca52**: README v2.0 alignment and four-layer architecture
- **0756682**: Python CLI cleanup and modernization
- **be4db94**: Concept evaluation framework addition
- **817f51c**: Qwen CLI integration and task commands
For complete commit history, see: [GitHub Commits](https://github.com/catlog22/Claude-Code-Workflow/commits/main)

View File

@@ -1,142 +0,0 @@
# 🔧 Claude Code Workflow (CCW) v3.2.1 Release Notes
**Release Date**: October 2, 2025
**Release Type**: Patch Release - Documentation Fix
**Repository**: https://github.com/catlog22/Claude-Code-Workflow
---
## 📋 Overview
CCW v3.2.1 is a critical documentation fix release that corrects `workflow-session.json` path references throughout the brainstorming workflow documentation. This ensures consistency with the architecture specification defined in `workflow-architecture.md`.
---
## 🐛 Bug Fixes
### **Documentation Path Corrections**
**Issue**: Documentation incorrectly referenced `workflow-session.json` inside the `.brainstorming/` subdirectory
**Impact**:
- Confusing path references in 9 brainstorming role documentation files
- Inconsistency with architectural specifications
- Potential runtime errors when commands attempt to read session metadata
**Fixed Files** (9 total):
1.`data-architect.md`
2.`product-manager.md`
3.`product-owner.md`
4.`scrum-master.md`
5.`subject-matter-expert.md`
6.`ui-designer.md`
7.`ux-expert.md`
8.`auto-parallel.md`
9.`artifacts.md`
**Corrections Applied**:
-**Incorrect**: `.workflow/WFS-{session}/.brainstorming/workflow-session.json`
-**Correct**: `.workflow/WFS-{session}/workflow-session.json`
---
## 📐 Architecture Alignment
### Confirmed Standard Structure
```
.workflow/WFS-[topic-slug]/
├── workflow-session.json # ✅ Session metadata (root level)
├── .brainstorming/ # Brainstorming artifacts subdirectory
│ └── topic-framework.md
├── IMPL_PLAN.md
├── TODO_LIST.md
└── .task/
└── IMPL-*.json
```
### Key Points
- `workflow-session.json` is **always at session root level**
- `.brainstorming/` directory contains **only** framework and analysis files
- No session metadata files inside subdirectories
---
## 📊 Changes Summary
| Category | Files Changed | Lines Modified |
|----------|--------------|----------------|
| Documentation Fixes | 9 | 19 insertions, 18 deletions |
| Path Corrections | 8 role files | 2 corrections per file |
| Structure Clarifications | 1 artifacts file | Added architectural note |
---
## ✅ Verification
**Pre-Release Checks**:
- ✅ No incorrect `.brainstorming/workflow-session.json` references
- ✅ No legacy `session.json` references
- ✅ All brainstorming roles use correct paths
- ✅ Architecture consistency verified with Gemini analysis
---
## 🔄 Upgrade Instructions
### For Existing Users
**No action required** - This is a documentation-only fix.
1. Pull the latest changes:
```bash
git pull origin main
```
2. Review updated documentation:
- `.claude/commands/workflow/brainstorm/*.md`
### For New Users
Simply clone the repository with the correct documentation:
```bash
git clone https://github.com/catlog22/Claude-Code-Workflow.git
```
---
## 📚 Related Documentation
- **Architecture Reference**: `.claude/workflows/workflow-architecture.md`
- **Brainstorming Commands**: `.claude/commands/workflow/brainstorm/`
- **Session Management**: `.claude/commands/workflow/session/`
---
## 🙏 Acknowledgments
Special thanks to the analysis tools used in this fix:
- **Gemini CLI**: Path verification and consistency checking
- **Codex**: Initial codebase analysis
- **Claude Code**: Documentation review and corrections
---
## 🔗 Links
- **Full Changelog**: [v3.2.0...v3.2.1](https://github.com/catlog22/Claude-Code-Workflow/compare/v3.2.0...v3.2.1)
- **Issues Fixed**: Documentation consistency issue
- **Previous Release**: [v3.2.0 Release Notes](RELEASE_NOTES_v3.2.0.md)
---
## 📝 Notes
- This is a **non-breaking change** - existing workflows will continue to function
- Documentation now correctly reflects the implemented architecture
- No code changes were necessary - this was purely a documentation correction
---
**Contributors**: Claude Code Development Team
**License**: MIT
**Support**: [GitHub Issues](https://github.com/catlog22/Claude-Code-Workflow/issues)

252
RELEASE_NOTES_v3.2.3.md Normal file
View File

@@ -0,0 +1,252 @@
# v3.2.3 - Version Management System
## 🎉 Release Date
2025-10-03
## ✨ Overview
This release introduces a comprehensive version management and upgrade notification system, making it easy to track your Claude Code Workflow installation and stay up-to-date with the latest releases.
## 🆕 New Features
### `/version` Command
A powerful new command that provides complete version information and automatic update checking:
**Features:**
- 📊 **Version Display**: Shows both local and global installation versions
- 🌐 **GitHub Integration**: Fetches latest stable release and development commits
- 🔄 **Smart Comparison**: Automatically compares installed version with latest available
- 💡 **Upgrade Recommendations**: Provides installation commands for easy upgrading
-**Fast Execution**: 30-second timeout for network calls, graceful offline handling
**Usage:**
```bash
/version
```
**Example Output:**
```
Installation Status:
- Local: No project-specific installation
- Global: ✅ Installed at ~/.claude
- Version: v3.2.3
- Installed: 2025-10-03T05:01:34Z
Latest Releases:
- Stable: v3.2.3 (2025-10-03T04:10:08Z)
- v3.2.3: Version Management System
- Latest Commit: c5c36a2 (2025-10-03T05:00:06Z)
- fix: Optimize version command API calls and data extraction
Status: ✅ You are on the latest stable version (3.2.3)
```
### Version Tracking System
**Version Files:**
- `.claude/version.json` - Local project installation tracking
- `~/.claude/version.json` - Global installation tracking
**Tracked Information:**
```json
{
"version": "v3.2.3",
"installation_mode": "Global",
"installation_path": "C:\\Users\\username\\.claude",
"source_branch": "main",
"installation_date_utc": "2025-10-03T05:01:34Z"
}
```
### GitHub API Integration
**Endpoints Used:**
- **Latest Release**: `https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest`
- Extracts: tag_name, release name, published date
- **Latest Commit**: `https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main`
- Extracts: commit SHA, message, author date
**Network Handling:**
- 30-second timeout for slow connections
- Graceful error handling for offline scenarios
- No external dependencies (uses curl and grep/sed)
## 🔄 What's Changed
### Documentation Updates
**Updated Files:**
-`CHANGELOG.md` - Added comprehensive v3.2.3 release notes
-`README.md` - Updated version badge to v3.2.3, added `/version` command
-`README_CN.md` - Updated version badge and command reference (Chinese)
-`.claude/commands/version.md` - Complete implementation guide
**Version References:**
- All version badges updated from v3.2.2 to v3.2.3
- "What's New" sections updated with v3.2.3 features
- Command reference tables include `/version` command
### Installation Scripts Enhancement
**Future Enhancement** (for next release):
- Installation scripts will automatically create `version.json` files
- Track installation mode (local vs global)
- Record installation timestamp
- Support version tracking for both stable and development installations
## 📋 Version Comparison Scenarios
### Scenario 1: Up to Date
```
✅ You are on the latest stable version (3.2.3)
```
### Scenario 2: Upgrade Available
```
⬆️ A newer stable version is available: v3.2.4
Your version: 3.2.3
To upgrade:
PowerShell: iex (iwr -useb https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1)
Bash: bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
```
### Scenario 3: Development Version
```
✨ You are running a development version (3.3.0-dev)
This is newer than the latest stable release (v3.2.3)
```
## 🛠️ Technical Details
### Implementation Highlights
**Simple Bash Commands:**
- No jq dependency required (uses grep/sed for JSON parsing)
- Cross-platform compatible (Windows Git Bash, Linux, macOS)
- Version comparison using `sort -V` for semantic versioning
- Direct API access using curl with error suppression
**Command Structure:**
```bash
# Check local version
test -f ./.claude/version.json && cat ./.claude/version.json
# Check global version
test -f ~/.claude/version.json && cat ~/.claude/version.json
# Fetch latest release (with timeout)
curl -fsSL "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null
# Extract version
grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4
# Compare versions
printf "%s\n%s" "3.2.2" "3.2.3" | sort -V | tail -n 1
```
## 📊 Benefits
### User Experience
- 🔍 **Quick version check** with single command
- 📊 **Comprehensive information** display (local, global, stable, dev)
- 🔄 **Automatic upgrade notifications** when new versions available
- 📈 **Development version tracking** for cutting-edge features
- 🌐 **GitHub integration** for latest updates
### DevOps
- 📁 **Version tracking** in both local and global installations
- 🕐 **Installation timestamp** for audit trails
- 🔀 **Support for both stable and development** branches
-**Fast execution** with 30-second network timeout
- 🛡️ **Graceful error handling** for offline scenarios
## 🔗 Related Commands
- `/cli:cli-init` - Initialize CLI tool configurations
- `/workflow:session:list` - List workflow sessions
- `/update-memory-full` - Update project documentation
## 📦 Installation
### Fresh Installation
**Windows (PowerShell):**
```powershell
iex (iwr -useb https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1)
```
**Linux/macOS (Bash):**
```bash
bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
```
### Upgrade from v3.2.2
Use the same installation commands above. The installer will automatically:
1. Detect your existing installation
2. Back up current files (if using `-BackupAll`)
3. Update to v3.2.3
4. Create/update `version.json` files
## 🐛 Bug Fixes
- Fixed commit message extraction to handle JSON escape sequences
- Improved API endpoint from `/branches/main` to `/commits/main` for reliable commit info
- Added 30-second timeout to all network calls for slow connections
- Enhanced release name and published date extraction
## 📚 Documentation
### New Documentation
- `.claude/commands/version.md` - Complete command implementation guide
- API endpoints and usage
- Timeout configuration
- Error handling scenarios
- Simple bash command examples
### Updated Documentation
- `CHANGELOG.md` - v3.2.3 release notes
- `README.md` - Version badge and command reference
- `README_CN.md` - Chinese version updates
## 🙏 Credits
This release includes contributions and improvements based on:
- GitHub API integration for version detection
- Cross-platform bash command compatibility
- User feedback on installation and upgrade processes
## 📝 Notes
- **Backward Compatible**: All existing commands and workflows continue to work
- **No Breaking Changes**: This is a minor release with new features only
- **Optional Feature**: `/version` command is entirely optional, existing workflows unaffected
## 🚀 What's Next
**Planned for v3.2.4:**
- Enhanced installation script to auto-create version.json
- Version tracking in all installation modes
- Automatic version detection during installation
**Future Enhancements:**
- Auto-update functionality (opt-in)
- Version comparison in workflow sessions
- Release notes display in CLI
---
**Full Changelog**: [v3.2.2...v3.2.3](https://github.com/catlog22/Claude-Code-Workflow/compare/v3.2.2...v3.2.3)
**Installation:**
```bash
# One-line install (recommended)
bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
# Or use specific version tag
git clone -b v3.2.3 https://github.com/catlog22/Claude-Code-Workflow.git
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)

View File

@@ -258,23 +258,25 @@ function Extract-Repository {
function Invoke-LocalInstaller {
param(
[string]$RepoDir
[string]$RepoDir,
[string]$VersionInfo = "",
[string]$BranchInfo = ""
)
$installerPath = Join-Path $RepoDir "Install-Claude.ps1"
if (-not (Test-Path $installerPath)) {
Write-ColorOutput "ERROR: Install-Claude.ps1 not found" $ColorError
return $false
}
Write-ColorOutput "Running local installer..." $ColorInfo
Write-Host ""
# Build parameters for local installer
$params = @{}
if ($Global) { $params["InstallMode"] = "Global" }
if ($Directory) {
if ($Directory) {
$params["InstallMode"] = "Custom"
$params["TargetPath"] = $Directory
}
@@ -282,11 +284,15 @@ function Invoke-LocalInstaller {
if ($NoBackup) { $params["NoBackup"] = $NoBackup }
if ($NonInteractive) { $params["NonInteractive"] = $NonInteractive }
if ($BackupAll) { $params["BackupAll"] = $BackupAll }
# Pass version and branch information
if ($VersionInfo) { $params["SourceVersion"] = $VersionInfo }
if ($BranchInfo) { $params["SourceBranch"] = $BranchInfo }
try {
# Change to repo directory and run installer
Push-Location $RepoDir
if ($params.Count -gt 0) {
$paramList = ($params.GetEnumerator() | ForEach-Object { "-$($_.Key) $($_.Value)" }) -join " "
Write-ColorOutput "Executing: & `"$installerPath`" $paramList" $ColorInfo
@@ -295,7 +301,7 @@ function Invoke-LocalInstaller {
Write-ColorOutput "Executing: & `"$installerPath`"" $ColorInfo
& $installerPath
}
Pop-Location
return $true
} catch {
@@ -542,26 +548,32 @@ function Main {
# Create temp directory
$tempDir = Get-TempDirectory
Write-ColorOutput "Temporary directory: $tempDir" $ColorInfo
try {
# Download repository
$zipPath = Download-Repository -TempDir $tempDir -Version $Version -Branch $Branch -Tag $Tag
if (-not $zipPath) {
throw "Download failed"
}
# Extract repository
$repoDir = Extract-Repository $zipPath $tempDir
if (-not $repoDir) {
throw "Extraction failed"
}
# Run local installer
$success = Invoke-LocalInstaller $repoDir
# Determine version and branch information to pass
$versionToPass = if ($Tag) { $Tag } else { "latest" }
$branchToPass = if ($Version -eq "branch") { $Branch } elseif ($Version -eq "latest") { "main" } elseif ($Tag) { $Tag } else { "main" }
Write-ColorOutput "Version info: $versionToPass (branch: $branchToPass)" $ColorInfo
# Run local installer with version information
$success = Invoke-LocalInstaller -RepoDir $repoDir -VersionInfo $versionToPass -BranchInfo $branchToPass
if (-not $success) {
throw "Installation script failed"
}
Write-Host ""
Write-ColorOutput "Remote installation completed successfully!" $ColorSuccess

View File

@@ -43,8 +43,8 @@ function show_header() {
function test_prerequisites() {
# Test bash version
if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
write_color "ERROR: Bash 4.0 or higher is required" "$COLOR_ERROR"
if [ "${BASH_VERSINFO[0]}" -lt 2 ]; then
write_color "ERROR: Bash 2.0 or higher is required" "$COLOR_ERROR"
write_color "Current version: ${BASH_VERSION}" "$COLOR_ERROR"
return 1
fi