nexakit 0.2.0 → 0.4.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/.claude-plugin/marketplace.json +10 -5
- package/README.md +20 -4
- package/assets/runtime/package-lock.json +2 -2
- package/catalogs/generadores.json +936 -0
- package/package.json +1 -1
- package/plugins/nexakit-ahorro/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-ahorro/README.md +13 -0
- package/plugins/nexakit-ahorro/hooks/compactar.js +39 -0
- package/plugins/nexakit-ahorro/hooks/hooks.json +1 -0
- package/plugins/nexakit-ahorro/hooks/register.js +32 -0
- package/plugins/nexakit-lecciones/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-lecciones/README.md +19 -0
- package/plugins/nexakit-lecciones/hooks/hooks.json +1 -0
- package/plugins/nexakit-lecciones/hooks/lecciones.js +39 -0
- package/plugins/nexakit-lecciones/hooks/register.js +61 -0
- package/plugins/nexakit-modelo/.claude-plugin/plugin.json +1 -1
- package/plugins/nexakit-modelo/hooks/barra.js +72 -0
- package/plugins/nexakit-modelo/hooks/recomendar.js +27 -0
- package/plugins/nexakit-modelo/hooks/register.js +73 -17
- package/plugins/nexakit-modelo/hooks/umbrales.js +3 -0
- package/plugins/nexakit-modelo/tests/register.test.ts +1 -1
- package/plugins/nexakit-sesion/.claude-plugin/plugin.json +1 -1
- package/plugins/nexakit-sesion/README.md +3 -3
- package/plugins/nexakit-sesion/hooks/aviso.js +28 -11
- package/plugins/nexakit-sesion/hooks/register.js +30 -2
- package/plugins/nexakit-sesion/tests/register.test.ts +3 -16
- package/plugins/niveles/agents/nivel-alto.md +3 -3
- package/plugins/niveles/agents/nivel-exigente.md +3 -3
- package/plugins/niveles/agents/nivel-ligero.md +3 -3
- package/plugins/niveles/agents/nivel-normal.md +3 -3
- package/schemas/generators.schema.json +299 -0
- package/skills/quality-gate/SKILL.md +1 -1
- package/skills/revisar/SKILL.md +46 -6
- package/src/clean-command.js +29 -0
- package/src/clean-project-flow.js +105 -0
- package/src/clean-project.js +431 -0
- package/src/cli-executable.js +1 -1
- package/src/gemini-files.js +3 -3
- package/src/gemini-tools.js +23 -8
- package/src/generators-catalog.js +63 -0
- package/src/level-agents.js +4 -3
- package/src/project-root.js +21 -2
- package/src/project-signals.js +6 -0
- package/src/redact.js +9 -0
- package/src/review-instructions.js +18 -29
- package/src/setup-state.js +7 -0
- package/src/setup-tui.js +98 -6
- package/src/skill-recommendations.js +25 -2
- package/src/toolkit-cli.js +0 -4
- package/src/toolkit-commands-guide.js +1 -1
- package/src/toolkit-setup.js +2 -2
- package/plugins/nexakit-modelo/hooks/status.js +0 -8
- package/plugins/nexakit-panel/.claude-plugin/plugin.json +0 -1
- package/plugins/nexakit-panel/README.md +0 -20
- package/plugins/nexakit-panel/hooks/hooks.json +0 -1
- package/plugins/nexakit-panel/hooks/lienzo.js +0 -382
- package/plugins/nexakit-panel/hooks/panel.js +0 -279
- package/plugins/nexakit-panel/hooks/register.tsx +0 -248
- package/plugins/nexakit-panel/tests/lienzo.test.ts +0 -142
- package/plugins/nexakit-panel/tests/panel.test.ts +0 -240
- package/plugins/nexakit-panel/tests/register.test.ts +0 -167
- package/plugins/nexakit-panel/types/index.d.ts +0 -41
- package/skills/revision-cruzada/SKILL.md +0 -59
- package/src/panel-cli.js +0 -182
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RECOMMENDED_REVIEWERS } from './review-policy.js';
|
|
2
1
|
import fs from 'node:fs/promises';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { randomUUID, createHash } from 'node:crypto';
|
|
@@ -10,36 +9,26 @@ const BODY = `${START}
|
|
|
10
9
|
Para programar sigue el proceso de Superpowers (obligatorio): contexto y
|
|
11
10
|
memoria, diseño y plan proporcionales, rama, pruebas, implementación,
|
|
12
11
|
verificación y cierre con memoria. No hace falta un comando para empezar.
|
|
13
|
-
Sobre sus skills mandan:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
Sobre sus skills mandan: no borrar código existente sin acuerdo aunque el TDD
|
|
13
|
+
lo pida; commit, push, PR y memoria solo con autorización. Reutiliza un diseño
|
|
14
|
+
o plan ya aprobado. Antes de un PR, quality-gate. Modo tutor (la persona
|
|
15
|
+
escribe el código, un paso verificable cada vez) solo si lo pide.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
Orquesta: tú entiendes, planificas, decides e integras; delega la ejecución en
|
|
18
|
+
subagentes de nivel (Claude: niveles:nivel-<nivel>; Codex: nivel_<nivel>):
|
|
19
|
+
ligero para comandos, búsquedas y cambios mecánicos; normal para implementar
|
|
20
|
+
con diseño claro; exigente para pruebas, casos borde o un fallo acotado; alto
|
|
21
|
+
para un fallo sutil, seguridad o lo que exigente no resolvió. Trabaja tú solo
|
|
22
|
+
lo que se hace en uno o dos pasos y la conversación con la persona. Da a cada
|
|
23
|
+
subagente un encargo autocontenido (objetivo, archivos, criterio de hecho),
|
|
24
|
+
lanza en paralelo los independientes y comprueba su informe antes de darlo
|
|
25
|
+
por bueno. Si el encargo necesita el mismo contexto que ya llevas, bifurca la
|
|
26
|
+
sesión (fork) en vez de crear un subagente nuevo. Usa elegir-modelo para nombres reales; nunca cambies el modelo de
|
|
27
|
+
la sesión por tu cuenta. Sin subagentes de nivel, trabaja tú.
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Un fallo del comando o informe vacío no significa «sin hallazgos».
|
|
28
|
-
|
|
29
|
-
La IA revisora se elige en la terminal durante la sesión, nunca en el arranque
|
|
30
|
-
ni en answers. Excluye siempre a la IA que programa. Antes de cada revisión ejecuta
|
|
31
|
-
\`nexakit revision --disponibles --principal <IA que programa>\` (claude,
|
|
32
|
-
codex o antigravity), sin llamadas a modelos. Ofrece las otras IA instaladas
|
|
33
|
-
con certificación «sí» o «pendiente» (avisa si la primera vez se certifican);
|
|
34
|
-
nunca las «no». Recomendadas: Claude→${RECOMMENDED_REVIEWERS.claude},
|
|
35
|
-
Codex→${RECOMMENDED_REVIEWERS.codex} y Antigravity→${RECOMMENDED_REVIEWERS.antigravity}.
|
|
36
|
-
Primera revisión con varias opciones: «¿A dónde mando la revisión?» marcando
|
|
37
|
-
la recomendada (Claude: selector; Codex/Antigravity: pregunta normal). Una
|
|
38
|
-
opción: úsala sin preguntar; ninguna: avisa que no hay revisión; si falta
|
|
39
|
-
certificar un perfil, infórmalo. Después conserva la elección en la sesión y
|
|
40
|
-
anuncia «Revisando con <IA>…». «que lo revise <IA>» cambia la elección. Si
|
|
41
|
-
desaparece, usa la única alternativa o pregunta entre las restantes. No persistas
|
|
42
|
-
la elección.
|
|
29
|
+
La revisión por otra IA es opcional: solo con /revisar o si la persona lo pide
|
|
30
|
+
(«que lo revise <IA>»); sigue la skill revisar. Usa la orden estable
|
|
31
|
+
~/.nexakit/nexakit (Windows: nexakit.cmd en esa carpeta).
|
|
43
32
|
|
|
44
33
|
Si una tarea larga queda a medias —pausa, cambio de IA, bloqueo o cierre— escribe o actualiza la nota de seguimiento con project-handoff; recomienda sesión nueva en los casos de project-handoff, y cierra el seguimiento al integrar con cerrar-memoria.
|
|
45
34
|
${END}`;
|
package/src/setup-state.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { inspectFolder } from './clean-project.js';
|
|
2
|
+
import { loadGeneratorsCatalog } from './generators-catalog.js';
|
|
3
|
+
import { readCleanProjectAnswers } from './skill-recommendations.js';
|
|
1
4
|
// Gathers, read-only, everything the setup questions and the confirmation need: the project and what it uses, the
|
|
2
5
|
// skills and their links, the agents installed, their base skills, the stable command and the project memory.
|
|
3
6
|
// Nothing here writes; setup-apply.js does, after the person confirms.
|
|
@@ -243,6 +246,10 @@ export async function gatherSetupState({
|
|
|
243
246
|
const reviewInstructions = await planReviewInstructions({ homeDirectory, environment, codexHome });
|
|
244
247
|
const superpowers = await inspectSuperpowers({ agentsFound, runCommand, environment });
|
|
245
248
|
return {
|
|
249
|
+
folder:await inspectFolder(start),
|
|
250
|
+
creationRoot:await fs.realpath(start),
|
|
251
|
+
generators:await loadGeneratorsCatalog(),
|
|
252
|
+
cleanProject:await readCleanProjectAnswers(project.root),
|
|
246
253
|
reviewInstructions,
|
|
247
254
|
superpowers,
|
|
248
255
|
homeDirectory,
|
package/src/setup-tui.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { createCleanProject } from './clean-project-flow.js';
|
|
1
2
|
// `npx nexakit`: three questions with the answer already suggested (skills, memory, agents) and one confirmation,
|
|
2
3
|
// in the style of `npm create vite`. Answered questions fold into one ◇ line; the active one uses ◆. The model,
|
|
3
4
|
// the drawing and the keys are pure, so every screen is tested as text; runSetupTui is the only part with I/O.
|
|
4
5
|
import os from 'node:os';
|
|
6
|
+
import fs from 'node:fs/promises';
|
|
7
|
+
import { planCleanProject, checkRequirements } from './clean-project.js';
|
|
8
|
+
import { runCleanCommand } from './clean-command.js';
|
|
5
9
|
import path from 'node:path';
|
|
6
10
|
import { applySetup } from './setup-apply.js';
|
|
7
11
|
import { AGENTS, AGENT_NAMES, buildConfirmation, joinNames, shortPath, suggestedAnswers } from './setup-plan.js';
|
|
@@ -64,9 +68,20 @@ export function createSetupModel(state) {
|
|
|
64
68
|
};
|
|
65
69
|
model.memoryChoice = answers.memory.decision === 'later' ? 'later'
|
|
66
70
|
: answers.memory.path === (state.memory.existing?.vaultPath ?? state.memory.suggestedPath) ? memoryOptions(model)[0] : 'other';
|
|
71
|
+
model.cleanChoice = {frontend:null,backend:null,database:null,mobile:null};
|
|
72
|
+
model.cleanGit = true; model.cleanFolder = state.creationRoot ?? state.project.root;
|
|
73
|
+
model.folderInput = ''; model.requirements = null; model.cleanPlan = null;
|
|
74
|
+
if (state.folder && !state.savedAnswers && !state.cleanProject) { model.step = 'mode'; model.cursor = state.folder.empty ? 0 : 1; }
|
|
75
|
+
if (state.cleanProject && state.cleanProject.status !== 'creado') model.step = 'clean-failed';
|
|
67
76
|
return model;
|
|
68
77
|
}
|
|
69
78
|
|
|
79
|
+
const cleanParts = ['frontend','backend','database','mobile'];
|
|
80
|
+
function technologyOptions(model, part) {
|
|
81
|
+
return model.state.generators.generators.filter(g=>g.part===part && (part!=='database' || model.cleanChoice.backend || g.id==='supabase'));
|
|
82
|
+
}
|
|
83
|
+
function goTechnology(model, part) { return go(model, `tech-${part}`, {cursor:part==='frontend'?0:technologyOptions(model,part).length}); }
|
|
84
|
+
|
|
70
85
|
// Leaving the skills question: a suggestion left unchecked is remembered as discarded, so it is not offered again.
|
|
71
86
|
function closeSkills(model) {
|
|
72
87
|
const chosen = model.state.skills.filter(skill => model.answers.skills.chosen.includes(skill.name)).map(skill => skill.name);
|
|
@@ -97,9 +112,20 @@ const previousOf = (model, step) => {
|
|
|
97
112
|
};
|
|
98
113
|
|
|
99
114
|
export function handleSetupKey(model, key) {
|
|
100
|
-
if (key === '\x03') return { model, effect: 'exit' };
|
|
115
|
+
if (key === '\x03') return ['creating','applying'].includes(model.step) ? {model} : { model, effect: 'exit' };
|
|
101
116
|
const { step } = model;
|
|
102
117
|
|
|
118
|
+
if (step === 'clean-folder') {
|
|
119
|
+
if (is(key,'enter')) {
|
|
120
|
+
const name = model.folderInput.trim();
|
|
121
|
+
if (!name || /[\\/:\x00-\x1f]/.test(name) || ['.','..','.git','.agent-toolkit'].includes(name)) return {model:{...model,message:'Escribe el nombre de una subcarpeta nueva.'}};
|
|
122
|
+
return {model,effect:'check-clean-folder',path:path.join(model.cleanFolder,name)};
|
|
123
|
+
}
|
|
124
|
+
if (key==='\x1b') return {model:go(model,'mode')};
|
|
125
|
+
if (key==='\x7f'||key==='\x08') return {model:{...model,folderInput:[...model.folderInput].slice(0,-1).join('')}};
|
|
126
|
+
if (/^[^\x00-\x1f\x7f]+$/u.test(key) && !key.startsWith('\x1b')) return {model:{...model,folderInput:model.folderInput+key,message:null}};
|
|
127
|
+
return {model};
|
|
128
|
+
}
|
|
103
129
|
if (step === 'memory-path') {
|
|
104
130
|
if (is(key, 'enter')) {
|
|
105
131
|
const raw = model.memoryInput.trim();
|
|
@@ -113,7 +139,41 @@ export function handleSetupKey(model, key) {
|
|
|
113
139
|
return { model };
|
|
114
140
|
}
|
|
115
141
|
|
|
116
|
-
if (is(key, 'quit') && !['applying'].includes(step)) return { model, effect: 'exit' };
|
|
142
|
+
if (is(key, 'quit') && !['applying','creating'].includes(step)) return { model, effect: 'exit' };
|
|
143
|
+
|
|
144
|
+
if (step==='mode') {
|
|
145
|
+
if(is(key,'up')||is(key,'down')) return {model:{...model,cursor:model.cursor===0?1:0}};
|
|
146
|
+
if(is(key,'enter')) return {model:model.cursor===1?go(model,'skills'):model.state.folder.empty?goTechnology(model,'frontend'):go(model,'clean-folder')};
|
|
147
|
+
return {model};
|
|
148
|
+
}
|
|
149
|
+
if (step.startsWith('tech-')) {
|
|
150
|
+
const part=step.slice(5), options=technologyOptions(model,part);
|
|
151
|
+
if(is(key,'up')) return {model:{...model,cursor:Math.max(0,model.cursor-1)}};
|
|
152
|
+
if(is(key,'down')) return {model:{...model,cursor:Math.min(options.length,model.cursor+1)}};
|
|
153
|
+
if(is(key,'back')) { const i=cleanParts.indexOf(part);return {model:i?goTechnology(model,cleanParts[i-1]):go(model,'mode')}; }
|
|
154
|
+
if(is(key,'enter')) {
|
|
155
|
+
const next={...model,cleanChoice:{...model.cleanChoice,[part]:options[model.cursor]?.id ?? null}};
|
|
156
|
+
if(part==='backend' && !next.cleanChoice.backend) next.cleanChoice.database=null;
|
|
157
|
+
if(part!=='mobile') return {model:goTechnology(next,cleanParts[cleanParts.indexOf(part)+1])};
|
|
158
|
+
if(!next.cleanChoice.frontend && !next.cleanChoice.backend && !next.cleanChoice.mobile) return {model:{...next,message:'Elige al menos una parte.'}};
|
|
159
|
+
if(next.cleanChoice.database==='supabase' && !next.cleanChoice.frontend && !next.cleanChoice.backend) return {model:{...next,message:'Supabase necesita frontend o backend.'}};
|
|
160
|
+
return next.state.folder.insideGit ? {model:go(next,'clean-confirm'),effect:'prepare-clean'} : {model:go(next,'git')};
|
|
161
|
+
}
|
|
162
|
+
return {model};
|
|
163
|
+
}
|
|
164
|
+
if(step==='git') {
|
|
165
|
+
if(is(key,'toggle')||is(key,'left')||is(key,'right')) return {model:{...model,cleanGit:!model.cleanGit}};
|
|
166
|
+
if(is(key,'enter')) return {model:go(model,'clean-confirm'),effect:'prepare-clean'};
|
|
167
|
+
if(is(key,'back')) return {model:goTechnology(model,'mobile')};
|
|
168
|
+
return {model};
|
|
169
|
+
}
|
|
170
|
+
if(step==='clean-confirm') {
|
|
171
|
+
if(is(key,'back')) return {model:goTechnology(model,'mobile')};
|
|
172
|
+
if(is(key,'enter') && model.cleanPlan && model.requirements && model.requirements.every(r=>r.ok)) return {model,effect:'create-project',choice:model.cleanChoice,git:!model.state.folder.insideGit && model.cleanGit,folder:model.cleanFolder};
|
|
173
|
+
return {model};
|
|
174
|
+
}
|
|
175
|
+
if(step==='clean-failed') return is(key,'enter') ? {model:go(model,'skills')} : {model};
|
|
176
|
+
if(step==='creating') return {model};
|
|
117
177
|
|
|
118
178
|
if (step === 'done' || step === 'detached') return { model, effect: 'exit' };
|
|
119
179
|
if (step === 'applying') return { model };
|
|
@@ -234,7 +294,21 @@ function folded(model) {
|
|
|
234
294
|
function question(model) {
|
|
235
295
|
const { state, answers } = model;
|
|
236
296
|
const home = state.homeDirectory;
|
|
297
|
+
if (model.step.startsWith('tech-')) {
|
|
298
|
+
const part=model.step.slice(5),labels={frontend:'frontend',backend:'backend',database:'base de datos',mobile:'app móvil'};
|
|
299
|
+
const options=[...technologyOptions(model,part).map(g=>g.label),`No quiero ${labels[part]}`];
|
|
300
|
+
return {title:`Elige ${labels[part]}`,body:options.map((text,i)=>({text:`${i===model.cursor?'●':'○'} ${text}`,cursor:i===model.cursor})),info:model.message?[model.message]:[],keys:'↑/↓ elegir · Enter continuar · q salir'};
|
|
301
|
+
}
|
|
237
302
|
switch (model.step) {
|
|
303
|
+
case 'mode': return {title:'¿Proyecto limpio o ya empezado?',body:['Proyecto limpio: crear la base desde cero','Ya empezado: preparar lo que hay'].map((text,i)=>({text:`${i===model.cursor?'●':'○'} ${text}`,cursor:i===model.cursor})),info:[],keys:'↑/↓ elegir · Enter continuar · q salir'};
|
|
304
|
+
case 'clean-folder': return {title:'Nombre de la subcarpeta nueva',body:[{text:model.folderInput+'▌'}],info:model.message?[model.message]:[],keys:'Enter comprobar · Esc volver'};
|
|
305
|
+
case 'git': return {title:'¿Inicio Git con un primer commit?',body:[{text:model.cleanGit?'● Sí / ○ No':'○ Sí / ● No'}],info:[],keys:'←/→ cambiar · Enter continuar · q salir'};
|
|
306
|
+
case 'clean-confirm': return {title:'¿Creo la base del proyecto?',body:(model.cleanPlan?.parts ?? []).flatMap(p=>[
|
|
307
|
+
{text:`${p.part}: ${p.id} → ${p.dir}`},...(p.commands.some(c=>/\.venv[\\/]/.test(c.argv[0]))?[{text:`${p.dir}: ${process.platform==='win32'?'py':'python3'} -m venv .venv`}]:[]),...p.commands.map(c=>({text:`${c.cwd}: ${c.argv.map(a=>JSON.stringify(a)).join(' ')}`})),
|
|
308
|
+
...p.writes.map(w=>({text:`Crear ${w.path}: ${w.content}`})),{text:`Comprobar ${p.check.cwd}: ${p.check.argv.map(a=>JSON.stringify(a)).join(' ')}`}]),
|
|
309
|
+
info:model.requirements===null?['Comprobando requisitos…']:[...(model.state.folder?.insideGit?['El commit queda a tu cargo en el repositorio existente.']:model.cleanGit?['git init','git add -A','git commit -m \"chore: crear la base del proyecto con nexakit\"']:[]),...model.requirements.filter(r=>!r.ok).map(r=>`! Falta ${r.program} ${r.minVersion} o superior (${r.found ?? 'no encontrado'}).`),...(model.message?[model.message]:[])],keys:'Enter crear · retroceso volver · q salir'};
|
|
310
|
+
case 'creating': return {title:'Creando el proyecto…',body:(model.cleanProgress ?? []).map(text=>({text})),info:[],keys:'Espera a que termine la orden'};
|
|
311
|
+
case 'clean-failed': return {title:'La creación no terminó',body:[{text:model.cleanFailure ?? `Revisa el registro en .agent-toolkit/creacion.log.`}],info:['Se conserva lo creado. Enter prepara lo existente.'],keys:'Enter continuar · q salir'};
|
|
238
312
|
case 'skills': {
|
|
239
313
|
const rows = skillRows(model);
|
|
240
314
|
const width = Math.min(28, Math.max(...rows.filter(r => r.skill).map(r => r.skill.name.length), 10));
|
|
@@ -249,7 +323,7 @@ function question(model) {
|
|
|
249
323
|
const missing = state.uncoveredTech?.length
|
|
250
324
|
? ['', ...wrapText(`Sin skill en el catálogo: ${joinNames(state.uncoveredTech.map(item => item.label))}. Para buscar una, pide a tu IA «busca una skill para ${state.uncoveredTech[0].label}».`, 60)]
|
|
251
325
|
: [];
|
|
252
|
-
const info = [...(model.info && current ? ['', ...wrapText(current.summary, 60), ...skillTrust(current)] : []), ...external, ...missing];
|
|
326
|
+
const info = [...(model.message?[model.message]:[]), ...(model.info && current ? ['', ...wrapText(current.summary, 60), ...skillTrust(current)] : []), ...external, ...missing];
|
|
253
327
|
return { title: '¿Qué skills quieres?', body, info, keys: 'espacio marcar · i qué hace · Enter seguir · q salir' };
|
|
254
328
|
}
|
|
255
329
|
case 'memory': {
|
|
@@ -463,12 +537,13 @@ export function renderSetupFrame(model, { columns = 80, rows, color = true } = {
|
|
|
463
537
|
return `${header.join('\n')}\n${body}`;
|
|
464
538
|
}
|
|
465
539
|
|
|
466
|
-
export async function runSetupTui({ input = process.stdin, output = process.stdout, options = {}, applyOptions = {} } = {}) {
|
|
540
|
+
export async function runSetupTui({ input = process.stdin, output = process.stdout, options = {}, applyOptions = {}, gather = gatherSetupState } = {}) {
|
|
467
541
|
const level = colorLevel(output);
|
|
468
542
|
const home = options.homeDirectory ?? os.homedir();
|
|
469
543
|
output.write('Revisando el proyecto…\n');
|
|
470
|
-
let model = createSetupModel(await
|
|
544
|
+
let model = createSetupModel(await gather(options));
|
|
471
545
|
let exitCode = 0;
|
|
546
|
+
let creationController;
|
|
472
547
|
// The questions live on the alternate screen, where moving home and erasing redraws in place: clearing the
|
|
473
548
|
// normal screen pushes a copy of every frame into the scrollback in most terminals. On exit the last frame is
|
|
474
549
|
// printed once on the normal screen, so the result stays readable.
|
|
@@ -499,6 +574,22 @@ export async function runSetupTui({ input = process.stdin, output = process.stdo
|
|
|
499
574
|
kind, mcpName: `${model.state.project.id}-memory` })
|
|
500
575
|
: null;
|
|
501
576
|
model = applyMemoryPathCheck(model, extra.path, kind, connections);
|
|
577
|
+
} else if (effect === 'check-clean-folder') {
|
|
578
|
+
const exists=await fs.lstat(extra.path).catch(e=>{if(e.code==='ENOENT')return null;throw e;});
|
|
579
|
+
model=exists?{...model,message:'Esa carpeta ya existe. Elige otra.'}:goTechnology({...model,cleanFolder:extra.path},'frontend');
|
|
580
|
+
} else if (effect === 'prepare-clean') {
|
|
581
|
+
try {
|
|
582
|
+
const cleanPlan=planCleanProject({choice:model.cleanChoice,catalog:model.state.generators,name:path.basename(model.cleanFolder)});
|
|
583
|
+
const requirements=await checkRequirements(cleanPlan,model.state.generators,{runCommand:options.runCommand ?? runCleanCommand});
|
|
584
|
+
model={...model,cleanPlan,requirements};
|
|
585
|
+
} catch(e) { model={...model,cleanPlan:null,requirements:[],message:e.message}; }
|
|
586
|
+
} else if (effect === 'create-project') {
|
|
587
|
+
model={...model,step:'creating',cleanProgress:[]}; creationController=new AbortController(); render();
|
|
588
|
+
const result=await createCleanProject({...extra,insideGit:model.state.folder.insideGit},{options,gather,signal:creationController.signal,runCommand:options.runCommand ?? runCleanCommand,
|
|
589
|
+
onProgress:(part,argv)=>{model={...model,cleanProgress:[`${part}: ${argv.join(' ')}`]};render();}});
|
|
590
|
+
if(result.state){options={...options,start:result.state.project.root};model=createSetupModel(result.state);}
|
|
591
|
+
if(result.ok){model={...model,step:'skills',flow:'full',message:result.gitResult==='sin-git'?'Git no está instalado; seguimos sin él.':null};}
|
|
592
|
+
else{exitCode=1;model={...model,step:'clean-failed',cleanFailure:`${result.failed.part}: ${result.failed.argv.join(' ')}\n${result.failed.output}\nRegistro: .agent-toolkit/creacion.log`};}
|
|
502
593
|
} else if (effect === 'apply') {
|
|
503
594
|
const labels = Object.fromEntries(buildConfirmation(model.state, model.answers).blocks.map(block => [block.id, block.label]));
|
|
504
595
|
model = { ...model, step: 'applying', progress: [] };
|
|
@@ -533,7 +624,8 @@ export async function runSetupTui({ input = process.stdin, output = process.stdo
|
|
|
533
624
|
};
|
|
534
625
|
const onData = chunk => {
|
|
535
626
|
const key = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
|
|
536
|
-
if
|
|
627
|
+
if(key === '\x03' && model.step==='creating'){creationController?.abort();return;}
|
|
628
|
+
if (key === '\x03' && !['applying','creating'].includes(model.step)) return cleanup(exitCode);
|
|
537
629
|
chain = chain.then(() => handle(key)).catch(error => {
|
|
538
630
|
model = { ...model, step: 'done', result: { ok: false, failed: { message: error instanceof Error ? error.message : String(error) } } };
|
|
539
631
|
exitCode = 1;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import generatorsData from '../catalogs/generadores.json' with { type: 'json' };
|
|
1
2
|
import { ownedReviewInstructions, removeReviewInstructions } from './review-instructions.js';
|
|
2
3
|
import { createHash } from 'node:crypto';
|
|
3
4
|
import fs from 'node:fs/promises';
|
|
@@ -1143,13 +1144,35 @@ export async function applyProjectSkillLinks(plan) {
|
|
|
1143
1144
|
// so a second run knows what was decided and does not ask again.
|
|
1144
1145
|
const isNameList = value => Array.isArray(value) && value.every(item => typeof item === 'string' && SKILL_NAME_RE.test(item));
|
|
1145
1146
|
function validSetupAnswers(answers) {
|
|
1146
|
-
return Boolean(answers && answers.version === 1 &&
|
|
1147
|
+
return Boolean(answers && (answers.cleanProject === undefined || validCleanProject(answers.cleanProject)) && answers.version === 1 &&
|
|
1147
1148
|
isNameList(answers.skills?.chosen) && isNameList(answers.skills?.discarded) &&
|
|
1148
1149
|
Array.isArray(answers.agents) && answers.agents.every(agent => ['claude', 'codex', 'antigravity'].includes(agent)) &&
|
|
1149
1150
|
(answers.memory?.decision === 'later' ||
|
|
1150
1151
|
(answers.memory?.decision === 'path' && typeof answers.memory.path === 'string' && path.isAbsolute(answers.memory.path))));
|
|
1151
1152
|
}
|
|
1152
1153
|
|
|
1154
|
+
function validCleanProject(value) {
|
|
1155
|
+
if (!value || typeof value.git !== 'boolean' || !['confirmado','creado','fallido'].includes(value.status) || !value.choice) return false;
|
|
1156
|
+
const parts = ['frontend','backend','database','mobile'];
|
|
1157
|
+
if (Object.keys(value.choice).some(p=>!parts.includes(p))) return false;
|
|
1158
|
+
return parts.every(part => value.choice[part] === null || generatorsData.generators.some(g=>g.id===value.choice[part] && g.part===part))
|
|
1159
|
+
&& (value.failedPart === undefined || ['frontend','backend','mobile','proyecto'].includes(value.failedPart));
|
|
1160
|
+
}
|
|
1161
|
+
export async function readCleanProjectAnswers(projectRoot) {
|
|
1162
|
+
const value = (await readProjectToolkitManifest(projectRoot))?.answers?.cleanProject;
|
|
1163
|
+
return validCleanProject(value) ? value : null;
|
|
1164
|
+
}
|
|
1165
|
+
export async function writeCleanProjectAnswers(projectRoot, cleanProject, lock) {
|
|
1166
|
+
if (!validCleanProject(cleanProject)) throw new Error('Respuestas del proyecto limpio no válidas.');
|
|
1167
|
+
await lock.assertHeld();
|
|
1168
|
+
const previous = await readProjectToolkitManifest(projectRoot);
|
|
1169
|
+
const result = await writeProjectManifestAndIgnore({projectRoot,mode:previous?.mode ?? 'symlink',
|
|
1170
|
+
gitIgnore:previous?.gitIgnoreStrategy ?? 'gitignore',prevManifest:previous,
|
|
1171
|
+
coupledEntriesMap:new Map((previous?.entries ?? []).map(e=>[e.relativePath,e])),lock,
|
|
1172
|
+
answers:{version:1,...previous?.answers,cleanProject}});
|
|
1173
|
+
if (!result.manifestWritten) throw new Error('No se guardaron las respuestas del proyecto limpio.');
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1153
1176
|
export async function readSetupAnswers(projectRoot) {
|
|
1154
1177
|
const manifest = await readProjectToolkitManifest(projectRoot);
|
|
1155
1178
|
return validSetupAnswers(manifest?.answers) ? manifest.answers : null;
|
|
@@ -1166,7 +1189,7 @@ export async function writeSetupAnswers(projectRoot, answers, lock) {
|
|
|
1166
1189
|
prevManifest,
|
|
1167
1190
|
coupledEntriesMap: new Map((prevManifest?.entries ?? []).map(entry => [entry.relativePath, entry])),
|
|
1168
1191
|
lock,
|
|
1169
|
-
answers
|
|
1192
|
+
answers: { ...answers, ...(prevManifest?.answers?.cleanProject && !answers.cleanProject && {cleanProject:prevManifest.answers.cleanProject}) }
|
|
1170
1193
|
});
|
|
1171
1194
|
if (!result.manifestWritten) throw new Error(`${PROJECT_TOOLKIT_DIR} no es una carpeta normal; no se guardaron las respuestas.`);
|
|
1172
1195
|
}
|
package/src/toolkit-cli.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import { runCli } from './cli.js';
|
|
3
3
|
import { runModelCommand } from './model-command.js';
|
|
4
|
-
import { runPanelCommand } from './panel-cli.js';
|
|
5
4
|
import { runRevisionCommand } from './revision.js';
|
|
6
5
|
import path from 'node:path';
|
|
7
6
|
import readline from 'node:readline';
|
|
@@ -38,7 +37,6 @@ const HELP = `Uso: npx nexakit [--project <ruta>] [--si]
|
|
|
38
37
|
nexakit revision --disponibles [--principal claude|codex|antigravity]
|
|
39
38
|
nexakit revision --con <ia> --modelo <m> --esfuerzo <e> --encargo <archivo> [--base <rama>]
|
|
40
39
|
nexakit modelo [--nivel <nivel>] [--ia claude|codex|antigravity] [--perfil-codex <nombre>]
|
|
41
|
-
nexakit panel [--demo] [--una-vez]
|
|
42
40
|
npx nexakit recommend [--project <ruta>] [--profile frontend|backend|mcp|security] [--client codex|claude] [--dry-run] [--json]
|
|
43
41
|
npx nexakit scan <carpeta de skill> [--json]
|
|
44
42
|
npx nexakit doctor [--agent codex|claude|antigravity|all] [--perfil-codex <nombre>] [--json]
|
|
@@ -56,7 +54,6 @@ reparar re-apunta enlaces rotos de una instalación anterior (--desde es la carp
|
|
|
56
54
|
que ya no existe); lista lo que encontró y siempre pregunta.
|
|
57
55
|
memoria ejecuta los subcomandos de project-memory (init, connect, doctor, status, sync).
|
|
58
56
|
revision y modelo piden una revisión a otra IA o consultan los modelos disponibles.
|
|
59
|
-
panel dibuja a pantalla completa la orquesta de tu sesión de Claude Code (ábrelo en otra división).
|
|
60
57
|
recommend inspecciona el proyecto en solo lectura; setup prepara las skills base globales y respeta las que quitaste
|
|
61
58
|
(--omitir <skill> declara quitada una que ya no tiene enlace; --reponer <skill> devuelve una; ambos se repiten).
|
|
62
59
|
(Alias local compatible: agent-toolkit)
|
|
@@ -95,7 +92,6 @@ export async function runToolkitCli(
|
|
|
95
92
|
const [command, ...rest] = argv;
|
|
96
93
|
if (command === 'modelo') return runModelCommand(rest, { out, err }, options);
|
|
97
94
|
if (command === 'revision') return runRevisionCommand(rest, { out, err }, { options });
|
|
98
|
-
if (command === 'panel') return runPanelCommand(rest, { out, err, input, output, isTTY, options });
|
|
99
95
|
if (command === 'memoria') {
|
|
100
96
|
return runCli(
|
|
101
97
|
rest,
|
|
@@ -50,7 +50,7 @@ export function getToolkitCommandsGuide({ clients = {} } = {}) {
|
|
|
50
50
|
codex: '$revisar',
|
|
51
51
|
antigravity: '/revisar',
|
|
52
52
|
stage: '4. Revisión par',
|
|
53
|
-
description: 'Pide una revisión
|
|
53
|
+
description: 'Pide una revisión a otra IA desde esta terminal; solo ocurre cuando tú la pides.',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
id: 'cerrar-memoria',
|
package/src/toolkit-setup.js
CHANGED
|
@@ -40,8 +40,8 @@ const SKILL_HOMES = {
|
|
|
40
40
|
const MCP_CLIENTS = ['codex', 'claude'];
|
|
41
41
|
// Skills nexakit no longer ships. Links it created are removed; anything else with the name is reported, never
|
|
42
42
|
// touched. The last three are now covered by Superpowers (brainstorming/writing-plans, systematic-debugging and
|
|
43
|
-
// test-driven-development), which is required.
|
|
44
|
-
export const RETIRED_SKILLS = Object.freeze(['programar', 'estado', 'spec-driven-development', 'depurar', 'desarrollo-con-pruebas']);
|
|
43
|
+
// test-driven-development), which is required. revision-cruzada merged into revisar when review became on demand.
|
|
44
|
+
export const RETIRED_SKILLS = Object.freeze(['programar', 'estado', 'spec-driven-development', 'depurar', 'desarrollo-con-pruebas', 'revision-cruzada']);
|
|
45
45
|
const MCP_SUFFIX = 'bin/agent-toolkit-mcp.js';
|
|
46
46
|
const COMMANDS = { codex: 'codex', claude: 'claude', antigravity: 'agy' };
|
|
47
47
|
export const globalSkillTarget = (home, client, name) => path.join(home, ...SKILL_HOMES[client], name);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const family = (model) => model?.match(/(?:^|claude-)(haiku|sonnet|opus|fable)(?:-|$)/u)?.[1] ?? model;
|
|
2
|
-
export function modelStatus(model, effort, recommendation) {
|
|
3
|
-
const actual = `${model ?? 'modelo no informado'} · ${effort ?? 'esfuerzo no informado'}`;
|
|
4
|
-
if (!recommendation) return actual;
|
|
5
|
-
const matches =
|
|
6
|
-
effort && family(model) === family(recommendation.model) && effort === recommendation.effort;
|
|
7
|
-
return `${actual} ${matches ? '✓' : `→ recomendado: ${recommendation.model} · ${recommendation.effort}`}`;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name": "nexakit-panel", "version": "0.1.0", "description": "Panel en vivo de la orquestación: modelo líder, subagentes, consultas al asesor, registro de la sesión, contexto y límites.", "types": "./types/index.d.ts", "license": "MIT"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# nexakit-panel
|
|
2
|
-
|
|
3
|
-
Panel de la orquestación de una sesión de Claude Code: el modelo líder y su esfuerzo, las consultas al asesor,
|
|
4
|
-
los subagentes con su modelo, estado y parte del uso, un registro de la sesión, el contexto, los límites de
|
|
5
|
-
5 horas y semanal, y el modelo frente al recomendado por `nexakit-modelo`. Todo sale de lo que informa Claude
|
|
6
|
-
Code; no muestra datos inventados.
|
|
7
|
-
|
|
8
|
-
## Uso
|
|
9
|
-
|
|
10
|
-
- `/panel` abre el panel junto al chat. Con al menos 104 columnas dibuja el diagrama completo; si no, una lista.
|
|
11
|
-
- `/panel-demo` alterna datos de ejemplo, marcados como ficticios, para ver el diseño.
|
|
12
|
-
- Para verlo siempre completo, abre `nexakit panel` en otra división de la terminal: lee la foto que este mod
|
|
13
|
-
guarda en `~/.nexakit/panel/` y la dibuja a pantalla completa.
|
|
14
|
-
|
|
15
|
-
La foto se guarda en tu disco con los secretos evidentes tachados (variables `*TOKEN*`, `*KEY*`, `*SECRET*`,
|
|
16
|
-
`*PASSWORD*`, cabeceras `Bearer` y opciones `--password`).
|
|
17
|
-
|
|
18
|
-
## Pruebas
|
|
19
|
-
|
|
20
|
-
`claude plugin test plugins/nexakit-panel`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"modules":["./register.tsx"]}
|