nexakit 0.0.0-stage → 0.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/.claude-plugin/marketplace.json +28 -0
- package/LICENSE +26 -0
- package/README.md +79 -2
- package/agents/claude/docs-researcher.md +9 -0
- package/agents/claude/implementation-tutor.md +9 -0
- package/agents/claude/project-explorer.md +9 -0
- package/agents/claude/quality-reviewer.md +9 -0
- package/agents/claude/requirements-analyst.md +9 -0
- package/agents/claude/solution-architect.md +9 -0
- package/agents/codex/docs-researcher.toml +10 -0
- package/agents/codex/implementation-tutor.toml +10 -0
- package/agents/codex/project-explorer.toml +10 -0
- package/agents/codex/quality-reviewer.toml +10 -0
- package/agents/codex/requirements-analyst.toml +11 -0
- package/agents/codex/solution-architect.toml +10 -0
- package/assets/brand/README.md +38 -0
- package/assets/brand/agent-toolkit-mark.png +0 -0
- package/assets/brand/agent-toolkit-mark.svg +13 -0
- package/assets/brand/agent-toolkit-tui-hero.png +0 -0
- package/assets/brand/nexakit-readme-hero.png +0 -0
- package/assets/brand/nexakit-readme-hero.svg +21 -0
- package/assets/runtime/package-lock.json +1425 -0
- package/bin/agent-task.js +14 -0
- package/bin/agent-toolkit-gemini.js +13 -0
- package/bin/agent-toolkit-inbox.js +14 -0
- package/bin/agent-toolkit-mcp.js +17 -0
- package/bin/agent-toolkit.js +13 -0
- package/bin/nexakit.js +13 -0
- package/bin/project-memory-mcp.js +22 -0
- package/bin/project-memory.js +7 -0
- package/catalogs/skills/api-design-principles/LICENSE.txt +21 -0
- package/catalogs/skills/api-design-principles/SKILL.md +110 -0
- package/catalogs/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/catalogs/skills/api-design-principles/assets/rest-api-template.py +185 -0
- package/catalogs/skills/api-design-principles/references/details.md +413 -0
- package/catalogs/skills/api-design-principles/references/graphql-schema-design.md +589 -0
- package/catalogs/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/catalogs/skills/nodejs-backend-patterns/LICENSE.txt +21 -0
- package/catalogs/skills/nodejs-backend-patterns/SKILL.md +45 -0
- package/catalogs/skills/nodejs-backend-patterns/references/advanced-patterns.md +430 -0
- package/catalogs/skills/nodejs-backend-patterns/references/details.md +599 -0
- package/catalogs/skills/supabase-postgres-best-practices/CHANGELOG.md +73 -0
- package/catalogs/skills/supabase-postgres-best-practices/LICENSE.txt +21 -0
- package/catalogs/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/_template.md +34 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/catalogs/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
- package/catalogs/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/catalogs/skills/vercel-composition-patterns/LICENSE.txt +27 -0
- package/catalogs/skills/vercel-composition-patterns/README.md +60 -0
- package/catalogs/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/catalogs/skills/vercel-composition-patterns/metadata.json +11 -0
- package/catalogs/skills/vercel-composition-patterns/rules/_sections.md +29 -0
- package/catalogs/skills/vercel-composition-patterns/rules/_template.md +24 -0
- package/catalogs/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/catalogs/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/catalogs/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/catalogs/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/catalogs/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/catalogs/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/catalogs/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/catalogs/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/catalogs/skills/vercel-react-best-practices/AGENTS.md +3810 -0
- package/catalogs/skills/vercel-react-best-practices/LICENSE.txt +27 -0
- package/catalogs/skills/vercel-react-best-practices/README.md +123 -0
- package/catalogs/skills/vercel-react-best-practices/SKILL.md +149 -0
- package/catalogs/skills/vercel-react-best-practices/metadata.json +15 -0
- package/catalogs/skills/vercel-react-best-practices/rules/_sections.md +46 -0
- package/catalogs/skills/vercel-react-best-practices/rules/_template.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-effect-event-deps.md +56 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/catalogs/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +37 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-defer-await.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-analyzable-paths.md +63 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +60 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/catalogs/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/catalogs/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +60 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-request-idle-callback.md +105 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/catalogs/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +85 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +68 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +82 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +64 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md +59 -0
- package/catalogs/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +149 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-no-shared-module-state.md +50 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +34 -0
- package/catalogs/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/catalogs/skills/webapp-testing/LICENSE.txt +202 -0
- package/catalogs/skills/webapp-testing/SKILL.md +96 -0
- package/catalogs/skills/webapp-testing/examples/console_logging.py +35 -0
- package/catalogs/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/catalogs/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/catalogs/skills/webapp-testing/scripts/with_server.py +106 -0
- package/catalogs/skills.json +1115 -0
- package/docs/skills/evidencias/2026-10-28-evaluacion-inicial-mcp-seguridad.md +118 -0
- package/docs/skills/evidencias/2026-10-28-incorporacion-mcp-seguridad.json +152 -0
- package/docs/skills/evidencias/2026-10-28-recomendador-preparacion.md +50 -0
- package/package.json +73 -4
- package/plugins/nexakit-modelo/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-modelo/hooks/hooks.json +1 -0
- package/plugins/nexakit-modelo/hooks/register.js +48 -0
- package/plugins/nexakit-modelo/hooks/status.js +8 -0
- package/plugins/nexakit-modelo/tests/register.test.ts +21 -0
- package/plugins/nexakit-panel/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-panel/README.md +20 -0
- package/plugins/nexakit-panel/hooks/hooks.json +1 -0
- package/plugins/nexakit-panel/hooks/lienzo.js +382 -0
- package/plugins/nexakit-panel/hooks/panel.js +279 -0
- package/plugins/nexakit-panel/hooks/register.tsx +248 -0
- package/plugins/nexakit-panel/tests/lienzo.test.ts +142 -0
- package/plugins/nexakit-panel/tests/panel.test.ts +240 -0
- package/plugins/nexakit-panel/tests/register.test.ts +167 -0
- package/plugins/nexakit-panel/types/index.d.ts +41 -0
- package/plugins/nexakit-sesion/.claude-plugin/plugin.json +1 -0
- package/plugins/nexakit-sesion/README.md +12 -0
- package/plugins/nexakit-sesion/hooks/aviso.js +38 -0
- package/plugins/nexakit-sesion/hooks/hooks.json +1 -0
- package/plugins/nexakit-sesion/hooks/register.js +28 -0
- package/plugins/nexakit-sesion/tests/register.test.ts +96 -0
- package/plugins/niveles/.claude-plugin/plugin.json +5 -0
- package/plugins/niveles/agents/nivel-alto.md +13 -0
- package/plugins/niveles/agents/nivel-exigente.md +13 -0
- package/plugins/niveles/agents/nivel-ligero.md +13 -0
- package/plugins/niveles/agents/nivel-normal.md +13 -0
- package/schemas/agent-client-adapter.schema.json +786 -0
- package/schemas/agent-client-auth-diagnostic.schema.json +801 -0
- package/schemas/agent-client-isolated-variant.schema.json +105 -0
- package/schemas/agent-client-isolated-verification.schema.json +99 -0
- package/schemas/agent-client-managed-preferences-invocation.schema.json +67 -0
- package/schemas/agent-client-managed-preferences.schema.json +63 -0
- package/schemas/agent-client-native-diagnostics.schema.json +85 -0
- package/schemas/agent-client-native-evaluation.schema.json +171 -0
- package/schemas/agent-client-native-preflight.schema.json +90 -0
- package/schemas/agent-client-output.schema.json +551 -0
- package/schemas/agent-client-runtime-fixture.schema.json +90 -0
- package/schemas/agent-client-runtime-local.schema.json +95 -0
- package/schemas/agent-client-runtime.schema.json +1288 -0
- package/schemas/agent-client-selective-config.schema.json +77 -0
- package/schemas/agent-client-supervised-local.schema.json +135 -0
- package/schemas/agent-client-supervised.schema.json +186 -0
- package/schemas/agent-model-preference.schema.json +573 -0
- package/schemas/agent-model-selection.schema.json +311 -0
- package/schemas/agent-task-approvals.schema.json +362 -0
- package/schemas/agent-task-prepare.schema.json +1324 -0
- package/schemas/agent-task-verify.schema.json +198 -0
- package/schemas/project-memory-update.schema.json +33 -0
- package/schemas/project-memory.schema.json +298 -0
- package/schemas/skill-catalog.schema.json +246 -0
- package/schemas/task-workflow-plan-output.schema.json +35 -0
- package/scripts/prepare-package.js +6 -0
- package/scripts/validate-skill-catalog.js +41 -0
- package/skills/cerrar-avisens/SKILL.md +12 -0
- package/skills/cerrar-memoria/SKILL.md +96 -0
- package/skills/cerrar-memoria/references/cierre.md +76 -0
- package/skills/decision-records/SKILL.md +27 -0
- package/skills/decision-records/agents/openai.yaml +7 -0
- package/skills/decision-records/references/adr-template.md +35 -0
- package/skills/differential-review/LICENSE.txt +427 -0
- package/skills/differential-review/SKILL.md +225 -0
- package/skills/differential-review/adversarial.md +203 -0
- package/skills/differential-review/agents/openai.yaml +6 -0
- package/skills/differential-review/assets/trail-of-bits-mark.svg +1 -0
- package/skills/differential-review/methodology.md +234 -0
- package/skills/differential-review/patterns.md +300 -0
- package/skills/differential-review/reporting.md +369 -0
- package/skills/elegir-modelo/SKILL.md +68 -0
- package/skills/elegir-modelo/modelos.mjs +108 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/SKILL.md +71 -0
- package/skills/gemini/SKILL.md +52 -0
- package/skills/imagen/SKILL.md +12 -0
- package/skills/investigar/SKILL.md +11 -0
- package/skills/mcp-builder/LICENSE.txt +202 -0
- package/skills/mcp-builder/SKILL.md +236 -0
- package/skills/mcp-builder/reference/evaluation.md +602 -0
- package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/skills/mcp-builder/scripts/connections.py +151 -0
- package/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/skills/ordenar-proyecto/SKILL.md +56 -0
- package/skills/project-handoff/SKILL.md +53 -0
- package/skills/project-handoff/agents/openai.yaml +7 -0
- package/skills/project-handoff/references/handoff-template.md +35 -0
- package/skills/quality-gate/LICENSE.txt +26 -0
- package/skills/quality-gate/SKILL.md +44 -0
- package/skills/quality-gate/agents/openai.yaml +7 -0
- package/skills/quality-gate/references/review-checklist.md +42 -0
- package/skills/revisar/SKILL.md +11 -0
- package/skills/revisar-skill/LICENSE-find-skills.txt +26 -0
- package/skills/revisar-skill/SKILL.md +94 -0
- package/skills/revision-cruzada/SKILL.md +59 -0
- package/skills/web-design-guidelines/AGENTS.md +156 -0
- package/skills/web-design-guidelines/LICENSE.txt +21 -0
- package/skills/web-design-guidelines/SKILL.md +29 -0
- package/src/agent-models.js +131 -0
- package/src/brand.js +117 -0
- package/src/claude-code-runner.js +642 -0
- package/src/cli-executable.js +88 -0
- package/src/cli.js +778 -0
- package/src/client-adapter-plan.js +271 -0
- package/src/client-auth-diagnostic-parser.js +211 -0
- package/src/client-auth-diagnostic.js +257 -0
- package/src/client-isolated-variant.js +106 -0
- package/src/client-isolated-verification.js +130 -0
- package/src/client-local-platform.js +14 -0
- package/src/client-managed-preferences-invocation.js +209 -0
- package/src/client-managed-preferences.js +78 -0
- package/src/client-native-access.js +134 -0
- package/src/client-native-diagnostics.js +253 -0
- package/src/client-native-evaluation.js +106 -0
- package/src/client-native-preflight-files.js +68 -0
- package/src/client-native-preflight.js +95 -0
- package/src/client-output-json.js +118 -0
- package/src/client-output-parser.js +278 -0
- package/src/client-runtime-admission.js +80 -0
- package/src/client-runtime-coordinator.js +70 -0
- package/src/client-runtime-core.js +92 -0
- package/src/client-runtime-fixture-permit.js +20 -0
- package/src/client-runtime-fixture-protocol.js +39 -0
- package/src/client-runtime-state.js +67 -0
- package/src/client-runtime-store-files.js +91 -0
- package/src/client-runtime-store.js +239 -0
- package/src/client-runtime-supervisor.js +146 -0
- package/src/client-selective-config.js +195 -0
- package/src/client-selective-files.js +126 -0
- package/src/client-supervised-codes.js +32 -0
- package/src/client-supervised-contract.js +52 -0
- package/src/client-supervised-coordinator.js +36 -0
- package/src/client-supervised-permit.js +20 -0
- package/src/client-supervised-protocol.js +37 -0
- package/src/client-supervised-store.js +167 -0
- package/src/client-supervised-supervisor.js +167 -0
- package/src/client-supervised.js +160 -0
- package/src/codex-cli-runner.js +358 -0
- package/src/codex-delivery.js +101 -0
- package/src/connect.js +703 -0
- package/src/doctor.js +795 -0
- package/src/gemini-cli.js +76 -0
- package/src/gemini-files.js +45 -0
- package/src/gemini-tools.js +249 -0
- package/src/init.js +473 -0
- package/src/install-lock.js +127 -0
- package/src/install-registry.js +61 -0
- package/src/legacy-repair.js +71 -0
- package/src/level-agents.js +111 -0
- package/src/link-states.js +172 -0
- package/src/memory-connection-artifacts.js +192 -0
- package/src/memory-connection-descriptor.js +158 -0
- package/src/memory-connection-diagnostic.js +177 -0
- package/src/memory-connection-files.js +191 -0
- package/src/memory-connection-manifest.js +118 -0
- package/src/memory-connection-package.js +176 -0
- package/src/memory-connection-plan.js +211 -0
- package/src/memory-connection-skill.js +211 -0
- package/src/memory-connection-toml.js +153 -0
- package/src/memory-locator.js +118 -0
- package/src/memory-mcp-policy.js +181 -0
- package/src/memory-mcp-server.js +166 -0
- package/src/memory-mcp-transport.js +59 -0
- package/src/missing-dependencies.js +21 -0
- package/src/model-command.js +147 -0
- package/src/model-preference.js +235 -0
- package/src/model-selection.js +368 -0
- package/src/native/managed-preferences.c +100 -0
- package/src/native/managed-preferences.h +17 -0
- package/src/package-lock-path.js +13 -0
- package/src/panel-cli.js +182 -0
- package/src/peer-handoff.js +27 -0
- package/src/peer-inbox-cli.js +211 -0
- package/src/peer-review-mcp.js +210 -0
- package/src/peer-review-store.js +532 -0
- package/src/platform.js +24 -0
- package/src/project-root.js +41 -0
- package/src/project-signals.js +339 -0
- package/src/recommend-report.js +77 -0
- package/src/review-instructions.js +211 -0
- package/src/review-policy.js +35 -0
- package/src/revision-adapters.js +157 -0
- package/src/revision-context.js +86 -0
- package/src/revision-isolation.js +222 -0
- package/src/revision-process.js +103 -0
- package/src/revision-provenance.js +89 -0
- package/src/revision-snapshot.js +120 -0
- package/src/revision.js +242 -0
- package/src/runtime-fixtures/runtime-supervisor/child.cjs +3 -0
- package/src/runtime-fixtures/runtime-supervisor/fixture.cjs +49 -0
- package/src/runtime-fixtures/supervised/child.cjs +3 -0
- package/src/runtime-fixtures/supervised/fixture.cjs +47 -0
- package/src/sensitive-data.js +21 -0
- package/src/setup-apply.js +231 -0
- package/src/setup-plan.js +231 -0
- package/src/setup-state.js +277 -0
- package/src/setup-tui.js +555 -0
- package/src/skill-catalog-add.js +91 -0
- package/src/skill-catalog-audit.js +68 -0
- package/src/skill-catalog.js +170 -0
- package/src/skill-files.js +39 -0
- package/src/skill-recommendations.js +1673 -0
- package/src/skill-scan-report.js +14 -0
- package/src/skill-scan.js +178 -0
- package/src/stable-command.js +53 -0
- package/src/stable-install.js +222 -0
- package/src/status.js +200 -0
- package/src/superpowers.js +133 -0
- package/src/sync-apply.js +227 -0
- package/src/sync-files.js +109 -0
- package/src/sync-inspect.js +394 -0
- package/src/sync-ledger.js +94 -0
- package/src/sync-markdown.js +151 -0
- package/src/sync-proposal.js +84 -0
- package/src/sync-record.js +459 -0
- package/src/sync.js +360 -0
- package/src/task-approvals.js +367 -0
- package/src/task-cli.js +79 -0
- package/src/task-external-verifier.js +584 -0
- package/src/task-prepare-files.js +115 -0
- package/src/task-prepare.js +180 -0
- package/src/task-verify-cli.js +67 -0
- package/src/task-verify-files.js +188 -0
- package/src/task-verify.js +118 -0
- package/src/task-workflow-mcp.js +544 -0
- package/src/task-workflow-store.js +254 -0
- package/src/terminal-text.js +68 -0
- package/src/toolkit-cli.js +543 -0
- package/src/toolkit-commands-guide.js +107 -0
- package/src/toolkit-setup.js +614 -0
- package/src/usage-metrics.js +43 -0
- package/templates/agent-team/01-encargo.md +158 -0
- package/templates/agent-team/02-propuesta.md +132 -0
- package/templates/agent-team/03-revision.md +150 -0
- package/templates/agent-team/README.md +213 -0
- package/templates/model-inventory/01-inventario.md +154 -0
- package/templates/model-inventory/README.md +115 -0
- package/templates/project-memory/README.md +67 -0
- package/templates/project-memory/project-memory.example.json +53 -0
- package/templates/project-memory/skill/project-id/SKILL.md +37 -0
- package/templates/project-memory/skill/project-id/references/project-profile.md +44 -0
- package/templates/project-memory/vault/00-INICIO/Estado actual.md +44 -0
- package/templates/project-memory/vault/00-INICIO/Fuentes de verdad.md +30 -0
- package/templates/project-memory/vault/00-INICIO/Inicio del proyecto.md +44 -0
- package/templates/project-memory/vault/00-INICIO/Mantenimiento de la memoria.md +26 -0
- package/templates/project-memory/vault/00-INICIO/Mapa de la memoria.md +33 -0
- package/templates/project-memory/vault/00-INICIO/Registro de sincronizaci/303/263n.md" +28 -0
- package/templates/project-memory/vault/01-PRODUCTO/Producto.md +16 -0
- package/templates/project-memory/vault/02-ARQUITECTURA/Arquitectura.md +16 -0
- package/templates/project-memory/vault/03-IMPLEMENTACION/Implementaci/303/263n.md +15 -0
- package/templates/project-memory/vault/04-DECISIONES/Decisiones.md +19 -0
- package/templates/project-memory/vault/05-ENTREGAS/Entregas.md +12 -0
- package/templates/project-memory/vault/06-OPERACION/Operaci/303/263n.md +15 -0
- package/templates/project-memory/vault/07-AGENTES/Protocolo de agentes.md +33 -0
- package/templates/project-memory/vault/08-RECURSOS/Recursos.md +12 -0
- package/templates/project-memory/vault/09-ARCHIVO/README.md +5 -0
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import { runCli } from './cli.js';
|
|
3
|
+
import { runModelCommand } from './model-command.js';
|
|
4
|
+
import { runPanelCommand } from './panel-cli.js';
|
|
5
|
+
import { runRevisionCommand } from './revision.js';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import readline from 'node:readline';
|
|
8
|
+
import { pathToFileURL } from 'node:url';
|
|
9
|
+
import { resolveProjectRoot } from './project-root.js';
|
|
10
|
+
import { loadSkillCatalog } from './skill-catalog.js';
|
|
11
|
+
import { scanSkillDirectory } from './skill-scan.js';
|
|
12
|
+
import { formatScanReport } from './skill-scan-report.js';
|
|
13
|
+
import {
|
|
14
|
+
applyToolkitDetach,
|
|
15
|
+
formatDetachReport,
|
|
16
|
+
inspectSkillProject,
|
|
17
|
+
planToolkitDetach,
|
|
18
|
+
recommendSkills,
|
|
19
|
+
} from './skill-recommendations.js';
|
|
20
|
+
import { formatRecommendationReport } from './recommend-report.js';
|
|
21
|
+
import { applySetup } from './setup-apply.js';
|
|
22
|
+
import { buildConfirmation, suggestedAnswers } from './setup-plan.js';
|
|
23
|
+
import { gatherSetupState } from './setup-state.js';
|
|
24
|
+
import { runSetupTui } from './setup-tui.js';
|
|
25
|
+
import { doctorToolkit, setupToolkit } from './toolkit-setup.js';
|
|
26
|
+
import { applyLegacyRepair, planLegacyRepair } from './legacy-repair.js';
|
|
27
|
+
import { READY_LINK_STATES, REMOVED_BY_USER_STATE, SETTLED_LINK_STATES } from './link-states.js';
|
|
28
|
+
|
|
29
|
+
const PROFILE_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u;
|
|
30
|
+
const SKILL_NAME_RE = /^[a-z0-9-]+$/u;
|
|
31
|
+
const RECOMMEND_PROFILES = ['frontend', 'backend', 'mcp', 'security'];
|
|
32
|
+
|
|
33
|
+
const HELP = `Uso: npx nexakit [--project <ruta>] [--si]
|
|
34
|
+
npx nexakit comprobar [--agent codex|claude|antigravity|all] [--perfil-codex <nombre>] [--json]
|
|
35
|
+
npx nexakit quitar [--project <ruta>] [--global] [--agent codex|claude|antigravity|all] [--si|--apply] [--json]
|
|
36
|
+
npx nexakit reparar --desde <ruta> [--agent codex|claude|antigravity|all]
|
|
37
|
+
npx nexakit memoria <subcomando> [opciones]
|
|
38
|
+
nexakit revision --disponibles [--principal claude|codex|antigravity]
|
|
39
|
+
nexakit revision --con <ia> --modelo <m> --esfuerzo <e> --encargo <archivo> [--base <rama>]
|
|
40
|
+
nexakit modelo [--nivel <nivel>] [--ia claude|codex|antigravity] [--perfil-codex <nombre>]
|
|
41
|
+
nexakit panel [--demo] [--una-vez]
|
|
42
|
+
npx nexakit recommend [--project <ruta>] [--profile frontend|backend|mcp|security] [--client codex|claude] [--dry-run] [--json]
|
|
43
|
+
npx nexakit scan <carpeta de skill> [--json]
|
|
44
|
+
npx nexakit doctor [--agent codex|claude|antigravity|all] [--perfil-codex <nombre>] [--json]
|
|
45
|
+
npx nexakit setup [--agent codex|claude|antigravity|all] [--perfil-codex <nombre>] [--omitir <skill>] [--reponer <skill>] [--apply] [--json]
|
|
46
|
+
|
|
47
|
+
npx nexakit hace tres preguntas con la respuesta ya sugerida (skills, memoria e IA)
|
|
48
|
+
y, con una sola confirmación, deja listo el proyecto: skills, memoria conectada a
|
|
49
|
+
tus IA y la orden ~/.nexakit/nexakit. Si todo está listo, no pregunta nada.
|
|
50
|
+
Sin terminal interactiva muestra lo que haría; --si lo aplica sin preguntas.
|
|
51
|
+
comprobar (o doctor) revisa en solo lectura Node, tus IA, skills base y restos antiguos.
|
|
52
|
+
quitar (o detach) retira las skills del proyecto, .agent-toolkit/ y su bloque de
|
|
53
|
+
.gitignore sin tocar archivos tuyos (--si o --apply para ejecutar; --global incluye las globales).
|
|
54
|
+
scan revisa el contenido de una skill sin ejecutarla (1 si encuentra un bloqueo).
|
|
55
|
+
reparar re-apunta enlaces rotos de una instalación anterior (--desde es la carpeta
|
|
56
|
+
que ya no existe); lista lo que encontró y siempre pregunta.
|
|
57
|
+
memoria ejecuta los subcomandos de project-memory (init, connect, doctor, status, sync).
|
|
58
|
+
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
|
+
recommend inspecciona el proyecto en solo lectura; setup prepara las skills base globales y respeta las que quitaste
|
|
61
|
+
(--omitir <skill> declara quitada una que ya no tiene enlace; --reponer <skill> devuelve una; ambos se repiten).
|
|
62
|
+
(Alias local compatible: agent-toolkit)
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
export async function runToolkitCli(
|
|
66
|
+
argv,
|
|
67
|
+
{ out, err, input = process.stdin, output = process.stdout, isTTY, options = {} } = {},
|
|
68
|
+
) {
|
|
69
|
+
if (argv.length === 1 && ['--help', '-h'].includes(argv[0])) {
|
|
70
|
+
await out(HELP);
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (argv.length === 0 || argv[0] === 'tui' || argv[0].startsWith('--')) {
|
|
75
|
+
const rest = argv[0] === 'tui' ? argv.slice(1) : argv;
|
|
76
|
+
const parsed = { projectRoot: process.cwd(), yes: false };
|
|
77
|
+
const seen = new Set();
|
|
78
|
+
for (let i = 0; i < rest.length; i++) {
|
|
79
|
+
const flag = rest[i];
|
|
80
|
+
if (seen.has(flag)) {
|
|
81
|
+
await err(HELP);
|
|
82
|
+
return 2;
|
|
83
|
+
}
|
|
84
|
+
seen.add(flag);
|
|
85
|
+
if (flag === '--project' && rest[i + 1]) parsed.projectRoot = rest[++i];
|
|
86
|
+
else if (flag === '--si') parsed.yes = true;
|
|
87
|
+
else {
|
|
88
|
+
await err(HELP);
|
|
89
|
+
return 2;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return runSetup(parsed, { out, err, input, output, isTTY, options });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const [command, ...rest] = argv;
|
|
96
|
+
if (command === 'modelo') return runModelCommand(rest, { out, err }, options);
|
|
97
|
+
if (command === 'revision') return runRevisionCommand(rest, { out, err }, { options });
|
|
98
|
+
if (command === 'panel') return runPanelCommand(rest, { out, err, input, output, isTTY, options });
|
|
99
|
+
if (command === 'memoria') {
|
|
100
|
+
return runCli(
|
|
101
|
+
rest,
|
|
102
|
+
{
|
|
103
|
+
out: (message) => out(`${message}\n`),
|
|
104
|
+
err: (message) => err(`${message}\n`),
|
|
105
|
+
},
|
|
106
|
+
{ ...options, commandName: 'npx nexakit memoria' },
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (command === 'scan') {
|
|
111
|
+
const flags = rest.filter(arg => arg.startsWith('--'));
|
|
112
|
+
const dirs = rest.filter(arg => !arg.startsWith('--'));
|
|
113
|
+
if (dirs.length !== 1 || flags.some(flag => flag !== '--json') || flags.length > 1) {
|
|
114
|
+
await err(HELP);
|
|
115
|
+
return 2;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
const report = await scanSkillDirectory(dirs[0]);
|
|
119
|
+
await out(flags.length ? JSON.stringify(report, null, 2) + '\n' : formatScanReport(report, dirs[0]));
|
|
120
|
+
return report.blocked ? 1 : 0;
|
|
121
|
+
} catch (error) {
|
|
122
|
+
await err(`No se pudo escanear ${dirs[0]}: ${error.code === 'ENOENT' ? 'la carpeta no existe' : error.message}\n`);
|
|
123
|
+
return 2;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (command === 'recommend') {
|
|
128
|
+
const parsed = { projectRoot: process.cwd(), json: false };
|
|
129
|
+
const seen = new Set();
|
|
130
|
+
for (let i = 0; i < rest.length; i++) {
|
|
131
|
+
const flag = rest[i];
|
|
132
|
+
if (seen.has(flag)) {
|
|
133
|
+
await err(HELP);
|
|
134
|
+
return 2;
|
|
135
|
+
}
|
|
136
|
+
seen.add(flag);
|
|
137
|
+
if (flag === '--project' && rest[i + 1]) parsed.projectRoot = rest[++i];
|
|
138
|
+
else if (flag === '--profile' && RECOMMEND_PROFILES.includes(rest[i + 1])) parsed.profile = rest[++i];
|
|
139
|
+
else if (flag === '--client' && ['codex', 'claude'].includes(rest[i + 1])) parsed.client = rest[++i];
|
|
140
|
+
else if (flag === '--dry-run') parsed.dryRun = true;
|
|
141
|
+
else if (flag === '--json') parsed.json = true;
|
|
142
|
+
else {
|
|
143
|
+
await err(HELP);
|
|
144
|
+
return 2;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
const catalogUrl = options.toolkitRoot
|
|
149
|
+
? pathToFileURL(path.join(options.toolkitRoot, 'catalogs/skills.json'))
|
|
150
|
+
: undefined;
|
|
151
|
+
const catalog = await loadSkillCatalog(catalogUrl ? { catalogUrl } : {});
|
|
152
|
+
const inspection = await inspectSkillProject(parsed.projectRoot, {
|
|
153
|
+
...(parsed.client && { client: parsed.client }),
|
|
154
|
+
...(options.toolkitRoot && { toolkitRoot: options.toolkitRoot }),
|
|
155
|
+
catalog,
|
|
156
|
+
});
|
|
157
|
+
const report = recommendSkills({
|
|
158
|
+
catalog,
|
|
159
|
+
inspection,
|
|
160
|
+
...(parsed.profile && { profile: parsed.profile }),
|
|
161
|
+
...(parsed.client && { client: parsed.client }),
|
|
162
|
+
});
|
|
163
|
+
await out(parsed.json ? JSON.stringify(report) + '\n' : formatRecommendationReport(report));
|
|
164
|
+
return 0;
|
|
165
|
+
} catch {
|
|
166
|
+
await err('No se pudo analizar el proyecto o cargar el catálogo confiable de skills.\n');
|
|
167
|
+
return 2;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (command === 'reparar') return runRepair(rest, { out, err, input, output, isTTY, options });
|
|
172
|
+
|
|
173
|
+
if (command === 'detach' || command === 'unlink' || command === 'quitar') {
|
|
174
|
+
const parsed = { projectRoot: process.cwd(), agent: 'all', global: false, apply: false, json: false };
|
|
175
|
+
const seen = new Set();
|
|
176
|
+
for (let i = 0; i < rest.length; i++) {
|
|
177
|
+
const flag = rest[i];
|
|
178
|
+
if (seen.has(flag)) {
|
|
179
|
+
await err(HELP);
|
|
180
|
+
return 2;
|
|
181
|
+
}
|
|
182
|
+
seen.add(flag);
|
|
183
|
+
if (flag === '--project' && rest[i + 1]) parsed.projectRoot = rest[++i];
|
|
184
|
+
else if (flag === '--agent' && ['codex', 'claude', 'antigravity', 'all'].includes(rest[i + 1]))
|
|
185
|
+
parsed.agent = rest[++i];
|
|
186
|
+
else if (flag === '--global') parsed.global = true;
|
|
187
|
+
else if (flag === '--apply' || flag === '--si') parsed.apply = true;
|
|
188
|
+
else if (flag === '--json') parsed.json = true;
|
|
189
|
+
else {
|
|
190
|
+
await err(HELP);
|
|
191
|
+
return 2;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
const catalogUrl = options.toolkitRoot
|
|
196
|
+
? pathToFileURL(path.join(options.toolkitRoot, 'catalogs/skills.json'))
|
|
197
|
+
: undefined;
|
|
198
|
+
const catalog = await loadSkillCatalog(catalogUrl ? { catalogUrl } : {});
|
|
199
|
+
// Skills are installed at the repository root, so they are removed from there too.
|
|
200
|
+
const { root } = await resolveProjectRoot(
|
|
201
|
+
parsed.projectRoot,
|
|
202
|
+
options.homeDirectory ? { homeDirectory: options.homeDirectory } : {},
|
|
203
|
+
);
|
|
204
|
+
const plan = await planToolkitDetach({
|
|
205
|
+
projectRoot: root,
|
|
206
|
+
includeGlobal: parsed.global,
|
|
207
|
+
environment: options.environment ?? (options.homeDirectory ? {} : process.env),
|
|
208
|
+
agent: parsed.agent,
|
|
209
|
+
catalog,
|
|
210
|
+
...(options.toolkitRoot && { toolkitRoot: options.toolkitRoot }),
|
|
211
|
+
...(options.homeDirectory && { homeDirectory: options.homeDirectory }),
|
|
212
|
+
...(options.codexHome && { codexHome: options.codexHome }),
|
|
213
|
+
});
|
|
214
|
+
const report = parsed.apply ? await applyToolkitDetach(plan) : plan;
|
|
215
|
+
if (parsed.json) {
|
|
216
|
+
const cleanJson = {
|
|
217
|
+
applied: report.applied,
|
|
218
|
+
reviewInstructions: report.reviewInstructions ?? [],
|
|
219
|
+
projectRoot: report.projectRoot,
|
|
220
|
+
includeGlobal: report.includeGlobal,
|
|
221
|
+
items: report.items.map(({ catalogEntry, ...itemRest }) => itemRest),
|
|
222
|
+
...(report.applied
|
|
223
|
+
? {
|
|
224
|
+
removedCount: report.removedCount,
|
|
225
|
+
gitIgnoreCleanedCount: report.gitIgnoreCleanedCount,
|
|
226
|
+
stateDirRemoved: report.stateDirRemoved,
|
|
227
|
+
}
|
|
228
|
+
: {
|
|
229
|
+
removeStateDir: report.removeStateDir,
|
|
230
|
+
removeLegacyLockfile: report.removeLegacyLockfile,
|
|
231
|
+
gitIgnoreUpdates: report.gitIgnoreUpdates,
|
|
232
|
+
}),
|
|
233
|
+
conflicts: report.conflicts,
|
|
234
|
+
manualCommands: report.manualCommands,
|
|
235
|
+
};
|
|
236
|
+
await out(JSON.stringify(cleanJson) + '\n');
|
|
237
|
+
} else {
|
|
238
|
+
await out(formatDetachReport(report));
|
|
239
|
+
}
|
|
240
|
+
return report.conflicts ? 1 : 0;
|
|
241
|
+
} catch {
|
|
242
|
+
await err('No se pudo inspeccionar o desacoplar el proyecto. Revisa la ruta y los permisos.\n');
|
|
243
|
+
return 1;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (!['doctor', 'comprobar', 'setup'].includes(command)) {
|
|
248
|
+
await err(HELP);
|
|
249
|
+
return 2;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const parsed = { agent: 'all' };
|
|
253
|
+
const seen = new Set();
|
|
254
|
+
for (let i = 0; i < rest.length; i++) {
|
|
255
|
+
const flag = rest[i];
|
|
256
|
+
if ((flag === '--reponer' || flag === '--omitir') && command === 'setup') {
|
|
257
|
+
const name = rest[i + 1] ?? '';
|
|
258
|
+
if (!SKILL_NAME_RE.test(name)) {
|
|
259
|
+
await err(HELP);
|
|
260
|
+
return 2;
|
|
261
|
+
}
|
|
262
|
+
(parsed[flag === '--reponer' ? 'restore' : 'omit'] ??= []).push(name);
|
|
263
|
+
i++;
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
if (seen.has(flag)) {
|
|
267
|
+
await err(HELP);
|
|
268
|
+
return 2;
|
|
269
|
+
}
|
|
270
|
+
seen.add(flag);
|
|
271
|
+
if (flag === '--agent' && ['codex', 'claude', 'antigravity', 'all'].includes(rest[i + 1]))
|
|
272
|
+
parsed.agent = rest[++i];
|
|
273
|
+
else if (flag === '--json') parsed.json = true;
|
|
274
|
+
else if (flag === '--perfil-codex' && PROFILE_RE.test(rest[i + 1] ?? '')) parsed.codexProfile = rest[++i];
|
|
275
|
+
else if (flag === '--apply' && command === 'setup') parsed.apply = true;
|
|
276
|
+
else {
|
|
277
|
+
await err(HELP);
|
|
278
|
+
return 2;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
const result = await (command === 'setup' ? setupToolkit : doctorToolkit)({ ...options, ...parsed });
|
|
283
|
+
if (command === 'comprobar' && !parsed.json) {
|
|
284
|
+
await out(formatComprobarReport(result, { homeDirectory: options.homeDirectory ?? os.homedir() }));
|
|
285
|
+
} else {
|
|
286
|
+
await out(JSON.stringify(result, null, parsed.json ? 0 : 2) + '\n');
|
|
287
|
+
}
|
|
288
|
+
if (command === 'setup') return result.conflicts ? 1 : 0;
|
|
289
|
+
if (command === 'comprobar') {
|
|
290
|
+
return result.node.supported &&
|
|
291
|
+
Object.values(result.dependencies).every(Boolean) &&
|
|
292
|
+
Object.values(result.clients).some((c) => c.available) &&
|
|
293
|
+
result.skills.every((s) => SETTLED_LINK_STATES.includes(s.state)) &&
|
|
294
|
+
!(result.retiredSkills ?? []).some((s) => !s.owned) &&
|
|
295
|
+
superpowersReady(result)
|
|
296
|
+
? 0
|
|
297
|
+
: 1;
|
|
298
|
+
}
|
|
299
|
+
return result.node.supported &&
|
|
300
|
+
Object.values(result.dependencies).every(Boolean) &&
|
|
301
|
+
Object.values(result.clients).every((c) => c.available) &&
|
|
302
|
+
Object.values(result.mcp).every((m) => READY_LINK_STATES.includes(m.state)) &&
|
|
303
|
+
result.skills.every((s) => SETTLED_LINK_STATES.includes(s.state)) &&
|
|
304
|
+
(!result.codexSandbox || ['allowed', 'not-needed', 'unknown'].includes(result.codexSandbox.state)) &&
|
|
305
|
+
superpowersReady(result)
|
|
306
|
+
? 0
|
|
307
|
+
: 1;
|
|
308
|
+
} catch {
|
|
309
|
+
await err(
|
|
310
|
+
'No se pudo inspeccionar o instalar. Revisa rutas, permisos y conflictos; no se reemplazan destinos.\n',
|
|
311
|
+
);
|
|
312
|
+
return 1;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
317
|
+
// Required: missing or disabled fails the check; a list that could not be read is reported but does not fail.
|
|
318
|
+
const superpowersReady = (result) =>
|
|
319
|
+
!Object.values(result.superpowers?.states ?? {}).some((state) => ['falta', 'desactivado'].includes(state));
|
|
320
|
+
|
|
321
|
+
function formatComprobarReport(result, { homeDirectory }) {
|
|
322
|
+
const short = (value) =>
|
|
323
|
+
value === homeDirectory ||
|
|
324
|
+
value.startsWith(homeDirectory + '/') ||
|
|
325
|
+
value.startsWith(homeDirectory + '\\')
|
|
326
|
+
? `~${value.slice(homeDirectory.length)}`
|
|
327
|
+
: value;
|
|
328
|
+
const lines = [
|
|
329
|
+
result.node.supported
|
|
330
|
+
? `✓ Node.js ${result.node.version}`
|
|
331
|
+
: `! Node.js ${result.node.version} (se necesita Node.js 24 o superior)`,
|
|
332
|
+
];
|
|
333
|
+
const missingDeps = Object.entries(result.dependencies)
|
|
334
|
+
.filter(([, ok]) => !ok)
|
|
335
|
+
.map(([name]) => name);
|
|
336
|
+
lines.push(
|
|
337
|
+
missingDeps.length === 0
|
|
338
|
+
? '✓ Dependencias instaladas'
|
|
339
|
+
: `! Faltan dependencias: ${missingDeps.join(', ')}`,
|
|
340
|
+
);
|
|
341
|
+
const availableClients = Object.entries(result.clients)
|
|
342
|
+
.filter(([, state]) => state.available)
|
|
343
|
+
.map(([name]) => name);
|
|
344
|
+
lines.push(
|
|
345
|
+
availableClients.length > 0
|
|
346
|
+
? `✓ IA disponibles: ${availableClients.join(', ')}`
|
|
347
|
+
: '! No encontré ninguna IA instalada (claude, codex o agy)',
|
|
348
|
+
);
|
|
349
|
+
const readySkills = result.skills.filter((s) => READY_LINK_STATES.includes(s.state));
|
|
350
|
+
const removedSkills = result.skills.filter((s) => s.state === REMOVED_BY_USER_STATE);
|
|
351
|
+
const pendingSkills = result.skills.filter((s) => !SETTLED_LINK_STATES.includes(s.state));
|
|
352
|
+
if (pendingSkills.length === 0) {
|
|
353
|
+
lines.push(`✓ Skills base listas (${readySkills.length})`);
|
|
354
|
+
} else {
|
|
355
|
+
lines.push(
|
|
356
|
+
`! ${plural(pendingSkills.length, 'enlace de skill base pendiente o con problema', 'enlaces de skills base pendientes o con problema')} (ejecuta npx nexakit para revisarlos)`,
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
if (removedSkills.length > 0) {
|
|
360
|
+
lines.push(
|
|
361
|
+
`✓ ${plural(removedSkills.length, 'skill que quitaste', 'skills que quitaste')} (nexakit no las recrea; para devolver una: npx nexakit setup --reponer <nombre> --apply)`,
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
for (const group of result.legacy ?? []) {
|
|
365
|
+
lines.push(
|
|
366
|
+
`! ${plural(group.count, 'enlace roto', 'enlaces rotos')} hacia ${short(group.root)} parecen de una instalación anterior. Si son de nexakit: npx nexakit reparar --desde ${short(group.root)}`,
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
for (const item of (result.retiredSkills ?? []).filter((s) => !s.owned)) {
|
|
370
|
+
lines.push(`! ${item.client} · ${item.name}: comando retirado con contenido ajeno; no lo toco`);
|
|
371
|
+
}
|
|
372
|
+
const superpowers = Object.entries(result.superpowers?.states ?? {});
|
|
373
|
+
const active = superpowers.filter(([, state]) => state === 'activo').map(([name]) => name);
|
|
374
|
+
if (active.length) lines.push(`✓ Superpowers activo en ${active.join(', ')}`);
|
|
375
|
+
for (const [name, state] of superpowers.filter(([, state]) => state !== 'activo')) {
|
|
376
|
+
lines.push(
|
|
377
|
+
state === 'falta'
|
|
378
|
+
? `! Falta Superpowers en ${name} (ejecuta npx nexakit para instalarlo)`
|
|
379
|
+
: state === 'desactivado'
|
|
380
|
+
? `! Superpowers está desactivado en ${name}; actívalo desde su gestor de plugins`
|
|
381
|
+
: `! No pude comprobar Superpowers en ${name}`,
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
for (const item of result.obsolete ?? []) {
|
|
385
|
+
lines.push(`! ${item.message} ${item.command}`);
|
|
386
|
+
}
|
|
387
|
+
return lines.join('\n') + '\n';
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Reads one line, and treats anything but "s" (including no answer at all) as no. The answer comes from the
|
|
391
|
+
// `line` event, which always precedes `close`, so an input that ends right after the answer is not lost.
|
|
392
|
+
async function askYesNo(input, output) {
|
|
393
|
+
const rl = readline.createInterface({ input, ...(output?.isTTY && { output }) });
|
|
394
|
+
try {
|
|
395
|
+
const answer = await new Promise((resolve) => {
|
|
396
|
+
let answered = false;
|
|
397
|
+
rl.once('line', (line) => {
|
|
398
|
+
answered = true;
|
|
399
|
+
resolve(line);
|
|
400
|
+
});
|
|
401
|
+
rl.once('close', () => {
|
|
402
|
+
if (!answered) resolve('');
|
|
403
|
+
});
|
|
404
|
+
});
|
|
405
|
+
return /^s(í|i)?$/iu.test(answer.trim());
|
|
406
|
+
} finally {
|
|
407
|
+
rl.close();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
async function runRepair(rest, { out, err, input, output, isTTY, options }) {
|
|
412
|
+
const parsed = { agent: 'all' };
|
|
413
|
+
const seen = new Set();
|
|
414
|
+
for (let i = 0; i < rest.length; i++) {
|
|
415
|
+
const flag = rest[i];
|
|
416
|
+
if (flag === '--si') {
|
|
417
|
+
await err('reparar siempre pregunta; no admite --si.\n');
|
|
418
|
+
return 2;
|
|
419
|
+
}
|
|
420
|
+
if (seen.has(flag)) {
|
|
421
|
+
await err(HELP);
|
|
422
|
+
return 2;
|
|
423
|
+
}
|
|
424
|
+
seen.add(flag);
|
|
425
|
+
if (flag === '--desde' && rest[i + 1]) parsed.from = rest[++i];
|
|
426
|
+
else if (flag === '--agent' && ['codex', 'claude', 'antigravity', 'all'].includes(rest[i + 1]))
|
|
427
|
+
parsed.agent = rest[++i];
|
|
428
|
+
else {
|
|
429
|
+
await err(HELP);
|
|
430
|
+
return 2;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (!parsed.from) {
|
|
434
|
+
await err(HELP);
|
|
435
|
+
return 2;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const home = options.homeDirectory ?? os.homedir();
|
|
439
|
+
const short = (value) =>
|
|
440
|
+
value === home || value.startsWith(home + path.sep) ? `~${value.slice(home.length)}` : value;
|
|
441
|
+
try {
|
|
442
|
+
const plan = await planLegacyRepair({ ...options, ...parsed });
|
|
443
|
+
const from = short(plan.from);
|
|
444
|
+
if (plan.links.length === 0) {
|
|
445
|
+
await out(`No encontré enlaces rotos hacia ${from}.\n`);
|
|
446
|
+
return 0;
|
|
447
|
+
}
|
|
448
|
+
await out(
|
|
449
|
+
[
|
|
450
|
+
`Encontré ${plural(plan.links.length, 'enlace roto', 'enlaces rotos')} hacia ${from}.`,
|
|
451
|
+
'No puedo comprobar que sean de nexakit: revisa la lista.',
|
|
452
|
+
...plan.links.map((link) => ` ${link.client} · ${link.name}`),
|
|
453
|
+
'',
|
|
454
|
+
].join('\n'),
|
|
455
|
+
);
|
|
456
|
+
const interactive = Boolean(isTTY ?? (input?.isTTY && output?.isTTY));
|
|
457
|
+
if (!interactive) {
|
|
458
|
+
await err('Este comando necesita una terminal interactiva.\n');
|
|
459
|
+
return 2;
|
|
460
|
+
}
|
|
461
|
+
await out('¿Los re-apunto a la copia de nexakit en uso? [s/N]\n');
|
|
462
|
+
if (!(await askYesNo(input, output))) {
|
|
463
|
+
await out('No se cambió nada.\n');
|
|
464
|
+
return 0;
|
|
465
|
+
}
|
|
466
|
+
const result = await applyLegacyRepair(plan, options);
|
|
467
|
+
const lines = [`Listo: ${plural(result.repaired, 'enlace re-apuntado', 'enlaces re-apuntados')}.`];
|
|
468
|
+
if (result.changed)
|
|
469
|
+
lines.push(
|
|
470
|
+
`${plural(result.changed, 'enlace cambió', 'enlaces cambiaron')} mientras confirmabas y no se tocó; vuelve a ejecutar el comando.`,
|
|
471
|
+
);
|
|
472
|
+
if (result.skipped.length)
|
|
473
|
+
lines.push(`No se repararon ${result.skipped.join(', ')}: la copia en uso no las incluye.`);
|
|
474
|
+
if (result.mcpCommands.length) {
|
|
475
|
+
lines.push(
|
|
476
|
+
'El MCP de revisión cruzada también apunta ahí. Para moverlo ejecuta:',
|
|
477
|
+
...result.mcpCommands.map((command) => ` ${command}`),
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
if (result.repaired) lines.push('Reinicia tus agentes para que carguen las skills.');
|
|
481
|
+
await out(lines.join('\n') + '\n');
|
|
482
|
+
return result.changed || result.skipped.length ? 1 : 0;
|
|
483
|
+
} catch {
|
|
484
|
+
await err('No se pudo comprobar ni reparar. Revisa rutas y permisos; no se reemplazan destinos.\n');
|
|
485
|
+
return 1;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Options tests and callers pass (homeDirectory, toolkitRoot, codexHome, environment, runCommand, runNpm, ...).
|
|
490
|
+
function setupStateOptions(projectRoot, options) {
|
|
491
|
+
const { runNpm, packageSpec, acquire, ...rest } = options;
|
|
492
|
+
return {
|
|
493
|
+
stateOptions: { ...rest, start: projectRoot },
|
|
494
|
+
applyOptions: {
|
|
495
|
+
...(runNpm && { runNpm }),
|
|
496
|
+
...(packageSpec && { packageSpec }),
|
|
497
|
+
...(acquire && { acquire }),
|
|
498
|
+
},
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
async function runSetup(parsed, { out, err, input, output, isTTY, options }) {
|
|
503
|
+
const { stateOptions, applyOptions } = setupStateOptions(parsed.projectRoot, options);
|
|
504
|
+
const interactive = Boolean(isTTY ?? (input?.isTTY && output?.isTTY));
|
|
505
|
+
try {
|
|
506
|
+
if (interactive && !parsed.yes)
|
|
507
|
+
return await runSetupTui({ input, output, options: stateOptions, applyOptions });
|
|
508
|
+
const state = await gatherSetupState(stateOptions);
|
|
509
|
+
const answers = suggestedAnswers(state);
|
|
510
|
+
const confirmation = buildConfirmation(state, answers);
|
|
511
|
+
const title = `nexakit · ${state.project.displayName}${state.project.fromSubfolder ? ' (repositorio completo)' : ''}`;
|
|
512
|
+
if (confirmation.allReady) {
|
|
513
|
+
await out(
|
|
514
|
+
`${title}\nTodo está listo.\n${confirmation.lines.map((line) => ` ${line.mark} ${line.text}`).join('\n')}\n`,
|
|
515
|
+
);
|
|
516
|
+
return 0;
|
|
517
|
+
}
|
|
518
|
+
if (!parsed.yes) {
|
|
519
|
+
await out(
|
|
520
|
+
`${title}\nCon las respuestas sugeridas prepararía:\n${confirmation.lines.map((line) => ` ${line.mark} ${line.text}`).join('\n')}\n\n` +
|
|
521
|
+
'No hay una terminal interactiva para preguntarte.\nPara aplicarlo sin preguntas: npx nexakit --si\n',
|
|
522
|
+
);
|
|
523
|
+
return 2;
|
|
524
|
+
}
|
|
525
|
+
await out(`${title}\n`);
|
|
526
|
+
const labels = Object.fromEntries(confirmation.blocks.map((block) => [block.id, block.label]));
|
|
527
|
+
const result = await applySetup(stateOptions, answers, {
|
|
528
|
+
...applyOptions,
|
|
529
|
+
onProgress: async (id, phase, message) => {
|
|
530
|
+
// The final check prints its own line with the result, below.
|
|
531
|
+
if (phase === 'done' && id !== 'final-check') await out(` ◇ ${labels[id] ?? id}\n`);
|
|
532
|
+
if (phase === 'failed') await err(` ✗ ${labels[id] ?? id}: ${message}\n`);
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
if (result.finalCheck)
|
|
536
|
+
await out(` ${result.finalCheck.ok ? '◇' : '!'} Comprobación final: ${result.finalCheck.message}\n`);
|
|
537
|
+
if (result.ok) await out('Listo. Cierra y abre tu IA para que cargue las skills y la memoria.\n');
|
|
538
|
+
return result.ok ? 0 : 1;
|
|
539
|
+
} catch (error) {
|
|
540
|
+
await err(`No se pudo preparar el proyecto: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
541
|
+
return 1;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export function getToolkitCommandsGuide({ clients = {} } = {}) {
|
|
2
|
+
const claudeActive = clients.claude?.available !== false;
|
|
3
|
+
const codexActive = clients.codex?.available !== false;
|
|
4
|
+
const antigravityActive = clients.antigravity?.available !== false;
|
|
5
|
+
|
|
6
|
+
const workflowCommands = [
|
|
7
|
+
{
|
|
8
|
+
id: 'superpowers:brainstorming',
|
|
9
|
+
claude: '/superpowers:brainstorming',
|
|
10
|
+
codex: '$superpowers:brainstorming',
|
|
11
|
+
antigravity: '/brainstorming',
|
|
12
|
+
stage: '1. Diseñar',
|
|
13
|
+
description: 'Superpowers: entiende la intención, compara alternativas y deja un diseño aprobado.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 'superpowers:writing-plans',
|
|
17
|
+
claude: '/superpowers:writing-plans',
|
|
18
|
+
codex: '$superpowers:writing-plans',
|
|
19
|
+
antigravity: '/writing-plans',
|
|
20
|
+
stage: '2. Planificar',
|
|
21
|
+
description: 'Superpowers: plan ejecutable con rutas exactas, pruebas y pasos verificables.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'superpowers:test-driven-development',
|
|
25
|
+
claude: '/superpowers:test-driven-development',
|
|
26
|
+
codex: '$superpowers:test-driven-development',
|
|
27
|
+
antigravity: '/test-driven-development',
|
|
28
|
+
stage: '2b. TDD',
|
|
29
|
+
description: 'Superpowers: ciclo Rojo → Verde → Refactorizar comprobando primero el fallo esperado.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'superpowers:systematic-debugging',
|
|
33
|
+
claude: '/superpowers:systematic-debugging',
|
|
34
|
+
codex: '$superpowers:systematic-debugging',
|
|
35
|
+
antigravity: '/systematic-debugging',
|
|
36
|
+
stage: '2c. Diagnóstico',
|
|
37
|
+
description: 'Superpowers: aísla la causa raíz reproducible antes de proponer un parche.',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'quality-gate',
|
|
41
|
+
claude: '/quality-gate',
|
|
42
|
+
codex: '$quality-gate',
|
|
43
|
+
antigravity: '/quality-gate',
|
|
44
|
+
stage: '3. Verificar',
|
|
45
|
+
description: 'Puerta de nexakit antes de PR o revisión: requisitos, seguridad y diff, sobre la evidencia de Superpowers.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'revisar',
|
|
49
|
+
claude: '/revisar',
|
|
50
|
+
codex: '$revisar',
|
|
51
|
+
antigravity: '/revisar',
|
|
52
|
+
stage: '4. Revisión par',
|
|
53
|
+
description: 'Pide una revisión adicional a otra IA desde esta terminal.',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'cerrar-memoria',
|
|
57
|
+
claude: '/cerrar-memoria',
|
|
58
|
+
codex: '$cerrar-memoria',
|
|
59
|
+
antigravity: '/cerrar-memoria',
|
|
60
|
+
stage: 'Cierre',
|
|
61
|
+
description: 'Prepara resumen de sesión y cambios propuestos para memoria.',
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const cliCommands = [
|
|
66
|
+
{
|
|
67
|
+
command: 'npx nexakit',
|
|
68
|
+
description: 'Abre el asistente de tres preguntas y deja listo el proyecto (--si aplica sin preguntar).',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
command: 'npx nexakit comprobar',
|
|
72
|
+
description: 'Comprueba en solo lectura Node, las tres IA, las skills base y los restos antiguos.',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
command: 'npx nexakit quitar --si',
|
|
76
|
+
description: 'Retira las skills del proyecto, .agent-toolkit/ y su bloque de .gitignore sin tocar lo tuyo.',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
command: 'npx nexakit scan <carpeta de skill>',
|
|
80
|
+
description: 'Revisa el contenido de una skill sin ejecutarla y avisa de lo sospechoso.',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
command: 'npx nexakit reparar --desde <ruta>',
|
|
84
|
+
description: 'Re-apunta enlaces antiguos rotos tras mostrar la lista y pedir confirmación.',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
command: 'npx nexakit memoria <subcomando>',
|
|
88
|
+
description: 'Ejecuta init, connect, doctor, status o sync sobre la bóveda de memoria.',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
command: 'nexakit revision --disponibles',
|
|
92
|
+
description: 'Consulta las IA disponibles y certificadas o lanza una revisión en solo lectura.',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
command: 'nexakit modelo',
|
|
96
|
+
description: 'Consulta modelos reales, esfuerzos y valores guardados.',
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
claudeActive,
|
|
102
|
+
codexActive,
|
|
103
|
+
antigravityActive,
|
|
104
|
+
workflowCommands,
|
|
105
|
+
cliCommands,
|
|
106
|
+
};
|
|
107
|
+
}
|