myconvergio 2.1.0

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.
Files changed (85) hide show
  1. package/.claude/agents/business_operations/andrea-customer-success-manager.md +175 -0
  2. package/.claude/agents/business_operations/anna-executive-assistant.md +268 -0
  3. package/.claude/agents/business_operations/dave-change-management-specialist.md +200 -0
  4. package/.claude/agents/business_operations/davide-project-manager.md +203 -0
  5. package/.claude/agents/business_operations/enrico-business-process-engineer.md +180 -0
  6. package/.claude/agents/business_operations/fabio-sales-business-development.md +175 -0
  7. package/.claude/agents/business_operations/luke-program-manager.md +105 -0
  8. package/.claude/agents/business_operations/marcello-pm.md +130 -0
  9. package/.claude/agents/business_operations/oliver-pm.md +134 -0
  10. package/.claude/agents/business_operations/sofia-marketing-strategist.md +175 -0
  11. package/.claude/agents/business_operations/steve-executive-communication-strategist.md +111 -0
  12. package/.claude/agents/compliance_legal/dr-enzo-healthcare-compliance-manager.md +198 -0
  13. package/.claude/agents/compliance_legal/elena-legal-compliance-expert.md +169 -0
  14. package/.claude/agents/compliance_legal/guardian-ai-security-validator.md +207 -0
  15. package/.claude/agents/compliance_legal/luca-security-expert.md +229 -0
  16. package/.claude/agents/compliance_legal/sophia-govaffairs.md +132 -0
  17. package/.claude/agents/core_utility/CONSTITUTION.md +365 -0
  18. package/.claude/agents/core_utility/CommonValuesAndPrinciples.md +296 -0
  19. package/.claude/agents/core_utility/MICROSOFT_VALUES.md +121 -0
  20. package/.claude/agents/core_utility/SECURITY_FRAMEWORK_TEMPLATE.md +137 -0
  21. package/.claude/agents/core_utility/diana-performance-dashboard.md +238 -0
  22. package/.claude/agents/core_utility/marcus-context-memory-keeper.md +218 -0
  23. package/.claude/agents/core_utility/po-prompt-optimizer.md +194 -0
  24. package/.claude/agents/core_utility/socrates-first-principles-reasoning.md +260 -0
  25. package/.claude/agents/core_utility/strategic-planner.md +292 -0
  26. package/.claude/agents/core_utility/taskmaster-strategic-task-decomposition-master.md +152 -0
  27. package/.claude/agents/core_utility/thor-quality-assurance-guardian.md +223 -0
  28. package/.claude/agents/core_utility/wanda-workflow-orchestrator.md +247 -0
  29. package/.claude/agents/core_utility/xavier-coordination-patterns.md +251 -0
  30. package/.claude/agents/design_ux/jony-creative-director.md +172 -0
  31. package/.claude/agents/design_ux/sara-ux-ui-designer.md +166 -0
  32. package/.claude/agents/design_ux/stefano-design-thinking-facilitator.md +180 -0
  33. package/.claude/agents/leadership_strategy/ali-chief-of-staff.md +594 -0
  34. package/.claude/agents/leadership_strategy/amy-cfo.md +179 -0
  35. package/.claude/agents/leadership_strategy/antonio-strategy-expert.md +217 -0
  36. package/.claude/agents/leadership_strategy/dan-engineering-gm.md +260 -0
  37. package/.claude/agents/leadership_strategy/domik-mckinsey-strategic-decision-maker.md +324 -0
  38. package/.claude/agents/leadership_strategy/matteo-strategic-business-architect.md +177 -0
  39. package/.claude/agents/leadership_strategy/satya-board-of-directors.md +222 -0
  40. package/.claude/agents/release_management/app-release-manager.md +2352 -0
  41. package/.claude/agents/release_management/feature-release-manager.md +235 -0
  42. package/.claude/agents/specialized_experts/angela-da.md +140 -0
  43. package/.claude/agents/specialized_experts/ava-analytics-insights-virtuoso.md +203 -0
  44. package/.claude/agents/specialized_experts/behice-cultural-coach.md +202 -0
  45. package/.claude/agents/specialized_experts/coach-team-coach.md +180 -0
  46. package/.claude/agents/specialized_experts/ethan-da.md +139 -0
  47. package/.claude/agents/specialized_experts/evan-ic6da.md +140 -0
  48. package/.claude/agents/specialized_experts/fiona-market-analyst.md +148 -0
  49. package/.claude/agents/specialized_experts/giulia-hr-talent-acquisition.md +175 -0
  50. package/.claude/agents/specialized_experts/jenny-inclusive-accessibility-champion.md +200 -0
  51. package/.claude/agents/specialized_experts/michael-vc.md +130 -0
  52. package/.claude/agents/specialized_experts/riccardo-storyteller.md +158 -0
  53. package/.claude/agents/specialized_experts/sam-startupper.md +253 -0
  54. package/.claude/agents/specialized_experts/wiz-investor-venture-capital.md +182 -0
  55. package/.claude/agents/technical_development/baccio-tech-architect.md +210 -0
  56. package/.claude/agents/technical_development/dario-debugger.md +250 -0
  57. package/.claude/agents/technical_development/marco-devops-engineer.md +200 -0
  58. package/.claude/agents/technical_development/omri-data-scientist.md +194 -0
  59. package/.claude/agents/technical_development/otto-performance-optimizer.md +262 -0
  60. package/.claude/agents/technical_development/paolo-best-practices-enforcer.md +303 -0
  61. package/.claude/agents/technical_development/rex-code-reviewer.md +231 -0
  62. package/.claude/rules/api-development.md +358 -0
  63. package/.claude/rules/code-style.md +129 -0
  64. package/.claude/rules/documentation-standards.md +359 -0
  65. package/.claude/rules/ethical-guidelines.md +383 -0
  66. package/.claude/rules/security-requirements.md +182 -0
  67. package/.claude/rules/testing-standards.md +266 -0
  68. package/.claude/skills/architecture/SKILL.md +228 -0
  69. package/.claude/skills/code-review/SKILL.md +140 -0
  70. package/.claude/skills/debugging/SKILL.md +192 -0
  71. package/.claude/skills/performance/SKILL.md +277 -0
  72. package/.claude/skills/project-management/SKILL.md +382 -0
  73. package/.claude/skills/release-management/SKILL.md +342 -0
  74. package/.claude/skills/security-audit/SKILL.md +276 -0
  75. package/.claude/skills/strategic-analysis/SKILL.md +338 -0
  76. package/LICENSE +60 -0
  77. package/README.md +379 -0
  78. package/VERSION +29 -0
  79. package/bin/myconvergio.js +304 -0
  80. package/package.json +43 -0
  81. package/scripts/bump-agent-version.sh +220 -0
  82. package/scripts/postinstall.js +172 -0
  83. package/scripts/sync-from-convergiocli.sh +169 -0
  84. package/scripts/test-deployment.sh +188 -0
  85. package/scripts/version-manager.sh +213 -0
