-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-ccdk-i124q.py
More file actions
523 lines (426 loc) · 20.4 KB
/
Copy pathinstall-ccdk-i124q.py
File metadata and controls
523 lines (426 loc) · 20.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
#!/usr/bin/env python3
"""
CCDK i124q - Professional Installation Script
Complete installer for the ultimate Claude Code enhancement toolkit
"""
import os
import sys
import subprocess
import shutil
import json
import urllib.request
from pathlib import Path
import tempfile
class CCDKi124qInstaller:
def __init__(self):
self.home_dir = Path.home()
self.claude_dir = self.home_dir / '.claude'
self.install_dir = Path.cwd()
self.components_installed = []
self.errors = []
def print_banner(self):
"""Display installation banner"""
banner = """
╔══════════════════════════════════════════════════════════════╗
║ ║
║ 🚀 CCDK i124q - Enhanced Claude Code Development Kit ║
║ ║
║ The Ultimate Claude Code Enhancement Toolkit ║
║ Integrating: CCDK + SuperClaude + ThinkChain + Templates ║
║ ║
╚══════════════════════════════════════════════════════════════╝
🎯 What you'll get:
• 37+ Integrated capabilities across 4 frameworks
• 11 AI personas with intelligent auto-activation
• Real-time thinking streams and tool discovery
• Professional analytics dashboards
• Complete development toolkit for Claude Code
🔧 Installation starting...
"""
print(banner)
def check_prerequisites(self):
"""Check system prerequisites"""
print("🔍 Checking prerequisites...")
# Check Python version
python_version = sys.version_info
if python_version < (3, 8):
self.errors.append("Python 3.8 or higher required")
return False
# Check for required tools
required_tools = ['git', 'npm', 'pip3']
missing_tools = []
for tool in required_tools:
if not shutil.which(tool):
missing_tools.append(tool)
if missing_tools:
self.errors.append(f"Missing required tools: {', '.join(missing_tools)}")
return False
print("✅ Prerequisites met")
return True
def create_directory_structure(self):
"""Create CCDK i124q directory structure"""
print("📁 Creating directory structure...")
try:
# Create main .claude directory
self.claude_dir.mkdir(exist_ok=True)
# Create subdirectories for each system
directories = [
'.claude/commands',
'.claude/agents',
'.claude/hooks',
'.claude/logs',
'.claude/superclaude/commands',
'.claude/superclaude/core',
'.claude/thinkchain/tools',
'.claude/templates'
]
for dir_path in directories:
(self.home_dir / dir_path).mkdir(parents=True, exist_ok=True)
print("✅ Directory structure created")
return True
except Exception as e:
self.errors.append(f"Directory creation failed: {e}")
return False
def install_python_dependencies(self):
"""Install all required Python packages"""
print("🐍 Installing Python dependencies...")
packages = [
'flask>=2.0.0',
'playwright>=1.0.0',
'anthropic>=0.25.0',
'requests>=2.25.0',
'rich>=13.0.0',
'prompt-toolkit>=3.0.0',
'beautifulsoup4',
'pydantic>=2.0.0',
'sseclient-py',
'python-dotenv',
'validators'
]
try:
for package in packages:
print(f" Installing {package}...")
subprocess.run([sys.executable, '-m', 'pip', 'install', package],
check=True, capture_output=True)
print("✅ Python dependencies installed")
return True
except subprocess.CalledProcessError as e:
self.errors.append(f"Python package installation failed: {e}")
return False
def install_superclaude_framework(self):
"""Install SuperClaude Framework"""
print("🎭 Installing SuperClaude Framework...")
try:
# Install SuperClaude from PyPI
subprocess.run([sys.executable, '-m', 'pip', 'install', 'SuperClaude'],
check=True, capture_output=True)
# Copy SuperClaude files to .claude directory
import SuperClaude
sc_path = Path(SuperClaude.__file__).parent
# Copy core files
core_files = ['PERSONAS.md', 'COMMANDS.md', 'RULES.md', 'PRINCIPLES.md']
for file_name in core_files:
src_file = sc_path / 'Core' / file_name
if src_file.exists():
shutil.copy2(src_file, self.claude_dir / 'superclaude' / 'core' / file_name)
# Copy command files
commands_dir = sc_path / 'Commands'
if commands_dir.exists():
for cmd_file in commands_dir.glob('*.md'):
shutil.copy2(cmd_file, self.claude_dir / 'superclaude' / 'commands' / cmd_file.name)
self.components_installed.append('SuperClaude Framework')
print("✅ SuperClaude Framework installed")
return True
except Exception as e:
self.errors.append(f"SuperClaude installation failed: {e}")
return False
def install_thinkchain_tools(self):
"""Install ThinkChain tools and components"""
print("⚡ Installing ThinkChain components...")
try:
# Clone ThinkChain repository
with tempfile.TemporaryDirectory() as temp_dir:
subprocess.run(['git', 'clone', 'https://github.com/martinbowling/thinkchain.git', temp_dir],
check=True, capture_output=True)
# Copy tools
tools_src = Path(temp_dir) / 'tools'
tools_dest = self.claude_dir / 'thinkchain' / 'tools'
if tools_src.exists():
shutil.copytree(tools_src, tools_dest, dirs_exist_ok=True)
# Copy configuration files
config_files = ['tool_discovery.py', 'ui_components.py', 'mcp_config.json', 'mcp_integration.py']
for config_file in config_files:
src_file = Path(temp_dir) / config_file
if src_file.exists():
shutil.copy2(src_file, self.claude_dir / 'thinkchain' / config_file)
self.components_installed.append('ThinkChain Engine')
print("✅ ThinkChain components installed")
return True
except Exception as e:
self.errors.append(f"ThinkChain installation failed: {e}")
return False
def install_templates_cli(self):
"""Install claude-code-templates CLI"""
print("📊 Installing Templates CLI...")
try:
subprocess.run(['npm', 'install', '-g', 'claude-code-templates@latest'],
check=True, capture_output=True)
self.components_installed.append('Templates CLI')
print("✅ Templates CLI installed")
return True
except subprocess.CalledProcessError as e:
self.errors.append(f"Templates CLI installation failed: {e}")
return False
def create_unified_configuration(self):
"""Create unified configuration files"""
print("⚙️ Creating unified configuration...")
try:
# Main CLAUDE.md configuration
claude_md_content = """# CCDK i124q - Enhanced Claude Code Development Kit
## System Overview
CCDK i124q represents the ultimate Claude Code enhancement toolkit, combining the proven CCDK foundation with community innovations.
## Core Identity: Enhanced CCDK with Multi-Framework Integration
- **CCDK Foundation**: 3-tier documentation system, hook framework, Task Master AI
- **SuperClaude Enhancement**: 16 specialized commands, 11 AI personas, advanced MCP integration
- **ThinkChain Power**: Real-time thinking streams, dynamic tool discovery, advanced CLI
- **Templates Analytics**: Professional dashboard, health checks, component library
- **Unified Experience**: Seamless integration preserving CCDK identity while adding community power
## Command Categories
### CCDK Original Commands (Preserved)
- `/full-context` - Comprehensive context gathering
- `/code-review` - Multi-perspective analysis
- `/create-docs` - CCDK documentation generation
- `/update-docs` - Documentation synchronization
- `/refactor` - Intelligent restructuring
### SuperClaude Enhanced Commands (sc: namespace)
- `/sc:implement` - Feature implementation with persona activation
- `/sc:analyze` - Comprehensive analysis with multiple domains
- `/sc:task` - Advanced task management with persistence
- `/sc:build` - Build and compilation with optimization
- `/sc:design` - Design systems and architecture
- And 11 more specialized commands...
## AI Persona System
Intelligent expertise routing with 11 specialized personas:
- 🏗️ **architect** - Systems design and scalability
- 🎭 **frontend** - UI/UX and accessibility
- ⚙️ **backend** - APIs and infrastructure reliability
- 🔍 **analyzer** - Root cause analysis and investigation
- 🛡️ **security** - Threat modeling and compliance
- ✍️ **scribe** - Professional documentation
- And 5 more domain specialists...
Auto-activation based on context analysis with manual override capabilities.
## Integration Philosophy
This unified system maintains CCDK's beloved 3-tier documentation and foundational principles while adding community innovations for enhanced development workflows.
## Dashboard Access
- **Port 4000**: 🌟 Unified Dashboard (main interface)
- **Port 5005**: 📈 Enhanced Analytics Dashboard
- **Port 7000**: 🌐 Enhanced WebUI with all systems
- **Port 3333**: 📊 Templates Analytics Dashboard
## Usage Patterns
- Use CCDK commands for core development workflows
- Use SuperClaude commands (sc:) for specialized expert tasks
- Personas activate automatically or can be manually specified
- ThinkChain tools provide advanced streaming capabilities
- All systems work together harmoniously
This represents the evolution of CCDK into the most comprehensive Claude Code enhancement toolkit available.
"""
with open(self.claude_dir / 'CLAUDE.md', 'w') as f:
f.write(claude_md_content)
# Create settings configuration
settings_config = {
"version": "CCDK i124q",
"systems": {
"ccdk": {"enabled": True, "commands": "commands/"},
"superclaude": {"enabled": True, "commands": "superclaude/commands/"},
"thinkchain": {"enabled": True, "tools": "thinkchain/tools/"}
},
"dashboards": {
"unified": {"port": 4000, "enabled": True},
"analytics": {"port": 5005, "enabled": True},
"webui": {"port": 7000, "enabled": True},
"templates": {"port": 3333, "enabled": True}
},
"features": {
"ai_personas": True,
"real_time_thinking": True,
"tool_streaming": True,
"mcp_integration": True
}
}
with open(self.claude_dir / 'settings.json', 'w') as f:
json.dump(settings_config, f, indent=2)
print("✅ Unified configuration created")
return True
except Exception as e:
self.errors.append(f"Configuration creation failed: {e}")
return False
def install_dashboard_files(self):
"""Install enhanced dashboard files"""
print("🌐 Installing enhanced dashboard files...")
try:
# Note: In a real installation, these would be included in the package
# For now, we'll create basic versions
dashboard_info = """
# Dashboard Files Installation
The enhanced dashboard files (unified-dashboard.py, enhanced WebUI, etc.)
should be included with your CCDK i124q installation package.
If you're installing from source, ensure you have:
- unified-dashboard.py (port 4000)
- webui/app-enhanced.py (port 7000)
- dashboard/app-enhanced.py (port 5005)
These provide the complete dashboard ecosystem for CCDK i124q.
"""
with open(self.claude_dir / 'DASHBOARD-INFO.md', 'w') as f:
f.write(dashboard_info)
print("✅ Dashboard information created")
return True
except Exception as e:
self.errors.append(f"Dashboard installation failed: {e}")
return False
def run_post_install_checks(self):
"""Run post-installation verification"""
print("🔍 Running post-installation checks...")
checks_passed = 0
total_checks = 4
# Check 1: Directory structure
required_dirs = ['.claude', '.claude/superclaude', '.claude/thinkchain']
all_dirs_exist = all((self.home_dir / dir_path).exists() for dir_path in required_dirs)
if all_dirs_exist:
checks_passed += 1
print(" ✅ Directory structure")
else:
print(" ❌ Directory structure")
# Check 2: SuperClaude installation
try:
import SuperClaude
checks_passed += 1
print(" ✅ SuperClaude Framework")
except ImportError:
print(" ❌ SuperClaude Framework")
# Check 3: Templates CLI
templates_available = shutil.which('claude-code-templates') is not None
if templates_available:
checks_passed += 1
print(" ✅ Templates CLI")
else:
print(" ❌ Templates CLI")
# Check 4: Configuration files
config_exists = (self.claude_dir / 'CLAUDE.md').exists() and (self.claude_dir / 'settings.json').exists()
if config_exists:
checks_passed += 1
print(" ✅ Configuration files")
else:
print(" ❌ Configuration files")
success_rate = (checks_passed / total_checks) * 100
print(f"📊 Post-installation checks: {checks_passed}/{total_checks} passed ({success_rate:.1f}%)")
return checks_passed >= 3 # Require at least 75% success
def display_completion_summary(self, success):
"""Display installation completion summary"""
if success:
summary = f"""
╔══════════════════════════════════════════════════════════════╗
║ ║
║ 🎉 CCDK i124q Installation Completed Successfully! 🎉 ║
║ ║
╚══════════════════════════════════════════════════════════════╝
✅ Components Installed:
{chr(10).join(f' • {comp}' for comp in self.components_installed)}
🚀 What's Available Now:
• 37+ integrated capabilities across all systems
• 11 AI personas with intelligent auto-activation
• Real-time thinking streams and tool discovery
• Professional analytics and monitoring dashboards
• Complete unified Claude Code development toolkit
🌐 Dashboard Access (once running):
• Port 4000: 🌟 Unified Dashboard (main interface)
• Port 5005: 📈 Enhanced Analytics Dashboard
• Port 7000: 🌐 Enhanced WebUI with all systems
• Port 3333: 📊 Templates Analytics Dashboard
📚 Configuration Location:
• Main config: ~/.claude/CLAUDE.md
• Settings: ~/.claude/settings.json
• Commands: ~/.claude/commands/ and ~/.claude/superclaude/commands/
• Tools: ~/.claude/thinkchain/tools/
🎯 Next Steps:
1. Start using CCDK commands in Claude Code
2. Try SuperClaude commands with sc: prefix
3. Explore AI personas and ThinkChain tools
4. Launch dashboards for monitoring and analytics
Welcome to the ultimate Claude Code enhancement experience! 🚀
"""
else:
summary = f"""
╔══════════════════════════════════════════════════════════════╗
║ ║
║ ⚠️ CCDK i124q Installation Completed with Issues ║
║ ║
╚══════════════════════════════════════════════════════════════╝
❌ Errors encountered:
{chr(10).join(f' • {error}' for error in self.errors)}
✅ Successfully installed:
{chr(10).join(f' • {comp}' for comp in self.components_installed)}
🔧 Recommended actions:
1. Review the errors above
2. Check system prerequisites
3. Retry installation with --verbose flag
4. Check the installation log for details
For support, please check the CCDK i124q documentation or
create an issue in the project repository.
"""
print(summary)
def run_installation(self):
"""Run the complete installation process"""
self.print_banner()
success = True
# Installation steps
steps = [
("Prerequisites check", self.check_prerequisites),
("Directory structure", self.create_directory_structure),
("Python dependencies", self.install_python_dependencies),
("SuperClaude Framework", self.install_superclaude_framework),
("ThinkChain components", self.install_thinkchain_tools),
("Templates CLI", self.install_templates_cli),
("Unified configuration", self.create_unified_configuration),
("Dashboard files", self.install_dashboard_files),
("Post-install checks", self.run_post_install_checks)
]
for step_name, step_function in steps:
print(f"\n🔄 {step_name}...")
if not step_function():
print(f"❌ {step_name} failed")
success = False
# Continue with other steps even if one fails
else:
print(f"✅ {step_name} completed")
self.display_completion_summary(success)
return success
def main():
"""Main installation function"""
installer = CCDKi124qInstaller()
# Check for command line arguments
if len(sys.argv) > 1 and sys.argv[1] in ['--help', '-h']:
print("""
CCDK i124q Installer
Usage: python install-ccdk-i124q.py [options]
Options:
--help, -h Show this help message
--verbose Enable verbose output
--force Force installation even if components exist
This installer will set up the complete CCDK i124q system with:
- CCDK Foundation (3-tier docs, hooks, Task Master AI)
- SuperClaude Framework (16 commands, 11 AI personas)
- ThinkChain Engine (real-time streaming, tool discovery)
- Templates Analytics (professional dashboards)
""")
return
try:
success = installer.run_installation()
sys.exit(0 if success else 1)
except KeyboardInterrupt:
print("\n\n⚠️ Installation cancelled by user")
sys.exit(130)
except Exception as e:
print(f"\n❌ Unexpected error during installation: {e}")
sys.exit(1)
if __name__ == '__main__':
main()