mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-06 01:54:11 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
661cb5be1c | ||
|
|
94a2150836 | ||
|
|
3067b8bda6 | ||
|
|
47973718d6 | ||
|
|
0b63465e5a | ||
|
|
0a85e98fdb | ||
|
|
cdea58f32f | ||
|
|
ed1e1c4bbf | ||
|
|
b1a2885799 | ||
|
|
c39f311a20 |
@@ -91,10 +91,11 @@ allowed-tools: TodoWrite(*), Read(*), Write(*), Bash(*), Glob(*)
|
||||
**Document Structure**:
|
||||
```
|
||||
.workflow/WFS-[topic]/.brainstorming/
|
||||
├── topic-framework.md # ★ STRUCTURED FRAMEWORK DOCUMENT
|
||||
└── workflow-session.json # Framework metadata and role assignments
|
||||
└── topic-framework.md # ★ STRUCTURED FRAMEWORK DOCUMENT
|
||||
```
|
||||
|
||||
**Note**: `workflow-session.json` is located at `.workflow/WFS-[topic]/workflow-session.json` (session root), not inside `.brainstorming/`.
|
||||
|
||||
## Framework Template Structures
|
||||
|
||||
### Dynamic Role-Based Framework
|
||||
|
||||
@@ -149,7 +149,7 @@ Task(subagent_type="conceptual-planning-agent",
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and topic description
|
||||
- Command: bash(cat .workflow/WFS-{topic}/.brainstorming/workflow-session.json 2>/dev/null || echo '{}')
|
||||
- Command: bash(cat .workflow/WFS-{topic}/workflow-session.json 2>/dev/null || echo '{}')
|
||||
- Output: session_metadata
|
||||
|
||||
### Implementation Context
|
||||
@@ -162,7 +162,7 @@ Task(subagent_type="conceptual-planning-agent",
|
||||
### Session Context
|
||||
**Workflow Directory**: .workflow/WFS-{topic}/.brainstorming/
|
||||
**Output Directory**: .workflow/WFS-{topic}/.brainstorming/{role}/
|
||||
**Session JSON**: .workflow/WFS-{topic}/.brainstorming/workflow-session.json
|
||||
**Session JSON**: .workflow/WFS-{topic}/workflow-session.json
|
||||
|
||||
### Dependencies & Context
|
||||
**Topic**: {user-provided-topic}
|
||||
|
||||
@@ -88,7 +88,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and existing context
|
||||
- Command: Read(.workflow/WFS-{session}/.brainstorming/session.json)
|
||||
- Command: Read(.workflow/WFS-{session}/workflow-session.json)
|
||||
- Output: session_context
|
||||
|
||||
## Analysis Requirements
|
||||
@@ -136,7 +136,7 @@ TodoWrite({
|
||||
activeForm: "Generating structured data-architect analysis"
|
||||
},
|
||||
{
|
||||
content: "Update session.json with data-architect completion status",
|
||||
content: "Update workflow-session.json with data-architect completion status",
|
||||
status: "pending",
|
||||
activeForm: "Updating session metadata"
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and existing context
|
||||
- Command: Read(.workflow/WFS-{session}/.brainstorming/session.json)
|
||||
- Command: Read(.workflow/WFS-{session}/workflow-session.json)
|
||||
- Output: session_context
|
||||
|
||||
## Analysis Requirements
|
||||
@@ -136,7 +136,7 @@ TodoWrite({
|
||||
activeForm: "Generating structured product-manager analysis"
|
||||
},
|
||||
{
|
||||
content: "Update session.json with product-manager completion status",
|
||||
content: "Update workflow-session.json with product-manager completion status",
|
||||
status: "pending",
|
||||
activeForm: "Updating session metadata"
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and existing context
|
||||
- Command: Read(.workflow/WFS-{session}/.brainstorming/session.json)
|
||||
- Command: Read(.workflow/WFS-{session}/workflow-session.json)
|
||||
- Output: session_context
|
||||
|
||||
## Analysis Requirements
|
||||
@@ -136,7 +136,7 @@ TodoWrite({
|
||||
activeForm: "Generating structured product-owner analysis"
|
||||
},
|
||||
{
|
||||
content: "Update session.json with product-owner completion status",
|
||||
content: "Update workflow-session.json with product-owner completion status",
|
||||
status: "pending",
|
||||
activeForm: "Updating session metadata"
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and existing context
|
||||
- Command: Read(.workflow/WFS-{session}/.brainstorming/session.json)
|
||||
- Command: Read(.workflow/WFS-{session}/workflow-session.json)
|
||||
- Output: session_context
|
||||
|
||||
## Analysis Requirements
|
||||
@@ -136,7 +136,7 @@ TodoWrite({
|
||||
activeForm: "Generating structured scrum-master analysis"
|
||||
},
|
||||
{
|
||||
content: "Update session.json with scrum-master completion status",
|
||||
content: "Update workflow-session.json with scrum-master completion status",
|
||||
status: "pending",
|
||||
activeForm: "Updating session metadata"
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and existing context
|
||||
- Command: Read(.workflow/WFS-{session}/.brainstorming/session.json)
|
||||
- Command: Read(.workflow/WFS-{session}/workflow-session.json)
|
||||
- Output: session_context
|
||||
|
||||
## Analysis Requirements
|
||||
@@ -136,7 +136,7 @@ TodoWrite({
|
||||
activeForm: "Generating structured subject-matter-expert analysis"
|
||||
},
|
||||
{
|
||||
content: "Update session.json with subject-matter-expert completion status",
|
||||
content: "Update workflow-session.json with subject-matter-expert completion status",
|
||||
status: "pending",
|
||||
activeForm: "Updating session metadata"
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and existing context
|
||||
- Command: Read(.workflow/WFS-{session}/.brainstorming/session.json)
|
||||
- Command: Read(.workflow/WFS-{session}/workflow-session.json)
|
||||
- Output: session_context
|
||||
|
||||
## Analysis Requirements
|
||||
@@ -136,7 +136,7 @@ TodoWrite({
|
||||
activeForm: "Generating structured ui-designer analysis"
|
||||
},
|
||||
{
|
||||
content: "Update session.json with ui-designer completion status",
|
||||
content: "Update workflow-session.json with ui-designer completion status",
|
||||
status: "pending",
|
||||
activeForm: "Updating session metadata"
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
|
||||
|
||||
3. **load_session_metadata**
|
||||
- Action: Load session metadata and existing context
|
||||
- Command: Read(.workflow/WFS-{session}/.brainstorming/session.json)
|
||||
- Command: Read(.workflow/WFS-{session}/workflow-session.json)
|
||||
- Output: session_context
|
||||
|
||||
## Analysis Requirements
|
||||
@@ -136,7 +136,7 @@ TodoWrite({
|
||||
activeForm: "Generating structured ux-expert analysis"
|
||||
},
|
||||
{
|
||||
content: "Update session.json with ux-expert completion status",
|
||||
content: "Update workflow-session.json with ux-expert completion status",
|
||||
status: "pending",
|
||||
activeForm: "Updating session metadata"
|
||||
}
|
||||
|
||||
@@ -41,19 +41,21 @@ type: strategic-guideline
|
||||
|
||||
### Standard Format (REQUIRED)
|
||||
```bash
|
||||
# Gemini Analysis
|
||||
# Gemini Analysis (全权限)
|
||||
cd [directory] && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: [clear analysis goal]
|
||||
TASK: [specific analysis task]
|
||||
MODE: [analysis|write]
|
||||
CONTEXT: [file references and memory context]
|
||||
EXPECTED: [expected output]
|
||||
RULES: [template reference and constraints]
|
||||
"
|
||||
|
||||
# Qwen Architecture & Code Generation
|
||||
# Qwen Architecture Analysis (仅分析)
|
||||
cd [directory] && ~/.claude/scripts/qwen-wrapper -p "
|
||||
PURPOSE: [clear architecture/code goal]
|
||||
TASK: [specific architecture/code task]
|
||||
PURPOSE: [clear architecture goal]
|
||||
TASK: [specific analysis task]
|
||||
MODE: analysis
|
||||
CONTEXT: [file references and memory context]
|
||||
EXPECTED: [expected deliverables]
|
||||
RULES: [template reference and constraints]
|
||||
@@ -63,6 +65,7 @@ RULES: [template reference and constraints]
|
||||
codex -C [directory] --full-auto exec "
|
||||
PURPOSE: [clear development goal]
|
||||
TASK: [specific development task]
|
||||
MODE: [auto|write]
|
||||
CONTEXT: [file references and memory context]
|
||||
EXPECTED: [expected deliverables]
|
||||
RULES: [template reference and constraints]
|
||||
@@ -72,10 +75,26 @@ RULES: [template reference and constraints]
|
||||
### Template Structure
|
||||
- [ ] **PURPOSE** - Clear goal and intent
|
||||
- [ ] **TASK** - Specific execution task
|
||||
- [ ] **MODE** - Execution mode and permission level
|
||||
- [ ] **CONTEXT** - File references and memory context from previous sessions
|
||||
- [ ] **EXPECTED** - Clear expected results
|
||||
- [ ] **RULES** - Template reference and constraints
|
||||
|
||||
### MODE Field Definition
|
||||
|
||||
The MODE field controls execution behavior and file permissions:
|
||||
|
||||
**For Gemini** (全权限,可读写):
|
||||
- `analysis` (default) - 分析 + 可生成文档
|
||||
- `write` - 创建/修改文件(自动启用 --approval-mode yolo)
|
||||
|
||||
**For Qwen** (仅分析):
|
||||
- `analysis` (default) - 仅架构分析,不生成代码
|
||||
|
||||
**For Codex**:
|
||||
- `auto` (default) - 自主开发,全文件操作
|
||||
- `write` - 测试生成和文件修改
|
||||
|
||||
### Directory Context
|
||||
Tools execute in current working directory:
|
||||
- **Gemini**: `cd path/to/project && ~/.claude/scripts/gemini-wrapper -p "prompt"`
|
||||
@@ -150,80 +169,92 @@ When planning any coding task, **ALWAYS** integrate CLI tools:
|
||||
|
||||
### Common Scenarios
|
||||
```bash
|
||||
# Project Analysis (in current directory)
|
||||
# Gemini - Code Analysis
|
||||
~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Understand codebase architecture
|
||||
TASK: Analyze project structure and identify patterns
|
||||
MODE: analysis
|
||||
CONTEXT: @{src/**/*.ts,CLAUDE.md} Previous analysis of auth system
|
||||
EXPECTED: Architecture overview and integration points
|
||||
RULES: $(cat "~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt") | Focus on integration points
|
||||
RULES: $(cat '~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt') | Focus on integration points
|
||||
"
|
||||
|
||||
# Project Analysis (in different directory)
|
||||
cd ../other-project && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Compare authentication patterns
|
||||
TASK: Analyze auth implementation in related project
|
||||
CONTEXT: @{src/auth/**/*} Current project context from session memory
|
||||
EXPECTED: Pattern comparison and recommendations
|
||||
RULES: $(cat "~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt") | Focus on architectural differences
|
||||
# Gemini - Generate Documentation
|
||||
~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Generate API documentation
|
||||
TASK: Create comprehensive API reference from code
|
||||
MODE: write
|
||||
CONTEXT: @{src/api/**/*}
|
||||
EXPECTED: API.md with all endpoints documented
|
||||
RULES: Follow project documentation standards
|
||||
"
|
||||
|
||||
# Architecture Design (with Qwen)
|
||||
# Qwen - Architecture Analysis
|
||||
cd src/auth && ~/.claude/scripts/qwen-wrapper -p "
|
||||
PURPOSE: Design authentication system architecture
|
||||
TASK: Create modular JWT-based auth system design
|
||||
PURPOSE: Analyze authentication system architecture
|
||||
TASK: Review JWT-based auth system design
|
||||
MODE: analysis
|
||||
CONTEXT: @{src/auth/**/*} Existing patterns and requirements
|
||||
EXPECTED: Complete architecture with code scaffolding
|
||||
RULES: $(cat "~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt") | Focus on modularity and security
|
||||
EXPECTED: Architecture analysis report with recommendations
|
||||
RULES: $(cat '~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt') | Focus on security
|
||||
"
|
||||
|
||||
# Feature Development (in target directory)
|
||||
# Codex - Feature Development
|
||||
codex -C path/to/project --full-auto exec "
|
||||
PURPOSE: Implement user authentication
|
||||
TASK: Create JWT-based authentication system
|
||||
MODE: auto
|
||||
CONTEXT: @{src/auth/**/*} Database schema from session memory
|
||||
EXPECTED: Complete auth module with tests
|
||||
RULES: $(cat "~/.claude/workflows/cli-templates/prompts/development/feature.txt") | Follow security best practices
|
||||
RULES: $(cat '~/.claude/workflows/cli-templates/prompts/development/feature.txt') | Follow security best practices
|
||||
" --skip-git-repo-check -s danger-full-access
|
||||
|
||||
# Code Review Preparation
|
||||
~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Prepare comprehensive code review
|
||||
TASK: Analyze code changes and identify potential issues
|
||||
CONTEXT: @{**/*.modified} Recent changes discussed in last session
|
||||
EXPECTED: Review checklist and improvement suggestions
|
||||
RULES: $(cat "~/.claude/workflows/cli-templates/prompts/analysis/quality.txt") | Focus on maintainability
|
||||
"
|
||||
# Codex - Test Generation
|
||||
codex -C src/auth --full-auto exec "
|
||||
PURPOSE: Increase test coverage
|
||||
TASK: Generate comprehensive tests for auth module
|
||||
MODE: write
|
||||
CONTEXT: @{**/*.ts} Exclude existing tests
|
||||
EXPECTED: Complete test suite with 80%+ coverage
|
||||
RULES: Use Jest, follow existing patterns
|
||||
" --skip-git-repo-check -s danger-full-access
|
||||
```
|
||||
|
||||
## 📋 Planning Checklist
|
||||
|
||||
For every development task:
|
||||
- [ ] **Purpose defined** - Clear goal and intent
|
||||
- [ ] **Mode selected** - Execution mode and permission level determined
|
||||
- [ ] **Context gathered** - File references and session memory documented
|
||||
- [ ] **Gemini analysis** completed for understanding
|
||||
- [ ] **Template selected** - Appropriate template chosen
|
||||
- [ ] **Constraints specified** - File patterns, scope, requirements
|
||||
- [ ] **Implementation approach** - Tool selection and workflow
|
||||
- [ ] **Quality measures** - Testing and validation plan
|
||||
- [ ] **Tool configuration** - Review `.gemini/CLAUDE.md` or `.codex/Agent.md` if needed
|
||||
|
||||
## 🎯 Key Features
|
||||
|
||||
### Gemini
|
||||
### Gemini (全权限)
|
||||
- **Command**: `~/.claude/scripts/gemini-wrapper`
|
||||
- **Strengths**: Large context window, pattern recognition
|
||||
- **Best For**: Analysis, architecture review, code exploration
|
||||
- **Best For**: Analysis, documentation generation, code exploration
|
||||
- **Permissions**: 可读写,MODE=write 时自动启用 --approval-mode yolo
|
||||
- **Default MODE**: `analysis`
|
||||
|
||||
### Qwen
|
||||
### Qwen (仅分析)
|
||||
- **Command**: `~/.claude/scripts/qwen-wrapper`
|
||||
- **Strengths**: Architecture analysis, code generation, implementation patterns
|
||||
- **Best For**: System design, code scaffolding, architectural planning
|
||||
- **Strengths**: Architecture analysis, pattern recognition
|
||||
- **Best For**: System design analysis, architectural review
|
||||
- **Permissions**: 仅分析,不生成代码
|
||||
- **Default MODE**: `analysis`
|
||||
|
||||
### 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`
|
||||
|
||||
### File Patterns
|
||||
- All files: `@{**/*}`
|
||||
@@ -250,15 +281,33 @@ For every development task:
|
||||
|
||||
**Example**:
|
||||
```bash
|
||||
# Focused analysis (preferred)
|
||||
cd src/auth && ~/.claude/scripts/gemini-wrapper -p "analyze auth patterns"
|
||||
# Gemini - Focused analysis
|
||||
cd src/auth && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Understand authentication patterns
|
||||
TASK: Analyze auth implementation
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts}
|
||||
EXPECTED: Pattern documentation
|
||||
RULES: Focus on security best practices
|
||||
"
|
||||
|
||||
# Focused architecture (Qwen)
|
||||
cd src/auth && ~/.claude/scripts/qwen-wrapper -p "design auth architecture"
|
||||
# Qwen - Architecture analysis
|
||||
cd src/auth && ~/.claude/scripts/qwen-wrapper -p "
|
||||
PURPOSE: Analyze auth architecture
|
||||
TASK: Review auth system design and patterns
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*}
|
||||
EXPECTED: Architecture analysis report
|
||||
RULES: Focus on modularity and security
|
||||
"
|
||||
|
||||
# Focused implementation (Codex)
|
||||
codex -C src/auth --full-auto exec "analyze auth implementation" --skip-git-repo-check
|
||||
|
||||
# Multi-scope (stay in root)
|
||||
~/.claude/scripts/gemini-wrapper -p "CONTEXT: @{src/auth/**/*,src/api/**/*}"
|
||||
# Codex - Implementation
|
||||
codex -C src/auth --full-auto exec "
|
||||
PURPOSE: Improve auth implementation
|
||||
TASK: Review and enhance auth code
|
||||
MODE: auto
|
||||
CONTEXT: @{**/*.ts}
|
||||
EXPECTED: Code improvements and fixes
|
||||
RULES: Maintain backward compatibility
|
||||
" --skip-git-repo-check -s danger-full-access
|
||||
```
|
||||
215
.codex/AGENTS.md
Normal file
215
.codex/AGENTS.md
Normal file
@@ -0,0 +1,215 @@
|
||||
# Codex Agent Execution Protocol
|
||||
|
||||
## Overview
|
||||
|
||||
**Role**: Codex - autonomous development, implementation, and testing
|
||||
|
||||
## Prompt Structure
|
||||
|
||||
**Receive prompts in this format**:
|
||||
|
||||
```
|
||||
PURPOSE: [development goal]
|
||||
TASK: [specific implementation task]
|
||||
MODE: [auto|write]
|
||||
CONTEXT: [file patterns]
|
||||
EXPECTED: [deliverables]
|
||||
RULES: [constraints and templates]
|
||||
```
|
||||
|
||||
## Execution Requirements
|
||||
|
||||
### ALWAYS
|
||||
|
||||
- **Parse all six fields** - Understand PURPOSE, TASK, MODE, CONTEXT, EXPECTED, RULES
|
||||
- **Follow MODE strictly** - Respect execution boundaries
|
||||
- **Study CONTEXT files** - Find 3+ similar patterns before implementing
|
||||
- **Apply RULES** - Follow templates and constraints exactly
|
||||
- **Test continuously** - Run tests after every change
|
||||
- **Commit incrementally** - Small, working commits
|
||||
- **Match project style** - Follow existing patterns exactly
|
||||
- **Validate EXPECTED** - Ensure all deliverables are met
|
||||
|
||||
### NEVER
|
||||
|
||||
- **Make assumptions** - Verify with existing code
|
||||
- **Ignore existing patterns** - Study before implementing
|
||||
- **Skip tests** - Tests are mandatory
|
||||
- **Use clever tricks** - Choose boring, obvious solutions
|
||||
- **Over-engineer** - Simple solutions over complex architectures
|
||||
- **Break existing code** - Ensure backward compatibility
|
||||
- **Exceed 3 attempts** - Stop and reassess if blocked 3 times
|
||||
|
||||
## MODE Behavior
|
||||
|
||||
### MODE: auto (default)
|
||||
|
||||
**Permissions**:
|
||||
- Full file operations (create/modify/delete)
|
||||
- Run tests and builds
|
||||
- Commit code incrementally
|
||||
|
||||
**Execute**:
|
||||
1. Parse PURPOSE and TASK
|
||||
2. Analyze CONTEXT files - find 3+ similar patterns
|
||||
3. Plan implementation approach
|
||||
4. Generate code following RULES and project patterns
|
||||
5. Write tests alongside code
|
||||
6. Run tests continuously
|
||||
7. Commit working code incrementally
|
||||
8. Validate all EXPECTED deliverables
|
||||
9. Report results
|
||||
|
||||
**Use For**: Feature implementation, bug fixes, refactoring
|
||||
|
||||
### MODE: write
|
||||
|
||||
**Permissions**:
|
||||
- Focused file operations
|
||||
- Create/modify specific files
|
||||
- Run tests for validation
|
||||
|
||||
**Execute**:
|
||||
1. Analyze CONTEXT files
|
||||
2. Make targeted changes
|
||||
3. Validate tests pass
|
||||
4. Report file changes
|
||||
|
||||
**Use For**: Test generation, documentation updates, targeted fixes
|
||||
|
||||
## RULES Processing
|
||||
|
||||
- **Parse the RULES field** to identify template content and additional constraints
|
||||
- **Recognize `|` as separator** between template and additional constraints
|
||||
- **ALWAYS apply all template guidelines** provided in the prompt
|
||||
- **ALWAYS apply all additional constraints** specified after `|`
|
||||
- **Treat all rules as mandatory** - both template and constraints must be followed
|
||||
- **Failure to follow any rule** constitutes task failure
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Three-Attempt Rule
|
||||
|
||||
**On 3rd failed attempt**:
|
||||
1. **Stop execution**
|
||||
2. **Report status**: What was attempted, what failed, root cause
|
||||
3. **Request guidance**: Ask for clarification, suggest alternatives
|
||||
|
||||
### Recovery Strategies
|
||||
|
||||
**Syntax/Type Errors**:
|
||||
1. Review and fix errors
|
||||
2. Re-run tests
|
||||
3. Validate build succeeds
|
||||
|
||||
**Runtime Errors**:
|
||||
1. Analyze stack trace
|
||||
2. Add error handling
|
||||
3. Add tests for error cases
|
||||
|
||||
**Test Failures**:
|
||||
1. Debug in isolation
|
||||
2. Review test setup
|
||||
3. Fix implementation or test
|
||||
|
||||
**Build Failures**:
|
||||
1. Check error messages
|
||||
2. Fix incrementally
|
||||
3. Validate each fix
|
||||
|
||||
## Progress Reporting
|
||||
|
||||
### During Execution
|
||||
|
||||
```
|
||||
[1/5] Analyzing existing code patterns...
|
||||
[2/5] Planning implementation approach...
|
||||
[3/5] Generating code...
|
||||
[4/5] Writing tests...
|
||||
[5/5] Running validation...
|
||||
```
|
||||
|
||||
### On Success
|
||||
|
||||
```
|
||||
✅ Task completed
|
||||
|
||||
Changes:
|
||||
- Created: [files with line counts]
|
||||
- Modified: [files with changes]
|
||||
|
||||
Validation:
|
||||
✅ Tests: [count] passing
|
||||
✅ Coverage: [percentage]
|
||||
✅ Build: Success
|
||||
|
||||
Next Steps: [recommendations]
|
||||
```
|
||||
|
||||
### On Partial Completion
|
||||
|
||||
```
|
||||
⚠️ Task partially completed
|
||||
|
||||
Completed: [what worked]
|
||||
Blocked: [what failed and why]
|
||||
Required: [what's needed]
|
||||
Recommendation: [next steps]
|
||||
```
|
||||
|
||||
## Quality Standards
|
||||
|
||||
### Code Quality
|
||||
- Follow project's existing patterns
|
||||
- Match import style and naming conventions
|
||||
- Single responsibility per function/class
|
||||
- DRY (Don't Repeat Yourself)
|
||||
- YAGNI (You Aren't Gonna Need It)
|
||||
|
||||
### Testing
|
||||
- Test all public functions
|
||||
- Test edge cases and error conditions
|
||||
- Mock external dependencies
|
||||
- Target 80%+ coverage
|
||||
|
||||
### Error Handling
|
||||
- Proper try-catch blocks
|
||||
- Clear error messages
|
||||
- Graceful degradation
|
||||
- Don't expose sensitive info
|
||||
|
||||
## Philosophy
|
||||
|
||||
- **Incremental progress over big bangs** - Small, testable changes
|
||||
- **Learning from existing code** - Study 3+ patterns before implementing
|
||||
- **Pragmatic over dogmatic** - Adapt to project reality
|
||||
- **Clear intent over clever code** - Boring, obvious solutions
|
||||
- **Simple over complex** - Avoid over-engineering
|
||||
- **Follow existing style** - Match project patterns exactly
|
||||
|
||||
## Execution Checklist
|
||||
|
||||
### Before Implementation
|
||||
- [ ] Understand PURPOSE and TASK clearly
|
||||
- [ ] Review all CONTEXT files
|
||||
- [ ] Find 3+ similar patterns in codebase
|
||||
- [ ] Check RULES templates and constraints
|
||||
- [ ] Plan implementation approach
|
||||
|
||||
### During Implementation
|
||||
- [ ] Follow existing patterns exactly
|
||||
- [ ] Write tests alongside code
|
||||
- [ ] Run tests after every change
|
||||
- [ ] Commit working code incrementally
|
||||
- [ ] Handle errors properly
|
||||
|
||||
### After Implementation
|
||||
- [ ] Run full test suite - all pass
|
||||
- [ ] Check coverage - meets target
|
||||
- [ ] Run build - succeeds
|
||||
- [ ] Review EXPECTED - all deliverables met
|
||||
|
||||
---
|
||||
|
||||
**Version**: 2.0.0
|
||||
**Last Updated**: 2025-10-02
|
||||
143
.gemini/GEMINI.md
Normal file
143
.gemini/GEMINI.md
Normal file
@@ -0,0 +1,143 @@
|
||||
# Gemini Execution Protocol
|
||||
|
||||
## Overview
|
||||
|
||||
**Role**: Gemini - code analysis and documentation generation
|
||||
|
||||
## Prompt Structure
|
||||
|
||||
**Receive prompts in this format**:
|
||||
|
||||
```
|
||||
PURPOSE: [goal statement]
|
||||
TASK: [specific task]
|
||||
MODE: [analysis|write]
|
||||
CONTEXT: [file patterns]
|
||||
EXPECTED: [deliverables]
|
||||
RULES: [constraints and templates]
|
||||
```
|
||||
|
||||
## Execution Requirements
|
||||
|
||||
### ALWAYS
|
||||
|
||||
- **Parse all six fields** - Understand PURPOSE, TASK, MODE, CONTEXT, EXPECTED, RULES
|
||||
- **Follow MODE strictly** - Respect permission boundaries
|
||||
- **Analyze CONTEXT files** - Read all matching patterns thoroughly
|
||||
- **Apply RULES** - Follow templates and constraints exactly
|
||||
- **Provide evidence** - Quote code with file:line references
|
||||
- **Match EXPECTED** - Deliver exactly what's requested
|
||||
|
||||
### NEVER
|
||||
|
||||
- **Assume behavior** - Verify with actual code
|
||||
- **Ignore CONTEXT** - Stay within specified file patterns
|
||||
- **Skip RULES** - Templates are mandatory when provided
|
||||
- **Make unsubstantiated claims** - Always back with code references
|
||||
- **Deviate from MODE** - Respect read/write boundaries
|
||||
|
||||
## MODE Behavior
|
||||
|
||||
### MODE: analysis (default)
|
||||
|
||||
**Permissions**:
|
||||
- Read all CONTEXT files
|
||||
- Create/modify documentation files
|
||||
|
||||
**Execute**:
|
||||
1. Read and analyze CONTEXT files
|
||||
2. Identify patterns and issues
|
||||
3. Generate insights and recommendations
|
||||
4. Create documentation if needed
|
||||
5. Output structured analysis
|
||||
|
||||
**Constraint**: Do NOT modify source code files
|
||||
|
||||
### MODE: write
|
||||
|
||||
**Permissions**:
|
||||
- Full file operations
|
||||
- Create/modify any files
|
||||
|
||||
**Execute**:
|
||||
1. Read CONTEXT files
|
||||
2. Perform requested file operations
|
||||
3. Create/modify files as specified
|
||||
4. Validate changes
|
||||
5. Report file changes
|
||||
|
||||
## Output Format
|
||||
|
||||
### Standard Analysis Structure
|
||||
|
||||
```markdown
|
||||
# Analysis: [TASK Title]
|
||||
|
||||
## Summary
|
||||
[2-3 sentence overview]
|
||||
|
||||
## Key Findings
|
||||
1. [Finding] - path/to/file:123
|
||||
2. [Finding] - path/to/file:456
|
||||
|
||||
## Detailed Analysis
|
||||
[Evidence-based analysis with code quotes]
|
||||
|
||||
## Recommendations
|
||||
1. [Actionable recommendation]
|
||||
2. [Actionable recommendation]
|
||||
```
|
||||
|
||||
### Code References
|
||||
|
||||
Always use format: `path/to/file:line_number`
|
||||
|
||||
Example: "Authentication logic at `src/auth/jwt.ts:45` uses deprecated algorithm"
|
||||
|
||||
## RULES Processing
|
||||
|
||||
- **Parse the RULES field** to identify template content and additional constraints
|
||||
- **Recognize `|` as separator** between template and additional constraints
|
||||
- **ALWAYS apply all template guidelines** provided in the prompt
|
||||
- **ALWAYS apply all additional constraints** specified after `|`
|
||||
- **Treat all rules as mandatory** - both template and constraints must be followed
|
||||
- **Failure to follow any rule** constitutes task failure
|
||||
|
||||
## Error Handling
|
||||
|
||||
**File Not Found**:
|
||||
- Report missing files
|
||||
- Continue with available files
|
||||
- Note in output
|
||||
|
||||
**Invalid CONTEXT Pattern**:
|
||||
- Report invalid pattern
|
||||
- Request correction
|
||||
- Do not guess
|
||||
|
||||
## Quality Standards
|
||||
|
||||
### Thoroughness
|
||||
- Analyze ALL files in CONTEXT
|
||||
- Check cross-file patterns
|
||||
- Identify edge cases
|
||||
- Quantify when possible
|
||||
|
||||
### Evidence-Based
|
||||
- Quote relevant code
|
||||
- Provide file:line references
|
||||
- Link related patterns
|
||||
|
||||
### Actionable
|
||||
- Clear recommendations
|
||||
- Prioritized by impact
|
||||
- Specific, not vague
|
||||
|
||||
## Philosophy
|
||||
|
||||
- **Incremental over big bangs** - Suggest small, testable changes
|
||||
- **Learn from existing code** - Reference project patterns
|
||||
- **Pragmatic over dogmatic** - Adapt to project reality
|
||||
- **Clear over clever** - Prefer obvious solutions
|
||||
- **Simple over complex** - Avoid over-engineering
|
||||
|
||||
@@ -156,22 +156,34 @@ function Test-Prerequisites {
|
||||
Write-ColorOutput "Current version: $($PSVersionTable.PSVersion)" $ColorError
|
||||
return $false
|
||||
}
|
||||
|
||||
|
||||
# Test source files exist
|
||||
$sourceDir = $PSScriptRoot
|
||||
$claudeDir = Join-Path $sourceDir ".claude"
|
||||
$claudeMd = Join-Path $sourceDir "CLAUDE.md"
|
||||
|
||||
$codexDir = Join-Path $sourceDir ".codex"
|
||||
$geminiDir = Join-Path $sourceDir ".gemini"
|
||||
|
||||
if (-not (Test-Path $claudeDir)) {
|
||||
Write-ColorOutput "ERROR: .claude directory not found in $sourceDir" $ColorError
|
||||
return $false
|
||||
}
|
||||
|
||||
|
||||
if (-not (Test-Path $claudeMd)) {
|
||||
Write-ColorOutput "ERROR: CLAUDE.md file not found in $sourceDir" $ColorError
|
||||
return $false
|
||||
}
|
||||
|
||||
|
||||
if (-not (Test-Path $codexDir)) {
|
||||
Write-ColorOutput "ERROR: .codex directory not found in $sourceDir" $ColorError
|
||||
return $false
|
||||
}
|
||||
|
||||
if (-not (Test-Path $geminiDir)) {
|
||||
Write-ColorOutput "ERROR: .gemini directory not found in $sourceDir" $ColorError
|
||||
return $false
|
||||
}
|
||||
|
||||
Write-ColorOutput "Prerequisites check passed" $ColorSuccess
|
||||
return $true
|
||||
}
|
||||
@@ -617,6 +629,8 @@ function Install-Global {
|
||||
$userProfile = [Environment]::GetFolderPath("UserProfile")
|
||||
$globalClaudeDir = Join-Path $userProfile ".claude"
|
||||
$globalClaudeMd = Join-Path $globalClaudeDir "CLAUDE.md"
|
||||
$globalCodexDir = Join-Path $userProfile ".codex"
|
||||
$globalGeminiDir = Join-Path $userProfile ".gemini"
|
||||
|
||||
Write-ColorOutput "Global installation path: $userProfile" $ColorInfo
|
||||
|
||||
@@ -624,12 +638,23 @@ function Install-Global {
|
||||
$sourceDir = $PSScriptRoot
|
||||
$sourceClaudeDir = Join-Path $sourceDir ".claude"
|
||||
$sourceClaudeMd = Join-Path $sourceDir "CLAUDE.md"
|
||||
$sourceCodexDir = Join-Path $sourceDir ".codex"
|
||||
$sourceGeminiDir = Join-Path $sourceDir ".gemini"
|
||||
|
||||
# Create backup folder if needed (default behavior unless NoBackup is specified)
|
||||
$backupFolder = $null
|
||||
if (-not $NoBackup) {
|
||||
if (Test-Path $globalClaudeDir) {
|
||||
$existingFiles = Get-ChildItem $globalClaudeDir -Recurse -File -ErrorAction SilentlyContinue
|
||||
if ((Test-Path $globalClaudeDir) -or (Test-Path $globalCodexDir) -or (Test-Path $globalGeminiDir)) {
|
||||
$existingFiles = @()
|
||||
if (Test-Path $globalClaudeDir) {
|
||||
$existingFiles += Get-ChildItem $globalClaudeDir -Recurse -File -ErrorAction SilentlyContinue
|
||||
}
|
||||
if (Test-Path $globalCodexDir) {
|
||||
$existingFiles += Get-ChildItem $globalCodexDir -Recurse -File -ErrorAction SilentlyContinue
|
||||
}
|
||||
if (Test-Path $globalGeminiDir) {
|
||||
$existingFiles += Get-ChildItem $globalGeminiDir -Recurse -File -ErrorAction SilentlyContinue
|
||||
}
|
||||
if (($existingFiles -and ($existingFiles | Measure-Object).Count -gt 0)) {
|
||||
$backupFolder = Get-BackupDirectory -TargetDirectory $userProfile
|
||||
Write-ColorOutput "Backup folder created: $backupFolder" $ColorInfo
|
||||
@@ -649,6 +674,14 @@ function Install-Global {
|
||||
Write-ColorOutput "Installing CLAUDE.md to global .claude directory..." $ColorInfo
|
||||
$claudeMdInstalled = Copy-FileToDestination -Source $sourceClaudeMd -Destination $globalClaudeMd -Description "CLAUDE.md" -BackupFolder $backupFolder
|
||||
|
||||
# Merge .codex directory contents
|
||||
Write-ColorOutput "Merging .codex directory contents..." $ColorInfo
|
||||
$codexMerged = Merge-DirectoryContents -Source $sourceCodexDir -Destination $globalCodexDir -Description ".codex directory contents" -BackupFolder $backupFolder
|
||||
|
||||
# Merge .gemini directory contents
|
||||
Write-ColorOutput "Merging .gemini directory contents..." $ColorInfo
|
||||
$geminiMerged = Merge-DirectoryContents -Source $sourceGeminiDir -Destination $globalGeminiDir -Description ".gemini directory contents" -BackupFolder $backupFolder
|
||||
|
||||
if ($backupFolder -and (Test-Path $backupFolder)) {
|
||||
$backupFiles = Get-ChildItem $backupFolder -Recurse -File -ErrorAction SilentlyContinue
|
||||
if (-not $backupFiles -or ($backupFiles | Measure-Object).Count -eq 0) {
|
||||
@@ -679,14 +712,18 @@ function Install-Path {
|
||||
$sourceDir = $PSScriptRoot
|
||||
$sourceClaudeDir = Join-Path $sourceDir ".claude"
|
||||
$sourceClaudeMd = Join-Path $sourceDir "CLAUDE.md"
|
||||
$sourceCodexDir = Join-Path $sourceDir ".codex"
|
||||
$sourceGeminiDir = Join-Path $sourceDir ".gemini"
|
||||
|
||||
# Local paths - only for agents, commands, output-styles
|
||||
# Local paths - for agents, commands, output-styles, .codex, .gemini
|
||||
$localClaudeDir = Join-Path $TargetDirectory ".claude"
|
||||
$localCodexDir = Join-Path $TargetDirectory ".codex"
|
||||
$localGeminiDir = Join-Path $TargetDirectory ".gemini"
|
||||
|
||||
# Create backup folder if needed
|
||||
$backupFolder = $null
|
||||
if (-not $NoBackup) {
|
||||
if ((Test-Path $localClaudeDir) -or (Test-Path $globalClaudeDir)) {
|
||||
if ((Test-Path $localClaudeDir) -or (Test-Path $localCodexDir) -or (Test-Path $localGeminiDir) -or (Test-Path $globalClaudeDir)) {
|
||||
$backupFolder = Get-BackupDirectory -TargetDirectory $TargetDirectory
|
||||
Write-ColorOutput "Backup folder created: $backupFolder" $ColorInfo
|
||||
}
|
||||
@@ -774,6 +811,14 @@ function Install-Path {
|
||||
Write-ColorOutput "Installing CLAUDE.md to global .claude directory..." $ColorInfo
|
||||
Copy-FileToDestination -Source $sourceClaudeMd -Destination $globalClaudeMd -Description "CLAUDE.md" -BackupFolder $backupFolder
|
||||
|
||||
# Merge .codex directory contents to local location
|
||||
Write-ColorOutput "Merging .codex directory contents to local location..." $ColorInfo
|
||||
$codexMerged = Merge-DirectoryContents -Source $sourceCodexDir -Destination $localCodexDir -Description ".codex directory contents" -BackupFolder $backupFolder
|
||||
|
||||
# Merge .gemini directory contents to local location
|
||||
Write-ColorOutput "Merging .gemini directory contents to local location..." $ColorInfo
|
||||
$geminiMerged = Merge-DirectoryContents -Source $sourceGeminiDir -Destination $localGeminiDir -Description ".gemini directory contents" -BackupFolder $backupFolder
|
||||
|
||||
if ($backupFolder -and (Test-Path $backupFolder)) {
|
||||
$backupFiles = Get-ChildItem $backupFolder -Recurse -File -ErrorAction SilentlyContinue
|
||||
if (-not $backupFiles -or ($backupFiles | Measure-Object).Count -eq 0) {
|
||||
@@ -879,10 +924,11 @@ function Show-Summary {
|
||||
if ($Mode -eq "Path") {
|
||||
Write-Host " Local Path: $Path"
|
||||
Write-Host " Global Path: $([Environment]::GetFolderPath('UserProfile'))"
|
||||
Write-Host " Local Components: agents, commands, output-styles"
|
||||
Write-Host " Local Components: agents, commands, output-styles, .codex, .gemini"
|
||||
Write-Host " Global Components: workflows, scripts, python_script, etc."
|
||||
} else {
|
||||
Write-Host " Path: $Path"
|
||||
Write-Host " Global Components: .claude, .codex, .gemini"
|
||||
}
|
||||
|
||||
if ($NoBackup) {
|
||||
@@ -896,10 +942,12 @@ function Show-Summary {
|
||||
Write-Host ""
|
||||
Write-ColorOutput "Next steps:" $ColorInfo
|
||||
Write-Host "1. Review CLAUDE.md - Customize guidelines for your project"
|
||||
Write-Host "2. Configure settings - Edit .claude/settings.local.json as needed"
|
||||
Write-Host "3. Start using Claude Code with Agent workflow coordination!"
|
||||
Write-Host "4. Use /workflow commands for task execution"
|
||||
Write-Host "5. Use /update-memory commands for memory system management"
|
||||
Write-Host "2. Review .codex/Agent.md - Codex agent execution protocol"
|
||||
Write-Host "3. Review .gemini/CLAUDE.md - Gemini agent execution protocol"
|
||||
Write-Host "4. Configure settings - Edit .claude/settings.local.json as needed"
|
||||
Write-Host "5. Start using Claude Code with Agent workflow coordination!"
|
||||
Write-Host "6. Use /workflow commands for task execution"
|
||||
Write-Host "7. Use /update-memory commands for memory system management"
|
||||
|
||||
Write-Host ""
|
||||
Write-ColorOutput "Documentation: https://github.com/catlog22/Claude-CCW" $ColorInfo
|
||||
|
||||
@@ -97,6 +97,8 @@ function test_prerequisites() {
|
||||
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
local claude_dir="$script_dir/.claude"
|
||||
local claude_md="$script_dir/CLAUDE.md"
|
||||
local codex_dir="$script_dir/.codex"
|
||||
local gemini_dir="$script_dir/.gemini"
|
||||
|
||||
if [ ! -d "$claude_dir" ]; then
|
||||
write_color "ERROR: .claude directory not found in $script_dir" "$COLOR_ERROR"
|
||||
@@ -108,6 +110,16 @@ function test_prerequisites() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$codex_dir" ]; then
|
||||
write_color "ERROR: .codex directory not found in $script_dir" "$COLOR_ERROR"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$gemini_dir" ]; then
|
||||
write_color "ERROR: .gemini directory not found in $script_dir" "$COLOR_ERROR"
|
||||
return 1
|
||||
fi
|
||||
|
||||
write_color "✓ Prerequisites check passed" "$COLOR_SUCCESS"
|
||||
return 0
|
||||
}
|
||||
@@ -389,6 +401,8 @@ function install_global() {
|
||||
local user_home="$HOME"
|
||||
local global_claude_dir="${user_home}/.claude"
|
||||
local global_claude_md="${global_claude_dir}/CLAUDE.md"
|
||||
local global_codex_dir="${user_home}/.codex"
|
||||
local global_gemini_dir="${user_home}/.gemini"
|
||||
|
||||
write_color "Global installation path: $user_home" "$COLOR_INFO"
|
||||
|
||||
@@ -396,14 +410,25 @@ function install_global() {
|
||||
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
local source_claude_dir="${script_dir}/.claude"
|
||||
local source_claude_md="${script_dir}/CLAUDE.md"
|
||||
local source_codex_dir="${script_dir}/.codex"
|
||||
local source_gemini_dir="${script_dir}/.gemini"
|
||||
|
||||
# Create backup folder if needed
|
||||
local backup_folder=""
|
||||
if [ "$NO_BACKUP" = false ]; then
|
||||
local has_existing_files=false
|
||||
|
||||
if [ -d "$global_claude_dir" ] && [ "$(ls -A "$global_claude_dir" 2>/dev/null)" ]; then
|
||||
backup_folder=$(get_backup_directory "$user_home")
|
||||
write_color "Backup folder created: $backup_folder" "$COLOR_INFO"
|
||||
has_existing_files=true
|
||||
elif [ -d "$global_codex_dir" ] && [ "$(ls -A "$global_codex_dir" 2>/dev/null)" ]; then
|
||||
has_existing_files=true
|
||||
elif [ -d "$global_gemini_dir" ] && [ "$(ls -A "$global_gemini_dir" 2>/dev/null)" ]; then
|
||||
has_existing_files=true
|
||||
elif [ -f "$global_claude_md" ]; then
|
||||
has_existing_files=true
|
||||
fi
|
||||
|
||||
if [ "$has_existing_files" = true ]; then
|
||||
backup_folder=$(get_backup_directory "$user_home")
|
||||
write_color "Backup folder created: $backup_folder" "$COLOR_INFO"
|
||||
fi
|
||||
@@ -417,6 +442,14 @@ function install_global() {
|
||||
write_color "Installing CLAUDE.md to global .claude directory..." "$COLOR_INFO"
|
||||
copy_file_to_destination "$source_claude_md" "$global_claude_md" "CLAUDE.md" "$backup_folder"
|
||||
|
||||
# Merge .codex directory contents
|
||||
write_color "Merging .codex directory contents..." "$COLOR_INFO"
|
||||
merge_directory_contents "$source_codex_dir" "$global_codex_dir" ".codex directory contents" "$backup_folder"
|
||||
|
||||
# Merge .gemini directory contents
|
||||
write_color "Merging .gemini directory contents..." "$COLOR_INFO"
|
||||
merge_directory_contents "$source_gemini_dir" "$global_gemini_dir" ".gemini directory contents" "$backup_folder"
|
||||
|
||||
# Remove empty backup folder
|
||||
if [ -n "$backup_folder" ] && [ -d "$backup_folder" ]; then
|
||||
if [ -z "$(ls -A "$backup_folder" 2>/dev/null)" ]; then
|
||||
@@ -442,14 +475,18 @@ function install_path() {
|
||||
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
local source_claude_dir="${script_dir}/.claude"
|
||||
local source_claude_md="${script_dir}/CLAUDE.md"
|
||||
local source_codex_dir="${script_dir}/.codex"
|
||||
local source_gemini_dir="${script_dir}/.gemini"
|
||||
|
||||
# Local paths
|
||||
local local_claude_dir="${target_dir}/.claude"
|
||||
local local_codex_dir="${target_dir}/.codex"
|
||||
local local_gemini_dir="${target_dir}/.gemini"
|
||||
|
||||
# Create backup folder if needed
|
||||
local backup_folder=""
|
||||
if [ "$NO_BACKUP" = false ]; then
|
||||
if [ -d "$local_claude_dir" ] || [ -d "$global_claude_dir" ]; then
|
||||
if [ -d "$local_claude_dir" ] || [ -d "$local_codex_dir" ] || [ -d "$local_gemini_dir" ] || [ -d "$global_claude_dir" ]; then
|
||||
backup_folder=$(get_backup_directory "$target_dir")
|
||||
write_color "Backup folder created: $backup_folder" "$COLOR_INFO"
|
||||
fi
|
||||
@@ -530,6 +567,14 @@ function install_path() {
|
||||
write_color "Installing CLAUDE.md to global .claude directory..." "$COLOR_INFO"
|
||||
copy_file_to_destination "$source_claude_md" "$global_claude_md" "CLAUDE.md" "$backup_folder"
|
||||
|
||||
# Merge .codex directory contents to local location
|
||||
write_color "Merging .codex directory contents to local location..." "$COLOR_INFO"
|
||||
merge_directory_contents "$source_codex_dir" "$local_codex_dir" ".codex directory contents" "$backup_folder"
|
||||
|
||||
# Merge .gemini directory contents to local location
|
||||
write_color "Merging .gemini directory contents to local location..." "$COLOR_INFO"
|
||||
merge_directory_contents "$source_gemini_dir" "$local_gemini_dir" ".gemini directory contents" "$backup_folder"
|
||||
|
||||
# Remove empty backup folder
|
||||
if [ -n "$backup_folder" ] && [ -d "$backup_folder" ]; then
|
||||
if [ -z "$(ls -A "$backup_folder" 2>/dev/null)" ]; then
|
||||
@@ -631,10 +676,11 @@ function show_summary() {
|
||||
if [ "$mode" = "Path" ]; then
|
||||
echo " Local Path: $path"
|
||||
echo " Global Path: $HOME"
|
||||
echo " Local Components: agents, commands, output-styles"
|
||||
echo " Local Components: agents, commands, output-styles, .codex, .gemini"
|
||||
echo " Global Components: workflows, scripts, python_script, etc."
|
||||
else
|
||||
echo " Path: $path"
|
||||
echo " Global Components: .claude, .codex, .gemini"
|
||||
fi
|
||||
|
||||
if [ "$NO_BACKUP" = true ]; then
|
||||
@@ -648,10 +694,12 @@ function show_summary() {
|
||||
echo ""
|
||||
write_color "Next steps:" "$COLOR_INFO"
|
||||
echo "1. Review CLAUDE.md - Customize guidelines for your project"
|
||||
echo "2. Configure settings - Edit .claude/settings.local.json as needed"
|
||||
echo "3. Start using Claude Code with Agent workflow coordination!"
|
||||
echo "4. Use /workflow commands for task execution"
|
||||
echo "5. Use /update-memory commands for memory system management"
|
||||
echo "2. Review .codex/Agent.md - Codex agent execution protocol"
|
||||
echo "3. Review .gemini/CLAUDE.md - Gemini agent execution protocol"
|
||||
echo "4. Configure settings - Edit .claude/settings.local.json as needed"
|
||||
echo "5. Start using Claude Code with Agent workflow coordination!"
|
||||
echo "6. Use /workflow commands for task execution"
|
||||
echo "7. Use /update-memory commands for memory system management"
|
||||
|
||||
echo ""
|
||||
write_color "Documentation: https://github.com/catlog22/Claude-Code-Workflow" "$COLOR_INFO"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 🚀 Claude Code Workflow (CCW): 下一代多智能体软件开发自动化框架
|
||||
|
||||
[](https://github.com/catlog22/Claude-Code-Workflow/releases)
|
||||
[](https://github.com/catlog22/Claude-Code-Workflow/releases)
|
||||
[](https://github.com/modelcontextprotocol)
|
||||
[](LICENSE)
|
||||
|
||||
|
||||
73
README.md
73
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](https://github.com/catlog22/Claude-Code-Workflow/releases)
|
||||
[](https://github.com/catlog22/Claude-Code-Workflow/releases)
|
||||
[](LICENSE)
|
||||
[]()
|
||||
[](https://github.com/modelcontextprotocol)
|
||||
@@ -15,9 +15,13 @@
|
||||
|
||||
**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.1.0** - TDD Workflow Support with Red-Green-Refactor cycle enforcement. See [CHANGELOG.md](CHANGELOG.md) for details.
|
||||
> **🎉 Latest: v3.2.0** - Simplified agent architecture with "Tests Are the Review" philosophy. See [CHANGELOG.md](CHANGELOG.md) for details.
|
||||
>
|
||||
> **v3.0.0**: Introduced **unified CLI command structure**. The `/cli:*` commands consolidate all tool interactions (Gemini, Qwen, Codex) using a `--tool` flag for selection.
|
||||
> **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
|
||||
|
||||
---
|
||||
|
||||
@@ -49,12 +53,59 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
|
||||
```
|
||||
|
||||
### **📋 Interactive Version Selection**
|
||||
|
||||
After running the installation command, you'll see an interactive menu with real-time version information:
|
||||
|
||||
```
|
||||
Detecting latest release and commits...
|
||||
Latest stable: v3.2.0 (2025-10-02 04:27 UTC)
|
||||
Latest commit: cdea58f (2025-10-02 08:15 UTC)
|
||||
|
||||
====================================================
|
||||
Version Selection Menu
|
||||
====================================================
|
||||
|
||||
1) Latest Stable Release (Recommended)
|
||||
|-- Version: v3.2.0
|
||||
|-- Released: 2025-10-02 04:27 UTC
|
||||
\-- Production-ready
|
||||
|
||||
2) Latest Development Version
|
||||
|-- Branch: main
|
||||
|-- Commit: cdea58f
|
||||
|-- Updated: 2025-10-02 08:15 UTC
|
||||
|-- Cutting-edge features
|
||||
\-- May contain experimental changes
|
||||
|
||||
3) Specific Release Version
|
||||
|-- Install a specific tagged release
|
||||
\-- Recent: v3.2.0, v3.1.0, v3.0.1
|
||||
|
||||
====================================================
|
||||
|
||||
Select version to install (1-3, default: 1):
|
||||
```
|
||||
|
||||
**Version Options:**
|
||||
- **Option 1 (Recommended)**: Latest stable release with verified production quality
|
||||
- **Option 2**: Latest development version from main branch with newest features
|
||||
- **Option 3**: Specific version tag for controlled deployments
|
||||
|
||||
> 💡 **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.
|
||||
|
||||
### **✅ Verify Installation**
|
||||
After installation, run the following command to ensure CCW is working:
|
||||
```bash
|
||||
/workflow:session:list
|
||||
```
|
||||
|
||||
> **📝 Important 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
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Getting Started
|
||||
@@ -117,6 +168,22 @@ After installation, run the following command to ensure CCW is working:
|
||||
/workflow:execute
|
||||
```
|
||||
|
||||
> **💡 When to Use Which Approach?**
|
||||
>
|
||||
> **Use `/workflow:plan` + `/workflow:execute` for:**
|
||||
> - Complex features requiring multiple modules (>3 modules)
|
||||
> - Tasks with multiple subtasks (>5 subtasks)
|
||||
> - Cross-cutting changes affecting architecture
|
||||
> - Features requiring coordination between components
|
||||
> - When you need structured planning and progress tracking
|
||||
>
|
||||
> **Use Claude Code directly for:**
|
||||
> - Simple, focused changes (single file or module)
|
||||
> - Quick bug fixes with clear solutions
|
||||
> - Documentation updates
|
||||
> - Code refactoring within one component
|
||||
> - Straightforward feature additions
|
||||
|
||||
**Code Analysis:**
|
||||
```bash
|
||||
# Deep codebase analysis
|
||||
|
||||
73
README_CN.md
73
README_CN.md
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](https://github.com/catlog22/Claude-Code-Workflow/releases)
|
||||
[](https://github.com/catlog22/Claude-Code-Workflow/releases)
|
||||
[](LICENSE)
|
||||
[]()
|
||||
[](https://github.com/modelcontextprotocol)
|
||||
@@ -15,9 +15,13 @@
|
||||
|
||||
**Claude Code Workflow (CCW)** 是一个新一代的多智能体自动化开发框架,通过智能工作流管理和自主执行来协调复杂的软件开发任务。
|
||||
|
||||
> **🎉 最新版本: v3.1.0** - TDD 工作流支持,包含 Red-Green-Refactor 循环强制执行。详见 [CHANGELOG.md](CHANGELOG.md)。
|
||||
> **🎉 最新版本: v3.2.0** - 采用"测试即审查"理念简化智能体架构。详见 [CHANGELOG.md](CHANGELOG.md)。
|
||||
>
|
||||
> **v3.0.0 版本**: 引入了**统一的 CLI 命令结构**。`/cli:*` 命令通过 `--tool` 标志整合了所有工具(Gemini, Qwen, Codex)的交互。
|
||||
> **v3.2.0 版本新特性**:
|
||||
> - 🔄 从 3 个智能体简化为 2 个核心智能体(`@code-developer`、`@test-fix-agent`)
|
||||
> - ✅ "测试即审查" - 测试通过 = 代码批准
|
||||
> - 🧪 增强的测试修复工作流,支持自动执行和修复
|
||||
> - 📦 交互式安装,包含版本选择菜单
|
||||
|
||||
---
|
||||
|
||||
@@ -49,12 +53,59 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
|
||||
```
|
||||
|
||||
### **📋 交互式版本选择**
|
||||
|
||||
运行安装命令后,您将看到包含实时版本信息的交互式菜单:
|
||||
|
||||
```
|
||||
正在检测最新版本和提交...
|
||||
最新稳定版: v3.2.0 (2025-10-02 04:27 UTC)
|
||||
最新提交: cdea58f (2025-10-02 08:15 UTC)
|
||||
|
||||
====================================================
|
||||
版本选择菜单
|
||||
====================================================
|
||||
|
||||
1) 最新稳定版(推荐)
|
||||
|-- 版本: v3.2.0
|
||||
|-- 发布时间: 2025-10-02 04:27 UTC
|
||||
\-- 生产就绪
|
||||
|
||||
2) 最新开发版
|
||||
|-- 分支: main
|
||||
|-- 提交: cdea58f
|
||||
|-- 更新时间: 2025-10-02 08:15 UTC
|
||||
|-- 最新功能
|
||||
\-- 可能包含实验性更改
|
||||
|
||||
3) 指定版本
|
||||
|-- 安装特定标签版本
|
||||
\-- 最近版本: v3.2.0, v3.1.0, v3.0.1
|
||||
|
||||
====================================================
|
||||
|
||||
选择要安装的版本 (1-3, 默认: 1):
|
||||
```
|
||||
|
||||
**版本选项:**
|
||||
- **选项 1(推荐)**:经过验证的最新稳定版本,生产环境可用
|
||||
- **选项 2**:来自 main 分支的最新开发版本,包含最新功能
|
||||
- **选项 3**:指定版本标签,用于受控部署
|
||||
|
||||
> 💡 **提示**:安装程序会自动从 GitHub 检测并显示最新的版本号和发布日期。只需按 Enter 键即可选择推荐的稳定版本。
|
||||
|
||||
### **✅ 验证安装**
|
||||
安装后,运行以下命令以确保 CCW 正常工作:
|
||||
```bash
|
||||
/workflow:session:list
|
||||
```
|
||||
|
||||
> **📝 重要说明:**
|
||||
> - 安装程序将自动安装/更新 `.codex/` 和 `.gemini/` 目录
|
||||
> - **全局模式**:安装到 `~/.codex` 和 `~/.gemini`
|
||||
> - **路径模式**:安装到指定目录(例如 `project/.codex`、`project/.gemini`)
|
||||
> - 安装前会自动备份现有文件
|
||||
|
||||
---
|
||||
|
||||
## 🚀 快速入门
|
||||
@@ -120,6 +171,22 @@ bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflo
|
||||
/workflow:execute
|
||||
```
|
||||
|
||||
> **💡 何时使用哪种方式?**
|
||||
>
|
||||
> **使用 `/workflow:plan` + `/workflow:execute` 适用于:**
|
||||
> - 需要多个模块的复杂功能(>3 个模块)
|
||||
> - 包含多个子任务的任务(>5 个子任务)
|
||||
> - 影响架构的横切变更
|
||||
> - 需要组件间协调的功能
|
||||
> - 需要结构化规划和进度跟踪时
|
||||
>
|
||||
> **直接使用 Claude Code 适用于:**
|
||||
> - 简单、聚焦的变更(单个文件或模块)
|
||||
> - 解决方案明确的快速 bug 修复
|
||||
> - 文档更新
|
||||
> - 单个组件内的代码重构
|
||||
> - 简单直接的功能添加
|
||||
|
||||
**代码分析:**
|
||||
```bash
|
||||
# 深度代码库分析
|
||||
|
||||
142
RELEASE_NOTES_v3.2.1.md
Normal file
142
RELEASE_NOTES_v3.2.1.md
Normal file
@@ -0,0 +1,142 @@
|
||||
# 🔧 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)
|
||||
@@ -1,16 +1,88 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Claude Code Workflow (CCW) - Remote Installation Script
|
||||
# One-liner remote installation for Claude Code Workflow system
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Claude Code Workflow (CCW) - Remote Installation Script
|
||||
|
||||
.DESCRIPTION
|
||||
One-liner remote installation for Claude Code Workflow system.
|
||||
Downloads and installs CCW from GitHub with flexible version selection.
|
||||
|
||||
.PARAMETER Version
|
||||
Installation version type:
|
||||
- "stable" (default): Latest stable release tag
|
||||
- "latest": Latest main branch (development version)
|
||||
- "branch": Install from specific branch
|
||||
|
||||
.PARAMETER Tag
|
||||
Specific release tag to install (e.g., "v3.2.0")
|
||||
Only used when Version is "stable"
|
||||
|
||||
.PARAMETER Branch
|
||||
Branch name to install from (default: "main")
|
||||
Only used when Version is "branch"
|
||||
|
||||
.PARAMETER Global
|
||||
Install to global user directory (~/.claude)
|
||||
|
||||
.PARAMETER Directory
|
||||
Install to custom directory
|
||||
|
||||
.PARAMETER Force
|
||||
Skip confirmation prompts
|
||||
|
||||
.PARAMETER NoBackup
|
||||
Skip backup of existing installation
|
||||
|
||||
.PARAMETER NonInteractive
|
||||
Run in non-interactive mode
|
||||
|
||||
.PARAMETER BackupAll
|
||||
Backup all files including git-ignored files
|
||||
|
||||
.EXAMPLE
|
||||
# Install latest stable release (recommended)
|
||||
.\install-remote.ps1
|
||||
|
||||
.EXAMPLE
|
||||
# Install specific stable version
|
||||
.\install-remote.ps1 -Version stable -Tag "v3.2.0"
|
||||
|
||||
.EXAMPLE
|
||||
# Install latest development version
|
||||
.\install-remote.ps1 -Version latest
|
||||
|
||||
.EXAMPLE
|
||||
# Install from specific branch
|
||||
.\install-remote.ps1 -Version branch -Branch "feature/new-feature"
|
||||
|
||||
.EXAMPLE
|
||||
# Install to global directory without prompts
|
||||
.\install-remote.ps1 -Global -Force
|
||||
|
||||
.LINK
|
||||
https://github.com/catlog22/Claude-Code-Workflow
|
||||
#>
|
||||
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[ValidateSet("stable", "latest", "branch")]
|
||||
[string]$Version = "stable",
|
||||
|
||||
[string]$Tag = "",
|
||||
|
||||
[string]$Branch = "main",
|
||||
|
||||
[switch]$Global,
|
||||
|
||||
[string]$Directory = "",
|
||||
|
||||
[switch]$Force,
|
||||
|
||||
[switch]$NoBackup,
|
||||
|
||||
[switch]$NonInteractive,
|
||||
[switch]$BackupAll,
|
||||
[string]$Branch = "main"
|
||||
|
||||
[switch]$BackupAll
|
||||
)
|
||||
|
||||
# Set encoding for proper Unicode support
|
||||
@@ -26,7 +98,7 @@ if ($PSVersionTable.PSVersion.Major -ge 6) {
|
||||
|
||||
# Script metadata
|
||||
$ScriptName = "Claude Code Workflow (CCW) Remote Installer"
|
||||
$Version = "2.1.1"
|
||||
$InstallerVersion = "2.2.0"
|
||||
|
||||
# Colors for output
|
||||
$ColorSuccess = "Green"
|
||||
@@ -43,7 +115,7 @@ function Write-ColorOutput {
|
||||
}
|
||||
|
||||
function Show-Header {
|
||||
Write-ColorOutput "==== $ScriptName v$Version ====" $ColorInfo
|
||||
Write-ColorOutput "==== $ScriptName v$InstallerVersion ====" $ColorInfo
|
||||
Write-ColorOutput "========================================================" $ColorInfo
|
||||
Write-Host ""
|
||||
}
|
||||
@@ -78,29 +150,70 @@ function Get-TempDirectory {
|
||||
return $tempDir
|
||||
}
|
||||
|
||||
function Get-LatestRelease {
|
||||
try {
|
||||
$apiUrl = "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest"
|
||||
$response = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing
|
||||
return $response.tag_name
|
||||
} catch {
|
||||
Write-ColorOutput "WARNING: Failed to fetch latest release, using 'main' branch" $ColorWarning
|
||||
return $null
|
||||
}
|
||||
}
|
||||
|
||||
function Download-Repository {
|
||||
param(
|
||||
[string]$TempDir,
|
||||
[string]$Branch = "main"
|
||||
[string]$Version = "stable",
|
||||
[string]$Branch = "main",
|
||||
[string]$Tag = ""
|
||||
)
|
||||
|
||||
|
||||
$repoUrl = "https://github.com/catlog22/Claude-Code-Workflow"
|
||||
$zipUrl = "$repoUrl/archive/refs/heads/$Branch.zip"
|
||||
|
||||
# Determine download URL based on version type
|
||||
if ($Version -eq "stable") {
|
||||
# Download latest stable release
|
||||
if ([string]::IsNullOrEmpty($Tag)) {
|
||||
$latestTag = Get-LatestRelease
|
||||
if ($latestTag) {
|
||||
$Tag = $latestTag
|
||||
} else {
|
||||
# Fallback to main branch if API fails
|
||||
$zipUrl = "$repoUrl/archive/refs/heads/main.zip"
|
||||
$downloadType = "main branch (fallback)"
|
||||
}
|
||||
}
|
||||
|
||||
if (-not [string]::IsNullOrEmpty($Tag)) {
|
||||
$zipUrl = "$repoUrl/archive/refs/tags/$Tag.zip"
|
||||
$downloadType = "stable release $Tag"
|
||||
}
|
||||
} elseif ($Version -eq "latest") {
|
||||
# Download latest main branch
|
||||
$zipUrl = "$repoUrl/archive/refs/heads/main.zip"
|
||||
$downloadType = "latest main branch"
|
||||
} else {
|
||||
# Download specific branch
|
||||
$zipUrl = "$repoUrl/archive/refs/heads/$Branch.zip"
|
||||
$downloadType = "branch $Branch"
|
||||
}
|
||||
|
||||
$zipPath = Join-Path $TempDir "repo.zip"
|
||||
|
||||
|
||||
Write-ColorOutput "Downloading from GitHub..." $ColorInfo
|
||||
Write-ColorOutput "Source: $repoUrl" $ColorInfo
|
||||
Write-ColorOutput "Branch: $Branch" $ColorInfo
|
||||
|
||||
Write-ColorOutput "Type: $downloadType" $ColorInfo
|
||||
|
||||
try {
|
||||
# Download with progress
|
||||
$progressPreference = $ProgressPreference
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
|
||||
Invoke-WebRequest -Uri $zipUrl -OutFile $zipPath -UseBasicParsing
|
||||
|
||||
|
||||
$ProgressPreference = $progressPreference
|
||||
|
||||
|
||||
if (Test-Path $zipPath) {
|
||||
$fileSize = (Get-Item $zipPath).Length
|
||||
Write-ColorOutput "Download complete ($([math]::Round($fileSize/1024/1024, 2)) MB)" $ColorSuccess
|
||||
@@ -225,29 +338,200 @@ function Wait-ForUserConfirmation {
|
||||
}
|
||||
}
|
||||
|
||||
function Show-VersionMenu {
|
||||
param(
|
||||
[string]$LatestStableVersion = "Detecting...",
|
||||
[string]$LatestStableDate = "",
|
||||
[string]$LatestCommitId = "",
|
||||
[string]$LatestCommitDate = ""
|
||||
)
|
||||
|
||||
Write-Host ""
|
||||
Write-ColorOutput "====================================================" $ColorInfo
|
||||
Write-ColorOutput " Version Selection Menu" $ColorInfo
|
||||
Write-ColorOutput "====================================================" $ColorInfo
|
||||
Write-Host ""
|
||||
|
||||
# Option 1: Latest Stable
|
||||
Write-ColorOutput "1) Latest Stable Release (Recommended)" $ColorSuccess
|
||||
if ($LatestStableVersion -ne "Detecting..." -and $LatestStableVersion -ne "Unknown") {
|
||||
Write-Host " |-- Version: $LatestStableVersion"
|
||||
if ($LatestStableDate) {
|
||||
Write-Host " |-- Released: $LatestStableDate"
|
||||
}
|
||||
Write-Host " \-- Production-ready"
|
||||
} else {
|
||||
Write-Host " |-- Version: Auto-detected from GitHub"
|
||||
Write-Host " \-- Production-ready"
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
# Option 2: Latest Development
|
||||
Write-ColorOutput "2) Latest Development Version" $ColorWarning
|
||||
Write-Host " |-- Branch: main"
|
||||
if ($LatestCommitId -and $LatestCommitDate) {
|
||||
Write-Host " |-- Commit: $LatestCommitId"
|
||||
Write-Host " |-- Updated: $LatestCommitDate"
|
||||
}
|
||||
Write-Host " |-- Cutting-edge features"
|
||||
Write-Host " \-- May contain experimental changes"
|
||||
Write-Host ""
|
||||
|
||||
# Option 3: Specific Version
|
||||
Write-ColorOutput "3) Specific Release Version" $ColorInfo
|
||||
Write-Host " |-- Install a specific tagged release"
|
||||
Write-Host " \-- Recent: v3.2.0, v3.1.0, v3.0.1"
|
||||
Write-Host ""
|
||||
|
||||
Write-ColorOutput "====================================================" $ColorInfo
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
function Get-UserVersionChoice {
|
||||
if ($NonInteractive -or $Force) {
|
||||
# Non-interactive mode: use default stable version
|
||||
return @{
|
||||
Type = "stable"
|
||||
Tag = $Tag
|
||||
Branch = $Branch
|
||||
}
|
||||
}
|
||||
|
||||
# Detect latest stable version and commit info
|
||||
Write-ColorOutput "Detecting latest release and commits..." $ColorInfo
|
||||
$latestVersion = "Unknown"
|
||||
$latestStableDate = ""
|
||||
$latestCommitId = ""
|
||||
$latestCommitDate = ""
|
||||
|
||||
try {
|
||||
# Get latest release info
|
||||
$apiUrl = "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest"
|
||||
$response = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing -TimeoutSec 5
|
||||
$latestVersion = $response.tag_name
|
||||
|
||||
# Parse and format release date
|
||||
if ($response.published_at) {
|
||||
$publishDate = [DateTime]::Parse($response.published_at)
|
||||
$latestStableDate = $publishDate.ToString("yyyy-MM-dd HH:mm UTC")
|
||||
}
|
||||
|
||||
Write-ColorOutput "Latest stable: $latestVersion ($latestStableDate)" $ColorSuccess
|
||||
} catch {
|
||||
Write-ColorOutput "Could not detect latest release" $ColorWarning
|
||||
}
|
||||
|
||||
try {
|
||||
# Get latest commit info from main branch
|
||||
$commitUrl = "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main"
|
||||
$commitResponse = Invoke-RestMethod -Uri $commitUrl -UseBasicParsing -TimeoutSec 5
|
||||
$latestCommitId = $commitResponse.sha.Substring(0, 7)
|
||||
|
||||
# Parse and format commit date
|
||||
if ($commitResponse.commit.committer.date) {
|
||||
$commitDate = [DateTime]::Parse($commitResponse.commit.committer.date)
|
||||
$latestCommitDate = $commitDate.ToString("yyyy-MM-dd HH:mm UTC")
|
||||
}
|
||||
|
||||
Write-ColorOutput "Latest commit: $latestCommitId ($latestCommitDate)" $ColorSuccess
|
||||
} catch {
|
||||
Write-ColorOutput "Could not detect latest commit" $ColorWarning
|
||||
}
|
||||
|
||||
Show-VersionMenu -LatestStableVersion $latestVersion -LatestStableDate $latestStableDate -LatestCommitId $latestCommitId -LatestCommitDate $latestCommitDate
|
||||
|
||||
$choice = Read-Host "Select version to install (1-3, default: 1)"
|
||||
|
||||
switch ($choice) {
|
||||
"2" {
|
||||
Write-Host ""
|
||||
Write-ColorOutput "✓ Selected: Latest Development Version (main branch)" $ColorSuccess
|
||||
return @{
|
||||
Type = "latest"
|
||||
Tag = ""
|
||||
Branch = "main"
|
||||
}
|
||||
}
|
||||
"3" {
|
||||
Write-Host ""
|
||||
Write-ColorOutput "Available recent releases:" $ColorInfo
|
||||
Write-Host " v3.2.0, v3.1.0, v3.0.1, v3.0.0"
|
||||
Write-Host ""
|
||||
$tagInput = Read-Host "Enter version tag (e.g., v3.2.0)"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($tagInput)) {
|
||||
Write-ColorOutput "No tag specified, using latest stable" $ColorWarning
|
||||
return @{
|
||||
Type = "stable"
|
||||
Tag = ""
|
||||
Branch = "main"
|
||||
}
|
||||
}
|
||||
|
||||
Write-ColorOutput "✓ Selected: Specific Version $tagInput" $ColorSuccess
|
||||
return @{
|
||||
Type = "stable"
|
||||
Tag = $tagInput
|
||||
Branch = "main"
|
||||
}
|
||||
}
|
||||
default {
|
||||
Write-Host ""
|
||||
if ($latestVersion -ne "Unknown") {
|
||||
Write-ColorOutput "✓ Selected: Latest Stable Release ($latestVersion)" $ColorSuccess
|
||||
} else {
|
||||
Write-ColorOutput "✓ Selected: Latest Stable Release (auto-detect)" $ColorSuccess
|
||||
}
|
||||
return @{
|
||||
Type = "stable"
|
||||
Tag = ""
|
||||
Branch = "main"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Main {
|
||||
Show-Header
|
||||
|
||||
|
||||
Write-ColorOutput "This will download and install Claude Code Workflow System from GitHub." $ColorInfo
|
||||
Write-Host ""
|
||||
|
||||
|
||||
# Test prerequisites
|
||||
Write-ColorOutput "Checking system requirements..." $ColorInfo
|
||||
if (-not (Test-Prerequisites)) {
|
||||
Wait-ForUserConfirmation "System check failed! Press any key to exit..." -ExitAfter
|
||||
}
|
||||
|
||||
|
||||
# Get version choice from user (interactive menu)
|
||||
$versionChoice = Get-UserVersionChoice
|
||||
$script:Version = $versionChoice.Type
|
||||
$script:Tag = $versionChoice.Tag
|
||||
$script:Branch = $versionChoice.Branch
|
||||
|
||||
# Determine version information for display
|
||||
$versionInfo = switch ($Version) {
|
||||
"stable" {
|
||||
if ($Tag) { "Stable release: $Tag" }
|
||||
else { "Latest stable release (auto-detected)" }
|
||||
}
|
||||
"latest" { "Latest main branch (development)" }
|
||||
"branch" { "Custom branch: $Branch" }
|
||||
}
|
||||
|
||||
# Confirm installation
|
||||
if (-not $NonInteractive -and -not $Force) {
|
||||
Write-Host ""
|
||||
Write-ColorOutput "SECURITY NOTE:" $ColorWarning
|
||||
Write-Host "- This script will download and execute Claude Code Workflow from GitHub"
|
||||
Write-Host "- Repository: https://github.com/catlog22/Claude-Code-Workflow"
|
||||
Write-Host "- Branch: $Branch (latest stable version)"
|
||||
Write-ColorOutput "INSTALLATION DETAILS:" $ColorInfo
|
||||
Write-Host "- Repository: https://github.com/catlog22/Claude-Code-Workflow"
|
||||
Write-Host "- Version: $versionInfo"
|
||||
Write-Host "- Features: Intelligent workflow orchestration with multi-agent coordination"
|
||||
Write-Host ""
|
||||
Write-ColorOutput "SECURITY NOTE:" $ColorWarning
|
||||
Write-Host "- This script will download and execute code from GitHub"
|
||||
Write-Host "- Please ensure you trust this source"
|
||||
Write-Host ""
|
||||
|
||||
|
||||
$choice = Read-Host "Continue with installation? (y/N)"
|
||||
if ($choice -notmatch '^[Yy]') {
|
||||
Write-ColorOutput "Installation cancelled" $ColorWarning
|
||||
@@ -261,7 +545,7 @@ function Main {
|
||||
|
||||
try {
|
||||
# Download repository
|
||||
$zipPath = Download-Repository $tempDir $Branch
|
||||
$zipPath = Download-Repository -TempDir $tempDir -Version $Version -Branch $Branch -Tag $Tag
|
||||
if (-not $zipPath) {
|
||||
throw "Download failed"
|
||||
}
|
||||
|
||||
@@ -6,9 +6,13 @@ set -e # Exit on error
|
||||
|
||||
# Script metadata
|
||||
SCRIPT_NAME="Claude Code Workflow (CCW) Remote Installer"
|
||||
VERSION="2.1.1"
|
||||
INSTALLER_VERSION="2.2.0"
|
||||
BRANCH="${BRANCH:-main}"
|
||||
|
||||
# Version control
|
||||
VERSION_TYPE="${VERSION_TYPE:-stable}" # stable, latest, branch
|
||||
TAG_VERSION=""
|
||||
|
||||
# Colors for output
|
||||
COLOR_RESET='\033[0m'
|
||||
COLOR_SUCCESS='\033[0;32m'
|
||||
@@ -32,7 +36,7 @@ function write_color() {
|
||||
}
|
||||
|
||||
function show_header() {
|
||||
write_color "==== $SCRIPT_NAME v$VERSION ====" "$COLOR_INFO"
|
||||
write_color "==== $SCRIPT_NAME v$INSTALLER_VERSION ====" "$COLOR_INFO"
|
||||
write_color "========================================================" "$COLOR_INFO"
|
||||
echo ""
|
||||
}
|
||||
@@ -72,17 +76,80 @@ function get_temp_directory() {
|
||||
echo "$temp_dir"
|
||||
}
|
||||
|
||||
function get_latest_release() {
|
||||
local api_url="https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest"
|
||||
|
||||
if command -v jq &> /dev/null; then
|
||||
# Use jq if available
|
||||
local tag
|
||||
tag=$(curl -fsSL "$api_url" 2>/dev/null | jq -r '.tag_name' 2>/dev/null)
|
||||
if [ -n "$tag" ] && [ "$tag" != "null" ]; then
|
||||
echo "$tag"
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
# Fallback: parse JSON with grep/sed
|
||||
local tag
|
||||
tag=$(curl -fsSL "$api_url" 2>/dev/null | grep -o '"tag_name":\s*"[^"]*"' | sed 's/"tag_name":\s*"\([^"]*\)"/\1/')
|
||||
if [ -n "$tag" ]; then
|
||||
echo "$tag"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
write_color "WARNING: Failed to fetch latest release, using 'main' branch" "$COLOR_WARNING" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
function download_repository() {
|
||||
local temp_dir="$1"
|
||||
local branch="${2:-main}"
|
||||
local version_type="${2:-stable}"
|
||||
local branch="${3:-main}"
|
||||
local tag="${4:-}"
|
||||
local repo_url="https://github.com/catlog22/Claude-Code-Workflow"
|
||||
local zip_url="${repo_url}/archive/refs/heads/${branch}.zip"
|
||||
local zip_url=""
|
||||
local download_type=""
|
||||
|
||||
# Determine download URL based on version type
|
||||
case "$version_type" in
|
||||
stable)
|
||||
# Download latest stable release
|
||||
if [ -z "$tag" ]; then
|
||||
tag=$(get_latest_release)
|
||||
if [ -z "$tag" ]; then
|
||||
# Fallback to main branch if API fails
|
||||
zip_url="${repo_url}/archive/refs/heads/main.zip"
|
||||
download_type="main branch (fallback)"
|
||||
else
|
||||
zip_url="${repo_url}/archive/refs/tags/${tag}.zip"
|
||||
download_type="stable release $tag"
|
||||
fi
|
||||
else
|
||||
zip_url="${repo_url}/archive/refs/tags/${tag}.zip"
|
||||
download_type="stable release $tag"
|
||||
fi
|
||||
;;
|
||||
latest)
|
||||
# Download latest main branch
|
||||
zip_url="${repo_url}/archive/refs/heads/main.zip"
|
||||
download_type="latest main branch"
|
||||
;;
|
||||
branch)
|
||||
# Download specific branch
|
||||
zip_url="${repo_url}/archive/refs/heads/${branch}.zip"
|
||||
download_type="branch $branch"
|
||||
;;
|
||||
*)
|
||||
write_color "ERROR: Invalid version type: $version_type" "$COLOR_ERROR" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local zip_path="${temp_dir}/repo.zip"
|
||||
|
||||
write_color "Downloading from GitHub..." "$COLOR_INFO" >&2
|
||||
write_color "Source: $repo_url" "$COLOR_INFO" >&2
|
||||
write_color "Branch: $branch" "$COLOR_INFO" >&2
|
||||
write_color "URL: $zip_url" "$COLOR_INFO" >&2
|
||||
write_color "Type: $download_type" "$COLOR_INFO" >&2
|
||||
|
||||
# Download with curl
|
||||
if curl -fsSL -o "$zip_path" "$zip_url" 2>&1 >&2; then
|
||||
@@ -217,6 +284,23 @@ function wait_for_user() {
|
||||
function parse_arguments() {
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--version)
|
||||
VERSION_TYPE="$2"
|
||||
if [[ ! "$VERSION_TYPE" =~ ^(stable|latest|branch)$ ]]; then
|
||||
write_color "ERROR: Invalid version type: $VERSION_TYPE" "$COLOR_ERROR"
|
||||
write_color "Valid options: stable, latest, branch" "$COLOR_ERROR"
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
--tag)
|
||||
TAG_VERSION="$2"
|
||||
shift 2
|
||||
;;
|
||||
--branch)
|
||||
BRANCH="$2"
|
||||
shift 2
|
||||
;;
|
||||
--global)
|
||||
INSTALL_GLOBAL=true
|
||||
shift
|
||||
@@ -241,10 +325,6 @@ function parse_arguments() {
|
||||
BACKUP_ALL=true
|
||||
shift
|
||||
;;
|
||||
--branch)
|
||||
BRANCH="$2"
|
||||
shift 2
|
||||
;;
|
||||
--help)
|
||||
show_help
|
||||
exit 0
|
||||
@@ -260,33 +340,208 @@ function parse_arguments() {
|
||||
|
||||
function show_help() {
|
||||
cat << EOF
|
||||
$SCRIPT_NAME v$VERSION
|
||||
$SCRIPT_NAME v$INSTALLER_VERSION
|
||||
|
||||
Usage: $0 [OPTIONS]
|
||||
|
||||
Options:
|
||||
Version Options:
|
||||
--version TYPE Version type: stable (default), latest, or branch
|
||||
--tag TAG Specific release tag (e.g., v3.2.0) - for stable version
|
||||
--branch BRANCH Branch name (default: main) - for branch version
|
||||
|
||||
Installation Options:
|
||||
--global Install to global user directory (~/.claude)
|
||||
--directory DIR Install to custom directory
|
||||
--force Force installation without prompts
|
||||
--no-backup Skip backup creation
|
||||
--non-interactive Non-interactive mode (no prompts)
|
||||
--backup-all Backup all files before installation
|
||||
--branch BRANCH Specify GitHub branch (default: main)
|
||||
--help Show this help message
|
||||
|
||||
Examples:
|
||||
# Interactive installation
|
||||
# Install latest stable release (recommended)
|
||||
$0
|
||||
|
||||
# Install specific stable version
|
||||
$0 --version stable --tag v3.2.0
|
||||
|
||||
# Install latest development version
|
||||
$0 --version latest
|
||||
|
||||
# Install from specific branch
|
||||
$0 --version branch --branch feature/new-feature
|
||||
|
||||
# Global installation without prompts
|
||||
$0 --global --non-interactive
|
||||
|
||||
# Custom directory installation
|
||||
$0 --directory /opt/claude-code-workflow
|
||||
|
||||
Repository: https://github.com/catlog22/Claude-Code-Workflow
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
function show_version_menu() {
|
||||
local latest_version="$1"
|
||||
local latest_date="$2"
|
||||
local commit_id="$3"
|
||||
local commit_date="$4"
|
||||
|
||||
echo ""
|
||||
write_color "====================================================" "$COLOR_INFO"
|
||||
write_color " Version Selection Menu" "$COLOR_INFO"
|
||||
write_color "====================================================" "$COLOR_INFO"
|
||||
echo ""
|
||||
|
||||
# Option 1: Latest Stable
|
||||
write_color "1) Latest Stable Release (Recommended)" "$COLOR_SUCCESS"
|
||||
if [ -n "$latest_version" ] && [ "$latest_version" != "Unknown" ]; then
|
||||
echo " |-- Version: $latest_version"
|
||||
if [ -n "$latest_date" ]; then
|
||||
echo " |-- Released: $latest_date"
|
||||
fi
|
||||
echo " \-- Production-ready"
|
||||
else
|
||||
echo " |-- Version: Auto-detected from GitHub"
|
||||
echo " \-- Production-ready"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Option 2: Latest Development
|
||||
write_color "2) Latest Development Version" "$COLOR_WARNING"
|
||||
echo " |-- Branch: main"
|
||||
if [ -n "$commit_id" ] && [ -n "$commit_date" ]; then
|
||||
echo " |-- Commit: $commit_id"
|
||||
echo " |-- Updated: $commit_date"
|
||||
fi
|
||||
echo " |-- Cutting-edge features"
|
||||
echo " \-- May contain experimental changes"
|
||||
echo ""
|
||||
|
||||
# Option 3: Specific Version
|
||||
write_color "3) Specific Release Version" "$COLOR_INFO"
|
||||
echo " |-- Install a specific tagged release"
|
||||
echo " \-- Recent: v3.2.0, v3.1.0, v3.0.1"
|
||||
echo ""
|
||||
|
||||
write_color "====================================================" "$COLOR_INFO"
|
||||
echo ""
|
||||
}
|
||||
|
||||
function get_user_version_choice() {
|
||||
if [ "$NON_INTERACTIVE" = true ] || [ "$FORCE" = true ]; then
|
||||
# Non-interactive mode: use default stable version
|
||||
echo "stable"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Detect latest stable version and commit info
|
||||
write_color "Detecting latest release and commits..." "$COLOR_INFO"
|
||||
local latest_version="Unknown"
|
||||
local latest_date=""
|
||||
local commit_id=""
|
||||
local commit_date=""
|
||||
|
||||
# Get latest release info
|
||||
local release_data
|
||||
release_data=$(curl -fsSL --connect-timeout 5 "https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2>/dev/null)
|
||||
|
||||
if [ -n "$release_data" ]; then
|
||||
if command -v jq &> /dev/null; then
|
||||
latest_version=$(echo "$release_data" | jq -r '.tag_name' 2>/dev/null)
|
||||
local published_at=$(echo "$release_data" | jq -r '.published_at' 2>/dev/null)
|
||||
if [ -n "$published_at" ] && [ "$published_at" != "null" ]; then
|
||||
# Format: 2025-10-02T04:27:21Z -> 2025-10-02 04:27 UTC
|
||||
latest_date=$(echo "$published_at" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
||||
fi
|
||||
else
|
||||
latest_version=$(echo "$release_data" | grep -o '"tag_name":\s*"[^"]*"' | sed 's/"tag_name":\s*"\([^"]*\)"/\1/')
|
||||
local published_at=$(echo "$release_data" | grep -o '"published_at":\s*"[^"]*"' | sed 's/"published_at":\s*"\([^"]*\)"/\1/')
|
||||
if [ -n "$published_at" ]; then
|
||||
latest_date=$(echo "$published_at" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$latest_version" ] && [ "$latest_version" != "null" ] && [ "$latest_version" != "Unknown" ]; then
|
||||
write_color "Latest stable: $latest_version ($latest_date)" "$COLOR_SUCCESS"
|
||||
else
|
||||
latest_version="Unknown"
|
||||
write_color "Could not detect latest release" "$COLOR_WARNING"
|
||||
fi
|
||||
|
||||
# Get latest commit info
|
||||
local commit_data
|
||||
commit_data=$(curl -fsSL --connect-timeout 5 "https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2>/dev/null)
|
||||
|
||||
if [ -n "$commit_data" ]; then
|
||||
if command -v jq &> /dev/null; then
|
||||
commit_id=$(echo "$commit_data" | jq -r '.sha' 2>/dev/null | cut -c1-7)
|
||||
local committer_date=$(echo "$commit_data" | jq -r '.commit.committer.date' 2>/dev/null)
|
||||
if [ -n "$committer_date" ] && [ "$committer_date" != "null" ]; then
|
||||
commit_date=$(echo "$committer_date" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
||||
fi
|
||||
else
|
||||
commit_id=$(echo "$commit_data" | grep -o '"sha":\s*"[^"]*"' | head -1 | sed 's/"sha":\s*"\([^"]*\)"/\1/' | cut -c1-7)
|
||||
local committer_date=$(echo "$commit_data" | grep -o '"date":\s*"[^"]*"' | head -1 | sed 's/"date":\s*"\([^"]*\)"/\1/')
|
||||
if [ -n "$committer_date" ]; then
|
||||
commit_date=$(echo "$committer_date" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$commit_id" ] && [ -n "$commit_date" ]; then
|
||||
write_color "Latest commit: $commit_id ($commit_date)" "$COLOR_SUCCESS"
|
||||
else
|
||||
write_color "Could not detect latest commit" "$COLOR_WARNING"
|
||||
fi
|
||||
|
||||
show_version_menu "$latest_version" "$latest_date" "$commit_id" "$commit_date"
|
||||
|
||||
read -p "Select version to install (1-3, default: 1): " choice
|
||||
|
||||
case "$choice" in
|
||||
2)
|
||||
echo ""
|
||||
write_color "✓ Selected: Latest Development Version (main branch)" "$COLOR_SUCCESS"
|
||||
VERSION_TYPE="latest"
|
||||
TAG_VERSION=""
|
||||
BRANCH="main"
|
||||
;;
|
||||
3)
|
||||
echo ""
|
||||
write_color "Available recent releases:" "$COLOR_INFO"
|
||||
echo " v3.2.0, v3.1.0, v3.0.1, v3.0.0"
|
||||
echo ""
|
||||
read -p "Enter version tag (e.g., v3.2.0): " tag_input
|
||||
|
||||
if [ -z "$tag_input" ]; then
|
||||
write_color "⚠ No tag specified, using latest stable" "$COLOR_WARNING"
|
||||
VERSION_TYPE="stable"
|
||||
TAG_VERSION=""
|
||||
else
|
||||
echo ""
|
||||
write_color "✓ Selected: Specific Version $tag_input" "$COLOR_SUCCESS"
|
||||
VERSION_TYPE="stable"
|
||||
TAG_VERSION="$tag_input"
|
||||
fi
|
||||
BRANCH="main"
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
if [ "$latest_version" != "Unknown" ]; then
|
||||
write_color "✓ Selected: Latest Stable Release ($latest_version)" "$COLOR_SUCCESS"
|
||||
else
|
||||
write_color "✓ Selected: Latest Stable Release (auto-detect)" "$COLOR_SUCCESS"
|
||||
fi
|
||||
VERSION_TYPE="stable"
|
||||
TAG_VERSION=""
|
||||
BRANCH="main"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function main() {
|
||||
show_header
|
||||
|
||||
@@ -300,14 +555,37 @@ function main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get version choice from user (interactive menu)
|
||||
get_user_version_choice
|
||||
|
||||
# Determine version information for display
|
||||
local version_info=""
|
||||
case "$VERSION_TYPE" in
|
||||
stable)
|
||||
if [ -n "$TAG_VERSION" ]; then
|
||||
version_info="Stable release: $TAG_VERSION"
|
||||
else
|
||||
version_info="Latest stable release (auto-detected)"
|
||||
fi
|
||||
;;
|
||||
latest)
|
||||
version_info="Latest main branch (development)"
|
||||
;;
|
||||
branch)
|
||||
version_info="Custom branch: $BRANCH"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Confirm installation
|
||||
if [ "$NON_INTERACTIVE" != true ] && [ "$FORCE" != true ]; then
|
||||
echo ""
|
||||
write_color "SECURITY NOTE:" "$COLOR_WARNING"
|
||||
echo "- This script will download and execute Claude Code Workflow from GitHub"
|
||||
write_color "INSTALLATION DETAILS:" "$COLOR_INFO"
|
||||
echo "- Repository: https://github.com/catlog22/Claude-Code-Workflow"
|
||||
echo "- Branch: $BRANCH (latest stable version)"
|
||||
echo "- Version: $version_info"
|
||||
echo "- Features: Intelligent workflow orchestration with multi-agent coordination"
|
||||
echo ""
|
||||
write_color "SECURITY NOTE:" "$COLOR_WARNING"
|
||||
echo "- This script will download and execute code from GitHub"
|
||||
echo "- Please ensure you trust this source"
|
||||
echo ""
|
||||
|
||||
@@ -328,7 +606,7 @@ function main() {
|
||||
# Download repository
|
||||
local zip_path
|
||||
write_color "Starting download process..." "$COLOR_INFO"
|
||||
zip_path=$(download_repository "$temp_dir" "$BRANCH")
|
||||
zip_path=$(download_repository "$temp_dir" "$VERSION_TYPE" "$BRANCH" "$TAG_VERSION")
|
||||
local download_status=$?
|
||||
|
||||
if [ $download_status -eq 0 ] && [ -n "$zip_path" ] && [ -f "$zip_path" ]; then
|
||||
|
||||
Reference in New Issue
Block a user