@korl3one/ccode 2.1.0 → 2.2.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 +139 -246
- package/dist/cli/index.js +219 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,349 +5,242 @@
|
|
|
5
5
|
██║ ██║ ██║ ██║██║ ██║██╔══╝
|
|
6
6
|
╚██████╗╚██████╗ ╚██████╔╝██████╔╝███████╗
|
|
7
7
|
╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
|
8
|
-
Context-Persistent AI Development v2.0
|
|
9
8
|
```
|
|
10
9
|
|
|
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.
|
|
20
|
-
|
|
21
|
-
Cuando ejecutas `ccode init`, un wizard interactivo te pregunta sobre tu proyecto y una IA genera:
|
|
22
|
-
|
|
23
|
-
| Archivo | Contenido |
|
|
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 |
|
|
33
|
-
|
|
34
|
-
Todo vive en la carpeta `.ccode/` dentro del repositorio. Cualquier desarrollador o IA puede leerla y entender el proyecto al instante.
|
|
35
|
-
|
|
36
|
-
### El principio fundamental
|
|
10
|
+
# CCODE
|
|
37
11
|
|
|
38
|
-
|
|
12
|
+
**Persistent context CLI for AI-assisted development.**
|
|
39
13
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## COMO funciona
|
|
45
|
-
|
|
46
|
-
### Instalacion
|
|
14
|
+
Stop re-explaining your project to AI every time the session resets.
|
|
47
15
|
|
|
48
16
|
```bash
|
|
49
17
|
npm install -g @korl3one/ccode
|
|
18
|
+
ccode init
|
|
50
19
|
```
|
|
51
20
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
21
|
+
[](https://www.npmjs.com/package/@korl3one/ccode)
|
|
22
|
+
[](LICENSE)
|
|
23
|
+
[](https://nodejs.org)
|
|
55
24
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
git clone https://github.com/iDevelop25/ccode.git
|
|
60
|
-
cd ccode
|
|
61
|
-
npm install
|
|
62
|
-
npm run build
|
|
63
|
-
npm link
|
|
64
|
-
```
|
|
25
|
+
---
|
|
65
26
|
|
|
66
|
-
|
|
27
|
+
## The problem
|
|
67
28
|
|
|
68
|
-
|
|
29
|
+
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
30
|
|
|
70
|
-
|
|
71
|
-
cd mi-proyecto
|
|
72
|
-
ccode init
|
|
73
|
-
```
|
|
31
|
+
## The solution
|
|
74
32
|
|
|
75
|
-
|
|
33
|
+
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
34
|
|
|
77
|
-
|
|
78
|
-
●○○○ Paso 1/4 — Descripcion del proyecto
|
|
79
|
-
> "Una app de gestion de tareas con autenticacion y dashboard"
|
|
35
|
+
Any developer or AI can read `.ccode/` and understand the project instantly.
|
|
80
36
|
|
|
81
|
-
|
|
82
|
-
> "Login, registro, CRUD de tareas, filtros, estadisticas"
|
|
37
|
+
---
|
|
83
38
|
|
|
84
|
-
|
|
85
|
-
> "Next.js, TypeScript, Prisma, PostgreSQL"
|
|
39
|
+
## Demo
|
|
86
40
|
|
|
87
|
-
●●●● Paso 4/4 — Tipo de proyecto
|
|
88
|
-
> "Aplicacion web"
|
|
89
41
|
```
|
|
42
|
+
$ ccode init
|
|
90
43
|
|
|
91
|
-
|
|
44
|
+
██████╗ ██████╗ ██████╗ ██████╗ ███████╗
|
|
45
|
+
██╔════╝██╔════╝ ██╔═══██╗██╔══██╗██╔════╝
|
|
46
|
+
██║ ██║ ██║ ██║██║ ██║█████╗
|
|
47
|
+
╚██████╗╚██████╗ ╚██████╔╝██████╔╝███████╗
|
|
48
|
+
╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
|
92
49
|
|
|
93
|
-
|
|
94
|
-
- **Medio** (app estandar): contexto moderado, 5-8 tareas
|
|
95
|
-
- **Complejo** (multiples modulos, integraciones): contexto completo con patrones y diagramas, 8-12 tareas
|
|
50
|
+
●●●● Paso 4/4
|
|
96
51
|
|
|
97
|
-
|
|
52
|
+
✓ Contexto generado exitosamente
|
|
98
53
|
|
|
99
|
-
|
|
54
|
+
.ccode/
|
|
55
|
+
├── project.md Documentacion del proyecto
|
|
56
|
+
├── architecture.md Arquitectura del sistema
|
|
57
|
+
├── rules.md Estandares de desarrollo
|
|
58
|
+
├── tasks.json Checklist de tareas (8 tareas)
|
|
59
|
+
├── context.json Configuracion
|
|
60
|
+
├── state.json Estado del workflow
|
|
61
|
+
└── memory.md Historial de decisiones
|
|
100
62
|
|
|
101
|
-
|
|
63
|
+
CCODE sigue observando tu proyecto...
|
|
102
64
|
|
|
103
|
-
```
|
|
104
65
|
████████████░░░░░░░░ 60% (3/5)
|
|
105
66
|
> Tarea activa: TASK-002 — Crear formulario de login
|
|
106
67
|
|
|
107
68
|
? Que hacemos?
|
|
108
69
|
> Verificar progreso (se detectaron cambios)
|
|
109
70
|
Marcar tarea como completada
|
|
110
|
-
Iniciar siguiente tarea
|
|
111
|
-
Generar / actualizar plan de tareas
|
|
71
|
+
Iniciar siguiente tarea
|
|
112
72
|
Ver estado completo
|
|
113
|
-
Ver contexto generado
|
|
114
73
|
Salir
|
|
115
74
|
```
|
|
116
75
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
1. **Detecta cambios** en tus archivos automaticamente (FileWatcher)
|
|
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
|
|
124
|
-
|
|
125
|
-
Tu desarrollas en tu editor favorito. CCODE esta en otra terminal como un acompanante que detecta tu progreso.
|
|
126
|
-
|
|
127
|
-
#### Paso 3: Verificacion automatica
|
|
76
|
+
---
|
|
128
77
|
|
|
129
|
-
|
|
78
|
+
## Why CCODE?
|
|
130
79
|
|
|
131
|
-
|
|
132
|
-
|
|
80
|
+
| | CCODE | Manual prompts |
|
|
81
|
+
|---|:---:|:---:|
|
|
82
|
+
| Persistent project context | ✅ | ❌ |
|
|
83
|
+
| Architecture adapted to complexity | ✅ | ❌ |
|
|
84
|
+
| AI-ready documentation | ✅ | ❌ |
|
|
85
|
+
| Verifiable task checklist | ✅ | ❌ |
|
|
86
|
+
| Auto-detect file changes | ✅ | ❌ |
|
|
87
|
+
| AI-powered task verification | ✅ | ❌ |
|
|
88
|
+
| Works with 6 AI providers | ✅ | ❌ |
|
|
89
|
+
| Context lives in the repo (Git) | ✅ | ❌ |
|
|
133
90
|
|
|
134
|
-
|
|
91
|
+
---
|
|
135
92
|
|
|
136
|
-
|
|
137
|
-
Evidencia: package.json, tsconfig.json y estructura de carpetas encontrados
|
|
93
|
+
## How it works
|
|
138
94
|
|
|
139
|
-
|
|
140
|
-
Falta: Campo de contrasena no encontrado, validacion pendiente
|
|
95
|
+
### 1. Initialize
|
|
141
96
|
|
|
142
|
-
|
|
97
|
+
```bash
|
|
98
|
+
cd my-project
|
|
99
|
+
ccode init
|
|
143
100
|
```
|
|
144
101
|
|
|
145
|
-
|
|
102
|
+
A step-by-step wizard asks about your project and an AI generates the full context. CCODE adapts automatically:
|
|
146
103
|
|
|
147
|
-
|
|
104
|
+
- **Simple project** (prototype, few features) → lightweight context, 3-5 tasks
|
|
105
|
+
- **Medium project** (standard app) → moderate context, 5-8 tasks
|
|
106
|
+
- **Complex project** (multiple modules, integrations) → detailed architecture, 8-12 tasks
|
|
148
107
|
|
|
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/` |
|
|
108
|
+
### 2. Persistent session
|
|
158
109
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
## Proveedores de IA soportados
|
|
110
|
+
After init, CCODE stays active — watching your project in real time:
|
|
162
111
|
|
|
163
|
-
|
|
112
|
+
- Detects file changes automatically
|
|
113
|
+
- Suggests verifying tasks when it sees progress
|
|
114
|
+
- Adapts the menu to your current workflow state
|
|
115
|
+
- Recovers from errors without crashing
|
|
164
116
|
|
|
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 |
|
|
117
|
+
You code in your editor. CCODE runs in another terminal as a companion.
|
|
173
118
|
|
|
174
|
-
|
|
119
|
+
### 3. AI verification
|
|
175
120
|
|
|
176
|
-
|
|
121
|
+
CCODE compares **acceptance criteria** against **actual project files**:
|
|
177
122
|
|
|
178
|
-
|
|
123
|
+
```
|
|
124
|
+
✓ TASK-001: Setup project base — COMPLETED
|
|
125
|
+
Evidence: package.json, tsconfig.json found
|
|
179
126
|
|
|
180
|
-
|
|
127
|
+
◐ TASK-002: Create login form — IN PROGRESS
|
|
128
|
+
Missing: password field not found, validation pending
|
|
181
129
|
|
|
182
|
-
|
|
130
|
+
○ TASK-003: Implement JWT auth — PENDING
|
|
131
|
+
```
|
|
183
132
|
|
|
184
|
-
###
|
|
133
|
+
### 4. Context export
|
|
185
134
|
|
|
186
|
-
|
|
135
|
+
```bash
|
|
136
|
+
ccode export
|
|
137
|
+
```
|
|
187
138
|
|
|
188
|
-
|
|
189
|
-
- **Independencia de modelo:** Cualquier IA (Claude, GPT, Ollama, la que sea) puede leer `.ccode/` y entender el proyecto al instante.
|
|
190
|
-
- **Trazabilidad:** Cada cambio queda en archivos versionables con Git. Puedes ver cuando se tomo cada decision.
|
|
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.
|
|
139
|
+
Generates a single `.md` file with your full project context — ready to paste into any AI chat (ChatGPT, Claude, Gemini, etc.) without connecting an API.
|
|
193
140
|
|
|
194
|
-
###
|
|
141
|
+
### 5. Project health check
|
|
195
142
|
|
|
196
|
-
|
|
143
|
+
```bash
|
|
144
|
+
ccode doctor
|
|
145
|
+
```
|
|
197
146
|
|
|
198
147
|
```
|
|
199
|
-
|
|
200
|
-
|
|
148
|
+
✓ Contexto generado
|
|
149
|
+
✓ Proveedor de IA configurado
|
|
150
|
+
⚠ 2 tareas sin completar
|
|
151
|
+
⚠ architecture.md no refleja 3 archivos nuevos
|
|
152
|
+
✓ Conexion con IA activa
|
|
201
153
|
```
|
|
202
154
|
|
|
203
|
-
Esto permite que cualquier desarrollador (humano o IA) ejecute las tareas con su propio criterio tecnico. CCODE guia el rumbo, no dicta la implementacion.
|
|
204
|
-
|
|
205
155
|
---
|
|
206
156
|
|
|
207
|
-
##
|
|
157
|
+
## Supported AI Providers
|
|
208
158
|
|
|
209
|
-
|
|
159
|
+
| Provider | Models | Note |
|
|
160
|
+
|----------|--------|------|
|
|
161
|
+
| **Claude** (Anthropic) | Sonnet 4, Haiku 3.5, Opus 4 | Recommended |
|
|
162
|
+
| **OpenAI** (ChatGPT) | GPT-4o, GPT-4o mini, GPT-4.1, o3-mini | Most popular |
|
|
163
|
+
| **Google Gemini** | 2.5 Flash, 2.5 Pro, 2.0 Flash | Free tier available |
|
|
164
|
+
| **DeepSeek** | Chat, Reasoner | Budget-friendly |
|
|
165
|
+
| **Groq** | Llama 3.3 70B, Llama 3.1 8B, Mixtral 8x7B | Ultra-fast, free tier |
|
|
166
|
+
| **Ollama** | Any local model | Offline, no API key |
|
|
210
167
|
|
|
211
|
-
|
|
212
|
-
- **Guia paso a paso** sin que te pierdas en un proyecto grande
|
|
213
|
-
- **Detecta tu progreso** automaticamente mientras programas
|
|
214
|
-
- **Adapta la complejidad** al tamano real del proyecto
|
|
168
|
+
---
|
|
215
169
|
|
|
216
|
-
|
|
170
|
+
## Available commands
|
|
217
171
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
172
|
+
| Command | What it does |
|
|
173
|
+
|---------|-------------|
|
|
174
|
+
| `ccode init` | Interactive wizard — generates full project context |
|
|
175
|
+
| `ccode update` | Re-analyze project and refresh context |
|
|
176
|
+
| `ccode export` | Export context as a single `.md` file for any AI |
|
|
177
|
+
| `ccode explain` | Quick project summary for onboarding |
|
|
178
|
+
| `ccode doctor` | Health check — what's good, what's missing |
|
|
179
|
+
| `ccode connect` | Configure AI provider |
|
|
180
|
+
| `ccode status` | Dashboard with progress bar and stats |
|
|
221
181
|
|
|
222
|
-
|
|
182
|
+
---
|
|
223
183
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
184
|
+
## What gets generated
|
|
185
|
+
|
|
186
|
+
Everything lives in `.ccode/` inside your repository:
|
|
187
|
+
|
|
188
|
+
| File | Content |
|
|
189
|
+
|------|---------|
|
|
190
|
+
| `project.md` | Vision, objectives, scope |
|
|
191
|
+
| `architecture.md` | System structure adapted to complexity |
|
|
192
|
+
| `rules.md` | Development standards for your stack |
|
|
193
|
+
| `tasks.json` | Task checklist with acceptance criteria |
|
|
194
|
+
| `state.json` | Active task, workflow stage |
|
|
195
|
+
| `memory.md` | Decision history |
|
|
196
|
+
| `config.json` | AI provider config |
|
|
227
197
|
|
|
228
198
|
---
|
|
229
199
|
|
|
230
|
-
##
|
|
200
|
+
## Architecture
|
|
231
201
|
|
|
232
202
|
```
|
|
233
203
|
src/
|
|
234
|
-
cli/
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
core/
|
|
239
|
-
context.ts → ContextEngine (configuracion + estado del workflow)
|
|
240
|
-
tasks.ts → TaskEngine (checklist de tareas con prioridades)
|
|
241
|
-
prompt-builder.ts → Meta-prompts adaptativos, generacion y verificacion
|
|
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
|
|
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
|
|
253
208
|
```
|
|
254
209
|
|
|
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
|
|
276
|
-
|
|
277
|
-
El logo ASCII usa un gradiente de 6 tonos de azul/cyan:
|
|
278
|
-
`#90E0EF → #48CAE4 → #00B4D8 → #0096C7 → #0077B6 → #023E8A`
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## Stack tecnologico
|
|
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
|
+
Key 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 and guidelines.
|
|
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.
|
|
313
219
|
|
|
314
220
|
---
|
|
315
221
|
|
|
316
|
-
##
|
|
222
|
+
## Learn more
|
|
317
223
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
npm test # Ejecutar tests
|
|
323
|
-
npm run test:watch # Tests en modo watch
|
|
324
|
-
```
|
|
224
|
+
- [Learning guide](docs/learning/README.md) — 6 modules following QP2C methodology
|
|
225
|
+
- [AGENTS.md](AGENTS.md) — Engineering roles
|
|
226
|
+
- [SKILLS.md](SKILLS.md) — Technical competencies
|
|
227
|
+
- [YouTube @CreativeCode25](https://www.youtube.com/@CreativeCode25) — Tutorials and walkthroughs
|
|
325
228
|
|
|
326
229
|
---
|
|
327
230
|
|
|
328
|
-
##
|
|
329
|
-
|
|
330
|
-
El proyecto incluye una guia de aprendizaje modular bajo la metodologia **QP2C** (Que, Como, Por que, Para que):
|
|
231
|
+
## Support the project
|
|
331
232
|
|
|
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 |
|
|
233
|
+
If CCODE helps you, consider giving it a **star on GitHub** ⭐
|
|
234
|
+
It helps the project grow and reach more developers.
|
|
340
235
|
|
|
341
|
-
|
|
342
|
-
- [`AGENTS.md`](AGENTS.md) — Roles de ingenieria del proyecto
|
|
343
|
-
- [`SKILLS.md`](SKILLS.md) — Competencias tecnicas requeridas
|
|
236
|
+
[](https://github.com/iDevelop25/ccode)
|
|
344
237
|
|
|
345
238
|
---
|
|
346
239
|
|
|
347
|
-
##
|
|
240
|
+
## License
|
|
348
241
|
|
|
349
242
|
ISC
|
|
350
243
|
|
|
351
244
|
---
|
|
352
245
|
|
|
353
|
-
*CCODE
|
|
246
|
+
*CCODE doesn't tell you how to code — it tells you what to build and makes sure you don't lose track.*
|
package/dist/cli/index.js
CHANGED
|
@@ -179,7 +179,7 @@ async function startSession() {
|
|
|
179
179
|
if (!hasConfig) {
|
|
180
180
|
choices.push({ name: ' 🔌 Conectar proveedor de IA', value: 'connect' });
|
|
181
181
|
}
|
|
182
|
-
choices.push({ name: ' 📋 Generar / actualizar plan de tareas', value: 'plan' }, { name: ` 📊 Ver estado completo`, value: 'status' }, { name: ' 📄 Ver contexto generado', value: 'context' });
|
|
182
|
+
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
183
|
if (hasConfig) {
|
|
184
184
|
choices.push({ name: ' 🔌 Reconfigurar IA', value: 'connect' });
|
|
185
185
|
}
|
|
@@ -211,6 +211,10 @@ async function startSession() {
|
|
|
211
211
|
complete: handleComplete,
|
|
212
212
|
status: handleStatus,
|
|
213
213
|
context: handleContext,
|
|
214
|
+
update: handleUpdate,
|
|
215
|
+
export: handleExport,
|
|
216
|
+
explain: handleExplain,
|
|
217
|
+
doctor: handleDoctor,
|
|
214
218
|
};
|
|
215
219
|
if (handlers[action]) {
|
|
216
220
|
try {
|
|
@@ -720,13 +724,222 @@ async function handleContext() {
|
|
|
720
724
|
}
|
|
721
725
|
console.log('');
|
|
722
726
|
}
|
|
727
|
+
// ─── UPDATE ─────────────────────────────────────────────────────────
|
|
728
|
+
async function handleUpdate() {
|
|
729
|
+
if (!(await requireInit()))
|
|
730
|
+
return;
|
|
731
|
+
const config = await requireAI();
|
|
732
|
+
if (!config)
|
|
733
|
+
return;
|
|
734
|
+
showHeader('Actualizar Contexto');
|
|
735
|
+
const spinner = ora({ text: 'Analizando proyecto...', color: 'cyan', spinner: 'dots' }).start();
|
|
736
|
+
try {
|
|
737
|
+
const ccodePath = path.join(process.cwd(), '.ccode');
|
|
738
|
+
const contextEngine = new ContextEngine();
|
|
739
|
+
await contextEngine.load();
|
|
740
|
+
const ctx = contextEngine.getContext();
|
|
741
|
+
// Leer archivos del proyecto
|
|
742
|
+
const projectFiles = listProjectFiles(process.cwd());
|
|
743
|
+
// Leer contexto actual
|
|
744
|
+
const currentProject = await FileUtils.readFileSafe(path.join(ccodePath, 'project.md'));
|
|
745
|
+
const currentArch = await FileUtils.readFileSafe(path.join(ccodePath, 'architecture.md'));
|
|
746
|
+
const currentRules = await FileUtils.readFileSafe(path.join(ccodePath, 'rules.md'));
|
|
747
|
+
spinner.text = 'Actualizando con IA...';
|
|
748
|
+
const provider = AIManager.getProvider(config);
|
|
749
|
+
const updatePrompt = `Eres un arquitecto de software. Analiza el estado ACTUAL del proyecto y actualiza la documentación existente.
|
|
750
|
+
|
|
751
|
+
=== DOCUMENTACIÓN ACTUAL ===
|
|
752
|
+
${currentProject}
|
|
753
|
+
|
|
754
|
+
=== ARQUITECTURA ACTUAL ===
|
|
755
|
+
${currentArch}
|
|
756
|
+
|
|
757
|
+
=== REGLAS ACTUALES ===
|
|
758
|
+
${currentRules}
|
|
759
|
+
|
|
760
|
+
=== ARCHIVOS EN EL PROYECTO ===
|
|
761
|
+
${projectFiles.join('\n')}
|
|
762
|
+
|
|
763
|
+
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.
|
|
764
|
+
|
|
765
|
+
Responde ÚNICAMENTE con JSON válido:
|
|
766
|
+
{
|
|
767
|
+
"project": "Contenido actualizado de project.md",
|
|
768
|
+
"architecture": "Contenido actualizado de architecture.md",
|
|
769
|
+
"rules": "Contenido actualizado de rules.md",
|
|
770
|
+
"changes": ["Lista de cambios detectados"]
|
|
771
|
+
}`;
|
|
772
|
+
const response = await provider.generate(updatePrompt);
|
|
773
|
+
const result = PromptBuilder.parseJSON(response);
|
|
774
|
+
await FileUtils.writeFile(path.join(ccodePath, 'project.md'), result.project);
|
|
775
|
+
await FileUtils.writeFile(path.join(ccodePath, 'architecture.md'), result.architecture);
|
|
776
|
+
await FileUtils.writeFile(path.join(ccodePath, 'rules.md'), result.rules);
|
|
777
|
+
spinner.succeed(c.success('Contexto actualizado'));
|
|
778
|
+
if (result.changes && result.changes.length > 0) {
|
|
779
|
+
console.log('');
|
|
780
|
+
console.log(c.accent(' Cambios detectados:'));
|
|
781
|
+
result.changes.forEach(change => console.log(c.dim(` • ${change}`)));
|
|
782
|
+
}
|
|
783
|
+
console.log('');
|
|
784
|
+
}
|
|
785
|
+
catch (error) {
|
|
786
|
+
spinner.fail('Error');
|
|
787
|
+
showError(error instanceof Error ? error.message : String(error));
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
// ─── EXPORT ─────────────────────────────────────────────────────────
|
|
791
|
+
async function handleExport() {
|
|
792
|
+
if (!(await requireInit()))
|
|
793
|
+
return;
|
|
794
|
+
showHeader('Exportar Contexto');
|
|
795
|
+
const pb = new PromptBuilder();
|
|
796
|
+
const fullContext = await pb.buildContextPrompt();
|
|
797
|
+
const exportPath = path.join(process.cwd(), '.ccode', 'context-export.md');
|
|
798
|
+
await FileUtils.writeFile(exportPath, `# CCODE — Project Context Export\n\n${fullContext}`);
|
|
799
|
+
showSuccess('Contexto exportado a .ccode/context-export.md');
|
|
800
|
+
showInfo('Copia el contenido y pégalo en cualquier chat de IA (ChatGPT, Claude, Gemini, etc.).');
|
|
801
|
+
console.log('');
|
|
802
|
+
}
|
|
803
|
+
// ─── EXPLAIN ────────────────────────────────────────────────────────
|
|
804
|
+
async function handleExplain() {
|
|
805
|
+
if (!(await requireInit()))
|
|
806
|
+
return;
|
|
807
|
+
showHeader('Resumen del Proyecto');
|
|
808
|
+
const ccodePath = path.join(process.cwd(), '.ccode');
|
|
809
|
+
const projectMd = await FileUtils.readFileSafe(path.join(ccodePath, 'project.md'));
|
|
810
|
+
const archMd = await FileUtils.readFileSafe(path.join(ccodePath, 'architecture.md'));
|
|
811
|
+
const taskEngine = new TaskEngine();
|
|
812
|
+
await taskEngine.load();
|
|
813
|
+
const stats = taskEngine.getStats();
|
|
814
|
+
const projectFiles = listProjectFiles(process.cwd());
|
|
815
|
+
// Extraer info clave
|
|
816
|
+
console.log(c.bold(' Proyecto'));
|
|
817
|
+
projectMd.split('\n').slice(0, 8).forEach(line => {
|
|
818
|
+
if (line.trim())
|
|
819
|
+
console.log(` ${line}`);
|
|
820
|
+
});
|
|
821
|
+
console.log('');
|
|
822
|
+
console.log(c.bold(' Arquitectura'));
|
|
823
|
+
archMd.split('\n').slice(0, 12).forEach(line => {
|
|
824
|
+
if (line.trim())
|
|
825
|
+
console.log(` ${line}`);
|
|
826
|
+
});
|
|
827
|
+
console.log('');
|
|
828
|
+
console.log(c.bold(' Archivos detectados'));
|
|
829
|
+
const dirs = projectFiles.filter(f => f.endsWith('/')).slice(0, 10);
|
|
830
|
+
dirs.forEach(d => console.log(c.accent(` ${d}`)));
|
|
831
|
+
const fileCount = projectFiles.filter(f => !f.endsWith('/')).length;
|
|
832
|
+
console.log(c.dim(` ${fileCount} archivos en total`));
|
|
833
|
+
console.log('');
|
|
834
|
+
console.log(c.bold(' Progreso'));
|
|
835
|
+
console.log(` ${showProgressBar(stats.completed, stats.total)}`);
|
|
836
|
+
console.log(c.dim(` ${stats.completed} completadas, ${stats.in_progress} en progreso, ${stats.pending} pendientes, ${stats.failed} fallidas`));
|
|
837
|
+
console.log('');
|
|
838
|
+
}
|
|
839
|
+
// ─── DOCTOR ─────────────────────────────────────────────────────────
|
|
840
|
+
async function handleDoctor() {
|
|
841
|
+
if (!(await requireInit()))
|
|
842
|
+
return;
|
|
843
|
+
showHeader('Diagnóstico del Proyecto');
|
|
844
|
+
const ccodePath = path.join(process.cwd(), '.ccode');
|
|
845
|
+
let issues = 0;
|
|
846
|
+
// 1. Verificar archivos de contexto
|
|
847
|
+
const requiredFiles = [
|
|
848
|
+
{ file: 'context.json', label: 'Configuración del proyecto' },
|
|
849
|
+
{ file: 'state.json', label: 'Estado del workflow' },
|
|
850
|
+
{ file: 'project.md', label: 'Documentación del proyecto' },
|
|
851
|
+
{ file: 'architecture.md', label: 'Arquitectura' },
|
|
852
|
+
{ file: 'rules.md', label: 'Reglas de desarrollo' },
|
|
853
|
+
{ file: 'tasks.json', label: 'Checklist de tareas' },
|
|
854
|
+
{ file: 'memory.md', label: 'Historial de decisiones' },
|
|
855
|
+
];
|
|
856
|
+
console.log(c.bold(' Archivos de contexto'));
|
|
857
|
+
for (const { file, label } of requiredFiles) {
|
|
858
|
+
const exists = await FileUtils.exists(path.join(ccodePath, file));
|
|
859
|
+
if (exists) {
|
|
860
|
+
const content = await FileUtils.readFileSafe(path.join(ccodePath, file));
|
|
861
|
+
if (content.trim().length < 5) {
|
|
862
|
+
console.log(c.warning(` ⚠ ${label} (${file}) — existe pero está vacío`));
|
|
863
|
+
issues++;
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
console.log(c.success(` ✓ ${label}`));
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
else {
|
|
870
|
+
console.log(c.error(` ✗ ${label} (${file}) — no encontrado`));
|
|
871
|
+
issues++;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
// 2. Proveedor de IA
|
|
875
|
+
console.log('');
|
|
876
|
+
console.log(c.bold(' Proveedor de IA'));
|
|
877
|
+
const config = await AIManager.loadConfig();
|
|
878
|
+
if (config) {
|
|
879
|
+
console.log(c.success(` ✓ Configurado: ${config.provider} (${config.model || 'default'})`));
|
|
880
|
+
// Test de conexión
|
|
881
|
+
const spinner = ora({ text: ' Probando conexión...', color: 'cyan', spinner: 'dots' }).start();
|
|
882
|
+
const connected = await AIManager.testConnection(config);
|
|
883
|
+
if (connected) {
|
|
884
|
+
spinner.succeed(c.success('Conexión activa'));
|
|
885
|
+
}
|
|
886
|
+
else {
|
|
887
|
+
spinner.fail(c.error('No se pudo conectar'));
|
|
888
|
+
issues++;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
else {
|
|
892
|
+
console.log(c.warning(` ⚠ No configurado — ejecuta "Conectar IA"`));
|
|
893
|
+
issues++;
|
|
894
|
+
}
|
|
895
|
+
// 3. Tareas
|
|
896
|
+
console.log('');
|
|
897
|
+
console.log(c.bold(' Tareas'));
|
|
898
|
+
const taskEngine = new TaskEngine();
|
|
899
|
+
await taskEngine.load();
|
|
900
|
+
const stats = taskEngine.getStats();
|
|
901
|
+
if (stats.total === 0) {
|
|
902
|
+
console.log(c.warning(' ⚠ No hay tareas — ejecuta "Generar plan"'));
|
|
903
|
+
issues++;
|
|
904
|
+
}
|
|
905
|
+
else {
|
|
906
|
+
console.log(c.success(` ✓ ${stats.total} tareas en total`));
|
|
907
|
+
if (stats.completed > 0)
|
|
908
|
+
console.log(c.success(` ✓ ${stats.completed} completadas`));
|
|
909
|
+
if (stats.in_progress > 0)
|
|
910
|
+
console.log(c.accent(` ◐ ${stats.in_progress} en progreso`));
|
|
911
|
+
if (stats.pending > 0)
|
|
912
|
+
console.log(c.warning(` ⚠ ${stats.pending} pendientes`));
|
|
913
|
+
if (stats.failed > 0) {
|
|
914
|
+
console.log(c.error(` ✗ ${stats.failed} fallidas — necesitan replantearse`));
|
|
915
|
+
issues++;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
// 4. Archivos del proyecto
|
|
919
|
+
console.log('');
|
|
920
|
+
console.log(c.bold(' Proyecto'));
|
|
921
|
+
const projectFiles = listProjectFiles(process.cwd());
|
|
922
|
+
const fileCount = projectFiles.filter(f => !f.endsWith('/')).length;
|
|
923
|
+
const dirCount = projectFiles.filter(f => f.endsWith('/')).length;
|
|
924
|
+
console.log(c.success(` ✓ ${fileCount} archivos en ${dirCount} directorios`));
|
|
925
|
+
// Resumen
|
|
926
|
+
console.log('');
|
|
927
|
+
console.log(c.dim(' ─────────────────────────────────────────────'));
|
|
928
|
+
if (issues === 0) {
|
|
929
|
+
console.log(c.success(' ✓ Todo en orden — el proyecto está saludable'));
|
|
930
|
+
}
|
|
931
|
+
else {
|
|
932
|
+
console.log(c.warning(` ⚠ ${issues} problema${issues > 1 ? 's' : ''} encontrado${issues > 1 ? 's' : ''}`));
|
|
933
|
+
}
|
|
934
|
+
console.log('');
|
|
935
|
+
}
|
|
723
936
|
// ─── CLI Setup ──────────────────────────────────────────────────────
|
|
724
937
|
async function main() {
|
|
725
938
|
const program = new Command();
|
|
726
939
|
program
|
|
727
940
|
.name('ccode')
|
|
728
941
|
.description('CCODE: Contexto Persistente para Desarrollo con IA')
|
|
729
|
-
.version('2.
|
|
942
|
+
.version('2.2.0');
|
|
730
943
|
// Comandos individuales (para uso rápido sin sesión)
|
|
731
944
|
program.command('init').description('Inicializa el contexto del proyecto').action(async () => {
|
|
732
945
|
await handleInit();
|
|
@@ -740,6 +953,10 @@ async function main() {
|
|
|
740
953
|
program.command('complete').description('Completa una tarea').action(handleComplete);
|
|
741
954
|
program.command('status').description('Estado del proyecto').action(handleStatus);
|
|
742
955
|
program.command('context').description('Ver contexto generado').action(handleContext);
|
|
956
|
+
program.command('update').description('Re-analiza y actualiza el contexto').action(handleUpdate);
|
|
957
|
+
program.command('export').description('Exporta contexto como .md para cualquier IA').action(handleExport);
|
|
958
|
+
program.command('explain').description('Resumen rápido del proyecto').action(handleExplain);
|
|
959
|
+
program.command('doctor').description('Diagnóstico de salud del proyecto').action(handleDoctor);
|
|
743
960
|
if (process.argv.length <= 2) {
|
|
744
961
|
// Sin argumentos → sesión interactiva
|
|
745
962
|
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.2.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",
|