claude-comms 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.2] - 2025-08-15
9
+
10
+ ### Fixed
11
+ - **BREAKING**: Replaced mock implementations with real GitHubFetcher and FileWriter
12
+ - Integrated FrankPulse's path handling fixes for cross-platform compatibility
13
+ - Fixed dependency injection in `_createDependencies()` to use real implementations
14
+ - Enhanced installation flow to properly fetch from GitHub repository
15
+ - Fixed API interface compatibility between orchestrator and real modules
16
+
17
+ ### Added
18
+ - Integration smoke test for CI/CD validation
19
+ - Real GitHub API integration with rate limiting and retry logic
20
+ - Comprehensive file writer with backup and rollback capabilities
21
+ - End-to-end installation testing framework
22
+
23
+ ### Changed
24
+ - Default repository configuration now points to `screwyforcepush/claude-code-subagent-bus`
25
+ - Improved error handling and progress reporting during installation
26
+ - Enhanced logging and debugging output for troubleshooting
27
+
28
+ ### Technical Details
29
+ - GitHubFetcher now supports multi-strategy fetching (Trees API, Contents API, Raw URLs)
30
+ - FileWriter includes atomic operations, permissions handling, and validation
31
+ - Orchestrator properly coordinates real dependencies instead of mocks
32
+ - All 21+ files from .claude directory structure are now correctly installed
33
+
34
+ ## [1.0.1] - 2025-08-14
35
+
36
+ ### Added
37
+ - Initial mock implementation framework
38
+ - Orchestrator pattern with dependency injection
39
+ - CLI interface with comprehensive options
40
+ - Test suite with unit and integration tests
41
+
42
+ ### Fixed
43
+ - Basic installation workflow
44
+ - File structure validation
45
+
46
+ ## [1.0.0] - 2025-08-14
47
+
48
+ ### Added
49
+ - Initial release
50
+ - NPX installer for Claude Code hooks and observability setup
51
+ - Multi-agent orchestration framework
52
+ - GitHub integration for fetching setup files
53
+ - File writer with backup and rollback capabilities
package/README.md CHANGED
@@ -1,44 +1,85 @@
1
- # Claude Comms Installer
1
+ # @claude-code/setup-installer
2
2
 
3
- A command-line installer for Claude Code communication hooks that enables multi-agent collaboration.
3
+ NPX-installable package to set up Claude multi-agent orchestration in any project.
4
4
 
5
- ## Installation
5
+ ## Installation & Usage
6
6
 
7
+ ### Quick Start
7
8
  ```bash
8
- npx claude-comms
9
+ npx @claude-code/setup-installer
9
10
  ```
10
11
 
11
- ## Usage
12
-
13
- Install communication hooks in the current directory:
12
+ ### Options
14
13
  ```bash
15
- npx claude-comms
14
+ # Install to specific directory
15
+ npx @claude-code/setup-installer --dir ./my-project
16
+
17
+ # Install specific version
18
+ npx @claude-code/setup-installer --version v1.2.0
19
+
20
+ # Force overwrite existing files
21
+ npx @claude-code/setup-installer --force
22
+
23
+ # Skip Python/uv dependency check
24
+ npx @claude-code/setup-installer --no-python-check
25
+
26
+ # Development mode with verbose logging
27
+ npx @claude-code/setup-installer --dev
28
+
29
+ # Verify mode (no changes)
30
+ npx @claude-code/setup-installer --verify
31
+
32
+ # Dry run (show what would be done)
33
+ npx @claude-code/setup-installer --dry-run
16
34
  ```
17
35
 
18
- Install in a specific directory:
19
- ```bash
20
- npx claude-comms --directory /path/to/project
36
+ ## What Gets Installed
37
+
38
+ - `.claude/` directory with hooks, agents, and configuration
39
+ - `CLAUDE.md` project instructions file
40
+ - `settings.local.json` template for local configuration
41
+
42
+ ## Development
43
+
44
+ ### Package Structure
45
+ ```
46
+ packages/setup-installer/
47
+ ├── bin/claude-setup.js # NPX executable entry point
48
+ ├── src/
49
+ │ ├── index.js # Main orchestrator
50
+ │ ├── cli/ # Command-line interface
51
+ │ ├── fetcher/ # GitHub API integration
52
+ │ ├── installer/ # File writing & validation
53
+ │ └── utils/ # Shared utilities
54
+ ├── templates/ # Configuration templates
55
+ └── test/ # Test suites
21
56
  ```
22
57
 
23
- Verbose output:
58
+ ### Scripts
24
59
  ```bash
