claudeinone-cli 1.0.1 → 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/dist/index.js +16 -1
- 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,79 @@
|
|
|
1
|
+
# Git Workflows
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Branch strategies, commit conventions, and team workflows for effective version control.
|
|
5
|
+
|
|
6
|
+
## Conventional Commits
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# Format: <type>(<scope>): <description>
|
|
10
|
+
git commit -m "feat(auth): add magic link authentication"
|
|
11
|
+
git commit -m "fix(api): handle null user in session middleware"
|
|
12
|
+
git commit -m "chore: update dependencies"
|
|
13
|
+
git commit -m "docs: add API authentication guide"
|
|
14
|
+
git commit -m "refactor(db): extract user repository pattern"
|
|
15
|
+
git commit -m "test(auth): add integration tests for login flow"
|
|
16
|
+
git commit -m "perf(queries): add index on user email column"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Feature Branch Workflow
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Create feature branch from main
|
|
23
|
+
git checkout main && git pull origin main
|
|
24
|
+
git checkout -b feat/user-authentication
|
|
25
|
+
|
|
26
|
+
# Work and commit
|
|
27
|
+
git add src/auth/
|
|
28
|
+
git commit -m "feat(auth): implement JWT token generation"
|
|
29
|
+
|
|
30
|
+
# Keep branch updated
|
|
31
|
+
git fetch origin main
|
|
32
|
+
git rebase origin/main # or merge
|
|
33
|
+
|
|
34
|
+
# Push for PR
|
|
35
|
+
git push -u origin feat/user-authentication
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Git Aliases (useful shortcuts)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git config --global alias.st "status -sb"
|
|
42
|
+
git config --global alias.lg "log --oneline --graph --decorate --all"
|
|
43
|
+
git config --global alias.undo "reset HEAD~1 --mixed"
|
|
44
|
+
git config --global alias.amend "commit --amend --no-edit"
|
|
45
|
+
git config --global alias.br "branch --sort=-committerdate"
|
|
46
|
+
git config --global alias.save "!git add -A && git commit -m 'SAVEPOINT'"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Commit Message Hook (commitlint)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install -D @commitlint/cli @commitlint/config-conventional
|
|
53
|
+
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
|
|
54
|
+
echo "npx commitlint --edit $1" > .husky/commit-msg
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Git Flow Commands
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Start a release
|
|
61
|
+
git checkout -b release/1.2.0 main
|
|
62
|
+
npm version minor # bumps package.json to 1.2.0
|
|
63
|
+
|
|
64
|
+
# Hotfix
|
|
65
|
+
git checkout -b hotfix/fix-login-crash main
|
|
66
|
+
git commit -m "fix: resolve null pointer in auth middleware"
|
|
67
|
+
git checkout main && git merge hotfix/fix-login-crash --no-ff
|
|
68
|
+
git tag -a v1.2.1 -m "Hotfix: login crash"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Best Practices
|
|
72
|
+
- Use conventional commits for automated changelogs
|
|
73
|
+
- Squash commits before merging feature branches
|
|
74
|
+
- Protect `main` branch — require PRs and CI checks
|
|
75
|
+
- Write imperative commit messages: "Add feature" not "Added feature"
|
|
76
|
+
|
|
77
|
+
## Resources
|
|
78
|
+
- [Conventional Commits](https://www.conventionalcommits.org)
|
|
79
|
+
- [Pro Git book](https://git-scm.com/book)
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Monorepo Management
|
|
2
|
+
|
|
3
|
+
Organizing multiple related projects in a single repository.
|
|
4
|
+
|
|
5
|
+
## Turborepo Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D turbo
|
|
9
|
+
npx turbo init
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"turbo": {
|
|
15
|
+
"tasks": {
|
|
16
|
+
"build": {
|
|
17
|
+
"outputs": ["dist/**"],
|
|
18
|
+
"cache": true
|
|
19
|
+
},
|
|
20
|
+
"test": {
|
|
21
|
+
"outputs": [".coverage/**"]
|
|
22
|
+
},
|
|
23
|
+
"lint": {
|
|
24
|
+
"outputs": []
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Monorepo Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
monorepo/
|
|
35
|
+
├── apps/
|
|
36
|
+
│ ├── web/
|
|
37
|
+
│ │ ├── src/
|
|
38
|
+
│ │ └── package.json
|
|
39
|
+
│ └── api/
|
|
40
|
+
│ ├── src/
|
|
41
|
+
│ └── package.json
|
|
42
|
+
├── packages/
|
|
43
|
+
│ ├── ui/
|
|
44
|
+
│ │ ├── src/
|
|
45
|
+
│ │ └── package.json
|
|
46
|
+
│ ├── utils/
|
|
47
|
+
│ │ ├── src/
|
|
48
|
+
│ │ └── package.json
|
|
49
|
+
│ └── config/
|
|
50
|
+
│ └── package.json
|
|
51
|
+
├── turbo.json
|
|
52
|
+
└── package.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Workspace Dependencies
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"name": "web",
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@monorepo/ui": "workspace:*",
|
|
62
|
+
"@monorepo/utils": "workspace:*"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Shared Configuration
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
// packages/config/eslint.js
|
|
71
|
+
module.exports = {
|
|
72
|
+
extends: ['next/core-web-vitals'],
|
|
73
|
+
rules: {
|
|
74
|
+
'react/react-in-jsx-scope': 'off'
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// apps/web/.eslintrc.js
|
|
79
|
+
module.exports = {
|
|
80
|
+
extends: ['@monorepo/config/eslint']
|
|
81
|
+
};
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Running Tasks
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Run task in all workspaces
|
|
88
|
+
turbo run build
|
|
89
|
+
|
|
90
|
+
# Run only in changed workspaces
|
|
91
|
+
turbo run build --only-affected
|
|
92
|
+
|
|
93
|
+
# Run with filter
|
|
94
|
+
turbo run build --filter=@monorepo/ui
|
|
95
|
+
|
|
96
|
+
# Run in parallel
|
|
97
|
+
turbo run build test --parallel
|
|
98
|
+
|
|
99
|
+
# Watch mode
|
|
100
|
+
turbo run dev
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Pnpm Workspace
|
|
104
|
+
|
|
105
|
+
```yaml
|
|
106
|
+
# pnpm-workspace.yaml
|
|
107
|
+
packages:
|
|
108
|
+
- 'apps/*'
|
|
109
|
+
- 'packages/*'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Install dependencies across workspaces
|
|
114
|
+
pnpm install
|
|
115
|
+
|
|
116
|
+
# Add dependency to specific workspace
|
|
117
|
+
pnpm add react --filter @monorepo/ui
|
|
118
|
+
|
|
119
|
+
# Run script in workspace
|
|
120
|
+
pnpm --filter @monorepo/ui build
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## CI/CD Integration
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
# .github/workflows/ci.yml
|
|
127
|
+
name: CI
|
|
128
|
+
on: [push, pull_request]
|
|
129
|
+
|
|
130
|
+
jobs:
|
|
131
|
+
test:
|
|
132
|
+
runs-on: ubuntu-latest
|
|
133
|
+
steps:
|
|
134
|
+
- uses: actions/checkout@v3
|
|
135
|
+
- uses: actions/setup-node@v3
|
|
136
|
+
|
|
137
|
+
- name: Install dependencies
|
|
138
|
+
run: pnpm install
|
|
139
|
+
|
|
140
|
+
- name: Build
|
|
141
|
+
run: turbo run build --filter=[HEAD~1]
|
|
142
|
+
|
|
143
|
+
- name: Test
|
|
144
|
+
run: turbo run test
|
|
145
|
+
|
|
146
|
+
- name: Lint
|
|
147
|
+
run: turbo run lint
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Best Practices
|
|
151
|
+
|
|
152
|
+
✅ **Clear boundaries** - Each package has single purpose
|
|
153
|
+
✅ **Shared dependencies** - Hoist common packages
|
|
154
|
+
✅ **Version consistency** - Lock versions across workspaces
|
|
155
|
+
✅ **Internal dependencies** - Reference via workspace protocol
|
|
156
|
+
✅ **Documentation** - Document workspace structure
|
|
157
|
+
|
|
158
|
+
## Resources
|
|
159
|
+
|
|
160
|
+
- [Turborepo Documentation](https://turbo.build/repo/docs)
|
|
161
|
+
- [pnpm Workspaces](https://pnpm.io/workspaces)
|
|
162
|
+
- [Nx Monorepo](https://nx.dev/)
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Testing Frameworks
|
|
2
|
+
|
|
3
|
+
Overview of popular testing tools and frameworks.
|
|
4
|
+
|
|
5
|
+
## Vitest (Fast Unit Testing)
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
9
|
+
|
|
10
|
+
describe('Math Utils', () => {
|
|
11
|
+
it('should add numbers', () => {
|
|
12
|
+
expect(add(2, 3)).toBe(5);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should handle negative numbers', () => {
|
|
16
|
+
expect(add(-2, 3)).toBe(1);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// Mocking
|
|
21
|
+
vi.mock('./database');
|
|
22
|
+
const mockDb = vi.hoisted(() => ({
|
|
23
|
+
query: vi.fn()
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
describe('UserService', () => {
|
|
27
|
+
it('should fetch user from database', async () => {
|
|
28
|
+
mockDb.query.mockResolvedValueOnce({ id: '1', name: 'John' });
|
|
29
|
+
|
|
30
|
+
const user = await getUserService().getUser('1');
|
|
31
|
+
|
|
32
|
+
expect(user.name).toBe('John');
|
|
33
|
+
expect(mockDb.query).toHaveBeenCalledWith('SELECT * FROM users WHERE id = 1');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Jest (Industry Standard)
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { jest } from '@jest/globals';
|
|
42
|
+
|
|
43
|
+
describe('PaymentService', () => {
|
|
44
|
+
let paymentService: PaymentService;
|
|
45
|
+
|
|
46
|
+
beforeEach(() => {
|
|
47
|
+
paymentService = new PaymentService();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should process payment', async () => {
|
|
51
|
+
const result = await paymentService.process({
|
|
52
|
+
amount: 100,
|
|
53
|
+
currency: 'USD'
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
expect(result.status).toBe('success');
|
|
57
|
+
expect(result).toHaveProperty('transactionId');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should retry on failure', async () => {
|
|
61
|
+
const processSpy = jest.spyOn(paymentService, 'process');
|
|
62
|
+
processSpy.mockRejectedValueOnce(new Error('Network error'));
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
await paymentService.process({ amount: 100 });
|
|
66
|
+
} catch (e) {
|
|
67
|
+
expect(processSpy).toHaveBeenCalled();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Testing Library (UI Testing)
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
|
77
|
+
import { Counter } from './Counter';
|
|
78
|
+
|
|
79
|
+
describe('Counter Component', () => {
|
|
80
|
+
it('should increment count on button click', () => {
|
|
81
|
+
render(<Counter />);
|
|
82
|
+
|
|
83
|
+
const button = screen.getByRole('button', { name: /increment/i });
|
|
84
|
+
fireEvent.click(button);
|
|
85
|
+
|
|
86
|
+
expect(screen.getByText('Count: 1')).toBeInTheDocument();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('should handle async operations', async () => {
|
|
90
|
+
render(<UserProfile userId="1" />);
|
|
91
|
+
|
|
92
|
+
await waitFor(() => {
|
|
93
|
+
expect(screen.getByText('John Doe')).toBeInTheDocument();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Cypress (E2E Testing)
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
describe('Login Flow', () => {
|
|
103
|
+
beforeEach(() => {
|
|
104
|
+
cy.visit('/login');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should login with valid credentials', () => {
|
|
108
|
+
cy.get('input[name="email"]').type('user@example.com');
|
|
109
|
+
cy.get('input[name="password"]').type('password123');
|
|
110
|
+
cy.get('button:contains("Sign In")').click();
|
|
111
|
+
|
|
112
|
+
cy.url().should('include', '/dashboard');
|
|
113
|
+
cy.get('h1:contains("Dashboard")').should('be.visible');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('should show error with invalid credentials', () => {
|
|
117
|
+
cy.get('input[name="email"]').type('invalid@example.com');
|
|
118
|
+
cy.get('input[name="password"]').type('wrong');
|
|
119
|
+
cy.get('button:contains("Sign In")').click();
|
|
120
|
+
|
|
121
|
+
cy.get('[role="alert"]').should('contain', 'Invalid credentials');
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## NightwatchJS
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
module.exports = {
|
|
130
|
+
'Login with valid credentials': (browser) => {
|
|
131
|
+
browser
|
|
132
|
+
.navigateTo('http://localhost:3000/login')
|
|
133
|
+
.setValue('input[name="email"]', 'user@example.com')
|
|
134
|
+
.setValue('input[name="password"]', 'password123')
|
|
135
|
+
.click('button[type="submit"]')
|
|
136
|
+
.waitForElementVisible('h1.dashboard-title')
|
|
137
|
+
.assert.urlEquals('http://localhost:3000/dashboard')
|
|
138
|
+
.end();
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Mocha + Chai
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
import { expect } from 'chai';
|
|
147
|
+
import { greet } from './greeting';
|
|
148
|
+
|
|
149
|
+
describe('Greeting', () => {
|
|
150
|
+
it('should return greeting message', () => {
|
|
151
|
+
const result = greet('John');
|
|
152
|
+
expect(result).to.equal('Hello, John!');
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it('should handle empty name', () => {
|
|
156
|
+
const result = greet('');
|
|
157
|
+
expect(result).to.equal('Hello!');
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('should be a string', () => {
|
|
161
|
+
const result = greet('Jane');
|
|
162
|
+
expect(result).to.be.a('string');
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Test Coverage
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Generate coverage report
|
|
171
|
+
jest --coverage
|
|
172
|
+
|
|
173
|
+
# Show coverage for specific file
|
|
174
|
+
vitest --coverage src/utils.ts
|
|
175
|
+
|
|
176
|
+
# Minimum coverage threshold
|
|
177
|
+
# package.json
|
|
178
|
+
{
|
|
179
|
+
"jest": {
|
|
180
|
+
"collectCoverageFrom": ["src/**/*.ts"],
|
|
181
|
+
"coveragePathIgnorePatterns": ["/node_modules/"],
|
|
182
|
+
"coverageThreshold": {
|
|
183
|
+
"global": {
|
|
184
|
+
"branches": 80,
|
|
185
|
+
"functions": 80,
|
|
186
|
+
"lines": 80,
|
|
187
|
+
"statements": 80
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Best Practices
|
|
195
|
+
|
|
196
|
+
✅ **Test behavior, not implementation** - Focus on outputs
|
|
197
|
+
✅ **Meaningful test names** - Describe what is being tested
|
|
198
|
+
✅ **DRY test code** - Extract common setup
|
|
199
|
+
✅ **Fast tests** - Mock external dependencies
|
|
200
|
+
✅ **Coverage** - Aim for 80%+ coverage
|
|
201
|
+
|
|
202
|
+
## Resources
|
|
203
|
+
|
|
204
|
+
- [Vitest](https://vitest.dev/)
|
|
205
|
+
- [Jest](https://jestjs.io/)
|
|
206
|
+
- [Testing Library](https://testing-library.com/)
|
|
207
|
+
- [Cypress](https://www.cypress.io/)
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# TypeScript
|
|
2
|
+
|
|
3
|
+
Typed superset of JavaScript with static type checking and excellent tooling.
|
|
4
|
+
|
|
5
|
+
## Basic Types
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// Primitives
|
|
9
|
+
const str: string = "hello";
|
|
10
|
+
const num: number = 42;
|
|
11
|
+
const bool: boolean = true;
|
|
12
|
+
const nothing: null = null;
|
|
13
|
+
const undefined_val: undefined = undefined;
|
|
14
|
+
|
|
15
|
+
// Collections
|
|
16
|
+
const arr: number[] = [1, 2, 3];
|
|
17
|
+
const tuple: [string, number] = ["name", 42];
|
|
18
|
+
const obj: { name: string; age: number } = { name: "John", age: 30 };
|
|
19
|
+
|
|
20
|
+
// Functions
|
|
21
|
+
const add = (a: number, b: number): number => a + b;
|
|
22
|
+
const greet = (name: string): void => console.log(`Hello, ${name}`);
|
|
23
|
+
const optional = (x?: number): number | undefined => x;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Interfaces & Types
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
// Interface (structural typing)
|
|
30
|
+
interface User {
|
|
31
|
+
id: number;
|
|
32
|
+
name: string;
|
|
33
|
+
email?: string; // Optional
|
|
34
|
+
readonly created_at: Date; // Readonly
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Type (more flexible)
|
|
38
|
+
type Admin = User & { admin_level: number };
|
|
39
|
+
type Status = "active" | "inactive" | "pending";
|
|
40
|
+
|
|
41
|
+
// Function type
|
|
42
|
+
type Handler = (event: Event) => void;
|
|
43
|
+
|
|
44
|
+
// Generics
|
|
45
|
+
interface Container<T> {
|
|
46
|
+
value: T;
|
|
47
|
+
get(): T;
|
|
48
|
+
set(v: T): void;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Classes
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
class Animal {
|
|
56
|
+
protected name: string;
|
|
57
|
+
private age: number = 0;
|
|
58
|
+
|
|
59
|
+
constructor(name: string) {
|
|
60
|
+
this.name = name;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
protected getAge() {
|
|
64
|
+
return this.age;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class Dog extends Animal {
|
|
69
|
+
bark() {
|
|
70
|
+
console.log(`${this.name} barks!`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Advanced Patterns
|
|
76
|
+
|
|
77
|
+
### Utility Types
|
|
78
|
+
```typescript
|
|
79
|
+
// Partial - make all properties optional
|
|
80
|
+
type PartialUser = Partial<User>;
|
|
81
|
+
|
|
82
|
+
// Required - make all properties required
|
|
83
|
+
type RequiredUser = Required<User>;
|
|
84
|
+
|
|
85
|
+
// Pick - select specific properties
|
|
86
|
+
type UserPreview = Pick<User, 'id' | 'name'>;
|
|
87
|
+
|
|
88
|
+
// Omit - exclude properties
|
|
89
|
+
type UserWithoutEmail = Omit<User, 'email'>;
|
|
90
|
+
|
|
91
|
+
// Record - create object with specific keys
|
|
92
|
+
type Status = 'active' | 'inactive';
|
|
93
|
+
const statusCount: Record<Status, number> = {
|
|
94
|
+
active: 10,
|
|
95
|
+
inactive: 5,
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Generics
|
|
100
|
+
```typescript
|
|
101
|
+
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
|
|
102
|
+
return obj[key];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const user = { name: "John", age: 30 };
|
|
106
|
+
const name = getProperty(user, 'name'); // string
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Discriminated Unions
|
|
110
|
+
```typescript
|
|
111
|
+
type Result<T> =
|
|
112
|
+
| { status: 'success'; data: T }
|
|
113
|
+
| { status: 'error'; error: Error };
|
|
114
|
+
|
|
115
|
+
function handle<T>(result: Result<T>) {
|
|
116
|
+
if (result.status === 'success') {
|
|
117
|
+
console.log(result.data); // T
|
|
118
|
+
} else {
|
|
119
|
+
console.log(result.error); // Error
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Strict Mode Configuration
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"compilerOptions": {
|
|
129
|
+
"strict": true,
|
|
130
|
+
"noImplicitAny": true,
|
|
131
|
+
"strictNullChecks": true,
|
|
132
|
+
"strictFunctionTypes": true,
|
|
133
|
+
"strictBindCallApply": true,
|
|
134
|
+
"strictPropertyInitialization": true,
|
|
135
|
+
"noImplicitThis": true,
|
|
136
|
+
"alwaysStrict": true,
|
|
137
|
+
"noUnusedLocals": true,
|
|
138
|
+
"noUnusedParameters": true,
|
|
139
|
+
"noImplicitReturns": true,
|
|
140
|
+
"noFallthroughCasesInSwitch": true
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Best Practices
|
|
146
|
+
|
|
147
|
+
1. **Always use strict mode**: Catch more errors at compile time
|
|
148
|
+
2. **Avoid any**: Use unknown or specific types instead
|
|
149
|
+
3. **Use readonly**: For immutable data
|
|
150
|
+
4. **Narrow types**: Use type guards and discriminated unions
|
|
151
|
+
5. **Generic constraints**: Limit what types can be used
|
|
152
|
+
|
|
153
|
+
## Resources
|
|
154
|
+
|
|
155
|
+
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
|
|
156
|
+
- [TypeScript Deep Dive](https://basarat.gitbook.io/typescript/)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Accessibility (a11y)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Build inclusive UIs that work for everyone — screen readers, keyboard users, and people with disabilities.
|
|
5
|
+
|
|
6
|
+
## Semantic HTML
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
// BAD — div soup
|
|
10
|
+
<div onClick={handleClick}>Click me</div>
|
|
11
|
+
<div class="nav"><div>Home</div><div>About</div></div>
|
|
12
|
+
|
|
13
|
+
// GOOD — semantic elements
|
|
14
|
+
<button onClick={handleClick} type="button">Click me</button>
|
|
15
|
+
<nav aria-label="Main navigation">
|
|
16
|
+
<ul>
|
|
17
|
+
<li><a href="/">Home</a></li>
|
|
18
|
+
<li><a href="/about">About</a></li>
|
|
19
|
+
</ul>
|
|
20
|
+
</nav>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ARIA Roles and Labels
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
// Modal
|
|
27
|
+
<div role="dialog" aria-modal="true" aria-labelledby="modal-title" aria-describedby="modal-desc">
|
|
28
|
+
<h2 id="modal-title">Confirm Delete</h2>
|
|
29
|
+
<p id="modal-desc">This action cannot be undone.</p>
|
|
30
|
+
<button onClick={onClose} aria-label="Close dialog">✕</button>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
// Loading state
|
|
34
|
+
<button disabled aria-busy={isLoading} aria-label={isLoading ? 'Saving...' : 'Save'}>
|
|
35
|
+
{isLoading ? <Spinner /> : 'Save'}
|
|
36
|
+
</button>
|
|
37
|
+
|
|
38
|
+
// Form with error
|
|
39
|
+
<div>
|
|
40
|
+
<label htmlFor="email">Email</label>
|
|
41
|
+
<input
|
|
42
|
+
id="email"
|
|
43
|
+
type="email"
|
|
44
|
+
aria-required="true"
|
|
45
|
+
aria-invalid={!!error}
|
|
46
|
+
aria-describedby={error ? 'email-error' : undefined}
|
|
47
|
+
/>
|
|
48
|
+
{error && <p id="email-error" role="alert">{error}</p>}
|
|
49
|
+
</div>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Keyboard Navigation
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
// Trap focus in modal
|
|
56
|
+
import { useEffect, useRef } from 'react';
|
|
57
|
+
|
|
58
|
+
function Modal({ onClose }: { onClose: () => void }) {
|
|
59
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const el = ref.current;
|
|
63
|
+
if (!el) return;
|
|
64
|
+
const focusable = el.querySelectorAll<HTMLElement>('button, [href], input, [tabindex]:not([tabindex="-1"])');
|
|
65
|
+
const first = focusable[0];
|
|
66
|
+
const last = focusable[focusable.length - 1];
|
|
67
|
+
|
|
68
|
+
first?.focus();
|
|
69
|
+
|
|
70
|
+
function handleTab(e: KeyboardEvent) {
|
|
71
|
+
if (e.key !== 'Tab') return;
|
|
72
|
+
if (e.shiftKey ? document.activeElement === first : document.activeElement === last) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
(e.shiftKey ? last : first)?.focus();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
el.addEventListener('keydown', handleTab);
|
|
79
|
+
return () => el.removeEventListener('keydown', handleTab);
|
|
80
|
+
}, []);
|
|
81
|
+
|
|
82
|
+
return <div ref={ref} role="dialog">{/* ... */}</div>;
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Color Contrast Check
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
// Ensure 4.5:1 ratio for normal text, 3:1 for large text
|
|
90
|
+
// WCAG AA compliance
|
|
91
|
+
const colors = {
|
|
92
|
+
textOnWhite: '#374151', // 10.7:1 ✓
|
|
93
|
+
primaryOnWhite: '#1d4ed8', // 6.8:1 ✓
|
|
94
|
+
errorText: '#dc2626', // 4.5:1 ✓
|
|
95
|
+
};
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Best Practices
|
|
99
|
+
- Test with keyboard only (Tab, Enter, Escape, Arrow keys)
|
|
100
|
+
- Test with VoiceOver (macOS) or NVDA (Windows)
|
|
101
|
+
- Run `npx axe-cli http://localhost:3000` for automated checks
|
|
102
|
+
- Add `aria-live="polite"` to dynamic content areas
|
|
103
|
+
|
|
104
|
+
## Resources
|
|
105
|
+
- [WCAG 2.1 guidelines](https://www.w3.org/TR/WCAG21/)
|
|
106
|
+
- [axe DevTools](https://www.deque.com/axe/)
|