oden-forge 2.0.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 (58) hide show
  1. package/.claude/CLAUDE.md +75 -0
  2. package/.claude/commands/oden/architect.md +204 -0
  3. package/.claude/commands/oden/checklist.md +199 -0
  4. package/.claude/commands/oden/daily.md +223 -0
  5. package/.claude/commands/oden/debug.md +203 -0
  6. package/.claude/commands/oden/epic.md +224 -0
  7. package/.claude/commands/oden/git.md +259 -0
  8. package/.claude/commands/oden/help.md +304 -0
  9. package/.claude/commands/oden/init-agents.md +268 -0
  10. package/.claude/commands/oden/init-mcp.md +460 -0
  11. package/.claude/commands/oden/init.md +495 -0
  12. package/.claude/commands/oden/mcp.md +585 -0
  13. package/.claude/commands/oden/prd.md +134 -0
  14. package/.claude/commands/oden/research.md +207 -0
  15. package/.claude/commands/oden/review.md +146 -0
  16. package/.claude/commands/oden/spec.md +539 -0
  17. package/.claude/commands/oden/sync.md +286 -0
  18. package/.claude/commands/oden/tasks.md +156 -0
  19. package/.claude/commands/oden/test.md +200 -0
  20. package/.claude/commands/oden/work.md +791 -0
  21. package/.claude/epics/.gitkeep +0 -0
  22. package/.claude/hooks/README.md +130 -0
  23. package/.claude/hooks/bash-worktree-fix.sh +189 -0
  24. package/.claude/prds/.gitkeep +0 -0
  25. package/.claude/rules/agent-coordination.md +224 -0
  26. package/.claude/rules/branch-operations.md +147 -0
  27. package/.claude/rules/datetime.md +118 -0
  28. package/.claude/rules/frontmatter-operations.md +58 -0
  29. package/.claude/rules/github-operations.md +89 -0
  30. package/.claude/rules/oden-methodology.md +111 -0
  31. package/.claude/rules/path-standards.md +155 -0
  32. package/.claude/rules/standard-patterns.md +174 -0
  33. package/.claude/rules/strip-frontmatter.md +82 -0
  34. package/.claude/rules/worktree-operations.md +136 -0
  35. package/.claude/scripts/oden/blocked.sh +72 -0
  36. package/.claude/scripts/oden/epic-list.sh +101 -0
  37. package/.claude/scripts/oden/epic-show.sh +91 -0
  38. package/.claude/scripts/oden/epic-status.sh +90 -0
  39. package/.claude/scripts/oden/help.sh +71 -0
  40. package/.claude/scripts/oden/in-progress.sh +74 -0
  41. package/.claude/scripts/oden/init.sh +192 -0
  42. package/.claude/scripts/oden/next.sh +65 -0
  43. package/.claude/scripts/oden/prd-list.sh +89 -0
  44. package/.claude/scripts/oden/prd-status.sh +63 -0
  45. package/.claude/scripts/oden/search.sh +71 -0
  46. package/.claude/scripts/oden/standup.sh +89 -0
  47. package/.claude/scripts/oden/status.sh +42 -0
  48. package/.claude/scripts/oden/validate.sh +101 -0
  49. package/.claude/settings.json +27 -0
  50. package/MIGRATION.md +217 -0
  51. package/README.md +368 -0
  52. package/bin/install.js +155 -0
  53. package/bin/migrate.js +191 -0
  54. package/bin/oden-forge.js +114 -0
  55. package/bin/post-install.js +47 -0
  56. package/bin/pre-uninstall.js +108 -0
  57. package/install.sh +231 -0
  58. package/package.json +76 -0
