@korl3one/ccode 2.1.0 → 2.3.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 +154 -256
- package/dist/cli/index.js +224 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,353 +1,251 @@
|
|
|
1
|
-
|
|
2
|
-
██████╗ ██████╗ ██████╗ ██████╗ ███████╗
|
|
3
|
-
██╔════╝██╔════╝ ██╔═══██╗██╔══██╗██╔════╝
|
|
4
|
-
██║ ██║ ██║ ██║██║ ██║█████╗
|
|
5
|
-
██║ ██║ ██║ ██║██║ ██║██╔══╝
|
|
6
|
-
╚██████╗╚██████╗ ╚██████╔╝██████╔╝███████╗
|
|
7
|
-
╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
|
8
|
-
Context-Persistent AI Development v2.0
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# CCODE — Contexto Persistente para Desarrollo Asistido
|
|
14
|
-
|
|
15
|
-
## QUE es CCODE
|
|
16
|
-
|
|
17
|
-
CCODE es una herramienta CLI que genera y mantiene el **contexto de trabajo** de un proyecto de software. Genera documentacion profesional, arquitectura, reglas de desarrollo y un checklist de tareas verificables — todo adaptado automaticamente a la complejidad real del proyecto.
|
|
18
|
-
|
|
19
|
-
**CCODE no genera codigo.** Genera el contexto que guia el desarrollo.
|
|
1
|
+
<div align="center">
|
|
20
2
|
|
|
21
|
-
|
|
3
|
+
<img src="assets/logo.png" alt="CCODE" width="600"/>
|
|
22
4
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| `project.md` | Vision, objetivos, alcance y funcionalidades |
|
|
26
|
-
| `architecture.md` | Estructura del sistema adaptada a la complejidad |
|
|
27
|
-
| `rules.md` | Estandares de desarrollo especificos al stack |
|
|
28
|
-
| `tasks.json` | Checklist de tareas con criterios de aceptacion |
|
|
29
|
-
| `state.json` | Tarea activa y etapa del workflow |
|
|
30
|
-
| `context.json` | Configuracion general del proyecto |
|
|
31
|
-
| `memory.md` | Historial de decisiones y tareas completadas |
|
|
32
|
-
| `config.json` | Configuracion del proveedor de IA |
|
|
5
|
+
<br/>
|
|
6
|
+
<br/>
|
|
33
7
|
|
|
34
|
-
|
|
8
|
+
**Persistent context CLI for AI-assisted development.**
|
|
35
9
|
|
|
36
|
-
|
|
10
|
+
Stop re-explaining your project to AI every time the session resets.
|
|
37
11
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Cuando trabajas con IA en un proyecto grande, el contexto se pierde al cambiar de sesion, modelo o herramienta. Cada vez hay que re-explicar todo. CCODE resuelve esto almacenando el contexto en el repositorio como archivos versionables con Git.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## COMO funciona
|
|
45
|
-
|
|
46
|
-
### Instalacion
|
|
12
|
+
<br/>
|
|
47
13
|
|
|
48
14
|
```bash
|
|
49
15
|
npm install -g @korl3one/ccode
|
|
50
16
|
```
|
|
51
17
|
|
|
52
|
-
|
|
18
|
+
<br/>
|
|
53
19
|
|
|
54
|
-
|
|
20
|
+
[](https://www.npmjs.com/package/@korl3one/ccode)
|
|
21
|
+
[](LICENSE)
|
|
22
|
+
[](https://nodejs.org)
|
|
23
|
+
[](https://github.com/iDevelop25/ccode)
|
|
55
24
|
|
|
56
|
-
|
|
25
|
+
</div>
|
|
57
26
|
|
|
58
|
-
|
|
59
|
-
git clone https://github.com/iDevelop25/ccode.git
|
|
60
|
-
cd ccode
|
|
61
|
-
npm install
|
|
62
|
-
npm run build
|
|
63
|
-
npm link
|
|
64
|
-
```
|
|
27
|
+
---
|
|
65
28
|
|
|
66
|
-
|
|
29
|
+
## The problem
|
|
67
30
|
|
|
68
|
-
|
|
31
|
+
Every time you switch sessions, models, or tools when working with AI, **you lose your project context**. You end up re-explaining the architecture, previous decisions, and current state over and over again.
|
|
69
32
|
|
|
70
|
-
|
|
71
|
-
cd mi-proyecto
|
|
72
|
-
ccode init
|
|
73
|
-
```
|
|
33
|
+
## The solution
|
|
74
34
|
|
|
75
|
-
|
|
35
|
+
CCODE stores your project context **inside the repository**. One command generates professional documentation, architecture, rules, and a verifiable task checklist — all adapted to your project's actual complexity.
|
|
76
36
|
|
|
77
|
-
|
|
78
|
-
●○○○ Paso 1/4 — Descripcion del proyecto
|
|
79
|
-
> "Una app de gestion de tareas con autenticacion y dashboard"
|
|
37
|
+
Any developer or AI can read `.ccode/` and understand the project instantly.
|
|
80
38
|
|
|
81
|
-
|
|
82
|
-
> "Login, registro, CRUD de tareas, filtros, estadisticas"
|
|
39
|
+
---
|
|
83
40
|
|
|
84
|
-
|
|
85
|
-
> "Next.js, TypeScript, Prisma, PostgreSQL"
|
|
41
|
+
## Demo
|
|
86
42
|
|
|
87
|
-
|
|
88
|
-
> "Aplicacion web"
|
|
89
|
-
```
|
|
43
|
+
### `ccode init` — Generate full project context
|
|
90
44
|
|
|
91
|
-
|
|
45
|
+
<div align="center">
|
|
46
|
+
<img src="assets/demo-init.svg" alt="ccode init demo" width="700"/>
|
|
47
|
+
</div>
|
|
92
48
|
|
|
93
|
-
|
|
94
|
-
- **Medio** (app estandar): contexto moderado, 5-8 tareas
|
|
95
|
-
- **Complejo** (multiples modulos, integraciones): contexto completo con patrones y diagramas, 8-12 tareas
|
|
49
|
+
<br/>
|
|
96
50
|
|
|
97
|
-
|
|
51
|
+
### Persistent session — CCODE watches while you code
|
|
98
52
|
|
|
99
|
-
|
|
53
|
+
<div align="center">
|
|
54
|
+
<img src="assets/demo-session.svg" alt="ccode session demo" width="700"/>
|
|
55
|
+
</div>
|
|
100
56
|
|
|
101
|
-
|
|
57
|
+
<br/>
|
|
102
58
|
|
|
103
|
-
|
|
104
|
-
████████████░░░░░░░░ 60% (3/5)
|
|
105
|
-
> Tarea activa: TASK-002 — Crear formulario de login
|
|
106
|
-
|
|
107
|
-
? Que hacemos?
|
|
108
|
-
> Verificar progreso (se detectaron cambios)
|
|
109
|
-
Marcar tarea como completada
|
|
110
|
-
Iniciar siguiente tarea (2 pendientes)
|
|
111
|
-
Generar / actualizar plan de tareas
|
|
112
|
-
Ver estado completo
|
|
113
|
-
Ver contexto generado
|
|
114
|
-
Salir
|
|
115
|
-
```
|
|
59
|
+
### `ccode doctor` — Project health check
|
|
116
60
|
|
|
117
|
-
|
|
61
|
+
<div align="center">
|
|
62
|
+
<img src="assets/demo-doctor.svg" alt="ccode doctor demo" width="700"/>
|
|
63
|
+
</div>
|
|
118
64
|
|
|
119
|
-
|
|
120
|
-
2. **Muestra progreso** con barra visual y tarea activa
|
|
121
|
-
3. **Adapta el menu** al estado actual del proyecto
|
|
122
|
-
4. **Sugiere acciones** relevantes (si hay cambios + tarea activa → sugiere verificar)
|
|
123
|
-
5. **Se recupera de errores** — si algo falla, la sesion sigue activa
|
|
65
|
+
---
|
|
124
66
|
|
|
125
|
-
|
|
67
|
+
## Why CCODE?
|
|
126
68
|
|
|
127
|
-
|
|
69
|
+
<div align="center">
|
|
128
70
|
|
|
129
|
-
|
|
71
|
+
| | CCODE | Manual prompts |
|
|
72
|
+
|---|:---:|:---:|
|
|
73
|
+
| Persistent project context | ✅ | ❌ |
|
|
74
|
+
| Architecture adapted to complexity | ✅ | ❌ |
|
|
75
|
+
| AI-ready documentation | ✅ | ❌ |
|
|
76
|
+
| Verifiable task checklist | ✅ | ❌ |
|
|
77
|
+
| Auto-detect file changes | ✅ | ❌ |
|
|
78
|
+
| AI-powered task verification | ✅ | ❌ |
|
|
79
|
+
| Works with 6 AI providers | ✅ | ❌ |
|
|
80
|
+
| Context lives in the repo (Git) | ✅ | ❌ |
|
|
130
81
|
|
|
131
|
-
|
|
132
|
-
> Verificar progreso con IA
|
|
82
|
+
</div>
|
|
133
83
|
|
|
134
|
-
|
|
84
|
+
---
|
|
135
85
|
|
|
136
|
-
|
|
137
|
-
Evidencia: package.json, tsconfig.json y estructura de carpetas encontrados
|
|
86
|
+
## How it works
|
|
138
87
|
|
|
139
|
-
|
|
140
|
-
Falta: Campo de contrasena no encontrado, validacion pendiente
|
|
88
|
+
### 1. Initialize
|
|
141
89
|
|
|
142
|
-
|
|
90
|
+
```bash
|
|
91
|
+
cd my-project
|
|
92
|
+
ccode init
|
|
143
93
|
```
|
|
144
94
|
|
|
145
|
-
|
|
95
|
+
A step-by-step wizard asks about your project and an AI generates the full context. CCODE **adapts automatically**:
|
|
146
96
|
|
|
147
|
-
|
|
97
|
+
| Project type | Context depth | Tasks |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| Simple (prototype, few features) | Lightweight docs | 3-5 |
|
|
100
|
+
| Medium (standard app) | Moderate architecture | 5-8 |
|
|
101
|
+
| Complex (multiple modules) | Detailed patterns + diagrams | 8-12 |
|
|
148
102
|
|
|
149
|
-
|
|
150
|
-
|--------|----------|
|
|
151
|
-
| **Conectar IA** | Configura tu proveedor de IA (Claude, OpenAI, Gemini, DeepSeek, Groq, Ollama) |
|
|
152
|
-
| **Siguiente tarea** | Muestra la tarea mas prioritaria y ofrece iniciarla |
|
|
153
|
-
| **Verificar progreso** | La IA escanea el proyecto y actualiza estados |
|
|
154
|
-
| **Completar tarea** | Marca como completada, registra en memoria |
|
|
155
|
-
| **Re-planificar** | Genera nuevas tareas considerando lo ya completado |
|
|
156
|
-
| **Ver estado** | Dashboard con barra de progreso y estadisticas |
|
|
157
|
-
| **Ver contexto** | Muestra cualquier archivo de `.ccode/` |
|
|
103
|
+
A simple login doesn't need microservice diagrams. CCODE is smart about it.
|
|
158
104
|
|
|
159
|
-
|
|
105
|
+
### 2. Persistent session
|
|
160
106
|
|
|
161
|
-
|
|
107
|
+
After init, CCODE **stays active** — watching your project in real time:
|
|
162
108
|
|
|
163
|
-
|
|
109
|
+
- Detects file changes automatically
|
|
110
|
+
- Suggests verifying tasks when it sees progress
|
|
111
|
+
- Adapts the menu to your current workflow state
|
|
112
|
+
- Recovers from errors without crashing
|
|
164
113
|
|
|
165
|
-
|
|
166
|
-
|-----------|---------|------|
|
|
167
|
-
| **Claude** (Anthropic) | Sonnet 4, Haiku 3.5, Opus 4 | Recomendado |
|
|
168
|
-
| **OpenAI** (ChatGPT) | GPT-4o, GPT-4o mini, GPT-4.1, o3-mini | El mas popular |
|
|
169
|
-
| **Google Gemini** | 2.5 Flash, 2.5 Pro, 2.0 Flash | Gratis con limites |
|
|
170
|
-
| **DeepSeek** | Chat, Reasoner | Economico |
|
|
171
|
-
| **Groq** | Llama 3.3 70B, Llama 3.1 8B, Mixtral 8x7B | Ultra-rapido, tier gratis |
|
|
172
|
-
| **Ollama** | Cualquier modelo local | Sin internet, sin API key |
|
|
114
|
+
You code in your editor. CCODE runs in another terminal as a companion.
|
|
173
115
|
|
|
174
|
-
|
|
116
|
+
### 3. AI verification
|
|
175
117
|
|
|
176
|
-
|
|
118
|
+
CCODE compares **acceptance criteria** against **actual project files**:
|
|
177
119
|
|
|
178
|
-
|
|
120
|
+
```
|
|
121
|
+
✓ TASK-001: Setup project base — COMPLETED
|
|
122
|
+
Evidence: package.json, tsconfig.json found
|
|
179
123
|
|
|
180
|
-
|
|
124
|
+
◐ TASK-002: Create login form — IN PROGRESS
|
|
125
|
+
Missing: password field not found, validation pending
|
|
181
126
|
|
|
182
|
-
|
|
127
|
+
○ TASK-003: Implement JWT auth — PENDING
|
|
128
|
+
```
|
|
183
129
|
|
|
184
|
-
|
|
130
|
+
It doesn't guess — it verifies.
|
|
185
131
|
|
|
186
|
-
|
|
132
|
+
### 4. Context export
|
|
187
133
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- **Consistencia:** Todos los colaboradores y herramientas operan con la misma fuente de verdad.
|
|
192
|
-
- **Workflow explicito:** El estado del workflow evita que se ejecuten acciones fuera de orden.
|
|
134
|
+
```bash
|
|
135
|
+
ccode export
|
|
136
|
+
```
|
|
193
137
|
|
|
194
|
-
|
|
138
|
+
Generates a single `.md` file with your full project context — ready to paste into **any AI chat** (ChatGPT, Claude, Gemini) without connecting an API.
|
|
195
139
|
|
|
196
|
-
|
|
140
|
+
### 5. Project health check
|
|
197
141
|
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
Malo: "Implementar const form = document.createElement('form')..."
|
|
142
|
+
```bash
|
|
143
|
+
ccode doctor
|
|
201
144
|
```
|
|
202
145
|
|
|
203
|
-
|
|
146
|
+
Like a linter, but for your project context. Checks files, AI connection, task status, and tells you what needs attention.
|
|
204
147
|
|
|
205
148
|
---
|
|
206
149
|
|
|
207
|
-
##
|
|
150
|
+
## Supported AI Providers
|
|
208
151
|
|
|
209
|
-
|
|
152
|
+
<div align="center">
|
|
210
153
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
154
|
+
| Provider | Models | Note |
|
|
155
|
+
|----------|--------|------|
|
|
156
|
+
| **Claude** (Anthropic) | Sonnet 4, Haiku 3.5, Opus 4 | Recommended |
|
|
157
|
+
| **OpenAI** (ChatGPT) | GPT-4o, GPT-4o mini, GPT-4.1, o3-mini | Most popular |
|
|
158
|
+
| **Google Gemini** | 2.5 Flash, 2.5 Pro, 2.0 Flash | Free tier available |
|
|
159
|
+
| **DeepSeek** | Chat, Reasoner | Budget-friendly |
|
|
160
|
+
| **Groq** | Llama 3.3 70B, Llama 3.1 8B, Mixtral | Ultra-fast, free tier |
|
|
161
|
+
| **Ollama** | Any local model | Offline, no API key |
|
|
215
162
|
|
|
216
|
-
|
|
163
|
+
</div>
|
|
217
164
|
|
|
218
|
-
|
|
219
|
-
- **Onboarding rapido:** Un nuevo miembro lee `.ccode/` y entiende todo
|
|
220
|
-
- **Decisiones trazables:** El historial de memoria muestra por que se tomaron decisiones
|
|
165
|
+
---
|
|
221
166
|
|
|
222
|
-
|
|
167
|
+
## Available commands
|
|
223
168
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
169
|
+
| Command | What it does |
|
|
170
|
+
|---------|-------------|
|
|
171
|
+
| `ccode init` | Interactive wizard — generates full project context |
|
|
172
|
+
| `ccode update` | Re-analyze project and refresh context with AI |
|
|
173
|
+
| `ccode export` | Export context as a single `.md` for any AI chat |
|
|
174
|
+
| `ccode explain` | Quick project summary for onboarding |
|
|
175
|
+
| `ccode doctor` | Health check — what's good, what's missing |
|
|
176
|
+
| `ccode connect` | Configure AI provider and model |
|
|
177
|
+
| `ccode status` | Dashboard with progress bar and stats |
|
|
178
|
+
| `ccode verify` | AI-powered task verification |
|
|
227
179
|
|
|
228
180
|
---
|
|
229
181
|
|
|
230
|
-
##
|
|
182
|
+
## What gets generated
|
|
183
|
+
|
|
184
|
+
Everything lives in `.ccode/` inside your repository:
|
|
231
185
|
|
|
232
186
|
```
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
ai/
|
|
243
|
-
provider.ts → Interfaz comun IAIProvider (patron Adapter)
|
|
244
|
-
claude.ts → Adapter para Claude (Anthropic)
|
|
245
|
-
openai.ts → Adapter para OpenAI (ChatGPT)
|
|
246
|
-
gemini.ts → Adapter para Google Gemini
|
|
247
|
-
deepseek.ts → Adapter para DeepSeek
|
|
248
|
-
groq.ts → Adapter para Groq (inferencia ultra-rapida)
|
|
249
|
-
ollama.ts → Adapter para Ollama (modelos locales)
|
|
250
|
-
manager.ts → Factory y gestion de configuracion
|
|
251
|
-
utils/
|
|
252
|
-
files.ts → Abstraccion del sistema de archivos
|
|
187
|
+
.ccode/
|
|
188
|
+
├── project.md Vision, objectives, scope
|
|
189
|
+
├── architecture.md System structure (adapted to complexity)
|
|
190
|
+
├── rules.md Development standards for your stack
|
|
191
|
+
├── tasks.json Task checklist with acceptance criteria
|
|
192
|
+
├── state.json Active task, workflow stage
|
|
193
|
+
├── context.json Project configuration
|
|
194
|
+
├── memory.md Decision history
|
|
195
|
+
└── config.json AI provider config
|
|
253
196
|
```
|
|
254
197
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
| Patron | Donde | Por que |
|
|
258
|
-
|--------|-------|---------|
|
|
259
|
-
| **Adapter** | `ai/` | Proveedores intercambiables sin cambiar el core |
|
|
260
|
-
| **State Machine** | `context.ts` | Workflow explicito (created → connected → planned → in_progress → idle) |
|
|
261
|
-
| **Observer** | `watcher.ts` | Deteccion reactiva de cambios en archivos |
|
|
262
|
-
| **Builder** | `prompt-builder.ts` | Construccion incremental de prompts complejos |
|
|
263
|
-
|
|
264
|
-
### Paleta de colores
|
|
265
|
-
|
|
266
|
-
| Color | Hex | Uso |
|
|
267
|
-
|-------|-----|-----|
|
|
268
|
-
| Primary | `#00B4D8` | Elementos principales, headers |
|
|
269
|
-
| Secondary | `#0077B6` | Acentos secundarios |
|
|
270
|
-
| Accent | `#90E0EF` | Highlights, info destacada |
|
|
271
|
-
| Success | `#2DC653` | Operaciones exitosas |
|
|
272
|
-
| Warning | `#FFB703` | Advertencias |
|
|
273
|
-
| Error | `#E63946` | Errores |
|
|
274
|
-
|
|
275
|
-
### Logo gradiente
|
|
198
|
+
---
|
|
276
199
|
|
|
277
|
-
|
|
278
|
-
`#90E0EF → #48CAE4 → #00B4D8 → #0096C7 → #0077B6 → #023E8A`
|
|
200
|
+
## Architecture
|
|
279
201
|
|
|
280
|
-
|
|
202
|
+
```
|
|
203
|
+
src/
|
|
204
|
+
├── cli/ Session, branding, file watcher
|
|
205
|
+
├── core/ Context engine, tasks, prompt builder
|
|
206
|
+
├── ai/ 6 provider adapters (Adapter pattern)
|
|
207
|
+
└── utils/ File system abstraction
|
|
208
|
+
```
|
|
281
209
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
| Tecnologia | Rol |
|
|
285
|
-
|------------|-----|
|
|
286
|
-
| **Node.js** | Runtime |
|
|
287
|
-
| **TypeScript** | Tipado estatico, interfaces |
|
|
288
|
-
| **ESM** | Sistema de modulos (`"type": "module"`, `NodeNext`) |
|
|
289
|
-
| **Commander.js** | Definicion de comandos CLI |
|
|
290
|
-
| **Inquirer v13** | Prompts interactivos y menus |
|
|
291
|
-
| **Chalk v5** | Colores en terminal |
|
|
292
|
-
| **Ora v8** | Spinners de progreso |
|
|
293
|
-
| **Axios** | HTTP client para APIs de IA |
|
|
294
|
-
| **fs-extra** | Operaciones de archivos mejoradas |
|
|
295
|
-
| **Vitest** | Testing |
|
|
210
|
+
**Patterns:** Adapter (AI providers) · Observer (file watcher) · State Machine (workflow) · Builder (prompts)
|
|
296
211
|
|
|
297
212
|
---
|
|
298
213
|
|
|
299
|
-
##
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
# Ejecutar tests
|
|
303
|
-
npm test
|
|
214
|
+
## Contributing
|
|
304
215
|
|
|
305
|
-
|
|
306
|
-
npm test:watch
|
|
307
|
-
```
|
|
216
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions.
|
|
308
217
|
|
|
309
|
-
|
|
310
|
-
- `PromptBuilder.parseJSON` — parsing robusto de respuestas de IA (directo, envuelto en texto, bloques markdown)
|
|
311
|
-
- `TaskEngine` — CRUD de tareas, priorizacion, estadisticas, manejo de errores
|
|
312
|
-
- `FileWatcher` — Estado inicial, flush, stop seguro
|
|
218
|
+
Adding a new AI provider? Just implement `IAIProvider`, add it to the manager switch, done. Zero changes to the rest of the system.
|
|
313
219
|
|
|
314
220
|
---
|
|
315
221
|
|
|
316
|
-
##
|
|
222
|
+
## Learn more
|
|
317
223
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
```
|
|
224
|
+
| Resource | Link |
|
|
225
|
+
|----------|------|
|
|
226
|
+
| Learning guide (6 modules, QP2C) | [docs/learning/](docs/learning/README.md) |
|
|
227
|
+
| Engineering roles | [AGENTS.md](AGENTS.md) |
|
|
228
|
+
| Technical competencies | [SKILLS.md](SKILLS.md) |
|
|
229
|
+
| YouTube tutorials | [@CreativeCode25](https://www.youtube.com/@CreativeCode25) |
|
|
325
230
|
|
|
326
231
|
---
|
|
327
232
|
|
|
328
|
-
|
|
233
|
+
<div align="center">
|
|
329
234
|
|
|
330
|
-
|
|
235
|
+
### If CCODE helps you, consider giving it a star ⭐
|
|
331
236
|
|
|
332
|
-
|
|
333
|
-
|--------|------|
|
|
334
|
-
| [00 — Introduccion](docs/learning/modules/00-intro.md) | Que es CCODE y que problema resuelve |
|
|
335
|
-
| [01 — CLI y Sesion](docs/learning/modules/01-cli-session.md) | Arquitectura CLI, loop persistente, menu contextual |
|
|
336
|
-
| [02 — Contexto Persistente](docs/learning/modules/02-context-persistence.md) | ContextEngine, TaskEngine, estado en `.ccode/` |
|
|
337
|
-
| [03 — Generacion de Contexto](docs/learning/modules/03-context-generation.md) | PromptBuilder, meta-prompts, adaptacion de complejidad |
|
|
338
|
-
| [04 — Proveedores de IA](docs/learning/modules/04-ai-providers.md) | Patron Adapter, 6 proveedores, AIManager |
|
|
339
|
-
| [05 — Watcher y Verificacion](docs/learning/modules/05-watcher-verify.md) | FileWatcher, verificacion automatica de tareas |
|
|
237
|
+
It helps the project grow and reach more developers.
|
|
340
238
|
|
|
341
|
-
|
|
342
|
-
- [`AGENTS.md`](AGENTS.md) — Roles de ingenieria del proyecto
|
|
343
|
-
- [`SKILLS.md`](SKILLS.md) — Competencias tecnicas requeridas
|
|
239
|
+
<br/>
|
|
344
240
|
|
|
345
|
-
|
|
241
|
+
[](https://github.com/iDevelop25/ccode)
|
|
346
242
|
|
|
347
|
-
|
|
243
|
+
<br/>
|
|
348
244
|
|
|
349
|
-
|
|
245
|
+
**[npm](https://www.npmjs.com/package/@korl3one/ccode)** · **[GitHub](https://github.com/iDevelop25/ccode)** · **[YouTube](https://www.youtube.com/@CreativeCode25)**
|
|
350
246
|
|
|
351
|
-
|
|
247
|
+
<br/>
|
|
248
|
+
|
|
249
|
+
*CCODE doesn't tell you how to code — it tells you what to build and makes sure you don't lose track.*
|
|
352
250
|
|
|
353
|
-
|
|
251
|
+
</div>
|
package/dist/cli/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import inquirer from 'inquirer';
|
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import * as path from 'path';
|
|
6
6
|
import * as fs from 'fs';
|
|
7
|
+
import updateNotifier from 'update-notifier';
|
|
7
8
|
import { showLogo, showWelcome, showHeader, showStep, showSuccess, showError, showWarning, showInfo, showFileTree, showProgressBar, c, } from './brand.js';
|
|
8
9
|
import { FileUtils } from '../utils/files.js';
|
|
9
10
|
import { ContextEngine } from '../core/context.js';
|
|
@@ -179,7 +180,7 @@ async function startSession() {
|
|
|
179
180
|
if (!hasConfig) {
|
|
180
181
|
choices.push({ name: ' 🔌 Conectar proveedor de IA', value: 'connect' });
|
|
181
182
|
}
|
|
182
|
-
choices.push({ name: ' 📋 Generar / actualizar plan de tareas', value: 'plan' }, { name: ` 📊 Ver estado completo`, value: 'status' }, { name: ' 📄 Ver contexto generado', value: 'context' });
|
|
183
|
+
choices.push({ name: ' 📋 Generar / actualizar plan de tareas', value: 'plan' }, { name: ` 📊 Ver estado completo`, value: 'status' }, { name: ' 📄 Ver contexto generado', value: 'context' }, { name: ' 🔄 Actualizar contexto (re-analizar proyecto)', value: 'update' }, { name: ' 📤 Exportar contexto para otra IA', value: 'export' }, { name: ' 💡 Explicar proyecto (resumen rápido)', value: 'explain' }, { name: ' 🩺 Doctor (diagnóstico de salud)', value: 'doctor' });
|
|
183
184
|
if (hasConfig) {
|
|
184
185
|
choices.push({ name: ' 🔌 Reconfigurar IA', value: 'connect' });
|
|
185
186
|
}
|
|
@@ -211,6 +212,10 @@ async function startSession() {
|
|
|
211
212
|
complete: handleComplete,
|
|
212
213
|
status: handleStatus,
|
|
213
214
|
context: handleContext,
|
|
215
|
+
update: handleUpdate,
|
|
216
|
+
export: handleExport,
|
|
217
|
+
explain: handleExplain,
|
|
218
|
+
doctor: handleDoctor,
|
|
214
219
|
};
|
|
215
220
|
if (handlers[action]) {
|
|
216
221
|
try {
|
|
@@ -720,13 +725,226 @@ async function handleContext() {
|
|
|
720
725
|
}
|
|
721
726
|
console.log('');
|
|
722
727
|
}
|
|
728
|
+
// ─── UPDATE ─────────────────────────────────────────────────────────
|
|
729
|
+
async function handleUpdate() {
|
|
730
|
+
if (!(await requireInit()))
|
|
731
|
+
return;
|
|
732
|
+
const config = await requireAI();
|
|
733
|
+
if (!config)
|
|
734
|
+
return;
|
|
735
|
+
showHeader('Actualizar Contexto');
|
|
736
|
+
const spinner = ora({ text: 'Analizando proyecto...', color: 'cyan', spinner: 'dots' }).start();
|
|
737
|
+
try {
|
|
738
|
+
const ccodePath = path.join(process.cwd(), '.ccode');
|
|
739
|
+
const contextEngine = new ContextEngine();
|
|
740
|
+
await contextEngine.load();
|
|
741
|
+
const ctx = contextEngine.getContext();
|
|
742
|
+
// Leer archivos del proyecto
|
|
743
|
+
const projectFiles = listProjectFiles(process.cwd());
|
|
744
|
+
// Leer contexto actual
|
|
745
|
+
const currentProject = await FileUtils.readFileSafe(path.join(ccodePath, 'project.md'));
|
|
746
|
+
const currentArch = await FileUtils.readFileSafe(path.join(ccodePath, 'architecture.md'));
|
|
747
|
+
const currentRules = await FileUtils.readFileSafe(path.join(ccodePath, 'rules.md'));
|
|
748
|
+
spinner.text = 'Actualizando con IA...';
|
|
749
|
+
const provider = AIManager.getProvider(config);
|
|
750
|
+
const updatePrompt = `Eres un arquitecto de software. Analiza el estado ACTUAL del proyecto y actualiza la documentación existente.
|
|
751
|
+
|
|
752
|
+
=== DOCUMENTACIÓN ACTUAL ===
|
|
753
|
+
${currentProject}
|
|
754
|
+
|
|
755
|
+
=== ARQUITECTURA ACTUAL ===
|
|
756
|
+
${currentArch}
|
|
757
|
+
|
|
758
|
+
=== REGLAS ACTUALES ===
|
|
759
|
+
${currentRules}
|
|
760
|
+
|
|
761
|
+
=== ARCHIVOS EN EL PROYECTO ===
|
|
762
|
+
${projectFiles.join('\n')}
|
|
763
|
+
|
|
764
|
+
Actualiza la documentación para reflejar los archivos y estructura actuales del proyecto. Mantén lo que siga siendo válido, actualiza lo que haya cambiado, agrega lo nuevo.
|
|
765
|
+
|
|
766
|
+
Responde ÚNICAMENTE con JSON válido:
|
|
767
|
+
{
|
|
768
|
+
"project": "Contenido actualizado de project.md",
|
|
769
|
+
"architecture": "Contenido actualizado de architecture.md",
|
|
770
|
+
"rules": "Contenido actualizado de rules.md",
|
|
771
|
+
"changes": ["Lista de cambios detectados"]
|
|
772
|
+
}`;
|
|
773
|
+
const response = await provider.generate(updatePrompt);
|
|
774
|
+
const result = PromptBuilder.parseJSON(response);
|
|
775
|
+
await FileUtils.writeFile(path.join(ccodePath, 'project.md'), result.project);
|
|
776
|
+
await FileUtils.writeFile(path.join(ccodePath, 'architecture.md'), result.architecture);
|
|
777
|
+
await FileUtils.writeFile(path.join(ccodePath, 'rules.md'), result.rules);
|
|
778
|
+
spinner.succeed(c.success('Contexto actualizado'));
|
|
779
|
+
if (result.changes && result.changes.length > 0) {
|
|
780
|
+
console.log('');
|
|
781
|
+
console.log(c.accent(' Cambios detectados:'));
|
|
782
|
+
result.changes.forEach(change => console.log(c.dim(` • ${change}`)));
|
|
783
|
+
}
|
|
784
|
+
console.log('');
|
|
785
|
+
}
|
|
786
|
+
catch (error) {
|
|
787
|
+
spinner.fail('Error');
|
|
788
|
+
showError(error instanceof Error ? error.message : String(error));
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
// ─── EXPORT ─────────────────────────────────────────────────────────
|
|
792
|
+
async function handleExport() {
|
|
793
|
+
if (!(await requireInit()))
|
|
794
|
+
return;
|
|
795
|
+
showHeader('Exportar Contexto');
|
|
796
|
+
const pb = new PromptBuilder();
|
|
797
|
+
const fullContext = await pb.buildContextPrompt();
|
|
798
|
+
const exportPath = path.join(process.cwd(), '.ccode', 'context-export.md');
|
|
799
|
+
await FileUtils.writeFile(exportPath, `# CCODE — Project Context Export\n\n${fullContext}`);
|
|
800
|
+
showSuccess('Contexto exportado a .ccode/context-export.md');
|
|
801
|
+
showInfo('Copia el contenido y pégalo en cualquier chat de IA (ChatGPT, Claude, Gemini, etc.).');
|
|
802
|
+
console.log('');
|
|
803
|
+
}
|
|
804
|
+
// ─── EXPLAIN ────────────────────────────────────────────────────────
|
|
805
|
+
async function handleExplain() {
|
|
806
|
+
if (!(await requireInit()))
|
|
807
|
+
return;
|
|
808
|
+
showHeader('Resumen del Proyecto');
|
|
809
|
+
const ccodePath = path.join(process.cwd(), '.ccode');
|
|
810
|
+
const projectMd = await FileUtils.readFileSafe(path.join(ccodePath, 'project.md'));
|
|
811
|
+
const archMd = await FileUtils.readFileSafe(path.join(ccodePath, 'architecture.md'));
|
|
812
|
+
const taskEngine = new TaskEngine();
|
|
813
|
+
await taskEngine.load();
|
|
814
|
+
const stats = taskEngine.getStats();
|
|
815
|
+
const projectFiles = listProjectFiles(process.cwd());
|
|
816
|
+
// Extraer info clave
|
|
817
|
+
console.log(c.bold(' Proyecto'));
|
|
818
|
+
projectMd.split('\n').slice(0, 8).forEach(line => {
|
|
819
|
+
if (line.trim())
|
|
820
|
+
console.log(` ${line}`);
|
|
821
|
+
});
|
|
822
|
+
console.log('');
|
|
823
|
+
console.log(c.bold(' Arquitectura'));
|
|
824
|
+
archMd.split('\n').slice(0, 12).forEach(line => {
|
|
825
|
+
if (line.trim())
|
|
826
|
+
console.log(` ${line}`);
|
|
827
|
+
});
|
|
828
|
+
console.log('');
|
|
829
|
+
console.log(c.bold(' Archivos detectados'));
|
|
830
|
+
const dirs = projectFiles.filter(f => f.endsWith('/')).slice(0, 10);
|
|
831
|
+
dirs.forEach(d => console.log(c.accent(` ${d}`)));
|
|
832
|
+
const fileCount = projectFiles.filter(f => !f.endsWith('/')).length;
|
|
833
|
+
console.log(c.dim(` ${fileCount} archivos en total`));
|
|
834
|
+
console.log('');
|
|
835
|
+
console.log(c.bold(' Progreso'));
|
|
836
|
+
console.log(` ${showProgressBar(stats.completed, stats.total)}`);
|
|
837
|
+
console.log(c.dim(` ${stats.completed} completadas, ${stats.in_progress} en progreso, ${stats.pending} pendientes, ${stats.failed} fallidas`));
|
|
838
|
+
console.log('');
|
|
839
|
+
}
|
|
840
|
+
// ─── DOCTOR ─────────────────────────────────────────────────────────
|
|
841
|
+
async function handleDoctor() {
|
|
842
|
+
if (!(await requireInit()))
|
|
843
|
+
return;
|
|
844
|
+
showHeader('Diagnóstico del Proyecto');
|
|
845
|
+
const ccodePath = path.join(process.cwd(), '.ccode');
|
|
846
|
+
let issues = 0;
|
|
847
|
+
// 1. Verificar archivos de contexto
|
|
848
|
+
const requiredFiles = [
|
|
849
|
+
{ file: 'context.json', label: 'Configuración del proyecto' },
|
|
850
|
+
{ file: 'state.json', label: 'Estado del workflow' },
|
|
851
|
+
{ file: 'project.md', label: 'Documentación del proyecto' },
|
|
852
|
+
{ file: 'architecture.md', label: 'Arquitectura' },
|
|
853
|
+
{ file: 'rules.md', label: 'Reglas de desarrollo' },
|
|
854
|
+
{ file: 'tasks.json', label: 'Checklist de tareas' },
|
|
855
|
+
{ file: 'memory.md', label: 'Historial de decisiones' },
|
|
856
|
+
];
|
|
857
|
+
console.log(c.bold(' Archivos de contexto'));
|
|
858
|
+
for (const { file, label } of requiredFiles) {
|
|
859
|
+
const exists = await FileUtils.exists(path.join(ccodePath, file));
|
|
860
|
+
if (exists) {
|
|
861
|
+
const content = await FileUtils.readFileSafe(path.join(ccodePath, file));
|
|
862
|
+
if (content.trim().length < 5) {
|
|
863
|
+
console.log(c.warning(` ⚠ ${label} (${file}) — existe pero está vacío`));
|
|
864
|
+
issues++;
|
|
865
|
+
}
|
|
866
|
+
else {
|
|
867
|
+
console.log(c.success(` ✓ ${label}`));
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
else {
|
|
871
|
+
console.log(c.error(` ✗ ${label} (${file}) — no encontrado`));
|
|
872
|
+
issues++;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
// 2. Proveedor de IA
|
|
876
|
+
console.log('');
|
|
877
|
+
console.log(c.bold(' Proveedor de IA'));
|
|
878
|
+
const config = await AIManager.loadConfig();
|
|
879
|
+
if (config) {
|
|
880
|
+
console.log(c.success(` ✓ Configurado: ${config.provider} (${config.model || 'default'})`));
|
|
881
|
+
// Test de conexión
|
|
882
|
+
const spinner = ora({ text: ' Probando conexión...', color: 'cyan', spinner: 'dots' }).start();
|
|
883
|
+
const connected = await AIManager.testConnection(config);
|
|
884
|
+
if (connected) {
|
|
885
|
+
spinner.succeed(c.success('Conexión activa'));
|
|
886
|
+
}
|
|
887
|
+
else {
|
|
888
|
+
spinner.fail(c.error('No se pudo conectar'));
|
|
889
|
+
issues++;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
console.log(c.warning(` ⚠ No configurado — ejecuta "Conectar IA"`));
|
|
894
|
+
issues++;
|
|
895
|
+
}
|
|
896
|
+
// 3. Tareas
|
|
897
|
+
console.log('');
|
|
898
|
+
console.log(c.bold(' Tareas'));
|
|
899
|
+
const taskEngine = new TaskEngine();
|
|
900
|
+
await taskEngine.load();
|
|
901
|
+
const stats = taskEngine.getStats();
|
|
902
|
+
if (stats.total === 0) {
|
|
903
|
+
console.log(c.warning(' ⚠ No hay tareas — ejecuta "Generar plan"'));
|
|
904
|
+
issues++;
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
console.log(c.success(` ✓ ${stats.total} tareas en total`));
|
|
908
|
+
if (stats.completed > 0)
|
|
909
|
+
console.log(c.success(` ✓ ${stats.completed} completadas`));
|
|
910
|
+
if (stats.in_progress > 0)
|
|
911
|
+
console.log(c.accent(` ◐ ${stats.in_progress} en progreso`));
|
|
912
|
+
if (stats.pending > 0)
|
|
913
|
+
console.log(c.warning(` ⚠ ${stats.pending} pendientes`));
|
|
914
|
+
if (stats.failed > 0) {
|
|
915
|
+
console.log(c.error(` ✗ ${stats.failed} fallidas — necesitan replantearse`));
|
|
916
|
+
issues++;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
// 4. Archivos del proyecto
|
|
920
|
+
console.log('');
|
|
921
|
+
console.log(c.bold(' Proyecto'));
|
|
922
|
+
const projectFiles = listProjectFiles(process.cwd());
|
|
923
|
+
const fileCount = projectFiles.filter(f => !f.endsWith('/')).length;
|
|
924
|
+
const dirCount = projectFiles.filter(f => f.endsWith('/')).length;
|
|
925
|
+
console.log(c.success(` ✓ ${fileCount} archivos en ${dirCount} directorios`));
|
|
926
|
+
// Resumen
|
|
927
|
+
console.log('');
|
|
928
|
+
console.log(c.dim(' ─────────────────────────────────────────────'));
|
|
929
|
+
if (issues === 0) {
|
|
930
|
+
console.log(c.success(' ✓ Todo en orden — el proyecto está saludable'));
|
|
931
|
+
}
|
|
932
|
+
else {
|
|
933
|
+
console.log(c.warning(` ⚠ ${issues} problema${issues > 1 ? 's' : ''} encontrado${issues > 1 ? 's' : ''}`));
|
|
934
|
+
}
|
|
935
|
+
console.log('');
|
|
936
|
+
}
|
|
723
937
|
// ─── CLI Setup ──────────────────────────────────────────────────────
|
|
724
938
|
async function main() {
|
|
939
|
+
// Notificar si hay una version nueva disponible
|
|
940
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('../../package.json', import.meta.url), 'utf-8'));
|
|
941
|
+
const notifier = updateNotifier({ pkg, updateCheckInterval: 1000 * 60 * 60 * 4 }); // cada 4 horas
|
|
942
|
+
notifier.notify({ isGlobal: true });
|
|
725
943
|
const program = new Command();
|
|
726
944
|
program
|
|
727
945
|
.name('ccode')
|
|
728
946
|
.description('CCODE: Contexto Persistente para Desarrollo con IA')
|
|
729
|
-
.version(
|
|
947
|
+
.version(pkg.version);
|
|
730
948
|
// Comandos individuales (para uso rápido sin sesión)
|
|
731
949
|
program.command('init').description('Inicializa el contexto del proyecto').action(async () => {
|
|
732
950
|
await handleInit();
|
|
@@ -740,6 +958,10 @@ async function main() {
|
|
|
740
958
|
program.command('complete').description('Completa una tarea').action(handleComplete);
|
|
741
959
|
program.command('status').description('Estado del proyecto').action(handleStatus);
|
|
742
960
|
program.command('context').description('Ver contexto generado').action(handleContext);
|
|
961
|
+
program.command('update').description('Re-analiza y actualiza el contexto').action(handleUpdate);
|
|
962
|
+
program.command('export').description('Exporta contexto como .md para cualquier IA').action(handleExport);
|
|
963
|
+
program.command('explain').description('Resumen rápido del proyecto').action(handleExplain);
|
|
964
|
+
program.command('doctor').description('Diagnóstico de salud del proyecto').action(handleDoctor);
|
|
743
965
|
if (process.argv.length <= 2) {
|
|
744
966
|
// Sin argumentos → sesión interactiva
|
|
745
967
|
const isInitialized = await FileUtils.exists(path.join(process.cwd(), '.ccode'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@korl3one/ccode",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "CLI de contexto persistente para desarrollo asistido por IA. Genera documentacion, arquitectura, reglas y tareas verificables.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli/index.js",
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"commander": "^14.0.3",
|
|
58
58
|
"fs-extra": "^11.3.4",
|
|
59
59
|
"inquirer": "^13.3.0",
|
|
60
|
-
"ora": "^8.2.0"
|
|
60
|
+
"ora": "^8.2.0",
|
|
61
|
+
"update-notifier": "^7.3.1"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@types/fs-extra": "^11.0.4",
|