forgegit 1.4.1 → 1.5.1

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.
@@ -4,7 +4,7 @@ REM Configuration - edit these values to customize
4
4
  REM Called from init.cmd via: call config.cmd
5
5
  REM ============================================================
6
6
 
7
- set "FG_VERSION=1.4.1"
7
+ set "FG_VERSION=1.5.0"
8
8
  set "TAG_INITIAL=v1.0.0"
9
9
  set "TAG_MESSAGE=Primera version estable"
10
10
  set "BRANCH_MAIN=main"
package/.forge/init.cmd CHANGED
@@ -2,163 +2,137 @@
2
2
  setlocal EnableDelayedExpansion
3
3
  chcp 65001 >nul 2>nul
4
4
 
5
- cd /d "%~dp0"
6
- cls
5
+ REM ============================================================
6
+ REM forge-git / .forge/init.cmd
7
+ REM init.cmd SIEMPRE vive en .forge/
8
+ REM PROJECT_ROOT es el padre (../)
9
+ REM ============================================================
7
10
 
8
- set "ROOT=%~dp0"
11
+ pushd "%~dp0.."
12
+ set "PROJECT_ROOT=%CD%"
13
+ popd
9
14
 
10
- REM --- Detectar donde esta lib/ y templates/ ---
11
- if exist ".forge\lib\ui.cmd" (
12
- set "LIB=%ROOT%.forge\lib"
13
- set "TPL=%ROOT%.forge\templates"
14
- set "CMDS=%ROOT%.forge\commands"
15
- ) else (
16
- set "LIB=%ROOT%lib"
17
- set "TPL=%ROOT%templates"
18
- set "CMDS=%ROOT%.forge\commands"
19
- )
15
+ set "FORGE_DIR=%~dp0"
16
+ set "LIB=%FORGE_DIR%lib"
17
+ set "TPL=%FORGE_DIR%templates"
18
+ set "CMDS=%FORGE_DIR%commands"
20
19
 
21
- REM --- Force mode ---
22
20
  set "FORCE=0"
23
21
  if /i "%~1"=="--force" set "FORCE=1"
24
22
  if /i "%~1"=="force" set "FORCE=1"
25
23
  if /i "%~1"=="-f" set "FORCE=1"
26
24
 
27
- call "%ROOT%config.cmd"
25
+ call "%FORGE_DIR%config.cmd"
28
26
 
27
+ pushd "%PROJECT_ROOT%"
29
28
  for %%a in ("%CD%") do set "PROJECT_NAME=%%~nxa"
29
+ popd
30
30
 
31
31
  call "%LIB%\ui.cmd" banner
32
32
 
33
- REM --- STEP 1/17: Node.js ---
33
+ cd /d "%PROJECT_ROOT%"
34
+
34
35
  where node >nul 2>nul
35
36
  if errorlevel 1 (
36
- echo [1/17] Node.js MISSING
37
+ echo [1/17] Node.js MISSING
37
38
  echo Descargalo desde: https://nodejs.org/
38
39
  goto :abort
39
40
  )
40
41
  for /f "tokens=*" %%v in ('node --version 2^>nul') do set "NODE_VER=%%v"
41
42
  call "%LIB%\ui.cmd" step 1/17 "Node.js !NODE_VER!" "OK"
42
43
 
43
- REM --- STEP 2/17: Git ---
44
44
  where git >nul 2>nul
45
45
  if errorlevel 1 (
46
- echo [2/17] Git MISSING
46
+ echo [2/17] Git MISSING
47
47
  echo Descargalo desde: https://git-scm.com/download/win
48
48
  goto :abort
49
49
  )
50
50
  for /f "tokens=*" %%v in ('git --version 2^>nul') do set "GIT_VER=%%v"
51
51
  call "%LIB%\ui.cmd" step 2/17 "!GIT_VER!" "OK"
52
52
 
53
- REM --- STEP 3/17: Init repo ---
54
53
  call "%LIB%\git-ops.cmd" init