package/README.md ADDED
@@ -0,0 +1,379 @@
1
+ <div align="center">
2
+
3
+ # MyConvergio - Claude Code Subagents Suite
4
+
5
+ <img src="./CovergioLogoTransparent.png" alt="Convergio Logo" width="200"/>
6
+
7
+ **v2.1.0** | 60 Specialized Agents | Enterprise-Grade AI Ecosystem
8
+
9
+ > *"Intent is human, momentum is agent"*
10
+ > — [The Agentic Manifesto](./AgenticManifesto.md)
11
+
12
+ [![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
13
+ [![npm version](https://img.shields.io/npm/v/myconvergio.svg)](https://www.npmjs.com/package/myconvergio)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## How It Works
20
+
21
+ **Each agent is a specialized AI assistant you invoke directly:**
22
+
23
+ ```bash
24
+ @agent-name [your request here]
25
+ ```
26
+
27
+ **Important**: Agents operate in **isolated contexts** - they don't automatically communicate with each other. If you need coordination between agents, you must explicitly ask one agent (like Ali) to invoke others and pass context manually.
28
+
29
+ ---
30
+
31
+ ## About This Project
32
+
33
+ MyConvergio is an **open-source collection** of 60 specialized Claude Code subagents designed for enterprise software project management, strategic leadership, and organizational excellence.
34
+
35
+ ### What are Claude Code Subagents?
36
+
37
+ Claude Code subagents are specialized AI assistants that can be invoked to handle specific types of tasks within the Claude Code environment. [Learn more in the official Anthropic documentation](https://docs.anthropic.com/en/docs/claude-code/sub-agents).
38
+
39
+ ### Key Features (v2.1.0)
40
+
41
+ | Feature | Description |
42
+ |---------|-------------|
43
+ | **npm Distribution** | Cross-platform install: `npm install -g myconvergio` |
44
+ | **60 Specialized Agents** | Organized in 8 categories covering all enterprise domains |
45
+ | **Constitution-Based Security** | Anti-hijacking protocol with 8 articles of protection |
46
+ | **Model Tiering** | 2 Opus / 14 Sonnet / 41 Haiku for 74-87% cost reduction |
47
+ | **ISE Engineering Playbook** | All technical agents follow Microsoft ISE standards |
48
+ | **Rules & Skills** | 6 rules + 8 reusable workflow skills |
49
+ | **Per-Agent Versioning** | Semantic versioning for granular control |
50
+
51
+ ---
52
+
53
+ ## What's New in v2.0.0
54
+
55
+ ### Major Changes
56
+
57
+ - **English-Only Agents**: All agents now in English only (Claude responds in user's language)
58
+ - **Makefile Installation**: Simple `make install` replaces complex shell scripts
59
+ - **60 Agents**: Expanded from 40 to 60 specialized agents
60
+ - **Cost Reduction**: 74-87% cost savings through intelligent model tiering
61
+
62
+ ### New Components
63
+
64
+ | Component | Description |
65
+ |-----------|-------------|
66
+ | **CONSTITUTION.md** | Security framework with 8 articles protecting all agents |
67
+ | **6 Rules** | Code style, security, testing, documentation, API, ethics |
68
+ | **8 Skills** | Reusable workflows for common tasks |
69
+ | **11 ADRs** | Documented architectural decisions |
70
+ | **115+ Security Tests** | Comprehensive jailbreak/injection test suite |
71
+
72
+ ### Infrastructure
73
+
74
+ - **GitHub Actions CI/CD**: Automated testing, validation, and releases
75
+ - **ConvergioCLI Sync**: Automatic synchronization with advanced local CLI
76
+ - **Per-Agent Versioning**: Each agent has its own semantic version
77
+
78
+ ### Breaking Changes
79
+
80
+ - Removed `start.sh` (use `make install`)
81
+ - Removed `claude-agents/` and `claude-agenti/` legacy folders
82
+ - Removed Italian agent versions (ADR-001)
83
+ - Changed install path from `~/.claude-code/` to `~/.claude/`
84
+
85
+ ---
86
+
87
+ ## Quick Start
88
+
89
+ ### Prerequisites
90
+
91
+ **Claude Code CLI Required** (Node.js 18+):
92
+
93
+ ```bash
94
+ npm install -g @anthropic-ai/claude-code
95
+ claude doctor
96
+ ```
97
+
98
+ **System Requirements:**
99
+ - macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (via WSL or native)
100
+ - Node.js 18+
101
+ - 4GB+ RAM
102
+
103
+ ### Installation
104
+
105
+ #### Option 1: npm (Recommended)
106
+
107
+ Works on **all platforms** (macOS, Linux, Windows):
108
+
109
+ ```bash
110
+ # Install
111
+ npm install -g myconvergio
112
+
113
+ # Verify installation
114
+ myconvergio version
115
+ ```
116
+
117
+ #### Option 2: Git Clone
118
+
119
+ For development or customization:
120
+
121
+ ```bash
122
+ git clone https://github.com/roberdan/MyConvergio.git
123
+ cd MyConvergio
124
+ make install
125
+ ```
126
+
127
+ ### Updating
128
+
129
+ ```bash
130
+ # npm users
131
+ npm update -g myconvergio
132
+
133
+ # Git users
134
+ git pull && make upgrade
135
+ ```
136
+
137
+ ### Uninstalling
138
+
139
+ ```bash
140
+ # npm users
141
+ myconvergio uninstall
142
+ npm uninstall -g myconvergio
143
+
144
+ # Git users
145
+ make clean
146
+ ```
147
+
148
+ ### Usage Examples
149
+
150
+ ```bash
151
+ # Strategic planning
152
+ @ali-chief-of-staff Help me design our global expansion strategy
153
+
154
+ # Technical architecture
155
+ @baccio-tech-architect Design microservices architecture for healthcare platform
156
+
157
+ # Code review
158
+ @rex-code-reviewer Review this pull request for security issues
159
+
160
+ # Strategic analysis
161
+ @domik-mckinsey-strategic-decision-maker Analyze market entry options for APAC
162
+
163
+ # Quality assurance
164
+ @thor-quality-assurance-guardian Audit our testing coverage
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Agent Portfolio (60 Specialists)
170
+
171
+ ### By Category
172
+
173
+ | Category | Count | Purpose |
174
+ |----------|-------|---------|
175
+ | `specialized_experts` | 13 | Domain expertise (HR, Analytics, Cultural, VC) |
176
+ | `business_operations` | 11 | PM, Sales, Customer Success, Marketing |
177
+ | `core_utility` | 9 | Infrastructure (Memory, QA, Performance) |
178
+ | `leadership_strategy` | 7 | Board, Strategy, OKR, CFO |
179
+ | `technical_development` | 7 | Engineering, DevOps, Code Review, Security |
180
+ | `compliance_legal` | 5 | Legal, Security, Healthcare Compliance |
181
+ | `design_ux` | 3 | Creative Direction, UX/UI, Design Thinking |
182
+ | `release_management` | 2 | App & Feature Release |
183
+
184
+ ### By Model Tier
185
+
186
+ | Tier | Count | Agents | Use Case |
187
+ |------|-------|--------|----------|
188
+ | **Opus** | 2 | ali-chief-of-staff, satya-board-of-directors | Complex reasoning |
189
+ | **Sonnet** | 14 | Strategic specialists (baccio, domik, thor, etc.) | Strategic decisions |
190
+ | **Haiku** | 41 | Workers and specialists | Quick tasks |
191
+
192
+ ### Key Agents
193
+
194
+ **Leadership:**
195
+ - `ali-chief-of-staff` - Strategic coordination and planning (can invoke other agents if asked)
196
+ - `satya-board-of-directors` - Strategic vision and governance
197
+
198
+ **Technical:**
199
+ - `baccio-tech-architect` - System design and architecture
200
+ - `rex-code-reviewer` - Code quality and review
201
+ - `marco-devops-engineer` - CI/CD and infrastructure
202
+ - `luca-security-expert` - Cybersecurity and compliance
203
+
204
+ **Strategy:**
205
+ - `domik-mckinsey-strategic-decision-maker` - McKinsey-level analysis
206
+ - `antonio-strategy-expert` - OKR and strategic frameworks
207
+ - `amy-cfo` - Financial strategy
208
+
209
+ **Quality:**
210
+ - `thor-quality-assurance-guardian` - Quality enforcement
211
+ - `elena-legal-compliance-expert` - Legal and regulatory
212
+
213
+ ---
214
+
215
+ ## Repository Structure
216
+
217
+ ```
218
+ MyConvergio/
219
+ ├── .claude/
220
+ │ ├── agents/ # 60 specialized agents
221
+ │ │ ├── leadership_strategy/ # 7 agents
222
+ │ │ ├── technical_development/ # 7 agents
223
+ │ │ ├── business_operations/ # 11 agents
224
+ │ │ ├── design_ux/ # 3 agents
225
+ │ │ ├── compliance_legal/ # 5 agents
226
+ │ │ ├── specialized_experts/ # 13 agents
227
+ │ │ ├── core_utility/ # 9 agents + CONSTITUTION.md
228
+ │ │ └── release_management/ # 2 agents
229
+ │ ├── rules/ # 6 coding rules
230
+ │ │ ├── code-style.md
231
+ │ │ ├── security-requirements.md
232
+ │ │ ├── testing-standards.md
233
+ │ │ ├── documentation-standards.md
234
+ │ │ ├── api-development.md
235
+ │ │ └── ethical-guidelines.md
236
+ │ └── skills/ # 8 reusable workflows
237
+ │ ├── code-review/
238
+ │ ├── debugging/
239
+ │ ├── architecture/
240
+ │ ├── security-audit/
241
+ │ ├── performance/
242
+ │ ├── strategic-analysis/
243
+ │ ├── release-management/
244
+ │ └── project-management/
245
+ ├── docs/
246
+ │ ├── adr/ # 11 Architecture Decision Records
247
+ │ └── AGENT_OPTIMIZATION_PLAN_2025.md
248
+ ├── tests/
249
+ │ ├── security_tests.md # 115+ security tests
250
+ │ └── token_analysis.md # Cost analysis
251
+ ├── scripts/
252
+ │ ├── sync-from-convergiocli.sh
253
+ │ ├── version-manager.sh
254
+ │ └── bump-agent-version.sh
255
+ ├── Makefile # Build and deploy commands
256
+ ├── VERSION # System version (2.1.0)
257
+ └── CLAUDE.md # Project instructions
258
+ ```
259
+
260
+ ---
261
+
262
+ ## CLI Commands
263
+
264
+ ### npm CLI (`myconvergio`)
265
+
266
+ ```bash
267
+ myconvergio help # Show available commands
268
+ myconvergio install # Install/reinstall to ~/.claude/
269
+ myconvergio uninstall # Remove from ~/.claude/
270
+ myconvergio version # Show version and installation status
271
+ ```
272
+
273
+ ### Make Commands (Git users)
274
+
275
+ ```bash
276
+ make install # Install agents, rules, skills to ~/.claude/
277
+ make upgrade # Update to latest version (clean + install)
278
+ make install-local # Install to current project only
279
+ make clean # Remove all installed components
280
+ make version # Show installed version info
281
+ ```
282
+
283
+ ---
284
+
285
+ ## Security Framework
286
+
287
+ All agents implement the [MyConvergio Constitution](/.claude/agents/core_utility/CONSTITUTION.md):
288
+
289
+ | Article | Protection |
290
+ |---------|------------|
291
+ | I | Identity Lock - Immutable agent identity |
292
+ | II | Ethical Principles - Fairness, transparency, accountability |
293
+ | III | Security Directives - Anti-hijacking, input validation |
294
+ | IV | Operational Boundaries - Role adherence |
295
+ | V | Failure Modes - Graceful degradation |
296
+ | VI | Collaboration - Safe inter-agent communication |
297
+ | VII | **Accessibility & Inclusion (NON-NEGOTIABLE)** |
298
+ | VIII | Accountability - Logging and audit trails |
299
+
300
+ ---
301
+
302
+ ## Architecture Decision Records
303
+
304
+ All major decisions are documented in `docs/adr/`:
305
+
306
+ | ADR | Decision |
307
+ |-----|----------|
308
+ | ADR-001 | English-only agents |
309
+ | ADR-002 | Makefile replaces start.sh |
310
+ | ADR-003 | Per-agent versioning |
311
+ | ADR-004 | Model tiering (Opus/Sonnet/Haiku) |
312
+ | ADR-005 | Constitution-based security |
313
+ | ADR-006 | GitHub Actions CI/CD |
314
+ | ADR-007 | Single source of truth |
315
+ | ADR-008 | ConvergioCLI relationship |
316
+ | ADR-009 | Skills & Rules system |
317
+ | ADR-010 | ISE Engineering Playbook standard |
318
+
319
+ ---
320
+
321
+ ## The Agentic Manifesto
322
+
323
+ *Human purpose. AI momentum.*
324
+
325
+ ### What we believe
326
+ 1. **Intent is human, momentum is agent.**
327
+ 2. **Impact must reach every mind and body.**
328
+ 3. **Trust grows from transparent provenance.**
329
+ 4. **Progress is judged by outcomes, not output.**
330
+
331
+ ### How we act
332
+ 1. Humans stay accountable for decisions and effects.
333
+ 2. Agents amplify capability, never identity.
334
+ 3. We design from the edge first: disability, language, connectivity.
335
+ 4. Safety rails precede scale.
336
+ 5. Learn in small loops, ship value early.
337
+
338
+ *Read the full [Agentic Manifesto](./AgenticManifesto.md)*
339
+
340
+ ---
341
+
342
+ ## Related Projects
343
+
344
+ - **[ConvergioCLI](https://github.com/Roberdan/convergio-cli)** - Advanced local CLI with Apple Silicon optimization, Anna executive assistant, offline mode with local models, and macOS-native features
345
+
346
+ ---
347
+
348
+ ## License & Legal
349
+
350
+ Copyright 2025 Convergio.io
351
+
352
+ Licensed under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](./LICENSE)
353
+
354
+ ### Disclaimers
355
+
356
+ - **Experimental Software**: Provided "AS IS" without warranties
357
+ - **Non-Commercial Use Only**: See LICENSE file for details
358
+ - **No Corporate Affiliation**: Not affiliated with Anthropic, OpenAI, or Microsoft
359
+ - **Personal Project**: Author is a Microsoft employee; this is a personal initiative
360
+
361
+ **Author Note**: Roberto D'Angelo is a Microsoft employee. This project is a personal initiative created independently during personal time. This project is NOT affiliated with, endorsed by, or representing Microsoft Corporation.
362
+
363
+ ---
364
+
365
+ ## Contributing
366
+
367
+ Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
368
+
369
+ For questions about commercial licensing: roberdan@fightthestroke.org
370
+
371
+ ---
372
+
373
+ <div align="center">
374
+
375
+ *Built with AI assistance in Milano, following the Agentic Manifesto principles*
376
+
377
+ **v2.0.0** | December 2025
378
+
379
+ </div>
package/VERSION ADDED
@@ -0,0 +1,29 @@
1
+ # MyConvergio Version Management
2
+ # Format: MAJOR.MINOR.PATCH[-PRERELEASE]
3
+ # Follows Semantic Versioning 2.0.0 (https://semver.org/)
4
+
5
+ # System Version
6
+ SYSTEM_VERSION=2.1.0
7
+
8
+ # Version Schema
9
+ # AGENT_NAME=MAJOR.MINOR.PATCH[-PRERELEASE] TIMESTAMP
10
+ # Example: ali-chief-of-staff=1.0.0 2025-07-30T10:00:00+02:00
11
+ dario-debugger=0.1.0 2025-12-15T09:09:44Z
12
+ otto-performance-optimizer=0.1.0 2025-12-15T09:09:44Z
13
+ paolo-best-practices-enforcer=0.1.0 2025-12-15T09:09:44Z
14
+ rex-code-reviewer=0.1.0 2025-12-15T09:09:44Z
15
+ feature-release-manager=0.1.0 2025-12-15T09:09:44Z
16
+ app-release-manager=0.1.0 2025-12-15T09:09:44Z
17
+ sophia-govaffairs=0.1.0 2025-12-15T09:09:44Z
18
+ guardian-ai-security-validator=0.1.0 2025-12-15T09:09:44Z
19
+ fiona-market-analyst=0.1.0 2025-12-15T09:09:44Z
20
+ angela-da=0.1.0 2025-12-15T09:09:44Z
21
+ michael-vc=0.1.0 2025-12-15T09:09:44Z
22
+ ethan-da=0.1.0 2025-12-15T09:09:44Z
23
+ evan-ic6da=0.1.0 2025-12-15T09:09:44Z
24
+ marcello-pm=0.1.0 2025-12-15T09:09:45Z
25
+ anna-executive-assistant=0.1.0 2025-12-15T09:09:45Z
26
+ oliver-pm=0.1.0 2025-12-15T09:09:45Z
27
+ strategic-planner=0.1.0 2025-12-15T09:09:45Z
28
+ taskmaster-strategic-task-decomposition-master=1.0.3 2025-12-28T13:14:06Z
29
+ davide-project-manager=1.0.3 2025-12-28T13:14:06Z
@@ -0,0 +1,304 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const readline = require('readline');
7
+
8
+ const CLAUDE_HOME = path.join(os.homedir(), '.claude');
9
+ const PACKAGE_ROOT = path.join(__dirname, '..');
10
+ const VERSION_FILE = path.join(PACKAGE_ROOT, 'VERSION');
11
+ const MANIFEST_FILE = path.join(CLAUDE_HOME, '.myconvergio-manifest.json');
12
+
13
+ // Colors for terminal output
14
+ const colors = {
15
+ reset: '\x1b[0m',
16
+ green: '\x1b[32m',
17
+ yellow: '\x1b[33m',
18
+ blue: '\x1b[34m',
19
+ red: '\x1b[31m',
20
+ };
21
+
22
+ function log(color, message) {
23
+ console.log(`${color}${message}${colors.reset}`);
24
+ }
25
+
26
+ function getVersion() {
27
+ try {
28
+ const content = fs.readFileSync(VERSION_FILE, 'utf8');
29
+ const match = content.match(/SYSTEM_VERSION=(.+)/);
30
+ return match ? match[1].trim() : 'unknown';
31
+ } catch {
32
+ const pkg = require('../package.json');
33
+ return pkg.version;
34
+ }
35
+ }
36
+
37
+ function countInstalled() {
38
+ const counts = { agents: 0, rules: 0, skills: 0 };
39
+
40
+ const agentsDir = path.join(CLAUDE_HOME, 'agents');
41
+ if (fs.existsSync(agentsDir)) {
42
+ counts.agents = countMdFiles(agentsDir);
43
+ }
44
+
45
+ const rulesDir = path.join(CLAUDE_HOME, 'rules');
46
+ if (fs.existsSync(rulesDir)) {
47
+ counts.rules = countMdFiles(rulesDir);
48
+ }
49
+
50
+ const skillsDir = path.join(CLAUDE_HOME, 'skills');
51
+ if (fs.existsSync(skillsDir)) {
52
+ counts.skills = fs.readdirSync(skillsDir).filter(f =>
53
+ fs.statSync(path.join(skillsDir, f)).isDirectory()
54
+ ).length;
55
+ }
56
+
57
+ return counts;
58
+ }
59
+
60
+ function countMdFiles(dir) {
61
+ let count = 0;
62
+ const items = fs.readdirSync(dir);
63
+ for (const item of items) {
64
+ const fullPath = path.join(dir, item);
65
+ const stat = fs.statSync(fullPath);
66
+ if (stat.isDirectory()) {
67
+ count += countMdFiles(fullPath);
68
+ } else if (item.endsWith('.md') &&
69
+ !['CONSTITUTION.md', 'CommonValuesAndPrinciples.md', 'SECURITY_FRAMEWORK_TEMPLATE.md'].includes(item)) {
70
+ count++;
71
+ }
72
+ }
73
+ return count;
74
+ }
75
+
76
+ function copyRecursive(src, dest, installedFiles = []) {
77
+ if (!fs.existsSync(src)) return installedFiles;
78
+
79
+ fs.mkdirSync(dest, { recursive: true });
80
+
81
+ const items = fs.readdirSync(src);
82
+ for (const item of items) {
83
+ const srcPath = path.join(src, item);
84
+ const destPath = path.join(dest, item);
85
+ const stat = fs.statSync(srcPath);
86
+
87
+ if (stat.isDirectory()) {
88
+ copyRecursive(srcPath, destPath, installedFiles);
89
+ } else {
90
+ fs.copyFileSync(srcPath, destPath);
91
+ installedFiles.push(destPath);
92
+ }
93
+ }
94
+ return installedFiles;
95
+ }
96
+
97
+ function loadManifest() {
98
+ try {
99
+ if (fs.existsSync(MANIFEST_FILE)) {
100
+ return JSON.parse(fs.readFileSync(MANIFEST_FILE, 'utf8'));
101
+ }
102
+ } catch {}
103
+ return { files: [], version: null, installedAt: null };
104
+ }
105
+
106
+ function saveManifest(files, version) {
107
+ const manifest = {
108
+ version,
109
+ installedAt: new Date().toISOString(),
110
+ files
111
+ };
112
+ fs.writeFileSync(MANIFEST_FILE, JSON.stringify(manifest, null, 2));
113
+ }
114
+
115
+ function createBackup() {
116
+ const backupDir = path.join(os.homedir(), '.claude-backup-' + Date.now());
117
+ const dirs = ['agents', 'rules', 'skills'];
118
+ let hasContent = false;
119
+
120
+ for (const dir of dirs) {
121
+ const srcDir = path.join(CLAUDE_HOME, dir);
122
+ if (fs.existsSync(srcDir) && fs.readdirSync(srcDir).length > 0) {
123
+ hasContent = true;
124
+ copyRecursive(srcDir, path.join(backupDir, dir));
125
+ }
126
+ }
127
+
128
+ if (hasContent) {
129
+ return backupDir;
130
+ }
131
+ return null;
132
+ }
133
+
134
+ function install(skipBackup = false) {
135
+ log(colors.blue, 'Installing MyConvergio to ~/.claude/...\n');
136
+
137
+ // Check for existing installation
138
+ const existingManifest = loadManifest();
139
+ if (existingManifest.version && !skipBackup) {
140
+ log(colors.yellow, `Existing installation found (v${existingManifest.version})`);
141
+ log(colors.yellow, 'Creating backup before upgrade...\n');
142
+ const backupDir = createBackup();
143
+ if (backupDir) {
144
+ log(colors.green, ` ✓ Backup created: ${backupDir}\n`);
145
+ }
146
+ }
147
+
148
+ const srcAgents = path.join(PACKAGE_ROOT, '.claude', 'agents');
149
+ const srcRules = path.join(PACKAGE_ROOT, '.claude', 'rules');
150
+ const srcSkills = path.join(PACKAGE_ROOT, '.claude', 'skills');
151
+
152
+ const installedFiles = [];
153
+
154
+ // Install agents
155
+ copyRecursive(srcAgents, path.join(CLAUDE_HOME, 'agents'), installedFiles);
156
+ log(colors.green, ' ✓ Installed agents');
157
+
158
+ // Install rules
159
+ copyRecursive(srcRules, path.join(CLAUDE_HOME, 'rules'), installedFiles);
160
+ log(colors.green, ' ✓ Installed rules');
161
+
162
+ // Install skills
163
+ copyRecursive(srcSkills, path.join(CLAUDE_HOME, 'skills'), installedFiles);
164
+ log(colors.green, ' ✓ Installed skills');
165
+
166
+ // Save manifest
167
+ const version = getVersion();
168
+ saveManifest(installedFiles, version);
169
+ log(colors.green, ` ✓ Saved manifest (${installedFiles.length} files)`);
170
+
171
+ console.log('');
172
+ log(colors.green, '✅ Installation complete!');
173
+ console.log('');
174
+ log(colors.yellow, 'Note: Your ~/.claude/CLAUDE.md was NOT modified.');
175
+ console.log(' Create your own configuration file if needed.');
176
+ }
177
+
178
+ function uninstall() {
179
+ log(colors.blue, 'Removing MyConvergio from ~/.claude/...\n');
180
+
181
+ const manifest = loadManifest();
182
+
183
+ if (manifest.files && manifest.files.length > 0) {
184
+ // Safe uninstall: only remove files we installed
185
+ log(colors.yellow, `Removing ${manifest.files.length} files installed by MyConvergio...\n`);
186
+
187
+ let removed = 0;
188
+ for (const file of manifest.files) {
189
+ if (fs.existsSync(file)) {
190
+ fs.unlinkSync(file);
191
+ removed++;
192
+ }
193
+ }
194
+
195
+ // Clean up empty directories
196
+ const dirs = ['agents', 'rules', 'skills'];
197
+ for (const dir of dirs) {
198
+ cleanEmptyDirs(path.join(CLAUDE_HOME, dir));
199
+ }
200
+
201
+ // Remove manifest
202
+ if (fs.existsSync(MANIFEST_FILE)) {
203
+ fs.unlinkSync(MANIFEST_FILE);
204
+ }
205
+
206
+ log(colors.green, ` ✓ Removed ${removed} files`);
207
+ console.log('');
208
+ log(colors.green, '✅ Uninstall complete!');
209
+ log(colors.yellow, 'Your custom files were preserved.');
210
+ } else {
211
+ // No manifest - warn user
212
+ log(colors.yellow, '⚠️ No installation manifest found.');
213
+ log(colors.yellow, 'This means MyConvergio was installed before manifest tracking,');
214
+ log(colors.yellow, 'or was installed via git clone.\n');
215
+ log(colors.yellow, 'To avoid deleting your custom files, please manually remove:');
216
+ console.log(' ~/.claude/agents/');
217
+ console.log(' ~/.claude/rules/');
218
+ console.log(' ~/.claude/skills/');
219
+ console.log('');
220
+ log(colors.yellow, 'Or use: make clean (if installed via git clone)');
221
+ }
222
+
223
+ console.log('');
224
+ log(colors.yellow, 'Note: ~/.claude/CLAUDE.md was NOT removed (user config).');
225
+ }
226
+
227
+ function cleanEmptyDirs(dir) {
228
+ if (!fs.existsSync(dir)) return;
229
+
230
+ const items = fs.readdirSync(dir);
231
+ for (const item of items) {
232
+ const fullPath = path.join(dir, item);
233
+ if (fs.statSync(fullPath).isDirectory()) {
234
+ cleanEmptyDirs(fullPath);
235
+ }
236
+ }
237
+
238
+ // Check if directory is now empty
239
+ if (fs.readdirSync(dir).length === 0) {
240
+ fs.rmdirSync(dir);
241
+ }
242
+ }
243
+
244
+ function showVersion() {
245
+ const version = getVersion();
246
+ log(colors.blue, `MyConvergio v${version}`);
247
+ console.log('');
248
+
249
+ const counts = countInstalled();
250
+ log(colors.blue, 'Installed Components:');
251
+ console.log(` Agents: ${counts.agents > 0 ? counts.agents : colors.red + 'not installed' + colors.reset}`);
252
+ console.log(` Rules: ${counts.rules > 0 ? counts.rules : colors.red + 'not installed' + colors.reset}`);
253
+ console.log(` Skills: ${counts.skills > 0 ? counts.skills : colors.red + 'not installed' + colors.reset}`);
254
+ }
255
+
256
+ function showHelp() {
257
+ console.log(`
258
+ ${colors.blue}MyConvergio - Claude Code Subagents Suite${colors.reset}
259
+
260
+ ${colors.yellow}Usage:${colors.reset}
261
+ myconvergio [command]
262
+
263
+ ${colors.yellow}Commands:${colors.reset}
264
+ install Install/reinstall agents, rules, and skills to ~/.claude/
265
+ uninstall Remove all installed components from ~/.claude/
266
+ version Show version and installation status
267
+ help Show this help message
268
+
269
+ ${colors.yellow}Examples:${colors.reset}
270
+ myconvergio install # Install or update components
271
+ myconvergio version # Check what's installed
272
+ myconvergio uninstall # Remove everything
273
+
274
+ ${colors.yellow}More info:${colors.reset}
275
+ https://github.com/roberdan/MyConvergio
276
+ `);
277
+ }
278
+
279
+ // Main
280
+ const args = process.argv.slice(2);
281
+ const command = args[0] || 'help';
282
+
283
+ switch (command) {
284
+ case 'install':
285
+ case 'reinstall':
286
+ case 'update':
287
+ install();
288
+ break;
289
+ case 'uninstall':
290
+ case 'remove':
291
+ uninstall();
292
+ break;
293
+ case 'version':
294
+ case '-v':
295
+ case '--version':
296
+ showVersion();
297
+ break;
298
+ case 'help':
299
+ case '-h':
300
+ case '--help':
301
+ default:
302
+ showHelp();
303
+ break;
304
+ }