@zenrick/zenkit 0.0.0-stage → 0.5.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 +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/avaliar-vigilancia-mandato.mjs +38 -0
- package/scripts/bundle.mjs +158 -0
- package/scripts/check-deps.mjs +178 -0
- package/scripts/check-models.mjs +150 -0
- package/scripts/cli.mjs +295 -0
- package/scripts/continuidade-mandato.mjs +47 -0
- package/scripts/discriminar-turno.mjs +191 -0
- package/scripts/doctor.mjs +615 -0
- package/scripts/generate.mjs +676 -0
- package/scripts/install.mjs +11 -0
- package/scripts/layer-remote.mjs +344 -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,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zenrick/zenkit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@zenrick/zenkit",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "Agentes, skills e regras para assistentes de IA (Cursor, Claude Code, Codex, Gemini CLI), com camadas privadas por pessoa. npx @zenrick/zenkit init",
|
|
6
|
+
"author": "Zenrick",
|
|
7
|
+
"homepage": "https://zenrick.dev/zenkit",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"ai-agents",
|
|
10
|
+
"agent-skills",
|
|
11
|
+
"claude-code",
|
|
12
|
+
"cursor",
|
|
13
|
+
"codex",
|
|
14
|
+
"gemini-cli",
|
|
15
|
+
"agents-md"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"bin": {
|
|
19
|
+
"zenkit": "scripts/cli.mjs"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"kit/",
|
|
26
|
+
"scripts/",
|
|
27
|
+
"INSTALL.md",
|
|
28
|
+
"TERMS.md",
|
|
29
|
+
"README.md",
|
|
30
|
+
"THIRD-PARTY-NOTICES.md",
|
|
31
|
+
"NOTICE",
|
|
32
|
+
"licenses/",
|
|
33
|
+
".claude-plugin/",
|
|
34
|
+
".cursor-plugin/",
|
|
35
|
+
"!scripts/*.test.mjs",
|
|
36
|
+
"!scripts/*.sh",
|
|
37
|
+
"!kit/skills/**/tests/"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"zenkit": "node scripts/cli.mjs",
|
|
41
|
+
"prepublishOnly": "npm run test:scripts && npm run validate:bundles && npm run doctor",
|
|
42
|
+
"generate": "node scripts/generate.mjs",
|
|
43
|
+
"generate:plugins": "node scripts/cli.mjs generate --plugins",
|
|
44
|
+
"setup": "node scripts/install.mjs",
|
|
45
|
+
"doctor": "node scripts/doctor.mjs",
|
|
46
|
+
"doctor:self-test": "scripts/doctor.self-test.sh",
|
|
47
|
+
"content-gate": "test -f .content-denylist && ! grep -rilEf .content-denylist kit || echo 'no denylist; skipping'",
|
|
48
|
+
"validate:skills": "node scripts/validate-skills.mjs",
|
|
49
|
+
"validate:skills:self-test": "scripts/validate-skills.self-test.sh",
|
|
50
|
+
"validate:bundles": "node scripts/validate-bundles.mjs",
|
|
51
|
+
"validate:bundles:self-test": "scripts/validate-bundles.self-test.sh",
|
|
52
|
+
"validate": "npm run check:deps && npm run test:scripts && npm run validate:skills && npm run validate:bundles && npm run content-gate && npm run generate && npm run generate:plugins && npm run doctor",
|
|
53
|
+
"check:deps": "node scripts/check-deps.mjs .",
|
|
54
|
+
"check:models": "node scripts/check-models.mjs .",
|
|
55
|
+
"test:scripts": "node --test scripts/check-deps-models.test.mjs scripts/social-pacer.test.mjs scripts/discriminar-turno.test.mjs scripts/generate.test.mjs scripts/ruleset-core.test.mjs scripts/layers.test.mjs scripts/layer-remote.test.mjs scripts/continuidade-mandato.test.mjs scripts/avaliar-vigilancia-mandato.test.mjs"
|
|
56
|
+
},
|
|
57
|
+
"workspaces": [
|
|
58
|
+
"packages/*"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Monorepo entry (coordenação §7b) — implementation lives in packages/zenkit-bridge/scripts/.
|
|
4
|
+
*/
|
|
5
|
+
export { avaliarVigilanciaMandato } from "../packages/zenkit-bridge/scripts/avaliar-vigilancia-mandato.mjs";
|
|
6
|
+
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const impl = join(
|
|
12
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
13
|
+
"..",
|
|
14
|
+
"packages",
|
|
15
|
+
"zenkit-bridge",
|
|
16
|
+
"scripts",
|
|
17
|
+
"avaliar-vigilancia-mandato.mjs",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
function isMain() {
|
|
21
|
+
try {
|
|
22
|
+
const u = new URL(import.meta.url);
|
|
23
|
+
const a = process.argv[1];
|
|
24
|
+
if (!a) return false;
|
|
25
|
+
return u.pathname.endsWith(a.replace(/\\/g, "/").split("/").pop());
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (import.meta.url === `file://${process.argv[1]?.replace(/\\/g, "/")}` || isMain()) {
|
|
32
|
+
const r = spawnSync(process.execPath, [impl, ...process.argv.slice(2)], {
|
|
33
|
+
stdio: "inherit",
|
|
34
|
+
env: process.env,
|
|
35
|
+
windowsHide: true,
|
|
36
|
+
});
|
|
37
|
+
process.exit(r.status ?? 1);
|
|
38
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Bundles — visão sobre a lista plana de skills (não é pasta).
|
|
4
|
+
*
|
|
5
|
+
* Formato: kit/bundles/<name>.yaml, subconjunto YAML (chave: valor + listas).
|
|
6
|
+
* Zero dependências. Um bundle que cita skill/agente/include inexistente
|
|
7
|
+
* é erro — manifesto podre em silêncio é o defeito que isto existe para evitar.
|
|
8
|
+
*/
|
|
9
|
+
import { promises as fs } from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
|
|
13
|
+
export const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
14
|
+
export const BUNDLES_DIR = path.join(ROOT, "kit", "bundles");
|
|
15
|
+
export const SKILLS_DIR = path.join(ROOT, "kit", "skills");
|
|
16
|
+
export const AGENTS_DIR = path.join(ROOT, "kit", "agents");
|
|
17
|
+
|
|
18
|
+
/** Parser mínimo: `key: value` e `key:\n - item`. Comentários `#`. Sem âncoras. */
|
|
19
|
+
export function parseSimpleYaml(text, label) {
|
|
20
|
+
const out = {};
|
|
21
|
+
const lines = text.replace(/\r\n/g, "\n").split("\n");
|
|
22
|
+
let currentList = null;
|
|
23
|
+
for (let i = 0; i < lines.length; i++) {
|
|
24
|
+
const raw = lines[i];
|
|
25
|
+
const line = raw.replace(/\s+#.*$/, "");
|
|
26
|
+
if (!line.trim() || line.trim().startsWith("#")) continue;
|
|
27
|
+
const listItem = /^[ \t]+-\s+(\S.*?)\s*$/.exec(line);
|
|
28
|
+
if (listItem) {
|
|
29
|
+
if (!currentList) {
|
|
30
|
+
throw new Error(`${label}:${i + 1}: item de lista sem chave`);
|
|
31
|
+
}
|
|
32
|
+
out[currentList].push(listItem[1]);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const kv = /^([A-Za-z0-9_-]+):\s*(.*?)\s*$/.exec(line);
|
|
36
|
+
if (!kv) {
|
|
37
|
+
throw new Error(`${label}:${i + 1}: linha inválida: ${raw}`);
|
|
38
|
+
}
|
|
39
|
+
currentList = null;
|
|
40
|
+
const key = kv[1];
|
|
41
|
+
const val = kv[2];
|
|
42
|
+
if (val === "") {
|
|
43
|
+
out[key] = [];
|
|
44
|
+
currentList = key;
|
|
45
|
+
} else {
|
|
46
|
+
out[key] = val;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function listSkillNames() {
|
|
53
|
+
const entries = await fs.readdir(SKILLS_DIR, { withFileTypes: true });
|
|
54
|
+
return new Set(entries.filter((e) => e.isDirectory()).map((e) => e.name));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function listAgentNames() {
|
|
58
|
+
const entries = await fs.readdir(AGENTS_DIR, { withFileTypes: true });
|
|
59
|
+
return new Set(
|
|
60
|
+
entries
|
|
61
|
+
.filter((e) => e.isFile() && e.name.endsWith(".md"))
|
|
62
|
+
.map((e) => e.name.replace(/\.md$/, "")),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function loadBundleFiles() {
|
|
67
|
+
let entries;
|
|
68
|
+
try {
|
|
69
|
+
entries = await fs.readdir(BUNDLES_DIR, { withFileTypes: true });
|
|
70
|
+
} catch {
|
|
71
|
+
throw new Error(`⛔ ${BUNDLES_DIR} não existe — fail-closed.`);
|
|
72
|
+
}
|
|
73
|
+
const files = entries.filter((e) => e.isFile() && e.name.endsWith(".yaml"));
|
|
74
|
+
if (files.length === 0) {
|
|
75
|
+
throw new Error("⛔ nenhum bundle em kit/bundles — fail-closed.");
|
|
76
|
+
}
|
|
77
|
+
const byName = new Map();
|
|
78
|
+
for (const f of files) {
|
|
79
|
+
const stem = f.name.replace(/\.yaml$/, "");
|
|
80
|
+
const raw = await fs.readFile(path.join(BUNDLES_DIR, f.name), "utf8");
|
|
81
|
+
const data = parseSimpleYaml(raw, f.name);
|
|
82
|
+
const name = (data.name || "").trim();
|
|
83
|
+
if (!name) throw new Error(`${f.name}: sem 'name'`);
|
|
84
|
+
if (name !== stem) {
|
|
85
|
+
throw new Error(`${f.name}: name '${name}' diverge do arquivo (esperado '${stem}')`);
|
|
86
|
+
}
|
|
87
|
+
byName.set(name, {
|
|
88
|
+
name,
|
|
89
|
+
title: (data.title || name).trim(),
|
|
90
|
+
description: (data.description || "").trim(),
|
|
91
|
+
audience: (data.audience || "").trim(),
|
|
92
|
+
kind: (data.kind || "building-block").trim(),
|
|
93
|
+
includes: Array.isArray(data.includes) ? data.includes : [],
|
|
94
|
+
skills: Array.isArray(data.skills) ? data.skills : [],
|
|
95
|
+
agents: Array.isArray(data.agents) ? data.agents : [],
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return byName;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function resolveOne(name, byName, stack, skills, agents) {
|
|
102
|
+
if (stack.has(name)) {
|
|
103
|
+
throw new Error(`ciclo de includes: ${[...stack, name].join(" -> ")}`);
|
|
104
|
+
}
|
|
105
|
+
const b = byName.get(name);
|
|
106
|
+
if (!b) throw new Error(`bundle inexistente: ${name}`);
|
|
107
|
+
stack.add(name);
|
|
108
|
+
for (const inc of b.includes) resolveOne(inc, byName, stack, skills, agents);
|
|
109
|
+
for (const s of b.skills) skills.add(s);
|
|
110
|
+
for (const a of b.agents) agents.add(a);
|
|
111
|
+
stack.delete(name);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function resolveBundle(name, byName) {
|
|
115
|
+
if (!byName.has(name)) {
|
|
116
|
+
const known = [...byName.keys()].sort().join(", ");
|
|
117
|
+
throw new Error(`bundle desconhecido: ${name}. Existem: ${known}`);
|
|
118
|
+
}
|
|
119
|
+
const skills = new Set();
|
|
120
|
+
const agents = new Set();
|
|
121
|
+
resolveOne(name, byName, new Set(), skills, agents);
|
|
122
|
+
const meta = byName.get(name);
|
|
123
|
+
return { name, title: meta.title, description: meta.description, audience: meta.audience, kind: meta.kind, skills, agents };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export async function validateBundles() {
|
|
127
|
+
const problemas = [];
|
|
128
|
+
const byName = await loadBundleFiles();
|
|
129
|
+
const skillNames = await listSkillNames();
|
|
130
|
+
const agentNames = await listAgentNames();
|
|
131
|
+
|
|
132
|
+
for (const b of byName.values()) {
|
|
133
|
+
for (const inc of b.includes) {
|
|
134
|
+
if (!byName.has(inc)) {
|
|
135
|
+
problemas.push(`${b.name}: includes '${inc}' — bundle inexistente`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
for (const s of b.skills) {
|
|
139
|
+
if (!skillNames.has(s)) {
|
|
140
|
+
problemas.push(`${b.name}: skills '${s}' — skill inexistente em kit/skills`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
for (const a of b.agents) {
|
|
144
|
+
if (!agentNames.has(a)) {
|
|
145
|
+
problemas.push(`${b.name}: agents '${a}' — agente inexistente em kit/agents`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
const resolved = resolveBundle(b.name, byName);
|
|
150
|
+
if (resolved.skills.size === 0) {
|
|
151
|
+
problemas.push(`${b.name}: resolve para zero skills — bundle vazio não é produto`);
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
problemas.push(`${b.name}: ${e.message}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return { problemas, count: byName.size };
|
|
158
|
+
}
|
|
@@ -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
|
+
}
|