mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
Initial release: Claude Code Workflow (CCW) v2.0
🚀 Revolutionary AI-powered development workflow orchestration system ## 🔥 Core Innovations - **Document-State Separation**: Markdown for planning, JSON for execution state - **Progressive Complexity Management**: Level 0-2 adaptive workflow depth - **5-Agent Orchestration**: Specialized AI agents with context preservation - **Session-First Architecture**: Auto-discovery and state inheritance ## 🏗️ Key Features - Intelligent workflow orchestration (Simple/Medium/Complex patterns) - Real-time document-state synchronization with conflict resolution - Hierarchical task management with 3-level JSON structure - Gemini CLI integration with 12+ specialized templates - Comprehensive file output generation for all workflow commands ## 📦 Installation Remote one-liner installation: ``` iex (iwr -useb https://raw.githubusercontent.com/catlog22/Claude-CCW/main/install-remote.ps1) ``` ## 🎯 System Architecture 4-layer intelligent development architecture: 1. Command Layer - Smart routing and version management 2. Agent Layer - 5 specialized development agents 3. Workflow Layer - Gemini templates and task orchestration 4. Memory Layer - Distributed documentation and auto-sync 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
309
install-remote.ps1
Normal file
309
install-remote.ps1
Normal file
@@ -0,0 +1,309 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Claude Code Workflow (CCW) - Remote Installation Script
|
||||
# One-liner remote installation for Claude Code Workflow system
|
||||
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[switch]$Global,
|
||||
[string]$Directory = "",
|
||||
[switch]$Force,
|
||||
[switch]$NoBackup,
|
||||
[switch]$NonInteractive,
|
||||
[switch]$BackupAll,
|
||||
[string]$Branch = "main"
|
||||
)
|
||||
|
||||
# Set encoding for proper Unicode support
|
||||
if ($PSVersionTable.PSVersion.Major -ge 6) {
|
||||
$OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
|
||||
} else {
|
||||
# Windows PowerShell 5.1
|
||||
$OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
chcp 65001 | Out-Null
|
||||
}
|
||||
|
||||
# Script metadata
|
||||
$ScriptName = "Claude Code Workflow (CCW) Remote Installer"
|
||||
$Version = "2.1.1"
|
||||
|
||||
# Colors for output
|
||||
$ColorSuccess = "Green"
|
||||
$ColorInfo = "Cyan"
|
||||
$ColorWarning = "Yellow"
|
||||
$ColorError = "Red"
|
||||
|
||||
function Write-ColorOutput {
|
||||
param(
|
||||
[string]$Message,
|
||||
[string]$Color = "White"
|
||||
)
|
||||
Write-Host $Message -ForegroundColor $Color
|
||||
}
|
||||
|
||||
function Show-Header {
|
||||
Write-ColorOutput "==== $ScriptName v$Version ====" $ColorInfo
|
||||
Write-ColorOutput "========================================================" $ColorInfo
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
function Test-Prerequisites {
|
||||
# Test PowerShell version
|
||||
if ($PSVersionTable.PSVersion.Major -lt 5) {
|
||||
Write-ColorOutput "ERROR: PowerShell 5.1 or higher is required" $ColorError
|
||||
Write-ColorOutput "Current version: $($PSVersionTable.PSVersion)" $ColorError
|
||||
return $false
|
||||
}
|
||||
|
||||
# Test internet connectivity
|
||||
try {
|
||||
$null = Invoke-WebRequest -Uri "https://github.com" -Method Head -TimeoutSec 10 -UseBasicParsing
|
||||
Write-ColorOutput "Network connection OK" $ColorSuccess
|
||||
} catch {
|
||||
Write-ColorOutput "ERROR: Cannot connect to GitHub" $ColorError
|
||||
Write-ColorOutput "Please check your network connection: $($_.Exception.Message)" $ColorError
|
||||
return $false
|
||||
}
|
||||
|
||||
return $true
|
||||
}
|
||||
|
||||
function Get-TempDirectory {
|
||||
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) "claude-code-workflow-install"
|
||||
if (Test-Path $tempDir) {
|
||||
Remove-Item -Path $tempDir -Recurse -Force
|
||||
}
|
||||
New-Item -Path $tempDir -ItemType Directory -Force | Out-Null
|
||||
return $tempDir
|
||||
}
|
||||
|
||||
function Download-Repository {
|
||||
param(
|
||||
[string]$TempDir,
|
||||
[string]$Branch = "main"
|
||||
)
|
||||
|
||||
$repoUrl = "https://github.com/catlog22/Claude-CCW"
|
||||
$zipUrl = "$repoUrl/archive/refs/heads/$Branch.zip"
|
||||
$zipPath = Join-Path $TempDir "repo.zip"
|
||||
|
||||
Write-ColorOutput "Downloading from GitHub..." $ColorInfo
|
||||
Write-ColorOutput "Source: $repoUrl" $ColorInfo
|
||||
Write-ColorOutput "Branch: $Branch" $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
|
||||
return $zipPath
|
||||
} else {
|
||||
throw "Downloaded file does not exist"
|
||||
}
|
||||
} catch {
|
||||
Write-ColorOutput "Download failed: $($_.Exception.Message)" $ColorError
|
||||
return $null
|
||||
}
|
||||
}
|
||||
|
||||
function Extract-Repository {
|
||||
param(
|
||||
[string]$ZipPath,
|
||||
[string]$TempDir
|
||||
)
|
||||
|
||||
Write-ColorOutput "Extracting files..." $ColorInfo
|
||||
|
||||
try {
|
||||
# Use .NET to extract zip
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory($ZipPath, $TempDir)
|
||||
|
||||
# Find the extracted directory (usually repo-name-branch)
|
||||
$extractedDirs = Get-ChildItem -Path $TempDir -Directory
|
||||
$repoDir = $extractedDirs | Where-Object { $_.Name -like "Claude-CCW-*" } | Select-Object -First 1
|
||||
|
||||
if ($repoDir) {
|
||||
Write-ColorOutput "Extraction complete: $($repoDir.FullName)" $ColorSuccess
|
||||
return $repoDir.FullName
|
||||
} else {
|
||||
throw "Could not find extracted repository directory"
|
||||
}
|
||||
} catch {
|
||||
Write-ColorOutput "Extraction failed: $($_.Exception.Message)" $ColorError
|
||||
return $null
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-LocalInstaller {
|
||||
param(
|
||||
[string]$RepoDir
|
||||
)
|
||||
|
||||
$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) {
|
||||
$params["InstallMode"] = "Custom"
|
||||
$params["TargetPath"] = $Directory
|
||||
}
|
||||
if ($Force) { $params["Force"] = $Force }
|
||||
if ($NoBackup) { $params["NoBackup"] = $NoBackup }
|
||||
if ($NonInteractive) { $params["NonInteractive"] = $NonInteractive }
|
||||
if ($BackupAll) { $params["BackupAll"] = $BackupAll }
|
||||
|
||||
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
|
||||
& $installerPath @params
|
||||
} else {
|
||||
Write-ColorOutput "Executing: & `"$installerPath`"" $ColorInfo
|
||||
& $installerPath
|
||||
}
|
||||
|
||||
Pop-Location
|
||||
return $true
|
||||
} catch {
|
||||
Pop-Location
|
||||
Write-ColorOutput "Installation script failed: $($_.Exception.Message)" $ColorError
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Cleanup-TempFiles {
|
||||
param(
|
||||
[string]$TempDir
|
||||
)
|
||||
|
||||
if (Test-Path $TempDir) {
|
||||
try {
|
||||
Remove-Item -Path $TempDir -Recurse -Force
|
||||
Write-ColorOutput "Temporary files cleaned up" $ColorInfo
|
||||
} catch {
|
||||
Write-ColorOutput "WARNING: Failed to clean temporary files: $($_.Exception.Message)" $ColorWarning
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Wait-ForUserConfirmation {
|
||||
param(
|
||||
[string]$Message = "Press any key to continue...",
|
||||
[switch]$ExitAfter
|
||||
)
|
||||
|
||||
if (-not $NonInteractive) {
|
||||
Write-Host ""
|
||||
Write-ColorOutput $Message $ColorInfo
|
||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
if ($ExitAfter) {
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
# 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-CCW"
|
||||
Write-Host "- Branch: $Branch (latest stable version)"
|
||||
Write-Host "- Features: Intelligent workflow orchestration with multi-agent coordination"
|
||||
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
|
||||
Wait-ForUserConfirmation -ExitAfter
|
||||
}
|
||||
}
|
||||
|
||||
# Create temp directory
|
||||
$tempDir = Get-TempDirectory
|
||||
Write-ColorOutput "Temporary directory: $tempDir" $ColorInfo
|
||||
|
||||
try {
|
||||
# Download repository
|
||||
$zipPath = Download-Repository $tempDir $Branch
|
||||
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
|
||||
if (-not $success) {
|
||||
throw "Installation script failed"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-ColorOutput "Remote installation completed successfully!" $ColorSuccess
|
||||
|
||||
} catch {
|
||||
Write-Host ""
|
||||
Write-ColorOutput "Remote installation failed: $($_.Exception.Message)" $ColorError
|
||||
Wait-ForUserConfirmation "Installation failed! Press any key to exit..." -ExitAfter
|
||||
} finally {
|
||||
# Cleanup
|
||||
Cleanup-TempFiles $tempDir
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-ColorOutput "Next steps:" $ColorInfo
|
||||
Write-Host "1. Review CLAUDE.md for project-specific guidelines"
|
||||
Write-Host "2. Try /workflow commands for Agent coordination"
|
||||
Write-Host "3. Use /update_dms to manage distributed documentation"
|
||||
|
||||
Wait-ForUserConfirmation "Remote installation done! Press any key to exit..." -ExitAfter
|
||||
}
|
||||
|
||||
# Run main function
|
||||
try {
|
||||
Main
|
||||
} catch {
|
||||
Write-ColorOutput "CRITICAL ERROR: $($_.Exception.Message)" $ColorError
|
||||
Write-Host ""
|
||||
Wait-ForUserConfirmation "A critical error occurred! Press any key to exit..." -ExitAfter
|
||||
}
|
||||
Reference in New Issue
Block a user