55
-
56
- REM --- STEP 4/17: Branch main ---
57
54
  call "%LIB%\git-ops.cmd" branch_main
58
55
 
59
- REM --- STEP 5/17: Crear estructura .forge/ ---
60
- if exist ".forge\commands" goto :step5_ok
61
- mkdir ".forge" 2>nul
62
- mkdir ".forge\commands" 2>nul
63
- mkdir ".forge\lib" 2>nul
64
- mkdir ".forge\templates" 2>nul
65
- call "%LIB%\ui.cmd" step 5/17 "Estructura .forge/" "CREADO"
66
- goto :step6
67
- :step5_ok
68
- call "%LIB%\ui.cmd" step 5/17 "Estructura .forge/" "YA EXISTE"
69
-
70
- :step6
71
- REM --- STEP 6/17: .gitignore ---
72
- if exist ".gitignore" goto :step6_ok
73
- call "%LIB%\templates.cmd" write_gitignore
74
- call "%LIB%\ui.cmd" step 6/17 ".gitignore universal" "CREADO"
75
- goto :step7
76
- :step6_ok
77
- call "%LIB%\ui.cmd" step 6/17 ".gitignore" "YA EXISTE"
78
-
79
- :step7
80
- REM --- STEP 7/17: README.md ---
81
- if exist "README.md" goto :step7_ok
82
- call "%LIB%\templates.cmd" write_readme
83
- call "%LIB%\ui.cmd" step 7/17 "README.md adaptativo" "CREADO"
84
- goto :step8
85
- :step7_ok
86
- call "%LIB%\ui.cmd" step 7/17 "README.md" "YA EXISTE"
87
-
88
- :step8
89
- REM --- STEP 8/17: forge.cmd ---
90
- if exist "forge.cmd" goto :step8_ok
91
- call "%LIB%\templates.cmd" write_forge
92
- call "%LIB%\ui.cmd" step 8/17 "forge.cmd menu" "CREADO"
93
- goto :step9
94
- :step8_ok
95
- call "%LIB%\ui.cmd" step 8/17 "forge.cmd" "YA EXISTE"
96
-
97
- :step9
98
- REM --- STEP 9/17: save.cmd ---
99
- if exist ".forge\commands\save.cmd" goto :step9_ok
100
- call "%LIB%\templates.cmd" write_save
101
- call "%LIB%\ui.cmd" step 9/17 "save.cmd" "CREADO"
102
- goto :step10
103
- :step9_ok
104
- call "%LIB%\ui.cmd" step 9/17 "save.cmd" "YA EXISTE"
105
-
106
- :step10
107
- REM --- STEP 10/17: push.cmd ---
108
- if exist ".forge\commands\push.cmd" goto :step10_ok
109
- call "%LIB%\templates.cmd" write_push
110
- call "%LIB%\ui.cmd" step 10/17 "push.cmd" "CREADO"
111
- goto :step11
112
- :step10_ok
113
- call "%LIB%\ui.cmd" step 10/17 "push.cmd" "YA EXISTE"
114
-
115
- :step11
116
- REM --- STEP 11/17: snapshots.cmd ---
117
- if exist ".forge\commands\snapshots.cmd" goto :step11_ok
118
- call "%LIB%\templates.cmd" write_snapshots
119
- call "%LIB%\ui.cmd" step 11/17 "snapshots.cmd" "CREADO"
120
- goto :step12
121
- :step11_ok
122
- call "%LIB%\ui.cmd" step 11/17 "snapshots.cmd" "YA EXISTE"
123
-
124
- :step12
125
- REM --- STEP 12/17: historial.cmd ---
126
- if exist ".forge\commands\historial.cmd" goto :step12_ok
127
- call "%LIB%\templates.cmd" write_historial
128
- call "%LIB%\ui.cmd" step 12/17 "historial.cmd" "CREADO"
129
- goto :step13
130
- :step12_ok
131
- call "%LIB%\ui.cmd" step 12/17 "historial.cmd" "YA EXISTE"
132
-
133
- :step13
134
- REM --- STEP 13/17: abrir.cmd ---
135
- if exist ".forge\commands\abrir.cmd" goto :step13_ok
136
- call "%LIB%\templates.cmd" write_abrir
137
- call "%LIB%\ui.cmd" step 13/17 "abrir.cmd" "CREADO"
138
- goto :step14
139
- :step13_ok
140
- call "%LIB%\ui.cmd" step 13/17 "abrir.cmd" "YA EXISTE"
141
-
142
- :step14
143
- REM --- STEP 14/17: auditar.cmd ---
144
- if exist ".forge\commands\auditar.cmd" goto :step14_ok
145
- call "%LIB%\templates.cmd" write_auditar
146
- call "%LIB%\ui.cmd" step 14/17 "auditar.cmd" "CREADO"
147
- goto :step15
148
- :step14_ok
149
- call "%LIB%\ui.cmd" step 14/17 "auditar.cmd" "YA EXISTE"
150
-
151
- :step15
152
- REM --- STEP 15/17: serve.cmd ---
153
- if exist ".forge\commands\serve.cmd" goto :step15_ok
154
- call "%LIB%\templates.cmd" write_serve
155
- call "%LIB%\ui.cmd" step 15/17 "serve.cmd" "CREADO"
156
- goto :step16
157
- :step15_ok
158
- call "%LIB%\ui.cmd" step 15/17 "serve.cmd" "YA EXISTE"
159
-
160
- :step16
161
- REM --- STEP 16/17: Commit ---
56
+ if exist ".forge\commands" (
57
+ call "%LIB%\ui.cmd" step 5/17 "Estructura .forge/" "YA EXISTE"
58
+ ) else (
59
+ mkdir ".forge" 2>nul
60
+ mkdir ".forge\commands" 2>nul
61
+ mkdir ".forge\lib" 2>nul
62
+ mkdir ".forge\templates" 2>nul
63
+ call "%LIB%\ui.cmd" step 5/17 "Estructura .forge/" "CREADO"
64
+ )
65
+
66
+ if exist ".gitignore" (
67
+ call "%LIB%\ui.cmd" step 6/17 ".gitignore" "YA EXISTE"
68
+ ) else (
69
+ call "%LIB%\templates.cmd" write_gitignore
70
+ call "%LIB%\ui.cmd" step 6/17 ".gitignore universal" "CREADO"
71
+ )
72
+
73
+ if exist "README.md" (
74
+ call "%LIB%\ui.cmd" step 7/17 "README.md" "YA EXISTE"
75
+ ) else (
76
+ call "%LIB%\templates.cmd" write_readme
77
+ call "%LIB%\ui.cmd" step 7/17 "README.md adaptativo" "CREADO"
78
+ )
79
+
80
+ if exist "forge.cmd" (
81
+ call "%LIB%\ui.cmd" step 8/17 "forge.cmd" "YA EXISTE"
82
+ ) else (
83
+ call "%LIB%\templates.cmd" write_forge
84
+ call "%LIB%\ui.cmd" step 8/17 "forge.cmd menu" "CREADO"
85
+ )
86
+
87
+ if exist ".forge\commands\save.cmd" (
88
+ call "%LIB%\ui.cmd" step 9/17 "save.cmd" "YA EXISTE"
89
+ ) else (
90
+ call "%LIB%\templates.cmd" write_save
91
+ call "%LIB%\ui.cmd" step 9/17 "save.cmd" "CREADO"
92
+ )
93
+
94
+ if exist ".forge\commands\push.cmd" (
95
+ call "%LIB%\ui.cmd" step 10/17 "push.cmd" "YA EXISTE"
96
+ ) else (
97
+ call "%LIB%\templates.cmd" write_push
98
+ call "%LIB%\ui.cmd" step 10/17 "push.cmd" "CREADO"
99
+ )
100
+
101
+ if exist ".forge\commands\snapshots.cmd" (
102
+ call "%LIB%\ui.cmd" step 11/17 "snapshots.cmd" "YA EXISTE"
103
+ ) else (
104
+ call "%LIB%\templates.cmd" write_snapshots
105
+ call "%LIB%\ui.cmd" step 11/17 "snapshots.cmd" "CREADO"
106
+ )
107
+
108
+ if exist ".forge\commands\historial.cmd" (
109
+ call "%LIB%\ui.cmd" step 12/17 "historial.cmd" "YA EXISTE"
110
+ ) else (
111
+ call "%LIB%\templates.cmd" write_historial
112
+ call "%LIB%\ui.cmd" step 12/17 "historial.cmd" "CREADO"
113
+ )
114
+
115
+ if exist ".forge\commands\abrir.cmd" (
116
+ call "%LIB%\ui.cmd" step 13/17 "abrir.cmd" "YA EXISTE"
117
+ ) else (
118
+ call "%LIB%\templates.cmd" write_abrir
119
+ call "%LIB%\ui.cmd" step 13/17 "abrir.cmd" "CREADO"
120
+ )
121
+
122
+ if exist ".forge\commands\auditar.cmd" (
123
+ call "%LIB%\ui.cmd" step 14/17 "auditar.cmd" "YA EXISTE"
124
+ ) else (
125
+ call "%LIB%\templates.cmd" write_auditar
126
+ call "%LIB%\ui.cmd" step 14/17 "auditar.cmd" "CREADO"
127
+ )
128
+
129
+ if exist ".forge\commands\serve.cmd" (
130
+ call "%LIB%\ui.cmd" step 15/17 "serve.cmd" "YA EXISTE"
131
+ ) else (
132
+ call "%LIB%\templates.cmd" write_serve
133
+ call "%LIB%\ui.cmd" step 15/17 "serve.cmd" "CREADO"
134
+ )
135
+
162
136
  call "%LIB%\git-ops.cmd" has_changes
