@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,501 @@
|
|
|
1
|
+
# Loading & Error States
|
|
2
|
+
|
|
3
|
+
**CRITICAL**: Proper loading and error state handling prevents layout shift and provides better user experience.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ⚠️ CRITICAL RULE: Never Use Early Returns
|
|
8
|
+
|
|
9
|
+
### The Problem
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// ❌ NEVER DO THIS - Early return with loading spinner
|
|
13
|
+
const Component = () => {
|
|
14
|
+
const { data, isLoading } = useQuery();
|
|
15
|
+
|
|
16
|
+
// WRONG: This causes layout shift and poor UX
|
|
17
|
+
if (isLoading) {
|
|
18
|
+
return <LoadingSpinner />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <Content data={data} />;
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Why this is bad:**
|
|
26
|
+
1. **Layout Shift**: Content position jumps when loading completes
|
|
27
|
+
2. **CLS (Cumulative Layout Shift)**: Poor Core Web Vital score
|
|
28
|
+
3. **Jarring UX**: Page structure changes suddenly
|
|
29
|
+
4. **Lost Scroll Position**: User loses place on page
|
|
30
|
+
|
|
31
|
+
### The Solutions
|
|
32
|
+
|
|
33
|
+
**Option 1: SuspenseLoader (PREFERRED for new components)**
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { SuspenseLoader } from '~components/SuspenseLoader';
|
|
37
|
+
|
|
38
|
+
const HeavyComponent = React.lazy(() => import('./HeavyComponent'));
|
|
39
|
+
|
|
40
|
+
export const MyComponent: React.FC = () => {
|
|
41
|
+
return (
|
|
42
|
+
<SuspenseLoader>
|
|
43
|
+
<HeavyComponent />
|
|
44
|
+
</SuspenseLoader>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Option 2: LoadingOverlay (for legacy useQuery patterns)**
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { LoadingOverlay } from '~components/LoadingOverlay';
|
|
53
|
+
|
|
54
|
+
export const MyComponent: React.FC = () => {
|
|
55
|
+
const { data, isLoading } = useQuery({ ... });
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<LoadingOverlay loading={isLoading}>
|
|
59
|
+
<Content data={data} />
|
|
60
|
+
</LoadingOverlay>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## SuspenseLoader Component
|
|
68
|
+
|
|
69
|
+
### What It Does
|
|
70
|
+
|
|
71
|
+
- Shows loading indicator while lazy components load
|
|
72
|
+
- Smooth fade-in animation
|
|
73
|
+
- Prevents layout shift
|
|
74
|
+
- Consistent loading experience across app
|
|
75
|
+
|
|
76
|
+
### Import
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { SuspenseLoader } from '~components/SuspenseLoader';
|
|
80
|
+
// Or
|
|
81
|
+
import { SuspenseLoader } from '@/components/SuspenseLoader';
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Basic Usage
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
<SuspenseLoader>
|
|
88
|
+
<LazyLoadedComponent />
|
|
89
|
+
</SuspenseLoader>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### With useSuspenseQuery
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { useSuspenseQuery } from '@tanstack/react-query';
|
|
96
|
+
import { SuspenseLoader } from '~components/SuspenseLoader';
|
|
97
|
+
|
|
98
|
+
const Inner: React.FC = () => {
|
|
99
|
+
// No isLoading needed!
|
|
100
|
+
const { data } = useSuspenseQuery({
|
|
101
|
+
queryKey: ['data'],
|
|
102
|
+
queryFn: () => api.getData(),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
return <Display data={data} />;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Outer component wraps in Suspense
|
|
109
|
+
export const Outer: React.FC = () => {
|
|
110
|
+
return (
|
|
111
|
+
<SuspenseLoader>
|
|
112
|
+
<Inner />
|
|
113
|
+
</SuspenseLoader>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Multiple Suspense Boundaries
|
|
119
|
+
|
|
120
|
+
**Pattern**: Separate loading for independent sections
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
export const Dashboard: React.FC = () => {
|
|
124
|
+
return (
|
|
125
|
+
<Box>
|
|
126
|
+
<SuspenseLoader>
|
|
127
|
+
<Header />
|
|
128
|
+
</SuspenseLoader>
|
|
129
|
+
|
|
130
|
+
<SuspenseLoader>
|
|
131
|
+
<MainContent />
|
|
132
|
+
</SuspenseLoader>
|
|
133
|
+
|
|
134
|
+
<SuspenseLoader>
|
|
135
|
+
<Sidebar />
|
|
136
|
+
</SuspenseLoader>
|
|
137
|
+
</Box>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Benefits:**
|
|
143
|
+
- Each section loads independently
|
|
144
|
+
- User sees partial content sooner
|
|
145
|
+
- Better perceived performance
|
|
146
|
+
|
|
147
|
+
### Nested Suspense
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
export const ParentComponent: React.FC = () => {
|
|
151
|
+
return (
|
|
152
|
+
<SuspenseLoader>
|
|
153
|
+
{/* Parent suspends while loading */}
|
|
154
|
+
<ParentContent>
|
|
155
|
+
<SuspenseLoader>
|
|
156
|
+
{/* Nested suspense for child */}
|
|
157
|
+
<ChildComponent />
|
|
158
|
+
</SuspenseLoader>
|
|
159
|
+
</ParentContent>
|
|
160
|
+
</SuspenseLoader>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## LoadingOverlay Component
|
|
168
|
+
|
|
169
|
+
### When to Use
|
|
170
|
+
|
|
171
|
+
- Legacy components with `useQuery` (not refactored to Suspense yet)
|
|
172
|
+
- Overlay loading state needed
|
|
173
|
+
- Can't use Suspense boundaries
|
|
174
|
+
|
|
175
|
+
### Usage
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
import { LoadingOverlay } from '~components/LoadingOverlay';
|
|
179
|
+
|
|
180
|
+
export const MyComponent: React.FC = () => {
|
|
181
|
+
const { data, isLoading } = useQuery({
|
|
182
|
+
queryKey: ['data'],
|
|
183
|
+
queryFn: () => api.getData(),
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<LoadingOverlay loading={isLoading}>
|
|
188
|
+
<Box sx={{ p: 2 }}>
|
|
189
|
+
{data && <Content data={data} />}
|
|
190
|
+
</Box>
|
|
191
|
+
</LoadingOverlay>
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**What it does:**
|
|
197
|
+
- Shows semi-transparent overlay with spinner
|
|
198
|
+
- Content area reserved (no layout shift)
|
|
199
|
+
- Prevents interaction while loading
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Error Handling
|
|
204
|
+
|
|
205
|
+
### useMuiSnackbar Hook (REQUIRED)
|
|
206
|
+
|
|
207
|
+
**NEVER use react-toastify** - Project standard is MUI Snackbar
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
import { useMuiSnackbar } from '@/hooks/useMuiSnackbar';
|
|
211
|
+
|
|
212
|
+
export const MyComponent: React.FC = () => {
|
|
213
|
+
const { showSuccess, showError, showInfo, showWarning } = useMuiSnackbar();
|
|
214
|
+
|
|
215
|
+
const handleAction = async () => {
|
|
216
|
+
try {
|
|
217
|
+
await api.doSomething();
|
|
218
|
+
showSuccess('Operation completed successfully');
|
|
219
|
+
} catch (error) {
|
|
220
|
+
showError('Operation failed');
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
return <Button onClick={handleAction}>Do Action</Button>;
|
|
225
|
+
};
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Available Methods:**
|
|
229
|
+
- `showSuccess(message)` - Green success message
|
|
230
|
+
- `showError(message)` - Red error message
|
|
231
|
+
- `showWarning(message)` - Orange warning message
|
|
232
|
+
- `showInfo(message)` - Blue info message
|
|
233
|
+
|
|
234
|
+
### TanStack Query Error Callbacks
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
import { useSuspenseQuery } from '@tanstack/react-query';
|
|
238
|
+
import { useMuiSnackbar } from '@/hooks/useMuiSnackbar';
|
|
239
|
+
|
|
240
|
+
export const MyComponent: React.FC = () => {
|
|
241
|
+
const { showError } = useMuiSnackbar();
|
|
242
|
+
|
|
243
|
+
const { data } = useSuspenseQuery({
|
|
244
|
+
queryKey: ['data'],
|
|
245
|
+
queryFn: () => api.getData(),
|
|
246
|
+
|
|
247
|
+
// Handle errors
|
|
248
|
+
onError: (error) => {
|
|
249
|
+
showError('Failed to load data');
|
|
250
|
+
console.error('Query error:', error);
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
return <Content data={data} />;
|
|
255
|
+
};
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Error Boundaries
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
262
|
+
|
|
263
|
+
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
264
|
+
return (
|
|
265
|
+
<Box sx={{ p: 4, textAlign: 'center' }}>
|
|
266
|
+
<Typography variant='h5' color='error'>
|
|
267
|
+
Something went wrong
|
|
268
|
+
</Typography>
|
|
269
|
+
<Typography>{error.message}</Typography>
|
|
270
|
+
<Button onClick={resetErrorBoundary}>Try Again</Button>
|
|
271
|
+
</Box>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export const MyPage: React.FC = () => {
|
|
276
|
+
return (
|
|
277
|
+
<ErrorBoundary
|
|
278
|
+
FallbackComponent={ErrorFallback}
|
|
279
|
+
onError={(error) => console.error('Boundary caught:', error)}
|
|
280
|
+
>
|
|
281
|
+
<SuspenseLoader>
|
|
282
|
+
<ComponentThatMightError />
|
|
283
|
+
</SuspenseLoader>
|
|
284
|
+
</ErrorBoundary>
|
|
285
|
+
);
|
|
286
|
+
};
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Complete Examples
|
|
292
|
+
|
|
293
|
+
### Example 1: Modern Component with Suspense
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
import React from 'react';
|
|
297
|
+
import { Box, Paper } from '@mui/material';
|
|
298
|
+
import { useSuspenseQuery } from '@tanstack/react-query';
|
|
299
|
+
import { SuspenseLoader } from '~components/SuspenseLoader';
|
|
300
|
+
import { myFeatureApi } from '../api/myFeatureApi';
|
|
301
|
+
|
|
302
|
+
// Inner component uses useSuspenseQuery
|
|
303
|
+
const InnerComponent: React.FC<{ id: number }> = ({ id }) => {
|
|
304
|
+
const { data } = useSuspenseQuery({
|
|
305
|
+
queryKey: ['entity', id],
|
|
306
|
+
queryFn: () => myFeatureApi.getEntity(id),
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// data is always defined - no isLoading needed!
|
|
310
|
+
return (
|
|
311
|
+
<Paper sx={{ p: 2 }}>
|
|
312
|
+
<h2>{data.title}</h2>
|
|
313
|
+
<p>{data.description}</p>
|
|
314
|
+
</Paper>
|
|
315
|
+
);
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// Outer component provides Suspense boundary
|
|
319
|
+
export const OuterComponent: React.FC<{ id: number }> = ({ id }) => {
|
|
320
|
+
return (
|
|
321
|
+
<Box>
|
|
322
|
+
<SuspenseLoader>
|
|
323
|
+
<InnerComponent id={id} />
|
|
324
|
+
</SuspenseLoader>
|
|
325
|
+
</Box>
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export default OuterComponent;
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Example 2: Legacy Pattern with LoadingOverlay
|
|
333
|
+
|
|
334
|
+
```typescript
|
|
335
|
+
import React from 'react';
|
|
336
|
+
import { Box } from '@mui/material';
|
|
337
|
+
import { useQuery } from '@tanstack/react-query';
|
|
338
|
+
import { LoadingOverlay } from '~components/LoadingOverlay';
|
|
339
|
+
import { myFeatureApi } from '../api/myFeatureApi';
|
|
340
|
+
|
|
341
|
+
export const LegacyComponent: React.FC<{ id: number }> = ({ id }) => {
|
|
342
|
+
const { data, isLoading, error } = useQuery({
|
|
343
|
+
queryKey: ['entity', id],
|
|
344
|
+
queryFn: () => myFeatureApi.getEntity(id),
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
return (
|
|
348
|
+
<LoadingOverlay loading={isLoading}>
|
|
349
|
+
<Box sx={{ p: 2 }}>
|
|
350
|
+
{error && <ErrorDisplay error={error} />}
|
|
351
|
+
{data && <Content data={data} />}
|
|
352
|
+
</Box>
|
|
353
|
+
</LoadingOverlay>
|
|
354
|
+
);
|
|
355
|
+
};
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Example 3: Error Handling with Snackbar
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
import React from 'react';
|
|
362
|
+
import { useSuspenseQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
363
|
+
import { Button } from '@mui/material';
|
|
364
|
+
import { useMuiSnackbar } from '@/hooks/useMuiSnackbar';
|
|
365
|
+
import { myFeatureApi } from '../api/myFeatureApi';
|
|
366
|
+
|
|
367
|
+
export const EntityEditor: React.FC<{ id: number }> = ({ id }) => {
|
|
368
|
+
const queryClient = useQueryClient();
|
|
369
|
+
const { showSuccess, showError } = useMuiSnackbar();
|
|
370
|
+
|
|
371
|
+
const { data } = useSuspenseQuery({
|
|
372
|
+
queryKey: ['entity', id],
|
|
373
|
+
queryFn: () => myFeatureApi.getEntity(id),
|
|
374
|
+
onError: () => {
|
|
375
|
+
showError('Failed to load entity');
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
const updateMutation = useMutation({
|
|
380
|
+
mutationFn: (updates) => myFeatureApi.update(id, updates),
|
|
381
|
+
|
|
382
|
+
onSuccess: () => {
|
|
383
|
+
queryClient.invalidateQueries({ queryKey: ['entity', id] });
|
|
384
|
+
showSuccess('Entity updated successfully');
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
onError: () => {
|
|
388
|
+
showError('Failed to update entity');
|
|
389
|
+
},
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
return (
|
|
393
|
+
<Button onClick={() => updateMutation.mutate({ name: 'New' })}>
|
|
394
|
+
Update
|
|
395
|
+
</Button>
|
|
396
|
+
);
|
|
397
|
+
};
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## Loading State Anti-Patterns
|
|
403
|
+
|
|
404
|
+
### ❌ What NOT to Do
|
|
405
|
+
|
|
406
|
+
```typescript
|
|
407
|
+
// ❌ NEVER - Early return
|
|
408
|
+
if (isLoading) {
|
|
409
|
+
return <CircularProgress />;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// ❌ NEVER - Conditional rendering
|
|
413
|
+
{isLoading ? <Spinner /> : <Content />}
|
|
414
|
+
|
|
415
|
+
// ❌ NEVER - Layout changes
|
|
416
|
+
if (isLoading) {
|
|
417
|
+
return (
|
|
418
|
+
<Box sx={{ height: 100 }}>
|
|
419
|
+
<Spinner />
|
|
420
|
+
</Box>
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
return (
|
|
424
|
+
<Box sx={{ height: 500 }}> // Different height!
|
|
425
|
+
<Content />
|
|
426
|
+
</Box>
|
|
427
|
+
);
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### ✅ What TO Do
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
// ✅ BEST - useSuspenseQuery + SuspenseLoader
|
|
434
|
+
<SuspenseLoader>
|
|
435
|
+
<ComponentWithSuspenseQuery />
|
|
436
|
+
</SuspenseLoader>
|
|
437
|
+
|
|
438
|
+
// ✅ ACCEPTABLE - LoadingOverlay
|
|
439
|
+
<LoadingOverlay loading={isLoading}>
|
|
440
|
+
<Content />
|
|
441
|
+
</LoadingOverlay>
|
|
442
|
+
|
|
443
|
+
// ✅ OK - Inline skeleton with same layout
|
|
444
|
+
<Box sx={{ height: 500 }}>
|
|
445
|
+
{isLoading ? <Skeleton variant='rectangular' height='100%' /> : <Content />}
|
|
446
|
+
</Box>
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## Skeleton Loading (Alternative)
|
|
452
|
+
|
|
453
|
+
### MUI Skeleton Component
|
|
454
|
+
|
|
455
|
+
```typescript
|
|
456
|
+
import { Skeleton, Box } from '@mui/material';
|
|
457
|
+
|
|
458
|
+
export const MyComponent: React.FC = () => {
|
|
459
|
+
const { data, isLoading } = useQuery({ ... });
|
|
460
|
+
|
|
461
|
+
return (
|
|
462
|
+
<Box sx={{ p: 2 }}>
|
|
463
|
+
{isLoading ? (
|
|
464
|
+
<>
|
|
465
|
+
<Skeleton variant='text' width={200} height={40} />
|
|
466
|
+
<Skeleton variant='rectangular' width='100%' height={200} />
|
|
467
|
+
<Skeleton variant='text' width='100%' />
|
|
468
|
+
</>
|
|
469
|
+
) : (
|
|
470
|
+
<>
|
|
471
|
+
<Typography variant='h5'>{data.title}</Typography>
|
|
472
|
+
<img src={data.image} />
|
|
473
|
+
<Typography>{data.description}</Typography>
|
|
474
|
+
</>
|
|
475
|
+
)}
|
|
476
|
+
</Box>
|
|
477
|
+
);
|
|
478
|
+
};
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
**Key**: Skeleton must have **same layout** as actual content (no shift)
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## Summary
|
|
486
|
+
|
|
487
|
+
**Loading States:**
|
|
488
|
+
- ✅ **PREFERRED**: SuspenseLoader + useSuspenseQuery (modern pattern)
|
|
489
|
+
- ✅ **ACCEPTABLE**: LoadingOverlay (legacy pattern)
|
|
490
|
+
- ✅ **OK**: Skeleton with same layout
|
|
491
|
+
- ❌ **NEVER**: Early returns or conditional layout
|
|
492
|
+
|
|
493
|
+
**Error Handling:**
|
|
494
|
+
- ✅ **ALWAYS**: useMuiSnackbar for user feedback
|
|
495
|
+
- ❌ **NEVER**: react-toastify
|
|
496
|
+
- ✅ Use onError callbacks in queries/mutations
|
|
497
|
+
- ✅ Error boundaries for component-level errors
|
|
498
|
+
|
|
499
|
+
**See Also:**
|
|
500
|
+
- [component-patterns.md](component-patterns.md) - Suspense integration
|
|
501
|
+
- [data-fetching.md](data-fetching.md) - useSuspenseQuery details
|