@kensaurus/skills 0.0.0-stage → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +53 -0
- package/.claude-plugin/plugin.json +40 -0
- package/.cursor-plugin/plugin.json +38 -0
- package/.mcp.json +28 -0
- package/CHANGELOG.md +1790 -0
- package/LICENSE +21 -0
- package/LICENSE-APACHE +62 -0
- package/NOTICE +13 -0
- package/README.md +821 -2
- package/SECURITY.md +55 -0
- package/agents/code-reviewer.md +60 -0
- package/agents/completion-judge.md +89 -0
- package/agents/db-migrator.md +125 -0
- package/agents/debugger.md +47 -0
- package/agents/deploy-checker.md +100 -0
- package/agents/perf-monitor.md +74 -0
- package/assets/favicon.png +0 -0
- package/assets/logo-light.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/logo.svg +6 -0
- package/assets/og.png +0 -0
- package/bin/install.mjs +1127 -0
- package/bin/kenji.js +2 -0
- package/commands/adr.md +17 -0
- package/commands/aeo-plan.md +18 -0
- package/commands/arch-boundaries.md +17 -0
- package/commands/aso-plan.md +18 -0
- package/commands/auth-flows.md +19 -0
- package/commands/backup-plan.md +17 -0
- package/commands/burndown-full.md +25 -0
- package/commands/capacitor-plan.md +18 -0
- package/commands/codemod-safety.md +22 -0
- package/commands/commit.md +18 -0
- package/commands/complete-everything.md +40 -0
- package/commands/cost-plan.md +19 -0
- package/commands/deadcode-plan.md +26 -0
- package/commands/deadcode.md +32 -0
- package/commands/debug-issue.md +17 -0
- package/commands/deps-plan.md +18 -0
- package/commands/docs-plan.md +17 -0
- package/commands/doctrine.md +19 -0
- package/commands/error-plan.md +19 -0
- package/commands/feedback-to-closure.md +36 -0
- package/commands/fix-issue.md +76 -0
- package/commands/gate-logic.md +26 -0
- package/commands/green-repo.md +36 -0
- package/commands/grill-me.md +19 -0
- package/commands/gtm-plan.md +21 -0
- package/commands/gtm-weekly.md +17 -0
- package/commands/gtm.md +22 -0
- package/commands/handoff.md +15 -0
- package/commands/housekeep-backlog.md +18 -0
- package/commands/housekeep-files.md +22 -0
- package/commands/housekeep-gates.md +18 -0
- package/commands/instant-nav.md +11 -0
- package/commands/integrity-plan.md +19 -0
- package/commands/launch-kit.md +16 -0
- package/commands/mcp-guide.md +40 -0
- package/commands/mobile-plan.md +19 -0
- package/commands/native-rn-monorepo/README.md +78 -0
- package/commands/native-rn-monorepo/android-build.md +26 -0
- package/commands/native-rn-monorepo/android-install.md +32 -0
- package/commands/native-rn-monorepo/android-logcat.md +37 -0
- package/commands/native-rn-monorepo/ios-ci-logs.md +56 -0
- package/commands/native-rn-monorepo/ios-ci-status.md +52 -0
- package/commands/native-rn-monorepo/ios-ci-trigger.md +59 -0
- package/commands/native-rn-monorepo/rn-reset.md +50 -0
- package/commands/native-rn-monorepo/rn-ship-ios.md +67 -0
- package/commands/native-rn-monorepo/rn-verify.md +53 -0
- package/commands/perf-plan.md +18 -0
- package/commands/plan-mode.md +74 -0
- package/commands/pr.md +16 -0
- package/commands/pricing-plan.md +20 -0
- package/commands/privacy-plan.md +18 -0
- package/commands/readability.md +12 -0
- package/commands/readme.md +15 -0
- package/commands/refactor.md +15 -0
- package/commands/release-prep.md +17 -0
- package/commands/research.md +25 -0
- package/commands/responsive-audit.md +21 -0
- package/commands/review-code.md +18 -0
- package/commands/rls-plan.md +18 -0
- package/commands/secrets-plan.md +18 -0
- package/commands/security-plan.md +19 -0
- package/commands/ship-and-observe.md +36 -0
- package/commands/skill-conflicts.md +19 -0
- package/commands/slop-plan.md +18 -0
- package/commands/stub-plan.md +18 -0
- package/commands/test-mutation.md +16 -0
- package/commands/test-plan.md +17 -0
- package/commands/test.md +29 -0
- package/commands/thirdparty-web-interface-guidelines.md +185 -0
- package/commands/uiux-plan.md +18 -0
- package/commands/uiux.md +45 -0
- package/commands/update-deps.md +21 -0
- package/commands/validation-plan.md +19 -0
- package/commands-portable/fix-issue.md +72 -0
- package/commands-portable/plan-mode.md +92 -0
- package/commands-portable/research.md +91 -0
- package/docs/screenshots/README.md +5 -0
- package/docs/screenshots/audit-dark.png +0 -0
- package/docs/screenshots/build-dark.png +0 -0
- package/docs/screenshots/grill-dark.png +0 -0
- package/docs/screenshots/hero-dark.png +0 -0
- package/docs/screenshots/hero-light.png +0 -0
- package/docs/screenshots/ship-dark.png +0 -0
- package/docs/screenshots/src/showcase.html +320 -0
- package/hooks/completion-gate.mjs +258 -0
- package/hooks/cursor-hooks.json +13 -0
- package/hooks/hooks.json +15 -0
- package/install.sh +21 -0
- package/llms.txt +40 -0
- package/mcp/README.md +266 -0
- package/mcp/VERSIONS.md +41 -0
- package/mcp/mcp-full.json.template +124 -0
- package/mcp/mcp.json.template +29 -0
- package/mcp/pinned-versions.json +27 -0
- package/package.json +94 -4
- package/rules/approved-plan-execution.mdc +65 -0
- package/rules/full-stack-ship-discipline.mdc +37 -0
- package/rules/native-rn-monorepo/README.md +63 -0
- package/rules/native-rn-monorepo/_project.mdc +69 -0
- package/rules/native-rn-monorepo/native-android.mdc +72 -0
- package/rules/native-rn-monorepo/native-ios.mdc +61 -0
- package/rules/native-rn-monorepo/react-native-js.mdc +78 -0
- package/rules/native-rn-monorepo/web.mdc +60 -0
- package/rules/project-starter/components.mdc +54 -0
- package/rules/project-starter/data-fetching.mdc +77 -0
- package/rules/project-starter/git.mdc +41 -0
- package/rules/project-starter/supabase.mdc +37 -0
- package/rules/project-starter/tailwind.mdc +48 -0
- package/rules/project-starter/typescript.mdc +36 -0
- package/rules/project-starter/web-performance.mdc +42 -0
- package/rules/senior-engineer.mdc +30 -0
- package/rules/shell-first-search.mdc +19 -0
- package/rules/skill-workflows.mdc +35 -0
- package/rules/verification-before-completion.mdc +57 -0
- package/skills/audit-accessibility/SKILL.md +441 -0
- package/skills/audit-agent-speed/SKILL.md +181 -0
- package/skills/audit-agent-speed/scripts/stop-typecheck.mjs +151 -0
- package/skills/audit-analytics/SKILL.md +138 -0
- package/skills/audit-auth-flows/SKILL.md +267 -0
- package/skills/audit-backend-architecture/SKILL.md +266 -0
- package/skills/audit-backend-architecture/references/patterns.md +386 -0
- package/skills/audit-bundle-size/SKILL.md +295 -0
- package/skills/audit-cicd/SKILL.md +218 -0
- package/skills/audit-code-quality/SKILL.md +314 -0
- package/skills/audit-code-review/SKILL.md +289 -0
- package/skills/audit-codemod-safety/SKILL.md +159 -0
- package/skills/audit-db-schema/SKILL.md +465 -0
- package/skills/audit-db-schema/references/details.md +110 -0
- package/skills/audit-doctrine/SKILL.md +189 -0
- package/skills/audit-env-parity/SKILL.md +133 -0
- package/skills/audit-fe-api/SKILL.md +458 -0
- package/skills/audit-gate-logic/SKILL.md +219 -0
- package/skills/audit-i18n/SKILL.md +339 -0
- package/skills/audit-infra-cost/SKILL.md +142 -0
- package/skills/audit-langfuse-llm/SKILL.md +468 -0
- package/skills/audit-langfuse-llm/references/details.md +226 -0
- package/skills/audit-llm-security/SKILL.md +147 -0
- package/skills/audit-monetization-iap/SKILL.md +137 -0
- package/skills/audit-payment-system/SKILL.md +268 -0
- package/skills/audit-payment-system/references/checklist.md +283 -0
- package/skills/audit-performance/SKILL.md +383 -0
- package/skills/audit-performance/references/loading-priority-2026.md +81 -0
- package/skills/audit-realworld/SKILL.md +287 -0
- package/skills/audit-registry-listing/SKILL.md +122 -0
- package/skills/audit-resilience/SKILL.md +153 -0
- package/skills/audit-responsive/SKILL.md +221 -0
- package/skills/audit-responsive/references/checklist.md +166 -0
- package/skills/audit-security/SKILL.md +289 -0
- package/skills/audit-skill-conflicts/SKILL.md +178 -0
- package/skills/audit-ui-states/SKILL.md +146 -0
- package/skills/audit-uiux-design-system/SKILL.md +475 -0
- package/skills/audit-uiux-design-system/references/details.md +71 -0
- package/skills/audit-ux/SKILL.md +381 -0
- package/skills/audit-ux/references/details.md +245 -0
- package/skills/audit-ux-journeys/SKILL.md +215 -0
- package/skills/audit-ux-journeys/references/checklist.md +179 -0
- package/skills/backend-db-performance/SKILL.md +441 -0
- package/skills/backend-error-handling/SKILL.md +489 -0
- package/skills/backend-error-handling/references/details.md +58 -0
- package/skills/backend-observability/SKILL.md +88 -0
- package/skills/backend-patterns/SKILL.md +499 -0
- package/skills/backend-patterns/references/architecture-patterns.md +298 -0
- package/skills/backend-realtime/SKILL.md +403 -0
- package/skills/backend-realtime/references/patterns.md +74 -0
- package/skills/burndown-full/SKILL.md +174 -0
- package/skills/complete-everything/SKILL.md +295 -0
- package/skills/data-pipeline/SKILL.md +109 -0
- package/skills/data-visualization/SKILL.md +488 -0
- package/skills/debug-error/SKILL.md +322 -0
- package/skills/debug-fe-be-integration/SKILL.md +459 -0
- package/skills/debug-sentry-monitor/SKILL.md +497 -0
- package/skills/debug-sentry-monitor/references/details.md +165 -0
- package/skills/deploy-npm/SKILL.md +394 -0
- package/skills/deploy-npm/references/example-mushi-mushi.md +52 -0
- package/skills/deploy-verify/SKILL.md +489 -0
- package/skills/design-api/SKILL.md +379 -0
- package/skills/design-canvas/SKILL.md +155 -0
- package/skills/design-email/SKILL.md +370 -0
- package/skills/design-frontend/SKILL.md +143 -0
- package/skills/design-generative-art/SKILL.md +474 -0
- package/skills/design-mobile-first/SKILL.md +506 -0
- package/skills/design-motion/SKILL.md +333 -0
- package/skills/design-motion/references/delight-interactions.md +191 -0
- package/skills/design-prd/SKILL.md +443 -0
- package/skills/design-system/SKILL.md +457 -0
- package/skills/design-theme/SKILL.md +226 -0
- package/skills/design-theme/themes/tsumagoi-ranch.md +150 -0
- package/skills/docs-adr/SKILL.md +168 -0
- package/skills/docs-coauthor/SKILL.md +368 -0
- package/skills/docs-comparison-pages/SKILL.md +117 -0
- package/skills/docs-domain-modeling/SKILL.md +97 -0
- package/skills/docs-launch-kit/SKILL.md +139 -0
- package/skills/docs-writer/SKILL.md +469 -0
- package/skills/enhance-agent-guardrails/SKILL.md +164 -0
- package/skills/enhance-arch-boundaries/SKILL.md +154 -0
- package/skills/enhance-capacitor-ui/SKILL.md +463 -0
- package/skills/enhance-capacitor-ui/references/details.md +750 -0
- package/skills/enhance-email-deliverability/SKILL.md +143 -0
- package/skills/enhance-growth-loops/SKILL.md +122 -0
- package/skills/enhance-lifecycle-email/SKILL.md +130 -0
- package/skills/enhance-motion/SKILL.md +193 -0
- package/skills/enhance-onboarding/SKILL.md +148 -0
- package/skills/enhance-pwa/SKILL.md +303 -0
- package/skills/enhance-readability/SKILL.md +146 -0
- package/skills/enhance-readme/SKILL.md +496 -0
- package/skills/enhance-readme/package-lock.json +187 -0
- package/skills/enhance-readme/package.json +17 -0
- package/skills/enhance-readme/scripts/generate-readme-blocks.mjs +199 -0
- package/skills/enhance-readme/scripts/record-readme-tour.mjs +442 -0
- package/skills/enhance-skill-prompts/SKILL.md +167 -0
- package/skills/enhance-skill-prompts/references/exemplar-audit-auth-flows.md +311 -0
- package/skills/enhance-ux-laws/SKILL.md +409 -0
- package/skills/enhance-web-conversion/SKILL.md +155 -0
- package/skills/enhance-web-forms/SKILL.md +154 -0
- package/skills/enhance-web-instant-nav/SKILL.md +138 -0
- package/skills/enhance-web-instant-nav/references/bfcache-blockers.md +23 -0
- package/skills/enhance-web-instant-nav/references/early-hints.md +33 -0
- package/skills/enhance-web-instant-nav/references/speculation-rules.md +44 -0
- package/skills/enhance-web-landing/SKILL.md +459 -0
- package/skills/enhance-web-landing/references/details.md +773 -0
- package/skills/enhance-web-redesign/SKILL.md +228 -0
- package/skills/enhance-web-seo/SKILL.md +276 -0
- package/skills/enhance-web-ui/SKILL.md +473 -0
- package/skills/enhance-web-ui/references/details.md +674 -0
- package/skills/enhance-web-ux/HEURISTICS.md +248 -0
- package/skills/enhance-web-ux/PATTERNS.md +375 -0
- package/skills/enhance-web-ux/SKILL.md +464 -0
- package/skills/enhance-web-ux/examples.md +222 -0
- package/skills/enhance-web-ux/references/details.md +406 -0
- package/skills/enhance-web-web3d/SKILL.md +397 -0
- package/skills/enhance-web-web3d/references/css-canvas-effects.md +180 -0
- package/skills/handoff/SKILL.md +66 -0
- package/skills/housekeep-backlog/SKILL.md +149 -0
- package/skills/housekeep-dead-code/SKILL.md +387 -0
- package/skills/housekeep-dead-code/references/ratchet-ci.md +205 -0
- package/skills/housekeep-dead-code/references/supabase-hygiene.md +152 -0
- package/skills/housekeep-design/SKILL.md +207 -0
- package/skills/housekeep-files/SKILL.md +220 -0
- package/skills/housekeep-files/references/naming-and-catalog.md +86 -0
- package/skills/housekeep-files/scripts/housekeep-files.ps1 +360 -0
- package/skills/housekeep-files/scripts/housekeep-files.sh +238 -0
- package/skills/housekeep-gates/SKILL.md +174 -0
- package/skills/iterate-agent-harness/SKILL.md +137 -0
- package/skills/iterate-gtm-weekly/SKILL.md +103 -0
- package/skills/iterate-post-launch/SKILL.md +292 -0
- package/skills/meta-mcp-builder/SKILL.md +313 -0
- package/skills/meta-skill-creator/SKILL.md +304 -0
- package/skills/mobile-capacitor-platform/SKILL.md +103 -0
- package/skills/mobile-emulator-start/SKILL.md +296 -0
- package/skills/mobile-emulator-test/SKILL.md +491 -0
- package/skills/mobile-emulator-test/references/details.md +478 -0
- package/skills/mobile-rn-performance/SKILL.md +107 -0
- package/skills/mobile-rn-screen/SKILL.md +476 -0
- package/skills/mobile-rn-screen/references/details.md +785 -0
- package/skills/mushi-health/SKILL.md +206 -0
- package/skills/mushi-integration/SKILL.md +257 -0
- package/skills/plan-aeo-readiness/SKILL.md +166 -0
- package/skills/plan-antislop/SKILL.md +281 -0
- package/skills/plan-aso/SKILL.md +149 -0
- package/skills/plan-backup-dr/SKILL.md +131 -0
- package/skills/plan-capacitor-hardening/SKILL.md +217 -0
- package/skills/plan-data-integrity/SKILL.md +187 -0
- package/skills/plan-dead-code/SKILL.md +386 -0
- package/skills/plan-dead-code/references/knip-config.md +214 -0
- package/skills/plan-dead-code/references/output-templates.md +133 -0
- package/skills/plan-dead-code/references/preservation-contract.md +50 -0
- package/skills/plan-dead-code/references/residue-greps.md +84 -0
- package/skills/plan-dependency-provenance/SKILL.md +200 -0
- package/skills/plan-docs-sync/SKILL.md +143 -0
- package/skills/plan-docs-sync/references/drift-taxonomy.md +43 -0
- package/skills/plan-docs-sync/references/output-templates.md +33 -0
- package/skills/plan-docs-sync/references/preservation-contract.md +17 -0
- package/skills/plan-error-handling/SKILL.md +205 -0
- package/skills/plan-gtm/SKILL.md +276 -0
- package/skills/plan-gtm/references/benchmarks-2026.md +183 -0
- package/skills/plan-input-validation/SKILL.md +179 -0
- package/skills/plan-llm-cost-guardrails/SKILL.md +176 -0
- package/skills/plan-mobile-readiness/SKILL.md +171 -0
- package/skills/plan-perf-audit/SKILL.md +145 -0
- package/skills/plan-perf-audit/references/audit-scope.md +51 -0
- package/skills/plan-perf-audit/references/output-templates.md +33 -0
- package/skills/plan-perf-audit/references/preservation-contract.md +13 -0
- package/skills/plan-pricing/SKILL.md +173 -0
- package/skills/plan-privacy-compliance/SKILL.md +148 -0
- package/skills/plan-rls-audit/SKILL.md +231 -0
- package/skills/plan-secrets-audit/SKILL.md +181 -0
- package/skills/plan-security-audit/SKILL.md +168 -0
- package/skills/plan-security-audit/references/output-templates.md +36 -0
- package/skills/plan-security-audit/references/owasp-supabase-scope.md +55 -0
- package/skills/plan-security-audit/references/preservation-contract.md +18 -0
- package/skills/plan-stub-checker/SKILL.md +216 -0
- package/skills/plan-stub-checker/references/detection-methodology.md +75 -0
- package/skills/plan-stub-checker/references/detection-taxonomy.md +34 -0
- package/skills/plan-stub-checker/references/output-templates.md +63 -0
- package/skills/plan-stub-checker/references/preservation-contract.md +24 -0
- package/skills/plan-test-coverage/SKILL.md +170 -0
- package/skills/plan-test-coverage/references/methodology.md +54 -0
- package/skills/plan-test-coverage/references/output-templates.md +34 -0
- package/skills/plan-test-coverage/references/preservation-contract.md +15 -0
- package/skills/plan-uiux-unification/SKILL.md +230 -0
- package/skills/plan-uiux-unification/references/output-templates.md +67 -0
- package/skills/plan-uiux-unification/references/phase-workbook.md +85 -0
- package/skills/plan-uiux-unification/references/preservation-contract.md +24 -0
- package/skills/protocol-browser-anti-stall/SKILL.md +211 -0
- package/skills/protocol-browser-anti-stall/references/mcp-to-cli-map.md +113 -0
- package/skills/protocol-browser-anti-stall/references/playwright-session-coordination.md +170 -0
- package/skills/research/SKILL.md +422 -0
- package/skills/test-exploratory/SKILL.md +165 -0
- package/skills/test-exploratory/references/charter-template.md +29 -0
- package/skills/test-load/SKILL.md +126 -0
- package/skills/test-mutation/SKILL.md +160 -0
- package/skills/test-playwright/SKILL.md +354 -0
- package/skills/test-qa/SKILL.md +364 -0
- package/skills/test-qa/references/details.md +268 -0
- package/skills/test-red-team/SKILL.md +386 -0
- package/skills/test-red-team/references/owasp-attack-checklist.md +193 -0
- package/skills/test-unit/SKILL.md +259 -0
- package/skills/test-unit/references/details.md +267 -0
- package/skills/test-visual-regression/SKILL.md +132 -0
- package/skills/thirdparty-emil-design-eng/ATTRIBUTION.md +20 -0
- package/skills/thirdparty-emil-design-eng/SKILL.md +21 -0
- package/skills/thirdparty-emil-design-eng/references/emil-design-eng.md +676 -0
- package/skills/thirdparty-ui-ux-pro-max/ATTRIBUTION.md +22 -0
- package/skills/thirdparty-ui-ux-pro-max/SKILL.md +304 -0
- package/skills/thirdparty-ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/thirdparty-ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/thirdparty-ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/thirdparty-ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/thirdparty-ui-ux-pro-max/data/products.csv +97 -0
- package/skills/thirdparty-ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/thirdparty-ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/thirdparty-ui-ux-pro-max/data/styles.csv +68 -0
- package/skills/thirdparty-ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/thirdparty-ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/thirdparty-ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/thirdparty-ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/thirdparty-ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/thirdparty-ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/skills/thirdparty-ui-ux-pro-max/scripts/search.py +114 -0
- package/skills/thirdparty-web-interface-guidelines/ATTRIBUTION.md +23 -0
- package/skills/thirdparty-web-interface-guidelines/SKILL.md +190 -0
- package/skills/workflow-build-feature/SKILL.md +118 -0
- package/skills/workflow-coding-discipline/SKILL.md +140 -0
- package/skills/workflow-environment-ready/SKILL.md +128 -0
- package/skills/workflow-feature-flag/SKILL.md +262 -0
- package/skills/workflow-feedback-to-closure/SKILL.md +165 -0
- package/skills/workflow-fix-and-ship/SKILL.md +136 -0
- package/skills/workflow-git-commit/SKILL.md +200 -0
- package/skills/workflow-green-repo/SKILL.md +166 -0
- package/skills/workflow-grilling/SKILL.md +73 -0
- package/skills/workflow-gtm/SKILL.md +153 -0
- package/skills/workflow-housekeep/SKILL.md +453 -0
- package/skills/workflow-housekeep/references/templates.md +109 -0
- package/skills/workflow-launch-ready/SKILL.md +145 -0
- package/skills/workflow-merge-conflicts/SKILL.md +62 -0
- package/skills/workflow-onboard/SKILL.md +99 -0
- package/skills/workflow-parallel-agents/SKILL.md +164 -0
- package/skills/workflow-pr/SKILL.md +197 -0
- package/skills/workflow-quality-gate/SKILL.md +147 -0
- package/skills/workflow-refactor/SKILL.md +274 -0
- package/skills/workflow-release-prep/SKILL.md +207 -0
- package/skills/workflow-ship-and-observe/SKILL.md +164 -0
- package/skills/workflow-spec-tdd/SKILL.md +141 -0
- package/skills/workflow-spec-tdd/references/spec-template.md +126 -0
- package/skills/workflow-spec-tdd/references/tdd-patterns.md +167 -0
- package/skills-cursor/babysit/SKILL.md +17 -0
- package/skills-cursor/canvas/SKILL.md +142 -0
- package/skills-cursor/canvas/sdk/canvas-tokens.d.ts +235 -0
- package/skills-cursor/canvas/sdk/chart-primitives.d.ts +200 -0
- package/skills-cursor/canvas/sdk/dag-layout.d.ts +102 -0
- package/skills-cursor/canvas/sdk/diff-view.d.ts +130 -0
- package/skills-cursor/canvas/sdk/form-primitives.d.ts +194 -0
- package/skills-cursor/canvas/sdk/hooks.d.ts +117 -0
- package/skills-cursor/canvas/sdk/index.d.ts +47 -0
- package/skills-cursor/canvas/sdk/theme.d.ts +61 -0
- package/skills-cursor/canvas/sdk/todo-list.d.ts +49 -0
- package/skills-cursor/canvas/sdk/ui-primitives.d.ts +549 -0
- package/skills-cursor/canvas/sdk/ui-primitives.test.d.ts +2 -0
- package/skills-cursor/create-hook/SKILL.md +238 -0
- package/skills-cursor/create-rule/SKILL.md +185 -0
- package/skills-cursor/create-skill/SKILL.md +269 -0
- package/skills-cursor/create-skill/references/authoring-guide.md +182 -0
- package/skills-cursor/create-subagent/SKILL.md +228 -0
- package/skills-cursor/migrate-to-skills/SKILL.md +121 -0
- package/skills-cursor/shell/SKILL.md +22 -0
- package/skills-cursor/split-to-prs/SKILL.md +47 -0
- package/skills-cursor/statusline/SKILL.md +193 -0
- package/skills-cursor/update-cli-config/SKILL.md +85 -0
- package/skills-cursor/update-cursor-settings/SKILL.md +137 -0
- package/skills.sh.json +297 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-motion
|
|
3
|
+
description: >
|
|
4
|
+
Build one new animation — micro-interaction, page transition, scroll, or
|
|
5
|
+
hover — with Framer Motion, CSS, or GSAP. Use when adding one animation to a
|
|
6
|
+
new surface. A coherent pass across an existing app → enhance-motion.
|
|
7
|
+
license: MIT
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Motion Design Skill
|
|
11
|
+
|
|
12
|
+
**Degree of freedom: MIXED.** Purpose and timing `[HIGH freedom]`; existing
|
|
13
|
+
motion inventory and reduced-motion `[LOW freedom — run exactly]`.
|
|
14
|
+
|
|
15
|
+
Create purposeful, performant animations that enhance UX without overwhelming users.
|
|
16
|
+
|
|
17
|
+
## How to reason
|
|
18
|
+
|
|
19
|
+
1. **Inventory** — existing motion library and `prefers-reduced-motion`
|
|
20
|
+
2. **Purpose** — feedback, orientation, focus, or (rare) delight
|
|
21
|
+
3. **Implement** — `transform`/`opacity` only; match the app's timing
|
|
22
|
+
4. **Motion-safe** — reduced-motion becomes an instant state change
|
|
23
|
+
|
|
24
|
+
## Worked example
|
|
25
|
+
|
|
26
|
+
> **Inventory:** Framer Motion already on the modal; no reduced-motion branch.
|
|
27
|
+
> **Purpose:** orientation — show the dialog arriving, not decoration.
|
|
28
|
+
> **Implement:** opacity + scale 0.95→1, 200ms ease-out; no `height` animation.
|
|
29
|
+
> **Motion-safe:** `prefers-reduced-motion` skips enter/exit; focus still moves.
|
|
30
|
+
|
|
31
|
+
## Self-critique before reporting
|
|
32
|
+
|
|
33
|
+
- **Purpose named** — not motion for its own sake
|
|
34
|
+
- **GPU-only** — no width/height/top/left animation
|
|
35
|
+
- **Reduced-motion proven** — a reduce setting was actually tested
|
|
36
|
+
- **Right owner** — app-wide coherent motion pass → `enhance-motion`
|
|
37
|
+
|
|
38
|
+
## Check existing first [LOW freedom — run exactly]
|
|
39
|
+
|
|
40
|
+
**Before adding ANY animation, verify:**
|
|
41
|
+
|
|
42
|
+
1. **Check for existing animation utilities:**
|
|
43
|
+
```bash
|
|
44
|
+
cat package.json | grep -i "framer-motion\|gsap\|animat"
|
|
45
|
+
rg "motion\.|animate\(|useSpring" --type tsx -l | head -10
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. **Check for existing CSS animations:**
|
|
49
|
+
```bash
|
|
50
|
+
rg "@keyframes|animation:" --type css
|
|
51
|
+
cat tailwind.config.* | grep -A20 "animation\|keyframes"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. **Check for animation preferences:**
|
|
55
|
+
```bash
|
|
56
|
+
rg "prefers-reduced-motion" --type tsx --type css
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Why:** Maintain consistent animation language. Respect user motion preferences.
|
|
60
|
+
|
|
61
|
+
## Animation Principles [HIGH freedom]
|
|
62
|
+
|
|
63
|
+
### 1. Purpose-Driven Motion
|
|
64
|
+
Every animation should serve a purpose:
|
|
65
|
+
- **Feedback** - Confirm user actions (button press, form submit)
|
|
66
|
+
- **Orientation** - Show where elements come from/go to
|
|
67
|
+
- **Focus** - Direct attention to important elements
|
|
68
|
+
- **Delight** - Add personality (use sparingly)
|
|
69
|
+
|
|
70
|
+
### 2. Performance Rules
|
|
71
|
+
- Use `transform` and `opacity` only (GPU-accelerated)
|
|
72
|
+
- Avoid animating `width`, `height`, `top`, `left` (trigger layout)
|
|
73
|
+
- Use `will-change` sparingly and remove after animation
|
|
74
|
+
- Target 60fps - keep animations under 100ms for interactions
|
|
75
|
+
|
|
76
|
+
## Framer Motion Patterns (React)
|
|
77
|
+
|
|
78
|
+
### Basic Animations
|
|
79
|
+
```tsx
|
|
80
|
+
import { motion } from 'framer-motion'
|
|
81
|
+
|
|
82
|
+
// Entrance animation
|
|
83
|
+
<motion.div
|
|
84
|
+
initial={{ opacity: 0, y: 20 }}
|
|
85
|
+
animate={{ opacity: 1, y: 0 }}
|
|
86
|
+
transition={{ duration: 0.3, ease: "easeOut" }}
|
|
87
|
+
>
|
|
88
|
+
Content
|
|
89
|
+
</motion.div>
|
|
90
|
+
|
|
91
|
+
// Exit animation
|
|
92
|
+
<motion.div
|
|
93
|
+
exit={{ opacity: 0, scale: 0.95 }}
|
|
94
|
+
transition={{ duration: 0.2 }}
|
|
95
|
+
>
|
|
96
|
+
Content
|
|
97
|
+
</motion.div>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Hover & Tap Interactions
|
|
101
|
+
```tsx
|
|
102
|
+
<motion.button
|
|
103
|
+
whileHover={{ scale: 1.02, boxShadow: "0 4px 20px rgba(0,0,0,0.1)" }}
|
|
104
|
+
whileTap={{ scale: 0.98 }}
|
|
105
|
+
transition={{ type: "spring", stiffness: 400, damping: 17 }}
|
|
106
|
+
>
|
|
107
|
+
Click me
|
|
108
|
+
</motion.button>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Staggered Lists
|
|
112
|
+
```tsx
|
|
113
|
+
const container = {
|
|
114
|
+
hidden: { opacity: 0 },
|
|
115
|
+
show: {
|
|
116
|
+
opacity: 1,
|
|
117
|
+
transition: { staggerChildren: 0.05 }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const item = {
|
|
122
|
+
hidden: { opacity: 0, x: -20 },
|
|
123
|
+
show: { opacity: 1, x: 0 }
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
<motion.ul variants={container} initial="hidden" animate="show">
|
|
127
|
+
{items.map(i => (
|
|
128
|
+
<motion.li key={i.id} variants={item}>{i.name}</motion.li>
|
|
129
|
+
))}
|
|
130
|
+
</motion.ul>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Scroll-Triggered Animations
|
|
134
|
+
```tsx
|
|
135
|
+
import { motion, useScroll, useTransform } from 'framer-motion'
|
|
136
|
+
|
|
137
|
+
function ParallaxSection() {
|
|
138
|
+
const { scrollYProgress } = useScroll()
|
|
139
|
+
const y = useTransform(scrollYProgress, [0, 1], [0, -100])
|
|
140
|
+
const opacity = useTransform(scrollYProgress, [0, 0.5, 1], [1, 1, 0])
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<motion.div style={{ y, opacity }}>
|
|
144
|
+
Parallax content
|
|
145
|
+
</motion.div>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Page Transitions (Next.js)
|
|
151
|
+
```tsx
|
|
152
|
+
// app/template.tsx
|
|
153
|
+
'use client'
|
|
154
|
+
import { motion } from 'framer-motion'
|
|
155
|
+
|
|
156
|
+
export default function Template({ children }: { children: React.ReactNode }) {
|
|
157
|
+
return (
|
|
158
|
+
<motion.div
|
|
159
|
+
initial={{ opacity: 0, y: 10 }}
|
|
160
|
+
animate={{ opacity: 1, y: 0 }}
|
|
161
|
+
exit={{ opacity: 0, y: -10 }}
|
|
162
|
+
transition={{ duration: 0.3 }}
|
|
163
|
+
>
|
|
164
|
+
{children}
|
|
165
|
+
</motion.div>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Layout Animations
|
|
171
|
+
```tsx
|
|
172
|
+
// Shared layout animations
|
|
173
|
+
<motion.div layout layoutId="card">
|
|
174
|
+
{isExpanded ? <ExpandedCard /> : <CollapsedCard />}
|
|
175
|
+
</motion.div>
|
|
176
|
+
|
|
177
|
+
// Smooth height changes
|
|
178
|
+
<motion.div
|
|
179
|
+
layout
|
|
180
|
+
transition={{ layout: { duration: 0.3 } }}
|
|
181
|
+
>
|
|
182
|
+
{showMore && <AdditionalContent />}
|
|
183
|
+
</motion.div>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## CSS-Only Animations
|
|
187
|
+
|
|
188
|
+
### Tailwind Animations
|
|
189
|
+
```tsx
|
|
190
|
+
// Fade in
|
|
191
|
+
<div className="animate-in fade-in duration-300">
|
|
192
|
+
|
|
193
|
+
// Slide up
|
|
194
|
+
<div className="animate-in slide-in-from-bottom-4 duration-500">
|
|
195
|
+
|
|
196
|
+
// Combined
|
|
197
|
+
<div className="animate-in fade-in slide-in-from-bottom-4 duration-500 delay-150">
|
|
198
|
+
|
|
199
|
+
// Custom in tailwind.config.ts
|
|
200
|
+
animation: {
|
|
201
|
+
'float': 'float 3s ease-in-out infinite',
|
|
202
|
+
'pulse-slow': 'pulse 3s ease-in-out infinite',
|
|
203
|
+
'shimmer': 'shimmer 2s linear infinite',
|
|
204
|
+
}
|
|
205
|
+
keyframes: {
|
|
206
|
+
float: {
|
|
207
|
+
'0%, 100%': { transform: 'translateY(0)' },
|
|
208
|
+
'50%': { transform: 'translateY(-10px)' },
|
|
209
|
+
},
|
|
210
|
+
shimmer: {
|
|
211
|
+
'0%': { backgroundPosition: '-200% 0' },
|
|
212
|
+
'100%': { backgroundPosition: '200% 0' },
|
|
213
|
+
},
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Loading Skeleton
|
|
218
|
+
```tsx
|
|
219
|
+
<div className="animate-pulse space-y-4">
|
|
220
|
+
<div className="h-4 bg-muted rounded w-3/4" />
|
|
221
|
+
<div className="h-4 bg-muted rounded w-1/2" />
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
// Shimmer effect
|
|
225
|
+
<div className="relative overflow-hidden bg-muted rounded">
|
|
226
|
+
<div className="absolute inset-0 -translate-x-full animate-shimmer bg-gradient-to-r from-transparent via-white/20 to-transparent" />
|
|
227
|
+
</div>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## GSAP for Complex Animations
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
import { gsap } from 'gsap'
|
|
234
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
|
235
|
+
import { useGSAP } from '@gsap/react'
|
|
236
|
+
|
|
237
|
+
gsap.registerPlugin(ScrollTrigger)
|
|
238
|
+
|
|
239
|
+
function HeroSection() {
|
|
240
|
+
const containerRef = useRef(null)
|
|
241
|
+
|
|
242
|
+
useGSAP(() => {
|
|
243
|
+
const tl = gsap.timeline({
|
|
244
|
+
scrollTrigger: {
|
|
245
|
+
trigger: containerRef.current,
|
|
246
|
+
start: "top center",
|
|
247
|
+
end: "bottom center",
|
|
248
|
+
scrub: 1,
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
tl.from(".hero-title", { opacity: 0, y: 100, duration: 1 })
|
|
253
|
+
.from(".hero-subtitle", { opacity: 0, y: 50 }, "-=0.5")
|
|
254
|
+
.from(".hero-cta", { opacity: 0, scale: 0.8 }, "-=0.3")
|
|
255
|
+
}, { scope: containerRef })
|
|
256
|
+
|
|
257
|
+
return <div ref={containerRef}>...</div>
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Micro-interaction reference
|
|
262
|
+
|
|
263
|
+
Options, not a checklist. This skill adds one animation, so pick the single item the purpose needs; unrequested hover, zoom, or reveal effects are scope creep.
|
|
264
|
+
|
|
265
|
+
### Buttons
|
|
266
|
+
- Hover: subtle scale (1.02) + shadow
|
|
267
|
+
- Active/tap: scale down (0.98)
|
|
268
|
+
- Loading: spinner + disabled state
|
|
269
|
+
- Success: checkmark animation
|
|
270
|
+
- Focus: visible ring animation
|
|
271
|
+
|
|
272
|
+
### Forms
|
|
273
|
+
- Input focus: border color transition
|
|
274
|
+
- Label float animation on focus
|
|
275
|
+
- Error shake animation
|
|
276
|
+
- Success checkmark
|
|
277
|
+
- Submit button loading state
|
|
278
|
+
|
|
279
|
+
### Navigation
|
|
280
|
+
- Active indicator slides
|
|
281
|
+
- Dropdown fade + slide
|
|
282
|
+
- Mobile menu slide from edge
|
|
283
|
+
- Breadcrumb transitions
|
|
284
|
+
|
|
285
|
+
### Cards
|
|
286
|
+
- Hover lift effect
|
|
287
|
+
- Image zoom on hover
|
|
288
|
+
- Content reveal on hover
|
|
289
|
+
- Selection state pulse
|
|
290
|
+
|
|
291
|
+
### Modals
|
|
292
|
+
- Backdrop fade in
|
|
293
|
+
- Content scale + fade
|
|
294
|
+
- Exit animation before unmount
|
|
295
|
+
|
|
296
|
+
## Accessibility [LOW freedom — run exactly]
|
|
297
|
+
|
|
298
|
+
```tsx
|
|
299
|
+
// Always respect reduced motion preference
|
|
300
|
+
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
301
|
+
|
|
302
|
+
// Framer Motion
|
|
303
|
+
<motion.div
|
|
304
|
+
initial={prefersReducedMotion ? false : { opacity: 0 }}
|
|
305
|
+
animate={{ opacity: 1 }}
|
|
306
|
+
transition={{ duration: prefersReducedMotion ? 0 : 0.3 }}
|
|
307
|
+
>
|
|
308
|
+
|
|
309
|
+
// CSS
|
|
310
|
+
@media (prefers-reduced-motion: reduce) {
|
|
311
|
+
*, *::before, *::after {
|
|
312
|
+
animation-duration: 0.01ms !important;
|
|
313
|
+
transition-duration: 0.01ms !important;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Tailwind
|
|
318
|
+
<div className="motion-safe:animate-bounce motion-reduce:animate-none">
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Delight & gamification patterns
|
|
322
|
+
|
|
323
|
+
For playful interactions (bouncy buttons, magnetic elements, confetti, Konami code, satisfying toggles, progress milestones), see [references/delight-interactions.md](references/delight-interactions.md).
|
|
324
|
+
|
|
325
|
+
## Validation [LOW freedom — do not skip]
|
|
326
|
+
|
|
327
|
+
After implementing animations:
|
|
328
|
+
|
|
329
|
+
1. **Performance** → 60fps in Chrome DevTools Performance tab
|
|
330
|
+
2. **Reduced motion** → Test with `prefers-reduced-motion: reduce`
|
|
331
|
+
3. **Mobile** → Test on actual device (not just emulator)
|
|
332
|
+
4. **Purpose** → Each animation serves a clear UX purpose
|
|
333
|
+
5. **Consistency** → Timing/easing matches rest of app
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Delight & Interactive UX Patterns
|
|
2
|
+
|
|
3
|
+
Purposeful play — every interaction enhances understanding or provides feedback.
|
|
4
|
+
Fun should support the task, not distract from it.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Success celebrations
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
'use client'
|
|
12
|
+
import confetti from 'canvas-confetti'
|
|
13
|
+
|
|
14
|
+
export function useSuccessCelebration() {
|
|
15
|
+
const celebrate = (intensity: 'small' | 'medium' | 'large' = 'medium') => {
|
|
16
|
+
const config = {
|
|
17
|
+
small: { particleCount: 30, spread: 50 },
|
|
18
|
+
medium: { particleCount: 100, spread: 70 },
|
|
19
|
+
large: { particleCount: 200, spread: 100, startVelocity: 45 },
|
|
20
|
+
}
|
|
21
|
+
confetti({ ...config[intensity], origin: { y: 0.6 },
|
|
22
|
+
colors: ['#10b981', '#3b82f6', '#8b5cf6', '#f59e0b'] })
|
|
23
|
+
}
|
|
24
|
+
return { celebrate }
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Bouncy / jelly buttons
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { motion } from 'framer-motion'
|
|
34
|
+
|
|
35
|
+
export function BouncyButton({ children, onClick }: ButtonProps) {
|
|
36
|
+
return (
|
|
37
|
+
<motion.button
|
|
38
|
+
onClick={onClick}
|
|
39
|
+
whileHover={{ scale: 1.05 }}
|
|
40
|
+
whileTap={{ scale: 0.95 }}
|
|
41
|
+
transition={{ type: 'spring', stiffness: 500, damping: 15 }}
|
|
42
|
+
className="px-6 py-3 bg-primary text-primary-foreground rounded-full font-medium"
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</motion.button>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function JellyButton({ children }: ButtonProps) {
|
|
50
|
+
return (
|
|
51
|
+
<motion.button
|
|
52
|
+
whileHover={{ scale: 1.02 }}
|
|
53
|
+
whileTap={{ scale: [1, 0.9, 1.1, 0.95, 1.02, 1], transition: { duration: 0.4 } }}
|
|
54
|
+
className="px-6 py-3 bg-primary rounded-lg"
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
</motion.button>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Magnetic button
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
'use client'
|
|
68
|
+
import { motion, useMotionValue, useSpring } from 'framer-motion'
|
|
69
|
+
import { useRef } from 'react'
|
|
70
|
+
|
|
71
|
+
export function MagneticButton({ children }: { children: React.ReactNode }) {
|
|
72
|
+
const ref = useRef<HTMLButtonElement>(null)
|
|
73
|
+
const x = useMotionValue(0)
|
|
74
|
+
const y = useMotionValue(0)
|
|
75
|
+
const springX = useSpring(x, { stiffness: 300, damping: 20 })
|
|
76
|
+
const springY = useSpring(y, { stiffness: 300, damping: 20 })
|
|
77
|
+
|
|
78
|
+
const handleMouseMove = (e: React.MouseEvent) => {
|
|
79
|
+
if (!ref.current) return
|
|
80
|
+
const rect = ref.current.getBoundingClientRect()
|
|
81
|
+
x.set((e.clientX - rect.left - rect.width / 2) * 0.3)
|
|
82
|
+
y.set((e.clientY - rect.top - rect.height / 2) * 0.3)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<motion.button
|
|
87
|
+
ref={ref}
|
|
88
|
+
style={{ x: springX, y: springY }}
|
|
89
|
+
onMouseMove={handleMouseMove}
|
|
90
|
+
onMouseLeave={() => { x.set(0); y.set(0) }}
|
|
91
|
+
className="px-6 py-3 bg-primary text-primary-foreground rounded-lg"
|
|
92
|
+
>
|
|
93
|
+
{children}
|
|
94
|
+
</motion.button>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Satisfying toggle
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
'use client'
|
|
105
|
+
import { motion } from 'framer-motion'
|
|
106
|
+
import { useState } from 'react'
|
|
107
|
+
|
|
108
|
+
export function SatisfyingToggle({ onToggle }: { onToggle: (on: boolean) => void }) {
|
|
109
|
+
const [isOn, setIsOn] = useState(false)
|
|
110
|
+
const toggle = () => {
|
|
111
|
+
setIsOn(v => !v)
|
|
112
|
+
onToggle(!isOn)
|
|
113
|
+
if ('vibrate' in navigator) navigator.vibrate(10)
|
|
114
|
+
}
|
|
115
|
+
return (
|
|
116
|
+
<motion.button
|
|
117
|
+
onClick={toggle}
|
|
118
|
+
className={`w-14 h-8 rounded-full p-1 ${isOn ? 'bg-primary' : 'bg-muted'}`}
|
|
119
|
+
animate={{ backgroundColor: isOn ? 'hsl(var(--primary))' : 'hsl(var(--muted))' }}
|
|
120
|
+
>
|
|
121
|
+
<motion.div
|
|
122
|
+
className="w-6 h-6 bg-white rounded-full shadow-md"
|
|
123
|
+
animate={{ x: isOn ? 22 : 0, scale: [1, 1.1, 1] }}
|
|
124
|
+
transition={{ type: 'spring', stiffness: 500, damping: 25 }}
|
|
125
|
+
/>
|
|
126
|
+
</motion.button>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Gamification: progress with milestones
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
export function PlayfulProgress({ value }: { value: number }) {
|
|
137
|
+
const milestones = [25, 50, 75, 100]
|
|
138
|
+
return (
|
|
139
|
+
<div className="relative">
|
|
140
|
+
<div className="h-4 bg-muted rounded-full overflow-hidden">
|
|
141
|
+
<motion.div
|
|
142
|
+
className="h-full bg-gradient-to-r from-primary to-primary/80 rounded-full"
|
|
143
|
+
initial={{ width: 0 }}
|
|
144
|
+
animate={{ width: `${value}%` }}
|
|
145
|
+
transition={{ type: 'spring', stiffness: 100, damping: 15 }}
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
{value === 100 && (
|
|
149
|
+
<motion.span initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }}
|
|
150
|
+
className="absolute -top-6 right-0 text-sm">
|
|
151
|
+
🎉 Complete!
|
|
152
|
+
</motion.span>
|
|
153
|
+
)}
|
|
154
|
+
</div>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Easter egg: Konami code
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
const KONAMI = ['ArrowUp','ArrowUp','ArrowDown','ArrowDown',
|
|
165
|
+
'ArrowLeft','ArrowRight','ArrowLeft','ArrowRight','KeyB','KeyA']
|
|
166
|
+
|
|
167
|
+
export function useKonamiCode(callback: () => void) {
|
|
168
|
+
const [index, setIndex] = useState(0)
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
const handle = (e: KeyboardEvent) => {
|
|
171
|
+
if (e.code === KONAMI[index]) {
|
|
172
|
+
if (index === KONAMI.length - 1) { callback(); setIndex(0) }
|
|
173
|
+
else setIndex(i => i + 1)
|
|
174
|
+
} else {
|
|
175
|
+
setIndex(0)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
window.addEventListener('keydown', handle)
|
|
179
|
+
return () => window.removeEventListener('keydown', handle)
|
|
180
|
+
}, [index, callback])
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Principles
|
|
187
|
+
|
|
188
|
+
1. **Purposeful play** — every interaction enhances understanding or provides feedback.
|
|
189
|
+
2. **Progressive discovery** — basic interactions work immediately; fun reveals over time.
|
|
190
|
+
3. **Respect user intent** — never block progress; provide skip/dismiss; respect `prefers-reduced-motion`.
|
|
191
|
+
4. **Performance first** — delight should not cause jank or lag.
|