@evolith/smart-cli 0.0.1-beta
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/ARCHITECTURE.md +121 -0
- package/README.es.md +425 -0
- package/README.md +419 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +59 -0
- package/dist/app.module.js.map +1 -0
- package/dist/application/services/index.d.ts +54 -0
- package/dist/application/services/index.js +307 -0
- package/dist/application/services/index.js.map +1 -0
- package/dist/application/services/services.test.d.ts +1 -0
- package/dist/application/services/services.test.js +176 -0
- package/dist/application/services/services.test.js.map +1 -0
- package/dist/application/use-cases/validate-satellite.use-case.d.ts +18 -0
- package/dist/application/use-cases/validate-satellite.use-case.js +92 -0
- package/dist/application/use-cases/validate-satellite.use-case.js.map +1 -0
- package/dist/application/use-cases/validate-satellite.use-case.spec.d.ts +1 -0
- package/dist/application/use-cases/validate-satellite.use-case.spec.js +102 -0
- package/dist/application/use-cases/validate-satellite.use-case.spec.js.map +1 -0
- package/dist/commands/adr/adr.command.d.ts +28 -0
- package/dist/commands/adr/adr.command.js +357 -0
- package/dist/commands/adr/adr.command.js.map +1 -0
- package/dist/commands/architecture/scaffold.command.d.ts +7 -0
- package/dist/commands/architecture/scaffold.command.js +162 -0
- package/dist/commands/architecture/scaffold.command.js.map +1 -0
- package/dist/commands/commands.test.d.ts +1 -0
- package/dist/commands/commands.test.js +131 -0
- package/dist/commands/commands.test.js.map +1 -0
- package/dist/commands/completion/completion.command.d.ts +20 -0
- package/dist/commands/completion/completion.command.js +215 -0
- package/dist/commands/completion/completion.command.js.map +1 -0
- package/dist/commands/docs/docs.command.d.ts +9 -0
- package/dist/commands/docs/docs.command.js +77 -0
- package/dist/commands/docs/docs.command.js.map +1 -0
- package/dist/commands/history/history.command.d.ts +29 -0
- package/dist/commands/history/history.command.js +268 -0
- package/dist/commands/history/history.command.js.map +1 -0
- package/dist/commands/init/agents.command.d.ts +22 -0
- package/dist/commands/init/agents.command.js +502 -0
- package/dist/commands/init/agents.command.js.map +1 -0
- package/dist/commands/init/init.command.d.ts +20 -0
- package/dist/commands/init/init.command.js +329 -0
- package/dist/commands/init/init.command.js.map +1 -0
- package/dist/commands/init/upgrade.command.d.ts +9 -0
- package/dist/commands/init/upgrade.command.js +77 -0
- package/dist/commands/init/upgrade.command.js.map +1 -0
- package/dist/commands/mcp/mcp-serve.command.d.ts +15 -0
- package/dist/commands/mcp/mcp-serve.command.js +106 -0
- package/dist/commands/mcp/mcp-serve.command.js.map +1 -0
- package/dist/commands/sdlc/generate-domain.command.d.ts +5 -0
- package/dist/commands/sdlc/generate-domain.command.js +55 -0
- package/dist/commands/sdlc/generate-domain.command.js.map +1 -0
- package/dist/commands/sdlc/handoff.command.d.ts +22 -0
- package/dist/commands/sdlc/handoff.command.js +273 -0
- package/dist/commands/sdlc/handoff.command.js.map +1 -0
- package/dist/commands/sdlc/sdlc.command.d.ts +4 -0
- package/dist/commands/sdlc/sdlc.command.js +34 -0
- package/dist/commands/sdlc/sdlc.command.js.map +1 -0
- package/dist/commands/standards/standards.command.d.ts +27 -0
- package/dist/commands/standards/standards.command.js +308 -0
- package/dist/commands/standards/standards.command.js.map +1 -0
- package/dist/commands/validate/validate.command.d.ts +19 -0
- package/dist/commands/validate/validate.command.js +231 -0
- package/dist/commands/validate/validate.command.js.map +1 -0
- package/dist/config/runtimes.json +196 -0
- package/dist/config/tool-catalog.json +343 -0
- package/dist/core/abstractions/index.d.ts +6 -0
- package/dist/core/abstractions/index.js +23 -0
- package/dist/core/abstractions/index.js.map +1 -0
- package/dist/core/abstractions/interfaces.d.ts +60 -0
- package/dist/core/abstractions/interfaces.js +5 -0
- package/dist/core/abstractions/interfaces.js.map +1 -0
- package/dist/core/abstractions/providers/config-parser.provider.d.ts +15 -0
- package/dist/core/abstractions/providers/config-parser.provider.js +68 -0
- package/dist/core/abstractions/providers/config-parser.provider.js.map +1 -0
- package/dist/core/abstractions/providers/logger.provider.d.ts +10 -0
- package/dist/core/abstractions/providers/logger.provider.js +84 -0
- package/dist/core/abstractions/providers/logger.provider.js.map +1 -0
- package/dist/core/abstractions/providers/mock-filesystem.provider.d.ts +30 -0
- package/dist/core/abstractions/providers/mock-filesystem.provider.js +122 -0
- package/dist/core/abstractions/providers/mock-filesystem.provider.js.map +1 -0
- package/dist/core/abstractions/providers/node-filesystem.provider.d.ts +19 -0
- package/dist/core/abstractions/providers/node-filesystem.provider.js +104 -0
- package/dist/core/abstractions/providers/node-filesystem.provider.js.map +1 -0
- package/dist/core/architecture/nx-workspace.strategy.d.ts +11 -0
- package/dist/core/architecture/nx-workspace.strategy.js +107 -0
- package/dist/core/architecture/nx-workspace.strategy.js.map +1 -0
- package/dist/core/architecture/workspace-manager.strategy.d.ts +7 -0
- package/dist/core/architecture/workspace-manager.strategy.js +3 -0
- package/dist/core/architecture/workspace-manager.strategy.js.map +1 -0
- package/dist/core/config/config.service.d.ts +15 -0
- package/dist/core/config/config.service.js +55 -0
- package/dist/core/config/config.service.js.map +1 -0
- package/dist/core/config/config.service.spec.d.ts +1 -0
- package/dist/core/config/config.service.spec.js +43 -0
- package/dist/core/config/config.service.spec.js.map +1 -0
- package/dist/core/di/container.d.ts +25 -0
- package/dist/core/di/container.js +87 -0
- package/dist/core/di/container.js.map +1 -0
- package/dist/core/di/container.spec.d.ts +1 -0
- package/dist/core/di/container.spec.js +137 -0
- package/dist/core/di/container.spec.js.map +1 -0
- package/dist/core/errors/index.d.ts +26 -0
- package/dist/core/errors/index.js +67 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/filesystem/file-manager.service.d.ts +4 -0
- package/dist/core/filesystem/file-manager.service.js +96 -0
- package/dist/core/filesystem/file-manager.service.js.map +1 -0
- package/dist/core/filesystem/file-manager.service.spec.d.ts +1 -0
- package/dist/core/filesystem/file-manager.service.spec.js +103 -0
- package/dist/core/filesystem/file-manager.service.spec.js.map +1 -0
- package/dist/core/mcp/mcp-server.service.d.ts +7 -0
- package/dist/core/mcp/mcp-server.service.js +31 -0
- package/dist/core/mcp/mcp-server.service.js.map +1 -0
- package/dist/core/mcp/metrics.service.d.ts +37 -0
- package/dist/core/mcp/metrics.service.js +72 -0
- package/dist/core/mcp/metrics.service.js.map +1 -0
- package/dist/core/mcp/prompts/index.d.ts +22 -0
- package/dist/core/mcp/prompts/index.js +175 -0
- package/dist/core/mcp/prompts/index.js.map +1 -0
- package/dist/core/mcp/resources/index.d.ts +11 -0
- package/dist/core/mcp/resources/index.js +193 -0
- package/dist/core/mcp/resources/index.js.map +1 -0
- package/dist/core/mcp/server.d.ts +25 -0
- package/dist/core/mcp/server.js +413 -0
- package/dist/core/mcp/server.js.map +1 -0
- package/dist/core/mcp/tools/agent.d.ts +41 -0
- package/dist/core/mcp/tools/agent.js +195 -0
- package/dist/core/mcp/tools/agent.js.map +1 -0
- package/dist/core/mcp/tools/architecture.d.ts +27 -0
- package/dist/core/mcp/tools/architecture.js +166 -0
- package/dist/core/mcp/tools/architecture.js.map +1 -0
- package/dist/core/mcp/tools/sdlc.d.ts +32 -0
- package/dist/core/mcp/tools/sdlc.js +189 -0
- package/dist/core/mcp/tools/sdlc.js.map +1 -0
- package/dist/core/mcp/tools/tool-utils.d.ts +4 -0
- package/dist/core/mcp/tools/tool-utils.js +18 -0
- package/dist/core/mcp/tools/tool-utils.js.map +1 -0
- package/dist/core/mcp/tools/validate.d.ts +18 -0
- package/dist/core/mcp/tools/validate.js +56 -0
- package/dist/core/mcp/tools/validate.js.map +1 -0
- package/dist/core/mcp/watcher.service.d.ts +8 -0
- package/dist/core/mcp/watcher.service.js +82 -0
- package/dist/core/mcp/watcher.service.js.map +1 -0
- package/dist/core/mcp/watcher.service.spec.d.ts +1 -0
- package/dist/core/mcp/watcher.service.spec.js +70 -0
- package/dist/core/mcp/watcher.service.spec.js.map +1 -0
- package/dist/core/observability/command-watcher.d.ts +45 -0
- package/dist/core/observability/command-watcher.js +168 -0
- package/dist/core/observability/command-watcher.js.map +1 -0
- package/dist/core/observability/error-reporter.d.ts +47 -0
- package/dist/core/observability/error-reporter.js +163 -0
- package/dist/core/observability/error-reporter.js.map +1 -0
- package/dist/core/observability/index.d.ts +4 -0
- package/dist/core/observability/index.js +24 -0
- package/dist/core/observability/index.js.map +1 -0
- package/dist/core/observability/observability.test.d.ts +1 -0
- package/dist/core/observability/observability.test.js +224 -0
- package/dist/core/observability/observability.test.js.map +1 -0
- package/dist/core/observability/structured-logger.d.ts +53 -0
- package/dist/core/observability/structured-logger.js +123 -0
- package/dist/core/observability/structured-logger.js.map +1 -0
- package/dist/core/observability/timing.d.ts +23 -0
- package/dist/core/observability/timing.js +140 -0
- package/dist/core/observability/timing.js.map +1 -0
- package/dist/core/services/command-executor.service.d.ts +3 -0
- package/dist/core/services/command-executor.service.js +12 -0
- package/dist/core/services/command-executor.service.js.map +1 -0
- package/dist/core/services/command-history.service.d.ts +38 -0
- package/dist/core/services/command-history.service.js +146 -0
- package/dist/core/services/command-history.service.js.map +1 -0
- package/dist/core/services/command-providers.d.ts +1 -0
- package/dist/core/services/command-providers.js +17 -0
- package/dist/core/services/command-providers.js.map +1 -0
- package/dist/core/services/runtime-catalog.service.d.ts +2 -0
- package/dist/core/services/runtime-catalog.service.js +7 -0
- package/dist/core/services/runtime-catalog.service.js.map +1 -0
- package/dist/core/sync/sync.service.d.ts +4 -0
- package/dist/core/sync/sync.service.js +81 -0
- package/dist/core/sync/sync.service.js.map +1 -0
- package/dist/core/sync/sync.service.spec.d.ts +1 -0
- package/dist/core/sync/sync.service.spec.js +63 -0
- package/dist/core/sync/sync.service.spec.js.map +1 -0
- package/dist/core/validators/ruleset-validator.service.d.ts +56 -0
- package/dist/core/validators/ruleset-validator.service.js +263 -0
- package/dist/core/validators/ruleset-validator.service.js.map +1 -0
- package/dist/core/validators/ruleset-validator.service.spec.d.ts +1 -0
- package/dist/core/validators/ruleset-validator.service.spec.js +121 -0
- package/dist/core/validators/ruleset-validator.service.spec.js.map +1 -0
- package/dist/domain/entities/index.d.ts +72 -0
- package/dist/domain/entities/index.js +119 -0
- package/dist/domain/entities/index.js.map +1 -0
- package/dist/domain/interfaces.d.ts +224 -0
- package/dist/domain/interfaces.js +3 -0
- package/dist/domain/interfaces.js.map +1 -0
- package/dist/domain/services/adr.service.d.ts +50 -0
- package/dist/domain/services/adr.service.js +125 -0
- package/dist/domain/services/adr.service.js.map +1 -0
- package/dist/domain/services/agent-registry.service.d.ts +26 -0
- package/dist/domain/services/agent-registry.service.js +152 -0
- package/dist/domain/services/agent-registry.service.js.map +1 -0
- package/dist/domain/services/index.d.ts +33 -0
- package/dist/domain/services/index.js +126 -0
- package/dist/domain/services/index.js.map +1 -0
- package/dist/domain/services/services.test.d.ts +1 -0
- package/dist/domain/services/services.test.js +236 -0
- package/dist/domain/services/services.test.js.map +1 -0
- package/dist/domain/services/standards.service.d.ts +47 -0
- package/dist/domain/services/standards.service.js +129 -0
- package/dist/domain/services/standards.service.js.map +1 -0
- package/dist/domain/services/tool-usage-telemetry.service.d.ts +46 -0
- package/dist/domain/services/tool-usage-telemetry.service.js +181 -0
- package/dist/domain/services/tool-usage-telemetry.service.js.map +1 -0
- package/dist/infrastructure/catalog/catalog-loader.d.ts +22 -0
- package/dist/infrastructure/catalog/catalog-loader.js +135 -0
- package/dist/infrastructure/catalog/catalog-loader.js.map +1 -0
- package/dist/infrastructure/catalog/catalog-loader.test.d.ts +1 -0
- package/dist/infrastructure/catalog/catalog-loader.test.js +184 -0
- package/dist/infrastructure/catalog/catalog-loader.test.js.map +1 -0
- package/dist/infrastructure/cli/command-executor.d.ts +20 -0
- package/dist/infrastructure/cli/command-executor.js +109 -0
- package/dist/infrastructure/cli/command-executor.js.map +1 -0
- package/dist/infrastructure/cli/command-executor.test.d.ts +1 -0
- package/dist/infrastructure/cli/command-executor.test.js +98 -0
- package/dist/infrastructure/cli/command-executor.test.js.map +1 -0
- package/dist/infrastructure/cli/providers/index.d.ts +52 -0
- package/dist/infrastructure/cli/providers/index.js +175 -0
- package/dist/infrastructure/cli/providers/index.js.map +1 -0
- package/dist/infrastructure/formatters/output-formatter.service.d.ts +28 -0
- package/dist/infrastructure/formatters/output-formatter.service.js +198 -0
- package/dist/infrastructure/formatters/output-formatter.service.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +10 -0
- package/dist/main.js.map +1 -0
- package/dist/test/mocks/index.d.ts +44 -0
- package/dist/test/mocks/index.js +135 -0
- package/dist/test/mocks/index.js.map +1 -0
- package/package.json +80 -0
- package/shell/completion.bash +85 -0
- package/shell/completion.fish +72 -0
- package/shell/completion.zsh +83 -0
- package/templates/evolith.yaml.example +45 -0
package/ARCHITECTURE.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Evolith CLI Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Evolith CLI is a NestJS-based command-line application that provides governance, standards validation, and tool selection capabilities for satellite repositories. It follows Clean Architecture principles with clear separation of concerns.
|
|
6
|
+
|
|
7
|
+
## Architecture Layers
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
src/
|
|
11
|
+
├── commands/ # Presentation Layer (CLI commands)
|
|
12
|
+
├── application/ # Application Layer (Use Cases)
|
|
13
|
+
├── domain/ # Domain Layer (Entities, Services, Business Rules)
|
|
14
|
+
├── infrastructure/ # Infrastructure Layer (External integrations)
|
|
15
|
+
└── core/ # Core Layer (Shared utilities, DI, abstractions)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Presentation Layer (`commands/`)
|
|
19
|
+
|
|
20
|
+
Commands are the entry points that handle user interaction. Each command:
|
|
21
|
+
- Extends `CommandRunner` from nest-commander
|
|
22
|
+
- Uses `@clack/prompts` for interactive input
|
|
23
|
+
- Delegates business logic to application use cases
|
|
24
|
+
- Formats output for human or JSON consumption
|
|
25
|
+
|
|
26
|
+
**Commands:**
|
|
27
|
+
- `adr/` - ADR management (create, list, get, update, matrix)
|
|
28
|
+
- `standards/` - Standards management (init, list, get, validate, export)
|
|
29
|
+
- `validate/` - Repository validation against Evolith standards
|
|
30
|
+
- `handoff/` - Tool handoff between phases
|
|
31
|
+
- `init/` - Repository initialization
|
|
32
|
+
|
|
33
|
+
### Application Layer (`application/use-cases/`)
|
|
34
|
+
|
|
35
|
+
Use cases orchestrate domain services to fulfill specific business operations:
|
|
36
|
+
- `ValidateSatelliteUseCase` - Validates satellite repository compliance
|
|
37
|
+
- `HandoffToolUseCase` - Manages tool handoff between phases
|
|
38
|
+
|
|
39
|
+
### Domain Layer (`domain/`)
|
|
40
|
+
|
|
41
|
+
Domain services encapsulate business logic:
|
|
42
|
+
- `ADRService` - ADR CRUD operations and matrix generation
|
|
43
|
+
- `StandardsService` - Standards registration and validation
|
|
44
|
+
- `PhaseService` - Phase and tool selection logic
|
|
45
|
+
- `ToolSelectionService` - Runtime-aware tool selection
|
|
46
|
+
- `PlatformDetectionService` - Runtime environment detection
|
|
47
|
+
|
|
48
|
+
### Infrastructure Layer (`infrastructure/`)
|
|
49
|
+
|
|
50
|
+
External integrations and platform-specific implementations:
|
|
51
|
+
- `cli/` - Command executor and prompt providers
|
|
52
|
+
- `catalog/` - JSON catalog loader for runtimes and tools
|
|
53
|
+
- `file-system/` - Node.js file system abstraction
|
|
54
|
+
|
|
55
|
+
### Core Layer (`core/`)
|
|
56
|
+
|
|
57
|
+
Shared utilities and framework:
|
|
58
|
+
- `abstractions/` - Interfaces for dependency injection
|
|
59
|
+
- `interfaces/` - IFileSystem, ILogger, IConfigParser
|
|
60
|
+
- `providers/` - Node.js specific implementations
|
|
61
|
+
- `di/` - DIContainer for service registration and resolution
|
|
62
|
+
- `errors/` - EvolithError base class and error codes
|
|
63
|
+
- `observability/` - Structured logging, timing, error reporting
|
|
64
|
+
|
|
65
|
+
## Dependency Injection
|
|
66
|
+
|
|
67
|
+
The `DIContainer` provides service location with singleton/transient scopes:
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
const container = getContainer();
|
|
71
|
+
container.registerSingleton('IService', () => new Service());
|
|
72
|
+
container.registerTransient('IFactory', () => new Factory());
|
|
73
|
+
|
|
74
|
+
const service = container.resolve('IService');
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Catalogs
|
|
78
|
+
|
|
79
|
+
Runtime and tool selection is driven by JSON catalogs:
|
|
80
|
+
|
|
81
|
+
- `config/runtimes.json` - Supported runtimes (nodejs, typescript, dotnet, python)
|
|
82
|
+
- `config/tool-catalog.json` - Tools grouped by phase (0-5)
|
|
83
|
+
- `config/cli-commands-matrix.json` - Command support matrix per runtime
|
|
84
|
+
|
|
85
|
+
## Observability
|
|
86
|
+
|
|
87
|
+
AOP-based observability with:
|
|
88
|
+
- `StructuredLogger` - JSON structured logging with context
|
|
89
|
+
- `@Timed` decorator - Operation duration tracking
|
|
90
|
+
- `ErrorReporter` - Error aggregation with correlation IDs
|
|
91
|
+
- `CommandWatcher` - Command execution telemetry
|
|
92
|
+
|
|
93
|
+
## Commands Pattern
|
|
94
|
+
|
|
95
|
+
All commands follow the same pattern:
|
|
96
|
+
|
|
97
|
+
1. Parse options via `@Option` decorators
|
|
98
|
+
2. Show intro with `p.intro()`
|
|
99
|
+
3. Execute business logic via use cases
|
|
100
|
+
4. Format and display results
|
|
101
|
+
5. Show outro with status color (green/yellow/red)
|
|
102
|
+
|
|
103
|
+
## Build and Test
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm run build # Compile TypeScript
|
|
107
|
+
npm run test # Run Jest test suite
|
|
108
|
+
npm run lint # ESLint validation
|
|
109
|
+
npm run typecheck # TypeScript type checking
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Extending the CLI
|
|
113
|
+
|
|
114
|
+
To add a new command:
|
|
115
|
+
|
|
116
|
+
1. Create `commands/<feature>/<feature>.command.ts`
|
|
117
|
+
2. Implement `CommandRunner` interface
|
|
118
|
+
3. Add use case in `application/use-cases/`
|
|
119
|
+
4. Register any new domain services
|
|
120
|
+
5. Add tests in `<feature>.command.spec.ts`
|
|
121
|
+
6. Update catalogs if adding new tools/runtimes
|
package/README.es.md
ADDED
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
# Evolith CLI
|
|
2
|
+
|
|
3
|
+
Interfaz de línea de comandos para gobernanza, validación de estándares e integración con agentes IA.
|
|
4
|
+
|
|
5
|
+
## Características
|
|
6
|
+
|
|
7
|
+
- **Gobernanza**: Gestión de ADR, seguimiento de estándares, instalación de agentes
|
|
8
|
+
- **Validación**: Cumplimiento del repositorio contra los estándares de Evolith
|
|
9
|
+
- **Integración IA**: Servidor MCP para llamadas de herramientas de agentes IA
|
|
10
|
+
- **Observabilidad**: Logging estructurado, métricas, reporte de errores
|
|
11
|
+
|
|
12
|
+
## Instalación
|
|
13
|
+
|
|
14
|
+
### npm (Recomendado)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g @evolith/smart-cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Manual
|
|
21
|
+
|
|
22
|
+
Descarga el binario más reciente desde [GitHub Releases](https://github.com/beyondnetcode/evolith_arch32/releases) y agrégalo a tu PATH.
|
|
23
|
+
|
|
24
|
+
### Verificar Instalación
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
smart-cli --version
|
|
28
|
+
# smart-cli version 0.0.1-beta
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Inicio Rápido
|
|
32
|
+
|
|
33
|
+
### 1. Inicializar un Repositorio
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd tu-proyecto
|
|
37
|
+
smart-cli init
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Esto crea un archivo `evolith.yaml` con la configuración por defecto.
|
|
41
|
+
|
|
42
|
+
### 2. Ejecutar la Primera Validación
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
smart-cli validate
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Salida:
|
|
49
|
+
```
|
|
50
|
+
✓ Validando repositorio...
|
|
51
|
+
✓ El repositorio cumple con los estándares de Evolith
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3. Instalar un Agente
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
smart-cli agents install
|
|
58
|
+
# Seleccionar la plantilla "standard" cuando se solicite
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Comandos
|
|
62
|
+
|
|
63
|
+
### validate
|
|
64
|
+
|
|
65
|
+
Valida el cumplimiento del repositorio contra los estándares de Evolith.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
smart-cli validate [opciones]
|
|
69
|
+
|
|
70
|
+
Opciones:
|
|
71
|
+
--satellite <ruta> Ruta al repositorio satélite (por defecto: cwd)
|
|
72
|
+
--core <ruta> Ruta a Evolith Core
|
|
73
|
+
--format <formato> Formato de salida: json, table, yaml, markdown
|
|
74
|
+
--output <archivo> Escribir salida a archivo
|
|
75
|
+
--ruleset <id> Validar ruleset específico (acl, open-core, inheritance)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Ejemplos:**
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Validación básica
|
|
82
|
+
smart-cli validate
|
|
83
|
+
|
|
84
|
+
# Salida JSON para automatización
|
|
85
|
+
smart-cli validate --format json
|
|
86
|
+
|
|
87
|
+
# Salida en tabla para humanos
|
|
88
|
+
smart-cli validate --format table
|
|
89
|
+
|
|
90
|
+
# Validar ruleset específico
|
|
91
|
+
smart-cli validate --ruleset acl
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### adr
|
|
95
|
+
|
|
96
|
+
Gestionar Registros de Decisiones de Arquitectura.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
smart-cli adr <comando>
|
|
100
|
+
|
|
101
|
+
Comandos:
|
|
102
|
+
create Crear nuevo ADR
|
|
103
|
+
list Listar todos los ADR
|
|
104
|
+
get Mostrar detalles del ADR
|
|
105
|
+
update Actualizar ADR existente
|
|
106
|
+
matrix Mostrar matriz de ADR
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Ejemplos:**
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Crear nuevo ADR
|
|
113
|
+
smart-cli adr create
|
|
114
|
+
|
|
115
|
+
# Listar todos los ADR
|
|
116
|
+
smart-cli adr list
|
|
117
|
+
|
|
118
|
+
# Obtener ADR específico
|
|
119
|
+
smart-cli adr get ADR-0002
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### standards
|
|
123
|
+
|
|
124
|
+
Gestionar estándares de gobernanza.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
smart-cli standards <comando>
|
|
128
|
+
|
|
129
|
+
Comandos:
|
|
130
|
+
init Inicializar directorio de estándares
|
|
131
|
+
list Listar todos los estándares
|
|
132
|
+
get Mostrar detalles del estándar
|
|
133
|
+
validate Validar contra estándares
|
|
134
|
+
export Exportar estándar a markdown/json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Ejemplos:**
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Inicializar estándares
|
|
141
|
+
smart-cli standards init
|
|
142
|
+
|
|
143
|
+
# Listar estándares
|
|
144
|
+
smart-cli standards list
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### agents
|
|
148
|
+
|
|
149
|
+
Instalar y gestionar agentes de Evolith.
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
smart-cli agents <comando>
|
|
153
|
+
|
|
154
|
+
Comandos:
|
|
155
|
+
install Instalar nuevo agente
|
|
156
|
+
list Listar agentes instalados
|
|
157
|
+
remove Eliminar agente
|
|
158
|
+
validate Validar ruleset del agente
|
|
159
|
+
upgrade Actualizar agente
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Ejemplos:**
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Instalación interactiva
|
|
166
|
+
smart-cli agents install
|
|
167
|
+
|
|
168
|
+
# Listar agentes
|
|
169
|
+
smart-cli agents list
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### history
|
|
173
|
+
|
|
174
|
+
Ver y gestionar historial de comandos.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
smart-cli history [opciones]
|
|
178
|
+
|
|
179
|
+
Opciones:
|
|
180
|
+
--list Listar comandos recientes
|
|
181
|
+
--get <id> Mostrar detalles del comando
|
|
182
|
+
--search <consulta> Buscar comandos
|
|
183
|
+
--stats Mostrar estadísticas
|
|
184
|
+
--clear Limpiar historial
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Ejemplos:**
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Mostrar últimos 20 comandos
|
|
191
|
+
smart-cli history
|
|
192
|
+
|
|
193
|
+
# Mostrar estadísticas
|
|
194
|
+
smart-cli history --stats
|
|
195
|
+
|
|
196
|
+
# Buscar comandos
|
|
197
|
+
smart-cli history --search validate
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### completion
|
|
201
|
+
|
|
202
|
+
Generar scripts de completado de shell.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
smart-cli completion --install <shell>
|
|
206
|
+
|
|
207
|
+
Shells soportados: bash, zsh, fish
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Ejemplos:**
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# Instalar completado bash
|
|
214
|
+
smart-cli completion --install bash
|
|
215
|
+
|
|
216
|
+
# Instalar completado zsh
|
|
217
|
+
smart-cli completion --install zsh
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Servidor MCP (Integración con Agentes IA)
|
|
221
|
+
|
|
222
|
+
La CLI de Evolith incluye un servidor MCP para integración con agentes IA.
|
|
223
|
+
|
|
224
|
+
### Iniciar el Servidor MCP
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
smart-cli mcp serve
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
El servidor se comunica vía stdio JSON-RPC.
|
|
231
|
+
|
|
232
|
+
También puedes iniciar en modo HTTP:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
smart-cli mcp serve --transport http --port 3000
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Herramientas MCP Disponibles
|
|
239
|
+
|
|
240
|
+
| Herramienta | Descripción |
|
|
241
|
+
|-------------|-------------|
|
|
242
|
+
| `evolith-validate` | Validar cumplimiento del repositorio |
|
|
243
|
+
| `evolith-agent-install` | Instalar nuevo agente |
|
|
244
|
+
| `evolith-agent-list` | Listar agentes instalados |
|
|
245
|
+
| `evolith-agent-validate` | Validar ruleset del agente |
|
|
246
|
+
| `evolith-architecture-validate` | Validar arquitectura |
|
|
247
|
+
| `evolith-sdlc-handoff` | Generar transición de fase |
|
|
248
|
+
| `evolith-sdlc-status` | Mostrar estado de fase SDLC |
|
|
249
|
+
| `evolith-config-get` | Obtener valor de configuración |
|
|
250
|
+
| `evolith-config-set` | Establecer valor de configuración |
|
|
251
|
+
| `evolith-metrics` | Obtener métricas del servidor MCP |
|
|
252
|
+
|
|
253
|
+
### Configuración para Cursor AI
|
|
254
|
+
|
|
255
|
+
Agregar a `~/.cursor/mcp.json`:
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
{
|
|
259
|
+
"mcpServers": {
|
|
260
|
+
"evolith": {
|
|
261
|
+
"command": "smart-cli",
|
|
262
|
+
"args": ["mcp", "serve"]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Configuración para Claude Desktop
|
|
269
|
+
|
|
270
|
+
Agregar a `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"mcpServers": {
|
|
275
|
+
"evolith": {
|
|
276
|
+
"command": "smart-cli",
|
|
277
|
+
"args": ["mcp", "serve"]
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Ejemplo de Flujo de Trabajo con Agente IA
|
|
284
|
+
|
|
285
|
+
Cuando está integrado con un agente IA, puedes tener conversaciones como:
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
Tú: Valida mi repositorio
|
|
289
|
+
Agente: Déjame ejecutar la validación...
|
|
290
|
+
|
|
291
|
+
await mcp.callTool('evolith-validate', {
|
|
292
|
+
path: '/user/project',
|
|
293
|
+
format: 'summary'
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
Resultado: ✓ El repositorio cumple con los estándares de Evolith
|
|
297
|
+
Reglas verificadas: 12
|
|
298
|
+
Todas las puertas pasaron
|
|
299
|
+
|
|
300
|
+
Tú: Muéstrame los ADR
|
|
301
|
+
Agente: Déjame obtener la lista de ADR...
|
|
302
|
+
|
|
303
|
+
await mcp.callTool('evolith-adr-list', {})
|
|
304
|
+
|
|
305
|
+
Resultado: Se encontraron 5 ADR:
|
|
306
|
+
- ADR-0001: Plantilla de Registro de Decisión de Arquitectura
|
|
307
|
+
- ADR-0002: Arquitectura Hexagonal (aceptado)
|
|
308
|
+
- ADR-0003: Pirámide de Pruebas (aceptado)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Configuración
|
|
312
|
+
|
|
313
|
+
Evolith usa un archivo `evolith.yaml` en la raíz del repositorio:
|
|
314
|
+
|
|
315
|
+
```yaml
|
|
316
|
+
coreRef:
|
|
317
|
+
version: "1.0.0"
|
|
318
|
+
path: "../evolith"
|
|
319
|
+
|
|
320
|
+
governance:
|
|
321
|
+
version: "1.0"
|
|
322
|
+
adrRegistry:
|
|
323
|
+
- id: "ADR-0001"
|
|
324
|
+
status: "accepted"
|
|
325
|
+
|
|
326
|
+
product:
|
|
327
|
+
name: "mi-proyecto"
|
|
328
|
+
type: "library"
|
|
329
|
+
runtime: "typescript"
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
## Formatos de Salida
|
|
333
|
+
|
|
334
|
+
Todos los comandos soportan múltiples formatos de salida:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
# JSON (por defecto para automatización)
|
|
338
|
+
smart-cli validate --format json
|
|
339
|
+
|
|
340
|
+
# Tabla (legible para humanos)
|
|
341
|
+
smart-cli validate --format table
|
|
342
|
+
|
|
343
|
+
# YAML (integración en pipelines)
|
|
344
|
+
smart-cli validate --format yaml
|
|
345
|
+
|
|
346
|
+
# Markdown (documentación)
|
|
347
|
+
smart-cli validate --format markdown
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## Solución de Problemas
|
|
351
|
+
|
|
352
|
+
### Comando no encontrado
|
|
353
|
+
|
|
354
|
+
Si `evolith` no se encuentra después de la instalación, asegúrate de que el binario global de npm está en tu PATH:
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# Agregar a ~/.bashrc o ~/.zshrc
|
|
358
|
+
export PATH="$(npm config get prefix)/bin:$PATH"
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Servidor MCP no responde
|
|
362
|
+
|
|
363
|
+
Asegúrate de que el servidor MCP está corriendo:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
smart-cli mcp serve &
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### La validación falla
|
|
370
|
+
|
|
371
|
+
Verifica que tu `evolith.yaml` existe y es válido:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
cat evolith.yaml
|
|
375
|
+
smart-cli validate --verbose
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## Desarrollo
|
|
379
|
+
|
|
380
|
+
### Construir desde el Código Fuente
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
cd sdk/cli
|
|
384
|
+
npm install
|
|
385
|
+
npm run build
|
|
386
|
+
npm link # Enlazar globalmente para pruebas
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Ejecutar Pruebas
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
npm test
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Estructura del Proyecto
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
sdk/cli/
|
|
399
|
+
├── src/
|
|
400
|
+
│ ├── commands/ # Comandos CLI (adr, validate, agents, etc.)
|
|
401
|
+
│ ├── application/ # Casos de uso
|
|
402
|
+
│ ├── domain/ # Lógica de negocio (servicios, entidades)
|
|
403
|
+
│ ├── infrastructure/# Integraciones externas (catálogo, CLI)
|
|
404
|
+
│ └── core/ # Compartido (DI, observabilidad, errores, MCP)
|
|
405
|
+
├── shell/ # Scripts de completado de shell
|
|
406
|
+
├── templates/ # Plantillas de configuración
|
|
407
|
+
└── docs/ # Documentación
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
## Contribuir
|
|
411
|
+
|
|
412
|
+
1. Haz fork del repositorio
|
|
413
|
+
2. Crea una rama de característica
|
|
414
|
+
3. Haz cambios con pruebas
|
|
415
|
+
4. Envía un pull request
|
|
416
|
+
|
|
417
|
+
## Licencia
|
|
418
|
+
|
|
419
|
+
ISC
|
|
420
|
+
|
|
421
|
+
## Soporte
|
|
422
|
+
|
|
423
|
+
- [Documentación](https://github.com/beyondnetcode/evolith_arch32#readme)
|
|
424
|
+
- [Rastreador de Incidencias](https://github.com/beyondnetcode/evolith_arch32/issues)
|
|
425
|
+
- [Discusiones](https://github.com/beyondnetcode/evolith_arch32/discussions)
|