claudeinone-cli 1.0.2 → 1.0.3
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/kit/.claude/.ck.json +9 -0
- package/kit/.claude/.ckignore +12 -0
- package/kit/.claude/agents/accessibility-auditor.md +46 -0
- package/kit/.claude/agents/api-designer.md +43 -0
- package/kit/.claude/agents/backend-developer.md +54 -0
- package/kit/.claude/agents/brainstormer.md +33 -0
- package/kit/.claude/agents/campaign-manager.md +36 -0
- package/kit/.claude/agents/code-reviewer.md +39 -0
- package/kit/.claude/agents/content-creator.md +38 -0
- package/kit/.claude/agents/copywriter.md +42 -0
- package/kit/.claude/agents/database-admin.md +37 -0
- package/kit/.claude/agents/debugger.md +46 -0
- package/kit/.claude/agents/devops-engineer.md +41 -0
- package/kit/.claude/agents/docs-manager.md +33 -0
- package/kit/.claude/agents/email-wizard.md +40 -0
- package/kit/.claude/agents/frontend-developer.md +52 -0
- package/kit/.claude/agents/fullstack-developer.md +55 -0
- package/kit/.claude/agents/git-manager.md +40 -0
- package/kit/.claude/agents/i18n-specialist.md +46 -0
- package/kit/.claude/agents/integration-specialist.md +48 -0
- package/kit/.claude/agents/journal-writer.md +39 -0
- package/kit/.claude/agents/mcp-manager.md +57 -0
- package/kit/.claude/agents/mobile-developer.md +38 -0
- package/kit/.claude/agents/performance-optimizer.md +38 -0
- package/kit/.claude/agents/planner.md +56 -0
- package/kit/.claude/agents/project-manager.md +34 -0
- package/kit/.claude/agents/refactorer.md +43 -0
- package/kit/.claude/agents/researcher.md +45 -0
- package/kit/.claude/agents/risk-analyst.md +33 -0
- package/kit/.claude/agents/scalability-consultant.md +39 -0
- package/kit/.claude/agents/scout.md +25 -0
- package/kit/.claude/agents/security-auditor.md +42 -0
- package/kit/.claude/agents/seo-specialist.md +44 -0
- package/kit/.claude/agents/skill-creator.md +64 -0
- package/kit/.claude/agents/social-media-manager.md +35 -0
- package/kit/.claude/agents/systems-designer.md +35 -0
- package/kit/.claude/agents/technology-strategist.md +43 -0
- package/kit/.claude/agents/tester.md +40 -0
- package/kit/.claude/agents/ui-ux-designer.md +40 -0
- package/kit/.claude/commands/co/ask.md +29 -0
- package/kit/.claude/commands/co/bootstrap-auto-fast.md +28 -0
- package/kit/.claude/commands/co/bootstrap-auto-parallel.md +29 -0
- package/kit/.claude/commands/co/bootstrap-auto.md +30 -0
- package/kit/.claude/commands/co/bootstrap.md +31 -0
- package/kit/.claude/commands/co/brainstorm.md +27 -0
- package/kit/.claude/commands/co/campaign.md +28 -0
- package/kit/.claude/commands/co/changelog.md +25 -0
- package/kit/.claude/commands/co/checkpoint.md +25 -0
- package/kit/.claude/commands/co/ci.md +26 -0
- package/kit/.claude/commands/co/ck-help.md +24 -0
- package/kit/.claude/commands/co/coding-level.md +24 -0
- package/kit/.claude/commands/co/content-cro.md +26 -0
- package/kit/.claude/commands/co/content-enhance.md +26 -0
- package/kit/.claude/commands/co/content-fast.md +24 -0
- package/kit/.claude/commands/co/content-good.md +26 -0
- package/kit/.claude/commands/co/cook.md +33 -0
- package/kit/.claude/commands/co/debug.md +26 -0
- package/kit/.claude/commands/co/deploy.md +25 -0
- package/kit/.claude/commands/co/design-3d.md +27 -0
- package/kit/.claude/commands/co/design-describe.md +25 -0
- package/kit/.claude/commands/co/design-fast.md +25 -0
- package/kit/.claude/commands/co/design-good.md +28 -0
- package/kit/.claude/commands/co/design-screenshot.md +26 -0
- package/kit/.claude/commands/co/design-video.md +26 -0
- package/kit/.claude/commands/co/docker.md +24 -0
- package/kit/.claude/commands/co/docs-api.md +25 -0
- package/kit/.claude/commands/co/docs-init.md +26 -0
- package/kit/.claude/commands/co/docs-readme.md +24 -0
- package/kit/.claude/commands/co/docs-summarize.md +25 -0
- package/kit/.claude/commands/co/docs-update.md +25 -0
- package/kit/.claude/commands/co/env-check.md +25 -0
- package/kit/.claude/commands/co/fix-ci.md +29 -0
- package/kit/.claude/commands/co/fix-fast.md +28 -0
- package/kit/.claude/commands/co/fix-hard.md +33 -0
- package/kit/.claude/commands/co/fix-logs.md +28 -0
- package/kit/.claude/commands/co/fix-types.md +28 -0
- package/kit/.claude/commands/co/fix-ui.md +28 -0
- package/kit/.claude/commands/co/fix.md +27 -0
- package/kit/.claude/commands/co/git-cm.md +26 -0
- package/kit/.claude/commands/co/git-cp.md +26 -0
- package/kit/.claude/commands/co/git-pr.md +26 -0
- package/kit/.claude/commands/co/index.md +24 -0
- package/kit/.claude/commands/co/integrate-polar.md +29 -0
- package/kit/.claude/commands/co/integrate-sepay.md +29 -0
- package/kit/.claude/commands/co/journal.md +27 -0
- package/kit/.claude/commands/co/k8s.md +24 -0
- package/kit/.claude/commands/co/kanban.md +25 -0
- package/kit/.claude/commands/co/lint-fix.md +24 -0
- package/kit/.claude/commands/co/load.md +25 -0
- package/kit/.claude/commands/co/migrate.md +28 -0
- package/kit/.claude/commands/co/mock.md +26 -0
- package/kit/.claude/commands/co/mode.md +24 -0
- package/kit/.claude/commands/co/monitor.md +25 -0
- package/kit/.claude/commands/co/new-feature.md +27 -0
- package/kit/.claude/commands/co/optimize.md +26 -0
- package/kit/.claude/commands/co/plan-archive.md +24 -0
- package/kit/.claude/commands/co/plan-ci.md +28 -0
- package/kit/.claude/commands/co/plan-cro.md +27 -0
- package/kit/.claude/commands/co/plan-fast.md +24 -0
- package/kit/.claude/commands/co/plan-hard.md +27 -0
- package/kit/.claude/commands/co/plan-parallel.md +25 -0
- package/kit/.claude/commands/co/plan-two.md +29 -0
- package/kit/.claude/commands/co/plan-validate.md +27 -0
- package/kit/.claude/commands/co/plan.md +27 -0
- package/kit/.claude/commands/co/pr.md +25 -0
- package/kit/.claude/commands/co/preview.md +26 -0
- package/kit/.claude/commands/co/refactor.md +25 -0
- package/kit/.claude/commands/co/release.md +25 -0
- package/kit/.claude/commands/co/review-a11y.md +24 -0
- package/kit/.claude/commands/co/review-codebase-parallel.md +27 -0
- package/kit/.claude/commands/co/review-codebase.md +27 -0
- package/kit/.claude/commands/co/review-perf.md +24 -0
- package/kit/.claude/commands/co/review-security.md +25 -0
- package/kit/.claude/commands/co/scaffold.md +25 -0
- package/kit/.claude/commands/co/scout.md +26 -0
- package/kit/.claude/commands/co/secure.md +26 -0
- package/kit/.claude/commands/co/seed.md +25 -0
- package/kit/.claude/commands/co/seo-audit.md +24 -0
- package/kit/.claude/commands/co/seo-keywords.md +25 -0
- package/kit/.claude/commands/co/skill-create.md +29 -0
- package/kit/.claude/commands/co/skill-fix-logs.md +28 -0
- package/kit/.claude/commands/co/slide-create.md +24 -0
- package/kit/.claude/commands/co/spawn.md +24 -0
- package/kit/.claude/commands/co/terraform.md +24 -0
- package/kit/.claude/commands/co/test-gen.md +24 -0
- package/kit/.claude/commands/co/test-ui.md +27 -0
- package/kit/.claude/commands/co/test.md +26 -0
- package/kit/.claude/commands/co/use-mcp.md +25 -0
- package/kit/.claude/commands/co/video-script.md +25 -0
- package/kit/.claude/commands/co/watzup.md +25 -0
- package/kit/.claude/commands/co/worktree.md +25 -0
- package/kit/.claude/commands/co/write-blog.md +25 -0
- package/kit/.claude/commands/co/write-copy.md +24 -0
- package/kit/.claude/commands/co/write-email.md +25 -0
- package/kit/.claude/commands/content/content-cro.md +26 -0
- package/kit/.claude/commands/content/content-enhance.md +26 -0
- package/kit/.claude/commands/content/content-fast.md +24 -0
- package/kit/.claude/commands/content/content-good.md +26 -0
- package/kit/.claude/commands/content/enhance.md +26 -0
- package/kit/.claude/commands/content/good.md +26 -0
- package/kit/.claude/commands/core/ask.md +29 -0
- package/kit/.claude/commands/core/bootstrap-auto-fast.md +28 -0
- package/kit/.claude/commands/core/bootstrap-auto-parallel.md +29 -0
- package/kit/.claude/commands/core/bootstrap-auto.md +30 -0
- package/kit/.claude/commands/core/bootstrap.md +31 -0
- package/kit/.claude/commands/core/ck-help.md +24 -0
- package/kit/.claude/commands/core/coding-level.md +24 -0
- package/kit/.claude/commands/core/cook.md +33 -0
- package/kit/.claude/commands/core/debug.md +26 -0
- package/kit/.claude/commands/core/journal.md +27 -0
- package/kit/.claude/commands/core/kanban.md +25 -0
- package/kit/.claude/commands/core/preview.md +26 -0
- package/kit/.claude/commands/core/scout.md +26 -0
- package/kit/.claude/commands/core/test-ui.md +27 -0
- package/kit/.claude/commands/core/test.md +26 -0
- package/kit/.claude/commands/core/use-mcp.md +25 -0
- package/kit/.claude/commands/core/watzup.md +25 -0
- package/kit/.claude/commands/core/worktree.md +25 -0
- package/kit/.claude/commands/design/3d.md +27 -0
- package/kit/.claude/commands/design/design-3d.md +27 -0
- package/kit/.claude/commands/design/design-describe.md +25 -0
- package/kit/.claude/commands/design/design-fast.md +25 -0
- package/kit/.claude/commands/design/design-good.md +28 -0
- package/kit/.claude/commands/design/design-screenshot.md +26 -0
- package/kit/.claude/commands/design/design-video.md +26 -0
- package/kit/.claude/commands/design/good.md +28 -0
- package/kit/.claude/commands/design/video.md +26 -0
- package/kit/.claude/commands/docs/docs-init.md +26 -0
- package/kit/.claude/commands/docs/docs-summarize.md +25 -0
- package/kit/.claude/commands/docs/docs-update.md +25 -0
- package/kit/.claude/commands/docs/init.md +26 -0
- package/kit/.claude/commands/docs/summarize.md +25 -0
- package/kit/.claude/commands/fix/ci.md +29 -0
- package/kit/.claude/commands/fix/fast.md +28 -0
- package/kit/.claude/commands/fix/fix-ci.md +29 -0
- package/kit/.claude/commands/fix/fix-fast.md +28 -0
- package/kit/.claude/commands/fix/fix-hard.md +33 -0
- package/kit/.claude/commands/fix/fix-logs.md +28 -0
- package/kit/.claude/commands/fix/fix-types.md +28 -0
- package/kit/.claude/commands/fix/fix-ui.md +28 -0
- package/kit/.claude/commands/fix/hard.md +33 -0
- package/kit/.claude/commands/fix/logs.md +28 -0
- package/kit/.claude/commands/fix/types.md +28 -0
- package/kit/.claude/commands/fix/ui.md +28 -0
- package/kit/.claude/commands/git/cp.md +26 -0
- package/kit/.claude/commands/git/git-cm.md +26 -0
- package/kit/.claude/commands/git/git-cp.md +26 -0
- package/kit/.claude/commands/git/git-pr.md +26 -0
- package/kit/.claude/commands/integrate/integrate-polar.md +29 -0
- package/kit/.claude/commands/integrate/integrate-sepay.md +29 -0
- package/kit/.claude/commands/integrate/sepay.md +29 -0
- package/kit/.claude/commands/plan/ci.md +28 -0
- package/kit/.claude/commands/plan/cro.md +27 -0
- package/kit/.claude/commands/plan/hard.md +27 -0
- package/kit/.claude/commands/plan/plan-archive.md +24 -0
- package/kit/.claude/commands/plan/plan-ci.md +28 -0
- package/kit/.claude/commands/plan/plan-cro.md +27 -0
- package/kit/.claude/commands/plan/plan-fast.md +24 -0
- package/kit/.claude/commands/plan/plan-hard.md +27 -0
- package/kit/.claude/commands/plan/plan-parallel.md +25 -0
- package/kit/.claude/commands/plan/plan-two.md +29 -0
- package/kit/.claude/commands/plan/plan-validate.md +27 -0
- package/kit/.claude/commands/plan/plan.md +27 -0
- package/kit/.claude/commands/plan/validate.md +27 -0
- package/kit/.claude/commands/skill/fix-logs.md +28 -0
- package/kit/.claude/commands/skill/skill-create.md +29 -0
- package/kit/.claude/commands/skill/skill-fix-logs.md +28 -0
- package/kit/.claude/settings.json +16 -0
- package/kit/.claude/skills/ai-anthropic.md +100 -0
- package/kit/.claude/skills/ai-context-engineering.md +113 -0
- package/kit/.claude/skills/ai-gemini.md +152 -0
- package/kit/.claude/skills/ai-langchain.md +93 -0
- package/kit/.claude/skills/ai-llamaindex.md +179 -0
- package/kit/.claude/skills/ai-mcp-builder.md +101 -0
- package/kit/.claude/skills/ai-openai.md +250 -0
- package/kit/.claude/skills/ai-prompt-engineering.md +173 -0
- package/kit/.claude/skills/ai-rag.md +91 -0
- package/kit/.claude/skills/ai-vectordb.md +215 -0
- package/kit/.claude/skills/analytics-segment.md +161 -0
- package/kit/.claude/skills/api-caching.md +103 -0
- package/kit/.claude/skills/api-documentation.md +50 -0
- package/kit/.claude/skills/api-graphql.md +234 -0
- package/kit/.claude/skills/api-openapi.md +116 -0
- package/kit/.claude/skills/api-pagination-filtering.md +239 -0
- package/kit/.claude/skills/api-rate-limiting.md +179 -0
- package/kit/.claude/skills/api-rest-advanced.md +50 -0
- package/kit/.claude/skills/api-rest.md +217 -0
- package/kit/.claude/skills/api-trpc.md +173 -0
- package/kit/.claude/skills/api-versioning.md +70 -0
- package/kit/.claude/skills/api-webhooks.md +226 -0
- package/kit/.claude/skills/arch-clean-code.md +226 -0
- package/kit/.claude/skills/arch-clean.md +91 -0
- package/kit/.claude/skills/arch-cqrs.md +229 -0
- package/kit/.claude/skills/arch-ddd.md +85 -0
- package/kit/.claude/skills/arch-event-driven.md +189 -0
- package/kit/.claude/skills/arch-microservices.md +80 -0
- package/kit/.claude/skills/arch-monorepo.md +87 -0
- package/kit/.claude/skills/arch-multi-tenant.md +81 -0
- package/kit/.claude/skills/arch-serverless.md +86 -0
- package/kit/.claude/skills/auth-clerk.md +97 -0
- package/kit/.claude/skills/auth-jwt.md +143 -0
- package/kit/.claude/skills/auth-lucia.md +93 -0
- package/kit/.claude/skills/auth-nextauth.md +446 -0
- package/kit/.claude/skills/auth-oauth.md +208 -0
- package/kit/.claude/skills/auth-oauth2.md +110 -0
- package/kit/.claude/skills/auth-passkeys.md +109 -0
- package/kit/.claude/skills/auth-session.md +88 -0
- package/kit/.claude/skills/backend-dotnet.md +414 -0
- package/kit/.claude/skills/backend-express.md +129 -0
- package/kit/.claude/skills/backend-fastify.md +104 -0
- package/kit/.claude/skills/backend-go.md +205 -0
- package/kit/.claude/skills/backend-graphql.md +149 -0
- package/kit/.claude/skills/backend-grpc.md +382 -0
- package/kit/.claude/skills/backend-hono.md +95 -0
- package/kit/.claude/skills/backend-java-spring.md +198 -0
- package/kit/.claude/skills/backend-nodejs-express.md +165 -0
- package/kit/.claude/skills/backend-nodejs.md +143 -0
- package/kit/.claude/skills/backend-php-laravel.md +156 -0
- package/kit/.claude/skills/backend-python-django.md +200 -0
- package/kit/.claude/skills/backend-python-fastapi.md +169 -0
- package/kit/.claude/skills/backend-ruby-rails.md +190 -0
- package/kit/.claude/skills/backend-rust.md +182 -0
- package/kit/.claude/skills/backend-websockets.md +392 -0
- package/kit/.claude/skills/cache-redis.md +195 -0
- package/kit/.claude/skills/caching-strategies.md +100 -0
- package/kit/.claude/skills/cloud-aws.md +165 -0
- package/kit/.claude/skills/cloud-azure.md +187 -0
- package/kit/.claude/skills/cloud-cloudflare.md +74 -0
- package/kit/.claude/skills/cloud-fly.md +94 -0
- package/kit/.claude/skills/cloud-gcp.md +160 -0
- package/kit/.claude/skills/cloud-railway.md +92 -0
- package/kit/.claude/skills/cloud-render.md +70 -0
- package/kit/.claude/skills/cloud-serverless.md +68 -0
- package/kit/.claude/skills/cloud-vercel.md +76 -0
- package/kit/.claude/skills/component-patterns.md +50 -0
- package/kit/.claude/skills/content-management.md +197 -0
- package/kit/.claude/skills/cors-security.md +50 -0
- package/kit/.claude/skills/data-csv-excel.md +210 -0
- package/kit/.claude/skills/database-optimization.md +196 -0
- package/kit/.claude/skills/databases-transactions.md +68 -0
- package/kit/.claude/skills/db-cassandra.md +89 -0
- package/kit/.claude/skills/db-drizzle.md +363 -0
- package/kit/.claude/skills/db-dynamodb.md +83 -0
- package/kit/.claude/skills/db-elasticsearch.md +105 -0
- package/kit/.claude/skills/db-firebase-firestore.md +191 -0
- package/kit/.claude/skills/db-mongodb.md +198 -0
- package/kit/.claude/skills/db-mysql.md +50 -0
- package/kit/.claude/skills/db-neon.md +72 -0
- package/kit/.claude/skills/db-planetscale.md +76 -0
- package/kit/.claude/skills/db-postgresql.md +50 -0
- package/kit/.claude/skills/db-prisma.md +414 -0
- package/kit/.claude/skills/db-redis.md +50 -0
- package/kit/.claude/skills/db-sqlite.md +149 -0
- package/kit/.claude/skills/db-supabase.md +445 -0
- package/kit/.claude/skills/devops-ci-cd.md +271 -0
- package/kit/.claude/skills/devops-database-backup.md +77 -0
- package/kit/.claude/skills/devops-docker.md +93 -0
- package/kit/.claude/skills/devops-github-actions.md +82 -0
- package/kit/.claude/skills/devops-health-checks.md +50 -0
- package/kit/.claude/skills/devops-kubernetes.md +109 -0
- package/kit/.claude/skills/devops-logging.md +163 -0
- package/kit/.claude/skills/devops-monitoring.md +203 -0
- package/kit/.claude/skills/devops-pulumi.md +94 -0
- package/kit/.claude/skills/devops-secrets.md +166 -0
- package/kit/.claude/skills/devops-terraform.md +226 -0
- package/kit/.claude/skills/error-boundaries.md +84 -0
- package/kit/.claude/skills/file-storage.md +50 -0
- package/kit/.claude/skills/frontend-angular.md +104 -0
- package/kit/.claude/skills/frontend-astro.md +94 -0
- package/kit/.claude/skills/frontend-bundle-analysis.md +147 -0
- package/kit/.claude/skills/frontend-forms.md +134 -0
- package/kit/.claude/skills/frontend-htmx.md +86 -0
- package/kit/.claude/skills/frontend-nextjs.md +188 -0
- package/kit/.claude/skills/frontend-pwa.md +105 -0
- package/kit/.claude/skills/frontend-react-hooks.md +238 -0
- package/kit/.claude/skills/frontend-react.md +129 -0
- package/kit/.claude/skills/frontend-remix-advanced.md +106 -0
- package/kit/.claude/skills/frontend-remix.md +101 -0
- package/kit/.claude/skills/frontend-solid.md +99 -0
- package/kit/.claude/skills/frontend-state-management.md +134 -0
- package/kit/.claude/skills/frontend-state.md +106 -0
- package/kit/.claude/skills/frontend-svelte.md +121 -0
- package/kit/.claude/skills/frontend-testing.md +100 -0
- package/kit/.claude/skills/frontend-vite.md +94 -0
- package/kit/.claude/skills/frontend-vue.md +133 -0
- package/kit/.claude/skills/frontend-webpack.md +93 -0
- package/kit/.claude/skills/functional-programming.md +50 -0
- package/kit/.claude/skills/hooks-custom.md +50 -0
- package/kit/.claude/skills/http-server.md +50 -0
- package/kit/.claude/skills/i18n-general.md +89 -0
- package/kit/.claude/skills/i18n-localization.md +191 -0
- package/kit/.claude/skills/i18n-nextjs.md +127 -0
- package/kit/.claude/skills/infrastructure-docker-compose.md +77 -0
- package/kit/.claude/skills/infrastructure-serverless.md +177 -0
- package/kit/.claude/skills/jwt-tokens.md +50 -0
- package/kit/.claude/skills/logging-winston.md +106 -0
- package/kit/.claude/skills/messaging-kafka.md +102 -0
- package/kit/.claude/skills/messaging-rabbitmq.md +50 -0
- package/kit/.claude/skills/mobile-capacitor.md +109 -0
- package/kit/.claude/skills/mobile-expo.md +101 -0
- package/kit/.claude/skills/mobile-flutter.md +259 -0
- package/kit/.claude/skills/mobile-react-native.md +238 -0
- package/kit/.claude/skills/monitoring-apm.md +50 -0
- package/kit/.claude/skills/monitoring-error-tracking.md +217 -0
- package/kit/.claude/skills/nodejs-streams.md +168 -0
- package/kit/.claude/skills/oauth-integration.md +50 -0
- package/kit/.claude/skills/patterns-dependency-injection.md +218 -0
- package/kit/.claude/skills/patterns-factory-singleton.md +209 -0
- package/kit/.claude/skills/patterns-observer-pubsub.md +210 -0
- package/kit/.claude/skills/payment-lemonsqueezy.md +101 -0
- package/kit/.claude/skills/payment-square.md +178 -0
- package/kit/.claude/skills/payment-stripe.md +206 -0
- package/kit/.claude/skills/perf-bundle.md +100 -0
- package/kit/.claude/skills/perf-web-vitals.md +102 -0
- package/kit/.claude/skills/performance-database-connection-pooling.md +67 -0
- package/kit/.claude/skills/performance-metrics.md +73 -0
- package/kit/.claude/skills/performance-optimization.md +208 -0
- package/kit/.claude/skills/performance-web-vitals.md +169 -0
- package/kit/.claude/skills/rate-limiting.md +77 -0
- package/kit/.claude/skills/reactive-programming.md +50 -0
- package/kit/.claude/skills/realtime-database.md +50 -0
- package/kit/.claude/skills/realtime-subscriptions.md +218 -0
- package/kit/.claude/skills/saas-ab-testing.md +90 -0
- package/kit/.claude/skills/saas-analytics.md +113 -0
- package/kit/.claude/skills/saas-billing.md +106 -0
- package/kit/.claude/skills/saas-email.md +88 -0
- package/kit/.claude/skills/saas-feature-flags.md +83 -0
- package/kit/.claude/skills/saas-onboarding.md +96 -0
- package/kit/.claude/skills/saas-user-onboarding.md +207 -0
- package/kit/.claude/skills/security-encryption.md +216 -0
- package/kit/.claude/skills/security-owasp.md +212 -0
- package/kit/.claude/skills/security-secrets-rotation.md +64 -0
- package/kit/.claude/skills/seo-content.md +94 -0
- package/kit/.claude/skills/seo-technical.md +101 -0
- package/kit/.claude/skills/serverless-framework.md +151 -0
- package/kit/.claude/skills/sharding-scaling.md +50 -0
- package/kit/.claude/skills/styling-css-modules.md +219 -0
- package/kit/.claude/skills/styling-styled-components.md +206 -0
- package/kit/.claude/skills/styling-tailwind.md +206 -0
- package/kit/.claude/skills/test-e2e.md +86 -0
- package/kit/.claude/skills/test-integration.md +216 -0
- package/kit/.claude/skills/test-performance.md +162 -0
- package/kit/.claude/skills/test-tdd.md +170 -0
- package/kit/.claude/skills/test-unit.md +301 -0
- package/kit/.claude/skills/testing-accessibility.md +117 -0
- package/kit/.claude/skills/testing-contract.md +75 -0
- package/kit/.claude/skills/testing-e2e-advanced.md +50 -0
- package/kit/.claude/skills/testing-load-stress.md +79 -0
- package/kit/.claude/skills/testing-mutation.md +92 -0
- package/kit/.claude/skills/testing-snapshot.md +50 -0
- package/kit/.claude/skills/testing-vitest.md +172 -0
- package/kit/.claude/skills/tooling-biome.md +91 -0
- package/kit/.claude/skills/tooling-build-tools.md +166 -0
- package/kit/.claude/skills/tooling-bun.md +94 -0
- package/kit/.claude/skills/tooling-eslint.md +103 -0
- package/kit/.claude/skills/tooling-git.md +79 -0
- package/kit/.claude/skills/tooling-monorepo.md +162 -0
- package/kit/.claude/skills/tooling-testing-frameworks.md +207 -0
- package/kit/.claude/skills/tooling-typescript.md +156 -0
- package/kit/.claude/skills/ui-a11y.md +106 -0
- package/kit/.claude/skills/ui-framer.md +106 -0
- package/kit/.claude/skills/ui-gsap.md +102 -0
- package/kit/.claude/skills/ui-radix.md +82 -0
- package/kit/.claude/skills/ui-shadcn.md +463 -0
- package/kit/.claude/skills/ui-tailwind.md +98 -0
- package/kit/.claude/skills/ui-threejs.md +110 -0
- package/kit/.claude/skills/ui-tokens.md +97 -0
- package/kit/.claude/skills/utilities-date-time.md +170 -0
- package/kit/.claude/skills/validation-schemas.md +110 -0
- package/kit/.claude/skills/version-control-git.md +144 -0
- package/kit/.claude/skills/web-accessibility-wcag.md +102 -0
- package/kit/.claude/skills/web-astro.md +197 -0
- package/kit/.claude/skills/web-html-css.md +224 -0
- package/kit/.claude/skills/web-htmx.md +99 -0
- package/kit/.claude/skills/web-nextjs-advanced.md +202 -0
- package/kit/.claude/skills/web-remix.md +194 -0
- package/kit/.claude/skills/web-seo.md +99 -0
- package/kit/.claude/skills/web-svelte.md +234 -0
- package/kit/.claude/skills/websocket-server.md +50 -0
- package/kit/.claude/skills/writing-marketing.md +89 -0
- package/kit/.claude/skills/writing-technical.md +119 -0
- package/kit/CLAUDE.md +206 -0
- package/kit/README.md +150 -0
- package/kit/SKILLS_INDEX.md +188 -0
- package/kit/docs/README.md +3 -0
- package/kit/journals/README.md +3 -0
- package/kit/plans/README.md +3 -0
- package/package.json +3 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Error Boundaries
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Catch JavaScript errors in React component trees and show fallback UI instead of crashing the whole app.
|
|
5
|
+
|
|
6
|
+
## react-error-boundary (Recommended)
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install react-error-boundary
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { ErrorBoundary, useErrorBoundary } from 'react-error-boundary';
|
|
14
|
+
|
|
15
|
+
function ErrorFallback({ error, resetErrorBoundary }: {
|
|
16
|
+
error: Error;
|
|
17
|
+
resetErrorBoundary: () => void;
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<div role="alert" className="p-4 bg-red-50 border border-red-200 rounded">
|
|
21
|
+
<h2 className="text-red-800 font-semibold">Something went wrong</h2>
|
|
22
|
+
<pre className="text-sm text-red-600 mt-2">{error.message}</pre>
|
|
23
|
+
<button onClick={resetErrorBoundary} className="mt-3 px-4 py-2 bg-red-600 text-white rounded">
|
|
24
|
+
Try again
|
|
25
|
+
</button>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function App() {
|
|
31
|
+
return (
|
|
32
|
+
<ErrorBoundary FallbackComponent={ErrorFallback} onReset={() => window.location.reload()}>
|
|
33
|
+
<Dashboard />
|
|
34
|
+
</ErrorBoundary>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Trigger manually from async code
|
|
39
|
+
function DataLoader() {
|
|
40
|
+
const { showBoundary } = useErrorBoundary();
|
|
41
|
+
useEffect(() => { fetchData().catch(showBoundary); }, []);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Next.js App Router Error Boundary
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
// app/dashboard/error.tsx
|
|
49
|
+
'use client';
|
|
50
|
+
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
|
|
51
|
+
useEffect(() => { console.error(error); }, [error]);
|
|
52
|
+
return (
|
|
53
|
+
<div>
|
|
54
|
+
<h2>Dashboard failed to load</h2>
|
|
55
|
+
<button onClick={reset}>Retry</button>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Class Component (Vanilla React)
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
class ErrorBoundary extends Component<{ children: ReactNode; fallback?: ReactNode }, { hasError: boolean }> {
|
|
65
|
+
state = { hasError: false };
|
|
66
|
+
static getDerivedStateFromError() { return { hasError: true }; }
|
|
67
|
+
componentDidCatch(error: Error, info: ErrorInfo) {
|
|
68
|
+
Sentry.captureException(error, { extra: { componentStack: info.componentStack } });
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
return this.state.hasError ? (this.props.fallback ?? <h2>Something went wrong</h2>) : this.props.children;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Best Practices
|
|
77
|
+
- Place error boundaries at route level AND around isolated features
|
|
78
|
+
- Always send caught errors to Sentry/Datadog
|
|
79
|
+
- Give users an actionable recovery option (retry, reload)
|
|
80
|
+
- Use `resetKeys` prop to auto-reset on route change
|
|
81
|
+
|
|
82
|
+
## Resources
|
|
83
|
+
- [react-error-boundary](https://www.npmjs.com/package/react-error-boundary)
|
|
84
|
+
- [React error boundary docs](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Production-Ready Skill Implementation
|
|
2
|
+
|
|
3
|
+
## Setup & Installation
|
|
4
|
+
|
|
5
|
+
Detailed installation and configuration steps for the technology.
|
|
6
|
+
|
|
7
|
+
## Core Concepts
|
|
8
|
+
|
|
9
|
+
Fundamental patterns and approaches.
|
|
10
|
+
|
|
11
|
+
## Implementation Examples
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// Real production code examples
|
|
15
|
+
// with error handling and best practices
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Advanced Patterns
|
|
19
|
+
|
|
20
|
+
Complex scenarios and optimization techniques.
|
|
21
|
+
|
|
22
|
+
## Performance Optimization
|
|
23
|
+
|
|
24
|
+
Tips for maximizing efficiency and speed.
|
|
25
|
+
|
|
26
|
+
## Security Considerations
|
|
27
|
+
|
|
28
|
+
Security best practices specific to this technology.
|
|
29
|
+
|
|
30
|
+
## Testing
|
|
31
|
+
|
|
32
|
+
How to properly test this feature.
|
|
33
|
+
|
|
34
|
+
## Monitoring & Debugging
|
|
35
|
+
|
|
36
|
+
Tools and techniques for production support.
|
|
37
|
+
|
|
38
|
+
## Best Practices
|
|
39
|
+
|
|
40
|
+
✅ Key recommendations
|
|
41
|
+
✅ Common pitfalls to avoid
|
|
42
|
+
✅ Performance considerations
|
|
43
|
+
✅ Security measures
|
|
44
|
+
✅ Production readiness
|
|
45
|
+
|
|
46
|
+
## Resources
|
|
47
|
+
|
|
48
|
+
- Official documentation
|
|
49
|
+
- Community guides
|
|
50
|
+
- Performance benchmarks
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Angular
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Angular is a full-featured TypeScript framework with dependency injection, RxJS reactivity, and a strong opinionated structure.
|
|
5
|
+
|
|
6
|
+
## Setup
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install -g @angular/cli
|
|
10
|
+
ng new my-app --standalone --routing --style=css
|
|
11
|
+
cd my-app
|
|
12
|
+
ng serve
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Standalone Component
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
// src/app/users/user-list.component.ts
|
|
19
|
+
import { Component, OnInit, inject } from '@angular/core';
|
|
20
|
+
import { AsyncPipe } from '@angular/common';
|
|
21
|
+
import { UserService } from './user.service';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'app-user-list',
|
|
25
|
+
standalone: true,
|
|
26
|
+
imports: [AsyncPipe],
|
|
27
|
+
template: `
|
|
28
|
+
<ul>
|
|
29
|
+
@for (user of users$ | async; track user.id) {
|
|
30
|
+
<li>{{ user.name }}</li>
|
|
31
|
+
}
|
|
32
|
+
</ul>
|
|
33
|
+
`
|
|
34
|
+
})
|
|
35
|
+
export class UserListComponent implements OnInit {
|
|
36
|
+
private userService = inject(UserService);
|
|
37
|
+
users$ = this.userService.getAll();
|
|
38
|
+
|
|
39
|
+
ngOnInit() { this.users$.subscribe(); }
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Service with HttpClient
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { Injectable, inject } from '@angular/core';
|
|
47
|
+
import { HttpClient } from '@angular/common/http';
|
|
48
|
+
import { Observable } from 'rxjs';
|
|
49
|
+
|
|
50
|
+
interface User { id: string; name: string; email: string; }
|
|
51
|
+
|
|
52
|
+
@Injectable({ providedIn: 'root' })
|
|
53
|
+
export class UserService {
|
|
54
|
+
private http = inject(HttpClient);
|
|
55
|
+
private API = '/api/users';
|
|
56
|
+
|
|
57
|
+
getAll(): Observable<User[]> { return this.http.get<User[]>(this.API); }
|
|
58
|
+
getById(id: string): Observable<User> { return this.http.get<User>(`${this.API}/${id}`); }
|
|
59
|
+
create(data: Omit<User, 'id'>): Observable<User> { return this.http.post<User>(this.API, data); }
|
|
60
|
+
update(id: string, data: Partial<User>): Observable<User> { return this.http.patch<User>(`${this.API}/${id}`, data); }
|
|
61
|
+
delete(id: string): Observable<void> { return this.http.delete<void>(`${this.API}/${id}`); }
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Reactive Forms
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { Component, inject } from '@angular/core';
|
|
69
|
+
import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
70
|
+
|
|
71
|
+
@Component({
|
|
72
|
+
standalone: true,
|
|
73
|
+
imports: [ReactiveFormsModule],
|
|
74
|
+
template: `
|
|
75
|
+
<form [formGroup]="form" (ngSubmit)="onSubmit()">
|
|
76
|
+
<input formControlName="email" type="email" />
|
|
77
|
+
@if (form.get('email')?.errors?.['required']) {
|
|
78
|
+
<span>Email is required</span>
|
|
79
|
+
}
|
|
80
|
+
<button type="submit" [disabled]="form.invalid">Submit</button>
|
|
81
|
+
</form>
|
|
82
|
+
`
|
|
83
|
+
})
|
|
84
|
+
export class LoginComponent {
|
|
85
|
+
private fb = inject(FormBuilder);
|
|
86
|
+
form = this.fb.group({
|
|
87
|
+
email: ['', [Validators.required, Validators.email]],
|
|
88
|
+
password: ['', [Validators.required, Validators.minLength(8)]]
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
onSubmit() {
|
|
92
|
+
if (this.form.valid) console.log(this.form.value);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Best Practices
|
|
98
|
+
- Use standalone components (Angular 17+) instead of NgModules
|
|
99
|
+
- Use `inject()` instead of constructor injection for cleaner code
|
|
100
|
+
- Use signals for local state, RxJS for async streams
|
|
101
|
+
- Lazy load routes: `loadComponent: () => import('./component')`
|
|
102
|
+
|
|
103
|
+
## Resources
|
|
104
|
+
- [Angular docs](https://angular.dev)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Astro
|
|
2
|
+
|
|
3
|
+
Build fast, content-focused websites with zero JavaScript by default (islands architecture).
|
|
4
|
+
|
|
5
|
+
## Basic Setup
|
|
6
|
+
|
|
7
|
+
```astro
|
|
8
|
+
---
|
|
9
|
+
// Component code (runs at build time)
|
|
10
|
+
const title = "My Site";
|
|
11
|
+
const posts = await fetch('/api/posts').then(r => r.json());
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<html>
|
|
15
|
+
<body>
|
|
16
|
+
<h1>{title}</h1>
|
|
17
|
+
<ul>
|
|
18
|
+
{posts.map(post => (
|
|
19
|
+
<li><a href={post.url}>{post.title}</a></li>
|
|
20
|
+
))}
|
|
21
|
+
</ul>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Islands Architecture
|
|
27
|
+
|
|
28
|
+
```astro
|
|
29
|
+
---
|
|
30
|
+
import Counter from '../components/Counter.jsx';
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
<main>
|
|
34
|
+
<h1>Static content</h1>
|
|
35
|
+
<!-- Island: interactive React component -->
|
|
36
|
+
<Counter client:load />
|
|
37
|
+
</main>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Routing
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
src/pages/
|
|
44
|
+
├── index.astro # /
|
|
45
|
+
├── about.astro # /about
|
|
46
|
+
├── blog/
|
|
47
|
+
│ ├── index.astro # /blog
|
|
48
|
+
│ └── [slug].astro # /blog/:slug
|
|
49
|
+
└── api/
|
|
50
|
+
└── posts.ts # /api/posts
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Dynamic Routes
|
|
54
|
+
|
|
55
|
+
```astro
|
|
56
|
+
---
|
|
57
|
+
export async function getStaticPaths() {
|
|
58
|
+
const posts = await fetchPosts();
|
|
59
|
+
return posts.map(post => ({
|
|
60
|
+
params: { slug: post.slug },
|
|
61
|
+
props: { post }
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const { slug } = Astro.params;
|
|
66
|
+
const { post } = Astro.props;
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
<article>
|
|
70
|
+
<h1>{post.title}</h1>
|
|
71
|
+
<Fragment set:html={post.content} />
|
|
72
|
+
</article>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Performance Benefits
|
|
76
|
+
|
|
77
|
+
- Zero JavaScript by default
|
|
78
|
+
- Build-time HTML generation
|
|
79
|
+
- Partial hydration for interactive components
|
|
80
|
+
- Fast page loads, excellent Core Web Vitals
|
|
81
|
+
- Great for content sites, blogs, docs
|
|
82
|
+
|
|
83
|
+
## Best Practices
|
|
84
|
+
|
|
85
|
+
1. Keep islands small and focused
|
|
86
|
+
2. Use static rendering where possible
|
|
87
|
+
3. Lazy load interactive components
|
|
88
|
+
4. Optimize images aggressively
|
|
89
|
+
5. Use content collections for organized content
|
|
90
|
+
|
|
91
|
+
## Resources
|
|
92
|
+
|
|
93
|
+
- [Astro Documentation](https://docs.astro.build/)
|
|
94
|
+
- [Islands Architecture](https://docs.astro.build/en/concepts/islands/)
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Bundle Analysis & Optimization
|
|
2
|
+
|
|
3
|
+
Analyzing and reducing bundle sizes.
|
|
4
|
+
|
|
5
|
+
## Webpack Bundle Analyzer
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D webpack-bundle-analyzer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
// webpack.config.js
|
|
13
|
+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
|
14
|
+
.BundleAnalyzerPlugin;
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
plugins: [
|
|
18
|
+
new BundleAnalyzerPlugin({
|
|
19
|
+
analyzerMode: 'static',
|
|
20
|
+
openAnalyzer: true,
|
|
21
|
+
reportFilename: 'bundle-report.html'
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Size Limits
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"bundlesize": [
|
|
32
|
+
{
|
|
33
|
+
"path": "./dist/main.js",
|
|
34
|
+
"maxSize": "100kb"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "./dist/vendor.js",
|
|
38
|
+
"maxSize": "200kb"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Code Splitting
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// Dynamic import
|
|
48
|
+
const HeavyComponent = lazy(() => import('./HeavyComponent'));
|
|
49
|
+
|
|
50
|
+
// Route-based splitting
|
|
51
|
+
const Dashboard = lazy(() => import('./pages/Dashboard'));
|
|
52
|
+
const Settings = lazy(() => import('./pages/Settings'));
|
|
53
|
+
|
|
54
|
+
// Tree shaking
|
|
55
|
+
import { debounce } from 'lodash-es'; // ESM import
|
|
56
|
+
import { debounce } from 'lodash'; // CommonJS (includes all)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Next.js Bundle Analysis
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Analyze bundle
|
|
63
|
+
ANALYZE=true npm run build
|
|
64
|
+
|
|
65
|
+
# Generate report
|
|
66
|
+
npm install -D @next/bundle-analyzer
|
|
67
|
+
|
|
68
|
+
# next.config.js
|
|
69
|
+
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|
70
|
+
enabled: process.env.ANALYZE === 'true',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
module.exports = withBundleAnalyzer({});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Dependency Audit
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Find unused dependencies
|
|
80
|
+
npm install -D depcheck
|
|
81
|
+
npx depcheck
|
|
82
|
+
|
|
83
|
+
# Check for vulnerabilities
|
|
84
|
+
npm audit
|
|
85
|
+
npm audit fix
|
|
86
|
+
|
|
87
|
+
# Check bundle impact
|
|
88
|
+
npm install -D bundlesize
|
|
89
|
+
npm run bundlesize
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Optimization Strategies
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
// 1. Remove unused packages
|
|
96
|
+
// Before: 2.5MB
|
|
97
|
+
// Remove lodash, moment (use date-fns)
|
|
98
|
+
// After: 1.8MB
|
|
99
|
+
|
|
100
|
+
// 2. Code splitting
|
|
101
|
+
// Route-based splitting
|
|
102
|
+
const Home = lazy(() => import('./pages/Home'));
|
|
103
|
+
const Dashboard = lazy(() => import('./pages/Dashboard'));
|
|
104
|
+
|
|
105
|
+
// 3. Lazy load heavy libraries
|
|
106
|
+
// Only load PDF viewer when needed
|
|
107
|
+
const PDFViewer = lazy(() => import('./PDFViewer'));
|
|
108
|
+
|
|
109
|
+
// 4. Use lighter alternatives
|
|
110
|
+
// moment.js (67KB) → date-fns (13KB)
|
|
111
|
+
// lodash (70KB) → lodash-es with tree shaking
|
|
112
|
+
|
|
113
|
+
// 5. Minification
|
|
114
|
+
// webpack minifies by default
|
|
115
|
+
// Next.js compresses with gzip
|
|
116
|
+
|
|
117
|
+
// 6. Remove debug code
|
|
118
|
+
if (process.env.NODE_ENV === 'production') {
|
|
119
|
+
console.log = () => {}; // Remove logs
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Monitoring Bundle
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
// src/utils/bundleMetrics.ts
|
|
127
|
+
if (typeof window !== 'undefined') {
|
|
128
|
+
console.log('Bundle metrics:', {
|
|
129
|
+
initialLoad: performance.timing.loadEventEnd - performance.timing.navigationStart,
|
|
130
|
+
firstPaint: performance.getEntriesByName('first-paint')[0],
|
|
131
|
+
resources: performance.getEntriesByType('resource').length
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Best Practices
|
|
137
|
+
|
|
138
|
+
✅ **Regular audits** - Monitor bundle size
|
|
139
|
+
✅ **Code splitting** - Chunk by route or feature
|
|
140
|
+
✅ **Tree shaking** - Use ES modules
|
|
141
|
+
✅ **Lazy loading** - Load on demand
|
|
142
|
+
✅ **Compression** - Enable gzip
|
|
143
|
+
|
|
144
|
+
## Resources
|
|
145
|
+
|
|
146
|
+
- [Webpack Bundle Analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer)
|
|
147
|
+
- [Web.dev Bundle](https://web.dev/reduce-javascript-for-faster-site-performance/)
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Form Handling & Validation
|
|
2
|
+
|
|
3
|
+
Building robust, validated forms.
|
|
4
|
+
|
|
5
|
+
## React Hook Form
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { useForm } from 'react-hook-form';
|
|
9
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
|
|
12
|
+
const schema = z.object({
|
|
13
|
+
email: z.string().email(),
|
|
14
|
+
password: z.string().min(8),
|
|
15
|
+
agreeToTerms: z.boolean().default(false)
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
type FormData = z.infer<typeof schema>;
|
|
19
|
+
|
|
20
|
+
export function LoginForm() {
|
|
21
|
+
const {
|
|
22
|
+
register,
|
|
23
|
+
handleSubmit,
|
|
24
|
+
formState: { errors, isSubmitting },
|
|
25
|
+
reset
|
|
26
|
+
} = useForm<FormData>({
|
|
27
|
+
resolver: zodResolver(schema)
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const onSubmit = async (data: FormData) => {
|
|
31
|
+
try {
|
|
32
|
+
await loginUser(data);
|
|
33
|
+
reset();
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error('Login failed:', error);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<form onSubmit={handleSubmit(onSubmit)}>
|
|
41
|
+
<input
|
|
42
|
+
{...register('email')}
|
|
43
|
+
type="email"
|
|
44
|
+
placeholder="Email"
|
|
45
|
+
/>
|
|
46
|
+
{errors.email && <span>{errors.email.message}</span>}
|
|
47
|
+
|
|
48
|
+
<input
|
|
49
|
+
{...register('password')}
|
|
50
|
+
type="password"
|
|
51
|
+
placeholder="Password"
|
|
52
|
+
/>
|
|
53
|
+
{errors.password && <span>{errors.password.message}</span>}
|
|
54
|
+
|
|
55
|
+
<label>
|
|
56
|
+
<input {...register('agreeToTerms')} type="checkbox" />
|
|
57
|
+
I agree to terms
|
|
58
|
+
</label>
|
|
59
|
+
|
|
60
|
+
<button type="submit" disabled={isSubmitting}>
|
|
61
|
+
{isSubmitting ? 'Logging in...' : 'Login'}
|
|
62
|
+
</button>
|
|
63
|
+
</form>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Formik Alternative
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { Formik, Form, Field, ErrorMessage } from 'formik';
|
|
72
|
+
import * as Yup from 'yup';
|
|
73
|
+
|
|
74
|
+
const validationSchema = Yup.object({
|
|
75
|
+
email: Yup.string().email().required(),
|
|
76
|
+
password: Yup.string().min(8).required()
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export function SignupForm() {
|
|
80
|
+
return (
|
|
81
|
+
<Formik
|
|
82
|
+
initialValues={{ email: '', password: '' }}
|
|
83
|
+
validationSchema={validationSchema}
|
|
84
|
+
onSubmit={async (values) => {
|
|
85
|
+
await registerUser(values);
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
<Form>
|
|
89
|
+
<Field name="email" type="email" placeholder="Email" />
|
|
90
|
+
<ErrorMessage name="email" component="div" />
|
|
91
|
+
|
|
92
|
+
<Field name="password" type="password" placeholder="Password" />
|
|
93
|
+
<ErrorMessage name="password" component="div" />
|
|
94
|
+
|
|
95
|
+
<button type="submit">Sign up</button>
|
|
96
|
+
</Form>
|
|
97
|
+
</Formik>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Advanced Validation
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
const schema = z.object({
|
|
106
|
+
password: z.string().min(8).max(50),
|
|
107
|
+
confirmPassword: z.string()
|
|
108
|
+
}).refine((data) => data.password === data.confirmPassword, {
|
|
109
|
+
message: "Passwords don't match",
|
|
110
|
+
path: ["confirmPassword"]
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Field-level validation
|
|
114
|
+
const validateEmail = async (email: string) => {
|
|
115
|
+
const exists = await checkEmailExists(email);
|
|
116
|
+
if (exists) {
|
|
117
|
+
throw new Error('Email already registered');
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Best Practices
|
|
123
|
+
|
|
124
|
+
✅ **Real-time validation** - Immediate feedback
|
|
125
|
+
✅ **Field-level errors** - Show errors next to fields
|
|
126
|
+
✅ **Disabled submit** - During submission
|
|
127
|
+
✅ **Clear labels** - Accessible forms
|
|
128
|
+
✅ **CSRF protection** - Validate on server
|
|
129
|
+
|
|
130
|
+
## Resources
|
|
131
|
+
|
|
132
|
+
- [React Hook Form](https://react-hook-form.com/)
|
|
133
|
+
- [Formik](https://formik.org/)
|
|
134
|
+
- [Zod Validation](https://zod.dev/)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# HTMX
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
HTMX extends HTML with AJAX, WebSockets, and SSE attributes — no JavaScript required for common patterns.
|
|
5
|
+
|
|
6
|
+
## Core Attributes
|
|
7
|
+
|
|
8
|
+
```html
|
|
9
|
+
<!-- GET request on click, swap into #result -->
|
|
10
|
+
<button hx-get="/api/users" hx-target="#result" hx-swap="innerHTML">
|
|
11
|
+
Load Users
|
|
12
|
+
</button>
|
|
13
|
+
<div id="result"></div>
|
|
14
|
+
|
|
15
|
+
<!-- POST form, replace form with response -->
|
|
16
|
+
<form hx-post="/api/users" hx-target="#user-list" hx-swap="beforeend">
|
|
17
|
+
<input name="email" type="email" required />
|
|
18
|
+
<input name="name" required />
|
|
19
|
+
<button type="submit">Add User</button>
|
|
20
|
+
</form>
|
|
21
|
+
|
|
22
|
+
<!-- Delete with confirmation, remove row -->
|
|
23
|
+
<tr id="user-1">
|
|
24
|
+
<td>John</td>
|
|
25
|
+
<td>
|
|
26
|
+
<button hx-delete="/api/users/1"
|
|
27
|
+
hx-confirm="Delete this user?"
|
|
28
|
+
hx-target="#user-1"
|
|
29
|
+
hx-swap="outerHTML">Delete</button>
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
|
|
33
|
+
<!-- Live search with debounce -->
|
|
34
|
+
<input type="search" name="q"
|
|
35
|
+
hx-get="/api/search"
|
|
36
|
+
hx-trigger="keyup changed delay:300ms"
|
|
37
|
+
hx-target="#results" />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Server Response (Express/Node.js)
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import express from 'express';
|
|
44
|
+
const app = express();
|
|
45
|
+
app.use(express.urlencoded({ extended: true }));
|
|
46
|
+
|
|
47
|
+
// Return HTML fragments
|
|
48
|
+
app.get('/api/users', async (req, res) => {
|
|
49
|
+
const users = await db.user.findMany();
|
|
50
|
+
const html = users.map(u => `<li>${u.name} (${u.email})</li>`).join('');
|
|
51
|
+
res.send(`<ul>${html}</ul>`);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
app.post('/api/users', async (req, res) => {
|
|
55
|
+
const user = await db.user.create({ data: req.body });
|
|
56
|
+
res.send(`<li id="user-${user.id}">${user.name}</li>`);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
app.delete('/api/users/:id', async (req, res) => {
|
|
60
|
+
await db.user.delete({ where: { id: req.params.id } });
|
|
61
|
+
res.send(''); // Empty response removes the element
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Loading Indicators
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<button hx-get="/api/slow-data" hx-target="#result">
|
|
69
|
+
Load Data
|
|
70
|
+
<span class="htmx-indicator">Loading...</span>
|
|
71
|
+
</button>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
.htmx-indicator { display: none; }
|
|
76
|
+
.htmx-request .htmx-indicator { display: inline; }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Best Practices
|
|
80
|
+
- Return HTML fragments, not JSON
|
|
81
|
+
- Use `hx-boost` on `<a>` and `<form>` tags to progressively enhance all links
|
|
82
|
+
- Combine with Alpine.js for local state that doesn't need server round-trips
|
|
83
|
+
- Use `HX-Trigger` response header to trigger events after requests
|
|
84
|
+
|
|
85
|
+
## Resources
|
|
86
|
+
- [HTMX docs](https://htmx.org/docs/)
|