@zenrick/zenkit 0.0.0-stage → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +19 -0
- package/.cursor-plugin/marketplace.json +22 -0
- package/INSTALL.md +73 -0
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +69 -3
- package/TERMS.md +48 -0
- package/THIRD-PARTY-NOTICES.md +109 -0
- package/kit/agents/backend-specialist.md +263 -0
- package/kit/agents/code-archaeologist.md +106 -0
- package/kit/agents/database-architect.md +226 -0
- package/kit/agents/debugger.md +226 -0
- package/kit/agents/devops-engineer.md +242 -0
- package/kit/agents/documentation-writer.md +104 -0
- package/kit/agents/explorer-agent.md +73 -0
- package/kit/agents/frontend-specialist.md +593 -0
- package/kit/agents/game-developer.md +162 -0
- package/kit/agents/mobile-developer.md +377 -0
- package/kit/agents/orchestrator.md +489 -0
- package/kit/agents/penetration-tester.md +188 -0
- package/kit/agents/performance-optimizer.md +187 -0
- package/kit/agents/product-manager.md +112 -0
- package/kit/agents/product-owner.md +95 -0
- package/kit/agents/project-planner.md +409 -0
- package/kit/agents/qa-automation-engineer.md +103 -0
- package/kit/agents/security-auditor.md +170 -0
- package/kit/agents/seo-specialist.md +111 -0
- package/kit/agents/test-engineer.md +158 -0
- package/kit/bundles/agent-building.yaml +26 -0
- package/kit/bundles/backend-data.yaml +14 -0
- package/kit/bundles/base.yaml +10 -0
- package/kit/bundles/core.yaml +21 -0
- package/kit/bundles/kit-engenharia.yaml +8 -0
- package/kit/bundles/kit-lite.yaml +9 -0
- package/kit/bundles/security.yaml +11 -0
- package/kit/bundles/ship-run.yaml +16 -0
- package/kit/bundles/web-ui.yaml +18 -0
- package/kit/commands/docs.md +33 -0
- package/kit/commands/explain.md +41 -0
- package/kit/commands/fix.md +65 -0
- package/kit/commands/implement.md +35 -0
- package/kit/commands/refactor.md +59 -0
- package/kit/commands/review.md +55 -0
- package/kit/commands/test.md +63 -0
- package/kit/modules/bridge/rules/cross-ide-bridge.mdc +73 -0
- package/kit/modules/bridge/zenkit-layer.yaml +1 -0
- package/kit/modules/nexuscore/sections/convivencia.md +12 -0
- package/kit/modules/nexuscore/sections/memoria.md +9 -0
- package/kit/modules/nexuscore/skills/quadro-agentes/SKILL.md +186 -0
- package/kit/modules/nexuscore/zenkit-layer.yaml +1 -0
- package/kit/rules/ZENKIT.mdc +294 -0
- package/kit/rules/git.mdc +51 -0
- package/kit/rules/karpathy-guidelines.mdc +70 -0
- package/kit/rules/model-routing.mdc +89 -0
- package/kit/rules/security-headers.mdc +41 -0
- package/kit/rules/social-automation.mdc +69 -0
- package/kit/rules/toc.mdc +40 -0
- package/kit/skills/api-patterns/SKILL.md +95 -0
- package/kit/skills/api-patterns/api-style.md +42 -0
- package/kit/skills/api-patterns/auth.md +24 -0
- package/kit/skills/api-patterns/documentation.md +26 -0
- package/kit/skills/api-patterns/graphql.md +41 -0
- package/kit/skills/api-patterns/rate-limiting.md +31 -0
- package/kit/skills/api-patterns/references/backend/backend-api-design.md +495 -0
- package/kit/skills/api-patterns/references/backend/backend-architecture.md +454 -0
- package/kit/skills/api-patterns/references/backend/backend-authentication.md +338 -0
- package/kit/skills/api-patterns/references/backend/backend-code-quality.md +659 -0
- package/kit/skills/api-patterns/references/backend/backend-debugging.md +904 -0
- package/kit/skills/api-patterns/references/backend/backend-devops.md +494 -0
- package/kit/skills/api-patterns/references/backend/backend-mindset.md +387 -0
- package/kit/skills/api-patterns/references/backend/backend-performance.md +397 -0
- package/kit/skills/api-patterns/references/backend/backend-security.md +290 -0
- package/kit/skills/api-patterns/references/backend/backend-technologies.md +256 -0
- package/kit/skills/api-patterns/references/backend/backend-testing.md +429 -0
- package/kit/skills/api-patterns/response.md +37 -0
- package/kit/skills/api-patterns/rest.md +40 -0
- package/kit/skills/api-patterns/scripts/api_validator.py +211 -0
- package/kit/skills/api-patterns/security-testing.md +122 -0
- package/kit/skills/api-patterns/trpc.md +41 -0
- package/kit/skills/api-patterns/versioning.md +22 -0
- package/kit/skills/app-builder/SKILL.md +76 -0
- package/kit/skills/app-builder/agent-coordination.md +71 -0
- package/kit/skills/app-builder/feature-building.md +53 -0
- package/kit/skills/app-builder/project-detection.md +34 -0
- package/kit/skills/app-builder/scaffolding.md +118 -0
- package/kit/skills/app-builder/tech-stack.md +41 -0
- package/kit/skills/app-builder/templates/SKILL.md +39 -0
- package/kit/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/kit/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/kit/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/kit/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/kit/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/kit/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/kit/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/kit/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/kit/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/kit/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/kit/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/kit/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/kit/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/kit/skills/architecture/SKILL.md +56 -0
- package/kit/skills/architecture/context-discovery.md +43 -0
- package/kit/skills/architecture/examples.md +94 -0
- package/kit/skills/architecture/pattern-selection.md +68 -0
- package/kit/skills/architecture/patterns-reference.md +50 -0
- package/kit/skills/architecture/trade-off-analysis.md +77 -0
- package/kit/skills/bash-linux/SKILL.md +203 -0
- package/kit/skills/batch-operations/SKILL.md +112 -0
- package/kit/skills/behavioral-modes/SKILL.md +255 -0
- package/kit/skills/brainstorming/SKILL.md +189 -0
- package/kit/skills/brainstorming/dynamic-questioning.md +350 -0
- package/kit/skills/brainstorming/references/problem-solving/attribution.md +69 -0
- package/kit/skills/brainstorming/references/problem-solving/collision-zone-thinking.md +79 -0
- package/kit/skills/brainstorming/references/problem-solving/inversion-exercise.md +91 -0
- package/kit/skills/brainstorming/references/problem-solving/meta-pattern-recognition.md +87 -0
- package/kit/skills/brainstorming/references/problem-solving/scale-game.md +95 -0
- package/kit/skills/brainstorming/references/problem-solving/simplification-cascades.md +80 -0
- package/kit/skills/brainstorming/references/problem-solving/when-stuck.md +72 -0
- package/kit/skills/claude-exec/SKILL.md +185 -0
- package/kit/skills/clean-code/SKILL.md +210 -0
- package/kit/skills/code-review-checklist/SKILL.md +115 -0
- package/kit/skills/code-review-graph/SKILL.md +50 -0
- package/kit/skills/code-review-graph/references/alternatives-comparison.md +12 -0
- package/kit/skills/code-review-graph/references/best-practices.md +9 -0
- package/kit/skills/code-review-graph/references/configuration.md +43 -0
- package/kit/skills/code-review-graph/references/core-workflows.md +61 -0
- package/kit/skills/code-review-graph/references/how-it-works-4-layers.md +20 -0
- package/kit/skills/code-review-graph/references/installation.md +67 -0
- package/kit/skills/code-review-graph/references/integration-with-zenkit.md +23 -0
- package/kit/skills/code-review-graph/references/known-limitations.md +13 -0
- package/kit/skills/code-review-graph/references/when-to-use-vs-when-to-skip.md +21 -0
- package/kit/skills/codex-exec/SKILL.md +161 -0
- package/kit/skills/context-compression/SKILL.md +145 -0
- package/kit/skills/coordinator-mode/SKILL.md +215 -0
- package/kit/skills/cursor-exec/SKILL.md +152 -0
- package/kit/skills/database-design/SKILL.md +53 -0
- package/kit/skills/database-design/database-selection.md +43 -0
- package/kit/skills/database-design/indexing.md +39 -0
- package/kit/skills/database-design/migrations.md +48 -0
- package/kit/skills/database-design/optimization.md +36 -0
- package/kit/skills/database-design/orm-selection.md +30 -0
- package/kit/skills/database-design/schema-design.md +56 -0
- package/kit/skills/database-design/scripts/schema_validator.py +172 -0
- package/kit/skills/deployment-procedures/SKILL.md +242 -0
- package/kit/skills/deprecation-and-migration/SKILL.md +149 -0
- package/kit/skills/documentation-templates/SKILL.md +195 -0
- package/kit/skills/entrega-com-agentes/SKILL.md +177 -0
- package/kit/skills/frontend-design/NOTICE.md +6 -0
- package/kit/skills/frontend-design/SKILL.md +456 -0
- package/kit/skills/frontend-design/animation-guide.md +331 -0
- package/kit/skills/frontend-design/color-system.md +311 -0
- package/kit/skills/frontend-design/decision-trees.md +418 -0
- package/kit/skills/frontend-design/motion-graphics.md +306 -0
- package/kit/skills/frontend-design/references/aesthetic/design-guideline-template.md +163 -0
- package/kit/skills/frontend-design/references/aesthetic/design-principles.md +62 -0
- package/kit/skills/frontend-design/references/aesthetic/design-resources.md +75 -0
- package/kit/skills/frontend-design/references/aesthetic/design-story-template.md +135 -0
- package/kit/skills/frontend-design/references/aesthetic/micro-interactions.md +53 -0
- package/kit/skills/frontend-design/references/aesthetic/storytelling-design.md +50 -0
- package/kit/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/kit/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/kit/skills/frontend-design/typography-system.md +345 -0
- package/kit/skills/frontend-design/ux-psychology.md +1116 -0
- package/kit/skills/frontend-design/visual-effects.md +383 -0
- package/kit/skills/game-development/2d-games/SKILL.md +119 -0
- package/kit/skills/game-development/3d-games/SKILL.md +135 -0
- package/kit/skills/game-development/SKILL.md +168 -0
- package/kit/skills/game-development/game-art/SKILL.md +185 -0
- package/kit/skills/game-development/game-audio/SKILL.md +190 -0
- package/kit/skills/game-development/game-design/SKILL.md +129 -0
- package/kit/skills/game-development/mobile-games/SKILL.md +108 -0
- package/kit/skills/game-development/multiplayer/SKILL.md +132 -0
- package/kit/skills/game-development/pc-games/SKILL.md +144 -0
- package/kit/skills/game-development/vr-ar/SKILL.md +123 -0
- package/kit/skills/game-development/web-games/SKILL.md +150 -0
- package/kit/skills/gemini-exec/SKILL.md +80 -0
- package/kit/skills/geo-fundamentals/SKILL.md +157 -0
- package/kit/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/kit/skills/git-worktrees/SKILL.md +107 -0
- package/kit/skills/i18n-localization/SKILL.md +145 -0
- package/kit/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/kit/skills/intelligent-routing/SKILL.md +128 -0
- package/kit/skills/intelligent-routing/references/4-response-format.md +16 -0
- package/kit/skills/intelligent-routing/references/complexity-assessment.md +29 -0
- package/kit/skills/intelligent-routing/references/debug-intelligent-routing.md +9 -0
- package/kit/skills/intelligent-routing/references/debugging-agent-selection.md +7 -0
- package/kit/skills/intelligent-routing/references/domain-detection-rules.md +29 -0
- package/kit/skills/intelligent-routing/references/edge-cases.md +29 -0
- package/kit/skills/intelligent-routing/references/implementation-rules.md +35 -0
- package/kit/skills/intelligent-routing/references/integration-with-existing-workflows.md +21 -0
- package/kit/skills/intelligent-routing/references/performance-considerations.md +14 -0
- package/kit/skills/intelligent-routing/references/summary.md +16 -0
- package/kit/skills/intelligent-routing/references/testing-the-system.md +36 -0
- package/kit/skills/intelligent-routing/references/tier-0-automatic-analysis-always-active.md +27 -0
- package/kit/skills/intelligent-routing/references/user-education.md +12 -0
- package/kit/skills/karpathy-guidelines/SKILL.md +67 -0
- package/kit/skills/karpathy-guidelines/references/EXAMPLES.md +522 -0
- package/kit/skills/lint-and-validate/SKILL.md +46 -0
- package/kit/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/kit/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/kit/skills/mcp-atuacao/SKILL.md +238 -0
- package/kit/skills/mcp-builder/NOTICE.md +6 -0
- package/kit/skills/mcp-builder/SKILL.md +259 -0
- package/kit/skills/memory-system/SKILL.md +181 -0
- package/kit/skills/mobile-design/SKILL.md +395 -0
- package/kit/skills/mobile-design/decision-trees.md +516 -0
- package/kit/skills/mobile-design/mobile-backend.md +491 -0
- package/kit/skills/mobile-design/mobile-color-system.md +420 -0
- package/kit/skills/mobile-design/mobile-debugging.md +122 -0
- package/kit/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/kit/skills/mobile-design/mobile-navigation.md +458 -0
- package/kit/skills/mobile-design/mobile-performance.md +767 -0
- package/kit/skills/mobile-design/mobile-testing.md +356 -0
- package/kit/skills/mobile-design/mobile-typography.md +433 -0
- package/kit/skills/mobile-design/platform-android.md +666 -0
- package/kit/skills/mobile-design/platform-ios.md +561 -0
- package/kit/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/kit/skills/mobile-design/touch-psychology.md +537 -0
- package/kit/skills/negocio-agente-conversa/SKILL.md +168 -0
- package/kit/skills/negocio-atendimento/SKILL.md +134 -0
- package/kit/skills/negocio-linguagem/SKILL.md +166 -0
- package/kit/skills/negocio-preco/SKILL.md +174 -0
- package/kit/skills/negocio-preco/scripts/preco.mjs +160 -0
- package/kit/skills/negocio-qualificacao/SKILL.md +140 -0
- package/kit/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/kit/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/kit/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/kit/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/kit/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/kit/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/kit/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/kit/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/kit/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/kit/skills/nextjs-react-expert/SKILL.md +308 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/common-patterns.md +331 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/complete-examples.md +872 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/component-patterns.md +502 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/data-fetching.md +767 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/file-organization.md +502 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/loading-and-error-states.md +501 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/performance.md +406 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/routing-guide.md +364 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/styling-guide.md +428 -0
- package/kit/skills/nextjs-react-expert/resources/app-patterns/typescript-standards.md +418 -0
- package/kit/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/kit/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/kit/skills/nodejs-best-practices/SKILL.md +78 -0
- package/kit/skills/nodejs-best-practices/references/10-anti-patterns-to-avoid.md +21 -0
- package/kit/skills/nodejs-best-practices/references/11-decision-checklist.md +14 -0
- package/kit/skills/nodejs-best-practices/references/2-runtime-considerations-2025.md +36 -0
- package/kit/skills/nodejs-best-practices/references/3-architecture-principles.md +35 -0
- package/kit/skills/nodejs-best-practices/references/4-error-handling-principles.md +42 -0
- package/kit/skills/nodejs-best-practices/references/5-async-patterns-principles.md +35 -0
- package/kit/skills/nodejs-best-practices/references/6-validation-principles.md +29 -0
- package/kit/skills/nodejs-best-practices/references/7-security-principles.md +29 -0
- package/kit/skills/nodejs-best-practices/references/8-testing-principles.md +28 -0
- package/kit/skills/observability-and-instrumentation/SKILL.md +150 -0
- package/kit/skills/opencode-go-exec/SKILL.md +101 -0
- package/kit/skills/parallel-agents/SKILL.md +184 -0
- package/kit/skills/performance-profiling/SKILL.md +145 -0
- package/kit/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/kit/skills/plan-writing/SKILL.md +213 -0
- package/kit/skills/powershell-windows/SKILL.md +196 -0
- package/kit/skills/provider-orchestration/SKILL.md +269 -0
- package/kit/skills/python-patterns/SKILL.md +80 -0
- package/kit/skills/python-patterns/references/10-decision-checklist.md +14 -0
- package/kit/skills/python-patterns/references/11-anti-patterns-to-avoid.md +20 -0
- package/kit/skills/python-patterns/references/2-async-vs-sync-decision.md +44 -0
- package/kit/skills/python-patterns/references/3-type-hints-strategy.md +56 -0
- package/kit/skills/python-patterns/references/4-project-structure-principles.md +56 -0
- package/kit/skills/python-patterns/references/5-django-principles-2025.md +40 -0
- package/kit/skills/python-patterns/references/6-fastapi-principles.md +50 -0
- package/kit/skills/python-patterns/references/7-background-tasks.md +31 -0
- package/kit/skills/python-patterns/references/8-error-handling-principles.md +29 -0
- package/kit/skills/python-patterns/references/9-testing-principles.md +37 -0
- package/kit/skills/red-team-tactics/SKILL.md +201 -0
- package/kit/skills/research/SKILL.md +166 -0
- package/kit/skills/rust-pro/SKILL.md +177 -0
- package/kit/skills/seo-fundamentals/SKILL.md +130 -0
- package/kit/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/kit/skills/sequential-thinking/.env.example +8 -0
- package/kit/skills/sequential-thinking/README.md +183 -0
- package/kit/skills/sequential-thinking/SKILL.md +95 -0
- package/kit/skills/sequential-thinking/package.json +31 -0
- package/kit/skills/sequential-thinking/references/advanced-strategies.md +79 -0
- package/kit/skills/sequential-thinking/references/advanced-techniques.md +76 -0
- package/kit/skills/sequential-thinking/references/core-patterns.md +95 -0
- package/kit/skills/sequential-thinking/references/examples-api.md +88 -0
- package/kit/skills/sequential-thinking/references/examples-architecture.md +94 -0
- package/kit/skills/sequential-thinking/references/examples-debug.md +90 -0
- package/kit/skills/sequential-thinking/scripts/format-thought.js +159 -0
- package/kit/skills/sequential-thinking/scripts/process-thought.js +236 -0
- package/kit/skills/server-management/SKILL.md +162 -0
- package/kit/skills/simplify-code/SKILL.md +133 -0
- package/kit/skills/skillify/SKILL.md +116 -0
- package/kit/skills/system-design-interview/SKILL.md +268 -0
- package/kit/skills/systematic-debugging/SKILL.md +110 -0
- package/kit/skills/tailwind-patterns/SKILL.md +283 -0
- package/kit/skills/tailwind-patterns/references/shadcn-ui/canvas-design-system.md +320 -0
- package/kit/skills/tailwind-patterns/references/shadcn-ui/shadcn-accessibility.md +471 -0
- package/kit/skills/tailwind-patterns/references/shadcn-ui/shadcn-components.md +424 -0
- package/kit/skills/tailwind-patterns/references/shadcn-ui/shadcn-theming.md +373 -0
- package/kit/skills/tailwind-patterns/references/shadcn-ui/tailwind-customization.md +483 -0
- package/kit/skills/tailwind-patterns/references/shadcn-ui/tailwind-responsive.md +382 -0
- package/kit/skills/tailwind-patterns/references/shadcn-ui/tailwind-utilities.md +455 -0
- package/kit/skills/tdd-workflow/SKILL.md +150 -0
- package/kit/skills/testing-patterns/SKILL.md +196 -0
- package/kit/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/kit/skills/ui-ux-pro-max/SKILL.md +135 -0
- package/kit/skills/verify-changes/SKILL.md +125 -0
- package/kit/skills/vulnerability-scanner/SKILL.md +278 -0
- package/kit/skills/vulnerability-scanner/checklists.md +121 -0
- package/kit/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/kit/skills/web-design-guidelines/SKILL.md +58 -0
- package/kit/skills/webapp-testing/NOTICE.md +6 -0
- package/kit/skills/webapp-testing/SKILL.md +188 -0
- package/kit/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/kit/workflows/brainstorm.md +113 -0
- package/kit/workflows/coordinate.md +72 -0
- package/kit/workflows/create.md +59 -0
- package/kit/workflows/debug.md +103 -0
- package/kit/workflows/deploy.md +176 -0
- package/kit/workflows/enhance.md +63 -0
- package/kit/workflows/orchestrate.md +237 -0
- package/kit/workflows/plan.md +89 -0
- package/kit/workflows/preview.md +81 -0
- package/kit/workflows/remember.md +67 -0
- package/kit/workflows/status.md +86 -0
- package/kit/workflows/test.md +144 -0
- package/kit/workflows/ui-ux-pro-max.md +296 -0
- package/kit/workflows/verify.md +72 -0
- package/licenses/Apache-2.0.txt +202 -0
- package/package.json +60 -6
- package/scripts/archive-codex-rollouts.ps1 +35 -0
- package/scripts/avaliar-vigilancia-mandato.mjs +38 -0
- package/scripts/bundle.mjs +170 -0
- package/scripts/check-deps.mjs +178 -0
- package/scripts/check-models.mjs +150 -0
- package/scripts/cli.mjs +313 -0
- package/scripts/content-checks.mjs +18 -0
- package/scripts/continuidade-mandato.mjs +47 -0
- package/scripts/discriminar-turno.mjs +191 -0
- package/scripts/doctor.mjs +611 -0
- package/scripts/generate.mjs +688 -0
- package/scripts/install.mjs +11 -0
- package/scripts/layer-remote.mjs +407 -0
- package/scripts/layers.mjs +208 -0
- package/scripts/marketplace.mjs +77 -0
- package/scripts/product.mjs +32 -0
- package/scripts/ruleset-core.mjs +68 -0
- package/scripts/social-hooks.mjs +293 -0
- package/scripts/social-pacer.mjs +219 -0
- package/scripts/validate-bundles.mjs +14 -0
- package/scripts/validate-skills.mjs +174 -0
- package/scripts/zenkit-daemon-task.cmd +3 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* check-deps.mjs — every dependency needs an upper bound on its major version
|
|
4
|
+
* and every project needs a lockfile. A floating `mcp>=1.0` once took Kyron
|
|
5
|
+
* down on a cold build (DEM-ZNK-DEP-01); this gate fails before that happens.
|
|
6
|
+
*
|
|
7
|
+
* Usage: node scripts/check-deps.mjs [repoDir...] (default: cwd)
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
10
|
+
import { join, relative, resolve } from "node:path";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
12
|
+
|
|
13
|
+
const NPM_LOCKS = ["package-lock.json", "npm-shrinkwrap.json", "pnpm-lock.yaml", "yarn.lock", "bun.lock", "bun.lockb"];
|
|
14
|
+
const PY_LOCKS = ["uv.lock", "poetry.lock", "pdm.lock", "Pipfile.lock", "requirements.lock"];
|
|
15
|
+
const NPM_SECTIONS = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"];
|
|
16
|
+
const SKIP_DIRS = new Set(["node_modules", ".git", "dist", "build", ".venv", "venv", "__pycache__"]);
|
|
17
|
+
|
|
18
|
+
/** True when an npm range cannot float to a new major. */
|
|
19
|
+
export function npmSpecBounded(spec) {
|
|
20
|
+
const s = String(spec).trim();
|
|
21
|
+
if (/^(workspace:|file:|link:|git|github:|https?:|npm:)/.test(s)) return true;
|
|
22
|
+
if (s === "" || s === "*" || /^(latest|next|x)$/i.test(s)) return false;
|
|
23
|
+
return s.split("||").every((part) => {
|
|
24
|
+
const p = part.trim();
|
|
25
|
+
if (p === "" || p === "*" || /^x$/i.test(p)) return false;
|
|
26
|
+
if (/^[~^]/.test(p)) return true;
|
|
27
|
+
if (/</.test(p)) return true;
|
|
28
|
+
if (/^>/.test(p)) return false;
|
|
29
|
+
// Bare versions: 1, 1.x, 1.2.x, 1.2.3 all stay inside one major.
|
|
30
|
+
return /^=?v?\d+(\.(\d+|x|\*))*([-+].*)?$/i.test(p) || /^\d+(\.\d+)*\s+-\s+\d/.test(p);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** True when a PEP 508 requirement cannot float to a new major. */
|
|
35
|
+
export function pySpecBounded(req) {
|
|
36
|
+
const r = String(req).split(";")[0].trim();
|
|
37
|
+
if (r === "" || r.startsWith("#") || r.startsWith("-")) return true;
|
|
38
|
+
if (/\s@\s/.test(r)) return true; // direct URL reference
|
|
39
|
+
const spec = r.replace(/^[A-Za-z0-9._-]+(\[[^\]]*\])?/, "").trim();
|
|
40
|
+
if (spec === "") return false;
|
|
41
|
+
return /<|~=|===?/.test(spec);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readJson(path) {
|
|
45
|
+
try {
|
|
46
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
47
|
+
} catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function workspaceDirs(root, pkg) {
|
|
53
|
+
const globs = Array.isArray(pkg?.workspaces) ? pkg.workspaces : pkg?.workspaces?.packages ?? [];
|
|
54
|
+
const dirs = [];
|
|
55
|
+
for (const g of globs) {
|
|
56
|
+
if (!g.endsWith("/*")) {
|
|
57
|
+
dirs.push(join(root, g));
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const base = join(root, g.slice(0, -2));
|
|
61
|
+
if (!existsSync(base)) continue;
|
|
62
|
+
for (const d of readdirSync(base)) {
|
|
63
|
+
const full = join(base, d);
|
|
64
|
+
if (statSync(full).isDirectory()) dirs.push(full);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return dirs;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Quoted strings inside every `<key> = [ ... ]` array of a pyproject. */
|
|
71
|
+
export function pyprojectRequirements(text) {
|
|
72
|
+
const reqs = [];
|
|
73
|
+
const arrays = text.matchAll(/^\s*([A-Za-z0-9_-]+)\s*=\s*\[((?:[^\[\]"'#]|"[^"]*"|'[^']*'|#[^\n]*)*)\]/gm);
|
|
74
|
+
for (const m of arrays) {
|
|
75
|
+
const before = text.slice(0, m.index);
|
|
76
|
+
const header = [...before.matchAll(/^\s*\[([^\]]+)\]\s*$/gm)].pop()?.[1] ?? "";
|
|
77
|
+
const isDeps =
|
|
78
|
+
(header === "project" && m[1] === "dependencies") ||
|
|
79
|
+
header === "project.optional-dependencies" ||
|
|
80
|
+
header === "dependency-groups";
|
|
81
|
+
if (!isDeps) continue;
|
|
82
|
+
for (const q of m[2].replace(/#[^\n]*/g, "").matchAll(/"([^"]+)"|'([^']+)'/g)) reqs.push(q[1] ?? q[2]);
|
|
83
|
+
}
|
|
84
|
+
return reqs;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function requirementsFiles(root) {
|
|
88
|
+
return readdirSync(root).filter((f) => /^requirements.*\.(txt|in)$/.test(f));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function isPinnedRequirementsFile(path) {
|
|
92
|
+
const lines = readFileSync(path, "utf8")
|
|
93
|
+
.split("\n")
|
|
94
|
+
.map((l) => l.split("#")[0].trim())
|
|
95
|
+
.filter((l) => l && !l.startsWith("-"));
|
|
96
|
+
return lines.length > 0 && lines.every((l) => /==/.test(l) || /\s@\s/.test(l));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Returns a list of human-readable problems for one repository. */
|
|
100
|
+
export function checkRepo(root) {
|
|
101
|
+
const problems = [];
|
|
102
|
+
const rel = (p) => relative(root, p) || ".";
|
|
103
|
+
|
|
104
|
+
const rootPkg = readJson(join(root, "package.json"));
|
|
105
|
+
if (rootPkg) {
|
|
106
|
+
if (!NPM_LOCKS.some((f) => existsSync(join(root, f)))) {
|
|
107
|
+
problems.push(`package.json: missing lockfile (${NPM_LOCKS.join(" | ")})`);
|
|
108
|
+
}
|
|
109
|
+
for (const dir of [root, ...workspaceDirs(root, rootPkg)]) {
|
|
110
|
+
const pkg = dir === root ? rootPkg : readJson(join(dir, "package.json"));
|
|
111
|
+
if (!pkg) continue;
|
|
112
|
+
for (const section of NPM_SECTIONS) {
|
|
113
|
+
for (const [name, spec] of Object.entries(pkg[section] ?? {})) {
|
|
114
|
+
if (!npmSpecBounded(spec)) {
|
|
115
|
+
problems.push(`${rel(join(dir, "package.json"))}: ${section}.${name} "${spec}" has no major cap`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const pyproject = join(root, "pyproject.toml");
|
|
123
|
+
const reqFiles = requirementsFiles(root);
|
|
124
|
+
if (existsSync(pyproject)) {
|
|
125
|
+
for (const req of pyprojectRequirements(readFileSync(pyproject, "utf8"))) {
|
|
126
|
+
if (!pySpecBounded(req)) problems.push(`pyproject.toml: "${req}" has no major cap`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
for (const f of reqFiles) {
|
|
130
|
+
for (const line of readFileSync(join(root, f), "utf8").split("\n")) {
|
|
131
|
+
const req = line.split("#")[0].trim();
|
|
132
|
+
if (req && !pySpecBounded(req)) problems.push(`${f}: "${req}" has no major cap`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (existsSync(pyproject) || reqFiles.length > 0) {
|
|
136
|
+
const locked =
|
|
137
|
+
PY_LOCKS.some((f) => existsSync(join(root, f))) ||
|
|
138
|
+
reqFiles.some((f) => f.endsWith(".txt") && isPinnedRequirementsFile(join(root, f)));
|
|
139
|
+
if (!locked) problems.push(`python: missing lockfile (${PY_LOCKS.join(" | ")} or fully pinned requirements*.txt)`);
|
|
140
|
+
}
|
|
141
|
+
return problems;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Nested projects (e.g. ops/<tool>/package.json) are checked too. */
|
|
145
|
+
export function projectRoots(root, depth = 3) {
|
|
146
|
+
const roots = [];
|
|
147
|
+
const walk = (dir, d) => {
|
|
148
|
+
const names = readdirSync(dir);
|
|
149
|
+
if (names.includes("package.json") || names.includes("pyproject.toml")) roots.push(dir);
|
|
150
|
+
if (d === 0) return;
|
|
151
|
+
for (const n of names) {
|
|
152
|
+
if (SKIP_DIRS.has(n) || n.startsWith(".")) continue;
|
|
153
|
+
const full = join(dir, n);
|
|
154
|
+
if (statSync(full).isDirectory()) walk(full, d - 1);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
walk(root, depth);
|
|
158
|
+
// Workspace members are covered by their root's check.
|
|
159
|
+
return roots.filter((r) => !roots.some((o) => o !== r && r.startsWith(o) && readJson(join(o, "package.json"))?.workspaces));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
|
|
163
|
+
const targets = process.argv.slice(2).length ? process.argv.slice(2) : ["."];
|
|
164
|
+
let total = 0;
|
|
165
|
+
for (const t of targets) {
|
|
166
|
+
const repo = resolve(t);
|
|
167
|
+
for (const root of projectRoots(repo)) {
|
|
168
|
+
const problems = checkRepo(root);
|
|
169
|
+
total += problems.length;
|
|
170
|
+
for (const p of problems) console.error(` - ${relative(repo, root) || "."}: ${p}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (total > 0) {
|
|
174
|
+
console.error(`⛔ ${total} dependency problem(s). Cap every dependency below its next major and commit a lockfile.`);
|
|
175
|
+
process.exit(1);
|
|
176
|
+
}
|
|
177
|
+
console.log("✅ every dependency has a major cap and every project has a lockfile.");
|
|
178
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* check-models.mjs — finds LLM model ids hard-coded in a repository and checks
|
|
4
|
+
* each one against the provider's live model list, so a retired model is
|
|
5
|
+
* reported here instead of as a 404 in production (DEM-ZNK-DEP-01).
|
|
6
|
+
*
|
|
7
|
+
* Usage: node scripts/check-models.mjs [--json] [repoDir...]
|
|
8
|
+
* Keys (optional, read from env, never printed): ANTHROPIC_API_KEY,
|
|
9
|
+
* OPENAI_API_KEY, GEMINI_API_KEY, DEEPSEEK_API_KEY, MOONSHOT_API_KEY.
|
|
10
|
+
* A provider without a key is reported as "unverified", not as a failure.
|
|
11
|
+
*/
|
|
12
|
+
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
13
|
+
import { extname, join, relative, resolve } from "node:path";
|
|
14
|
+
import { pathToFileURL } from "node:url";
|
|
15
|
+
|
|
16
|
+
// Tests carry made-up ids on purpose (pricing tables, parser fixtures); only shipped code can 404.
|
|
17
|
+
const SKIP_DIRS = new Set(["node_modules", ".git", "dist", "build", ".venv", "venv", "__pycache__", "coverage", "tests", "test", "__tests__", "fixtures"]);
|
|
18
|
+
const TEST_FILE = /(^test_.*\.py$|_test\.py$|\.(test|spec)\.[cm]?[jt]sx?$)/;
|
|
19
|
+
const SCAN_EXT = new Set([".ts", ".tsx", ".js", ".mjs", ".cjs", ".py", ".json", ".yaml", ".yml", ".toml", ".env", ".example", ".sh"]);
|
|
20
|
+
const SKIP_FILES = /(package-lock\.json|pnpm-lock\.yaml|yarn\.lock|uv\.lock|poetry\.lock|CHANGELOG)/;
|
|
21
|
+
const MAX_FILE_BYTES = 512 * 1024;
|
|
22
|
+
|
|
23
|
+
export const PROVIDERS = {
|
|
24
|
+
anthropic: {
|
|
25
|
+
pattern: /\bclaude-(?:(?:opus|sonnet|haiku|fable)-)?\d[0-9a-z.-]*/g,
|
|
26
|
+
key: "ANTHROPIC_API_KEY",
|
|
27
|
+
list: async (key) =>
|
|
28
|
+
(await getJson("https://api.anthropic.com/v1/models?limit=1000", {
|
|
29
|
+
"x-api-key": key,
|
|
30
|
+
"anthropic-version": "2023-06-01",
|
|
31
|
+
})).data.map((m) => m.id),
|
|
32
|
+
},
|
|
33
|
+
openai: {
|
|
34
|
+
pattern: /\bgpt-\d[0-9a-z.-]*/g,
|
|
35
|
+
key: "OPENAI_API_KEY",
|
|
36
|
+
list: async (key) =>
|
|
37
|
+
(await getJson("https://api.openai.com/v1/models", { authorization: `Bearer ${key}` })).data.map((m) => m.id),
|
|
38
|
+
},
|
|
39
|
+
google: {
|
|
40
|
+
pattern: /\bgemini-\d[0-9a-z.-]*/g,
|
|
41
|
+
key: "GEMINI_API_KEY",
|
|
42
|
+
list: async (key) =>
|
|
43
|
+
(await getJson("https://generativelanguage.googleapis.com/v1beta/models?pageSize=1000", {
|
|
44
|
+
"x-goog-api-key": key,
|
|
45
|
+
})).models.map((m) => m.name.replace(/^models\//, "")),
|
|
46
|
+
},
|
|
47
|
+
deepseek: {
|
|
48
|
+
pattern: /\bdeepseek-(?:chat|reasoner|coder|v\d)[0-9a-z.-]*/g,
|
|
49
|
+
key: "DEEPSEEK_API_KEY",
|
|
50
|
+
list: async (key) =>
|
|
51
|
+
(await getJson("https://api.deepseek.com/models", { authorization: `Bearer ${key}` })).data.map((m) => m.id),
|
|
52
|
+
},
|
|
53
|
+
moonshot: {
|
|
54
|
+
pattern: /\b(?:kimi-k\d[0-9a-z.-]*|moonshot-v1-[0-9a-z-]+)/g,
|
|
55
|
+
key: "MOONSHOT_API_KEY",
|
|
56
|
+
list: async (key) =>
|
|
57
|
+
(await getJson("https://api.moonshot.ai/v1/models", { authorization: `Bearer ${key}` })).data.map((m) => m.id),
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
async function getJson(url, headers) {
|
|
62
|
+
const res = await fetch(url, { headers, signal: AbortSignal.timeout(20_000) });
|
|
63
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
64
|
+
return res.json();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Model ids per provider found in a text blob (trailing separators trimmed). */
|
|
68
|
+
export function extractModelIds(text) {
|
|
69
|
+
const found = {};
|
|
70
|
+
for (const [name, p] of Object.entries(PROVIDERS)) {
|
|
71
|
+
for (const m of text.matchAll(p.pattern)) {
|
|
72
|
+
const id = m[0].replace(/[.-]+$/, "");
|
|
73
|
+
(found[name] ??= new Set()).add(id);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return found;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** An alias like claude-haiku-4-5 is live when a dated id extends it. */
|
|
80
|
+
export function isListed(id, listed) {
|
|
81
|
+
return listed.some((l) => l === id || l.startsWith(`${id}-`));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function* files(dir) {
|
|
85
|
+
for (const n of readdirSync(dir)) {
|
|
86
|
+
if (SKIP_DIRS.has(n)) continue;
|
|
87
|
+
const full = join(dir, n);
|
|
88
|
+
const st = statSync(full);
|
|
89
|
+
if (st.isDirectory()) yield* files(full);
|
|
90
|
+
else if (st.size <= MAX_FILE_BYTES && !SKIP_FILES.test(n) && !TEST_FILE.test(n) && (SCAN_EXT.has(extname(n)) || n.startsWith(".env"))) yield full;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** { provider: { id: [file, ...] } } for one repository. */
|
|
95
|
+
export function scanRepo(root) {
|
|
96
|
+
const usage = {};
|
|
97
|
+
for (const f of files(root)) {
|
|
98
|
+
const ids = extractModelIds(readFileSync(f, "utf8"));
|
|
99
|
+
for (const [prov, set] of Object.entries(ids)) {
|
|
100
|
+
for (const id of set) ((usage[prov] ??= {})[id] ??= []).push(relative(root, f));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return usage;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export async function checkModels(roots, env = process.env, listFn = (p, key) => PROVIDERS[p].list(key)) {
|
|
107
|
+
const usage = {};
|
|
108
|
+
for (const root of roots) {
|
|
109
|
+
for (const [prov, ids] of Object.entries(scanRepo(root))) {
|
|
110
|
+
for (const [id, fs] of Object.entries(ids)) {
|
|
111
|
+
((usage[prov] ??= {})[id] ??= []).push(...fs.map((f) => `${root}:${f}`));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const report = { retired: [], unverified: [], ok: [] };
|
|
116
|
+
for (const [prov, ids] of Object.entries(usage)) {
|
|
117
|
+
const key = env[PROVIDERS[prov].key];
|
|
118
|
+
let listed = null;
|
|
119
|
+
let reason = `no ${PROVIDERS[prov].key}`;
|
|
120
|
+
if (key) {
|
|
121
|
+
try {
|
|
122
|
+
listed = await listFn(prov, key);
|
|
123
|
+
} catch (e) {
|
|
124
|
+
reason = `model list failed: ${e.message}`;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
for (const [id, where] of Object.entries(ids)) {
|
|
128
|
+
const row = { provider: prov, id, where: [...new Set(where)].slice(0, 5) };
|
|
129
|
+
if (!listed) report.unverified.push({ ...row, reason });
|
|
130
|
+
else if (isListed(id, listed)) report.ok.push(row);
|
|
131
|
+
else report.retired.push(row);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return report;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
|
|
138
|
+
const args = process.argv.slice(2);
|
|
139
|
+
const json = args.includes("--json");
|
|
140
|
+
const targets = args.filter((a) => a !== "--json");
|
|
141
|
+
const report = await checkModels((targets.length ? targets : ["."]).map((t) => resolve(t)));
|
|
142
|
+
if (json) {
|
|
143
|
+
console.log(JSON.stringify(report, null, 2));
|
|
144
|
+
} else {
|
|
145
|
+
for (const r of report.retired) console.error(` ⛔ ${r.provider} ${r.id} — not in the provider list (${r.where.join(", ")})`);
|
|
146
|
+
for (const r of report.unverified) console.warn(` ⚠️ ${r.provider} ${r.id} — unverified: ${r.reason}`);
|
|
147
|
+
console.log(`models: ${report.ok.length} live, ${report.retired.length} retired, ${report.unverified.length} unverified`);
|
|
148
|
+
}
|
|
149
|
+
process.exit(report.retired.length > 0 ? 1 : 0);
|
|
150
|
+
}
|
package/scripts/cli.mjs
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* zenkit — um comando. Sem caminho absoluto, sem saber qual script chamar.
|
|
4
|
+
*
|
|
5
|
+
* npx /caminho/para/zenkit # init Kit Lite no cwd
|
|
6
|
+
* zenkit init --into . --bundle kit-engenharia
|
|
7
|
+
* zenkit init --plugin # Cursor local + Claude plugin-dir
|
|
8
|
+
* zenkit doctor
|
|
9
|
+
* zenkit bundles
|
|
10
|
+
* zenkit generate --plugins
|
|
11
|
+
*
|
|
12
|
+
* scripts/install.mjs continua: mesmo init, para quem já tinha o comando antigo.
|
|
13
|
+
*/
|
|
14
|
+
import { promises as fs } from "node:fs";
|
|
15
|
+
import os from "node:os";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
import { generateKit, emitPluginPackage, emitStorefrontPlugins } from "./generate.mjs";
|
|
19
|
+
import { loadBundleFiles, resolveBundle } from "./bundle.mjs";
|
|
20
|
+
import { writeMarketplaces } from "./marketplace.mjs";
|
|
21
|
+
import {
|
|
22
|
+
MAX_ARCHIVE_BYTES,
|
|
23
|
+
isRemoteSpec,
|
|
24
|
+
listRemoteLayers,
|
|
25
|
+
packLayer,
|
|
26
|
+
pullLayer,
|
|
27
|
+
pushLayer,
|
|
28
|
+
} from "./layer-remote.mjs";
|
|
29
|
+
import { pluginId, ROOT, storefrontBundles } from "./product.mjs";
|
|
30
|
+
|
|
31
|
+
const USAGE = `zenkit — instala o kit no seu projeto
|
|
32
|
+
|
|
33
|
+
Uso:
|
|
34
|
+
zenkit init [--into DIR] [--bundle kit-lite] [--plugin] [--layer DIR]...
|
|
35
|
+
zenkit doctor
|
|
36
|
+
zenkit bundles
|
|
37
|
+
zenkit generate [--target DIR] [--bundle NOME] [--plugins] [--layer DIR]...
|
|
38
|
+
zenkit layer push DIR
|
|
39
|
+
zenkit layer pull NOME [--version N] [--into DIR]
|
|
40
|
+
zenkit layer list
|
|
41
|
+
zenkit layer pack DIR --out ARQUIVO [--bundle RECEITA]
|
|
42
|
+
|
|
43
|
+
--layer soma uma camada (diretório com zenkit-layer.yaml) por cima do núcleo;
|
|
44
|
+
repita para empilhar, da mais geral para a mais específica. Sem --layer, vale
|
|
45
|
+
ZENKIT_LAYERS (caminhos separados pelo separador do sistema).
|
|
46
|
+
--layer nexuscore:NOME[@VERSÃO] usa a sua camada privada guardada no NexusCore
|
|
47
|
+
(baixada para ~/.zenkit/layers; sem rede, usa a última do cache).
|
|
48
|
+
--layer archive:URL#sha256=HASH usa uma camada em arquivo, baixada por https e
|
|
49
|
+
conferida pelo sha256 (token, se houver: ZENKIT_ARCHIVE_TOKEN ou
|
|
50
|
+
ZENKIT_ARCHIVE_TOKEN_FILE).
|
|
51
|
+
|
|
52
|
+
layer push publica uma nova versão da camada no NexusCore (recusa segredo).
|
|
53
|
+
NexusCore: ZENKIT_NEXUS_URL e ZENKIT_NEXUS_KEY (ou ZENKIT_NEXUS_KEY_FILE).
|
|
54
|
+
layer pack gera o arquivo de uma camada (recusa segredo) e mostra o sha256.
|
|
55
|
+
Com --bundle, só o que a receita usa da camada (uma vitrine de um pacote pago),
|
|
56
|
+
conferindo o carimbo de validade das skills fiscal e de privacidade.
|
|
57
|
+
|
|
58
|
+
Sem comando: init no diretório atual (Kit Lite).
|
|
59
|
+
O default copia o recorte para .cursor, .claude e .agents (Codex/Gemini).
|
|
60
|
+
--plugin instala como plugin nativo (Cursor em ~/.cursor/plugins/local,
|
|
61
|
+
Claude via --plugin-dir). Não mistura os dois modos: o Cursor carregaria
|
|
62
|
+
a skill duas vezes.
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
const layerArg = (value) => (isRemoteSpec(value) ? value : path.resolve(value));
|
|
66
|
+
|
|
67
|
+
/** `pack DIR --out FILE [--bundle NAME]`; null when the arguments do not fit. */
|
|
68
|
+
function parsePackFlags(args) {
|
|
69
|
+
const [dir, ...flags] = args;
|
|
70
|
+
const parsed = { dir, out: null, bundle: undefined };
|
|
71
|
+
for (let i = 0; i < flags.length; i += 2) {
|
|
72
|
+
if (flags[i] === "--out" && flags[i + 1]) parsed.out = flags[i + 1];
|
|
73
|
+
else if (flags[i] === "--bundle" && flags[i + 1]) parsed.bundle = flags[i + 1];
|
|
74
|
+
else return null;
|
|
75
|
+
}
|
|
76
|
+
return dir && parsed.out ? parsed : null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function runLayer(argv, { env = process.env, fetch, out = process.stdout } = {}) {
|
|
80
|
+
const [sub, ...rest] = argv;
|
|
81
|
+
if (sub === "push" && rest.length === 1) {
|
|
82
|
+
const res = await pushLayer(path.resolve(rest[0]), { env, fetch });
|
|
83
|
+
out.write(
|
|
84
|
+
res.reaproveitado
|
|
85
|
+
? `camada '${res.nome}' já estava publicada (v${res.versao}, sem mudança)\n`
|
|
86
|
+
: `camada '${res.nome}' publicada: v${res.versao}, ${res.arquivos} arquivos, ${res.bytes} bytes\n`,
|
|
87
|
+
);
|
|
88
|
+
return res;
|
|
89
|
+
}
|
|
90
|
+
if (sub === "pull" && rest.length >= 1) {
|
|
91
|
+
const [name, ...flags] = rest;
|
|
92
|
+
let version;
|
|
93
|
+
let into;
|
|
94
|
+
for (let i = 0; i < flags.length; i++) {
|
|
95
|
+
if (flags[i] === "--version" && flags[i + 1]) version = Number(flags[++i]);
|
|
96
|
+
else if (flags[i] === "--into" && flags[i + 1]) into = path.resolve(flags[++i]);
|
|
97
|
+
else throw new Error(`flag desconhecida: ${flags[i]}`);
|
|
98
|
+
}
|
|
99
|
+
const res = await pullLayer(name, { version, into, env, fetch });
|
|
100
|
+
out.write(`camada '${name}' v${res.version} em ${res.dir}\n`);
|
|
101
|
+
return res;
|
|
102
|
+
}
|
|
103
|
+
const packFlags = sub === "pack" ? parsePackFlags(rest) : null;
|
|
104
|
+
if (packFlags) {
|
|
105
|
+
const out_ = path.resolve(packFlags.out);
|
|
106
|
+
const packed = await packLayer(path.resolve(packFlags.dir), {
|
|
107
|
+
maxBytes: MAX_ARCHIVE_BYTES,
|
|
108
|
+
bundle: packFlags.bundle,
|
|
109
|
+
});
|
|
110
|
+
await fs.mkdir(path.dirname(out_), { recursive: true });
|
|
111
|
+
await fs.writeFile(out_, packed.bytes);
|
|
112
|
+
out.write(
|
|
113
|
+
`camada '${packed.name}' empacotada em ${out_}: ${packed.files} arquivos, ${packed.bytes.length} bytes\n` +
|
|
114
|
+
`sha256: ${packed.sha256}\n` +
|
|
115
|
+
`publique o arquivo por https e use: --layer archive:<url-do-arquivo>#sha256=${packed.sha256}\n`,
|
|
116
|
+
);
|
|
117
|
+
return packed;
|
|
118
|
+
}
|
|
119
|
+
if (sub === "list" && rest.length === 0) {
|
|
120
|
+
const layers = await listRemoteLayers({ env, fetch });
|
|
121
|
+
if (layers.length === 0) out.write("nenhuma camada no NexusCore\n");
|
|
122
|
+
for (const l of layers) out.write(`${l.nome.padEnd(24)} v${l.versao} ${l.bytes} bytes ${l.criado_em}\n`);
|
|
123
|
+
return layers;
|
|
124
|
+
}
|
|
125
|
+
throw new Error(
|
|
126
|
+
`uso: zenkit layer push DIR | pull NOME [--version N] [--into DIR] | list | pack DIR --out ARQUIVO [--bundle RECEITA]\n${USAGE}`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function isKitRoot(dir) {
|
|
131
|
+
return path.resolve(dir) === ROOT;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function parseInitFlags(argv) {
|
|
135
|
+
let into = null;
|
|
136
|
+
let bundle = "kit-lite";
|
|
137
|
+
let plugin = false;
|
|
138
|
+
const layers = [];
|
|
139
|
+
for (let i = 0; i < argv.length; i++) {
|
|
140
|
+
if (argv[i] === "--into" && argv[i + 1]) {
|
|
141
|
+
into = path.resolve(argv[++i]);
|
|
142
|
+
} else if (argv[i] === "--bundle" && argv[i + 1]) {
|
|
143
|
+
bundle = argv[++i];
|
|
144
|
+
} else if (argv[i] === "--layer" && argv[i + 1]) {
|
|
145
|
+
layers.push(layerArg(argv[++i]));
|
|
146
|
+
} else if (argv[i] === "--plugin") {
|
|
147
|
+
plugin = true;
|
|
148
|
+
} else if (argv[i] === "--help" || argv[i] === "-h") {
|
|
149
|
+
return { help: true };
|
|
150
|
+
} else if (argv[i].startsWith("-")) {
|
|
151
|
+
throw new Error(`flag desconhecida: ${argv[i]}`);
|
|
152
|
+
} else {
|
|
153
|
+
throw new Error(`argumento inesperado: ${argv[i]}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return { into, bundle, plugin, layers, help: false };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async function replaceSymlink(linkPath, target) {
|
|
160
|
+
await fs.mkdir(path.dirname(linkPath), { recursive: true });
|
|
161
|
+
try {
|
|
162
|
+
await fs.lstat(linkPath);
|
|
163
|
+
await fs.rm(linkPath, { recursive: true, force: true });
|
|
164
|
+
} catch {
|
|
165
|
+
/* ainda não existe */
|
|
166
|
+
}
|
|
167
|
+
await fs.symlink(target, linkPath, "dir");
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export async function runInit({ into, bundle, plugin, layers = [] }) {
|
|
171
|
+
const target = into || process.cwd();
|
|
172
|
+
if (isKitRoot(target) && !plugin) {
|
|
173
|
+
const err = new Error(
|
|
174
|
+
"init recusou gravar no repositório do kit.\n" +
|
|
175
|
+
"Passe o projeto: zenkit init --into /caminho/do/projeto",
|
|
176
|
+
);
|
|
177
|
+
err.exitCode = 2;
|
|
178
|
+
throw err;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const byName = await loadBundleFiles();
|
|
182
|
+
const meta = resolveBundle(bundle, byName);
|
|
183
|
+
|
|
184
|
+
if (plugin) {
|
|
185
|
+
const dest = path.join(os.homedir(), ".zenkit", "plugins", bundle);
|
|
186
|
+
const result = await emitPluginPackage({ dest, bundle });
|
|
187
|
+
const local = path.join(
|
|
188
|
+
os.homedir(),
|
|
189
|
+
".cursor",
|
|
190
|
+
"plugins",
|
|
191
|
+
"local",
|
|
192
|
+
result.id,
|
|
193
|
+
);
|
|
194
|
+
await replaceSymlink(local, result.cursorDest);
|
|
195
|
+
process.stdout.write(
|
|
196
|
+
`ZenKit ${meta.title} instalado como plugin (${result.id}).\n` +
|
|
197
|
+
` Cursor: ${local}\n` +
|
|
198
|
+
` Recarregue a janela (Developer: Reload Window).\n` +
|
|
199
|
+
` Claude: claude --plugin-dir ${result.claudeDest}\n` +
|
|
200
|
+
` Pacote: ${dest}\n`,
|
|
201
|
+
);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
await generateKit({ target, bundle, layers });
|
|
206
|
+
process.stdout.write(
|
|
207
|
+
`ZenKit instalado em ${target} (bundle ${bundle}).\n` +
|
|
208
|
+
"Pastas: .cursor (Cursor), .claude (Claude Code), .agents/skills (Codex e o padrão aberto).\n" +
|
|
209
|
+
"Plugin nativo: zenkit init --plugin --bundle " +
|
|
210
|
+
bundle +
|
|
211
|
+
"\n" +
|
|
212
|
+
"Conferir: zenkit doctor\n",
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async function runBundles() {
|
|
217
|
+
const byName = await loadBundleFiles();
|
|
218
|
+
const list = storefrontBundles(byName);
|
|
219
|
+
for (const b of list) {
|
|
220
|
+
const resolved = resolveBundle(b.name, byName);
|
|
221
|
+
process.stdout.write(
|
|
222
|
+
`${b.name.padEnd(18)} ${pluginId(b.name).padEnd(20)} ${b.title} — ${resolved.skills.size} skills\n`,
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async function runGenerate(argv) {
|
|
228
|
+
let target = null;
|
|
229
|
+
let bundle = null;
|
|
230
|
+
let plugins = false;
|
|
231
|
+
const layers = [];
|
|
232
|
+
for (let i = 0; i < argv.length; i++) {
|
|
233
|
+
if (argv[i] === "--target" && argv[i + 1]) {
|
|
234
|
+
target = path.resolve(argv[++i]);
|
|
235
|
+
} else if (argv[i] === "--bundle" && argv[i + 1]) {
|
|
236
|
+
bundle = argv[++i];
|
|
237
|
+
} else if (argv[i] === "--layer" && argv[i + 1]) {
|
|
238
|
+
layers.push(layerArg(argv[++i]));
|
|
239
|
+
} else if (argv[i] === "--plugins") {
|
|
240
|
+
plugins = true;
|
|
241
|
+
} else if (argv[i].startsWith("-")) {
|
|
242
|
+
throw new Error(`flag desconhecida: ${argv[i]}`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (plugins) {
|
|
246
|
+
await writeMarketplaces();
|
|
247
|
+
if (bundle) {
|
|
248
|
+
await emitPluginPackage({
|
|
249
|
+
dest: path.join(ROOT, "plugins", bundle),
|
|
250
|
+
bundle,
|
|
251
|
+
});
|
|
252
|
+
process.stdout.write(`plugin ${bundle} em plugins/${bundle}\n`);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
await emitStorefrontPlugins();
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
await generateKit({ target: target || path.join(ROOT, ".preview"), bundle, layers });
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export async function runCli(argv) {
|
|
262
|
+
const [cmd, ...rest] = argv;
|
|
263
|
+
if (!cmd || cmd === "init" || cmd.startsWith("-")) {
|
|
264
|
+
const flags = parseInitFlags(cmd === "init" ? rest : argv);
|
|
265
|
+
if (flags.help) {
|
|
266
|
+
process.stdout.write(USAGE);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
await runInit(flags);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (cmd === "--help" || cmd === "-h" || cmd === "help") {
|
|
273
|
+
process.stdout.write(USAGE);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (cmd === "doctor") {
|
|
277
|
+
const { spawn } = await import("node:child_process");
|
|
278
|
+
const child = spawn(process.execPath, [path.join(ROOT, "scripts", "doctor.mjs")], {
|
|
279
|
+
stdio: "inherit",
|
|
280
|
+
});
|
|
281
|
+
const code = await new Promise((resolve) => child.on("close", resolve));
|
|
282
|
+
if (code !== 0) {
|
|
283
|
+
const err = new Error("doctor reprovou");
|
|
284
|
+
err.exitCode = code;
|
|
285
|
+
throw err;
|
|
286
|
+
}
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (cmd === "bundles") {
|
|
290
|
+
await runBundles();
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (cmd === "generate") {
|
|
294
|
+
await runGenerate(rest);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (cmd === "layer") {
|
|
298
|
+
await runLayer(rest);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
throw new Error(`comando desconhecido: ${cmd}\n${USAGE}`);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const invokedDirectly =
|
|
305
|
+
Boolean(process.argv[1]) &&
|
|
306
|
+
path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
307
|
+
|
|
308
|
+
if (invokedDirectly) {
|
|
309
|
+
runCli(process.argv.slice(2)).catch((e) => {
|
|
310
|
+
process.stderr.write(String(e?.message || e) + "\n");
|
|
311
|
+
process.exit(e.exitCode || 1);
|
|
312
|
+
});
|
|
313
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content rules that travel with a skill wherever it ships: the public core
|
|
3
|
+
* (checked by doctor) or a paid pack (checked by `zenkit layer pack --bundle`).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Skills whose output is legal or tax material: they must carry a validity stamp. */
|
|
7
|
+
export const STAMPED = ["negocio-fiscal", "negocio-privacidade"];
|
|
8
|
+
export const STAMP_RE = /legisla[cç][aã]o[^.]{0,80}agosto de 2026/i;
|
|
9
|
+
|
|
10
|
+
/** Problems in a stamped skill's SKILL.md; empty when it is fine. */
|
|
11
|
+
export function stampProblems(name, body) {
|
|
12
|
+
const problems = [];
|
|
13
|
+
if (!STAMP_RE.test(body)) problems.push(`${name} sem carimbo "agosto de 2026"`);
|
|
14
|
+
if (!(/rascunho/i.test(body) && /(contador|advogado)/i.test(body))) {
|
|
15
|
+
problems.push(`${name} não manda validar rascunho com contador/advogado`);
|
|
16
|
+
}
|
|
17
|
+
return problems;
|
|
18
|
+
}
|