package/README.md ADDED
@@ -0,0 +1,368 @@
1
+ # Oden Forge
2
+
3
+ **Forja proyectos profesionales desde cero usando la metodología Documentation-First Development.**
4
+
5
+ Oden Forge es un sistema de skills para Claude Code que guía a desarrolladores a través de un wizard inteligente para crear proyectos completos siguiendo las mejores prácticas de la metodología Oden.
6
+
7
+ ## Filosofía
8
+
9
+ > "Documenta y diseña COMPLETAMENTE antes de codificar"
10
+
11
+ La metodología Oden se basa en tres principios:
12
+
13
+ 1. **Documentation-First**: Todo se documenta antes de escribir código
14
+ 2. **Design Sprint Adaptado**: Diseño rápido → Validación → Iteración
15
+ 3. **Entrega incremental**: Valor tangible cada semana
16
+
17
+ ## 🚀 Instalación
18
+
19
+ ### Método 1: NPM (Recomendado)
20
+ ```bash
21
+ # Instalación global
22
+ npm install -g oden-forge
23
+
24
+ # Uso inmediato en cualquier proyecto
25
+ cd tu-proyecto
26
+ claude-code
27
+ /oden:init
28
+ ```
29
+
30
+ ### Método 2: Instalación Directa
31
+ ```bash
32
+ # One-liner desde GitHub
33
+ curl -fsSL https://raw.githubusercontent.com/javikin/oden-forge/main/install-direct.sh | bash
34
+
35
+ # O descargar y ejecutar
36
+ wget https://raw.githubusercontent.com/javikin/oden-forge/main/install-direct.sh
37
+ chmod +x install-direct.sh
38
+ ./install-direct.sh
39
+ ```
40
+
41
+ ### Método 3: Git Clone (Legacy)
42
+ ```bash
43
+ git clone https://github.com/javikin/oden-forge.git
44
+ cd oden-forge
45
+ ./install.sh
46
+ ```
47
+
48
+ ### ✅ Verificar Instalación
49
+ ```bash
50
+ # Si instalaste con NPM
51
+ oden-forge status
52
+
53
+ # En Claude Code (todos los métodos)
54
+ /oden:help
55
+ ```
56
+
57
+ ## Comandos Disponibles
58
+
59
+ ### Inicialización y Setup
60
+ | Comando | Descripción |
61
+ |---------|-------------|
62
+ | `/oden:init` | Wizard interactivo para crear un proyecto desde cero |
63
+ | `/oden:init-agents [cat]` | Instalar agentes de desarrollo (core, frontend, backend, mobile, devops, data) |
64
+ | `/oden:init-mcp [cat]` | Instalar MCPs recomendados (essential, design, backend, testing, mobile, devops) |
65
+ | `/oden:help` | Mostrar ayuda y guías |
66
+
67
+ ### Fase Pre-Desarrollo
68
+ | Comando | Descripción |
69
+ |---------|-------------|
70
+ | `/oden:architect` | Crear technical-decisions.md (arquitectura, DB schema, stack) |
71
+ | `/oden:analyze` | Análisis competitivo y requisitos de negocio |
72
+ | `/oden:spec [módulo]` | Crear especificaciones detalladas por módulo (800+ líneas) |
73
+ | `/oden:plan` | Plan de implementación semana por semana |
74
+ | `/oden:checklist` | Verificar que todo esté listo antes de codificar |
75
+
76
+ ### Fase Desarrollo
77
+ | Comando | Descripción |
78
+ |---------|-------------|
79
+ | `/oden:daily` | Registrar progreso diario (DAY_X_COMPLETED.md) |
80
+ | `/oden:dev [agent]` | Invocar agentes de desarrollo (ver abajo) |
81
+ | `/oden:review` | Code review automático antes de PR |
82
+ | `/oden:test [sub]` | Testing - estrategia, ejecución, análisis |
83
+ | `/oden:debug [sub]` | Debugging - analizar errores y soluciones |
84
+ | `/oden:research [topic]` | Investigación técnica |
85
+ | `/oden:git [sub]` | Git workflow - branches, PRs, gestión |
86
+
87
+ ### Sincronización con GitHub (integración CCPM)
88
+ | Comando | Descripción |
89
+ |---------|-------------|
90
+ | `/oden:sync setup` | Configurar proyecto para sync con GitHub |
91
+ | `/oden:sync prd [nombre]` | Crear PRD (Product Requirement Document) |
92
+ | `/oden:sync epic [nombre]` | Convertir PRD a Epic técnico |
93
+ | `/oden:sync tasks [nombre]` | Descomponer Epic en tasks |
94
+ | `/oden:sync github [nombre]` | Push Epic y tasks a GitHub como issues |
95
+ | `/oden:sync start [nombre]` | Iniciar desarrollo en epic (worktree) |
96
+ | `/oden:sync issue [#]` | Trabajar en un issue específico |
97
+ | `/oden:sync close [#]` | Cerrar issue completado |
98
+ | `/oden:sync status` | Ver estado de sincronización |
99
+
100
+ ---
101
+
102
+ ## Agentes de Desarrollo (`/oden:dev`)
103
+
104
+ Durante la implementación, invoca agentes especializados:
105
+
106
+ ### Desarrollo de Código
107
+ | Comando | Agente | Uso |
108
+ |---------|--------|-----|
109
+ | `/oden:dev fullstack` | fullstack-developer | Desarrollo end-to-end |
110
+ | `/oden:dev frontend` | frontend-developer | UI/React components |
111
+ | `/oden:dev backend` | backend-architect | APIs y servicios |
112
+ | `/oden:dev mobile` | mobile-developer | React Native/Flutter |
113
+ | `/oden:dev ios` | ios-developer | Swift/SwiftUI nativo |
114
+
115
+ ### Base de Datos
116
+ | Comando | Agente | Uso |
117
+ |---------|--------|-----|
118
+ | `/oden:dev db` | database-architect | Diseño de schema |
119
+ | `/oden:dev db-optimize` | database-optimization | Optimizar queries |
120
+ | `/oden:dev supabase` | supabase-schema-architect | Supabase específico |
121
+
122
+ ### Testing y QA
123
+ | Comando | Agente | Uso |
124
+ |---------|--------|-----|
125
+ | `/oden:dev test` | test-engineer | Estrategia de testing |
126
+ | `/oden:dev debug` | debugger | Debugging de errores |
127
+ | `/oden:dev review` | code-reviewer | Code review |
128
+
129
+ ### DevOps
130
+ | Comando | Agente | Uso |
131
+ |---------|--------|-----|
132
+ | `/oden:dev devops` | devops-engineer | CI/CD, infraestructura |
133
+ | `/oden:dev deploy` | deployment-engineer | Deployments |
134
+ | `/oden:dev perf` | performance-engineer | Performance tuning |
135
+
136
+ ### Utilidades
137
+ | Comando | Agente | Uso |
138
+ |---------|--------|-----|
139
+ | `/oden:dev git` | git-flow-manager | Git workflow |
140
+ | `/oden:dev docs` | technical-writer | Documentación |
141
+ | `/oden:dev analyze-code` | code-analyzer | Análisis de código |
142
+
143
+ ---
144
+
145
+ ## Testing (`/oden:test`)
146
+
147
+ | Comando | Descripción |
148
+ |---------|-------------|
149
+ | `/oden:test strategy` | Crear estrategia de testing |
150
+ | `/oden:test run` | Ejecutar tests y analizar |
151
+ | `/oden:test fix` | Analizar fallos y sugerir fixes |
152
+ | `/oden:test coverage` | Analizar cobertura |
153
+ | `/oden:test generate [mod]` | Generar tests desde specs |
154
+
155
+ ---
156
+
157
+ ## Debugging (`/oden:debug`)
158
+
159
+ | Comando | Descripción |
160
+ |---------|-------------|
161
+ | `/oden:debug error [msg]` | Analizar error y sugerir solución |
162
+ | `/oden:debug logs [file]` | Analizar logs para patrones |
163
+ | `/oden:debug trace [fn]` | Trazar flujo de función |
164
+ | `/oden:debug perf [area]` | Analizar performance |
165
+ | `/oden:debug compare [branch]` | Comparar para encontrar regresión |
166
+
167
+ ---
168
+
169
+ ## Research (`/oden:research`)
170
+
171
+ | Comando | Descripción |
172
+ |---------|-------------|
173
+ | `/oden:research how [pregunta]` | Cómo implementar algo |
174
+ | `/oden:research compare [a] vs [b]` | Comparar tecnologías |
175
+ | `/oden:research best-practice [topic]` | Mejores prácticas |
176
+ | `/oden:research library [name]` | Investigar librería |
177
+ | `/oden:research docs [lib] [topic]` | Buscar documentación |
178
+
179
+ ---
180
+
181
+ ## Git Workflow (`/oden:git`)
182
+
183
+ | Comando | Descripción |
184
+ |---------|-------------|
185
+ | `/oden:git start [feature]` | Iniciar nueva feature |
186
+ | `/oden:git sync` | Sincronizar con main |
187
+ | `/oden:git pr` | Preparar y crear PR |
188
+ | `/oden:git status` | Estado detallado |
189
+ | `/oden:git finish` | Finalizar feature |
190
+
191
+ ---
192
+
193
+ ## El Wizard `/oden:init`
194
+
195
+ El wizard te guía a través de:
196
+
197
+ ### 1. Tipo de Proyecto
198
+ - Web Application (React, Next.js, Vue, etc.)
199
+ - Mobile App (React Native, Flutter, iOS, Android)
200
+ - Backend/API (Node.js, Python, Go, etc.)
201
+ - Full-Stack (combinaciones)
202
+
203
+ ### 2. Nivel de Experiencia
204
+ - Principiante: Explicaciones detalladas + guías de System Design
205
+ - Intermedio: Guías contextuales + mejores prácticas
206
+ - Avanzado: Solo lo esencial, decisiones rápidas
207
+
208
+ ### 3. Scope del Proyecto
209
+ - MVP (8-10 semanas): 30-40% features, rápido al mercado
210
+ - Modo Turbo (14-20 semanas): 100% profesional, enterprise-ready
211
+
212
+ ### 4. Stack Tecnológico
213
+ Basado en tus respuestas, recomienda:
214
+ - Framework frontend/backend
215
+ - Base de datos
216
+ - Servicios cloud
217
+ - Herramientas de desarrollo
218
+
219
+ ### 5. Estructura de Documentación
220
+ Crea automáticamente:
221
+ ```
222
+ docs/
223
+ ├── README.md
224
+ ├── guides/
225
+ ├── reference/
226
+ │ ├── technical-decisions.md
227
+ │ ├── competitive-analysis.md
228
+ │ ├── implementation-plan.md
229
+ │ └── modules/
230
+ ├── development/
231
+ │ ├── current/
232
+ │ └── completed/
233
+ ├── archived/
234
+ └── temp/
235
+ ```
236
+
237
+ ---
238
+
239
+ ## Agentes Pre-Desarrollo
240
+
241
+ | Agente | Rol | Entregables |
242
+ |--------|-----|-------------|
243
+ | `technical-architect` | Arquitectura y decisiones técnicas | technical-decisions.md (2000+ líneas) |
244
+ | `domain-expert` | Análisis de competencia y requisitos | competitive-analysis.md, user stories |
245
+ | `spec-writer` | Especificaciones detalladas | Specs de 800-1200 líneas por módulo |
246
+ | `implementation-planner` | Planificación semana por semana | implementation-plan.md |
247
+ | `daily-logger` | Documentación de progreso | DAY_X_COMPLETED.md |
248
+
249
+ ---
250
+
251
+ ## Métricas de Éxito
252
+
253
+ ### Durante Desarrollo
254
+ - 100% de módulos definidos antes de codificar
255
+ - 0 dependencias circulares
256
+ - Documentación > 8,000 líneas antes de primera línea de código
257
+ - Progreso diario documentado
258
+
259
+ ### Post-Lanzamiento
260
+ - Performance: < 100ms latencia crítica
261
+ - Uptime: 99.9%
262
+ - User satisfaction: NPS > 50
263
+
264
+ ---
265
+
266
+ ## Estructura del Proyecto
267
+
268
+ ```
269
+ oden/
270
+ ├── .claude/
271
+ │ ├── commands/oden/ # 52 comandos unificados
272
+ │ ├── scripts/oden/ # 14 scripts de soporte
273
+ │ ├── hooks/ # Hooks de git
274
+ │ ├── rules/ # 10 reglas de metodología
275
+ │ ├── prds/ # PRDs locales
276
+ │ └── epics/ # Epics locales
277
+ ├── install.sh # Instalador automático
278
+ ├── INSTALL.md # Guía de instalación
279
+ └── README.md
280
+ ```
281
+
282
+ ---
283
+
284
+ ## Flujo de Trabajo Completo
285
+
286
+ ```
287
+ ┌─────────────────────────────────────────────────────────────┐
288
+ │ SETUP INICIAL │
289
+ ├─────────────────────────────────────────────────────────────┤
290
+ │ /oden:init → Wizard de proyecto │
291
+ │ /oden:init-agents → Instalar agentes de desarrollo │
292
+ │ /oden:init-mcp → Instalar MCPs recomendados │
293
+ │ /oden:sync setup → Configurar GitHub │
294
+ └─────────────────────────────────────────────────────────────┘
295
+
296
+ ┌─────────────────────────────────────────────────────────────┐
297
+ │ PRE-DESARROLLO (1-2 semanas) │
298
+ ├─────────────────────────────────────────────────────────────┤
299
+ │ /oden:architect → technical-decisions.md (2000+ loc) │
300
+ │ ↓ │
301
+ │ /oden:analyze → competitive-analysis.md │
302
+ │ ↓ │
303
+ │ /oden:spec auth → auth-spec.md (800+ loc) │
304
+ │ /oden:spec orders → orders-spec.md (800+ loc) │
305
+ │ ↓ │
306
+ │ /oden:plan → implementation-plan.md │
307
+ │ ↓ │
308
+ │ /oden:checklist → ✅ Ready to code! │
309
+ └─────────────────────────────────────────────────────────────┘
310
+
311
+ ┌─────────────────────────────────────────────────────────────┐
312
+ │ CREAR FEATURES (CCPM) │
313
+ ├─────────────────────────────────────────────────────────────┤
314
+ │ /oden:sync prd auth → Crear PRD │
315
+ │ ↓ │
316
+ │ /oden:sync epic auth → Convertir a Epic técnico │
317
+ │ ↓ │
318
+ │ /oden:sync tasks auth → Descomponer en tasks │
319
+ │ ↓ │
320
+ │ /oden:sync github auth → Push a GitHub como issues │
321
+ └─────────────────────────────────────────────────────────────┘
322
+
323
+ ┌─────────────────────────────────────────────────────────────┐
324
+ │ DESARROLLO (8-18 semanas) │
325
+ ├─────────────────────────────────────────────────────────────┤
326
+ │ /oden:sync start auth → Iniciar epic (worktree) │
327
+ │ ↓ │
328
+ │ /oden:sync issue #123 → Trabajar en issue │
329
+ │ /oden:dev fullstack → Implementar según specs │
330
+ │ /oden:test run → Ejecutar tests │
331
+ │ /oden:debug error → Resolver problemas │
332
+ │ ↓ │
333
+ │ /oden:daily → DAY_X_COMPLETED.md │
334
+ │ ↓ │
335
+ │ /oden:sync close #123 → Cerrar issue │
336
+ │ /oden:review → Code review │
337
+ │ /oden:git pr → Create PR │
338
+ └─────────────────────────────────────────────────────────────┘
339
+ ```
340
+
341
+ ---
342
+
343
+ ## Requisitos
344
+
345
+ ```bash
346
+ # GitHub CLI instalado y autenticado (para sync con GitHub)
347
+ gh auth status
348
+
349
+ # Git configurado
350
+ git --version
351
+ ```
352
+
353
+ ---
354
+
355
+ ## Inspiración
356
+
357
+ Oden está inspirado en:
358
+ - [CCPM](https://github.com/automazeio/ccpm) - Claude Code Project Manager
359
+ - Metodología Oden - Documentation-First Development
360
+ - Design Sprints de Google Ventures
361
+
362
+ ## Contribuir
363
+
364
+ ¿Ideas para mejorar Oden Forge? Abre un issue o PR.
365
+
366
+ ## Licencia
367
+
368
+ MIT
package/bin/install.js ADDED
@@ -0,0 +1,155 @@
1
+ #!/usr/bin/env node
2
+
3
+ const chalk = require('chalk');
4
+ const fs = require('fs-extra');
5
+ const path = require('path');
6
+ const inquirer = require('inquirer');
7
+
8
+ async function install(options = {}) {
9
+ console.log('\n' + chalk.blue('🔨 Installing Oden Forge 2.0'));
10
+ console.log(chalk.blue('═'.repeat(50)));
11
+
12
+ const claudeDir = path.join(process.env.HOME, '.claude');
13
+ const packageDir = path.dirname(__dirname);
14
+
15
+ // Check for legacy installations
16
+ const legacyPaths = await checkLegacyInstallations();
17
+
18
+ if (legacyPaths.length > 0 && !options.force) {
19
+ console.log(chalk.yellow('\n⚠️ Legacy installations detected:'));
20
+ legacyPaths.forEach(p => console.log(chalk.gray(` ${p.path} (${p.type})`)));
21
+
22
+ const { shouldMigrate } = await inquirer.prompt([{
23
+ type: 'confirm',
24
+ name: 'shouldMigrate',
25
+ message: 'Would you like to clean up and migrate automatically?',
26
+ default: true
27
+ }]);
28
+
29
+ if (shouldMigrate) {
30
+ await cleanLegacyInstallations(legacyPaths);
31
+ }
32
+ }
33
+
34
+ // Create Claude directory if it doesn't exist
35
+ if (!fs.existsSync(claudeDir)) {
36
+ console.log(chalk.yellow('📁 Creating ~/.claude directory...'));
37
+ fs.ensureDirSync(claudeDir);
38
+ }
39
+
40
+ try {
41
+ // Install commands
42
+ console.log(chalk.yellow('📝 Installing commands...'));
43
+ const commandsSource = path.join(packageDir, '.claude', 'commands', 'oden');
44
+ const commandsTarget = path.join(claudeDir, 'commands', 'oden');
45
+
46
+ if (fs.existsSync(commandsSource)) {
47
+ fs.ensureDirSync(path.dirname(commandsTarget));
48
+ fs.copySync(commandsSource, commandsTarget);
49
+ const commandCount = fs.readdirSync(commandsTarget).filter(f => f.endsWith('.md')).length;
50
+ console.log(chalk.green(`✅ ${commandCount} commands installed`));
51
+ }
52
+
53
+ // Install scripts
54
+ console.log(chalk.yellow('🔧 Installing scripts...'));
55
+ const scriptsSource = path.join(packageDir, '.claude', 'scripts', 'oden');
56
+ const scriptsTarget = path.join(claudeDir, 'scripts', 'oden');
57
+
58
+ if (fs.existsSync(scriptsSource)) {
59
+ fs.ensureDirSync(path.dirname(scriptsTarget));
60
+ fs.copySync(scriptsSource, scriptsTarget);
61
+ // Make scripts executable
62
+ const scripts = fs.readdirSync(scriptsTarget).filter(f => f.endsWith('.sh'));
63
+ scripts.forEach(script => {
64
+ fs.chmodSync(path.join(scriptsTarget, script), 0o755);
65
+ });
66
+ console.log(chalk.green(`✅ ${scripts.length} scripts installed`));
67
+ }
68
+
69
+ // Install rules
70
+ console.log(chalk.yellow('📋 Installing rules...'));
71
+ const rulesSource = path.join(packageDir, '.claude', 'rules');
72
+ const rulesTarget = path.join(claudeDir, 'rules');
73
+
74
+ if (fs.existsSync(rulesSource)) {
75
+ fs.ensureDirSync(rulesTarget);
76
+ fs.copySync(rulesSource, rulesTarget);
77
+ const ruleCount = fs.readdirSync(rulesTarget).filter(f => f.endsWith('.md')).length;
78
+ console.log(chalk.green(`✅ ${ruleCount} rules installed`));
79
+ }
80
+
81
+ // Create working directories
82
+ console.log(chalk.yellow('📂 Creating working directories...'));
83
+ const workDirs = ['prds', 'epics'];
84
+ workDirs.forEach(dir => {
85
+ const dirPath = path.join(claudeDir, dir);
86
+ fs.ensureDirSync(dirPath);
87
+ fs.ensureFileSync(path.join(dirPath, '.gitkeep'));
88
+ });
89
+ console.log(chalk.green(`✅ Working directories created`));
90
+
91
+ // Success message
92
+ console.log('\n' + chalk.green('🎉 Installation Complete!'));
93
+ console.log(chalk.green('═'.repeat(30)));
94
+ console.log(chalk.white('📍 Location: ' + chalk.gray(claudeDir)));
95
+ console.log(chalk.white('🚀 Usage: Open Claude Code and run /oden:init'));
96
+ console.log(chalk.white('📚 Help: /oden:help'));
97
+ console.log(chalk.white('📖 Docs: https://javikin.github.io/oden-forge'));
98
+ console.log('');
99
+
100
+ } catch (error) {
101
+ console.log(chalk.red('\n❌ Installation failed:'), error.message);
102
+ process.exit(1);
103
+ }
104
+ }
105
+
106
+ async function checkLegacyInstallations() {
107
+ const claudeDir = path.join(process.env.HOME, '.claude');
108
+ const legacyPaths = [];
109
+
110
+ // Check for old Oden Forge v1
111
+ const oldOdenPaths = [
112
+ path.join(claudeDir, 'commands', 'pm'),
113
+ path.join(claudeDir, 'commands', 'ccpm'),
114
+ path.join(claudeDir, 'scripts', 'pm'),
115
+ path.join(claudeDir, 'scripts', 'ccpm')
116
+ ];
117
+
118
+ oldOdenPaths.forEach(p => {
119
+ if (fs.existsSync(p)) {
120
+ legacyPaths.push({ path: p, type: 'Oden Forge v1' });
121
+ }
122
+ });
123
+
124
+ // Check for CCPM installations
125
+ const ccpmPaths = [
126
+ path.join(process.env.HOME, '.ccpm'),
127
+ path.join(claudeDir, 'ccpm')
128
+ ];
129
+
130
+ ccpmPaths.forEach(p => {
131
+ if (fs.existsSync(p)) {
132
+ legacyPaths.push({ path: p, type: 'CCPM' });
133
+ }
134
+ });
135
+
136
+ return legacyPaths;
137
+ }
138
+
139
+ async function cleanLegacyInstallations(legacyPaths) {
140
+ console.log(chalk.yellow('\n🧹 Cleaning legacy installations...'));
141
+
142
+ for (const legacy of legacyPaths) {
143
+ try {
144
+ console.log(chalk.gray(` Removing: ${legacy.path}`));
145
+ fs.removeSync(legacy.path);
146
+ console.log(chalk.green(` ✅ Removed ${legacy.type}`));
147
+ } catch (error) {
148
+ console.log(chalk.red(` ❌ Failed to remove ${legacy.path}: ${error.message}`));
149
+ }
150
+ }
151
+
152
+ console.log(chalk.green('✅ Legacy cleanup complete'));
153
+ }
154
+
155
+ module.exports = { install, checkLegacyInstallations, cleanLegacyInstallations };