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,216 @@
|
|
|
1
|
+
# Integration Testing
|
|
2
|
+
|
|
3
|
+
Testing interactions between multiple components and external services.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D vitest supertest jest axios
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## API Integration Tests
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
|
15
|
+
import request from 'supertest';
|
|
16
|
+
import app from '../app';
|
|
17
|
+
|
|
18
|
+
describe('User API Integration', () => {
|
|
19
|
+
let userId: string;
|
|
20
|
+
|
|
21
|
+
beforeAll(async () => {
|
|
22
|
+
// Setup test database
|
|
23
|
+
await db.connect();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
afterAll(async () => {
|
|
27
|
+
await db.disconnect();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should create a user', async () => {
|
|
31
|
+
const response = await request(app)
|
|
32
|
+
.post('/api/users')
|
|
33
|
+
.send({
|
|
34
|
+
email: 'test@example.com',
|
|
35
|
+
name: 'Test User'
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
expect(response.status).toBe(201);
|
|
39
|
+
expect(response.body).toHaveProperty('id');
|
|
40
|
+
userId = response.body.id;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should fetch created user', async () => {
|
|
44
|
+
const response = await request(app)
|
|
45
|
+
.get(`/api/users/${userId}`);
|
|
46
|
+
|
|
47
|
+
expect(response.status).toBe(200);
|
|
48
|
+
expect(response.body.email).toBe('test@example.com');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should update user', async () => {
|
|
52
|
+
const response = await request(app)
|
|
53
|
+
.patch(`/api/users/${userId}`)
|
|
54
|
+
.send({ name: 'Updated User' });
|
|
55
|
+
|
|
56
|
+
expect(response.status).toBe(200);
|
|
57
|
+
expect(response.body.name).toBe('Updated User');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should delete user', async () => {
|
|
61
|
+
const response = await request(app)
|
|
62
|
+
.delete(`/api/users/${userId}`);
|
|
63
|
+
|
|
64
|
+
expect(response.status).toBe(204);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Database Integration Tests
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
73
|
+
import { db } from '../db';
|
|
74
|
+
|
|
75
|
+
describe('Database Operations', () => {
|
|
76
|
+
beforeEach(async () => {
|
|
77
|
+
await db.truncate('users');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should save and retrieve user', async () => {
|
|
81
|
+
const user = await db.users.create({
|
|
82
|
+
email: 'user@example.com',
|
|
83
|
+
name: 'John Doe'
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const retrieved = await db.users.findById(user.id);
|
|
87
|
+
expect(retrieved.email).toBe('user@example.com');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('should update user', async () => {
|
|
91
|
+
const user = await db.users.create({
|
|
92
|
+
email: 'old@example.com',
|
|
93
|
+
name: 'John'
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
await db.users.update(user.id, {
|
|
97
|
+
email: 'new@example.com'
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const updated = await db.users.findById(user.id);
|
|
101
|
+
expect(updated.email).toBe('new@example.com');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should handle transactions', async () => {
|
|
105
|
+
await db.transaction(async (trx) => {
|
|
106
|
+
const user = await trx('users').insert({
|
|
107
|
+
email: 'tx@example.com',
|
|
108
|
+
name: 'Transaction'
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
await trx('profiles').insert({
|
|
112
|
+
userId: user[0],
|
|
113
|
+
bio: 'Bio'
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const count = await db('users').count();
|
|
118
|
+
expect(count[0]['count(*)']).toBe(1);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Third-Party Service Mocking
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
127
|
+
import axios from 'axios';
|
|
128
|
+
|
|
129
|
+
// Mock external API
|
|
130
|
+
vi.mock('axios');
|
|
131
|
+
const mockedAxios = axios as jest.Mocked<typeof axios>;
|
|
132
|
+
|
|
133
|
+
describe('Payment Service Integration', () => {
|
|
134
|
+
it('should process payment via Stripe', async () => {
|
|
135
|
+
mockedAxios.post.mockResolvedValueOnce({
|
|
136
|
+
data: { id: 'pi_123', status: 'succeeded' }
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const result = await processPayment({
|
|
140
|
+
amount: 9999,
|
|
141
|
+
currency: 'USD'
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
expect(result.status).toBe('succeeded');
|
|
145
|
+
expect(mockedAxios.post).toHaveBeenCalledWith(
|
|
146
|
+
'https://api.stripe.com/v1/payment_intents',
|
|
147
|
+
expect.any(Object)
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('should handle payment failure', async () => {
|
|
152
|
+
mockedAxios.post.mockRejectedValueOnce(
|
|
153
|
+
new Error('Card declined')
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
await expect(processPayment({ amount: 9999 }))
|
|
157
|
+
.rejects
|
|
158
|
+
.toThrow('Card declined');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## End-to-End API Chain
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { describe, it, expect } from 'vitest';
|
|
167
|
+
import request from 'supertest';
|
|
168
|
+
import app from '../app';
|
|
169
|
+
|
|
170
|
+
describe('User Workflow', () => {
|
|
171
|
+
it('should complete signup → verify → login flow', async () => {
|
|
172
|
+
// 1. Sign up
|
|
173
|
+
const signupRes = await request(app)
|
|
174
|
+
.post('/api/auth/signup')
|
|
175
|
+
.send({
|
|
176
|
+
email: 'new@example.com',
|
|
177
|
+
password: 'secure123'
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
expect(signupRes.status).toBe(201);
|
|
181
|
+
const { userId } = signupRes.body;
|
|
182
|
+
|
|
183
|
+
// 2. Send verification (mock email)
|
|
184
|
+
const verifyRes = await request(app)
|
|
185
|
+
.post(`/api/auth/verify/${userId}`)
|
|
186
|
+
.send({ code: '123456' });
|
|
187
|
+
|
|
188
|
+
expect(verifyRes.status).toBe(200);
|
|
189
|
+
|
|
190
|
+
// 3. Login
|
|
191
|
+
const loginRes = await request(app)
|
|
192
|
+
.post('/api/auth/login')
|
|
193
|
+
.send({
|
|
194
|
+
email: 'new@example.com',
|
|
195
|
+
password: 'secure123'
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
expect(loginRes.status).toBe(200);
|
|
199
|
+
expect(loginRes.body).toHaveProperty('token');
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Best Practices
|
|
205
|
+
|
|
206
|
+
✅ **Isolation** - Use test database, reset between tests
|
|
207
|
+
✅ **Real calls vs mocks** - Mix real and mocked services
|
|
208
|
+
✅ **Async handling** - Proper await and promise handling
|
|
209
|
+
✅ **Cleanup** - Always teardown after tests
|
|
210
|
+
✅ **Meaningful assertions** - Test behavior, not implementation
|
|
211
|
+
|
|
212
|
+
## Resources
|
|
213
|
+
|
|
214
|
+
- [Vitest Documentation](https://vitest.dev/)
|
|
215
|
+
- [Supertest Guide](https://github.com/visionmedia/supertest)
|
|
216
|
+
- [Testing Library](https://testing-library.com/)
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Performance Testing
|
|
2
|
+
|
|
3
|
+
Load testing, stress testing, and performance profiling.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D k6 autocannon clinic
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## K6 Load Testing
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import http from 'k6/http';
|
|
15
|
+
import { check, sleep } from 'k6';
|
|
16
|
+
|
|
17
|
+
export const options = {
|
|
18
|
+
vus: 100, // 100 virtual users
|
|
19
|
+
duration: '30s', // 30 second duration
|
|
20
|
+
thresholds: {
|
|
21
|
+
http_req_duration: ['p(95)<500', 'p(99)<1000'],
|
|
22
|
+
http_req_failed: ['rate<0.1']
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default function () {
|
|
27
|
+
const response = http.get('http://localhost:3000/api/users');
|
|
28
|
+
|
|
29
|
+
check(response, {
|
|
30
|
+
'status is 200': (r) => r.status === 200,
|
|
31
|
+
'response time < 500ms': (r) => r.timings.duration < 500
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
sleep(1);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Autocannon Benchmarking
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Simple benchmark
|
|
42
|
+
autocannon http://localhost:3000
|
|
43
|
+
|
|
44
|
+
# Custom configuration
|
|
45
|
+
autocannon -c 100 -d 30 -p 10 http://localhost:3000/api/users
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Clinic.js Profiling
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Profiler
|
|
52
|
+
clinic doctor -- node app.js
|
|
53
|
+
|
|
54
|
+
# Flame graph
|
|
55
|
+
clinic flame -- node app.js
|
|
56
|
+
|
|
57
|
+
# Bubbleprof
|
|
58
|
+
clinic bubbleprof -- node app.js
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Custom Performance Tests
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import { describe, it, expect } from 'vitest';
|
|
65
|
+
import { performance } from 'perf_hooks';
|
|
66
|
+
|
|
67
|
+
describe('Performance Benchmarks', () => {
|
|
68
|
+
it('should calculate fibonacci < 1ms', () => {
|
|
69
|
+
const start = performance.now();
|
|
70
|
+
|
|
71
|
+
const result = fibonacci(10);
|
|
72
|
+
|
|
73
|
+
const duration = performance.now() - start;
|
|
74
|
+
expect(duration).toBeLessThan(1);
|
|
75
|
+
expect(result).toBe(55);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('should handle 1000 items in array map < 5ms', () => {
|
|
79
|
+
const items = Array.from({ length: 1000 }, (_, i) => i);
|
|
80
|
+
|
|
81
|
+
const start = performance.now();
|
|
82
|
+
const doubled = items.map(x => x * 2);
|
|
83
|
+
const duration = performance.now() - start;
|
|
84
|
+
|
|
85
|
+
expect(duration).toBeLessThan(5);
|
|
86
|
+
expect(doubled[0]).toBe(0);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Memory Profiling
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { performance, PerformanceObserver } from 'perf_hooks';
|
|
95
|
+
|
|
96
|
+
// Track memory usage
|
|
97
|
+
function monitorMemory() {
|
|
98
|
+
const obs = new PerformanceObserver((items) => {
|
|
99
|
+
items.getEntries().forEach((entry) => {
|
|
100
|
+
console.log(`Memory: ${Math.round(entry.duration)} MB`);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
obs.observe({ entryTypes: ['measure'] });
|
|
105
|
+
|
|
106
|
+
const start = performance.now();
|
|
107
|
+
|
|
108
|
+
// Your code here
|
|
109
|
+
const largeArray = Array(1000000).fill(0);
|
|
110
|
+
|
|
111
|
+
const end = performance.now();
|
|
112
|
+
performance.measure('memory-test', start, end);
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Database Query Performance
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { performance } from 'perf_hooks';
|
|
120
|
+
|
|
121
|
+
describe('Query Performance', () => {
|
|
122
|
+
it('should fetch 1000 users < 100ms', async () => {
|
|
123
|
+
const start = performance.now();
|
|
124
|
+
|
|
125
|
+
const users = await db('users')
|
|
126
|
+
.limit(1000)
|
|
127
|
+
.select();
|
|
128
|
+
|
|
129
|
+
const duration = performance.now() - start;
|
|
130
|
+
expect(duration).toBeLessThan(100);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it('should index improves query speed', async () => {
|
|
134
|
+
// Without index
|
|
135
|
+
const noIndexTime = await measureQuery(
|
|
136
|
+
() => db('users').where('email', '=', 'test@example.com').first()
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
// With index (after adding)
|
|
140
|
+
const withIndexTime = await measureQuery(
|
|
141
|
+
() => db('users').where('email', '=', 'test@example.com').first()
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
// Index should be 10x faster
|
|
145
|
+
expect(withIndexTime).toBeLessThan(noIndexTime / 10);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Best Practices
|
|
151
|
+
|
|
152
|
+
✅ **Establish baselines** - Record current performance
|
|
153
|
+
✅ **Test under load** - Realistic user volumes
|
|
154
|
+
✅ **Profile regularly** - Catch regressions early
|
|
155
|
+
✅ **Monitor thresholds** - Set SLOs and alert on breaches
|
|
156
|
+
✅ **Isolate variables** - Test one change at a time
|
|
157
|
+
|
|
158
|
+
## Resources
|
|
159
|
+
|
|
160
|
+
- [K6 Documentation](https://k6.io/docs/)
|
|
161
|
+
- [Autocannon](https://github.com/mcollina/autocannon)
|
|
162
|
+
- [Clinic.js](https://clinicjs.org/)
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Test-Driven Development (TDD)
|
|
2
|
+
|
|
3
|
+
Writing tests before implementation for better code design.
|
|
4
|
+
|
|
5
|
+
## Red-Green-Refactor Cycle
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// Step 1: RED - Write failing test
|
|
9
|
+
import { describe, it, expect } from 'vitest';
|
|
10
|
+
import { Calculator } from '../calculator';
|
|
11
|
+
|
|
12
|
+
describe('Calculator', () => {
|
|
13
|
+
it('should add two numbers', () => {
|
|
14
|
+
const calc = new Calculator();
|
|
15
|
+
expect(calc.add(2, 3)).toBe(5);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should multiply two numbers', () => {
|
|
19
|
+
const calc = new Calculator();
|
|
20
|
+
expect(calc.multiply(2, 3)).toBe(6);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Step 2: GREEN - Write minimal implementation
|
|
25
|
+
export class Calculator {
|
|
26
|
+
add(a: number, b: number): number {
|
|
27
|
+
return a + b;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
multiply(a: number, b: number): number {
|
|
31
|
+
return a * b;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Step 3: REFACTOR - Improve code while keeping tests passing
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API TDD Example
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
// Test first
|
|
42
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
43
|
+
import request from 'supertest';
|
|
44
|
+
import app from '../app';
|
|
45
|
+
|
|
46
|
+
describe('User API', () => {
|
|
47
|
+
it('should create user and return 201', async () => {
|
|
48
|
+
const response = await request(app)
|
|
49
|
+
.post('/api/users')
|
|
50
|
+
.send({ email: 'test@example.com', name: 'Test' });
|
|
51
|
+
|
|
52
|
+
expect(response.status).toBe(201);
|
|
53
|
+
expect(response.body).toHaveProperty('id');
|
|
54
|
+
expect(response.body.email).toBe('test@example.com');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should return 400 for invalid email', async () => {
|
|
58
|
+
const response = await request(app)
|
|
59
|
+
.post('/api/users')
|
|
60
|
+
.send({ email: 'invalid', name: 'Test' });
|
|
61
|
+
|
|
62
|
+
expect(response.status).toBe(400);
|
|
63
|
+
expect(response.body.errors).toContain('Invalid email');
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Implementation
|
|
68
|
+
app.post('/api/users', async (req, res) => {
|
|
69
|
+
const { email, name } = req.body;
|
|
70
|
+
const errors = [];
|
|
71
|
+
|
|
72
|
+
if (!email || !email.includes('@')) {
|
|
73
|
+
errors.push('Invalid email');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (errors.length) {
|
|
77
|
+
return res.status(400).json({ errors });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const user = await db.users.create({ email, name });
|
|
81
|
+
res.status(201).json(user);
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Contract Testing
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// Define contract first
|
|
89
|
+
interface UserService {
|
|
90
|
+
getUser(id: string): Promise<{ id: string; email: string }>;
|
|
91
|
+
createUser(data: any): Promise<{ id: string; email: string }>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Test contract
|
|
95
|
+
describe('UserService Contract', () => {
|
|
96
|
+
let service: UserService;
|
|
97
|
+
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
service = createUserService();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('getUser returns object with id and email', async () => {
|
|
103
|
+
const user = await service.getUser('123');
|
|
104
|
+
|
|
105
|
+
expect(user).toHaveProperty('id');
|
|
106
|
+
expect(user).toHaveProperty('email');
|
|
107
|
+
expect(typeof user.id).toBe('string');
|
|
108
|
+
expect(typeof user.email).toBe('string');
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Acceptance Test-Driven Development
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// Feature specification
|
|
117
|
+
Feature: User Registration
|
|
118
|
+
Scenario: User registers with valid credentials
|
|
119
|
+
Given user is on signup page
|
|
120
|
+
When user enters email "test@example.com"
|
|
121
|
+
And user enters password "secure123"
|
|
122
|
+
And user clicks "Sign Up"
|
|
123
|
+
Then user should be redirected to dashboard
|
|
124
|
+
And welcome email should be sent
|
|
125
|
+
|
|
126
|
+
// Automated acceptance test
|
|
127
|
+
import { test, expect } from '@playwright/test';
|
|
128
|
+
|
|
129
|
+
test.describe('User Registration', () => {
|
|
130
|
+
test('should register with valid credentials', async ({ page }) => {
|
|
131
|
+
await page.goto('/signup');
|
|
132
|
+
|
|
133
|
+
await page.fill('input[name="email"]', 'test@example.com');
|
|
134
|
+
await page.fill('input[name="password"]', 'secure123');
|
|
135
|
+
await page.click('button:has-text("Sign Up")');
|
|
136
|
+
|
|
137
|
+
await expect(page).toHaveURL('/dashboard');
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Mutation Testing
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
// Detect weak tests
|
|
146
|
+
import stryker from '@stryker-mutator/core';
|
|
147
|
+
|
|
148
|
+
const results = await stryker.runMutationTest({
|
|
149
|
+
mutate: ['src/**/*.ts'],
|
|
150
|
+
testFramework: 'vitest',
|
|
151
|
+
reporters: ['json', 'html']
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// If mutation score < 80%, tests are weak
|
|
155
|
+
console.log(`Mutation score: ${results.mutationScore}%`);
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Best Practices
|
|
159
|
+
|
|
160
|
+
✅ **Write one test per scenario** - Keep tests focused
|
|
161
|
+
✅ **Meaningful test names** - Describe behavior
|
|
162
|
+
✅ **Arrange-Act-Assert** - Clear test structure
|
|
163
|
+
✅ **Fast feedback loop** - Run tests frequently
|
|
164
|
+
✅ **Refactor with confidence** - Tests prevent regressions
|
|
165
|
+
|
|
166
|
+
## Resources
|
|
167
|
+
|
|
168
|
+
- [Test-Driven Development in Practice](https://www.youtube.com/watch?v=QCwqnjxqfmY)
|
|
169
|
+
- [Vitest Documentation](https://vitest.dev/)
|
|
170
|
+
- [Testing Library](https://testing-library.com/)
|