25
- npx claude-comms --verbose
60
+ npm test # Run all tests
61
+ npm run test:unit # Unit tests only
62
+ npm run test:integration # Integration tests
63
+ npm run test:coverage # Coverage report
64
+ npm run lint # ESLint
65
+ npm run dev # Development mode
26
66
  ```
27
67
 
28
- ## What it does
68
+ ## Architecture
29
69
 
30
- This installer sets up the necessary communication infrastructure for Claude Code multi-agent workflows:
70
+ This package implements a hybrid GitHub API strategy for optimal performance:
31
71
 
32
- 1. Creates `.claude/hooks/comms/` directory structure
33
- 2. Installs Python communication scripts
34
- 3. Sets up message passing utilities
35
- 4. Configures team coordination tools
72
+ 1. **GitHub Trees API** for efficient recursive directory fetching
73
+ 2. **Contents API** for individual files
74
+ 3. **Fallback strategies** for rate limiting scenarios
75
+ 4. **Atomic operations** with rollback on failure
36
76
 
37
77
  ## Requirements
38
78
 
39
- - Node.js 16.0.0 or higher
40
- - Python 3.8+ (for communication hooks)
79
+ - Node.js 18.0.0 or higher
80
+ - npm 9.0.0 or higher
81
+ - Internet connection for GitHub access
41
82
 
42
- ## Support
83
+ ## License
43
84
 
44
- For issues and questions, please visit our GitHub repository.
85
+ MIT
@@ -1,48 +1,128 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { Command } = require('commander');
3
+ /**
4
+ * Claude Code Setup Installer
5
+ * NPX-executable script to install Claude multi-agent orchestration setup
6
+ *
7
+ * Usage:
8
+ * npx @claude-code/setup-installer
9
+ * npx @claude-code/setup-installer --dir ./my-project
10
+ * npx @claude-code/setup-installer --version v1.2.0
11
+ * npx @claude-code/setup-installer --force
12
+ */
13
+
14
+ const { program } = require('commander');
4
15
  const chalk = require('chalk');
5
16
  const path = require('path');
6
- const fs = require('fs-extra');
7
17
 
8
- const program = new Command();
18
+ // Import main installer logic
19
+ const installer = require('../src/index.js');
20
+ const { version } = require('../package.json');
9
21
 
22
+ // Configure CLI arguments
10
23
  program
11
- .name('claude-comms')
12
- .description('Claude Code communication hooks installer')
13
- .version('1.0.1');
24
+ .name('claude-setup')
25
+ .description('Install Claude multi-agent orchestration setup into your project')
26
+ .version(version)
27
+ .option('-d, --dir <directory>', 'Target directory for installation', process.cwd())
28
+ .option('-v, --version <version>', 'Specific version/tag to install from GitHub', 'main')
29
+ .option('-f, --force', 'Overwrite existing files without prompting', false)
30
+ .option('--no-python-check', 'Skip Python/uv dependency validation', false)
31
+ .option('--dev', 'Development mode with verbose logging', false)
32
+ .option('--verify', 'Verify installation without making changes', false)
33
+ .option('--dry-run', 'Show what would be installed without executing', false)
34
+ .parse();
14
35
 
15
- program
16
- .option('-d, --directory <dir>', 'target directory', process.cwd())
17
- .option('--verbose', 'verbose output')
18
- .action(async (options) => {
19
- console.log(chalk.blue('🤖 Claude Code Communication Hooks Installer'));
20
- console.log(chalk.gray('Setting up communication hooks in:'), options.directory);
21
-
22
- try {
23
- // Create .claude directory structure
24
- const claudeDir = path.join(options.directory, '.claude');
25
- const hooksDir = path.join(claudeDir, 'hooks');
26
- const commsDir = path.join(hooksDir, 'comms');
27
-
28
- await fs.ensureDir(commsDir);
29
-
30
- // Copy communication hook files
31
- const templateDir = path.join(__dirname, '..', 'templates');
32
- await fs.copy(templateDir, commsDir);
33
-
34
- console.log(chalk.green('✅ Communication hooks installed successfully!'));
35
- console.log(chalk.yellow('📝 Next steps:'));
36
- console.log(' 1. Review configuration in .claude/hooks/comms/');
37
- console.log(' 2. Run your first multi-agent session');
38
-
39
- } catch (error) {
40
- console.error(chalk.red('❌ Installation failed:'), error.message);
41
- if (options.verbose) {
42
- console.error(error.stack);
43
- }
44
- process.exit(1);
36
+ const options = program.opts();
37
+
38
+ // Entry point
39
+ async function main() {
40
+ try {
41
+ console.log(chalk.cyan.bold(`\n🚀 Claude Code Setup Installer v${version}\n`));
42
+
43
+ // Validate target directory
44
+ const targetDir = path.resolve(options.dir);
45
+ console.log(chalk.blue(`📍 Target directory: ${targetDir}`));
46
+
47
+ // Development mode logging
48
+ if (options.dev) {
49
+ console.log(chalk.yellow('🔧 Development mode enabled'));
50
+ console.log(chalk.gray('Options:', JSON.stringify(options, null, 2)));
51
+ }
52
+
53
+ // Verification mode
54
+ if (options.verify) {
55
+ console.log(chalk.yellow('🔍 Verification mode - no changes will be made'));
56
+ }
57
+
58
+ // Dry run mode
59
+ if (options.dryRun) {
60
+ console.log(chalk.yellow('🏃 Dry run mode - showing what would be installed'));
61
+ }
62
+
63
+ // Execute installer with options
64
+ await installer.install({
65
+ targetDir,
66
+ gitRef: options.version,
67
+ force: options.force,
68
+ checkPython: options.pythonCheck,
69
+ dev: options.dev,
70
+ verify: options.verify,
71
+ dryRun: options.dryRun
72
+ });
73
+
74
+ console.log(chalk.green.bold('\n✅ Installation complete!\n'));
75
+
76
+ // Show next steps
77
+ console.log(chalk.cyan('Next steps:'));
78
+ console.log(chalk.white('1. Review .claude/settings.local.json for configuration'));
79
+ console.log(chalk.white('2. Ensure Python and uv are installed for hooks'));
80
+ console.log(chalk.white('3. Start the observability server (optional)'));
81
+ console.log(chalk.white('4. Open your project in Claude Code'));
82
+ console.log(chalk.cyan('\nHappy coding with Claude! 🤖\n'));
83
+
84
+ } catch (error) {
85
+ console.error(chalk.red.bold('\n❌ Installation failed:'));
86
+ console.error(chalk.red(error.message));
87
+
88
+ if (options.dev && error.stack) {
89
+ console.error(chalk.gray('\nStack trace:'));
90
+ console.error(chalk.gray(error.stack));
45
91
  }
46
- });
92
+
93
+ // Show troubleshooting hints
94
+ console.log(chalk.yellow('\n💡 Troubleshooting:'));
95
+ console.log(chalk.white('• Check network connection for GitHub access'));
96
+ console.log(chalk.white('• Verify write permissions in target directory'));
97
+ console.log(chalk.white('• Try running with --dev for more details'));
98
+ console.log(chalk.white('• Report issues: https://github.com/alexsavage/claude-code-hooks-multi-agent-observability/issues'));
99
+
100
+ process.exit(1);
101
+ }
102
+ }
103
+
104
+ // Handle uncaught errors gracefully
105
+ process.on('uncaughtException', (error) => {
106
+ console.error(chalk.red.bold('\n💥 Unexpected error:'));
107
+ console.error(chalk.red(error.message));
108
+ process.exit(1);
109
+ });
110
+
111
+ process.on('unhandledRejection', (reason, promise) => {
112
+ console.error(chalk.red.bold('\n💥 Unhandled promise rejection:'));
113
+ console.error(chalk.red(reason));
114
+ process.exit(1);
115
+ });
116
+
117
+ // Handle CTRL+C gracefully
118
+ process.on('SIGINT', () => {
119
+ console.log(chalk.yellow('\n\n⚠️ Installation cancelled by user'));
120
+ process.exit(0);
121
+ });
47
122
 
48
- program.parse();
123
+ // Execute main function
124
+ main().catch((error) => {
125
+ console.error(chalk.red.bold('\n❌ Fatal error:'));
126
+ console.error(chalk.red(error.message));
127
+ process.exit(1);
128
+ });
package/package.json CHANGED
@@ -1,37 +1,84 @@
1
1
  {
2
2
  "name": "claude-comms",
3
- "version": "1.0.1",
4
- "description": "Claude Code communication hooks installer",
3
+ "version": "1.0.2",
4
+ "description": "NPX installer for Claude Code hooks and observability setup",
5
+ "main": "src/index.js",
5
6
  "bin": {
6
- "claude-comms": "./bin/claude-setup.js"
7
+ "claude-comms": "bin/claude-setup.js"
7
8
  },
8
- "main": "./src/index.js",
9
9
  "scripts": {
10
- "test": "echo \"Tests bypassed for initial publish - interface mismatch to be fixed\""
10
+ "test": "jest",
11
+ "test:unit": "jest --testPathPattern=unit",
12
+ "test:integration": "jest --testPathPattern=integration",
13
+ "test:watch": "jest --watch",
14
+ "test:coverage": "jest --coverage",
15
+ "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
16
+ "test:e2e": "bash test/e2e/install.sh",
17
+ "test:memory": "node --expose-gc test/performance/memory-test.js",
18
+ "lint": "eslint src/ test/ --ext .js,.ts",
19
+ "lint:fix": "eslint src/ test/ --ext .js,.ts --fix",
20
+ "build": "node scripts/build.js",
21
+ "dev": "nodemon bin/claude-setup.js",
22
+ "security:check": "npm audit && snyk test",
23
+ "docs:lint": "markdownlint README.md docs/",
24
+ "examples:test": "node test/examples/test-examples.js",
25
+ "prepublishOnly": "npm run test && npm run lint && npm run build"
11
26
  },
12
27
  "keywords": [
13
- "claude",
14
- "code",
28
+ "claude-code",
15
29
  "hooks",
16
- "communication",
17
- "installer"
30
+ "observability",
31
+ "npx",
32
+ "installer",
33
+ "multi-agent"
18
34
  ],
19
35
  "author": "Claude Code Team",
20
36
  "license": "MIT",
21
- "publishConfig": {
22
- "access": "public"
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/alexsavage/claude-code-hooks-multi-agent-observability.git",
40
+ "directory": "packages/setup-installer"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/alexsavage/claude-code-hooks-multi-agent-observability/issues"
44
+ },
45
+ "homepage": "https://github.com/alexsavage/claude-code-hooks-multi-agent-observability#readme",
46
+ "engines": {
47
+ "node": ">=16.0.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/jest": "^29.5.0",
51
+ "@types/node": "^20.0.0",
52
+ "babel-jest": "^29.5.0",
53
+ "eslint": "^8.40.0",
54
+ "husky": "^8.0.0",
55
+ "jest": "^29.5.0",
56
+ "jest-junit": "^16.0.0",
57
+ "markdownlint-cli": "^0.35.0",
58
+ "mock-fs": "^5.2.0",
59
+ "nock": "^13.3.0",
60
+ "nodemon": "^3.0.0",
61
+ "snyk": "^1.1100.0",
62
+ "supertest": "^6.3.0",
63
+ "ts-jest": "^29.1.0",
64
+ "typescript": "^5.0.0"
23
65
  },
24
66
  "dependencies": {
25
67
  "commander": "^11.0.0",
68
+ "prompts": "^2.4.2",
26
69
  "chalk": "^4.1.2",
70
+ "ora": "^5.4.1",
71
+ "node-fetch": "^2.6.11",
27
72
  "fs-extra": "^11.1.1"
28
73
  },
29
- "engines": {
30
- "node": ">=16.0.0"
31
- },
32
- "repository": {
33
- "type": "git",
34
- "url": "https://github.com/claude-code/communication-hooks.git",
35
- "directory": "packages/setup-installer"
74
+ "files": [
75
+ "bin/",
76
+ "src/",
77
+ "templates/",
78
+ "README.md",
79
+ "CHANGELOG.md"
80
+ ],
81
+ "publishConfig": {
82
+ "access": "public"
36
83
  }
37
84
  }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * CLI Entry Point for @claude-code/setup-installer
3
+ *
4
+ * Main entry point that orchestrates CLI parsing, user interaction,
5
+ * and installation flow with proper error handling.
6
+ */
7
+
8
+ const { run } = require('./runner');
9
+
10
+ /**
11
+ * CLI entry point - can be called directly or used as module
12
+ */
13
+ async function main() {
14
+ try {
15
+ await run(process.argv);
16
+ } catch (error) {
17
+ console.error('CLI execution failed:', error.message);
18
+ process.exit(1);
19
+ }
20
+ }
21
+
22
+ // Run if called directly
23
+ if (require.main === module) {
24
+ main();
25
+ }
26
+
27
+ module.exports = {
28
+ run,
29
+ main
30
+ };