163
137
  if errorlevel 1 (
164
138
  set "USER_MSG="
@@ -170,7 +144,6 @@ if errorlevel 1 (
170
144
  call "%LIB%\ui.cmd" step 16/17 "Sin cambios para commit" "SKIP"
171
145
  )
172
146
 
173
- REM --- STEP 17/17: Tag ---
174
147
  call "%LIB%\git-ops.cmd" tag
175
148
  if errorlevel 1 (
176
149
  call "%LIB%\ui.cmd" step 17/17 "Tag %TAG_INITIAL%" "CREADO"
package/WORKFLOW.md ADDED
@@ -0,0 +1,354 @@
1
+ # forgeGit - Workflow con IA
2
+
3
+ Documento para cualquier IA (ChatGPT, DeepSeek, Claude, Gemini, Cursor,
4
+ Cline) que vaya a trabajar con proyectos que usan forgeGit.
5
+
6
+ ---
7
+
8
+ ## Contexto del proyecto (para IA nuevas)
9
+
10
+ Este proyecto usa **forgeGit**, un kit de bootstrap Git para Windows.
11
+
12
+ - **Comandos principales**: forge (menu), forge save (commit), forge push (GitHub), forge serve (servidor), forge snap (snapshots)
13
+ - **Estructura**: forge.cmd en raiz, toda la infraestructura en .forge/
14
+ - **Stack tipico**: HTML + Canvas + JS Vanilla + Node.js
15
+ - **Servidor**: node server.js en puerto 8080
16
+ - **Segmentacion IA**: RMBG-2.0 en WebGPU via Web Worker
17
+
18
+ Si sos una IA leyendo esto por primera vez, mira tambien:
19
+ - README.md (que es forgeGit)
20
+ - MANUAL.md (comandos detallados)
21
+ - FUTURE.md (roadmap)
22
+
23
+ ---
24
+
25
+ ## Regla de oro: instrucciones quirurgicas
26
+
27
+ Toda instruccion para modificar codigo DEBE ser:
28
+
29
+ 1. Bloque exacto de codigo (no referencias vagas)
30
+ 2. Ubicacion exacta (busca / reemplaza / pega debajo)
31
+ 3. Sin ambiguedad
32
+
33
+ ### Formato obligatorio para REEMPLAZAR
34
+
35
+ Busca exactamente este codigo:
36
+ [codigo viejo exacto]
37
+
38
+ Reemplazalo exactamente por este codigo:
39
+ [codigo nuevo exacto]
40
+
41
+ ### Formato obligatorio para INSERTAR
42
+
43
+ Busca exactamente esta linea:
44
+ [linea exacta]
45
+
46
+ Pega inmediatamente debajo de esta linea:
47
+ [bloque nuevo completo]
48
+
49
+ ### PROHIBIDO
50
+
51
+ - "busca donde..."
52
+ - "anade cerca de..."
53
+ - "modifica la funcion que..."
54
+ - "cambia la linea que dice..."
55
+ - Cualquier instruccion que requiera interpretacion
56
+
57
+ ---
58
+
59
+ ## Reglas para la IA
60
+
61
+ Si sos una IA leyendo este documento:
62
+
63
+ ### Herramienta correcta segun el caso
64
+
65
+ | Caso | Herramienta |
66
+ |------|-------------|
67
+ | Crear archivo NUEVO (.md, .txt, README) | Notepad (rapido) |
68
+ | Editar codigo existente (HTML, JS, CSS) | VS Code (forge open) |
69
+ | Aplicar cambio quirurgico de la IA | VS Code (Ctrl+H para reemplazar) |
70
+ | Ver diff de cambios | VS Code (Source Control) o git diff |
71
+ | Comparar 2 versiones | VS Code (Ctrl+Shift+P -> Compare) |
72
+
73
+ ### PROHIBIDO usar Notepad para
74
+
75
+ - Editar archivos de codigo existentes (no tiene reemplazo confiable)
76
+ - Aplicar cambios quirurgicos de la IA
77
+ - Ver/editar archivos con mas de 50 lineas
78
+ - Editar archivos con encoding especial (UTF-8 con BOM, CRLF)
79
+
80
+ ### Comando correcto para editar codigo
81
+
82
+ forge open
83
+
84
+ Abre VS Code en el proyecto. Desde ahi:
85
+ - Ctrl+F para buscar
86
+ - Ctrl+H para reemplazar
87
+ - Ctrl+S para guardar
88
+ - Ctrl+Shift+F para buscar en todo el proyecto
89
+
90
+
91
+ 1. Toda instruccion de codigo usa formato busca/reemplaza exacto.
92
+ 2. No asumas ubicaciones. Siempre especifica linea exacta.
93
+ 3. Un cambio a la vez. Si son 3 archivos, dalos por separado.
94
+ 4. Recomenda "forge snap" antes de cambios grandes.
95
+ 5. Si un cambio falla, deci exactamente que comando de git usar.
96
+ 6. No mezcles cambios buenos con malos en el mismo bloque.
97
+
98
+ ---
99
+
100
+ ## Dos tipos de IA
101
+
102
+ ### Tipo A: IA en chat (ChatGPT, DeepSeek web, Claude web)
103
+
104
+ - NO tiene acceso a los archivos
105
+ - El humano copia/pega el codigo afectado
106
+ - La IA responde con formato quirurgico
107
+ - El humano aplica manualmente en VS Code
108
+
109
+ ### Tipo B: IA en editor (Cursor, Cline, Copilot, Roo)
110
+
111
+ - SI tiene acceso a los archivos
112
+ - Puede editar directamente
113
+ - Aun asi, debe usar formato quirurgico para trazabilidad
114
+ - El humano solo verifica y prueba
115
+
116
+ ---
117
+
118
+ ## Flujo de trabajo
119
+
120
+ ### 1. Antes de cambios grandes
121
+
122
+ forge snap
123
+
124
+ Nombre: "antes de [cambio]"
125
+
126
+ Crea un punto de restauracion completo.
127
+
128
+ ### 2. IA da cambios en formato quirurgico
129
+
130
+ Cada cambio viene con bloque exacto de busca/reemplaza.
131
+
132
+ ### 3. Aplicar en VS Code
133
+
134
+ forge open
135
+
136
+ Buscar el bloque, reemplazar, Ctrl+S.
137
+
138
+ ### 4. Probar en navegador
139
+
140
+ forge serve
141
+
142
+ F5 para recargar tras cada cambio.
143
+
144
+ ### 5. Decidir
145
+
146
+ | Resultado | Accion |
147
+ |-----------|--------|
148
+ | Todo funciona | forge save |
149
+ | 1 archivo falla | git checkout -- archivo.js + forge save |
150
+ | Todo falla | forge snap -> v -> SI |
151
+
152
+ ---
153
+
154
+ ## Como reportar resultados a la IA
155
+
156
+ ### Si el cambio funciona
157
+
158
+ Aplicado el cambio 1 (GLOW_MIN: 30). Funciona. El aura es mas intensa.
159
+
160
+ ### Si el cambio falla
161
+
162
+ Aplicado el cambio 1. NO funciona. Al arrastrar imagen el aura
163
+ desaparece. Consola muestra:
164
+ TypeError: hueShift2 is not defined at renderAura (Static_Glish.html:412)
165
+
166
+ ### Si el bloque no se encontro
167
+
168
+ Busque "const glowMax = 75" en Static_Glish.html. NO EXISTE.
169
+ El codigo actual tiene:
170
+ const GLOW_MAX: 75,
171
+
172
+ ### Si cambio otros archivos
173
+
174
+ El cambio 1 en Static_Glish.html funciona.
175
+ Pero worker.js tambien parece afectado. Revisar?
176
+
177
+ ---
178
+
179
+ ## Cuando la IA alucina
180
+
181
+ Si la IA da un bloque que NO EXISTE en tu codigo:
182
+
183
+ 1. NO aplicar a ciegas
184
+ 2. Reportar a la IA con el bloque actual
185
+ 3. Pedirle que ajuste la instruccion
186
+ 4. Nunca inventar el cambio
187
+
188
+ Formato de reporte:
189
+
190
+ Bloque de la IA:
191
+ const glowMax = 75;
192
+
193
+ Bloque real en el archivo:
194
+ const GLOW_MAX: 75,
195
+
196
+ Ajusta la instruccion al codigo real.
197
+
198
+ ---
199
+
200
+ ## Multi-archivo coordinado
201
+
202
+ Si la IA va a modificar varios archivos, DEBE:
203
+
204
+ 1. Listar TODOS los archivos afectados al inicio
205
+ 2. Dar los cambios en orden logico (dependencias primero)
206
+ 3. Indicar que archivos probar juntos
207
+
208
+ Formato:
209
+
210
+ Archivos afectados:
211
+ 1. Static_Glish.html (cambio de GLOW_MAX)
212
+ 2. worker.js (cambio dependiente del anterior)
213
+ 3. server.js (independiente)
214
+
215
+ Aplicar los 3 y probar juntos.
216
+
217
+ ---
218
+
219
+ ## Dependencias cruzadas
220
+
221
+ Si cambias una variable global, revisa quien la usa:
222
+
223
+ grep "GLOW_MAX" Static_Glish.html
224
+
225
+ Si el cambio en un archivo afecta a otro, la IA DEBE avisarlo.
226
+
227
+ ---
228
+
229
+ ## Forge audit para IA
230
+
231
+ Cuando tenes commits recientes con cambios mezclados:
232
+
233
+ forge audit
234
+
235
+ Elegir rango de commits. Genera un .txt en audits/ con:
236
+ - Commits del rango
237
+ - Diff completo
238
+ - Estado actual
239
+
240
+ Se lo podes pasar a otra IA para que audite los cambios.
241
+
242
+ ---
243
+
244
+ ## Cuando la IA es mala vs typo
245
+
246
+ Si un cambio no funciona, distinguir:
247
+
248
+ | Sintoma | Causa probable |
249
+ |---------|----------------|
250
+ | Error de sintaxis | Typo al aplicar |
251
+ | Bloque no encontrado | IA alucino |
252
+ | Variable no definida | Orden de cambios incorrecto |
253
+ | Funciona pero diferente | IA malinterpreto |
254
+
255
+ Antes de culpar a la IA, verificar:
256
+
257
+ git diff
258
+
259
+ Si el diff NO coincide con lo que la IA dijo, fue typo tuyo.
260
+ Si el diff SI coincide, la IA fallo.
261
+
262
+ ---
263
+
264
+ ## Edge cases
265
+
266
+ ### Caso 1: 3 archivos, 2 buenos, 1 malo
267
+
268
+ git checkout -- archivo_roto.js
269
+ forge save
270
+
271
+ Mensaje: "X e Y ok, Z descartado"
272
+
273
+ ### Caso 2: 1 archivo con 5 cambios, 3 buenos, 2 malos
274
+
275
+ git checkout -- archivo.html
276
+
277
+ Luego pedir a la IA 1 cambio a la vez y commitear cada uno.
278
+
279
+ ### Caso 3: Ya commiteaste y despues viste el error
280
+
281
+ git log --oneline -5
282
+ git checkout abc1234 -- archivo.js
283
+ forge save
284
+
285
+ Mensaje: "revertir archivo X a version anterior"
286
+
287
+ ### Caso 4: No sabes que archivo tiene el error
288
+
289
+ git checkout -- archivo1.js
290
+ REM Probar. Si no funciona:
291
+ git checkout -- archivo2.js
292
+ REM El culpable era el ultimo revertido.
293
+
294
+ ### Caso 5: Todo roto, volver al snapshot
295
+
296
+ forge snap
297
+
298
+ Elegir v, escribir SI.
299
+
300
+ ---
301
+
302
+ ## Comandos de rescate
303
+
304
+ | Situacion | Comando |
305
+ |-----------|---------|
306
+ | Ver que cambio | git diff |
307
+ | Revertir 1 archivo | git checkout -- archivo.js |
308
+ | Revertir archivo a commit viejo | git checkout abc1234 -- archivo.js |
309
+ | Deshacer ultimo commit (mantener cambios) | git reset --soft HEAD~1 |
310
+ | Ver TODO lo que hiciste | git reflog |
311
+ | Volver a estado borrado | git reset --hard HEAD@{2} |
312
+ | Restaurar snapshot | forge snap -> v |
313
+
314
+ ---
315
+
316
+ ## Comandos del dia a dia
317
+
318
+ forge Menu interactivo
319
+ forge init Bootstrap (raro)
320
+ forge save Commit de cambios
321
+ forge push Push a GitHub
322
+ forge log Historial
323
+ forge snap Snapshots
324
+ forge audit Reporte diff
325
+ forge open VS Code
326
+ forge serve Servidor dev
327
+ forge help Ayuda
328
+
329
+ ---
330
+
331
+ ## Estructura del proyecto
332
+
333
+ MiProyecto/
334
+ |-- forge.cmd Menu + CLI (unico .cmd visible)
335
+ |-- .forge/
336
+ | |-- init.cmd Bootstrap
337
+ | |-- config.cmd Configuracion
338
+ | |-- commands/ 7 helpers
339
+ | |-- lib/ Modulos internos
340
+ | |-- templates/ Fuentes .tpl
341
+ | +-- serve-static.js Servidor Node.js
342
+ |-- versiones/ Snapshots
343
+ |-- audits/ Reportes diff
344
+ +-- (tus archivos)
345
+
346
+ ---
347
+
348
+ ## Links
349
+
350
+ - Repo: https://github.com/vloitz/forgeGit
351
+ - npm: https://www.npmjs.com/package/forgegit
352
+ - Releases: https://github.com/vloitz/forgeGit/releases
353
+ - Manual: MANUAL.md
354
+ - Futuro: FUTURE.md
package/forge.cmd CHANGED
@@ -17,12 +17,13 @@ if "!ESC!"=="" (
17
17
  )
18
18
 
19
19
  set "CMD_DIR=.forge\commands"
20
+ set "INIT_CMD=.forge\init.cmd"
20
21
 
21
22
  REM --- Verificar instalacion ---
22
- if not exist "%CMD_DIR%\save.cmd" (
23
+ if not exist "%INIT_CMD%" (
23
24
  echo.
24
- echo !C_RE![X]!C_RS! forgeGit no esta instalado aqui.
25
- echo !C_GY!Ejecuta desde un proyecto nuevo:!C_RS! forge
25
+ echo !C_RE![X]!C_RS! forgeGit no esta instalado correctamente.
26
+ echo !C_GY!Falta .forge\init.cmd!C_RS!
26
27
  echo.
27
28
  pause
28
29
  exit /b 1
@@ -30,6 +31,7 @@ if not exist "%CMD_DIR%\save.cmd" (
30
31
 
31
32
  REM --- Modo CLI directo ---
32
33
  if not "%~1"=="" (
34
+ if /i "%~1"=="init" ( call "%INIT_CMD%" %2 %3 & exit /b 0 )
33
35
  if /i "%~1"=="save" ( call "%CMD_DIR%\save.cmd" & exit /b 0 )
34
36
  if /i "%~1"=="push" ( call "%CMD_DIR%\push.cmd" & exit /b 0 )
35
37
  if /i "%~1"=="snap" ( call "%CMD_DIR%\snapshots.cmd" & exit /b 0 )
@@ -67,6 +69,7 @@ echo !C_YE![6]!C_RS! Abrir en VS Code
67
69
  echo !C_YE![7]!C_RS! Servidor dev !C_GY!(auto-detect)!C_RS!
68
70
  echo.
69
71
  echo !C_BC!Sistema:!C_RS!
72
+ echo !C_YE![r]!C_RS! Re-bootstrap !C_GY!(init --force)!C_RS!
70
73
  echo !C_YE![0]!C_RS! Salir
71
74
  echo.
72
75
  echo !C_CY!--------------------------------------------!C_RS!
@@ -82,6 +85,7 @@ if "!OPT!"=="4" ( call "%CMD_DIR%\snapshots.cmd" & echo. & pause & goto :menu )
82
85
  if "!OPT!"=="5" ( call "%CMD_DIR%\auditar.cmd" & echo. & pause & goto :menu )
83
86
  if "!OPT!"=="6" ( call "%CMD_DIR%\abrir.cmd" & echo. & pause & goto :menu )
84
87
  if "!OPT!"=="7" ( call "%CMD_DIR%\serve.cmd" & echo. & pause & goto :menu )
88
+ if /i "!OPT!"=="r" ( call "%INIT_CMD%" --force & echo. & pause & goto :menu )
85
89
  if "!OPT!"=="0" goto :end
86
90
  if /i "!OPT!"=="q" goto :end
87
91
 
@@ -98,6 +102,8 @@ echo !C_CY!============================================!C_RS!
98
102
  echo.
99
103
  echo !C_BC!USO:!C_RS!
100
104
  echo !C_WH!forge!C_RS! Menu interactivo
105
+ echo !C_WH!forge init!C_RS! Bootstrap (re-instalar)
106
+ echo !C_WH!forge init --force!C_RS! Regenerar todo
101
107
  echo !C_WH!forge save!C_RS! Guardar cambios
102
108
  echo !C_WH!forge push!C_RS! Subir a GitHub
103
109
  echo !C_WH!forge snap!C_RS! Snapshots