nexakit 0.6.0 → 0.8.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 +6 -0
- package/README.md +4 -3
- package/assets/runtime/package-lock.json +2 -2
- package/package.json +1 -1
- package/plugins/huellas.json +14 -10
- package/plugins/nexakit-ahorro/.claude-plugin/plugin.json +9 -1
- package/plugins/nexakit-ahorro/README.md +5 -0
- package/plugins/nexakit-ahorro/tests/register.test.ts +143 -0
- package/plugins/nexakit-guardarrailes/.claude-plugin/plugin.json +9 -0
- package/plugins/nexakit-guardarrailes/README.md +63 -0
- package/plugins/nexakit-guardarrailes/hooks/guardarrailes.js +466 -0
- package/plugins/nexakit-guardarrailes/hooks/hooks.json +1 -0
- package/plugins/nexakit-guardarrailes/hooks/register.js +26 -0
- package/plugins/nexakit-guardarrailes/tests/register.test.ts +228 -0
- package/plugins/nexakit-lecciones/.claude-plugin/plugin.json +9 -1
- package/plugins/nexakit-lecciones/README.md +5 -0
- package/plugins/nexakit-modelo/.claude-plugin/plugin.json +8 -1
- package/plugins/nexakit-modelo/hooks/barra.js +64 -4
- package/plugins/nexakit-modelo/hooks/recomendar.js +11 -1
- package/plugins/nexakit-modelo/hooks/register.js +17 -2
- package/plugins/nexakit-modelo/tests/register.test.ts +29 -0
- package/plugins/nexakit-sesion/.claude-plugin/plugin.json +9 -1
- package/plugins/nexakit-sesion/README.md +5 -0
- package/plugins/niveles/.claude-plugin/plugin.json +5 -2
- package/plugins/niveles/agents/cazador-de-flakes.md +18 -0
- package/plugins/niveles/agents/cierre-de-memoria.md +16 -0
- package/plugins/niveles/agents/investigador.md +18 -0
- package/plugins/niveles/agents/revisor-de-calidad.md +17 -0
- package/plugins/niveles/agents/sincronizador-docs.md +17 -0
- package/plugins/niveles/agents/subir-al-repo.md +23 -0
- package/schemas/project-memory.schema.json +21 -0
- package/skills/elegir-modelo/SKILL.md +2 -1
- package/src/mods.js +1 -0
- package/src/sync-inspect.js +15 -6
- package/src/toolkit-commands-guide.js +1 -1
|
@@ -58,7 +58,8 @@ Aplica la primera que resuelva el caso (es el mismo criterio que usa la barra de
|
|
|
58
58
|
| --- | --- | --- |
|
|
59
59
|
| Pregunta corta o explicación de algo ya en contexto | bajar el esfuerzo a `low` | ninguno; ahorra razonamiento |
|
|
60
60
|
| Fallo normal en código existente | subir el esfuerzo a `high`, mismo modelo | ninguno de caché |
|
|
61
|
-
|
|
|
61
|
+
| Escribir pruebas o cubrir casos borde | subir el esfuerzo a `high`, mismo modelo (es el trabajo de `nivel-exigente`) | ninguno de caché |
|
|
62
|
+
| Tarea mecánica (commit, push, lint, búsquedas) | delegar en `nivel-ligero`, solo si lee mucho o devuelve mucho ruido; si es pequeña, hazla en la sesión | un subagente pequeño |
|
|
62
63
|
| Fallo que ya se intentó y sigue, intermitente, de seguridad o concurrencia | con poco contexto o caché fría, cambiar al más capaz; si no, delegar en `nivel-alto` | relectura sin caché, o un subagente |
|
|
63
64
|
| Diseño o arquitectura | el más capaz; con mucho contexto, mejor en sesión nueva | relee todo el contexto si se cambia a mitad |
|
|
64
65
|
| Cinco o más turnos de rutina en un modelo más caro del necesario | sesión nueva en el modelo de uso diario | ninguno; deja de pagar de más en cada turno |
|
package/src/mods.js
CHANGED
|
@@ -15,6 +15,7 @@ export const MODS = Object.freeze([
|
|
|
15
15
|
mod('nexakit-ahorro', 'Recorta la salida larga de comandos'),
|
|
16
16
|
mod('nexakit-lecciones', 'Frena errores y guarda correcciones'),
|
|
17
17
|
mod('nexakit-sesion', 'Avisa cuándo abrir una sesión nueva'),
|
|
18
|
+
mod('nexakit-guardarrailes', 'Frena comandos peligrosos, secretos y commits mal escritos'),
|
|
18
19
|
]);
|
|
19
20
|
|
|
20
21
|
const allUnknown = () => Object.fromEntries(MODS.map((item) => [item.name, 'desconocido']));
|
package/src/sync-inspect.js
CHANGED
|
@@ -90,7 +90,7 @@ export async function inspectMemorySync(options = {}, context = {}) {
|
|
|
90
90
|
};
|
|
91
91
|
const inventory = await collectFiles(query, repository, prNumber, maxFiles, raw.changedFiles, warn);
|
|
92
92
|
const checks = await collectChecks(query, repository, raw.headRefOid, safeText, safeUrl, warn);
|
|
93
|
-
const { candidateAreas, unmappedFiles } = resolveCandidateAreas(doctor.vaultPath, manifest.memory?.layout, inventory.files, warn);
|
|
93
|
+
const { candidateAreas, unmappedFiles } = resolveCandidateAreas(doctor.vaultPath, manifest.memory?.layout, inventory.files, warn, manifest.automation?.areas);
|
|
94
94
|
const report = {
|
|
95
95
|
command: "sync inspect", status: checks.summary.adverse > 0 ? "blocked" : warnings.length ? "partial" : "ready",
|
|
96
96
|
repository, branch, ledgerPath, alreadyReviewed: reviewed.has(prNumber), pullRequest,
|
|
@@ -311,12 +311,18 @@ const RULES = [
|
|
|
311
311
|
{ id: "frontend-path", category: "frontend", test: /(?:^|\/)[^/]*(?:frontend|client|web|ui)[^/]*(?:\/|$)/i, destinations: /(?:FRONTEND|IMPLEMENTACION)$/ },
|
|
312
312
|
{ id: "firmware-path", category: "hardware", test: /(?:^|\/)[^/]*(?:firmware|hardware|iot|esp32)[^/]*(?:\/|$)|\.(?:ino)$/i, destinations: /(?:IOT|HARDWARE|IMPLEMENTACION)$/ },
|
|
313
313
|
{ id: "docs-path", category: "documentation", test: /(?:^|\/)(?:docs|documentation)(?:\/|$)|\.(?:md|mdx)$/i, destinations: /(?:PRODUCTO|ARQUITECTURA|IMPLEMENTACION)$/ },
|
|
314
|
-
{ id: "operations-path", category: "operations", test: /(?:^|\/)(?:\.github|infra|deploy|docker|scripts)(?:\/|$)|(?:^|\/)(?:Dockerfile|docker-compose[^/]
|
|
315
|
-
{ id: "tests-path", category: "tests", test: /(?:^|\/)(?:test|tests|__tests__)(?:\/|$)|\.(?:test|spec)\.[^/]+$/i, destinations: /(?:IMPLEMENTACION|ENTREGAS|SPRINTS)$/ },
|
|
316
|
-
{ id: "decisions-path", category: "decisions", test: /(?:^|\/)(?:adr|decisions|decisiones)(?:\/|$)/i, destinations: /(?:DECISIONES)$/ }
|
|
314
|
+
{ id: "operations-path", category: "operations", test: /(?:^|\/)(?:\.github|\.claude-plugin|infra|deploy|docker|scripts)(?:\/|$)|(?:^|\/)(?:Dockerfile|docker-compose[^/]*|\.gitignore|\.gitattributes|package(?:-lock)?\.json)$/i, destinations: /(?:OPERACION)$/ },
|
|
315
|
+
{ id: "tests-path", category: "tests", test: /(?:^|\/)(?:test|tests|__tests__|test-support|testing)(?:\/|$)|\.(?:test|spec)\.[^/]+$/i, destinations: /(?:IMPLEMENTACION|ENTREGAS|SPRINTS)$/ },
|
|
316
|
+
{ id: "decisions-path", category: "decisions", test: /(?:^|\/)(?:adr|decisions|decisiones)(?:\/|$)/i, destinations: /(?:DECISIONES)$/ },
|
|
317
|
+
// Solo carpetas de código en la raíz: así no se solapa con las reglas por nombre de carpeta (frontend/src/...).
|
|
318
|
+
{ id: "source-path", category: "implementation", test: /^(?:src|lib|app|bin|packages|plugins|schemas|templates|examples)\//i, destinations: /(?:IMPLEMENTACION)$/ }
|
|
317
319
|
];
|
|
318
320
|
|
|
319
|
-
|
|
321
|
+
// automation.areas permite al proyecto elegir la carpeta de una categoría que tiene varias candidatas.
|
|
322
|
+
const declaredAreas = (areas) => (areas && typeof areas === "object" && !Array.isArray(areas) ? areas : {});
|
|
323
|
+
|
|
324
|
+
function resolveCandidateAreas(vault, layout, files, warn, areas) {
|
|
325
|
+
const declared = declaredAreas(areas);
|
|
320
326
|
const dirs = layout?.profile === "declared" ? layout.requiredDirectories : CANONICAL_DIRS;
|
|
321
327
|
const allowed = [];
|
|
322
328
|
for (const dir of dirs ?? []) {
|
|
@@ -339,7 +345,10 @@ function resolveCandidateAreas(vault, layout, files, warn) {
|
|
|
339
345
|
// Prefer a precise area (e.g. BACKEND), otherwise a single generic match.
|
|
340
346
|
const exact = destinations.filter((dir) => dir.toLowerCase().endsWith(rule.category) || rule.category === "hardware" && /(?:iot|hardware)$/i.test(dir));
|
|
341
347
|
const choices = exact.length ? exact : destinations;
|
|
342
|
-
const
|
|
348
|
+
const chosen = declared[rule.category];
|
|
349
|
+
const usesDeclared = typeof chosen === "string" && allowed.includes(chosen);
|
|
350
|
+
if (chosen !== undefined && !usesDeclared) warn("area-override-invalid", `El mapeo declarado para ${rule.category} no apunta a una carpeta permitida de la bóveda.`);
|
|
351
|
+
const directory = usesDeclared ? chosen : choices.length === 1 ? choices[0] : null;
|
|
343
352
|
const notes = [];
|
|
344
353
|
let omittedNotes = 0;
|
|
345
354
|
if (directory === null) warn("area-unresolved", "Una categoría no tiene carpeta inequívoca; requiere revisión manual.");
|
|
@@ -65,7 +65,7 @@ export function getToolkitCommandsGuide({ clients = {} } = {}) {
|
|
|
65
65
|
const cliCommands = [
|
|
66
66
|
{
|
|
67
67
|
command: 'npx nexakit',
|
|
68
|
-
description: 'Abre el asistente de
|
|
68
|
+
description: 'Abre el asistente de instalación, que ofrece mods como nexakit-guardarrailes para Claude Code. Usa --si para aplicar las opciones sugeridas.',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
command: 'npx nexakit comprobar',
|