claude-agent-framework 1.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.
- package/README.md +128 -0
- package/bin/claude-framework +3 -0
- package/framework/agents/design-lead.md +240 -0
- package/framework/agents/product-owner.md +179 -0
- package/framework/agents/tech-lead.md +226 -0
- package/framework/commands/ayuda.md +127 -0
- package/framework/commands/a/303/261adir.md +98 -0
- package/framework/commands/backup.md +397 -0
- package/framework/commands/cambiar.md +110 -0
- package/framework/commands/cloud.md +457 -0
- package/framework/commands/code.md +142 -0
- package/framework/commands/debug.md +334 -0
- package/framework/commands/deploy.md +383 -0
- package/framework/commands/deshacer.md +120 -0
- package/framework/commands/estado.md +218 -0
- package/framework/commands/explica.md +227 -0
- package/framework/commands/feature.md +120 -0
- package/framework/commands/git.md +427 -0
- package/framework/commands/historial.md +202 -0
- package/framework/commands/learn.md +408 -0
- package/framework/commands/movil.md +245 -0
- package/framework/commands/nuevo.md +118 -0
- package/framework/commands/plan.md +134 -0
- package/framework/commands/prd.md +113 -0
- package/framework/commands/probar.md +148 -0
- package/framework/commands/revisar.md +208 -0
- package/framework/commands/seeds.md +230 -0
- package/framework/commands/seguridad.md +226 -0
- package/framework/commands/tasks.md +157 -0
- package/framework/skills/architecture/algorithms.md +970 -0
- package/framework/skills/architecture/clean-code.md +1080 -0
- package/framework/skills/architecture/design-patterns.md +1984 -0
- package/framework/skills/architecture/functional-programming.md +972 -0
- package/framework/skills/architecture/solid.md +991 -0
- package/framework/skills/cloud/cloud-aws.md +848 -0
- package/framework/skills/cloud/cloud-azure.md +931 -0
- package/framework/skills/cloud/cloud-gcp.md +848 -0
- package/framework/skills/cloud/message-queues.md +1229 -0
- package/framework/skills/core/accessibility.md +401 -0
- package/framework/skills/core/api.md +474 -0
- package/framework/skills/core/authentication.md +306 -0
- package/framework/skills/core/authorization.md +388 -0
- package/framework/skills/core/background-jobs.md +341 -0
- package/framework/skills/core/caching.md +473 -0
- package/framework/skills/core/code-review.md +341 -0
- package/framework/skills/core/controllers.md +290 -0
- package/framework/skills/core/cua.md +285 -0
- package/framework/skills/core/documentation.md +472 -0
- package/framework/skills/core/file-uploads.md +351 -0
- package/framework/skills/core/hotwire-native.md +296 -0
- package/framework/skills/core/hotwire.md +278 -0
- package/framework/skills/core/i18n.md +334 -0
- package/framework/skills/core/imports-exports.md +750 -0
- package/framework/skills/core/infrastructure.md +337 -0
- package/framework/skills/core/models.md +228 -0
- package/framework/skills/core/notifications.md +672 -0
- package/framework/skills/core/payments.md +581 -0
- package/framework/skills/core/performance.md +361 -0
- package/framework/skills/core/rails-scaffold.md +131 -0
- package/framework/skills/core/search.md +518 -0
- package/framework/skills/core/security.md +565 -0
- package/framework/skills/core/seeds.md +307 -0
- package/framework/skills/core/seo.md +542 -0
- package/framework/skills/core/testing.md +393 -0
- package/framework/skills/core/views.md +260 -0
- package/framework/skills/core/websockets.md +564 -0
- package/framework/skills/data/advanced-sql.md +1204 -0
- package/framework/skills/data/nosql.md +1141 -0
- package/framework/skills/devops/containers-advanced.md +1237 -0
- package/framework/skills/devops/debugging.md +834 -0
- package/framework/skills/devops/git-workflow.md +752 -0
- package/framework/skills/devops/networking.md +932 -0
- package/framework/skills/devops/shell-scripting.md +1132 -0
- package/framework/sub-agents/architecture-patterns-agent.md +1450 -0
- package/framework/sub-agents/cloud-agent.md +677 -0
- package/framework/sub-agents/data.md +504 -0
- package/framework/sub-agents/debugging-agent.md +554 -0
- package/framework/sub-agents/devops.md +483 -0
- package/framework/sub-agents/docs.md +176 -0
- package/framework/sub-agents/frontend-dev.md +349 -0
- package/framework/sub-agents/git-workflow-agent.md +697 -0
- package/framework/sub-agents/integrations.md +630 -0
- package/framework/sub-agents/native-dev.md +434 -0
- package/framework/sub-agents/qa.md +138 -0
- package/framework/sub-agents/rails-dev.md +375 -0
- package/framework/sub-agents/security.md +526 -0
- package/framework/sub-agents/ui.md +437 -0
- package/framework/sub-agents/ux.md +284 -0
- package/framework/templates/api-spec.md +500 -0
- package/framework/templates/component-spec.md +248 -0
- package/framework/templates/feature.json +13 -0
- package/framework/templates/model-spec.md +318 -0
- package/framework/templates/prd-template.md +80 -0
- package/framework/templates/task-plan.md +122 -0
- package/framework/templates/task-user-story.md +52 -0
- package/framework/templates/technical-spec.md +260 -0
- package/framework/templates/user-story.md +95 -0
- package/package.json +42 -0
- package/project-templates/CLAUDE.md +42 -0
- package/project-templates/contexts/architecture.md +25 -0
- package/project-templates/contexts/conventions.md +46 -0
- package/project-templates/contexts/design-system.md +47 -0
- package/project-templates/contexts/requirements.md +38 -0
- package/project-templates/contexts/stack.md +30 -0
- package/project-templates/history/active/models.md +11 -0
- package/project-templates/history/changelog.md +15 -0
- package/project-templates/workspace/.gitkeep +0 -0
- package/src/cli.js +52 -0
- package/src/init.js +104 -0
- package/src/status.js +75 -0
- package/src/update.js +88 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Design System
|
|
2
|
+
|
|
3
|
+
## Colores
|
|
4
|
+
|
|
5
|
+
### Primarios
|
|
6
|
+
- Primary: [Por definir]
|
|
7
|
+
- Secondary: [Por definir]
|
|
8
|
+
|
|
9
|
+
### Neutros
|
|
10
|
+
- Background: #ffffff
|
|
11
|
+
- Text: #1a1a1a
|
|
12
|
+
- Border: #e5e5e5
|
|
13
|
+
|
|
14
|
+
### Estados
|
|
15
|
+
- Success: #22c55e
|
|
16
|
+
- Warning: #f59e0b
|
|
17
|
+
- Error: #ef4444
|
|
18
|
+
- Info: #3b82f6
|
|
19
|
+
|
|
20
|
+
## Tipografia
|
|
21
|
+
|
|
22
|
+
### Fuentes
|
|
23
|
+
- Headings: System UI
|
|
24
|
+
- Body: System UI
|
|
25
|
+
- Mono: Monospace
|
|
26
|
+
|
|
27
|
+
### Escalas
|
|
28
|
+
- xs: 0.75rem
|
|
29
|
+
- sm: 0.875rem
|
|
30
|
+
- base: 1rem
|
|
31
|
+
- lg: 1.125rem
|
|
32
|
+
- xl: 1.25rem
|
|
33
|
+
- 2xl: 1.5rem
|
|
34
|
+
- 3xl: 1.875rem
|
|
35
|
+
- 4xl: 2.25rem
|
|
36
|
+
|
|
37
|
+
## Espaciado
|
|
38
|
+
|
|
39
|
+
Usar escala de Tailwind: 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24...
|
|
40
|
+
|
|
41
|
+
## Componentes
|
|
42
|
+
|
|
43
|
+
*Se documentaran aqui los componentes reutilizables.*
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
*Este documento se actualiza por el Design Lead.*
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Requisitos del Proyecto
|
|
2
|
+
|
|
3
|
+
## Informacion General
|
|
4
|
+
|
|
5
|
+
| Campo | Valor |
|
|
6
|
+
|-------|-------|
|
|
7
|
+
| Nombre del proyecto | [Por definir] |
|
|
8
|
+
| Descripcion | [Por definir] |
|
|
9
|
+
| Fecha de inicio | [Por definir] |
|
|
10
|
+
| Estado | No iniciado |
|
|
11
|
+
|
|
12
|
+
## Usuarios
|
|
13
|
+
|
|
14
|
+
### Tipos de usuario
|
|
15
|
+
- [Por definir]
|
|
16
|
+
|
|
17
|
+
### Necesidades principales
|
|
18
|
+
- [Por definir]
|
|
19
|
+
|
|
20
|
+
## Funcionalidades
|
|
21
|
+
|
|
22
|
+
### MVP (Minimo Producto Viable)
|
|
23
|
+
1. [Por definir]
|
|
24
|
+
|
|
25
|
+
### Futuras mejoras
|
|
26
|
+
- [Por definir]
|
|
27
|
+
|
|
28
|
+
## Restricciones
|
|
29
|
+
|
|
30
|
+
### Tecnicas
|
|
31
|
+
- [Por definir]
|
|
32
|
+
|
|
33
|
+
### De negocio
|
|
34
|
+
- [Por definir]
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
*Este documento se actualiza durante el discovery con el Product Owner.*
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Stack Tecnologico
|
|
2
|
+
|
|
3
|
+
## Backend
|
|
4
|
+
- **Framework**: Ruby on Rails 8.1
|
|
5
|
+
- **Base de datos**: SQLite3
|
|
6
|
+
- **Jobs en segundo plano**: Solid Queue
|
|
7
|
+
- **Cache**: Solid Cache
|
|
8
|
+
|
|
9
|
+
## Frontend
|
|
10
|
+
- **Estilos**: Tailwind CSS
|
|
11
|
+
- **Interactividad**: Hotwire (Turbo + Stimulus)
|
|
12
|
+
- **Componentes**: ViewComponent
|
|
13
|
+
|
|
14
|
+
## Movil
|
|
15
|
+
- **Framework**: Hotwire Native
|
|
16
|
+
- **Plataformas**: iOS, Android
|
|
17
|
+
|
|
18
|
+
## Testing
|
|
19
|
+
- **Framework**: RSpec
|
|
20
|
+
- **Factories**: FactoryBot
|
|
21
|
+
- **E2E**: Capybara
|
|
22
|
+
|
|
23
|
+
## Autenticacion y Autorizacion
|
|
24
|
+
- **Autenticacion**: Rails 8 Authentication Generator
|
|
25
|
+
- **Autorizacion**: Pundit
|
|
26
|
+
|
|
27
|
+
## Otros
|
|
28
|
+
- **Archivos**: Active Storage
|
|
29
|
+
- **Emails**: Action Mailer
|
|
30
|
+
- **Tiempo real**: Action Cable
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Registro de todos los cambios realizados en el proyecto.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## [Fecha] - Inicio del proyecto
|
|
8
|
+
|
|
9
|
+
- **Tipo**: Inicializacion
|
|
10
|
+
- **Descripcion**: Proyecto creado con claude-agent-framework
|
|
11
|
+
- **Archivos**: Estructura inicial
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
*Este archivo se actualiza automaticamente con cada cambio.*
|
|
File without changes
|
package/src/cli.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const { program } = require('commander');
|
|
2
|
+
const pkg = require('../package.json');
|
|
3
|
+
const init = require('./init');
|
|
4
|
+
const update = require('./update');
|
|
5
|
+
const status = require('./status');
|
|
6
|
+
|
|
7
|
+
program
|
|
8
|
+
.name('claude-framework')
|
|
9
|
+
.description('Framework de agentes para desarrollo con Claude Code')
|
|
10
|
+
.version(pkg.version);
|
|
11
|
+
|
|
12
|
+
program
|
|
13
|
+
.command('init')
|
|
14
|
+
.description('Inicializa el framework en el directorio actual')
|
|
15
|
+
.option('-f, --force', 'Sobrescribir si ya existe .claude/')
|
|
16
|
+
.option('-d, --dir <path>', 'Directorio destino (default: directorio actual)')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
try {
|
|
19
|
+
await init(options);
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error('Error:', error.message);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
program
|
|
27
|
+
.command('update')
|
|
28
|
+
.description('Actualiza el framework a la ultima version')
|
|
29
|
+
.option('-f, --force', 'Forzar reinstalacion aunque sea la misma version')
|
|
30
|
+
.option('-b, --backup', 'Crear backup antes de actualizar')
|
|
31
|
+
.action(async (options) => {
|
|
32
|
+
try {
|
|
33
|
+
await update(options);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error('Error:', error.message);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
program
|
|
41
|
+
.command('status')
|
|
42
|
+
.description('Muestra la version instalada del framework')
|
|
43
|
+
.action(async () => {
|
|
44
|
+
try {
|
|
45
|
+
await status();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error('Error:', error.message);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
program.parse();
|
package/src/init.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
const FRAMEWORK_DIRS = ['agents', 'sub-agents', 'skills', 'commands', 'templates'];
|
|
6
|
+
const PROJECT_DIRS = ['contexts', 'history', 'history/active', 'workspace'];
|
|
7
|
+
|
|
8
|
+
async function init(options = {}) {
|
|
9
|
+
const targetDir = options.dir || process.cwd();
|
|
10
|
+
const claudeDir = path.join(targetDir, '.claude');
|
|
11
|
+
|
|
12
|
+
console.log(chalk.blue('Inicializando claude-agent-framework...'));
|
|
13
|
+
|
|
14
|
+
// Verificar si ya existe
|
|
15
|
+
if (fs.existsSync(claudeDir) && !options.force) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
'.claude/ ya existe. Usa --force para sobrescribir el framework (no tocara tus contexts/history).'
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Crear directorio .claude si no existe
|
|
22
|
+
await fs.ensureDir(claudeDir);
|
|
23
|
+
|
|
24
|
+
// Obtener ruta del paquete instalado
|
|
25
|
+
const packageRoot = path.join(__dirname, '..');
|
|
26
|
+
const frameworkSrc = path.join(packageRoot, 'framework');
|
|
27
|
+
const templatesSrc = path.join(packageRoot, 'project-templates');
|
|
28
|
+
|
|
29
|
+
// Copiar framework (siempre sobrescribe)
|
|
30
|
+
console.log(chalk.gray(' Copiando framework...'));
|
|
31
|
+
for (const dir of FRAMEWORK_DIRS) {
|
|
32
|
+
const src = path.join(frameworkSrc, dir);
|
|
33
|
+
const dest = path.join(claudeDir, dir);
|
|
34
|
+
if (fs.existsSync(src)) {
|
|
35
|
+
await fs.copy(src, dest);
|
|
36
|
+
console.log(chalk.gray(` + ${dir}/`));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Copiar templates de proyecto (solo si no existen)
|
|
41
|
+
console.log(chalk.gray(' Creando estructura de proyecto...'));
|
|
42
|
+
for (const dir of PROJECT_DIRS) {
|
|
43
|
+
const dest = path.join(claudeDir, dir);
|
|
44
|
+
if (!fs.existsSync(dest)) {
|
|
45
|
+
await fs.ensureDir(dest);
|
|
46
|
+
console.log(chalk.gray(` + ${dir}/`));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Copiar archivos de contexto template (solo si no existen)
|
|
51
|
+
const contextsSrc = path.join(templatesSrc, 'contexts');
|
|
52
|
+
const contextsDest = path.join(claudeDir, 'contexts');
|
|
53
|
+
if (fs.existsSync(contextsSrc)) {
|
|
54
|
+
const files = await fs.readdir(contextsSrc);
|
|
55
|
+
for (const file of files) {
|
|
56
|
+
const destFile = path.join(contextsDest, file);
|
|
57
|
+
if (!fs.existsSync(destFile)) {
|
|
58
|
+
await fs.copy(path.join(contextsSrc, file), destFile);
|
|
59
|
+
console.log(chalk.gray(` + contexts/${file}`));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Copiar CLAUDE.md template (solo si no existe)
|
|
65
|
+
const claudeMdSrc = path.join(templatesSrc, 'CLAUDE.md');
|
|
66
|
+
const claudeMdDest = path.join(targetDir, 'CLAUDE.md');
|
|
67
|
+
if (fs.existsSync(claudeMdSrc) && !fs.existsSync(claudeMdDest)) {
|
|
68
|
+
await fs.copy(claudeMdSrc, claudeMdDest);
|
|
69
|
+
console.log(chalk.gray(' + CLAUDE.md'));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Crear features/ si no existe
|
|
73
|
+
const featuresDir = path.join(targetDir, 'features');
|
|
74
|
+
if (!fs.existsSync(featuresDir)) {
|
|
75
|
+
await fs.ensureDir(featuresDir);
|
|
76
|
+
await fs.writeFile(path.join(featuresDir, '.gitkeep'), '');
|
|
77
|
+
console.log(chalk.gray(' + features/'));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Guardar version del framework
|
|
81
|
+
const pkg = require('../package.json');
|
|
82
|
+
await fs.writeJson(path.join(claudeDir, '.framework-version.json'), {
|
|
83
|
+
version: pkg.version,
|
|
84
|
+
installedAt: new Date().toISOString()
|
|
85
|
+
}, { spaces: 2 });
|
|
86
|
+
|
|
87
|
+
console.log('');
|
|
88
|
+
console.log(chalk.green(`Framework v${pkg.version} instalado correctamente.`));
|
|
89
|
+
console.log('');
|
|
90
|
+
console.log('Estructura creada:');
|
|
91
|
+
console.log(chalk.cyan(' .claude/'));
|
|
92
|
+
console.log(chalk.cyan(' ├── agents/ ') + chalk.gray('# Agentes principales (PO, Tech Lead, Design Lead)'));
|
|
93
|
+
console.log(chalk.cyan(' ├── sub-agents/ ') + chalk.gray('# Sub-agentes especializados'));
|
|
94
|
+
console.log(chalk.cyan(' ├── skills/ ') + chalk.gray('# Capacidades tecnicas'));
|
|
95
|
+
console.log(chalk.cyan(' ├── commands/ ') + chalk.gray('# Comandos disponibles'));
|
|
96
|
+
console.log(chalk.cyan(' ├── templates/ ') + chalk.gray('# Plantillas de documentos'));
|
|
97
|
+
console.log(chalk.cyan(' ├── contexts/ ') + chalk.gray('# Contexto de tu proyecto'));
|
|
98
|
+
console.log(chalk.cyan(' ├── history/ ') + chalk.gray('# Historial de cambios'));
|
|
99
|
+
console.log(chalk.cyan(' └── workspace/ ') + chalk.gray('# Archivos de trabajo'));
|
|
100
|
+
console.log('');
|
|
101
|
+
console.log('Siguiente paso: Abre Claude Code y escribe tu idea!');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
module.exports = init;
|
package/src/status.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
async function status() {
|
|
6
|
+
const claudeDir = path.join(process.cwd(), '.claude');
|
|
7
|
+
const versionFile = path.join(claudeDir, '.framework-version.json');
|
|
8
|
+
const pkg = require('../package.json');
|
|
9
|
+
|
|
10
|
+
console.log(chalk.blue('claude-agent-framework'));
|
|
11
|
+
console.log('');
|
|
12
|
+
|
|
13
|
+
// Version del CLI instalado globalmente
|
|
14
|
+
console.log(`CLI version: ${chalk.cyan(pkg.version)}`);
|
|
15
|
+
|
|
16
|
+
// Version del framework en este proyecto
|
|
17
|
+
if (!fs.existsSync(claudeDir)) {
|
|
18
|
+
console.log(`Proyecto: ${chalk.yellow('No inicializado')}`);
|
|
19
|
+
console.log('');
|
|
20
|
+
console.log('Ejecuta: claude-framework init');
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!fs.existsSync(versionFile)) {
|
|
25
|
+
console.log(`Proyecto: ${chalk.yellow('Version desconocida (pre-CLI)')}`);
|
|
26
|
+
console.log('');
|
|
27
|
+
console.log('Ejecuta: claude-framework update');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const data = await fs.readJson(versionFile);
|
|
32
|
+
|
|
33
|
+
console.log(`Proyecto version: ${chalk.cyan(data.version)}`);
|
|
34
|
+
console.log(`Instalado: ${chalk.gray(new Date(data.installedAt).toLocaleString())}`);
|
|
35
|
+
|
|
36
|
+
if (data.previousVersion) {
|
|
37
|
+
console.log(`Version anterior: ${chalk.gray(data.previousVersion)}`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log('');
|
|
41
|
+
|
|
42
|
+
// Comparar versiones
|
|
43
|
+
if (data.version === pkg.version) {
|
|
44
|
+
console.log(chalk.green('El framework esta actualizado.'));
|
|
45
|
+
} else {
|
|
46
|
+
console.log(chalk.yellow(`Actualizacion disponible: v${data.version} -> v${pkg.version}`));
|
|
47
|
+
console.log('Ejecuta: claude-framework update');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Mostrar estructura
|
|
51
|
+
console.log('');
|
|
52
|
+
console.log('Estructura del proyecto:');
|
|
53
|
+
|
|
54
|
+
const dirs = [
|
|
55
|
+
{ name: 'agents', desc: 'Agentes principales', isFramework: true },
|
|
56
|
+
{ name: 'sub-agents', desc: 'Sub-agentes', isFramework: true },
|
|
57
|
+
{ name: 'skills', desc: 'Capacidades tecnicas', isFramework: true },
|
|
58
|
+
{ name: 'commands', desc: 'Comandos', isFramework: true },
|
|
59
|
+
{ name: 'templates', desc: 'Plantillas', isFramework: true },
|
|
60
|
+
{ name: 'contexts', desc: 'Tu contexto', isFramework: false },
|
|
61
|
+
{ name: 'history', desc: 'Tu historial', isFramework: false },
|
|
62
|
+
{ name: 'workspace', desc: 'Tu workspace', isFramework: false }
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
for (const dir of dirs) {
|
|
66
|
+
const dirPath = path.join(claudeDir, dir.name);
|
|
67
|
+
const exists = fs.existsSync(dirPath);
|
|
68
|
+
const icon = exists ? chalk.green('✓') : chalk.red('✗');
|
|
69
|
+
const label = dir.isFramework ? chalk.cyan(dir.name) : chalk.white(dir.name);
|
|
70
|
+
const tag = dir.isFramework ? chalk.gray('[framework]') : chalk.gray('[proyecto]');
|
|
71
|
+
console.log(` ${icon} ${label.padEnd(20)} ${tag}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = status;
|
package/src/update.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
const FRAMEWORK_DIRS = ['agents', 'sub-agents', 'skills', 'commands', 'templates'];
|
|
6
|
+
|
|
7
|
+
async function update(options = {}) {
|
|
8
|
+
const targetDir = process.cwd();
|
|
9
|
+
const claudeDir = path.join(targetDir, '.claude');
|
|
10
|
+
|
|
11
|
+
// Verificar que existe .claude/
|
|
12
|
+
if (!fs.existsSync(claudeDir)) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
'No se encontro .claude/ en este directorio.\n' +
|
|
15
|
+
'Ejecuta primero: claude-framework init'
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Leer version actual
|
|
20
|
+
const versionFile = path.join(claudeDir, '.framework-version.json');
|
|
21
|
+
let currentVersion = '0.0.0';
|
|
22
|
+
let installedAt = 'desconocido';
|
|
23
|
+
|
|
24
|
+
if (fs.existsSync(versionFile)) {
|
|
25
|
+
const data = await fs.readJson(versionFile);
|
|
26
|
+
currentVersion = data.version;
|
|
27
|
+
installedAt = data.installedAt;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const pkg = require('../package.json');
|
|
31
|
+
|
|
32
|
+
console.log(chalk.blue('Actualizando claude-agent-framework...'));
|
|
33
|
+
console.log(chalk.gray(` Version actual: ${currentVersion}`));
|
|
34
|
+
console.log(chalk.gray(` Version nueva: ${pkg.version}`));
|
|
35
|
+
|
|
36
|
+
// Verificar si ya tiene la version actual
|
|
37
|
+
if (currentVersion === pkg.version && !options.force) {
|
|
38
|
+
console.log('');
|
|
39
|
+
console.log(chalk.yellow('Ya tienes la ultima version.'));
|
|
40
|
+
console.log(chalk.gray('Usa --force para reinstalar.'));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Crear backup si se solicita
|
|
45
|
+
if (options.backup) {
|
|
46
|
+
const backupDir = path.join(claudeDir, `.backup-${currentVersion}-${Date.now()}`);
|
|
47
|
+
console.log(chalk.gray(` Creando backup en ${path.basename(backupDir)}...`));
|
|
48
|
+
|
|
49
|
+
for (const dir of FRAMEWORK_DIRS) {
|
|
50
|
+
const src = path.join(claudeDir, dir);
|
|
51
|
+
if (fs.existsSync(src)) {
|
|
52
|
+
await fs.copy(src, path.join(backupDir, dir));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Obtener ruta del paquete
|
|
58
|
+
const packageRoot = path.join(__dirname, '..');
|
|
59
|
+
const frameworkSrc = path.join(packageRoot, 'framework');
|
|
60
|
+
|
|
61
|
+
// Actualizar SOLO las carpetas del framework
|
|
62
|
+
console.log(chalk.gray(' Actualizando framework...'));
|
|
63
|
+
for (const dir of FRAMEWORK_DIRS) {
|
|
64
|
+
const src = path.join(frameworkSrc, dir);
|
|
65
|
+
const dest = path.join(claudeDir, dir);
|
|
66
|
+
if (fs.existsSync(src)) {
|
|
67
|
+
await fs.remove(dest);
|
|
68
|
+
await fs.copy(src, dest);
|
|
69
|
+
console.log(chalk.gray(` ~ ${dir}/`));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// NO tocar: contexts/, history/, workspace/, settings.local.json
|
|
74
|
+
console.log(chalk.gray(' Manteniendo intactos: contexts/, history/, workspace/'));
|
|
75
|
+
|
|
76
|
+
// Actualizar version
|
|
77
|
+
await fs.writeJson(versionFile, {
|
|
78
|
+
version: pkg.version,
|
|
79
|
+
installedAt: new Date().toISOString(),
|
|
80
|
+
previousVersion: currentVersion,
|
|
81
|
+
previousInstalledAt: installedAt
|
|
82
|
+
}, { spaces: 2 });
|
|
83
|
+
|
|
84
|
+
console.log('');
|
|
85
|
+
console.log(chalk.green(`Actualizado de v${currentVersion} a v${pkg.version}`));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
module.exports = update;
|