@wazir-dev/cli 1.0.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/AGENTS.md +111 -0
- package/CHANGELOG.md +14 -0
- package/CONTRIBUTING.md +101 -0
- package/LICENSE +21 -0
- package/README.md +314 -0
- package/assets/composition-engine.mmd +34 -0
- package/assets/demo-script.sh +17 -0
- package/assets/logo-dark.svg +14 -0
- package/assets/logo.svg +14 -0
- package/assets/pipeline.mmd +39 -0
- package/assets/record-demo.sh +51 -0
- package/docs/README.md +51 -0
- package/docs/adapters/context-mode.md +60 -0
- package/docs/concepts/architecture.md +87 -0
- package/docs/concepts/artifact-model.md +60 -0
- package/docs/concepts/composition-engine.md +36 -0
- package/docs/concepts/indexing-and-recall.md +160 -0
- package/docs/concepts/observability.md +41 -0
- package/docs/concepts/roles-and-workflows.md +59 -0
- package/docs/concepts/terminology-policy.md +27 -0
- package/docs/getting-started/01-installation.md +78 -0
- package/docs/getting-started/02-first-run.md +102 -0
- package/docs/getting-started/03-adding-to-project.md +15 -0
- package/docs/getting-started/04-host-setup.md +15 -0
- package/docs/guides/ci-integration.md +15 -0
- package/docs/guides/creating-skills.md +15 -0
- package/docs/guides/expertise-module-authoring.md +15 -0
- package/docs/guides/hook-development.md +15 -0
- package/docs/guides/memory-and-learnings.md +34 -0
- package/docs/guides/multi-host-export.md +15 -0
- package/docs/guides/troubleshooting.md +101 -0
- package/docs/guides/writing-custom-roles.md +15 -0
- package/docs/plans/2026-03-15-cli-pipeline-integration-design.md +592 -0
- package/docs/plans/2026-03-15-cli-pipeline-integration-plan.md +598 -0
- package/docs/plans/2026-03-15-docs-enforcement-plan.md +238 -0
- package/docs/readmes/INDEX.md +99 -0
- package/docs/readmes/features/expertise/README.md +171 -0
- package/docs/readmes/features/exports/README.md +222 -0
- package/docs/readmes/features/hooks/README.md +103 -0
- package/docs/readmes/features/hooks/loop-cap-guard.md +133 -0
- package/docs/readmes/features/hooks/post-tool-capture.md +121 -0
- package/docs/readmes/features/hooks/post-tool-lint.md +130 -0
- package/docs/readmes/features/hooks/pre-compact-summary.md +122 -0
- package/docs/readmes/features/hooks/pre-tool-capture-route.md +100 -0
- package/docs/readmes/features/hooks/protected-path-write-guard.md +128 -0
- package/docs/readmes/features/hooks/session-start.md +119 -0
- package/docs/readmes/features/hooks/stop-handoff-harvest.md +125 -0
- package/docs/readmes/features/roles/README.md +157 -0
- package/docs/readmes/features/roles/clarifier.md +152 -0
- package/docs/readmes/features/roles/content-author.md +190 -0
- package/docs/readmes/features/roles/designer.md +193 -0
- package/docs/readmes/features/roles/executor.md +184 -0
- package/docs/readmes/features/roles/learner.md +210 -0
- package/docs/readmes/features/roles/planner.md +182 -0
- package/docs/readmes/features/roles/researcher.md +164 -0
- package/docs/readmes/features/roles/reviewer.md +184 -0
- package/docs/readmes/features/roles/specifier.md +162 -0
- package/docs/readmes/features/roles/verifier.md +215 -0
- package/docs/readmes/features/schemas/README.md +178 -0
- package/docs/readmes/features/skills/README.md +63 -0
- package/docs/readmes/features/skills/brainstorming.md +96 -0
- package/docs/readmes/features/skills/debugging.md +148 -0
- package/docs/readmes/features/skills/design.md +120 -0
- package/docs/readmes/features/skills/prepare-next.md +109 -0
- package/docs/readmes/features/skills/run-audit.md +159 -0
- package/docs/readmes/features/skills/scan-project.md +109 -0
- package/docs/readmes/features/skills/self-audit.md +176 -0
- package/docs/readmes/features/skills/tdd.md +137 -0
- package/docs/readmes/features/skills/using-skills.md +92 -0
- package/docs/readmes/features/skills/verification.md +120 -0
- package/docs/readmes/features/skills/writing-plans.md +104 -0
- package/docs/readmes/features/tooling/README.md +320 -0
- package/docs/readmes/features/workflows/README.md +186 -0
- package/docs/readmes/features/workflows/author.md +181 -0
- package/docs/readmes/features/workflows/clarify.md +154 -0
- package/docs/readmes/features/workflows/design-review.md +171 -0
- package/docs/readmes/features/workflows/design.md +169 -0
- package/docs/readmes/features/workflows/discover.md +162 -0
- package/docs/readmes/features/workflows/execute.md +173 -0
- package/docs/readmes/features/workflows/learn.md +167 -0
- package/docs/readmes/features/workflows/plan-review.md +165 -0
- package/docs/readmes/features/workflows/plan.md +170 -0
- package/docs/readmes/features/workflows/prepare-next.md +167 -0
- package/docs/readmes/features/workflows/review.md +169 -0
- package/docs/readmes/features/workflows/run-audit.md +191 -0
- package/docs/readmes/features/workflows/spec-challenge.md +159 -0
- package/docs/readmes/features/workflows/specify.md +160 -0
- package/docs/readmes/features/workflows/verify.md +177 -0
- package/docs/readmes/packages/README.md +50 -0
- package/docs/readmes/packages/ajv.md +117 -0
- package/docs/readmes/packages/context-mode.md +118 -0
- package/docs/readmes/packages/gray-matter.md +116 -0
- package/docs/readmes/packages/node-test.md +137 -0
- package/docs/readmes/packages/yaml.md +112 -0
- package/docs/reference/configuration-reference.md +159 -0
- package/docs/reference/expertise-index.md +52 -0
- package/docs/reference/git-flow.md +43 -0
- package/docs/reference/hooks.md +87 -0
- package/docs/reference/host-exports.md +50 -0
- package/docs/reference/launch-checklist.md +172 -0
- package/docs/reference/marketplace-listings.md +76 -0
- package/docs/reference/release-process.md +34 -0
- package/docs/reference/roles-reference.md +77 -0
- package/docs/reference/skills.md +33 -0
- package/docs/reference/templates.md +29 -0
- package/docs/reference/tooling-cli.md +94 -0
- package/docs/truth-claims.yaml +222 -0
- package/expertise/PROGRESS.md +63 -0
- package/expertise/README.md +18 -0
- package/expertise/antipatterns/PROGRESS.md +56 -0
- package/expertise/antipatterns/backend/api-design-antipatterns.md +1271 -0
- package/expertise/antipatterns/backend/auth-antipatterns.md +1195 -0
- package/expertise/antipatterns/backend/caching-antipatterns.md +622 -0
- package/expertise/antipatterns/backend/database-antipatterns.md +1038 -0
- package/expertise/antipatterns/backend/index.md +24 -0
- package/expertise/antipatterns/backend/microservices-antipatterns.md +850 -0
- package/expertise/antipatterns/code/architecture-antipatterns.md +919 -0
- package/expertise/antipatterns/code/async-antipatterns.md +622 -0
- package/expertise/antipatterns/code/code-smells.md +1186 -0
- package/expertise/antipatterns/code/dependency-antipatterns.md +1209 -0
- package/expertise/antipatterns/code/error-handling-antipatterns.md +1360 -0
- package/expertise/antipatterns/code/index.md +27 -0
- package/expertise/antipatterns/code/naming-and-abstraction.md +1118 -0
- package/expertise/antipatterns/code/state-management-antipatterns.md +1076 -0
- package/expertise/antipatterns/code/testing-antipatterns.md +1053 -0
- package/expertise/antipatterns/design/accessibility-antipatterns.md +1136 -0
- package/expertise/antipatterns/design/dark-patterns.md +1121 -0
- package/expertise/antipatterns/design/index.md +22 -0
- package/expertise/antipatterns/design/ui-antipatterns.md +1202 -0
- package/expertise/antipatterns/design/ux-antipatterns.md +680 -0
- package/expertise/antipatterns/frontend/css-layout-antipatterns.md +691 -0
- package/expertise/antipatterns/frontend/flutter-antipatterns.md +1827 -0
- package/expertise/antipatterns/frontend/index.md +23 -0
- package/expertise/antipatterns/frontend/mobile-antipatterns.md +573 -0
- package/expertise/antipatterns/frontend/react-antipatterns.md +1128 -0
- package/expertise/antipatterns/frontend/spa-antipatterns.md +1235 -0
- package/expertise/antipatterns/index.md +31 -0
- package/expertise/antipatterns/performance/index.md +20 -0
- package/expertise/antipatterns/performance/performance-antipatterns.md +1013 -0
- package/expertise/antipatterns/performance/premature-optimization.md +623 -0
- package/expertise/antipatterns/performance/scaling-antipatterns.md +785 -0
- package/expertise/antipatterns/process/ai-coding-antipatterns.md +853 -0
- package/expertise/antipatterns/process/code-review-antipatterns.md +656 -0
- package/expertise/antipatterns/process/deployment-antipatterns.md +920 -0
- package/expertise/antipatterns/process/index.md +23 -0
- package/expertise/antipatterns/process/technical-debt-antipatterns.md +647 -0
- package/expertise/antipatterns/security/index.md +20 -0
- package/expertise/antipatterns/security/secrets-antipatterns.md +849 -0
- package/expertise/antipatterns/security/security-theater.md +843 -0
- package/expertise/antipatterns/security/vulnerability-patterns.md +801 -0
- package/expertise/architecture/PROGRESS.md +70 -0
- package/expertise/architecture/data/caching-architecture.md +671 -0
- package/expertise/architecture/data/data-consistency.md +574 -0
- package/expertise/architecture/data/data-modeling.md +536 -0
- package/expertise/architecture/data/event-streams-and-queues.md +634 -0
- package/expertise/architecture/data/index.md +25 -0
- package/expertise/architecture/data/search-architecture.md +663 -0
- package/expertise/architecture/data/sql-vs-nosql.md +708 -0
- package/expertise/architecture/decisions/architecture-decision-records.md +640 -0
- package/expertise/architecture/decisions/build-vs-buy.md +616 -0
- package/expertise/architecture/decisions/index.md +23 -0
- package/expertise/architecture/decisions/monolith-to-microservices.md +790 -0
- package/expertise/architecture/decisions/technology-selection.md +616 -0
- package/expertise/architecture/distributed/cap-theorem-and-tradeoffs.md +800 -0
- package/expertise/architecture/distributed/circuit-breaker-bulkhead.md +741 -0
- package/expertise/architecture/distributed/consensus-and-coordination.md +796 -0
- package/expertise/architecture/distributed/distributed-systems-fundamentals.md +564 -0
- package/expertise/architecture/distributed/idempotency-and-retry.md +796 -0
- package/expertise/architecture/distributed/index.md +25 -0
- package/expertise/architecture/distributed/saga-pattern.md +797 -0
- package/expertise/architecture/foundations/architectural-thinking.md +460 -0
- package/expertise/architecture/foundations/coupling-and-cohesion.md +770 -0
- package/expertise/architecture/foundations/design-principles-solid.md +649 -0
- package/expertise/architecture/foundations/domain-driven-design.md +719 -0
- package/expertise/architecture/foundations/index.md +25 -0
- package/expertise/architecture/foundations/separation-of-concerns.md +472 -0
- package/expertise/architecture/foundations/twelve-factor-app.md +797 -0
- package/expertise/architecture/index.md +34 -0
- package/expertise/architecture/integration/api-design-graphql.md +638 -0
- package/expertise/architecture/integration/api-design-grpc.md +804 -0
- package/expertise/architecture/integration/api-design-rest.md +892 -0
- package/expertise/architecture/integration/index.md +25 -0
- package/expertise/architecture/integration/third-party-integration.md +795 -0
- package/expertise/architecture/integration/webhooks-and-callbacks.md +1152 -0
- package/expertise/architecture/integration/websockets-realtime.md +791 -0
- package/expertise/architecture/mobile-architecture/index.md +22 -0
- package/expertise/architecture/mobile-architecture/mobile-app-architecture.md +780 -0
- package/expertise/architecture/mobile-architecture/mobile-backend-for-frontend.md +670 -0
- package/expertise/architecture/mobile-architecture/offline-first.md +719 -0
- package/expertise/architecture/mobile-architecture/push-and-sync.md +782 -0
- package/expertise/architecture/patterns/cqrs-event-sourcing.md +717 -0
- package/expertise/architecture/patterns/event-driven.md +797 -0
- package/expertise/architecture/patterns/hexagonal-clean-architecture.md +870 -0
- package/expertise/architecture/patterns/index.md +27 -0
- package/expertise/architecture/patterns/layered-architecture.md +736 -0
- package/expertise/architecture/patterns/microservices.md +753 -0
- package/expertise/architecture/patterns/modular-monolith.md +692 -0
- package/expertise/architecture/patterns/monolith.md +626 -0
- package/expertise/architecture/patterns/plugin-architecture.md +735 -0
- package/expertise/architecture/patterns/serverless.md +780 -0
- package/expertise/architecture/scaling/database-scaling.md +615 -0
- package/expertise/architecture/scaling/feature-flags-and-rollouts.md +757 -0
- package/expertise/architecture/scaling/horizontal-vs-vertical.md +606 -0
- package/expertise/architecture/scaling/index.md +24 -0
- package/expertise/architecture/scaling/multi-tenancy.md +800 -0
- package/expertise/architecture/scaling/stateless-design.md +787 -0
- package/expertise/backend/embedded-firmware.md +625 -0
- package/expertise/backend/go.md +853 -0
- package/expertise/backend/index.md +24 -0
- package/expertise/backend/java-spring.md +448 -0
- package/expertise/backend/node-typescript.md +625 -0
- package/expertise/backend/python-fastapi.md +724 -0
- package/expertise/backend/rust.md +458 -0
- package/expertise/backend/solidity.md +711 -0
- package/expertise/composition-map.yaml +443 -0
- package/expertise/content/foundations/content-modeling.md +395 -0
- package/expertise/content/foundations/editorial-standards.md +449 -0
- package/expertise/content/foundations/index.md +24 -0
- package/expertise/content/foundations/microcopy.md +455 -0
- package/expertise/content/foundations/terminology-governance.md +509 -0
- package/expertise/content/index.md +34 -0
- package/expertise/content/patterns/accessibility-copy.md +518 -0
- package/expertise/content/patterns/index.md +24 -0
- package/expertise/content/patterns/notification-content.md +433 -0
- package/expertise/content/patterns/sample-content.md +486 -0
- package/expertise/content/patterns/state-copy.md +439 -0
- package/expertise/design/PROGRESS.md +58 -0
- package/expertise/design/disciplines/dark-mode-theming.md +577 -0
- package/expertise/design/disciplines/design-systems.md +595 -0
- package/expertise/design/disciplines/index.md +25 -0
- package/expertise/design/disciplines/information-architecture.md +800 -0
- package/expertise/design/disciplines/interaction-design.md +788 -0
- package/expertise/design/disciplines/responsive-design.md +552 -0
- package/expertise/design/disciplines/usability-testing.md +516 -0
- package/expertise/design/disciplines/user-research.md +792 -0
- package/expertise/design/foundations/accessibility-design.md +796 -0
- package/expertise/design/foundations/color-theory.md +797 -0
- package/expertise/design/foundations/iconography.md +795 -0
- package/expertise/design/foundations/index.md +26 -0
- package/expertise/design/foundations/motion-and-animation.md +653 -0
- package/expertise/design/foundations/rtl-design.md +585 -0
- package/expertise/design/foundations/spacing-and-layout.md +607 -0
- package/expertise/design/foundations/typography.md +800 -0
- package/expertise/design/foundations/visual-hierarchy.md +761 -0
- package/expertise/design/index.md +32 -0
- package/expertise/design/patterns/authentication-flows.md +474 -0
- package/expertise/design/patterns/content-consumption.md +789 -0
- package/expertise/design/patterns/data-display.md +618 -0
- package/expertise/design/patterns/e-commerce.md +1494 -0
- package/expertise/design/patterns/feedback-and-states.md +642 -0
- package/expertise/design/patterns/forms-and-input.md +819 -0
- package/expertise/design/patterns/gamification.md +801 -0
- package/expertise/design/patterns/index.md +31 -0
- package/expertise/design/patterns/microinteractions.md +449 -0
- package/expertise/design/patterns/navigation.md +800 -0
- package/expertise/design/patterns/notifications.md +705 -0
- package/expertise/design/patterns/onboarding.md +700 -0
- package/expertise/design/patterns/search-and-filter.md +601 -0
- package/expertise/design/patterns/settings-and-preferences.md +768 -0
- package/expertise/design/patterns/social-and-community.md +748 -0
- package/expertise/design/platforms/desktop-native.md +612 -0
- package/expertise/design/platforms/index.md +25 -0
- package/expertise/design/platforms/mobile-android.md +825 -0
- package/expertise/design/platforms/mobile-cross-platform.md +983 -0
- package/expertise/design/platforms/mobile-ios.md +699 -0
- package/expertise/design/platforms/tablet.md +794 -0
- package/expertise/design/platforms/web-dashboard.md +790 -0
- package/expertise/design/platforms/web-responsive.md +550 -0
- package/expertise/design/psychology/behavioral-nudges.md +449 -0
- package/expertise/design/psychology/cognitive-load.md +1191 -0
- package/expertise/design/psychology/error-psychology.md +778 -0
- package/expertise/design/psychology/index.md +22 -0
- package/expertise/design/psychology/persuasive-design.md +736 -0
- package/expertise/design/psychology/user-mental-models.md +623 -0
- package/expertise/design/tooling/open-pencil.md +266 -0
- package/expertise/frontend/angular.md +1073 -0
- package/expertise/frontend/desktop-electron.md +546 -0
- package/expertise/frontend/flutter.md +782 -0
- package/expertise/frontend/index.md +27 -0
- package/expertise/frontend/native-android.md +409 -0
- package/expertise/frontend/native-ios.md +490 -0
- package/expertise/frontend/react-native.md +1160 -0
- package/expertise/frontend/react.md +808 -0
- package/expertise/frontend/vue.md +1089 -0
- package/expertise/humanize/domain-rules-code.md +79 -0
- package/expertise/humanize/domain-rules-content.md +67 -0
- package/expertise/humanize/domain-rules-technical-docs.md +56 -0
- package/expertise/humanize/index.md +35 -0
- package/expertise/humanize/self-audit-checklist.md +87 -0
- package/expertise/humanize/sentence-patterns.md +218 -0
- package/expertise/humanize/vocabulary-blacklist.md +105 -0
- package/expertise/i18n/PROGRESS.md +65 -0
- package/expertise/i18n/advanced/accessibility-and-i18n.md +28 -0
- package/expertise/i18n/advanced/bidirectional-text-algorithm.md +38 -0
- package/expertise/i18n/advanced/complex-scripts.md +30 -0
- package/expertise/i18n/advanced/performance-and-i18n.md +27 -0
- package/expertise/i18n/advanced/testing-i18n.md +28 -0
- package/expertise/i18n/content/content-adaptation.md +23 -0
- package/expertise/i18n/content/locale-specific-formatting.md +23 -0
- package/expertise/i18n/content/machine-translation-integration.md +28 -0
- package/expertise/i18n/content/translation-management.md +29 -0
- package/expertise/i18n/foundations/date-time-calendars.md +67 -0
- package/expertise/i18n/foundations/i18n-architecture.md +272 -0
- package/expertise/i18n/foundations/locale-and-language-tags.md +79 -0
- package/expertise/i18n/foundations/numbers-currency-units.md +61 -0
- package/expertise/i18n/foundations/pluralization-and-gender.md +109 -0
- package/expertise/i18n/foundations/string-externalization.md +236 -0
- package/expertise/i18n/foundations/text-direction-bidi.md +241 -0
- package/expertise/i18n/foundations/unicode-and-encoding.md +86 -0
- package/expertise/i18n/index.md +38 -0
- package/expertise/i18n/platform/backend-i18n.md +31 -0
- package/expertise/i18n/platform/flutter-i18n.md +148 -0
- package/expertise/i18n/platform/native-android-i18n.md +36 -0
- package/expertise/i18n/platform/native-ios-i18n.md +36 -0
- package/expertise/i18n/platform/react-i18n.md +103 -0
- package/expertise/i18n/platform/web-css-i18n.md +81 -0
- package/expertise/i18n/rtl/arabic-specific.md +175 -0
- package/expertise/i18n/rtl/hebrew-specific.md +149 -0
- package/expertise/i18n/rtl/rtl-animations-and-transitions.md +111 -0
- package/expertise/i18n/rtl/rtl-forms-and-input.md +161 -0
- package/expertise/i18n/rtl/rtl-fundamentals.md +211 -0
- package/expertise/i18n/rtl/rtl-icons-and-images.md +181 -0
- package/expertise/i18n/rtl/rtl-layout-mirroring.md +252 -0
- package/expertise/i18n/rtl/rtl-navigation-and-gestures.md +107 -0
- package/expertise/i18n/rtl/rtl-testing-and-qa.md +147 -0
- package/expertise/i18n/rtl/rtl-typography.md +160 -0
- package/expertise/index.md +113 -0
- package/expertise/index.yaml +216 -0
- package/expertise/infrastructure/cloud-aws.md +597 -0
- package/expertise/infrastructure/cloud-gcp.md +599 -0
- package/expertise/infrastructure/cybersecurity.md +816 -0
- package/expertise/infrastructure/database-mongodb.md +447 -0
- package/expertise/infrastructure/database-postgres.md +400 -0
- package/expertise/infrastructure/devops-cicd.md +787 -0
- package/expertise/infrastructure/index.md +27 -0
- package/expertise/performance/PROGRESS.md +50 -0
- package/expertise/performance/backend/api-latency.md +1204 -0
- package/expertise/performance/backend/background-jobs.md +506 -0
- package/expertise/performance/backend/connection-pooling.md +1209 -0
- package/expertise/performance/backend/database-query-optimization.md +515 -0
- package/expertise/performance/backend/index.md +23 -0
- package/expertise/performance/backend/rate-limiting-and-throttling.md +971 -0
- package/expertise/performance/foundations/algorithmic-complexity.md +954 -0
- package/expertise/performance/foundations/caching-strategies.md +489 -0
- package/expertise/performance/foundations/concurrency-and-parallelism.md +847 -0
- package/expertise/performance/foundations/index.md +24 -0
- package/expertise/performance/foundations/measuring-and-profiling.md +440 -0
- package/expertise/performance/foundations/memory-management.md +964 -0
- package/expertise/performance/foundations/performance-budgets.md +1314 -0
- package/expertise/performance/index.md +31 -0
- package/expertise/performance/infrastructure/auto-scaling.md +1059 -0
- package/expertise/performance/infrastructure/cdn-and-edge.md +1081 -0
- package/expertise/performance/infrastructure/index.md +22 -0
- package/expertise/performance/infrastructure/load-balancing.md +1081 -0
- package/expertise/performance/infrastructure/observability.md +1079 -0
- package/expertise/performance/mobile/index.md +23 -0
- package/expertise/performance/mobile/mobile-animations.md +544 -0
- package/expertise/performance/mobile/mobile-memory-battery.md +416 -0
- package/expertise/performance/mobile/mobile-network.md +452 -0
- package/expertise/performance/mobile/mobile-rendering.md +599 -0
- package/expertise/performance/mobile/mobile-startup-time.md +505 -0
- package/expertise/performance/platform-specific/flutter-performance.md +647 -0
- package/expertise/performance/platform-specific/index.md +22 -0
- package/expertise/performance/platform-specific/node-performance.md +1307 -0
- package/expertise/performance/platform-specific/postgres-performance.md +1366 -0
- package/expertise/performance/platform-specific/react-performance.md +1403 -0
- package/expertise/performance/web/bundle-optimization.md +1239 -0
- package/expertise/performance/web/image-and-media.md +636 -0
- package/expertise/performance/web/index.md +24 -0
- package/expertise/performance/web/network-optimization.md +1133 -0
- package/expertise/performance/web/rendering-performance.md +1098 -0
- package/expertise/performance/web/ssr-and-hydration.md +918 -0
- package/expertise/performance/web/web-vitals.md +1374 -0
- package/expertise/quality/accessibility.md +985 -0
- package/expertise/quality/evidence-based-verification.md +499 -0
- package/expertise/quality/index.md +24 -0
- package/expertise/quality/ml-model-audit.md +614 -0
- package/expertise/quality/performance.md +600 -0
- package/expertise/quality/testing-api.md +891 -0
- package/expertise/quality/testing-mobile.md +496 -0
- package/expertise/quality/testing-web.md +849 -0
- package/expertise/security/PROGRESS.md +54 -0
- package/expertise/security/agentic-identity.md +540 -0
- package/expertise/security/compliance-frameworks.md +601 -0
- package/expertise/security/data/data-encryption.md +364 -0
- package/expertise/security/data/data-privacy-gdpr.md +692 -0
- package/expertise/security/data/database-security.md +1171 -0
- package/expertise/security/data/index.md +22 -0
- package/expertise/security/data/pii-handling.md +531 -0
- package/expertise/security/foundations/authentication.md +1041 -0
- package/expertise/security/foundations/authorization.md +603 -0
- package/expertise/security/foundations/cryptography.md +1001 -0
- package/expertise/security/foundations/index.md +25 -0
- package/expertise/security/foundations/owasp-top-10.md +1354 -0
- package/expertise/security/foundations/secrets-management.md +1217 -0
- package/expertise/security/foundations/secure-sdlc.md +700 -0
- package/expertise/security/foundations/supply-chain-security.md +698 -0
- package/expertise/security/index.md +31 -0
- package/expertise/security/infrastructure/cloud-security-aws.md +1296 -0
- package/expertise/security/infrastructure/cloud-security-gcp.md +1376 -0
- package/expertise/security/infrastructure/container-security.md +721 -0
- package/expertise/security/infrastructure/incident-response.md +1295 -0
- package/expertise/security/infrastructure/index.md +24 -0
- package/expertise/security/infrastructure/logging-and-monitoring.md +1618 -0
- package/expertise/security/infrastructure/network-security.md +1337 -0
- package/expertise/security/mobile/index.md +23 -0
- package/expertise/security/mobile/mobile-android-security.md +1218 -0
- package/expertise/security/mobile/mobile-binary-protection.md +1229 -0
- package/expertise/security/mobile/mobile-data-storage.md +1265 -0
- package/expertise/security/mobile/mobile-ios-security.md +1401 -0
- package/expertise/security/mobile/mobile-network-security.md +1520 -0
- package/expertise/security/smart-contract-security.md +594 -0
- package/expertise/security/testing/index.md +22 -0
- package/expertise/security/testing/penetration-testing.md +1258 -0
- package/expertise/security/testing/security-code-review.md +1765 -0
- package/expertise/security/testing/threat-modeling.md +1074 -0
- package/expertise/security/testing/vulnerability-scanning.md +1062 -0
- package/expertise/security/web/api-security.md +586 -0
- package/expertise/security/web/cors-and-headers.md +433 -0
- package/expertise/security/web/csrf.md +562 -0
- package/expertise/security/web/file-upload.md +1477 -0
- package/expertise/security/web/index.md +25 -0
- package/expertise/security/web/injection.md +1375 -0
- package/expertise/security/web/session-management.md +1101 -0
- package/expertise/security/web/xss.md +1158 -0
- package/exports/README.md +17 -0
- package/exports/hosts/claude/.claude/agents/clarifier.md +42 -0
- package/exports/hosts/claude/.claude/agents/content-author.md +63 -0
- package/exports/hosts/claude/.claude/agents/designer.md +55 -0
- package/exports/hosts/claude/.claude/agents/executor.md +55 -0
- package/exports/hosts/claude/.claude/agents/learner.md +51 -0
- package/exports/hosts/claude/.claude/agents/planner.md +53 -0
- package/exports/hosts/claude/.claude/agents/researcher.md +43 -0
- package/exports/hosts/claude/.claude/agents/reviewer.md +54 -0
- package/exports/hosts/claude/.claude/agents/specifier.md +47 -0
- package/exports/hosts/claude/.claude/agents/verifier.md +71 -0
- package/exports/hosts/claude/.claude/commands/author.md +42 -0
- package/exports/hosts/claude/.claude/commands/clarify.md +38 -0
- package/exports/hosts/claude/.claude/commands/design-review.md +46 -0
- package/exports/hosts/claude/.claude/commands/design.md +44 -0
- package/exports/hosts/claude/.claude/commands/discover.md +37 -0
- package/exports/hosts/claude/.claude/commands/execute.md +48 -0
- package/exports/hosts/claude/.claude/commands/learn.md +38 -0
- package/exports/hosts/claude/.claude/commands/plan-review.md +42 -0
- package/exports/hosts/claude/.claude/commands/plan.md +39 -0
- package/exports/hosts/claude/.claude/commands/prepare-next.md +37 -0
- package/exports/hosts/claude/.claude/commands/review.md +40 -0
- package/exports/hosts/claude/.claude/commands/run-audit.md +41 -0
- package/exports/hosts/claude/.claude/commands/spec-challenge.md +41 -0
- package/exports/hosts/claude/.claude/commands/specify.md +38 -0
- package/exports/hosts/claude/.claude/commands/verify.md +37 -0
- package/exports/hosts/claude/.claude/settings.json +34 -0
- package/exports/hosts/claude/CLAUDE.md +19 -0
- package/exports/hosts/claude/export.manifest.json +38 -0
- package/exports/hosts/claude/host-package.json +67 -0
- package/exports/hosts/codex/AGENTS.md +19 -0
- package/exports/hosts/codex/export.manifest.json +38 -0
- package/exports/hosts/codex/host-package.json +41 -0
- package/exports/hosts/cursor/.cursor/hooks.json +16 -0
- package/exports/hosts/cursor/.cursor/rules/wazir-core.mdc +19 -0
- package/exports/hosts/cursor/export.manifest.json +38 -0
- package/exports/hosts/cursor/host-package.json +42 -0
- package/exports/hosts/gemini/GEMINI.md +19 -0
- package/exports/hosts/gemini/export.manifest.json +38 -0
- package/exports/hosts/gemini/host-package.json +41 -0
- package/hooks/README.md +18 -0
- package/hooks/definitions/loop_cap_guard.yaml +21 -0
- package/hooks/definitions/post_tool_capture.yaml +24 -0
- package/hooks/definitions/pre_compact_summary.yaml +19 -0
- package/hooks/definitions/pre_tool_capture_route.yaml +19 -0
- package/hooks/definitions/protected_path_write_guard.yaml +19 -0
- package/hooks/definitions/session_start.yaml +19 -0
- package/hooks/definitions/stop_handoff_harvest.yaml +20 -0
- package/hooks/loop-cap-guard +17 -0
- package/hooks/post-tool-lint +36 -0
- package/hooks/protected-path-write-guard +17 -0
- package/hooks/session-start +41 -0
- package/llms-full.txt +2355 -0
- package/llms.txt +43 -0
- package/package.json +79 -0
- package/roles/README.md +20 -0
- package/roles/clarifier.md +42 -0
- package/roles/content-author.md +63 -0
- package/roles/designer.md +55 -0
- package/roles/executor.md +55 -0
- package/roles/learner.md +51 -0
- package/roles/planner.md +53 -0
- package/roles/researcher.md +43 -0
- package/roles/reviewer.md +54 -0
- package/roles/specifier.md +47 -0
- package/roles/verifier.md +71 -0
- package/schemas/README.md +24 -0
- package/schemas/accepted-learning.schema.json +20 -0
- package/schemas/author-artifact.schema.json +156 -0
- package/schemas/clarification.schema.json +19 -0
- package/schemas/design-artifact.schema.json +80 -0
- package/schemas/docs-claim.schema.json +18 -0
- package/schemas/export-manifest.schema.json +20 -0
- package/schemas/hook.schema.json +67 -0
- package/schemas/host-export-package.schema.json +18 -0
- package/schemas/implementation-plan.schema.json +19 -0
- package/schemas/proposed-learning.schema.json +19 -0
- package/schemas/research.schema.json +18 -0
- package/schemas/review.schema.json +29 -0
- package/schemas/run-manifest.schema.json +18 -0
- package/schemas/spec-challenge.schema.json +18 -0
- package/schemas/spec.schema.json +20 -0
- package/schemas/usage.schema.json +102 -0
- package/schemas/verification-proof.schema.json +29 -0
- package/schemas/wazir-manifest.schema.json +173 -0
- package/skills/README.md +40 -0
- package/skills/brainstorming/SKILL.md +77 -0
- package/skills/debugging/SKILL.md +50 -0
- package/skills/design/SKILL.md +61 -0
- package/skills/dispatching-parallel-agents/SKILL.md +128 -0
- package/skills/executing-plans/SKILL.md +70 -0
- package/skills/finishing-a-development-branch/SKILL.md +169 -0
- package/skills/humanize/SKILL.md +123 -0
- package/skills/init-pipeline/SKILL.md +124 -0
- package/skills/prepare-next/SKILL.md +20 -0
- package/skills/receiving-code-review/SKILL.md +123 -0
- package/skills/requesting-code-review/SKILL.md +105 -0
- package/skills/requesting-code-review/code-reviewer.md +108 -0
- package/skills/run-audit/SKILL.md +197 -0
- package/skills/scan-project/SKILL.md +41 -0
- package/skills/self-audit/SKILL.md +153 -0
- package/skills/subagent-driven-development/SKILL.md +154 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/skills/subagent-driven-development/implementer-prompt.md +102 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/tdd/SKILL.md +23 -0
- package/skills/using-git-worktrees/SKILL.md +163 -0
- package/skills/using-skills/SKILL.md +95 -0
- package/skills/verification/SKILL.md +22 -0
- package/skills/wazir/SKILL.md +463 -0
- package/skills/writing-plans/SKILL.md +30 -0
- package/skills/writing-skills/SKILL.md +157 -0
- package/skills/writing-skills/anthropic-best-practices.md +122 -0
- package/skills/writing-skills/persuasion-principles.md +50 -0
- package/templates/README.md +20 -0
- package/templates/artifacts/README.md +10 -0
- package/templates/artifacts/accepted-learning.md +19 -0
- package/templates/artifacts/accepted-learning.template.json +12 -0
- package/templates/artifacts/author.md +74 -0
- package/templates/artifacts/author.template.json +19 -0
- package/templates/artifacts/clarification.md +21 -0
- package/templates/artifacts/clarification.template.json +12 -0
- package/templates/artifacts/execute-notes.md +19 -0
- package/templates/artifacts/implementation-plan.md +21 -0
- package/templates/artifacts/implementation-plan.template.json +11 -0
- package/templates/artifacts/learning-proposal.md +19 -0
- package/templates/artifacts/next-run-handoff.md +21 -0
- package/templates/artifacts/plan-review.md +19 -0
- package/templates/artifacts/proposed-learning.template.json +12 -0
- package/templates/artifacts/research.md +21 -0
- package/templates/artifacts/research.template.json +12 -0
- package/templates/artifacts/review-findings.md +19 -0
- package/templates/artifacts/review.template.json +11 -0
- package/templates/artifacts/run-manifest.template.json +8 -0
- package/templates/artifacts/spec-challenge.md +19 -0
- package/templates/artifacts/spec-challenge.template.json +11 -0
- package/templates/artifacts/spec.md +21 -0
- package/templates/artifacts/spec.template.json +12 -0
- package/templates/artifacts/verification-proof.md +19 -0
- package/templates/artifacts/verification-proof.template.json +11 -0
- package/templates/examples/accepted-learning.example.json +14 -0
- package/templates/examples/author.example.json +152 -0
- package/templates/examples/clarification.example.json +15 -0
- package/templates/examples/docs-claim.example.json +8 -0
- package/templates/examples/export-manifest.example.json +7 -0
- package/templates/examples/host-export-package.example.json +11 -0
- package/templates/examples/implementation-plan.example.json +17 -0
- package/templates/examples/proposed-learning.example.json +13 -0
- package/templates/examples/research.example.json +15 -0
- package/templates/examples/research.example.md +6 -0
- package/templates/examples/review.example.json +17 -0
- package/templates/examples/run-manifest.example.json +9 -0
- package/templates/examples/spec-challenge.example.json +14 -0
- package/templates/examples/spec.example.json +21 -0
- package/templates/examples/verification-proof.example.json +21 -0
- package/templates/examples/wazir-manifest.example.yaml +65 -0
- package/templates/task-definition-schema.md +99 -0
- package/tooling/README.md +20 -0
- package/tooling/src/adapters/context-mode.js +50 -0
- package/tooling/src/capture/command.js +376 -0
- package/tooling/src/capture/store.js +99 -0
- package/tooling/src/capture/usage.js +270 -0
- package/tooling/src/checks/branches.js +50 -0
- package/tooling/src/checks/brand-truth.js +110 -0
- package/tooling/src/checks/changelog.js +231 -0
- package/tooling/src/checks/command-registry.js +36 -0
- package/tooling/src/checks/commits.js +102 -0
- package/tooling/src/checks/docs-drift.js +103 -0
- package/tooling/src/checks/docs-truth.js +201 -0
- package/tooling/src/checks/runtime-surface.js +156 -0
- package/tooling/src/cli.js +116 -0
- package/tooling/src/command-options.js +56 -0
- package/tooling/src/commands/validate.js +320 -0
- package/tooling/src/doctor/command.js +91 -0
- package/tooling/src/export/command.js +77 -0
- package/tooling/src/export/compiler.js +498 -0
- package/tooling/src/guards/loop-cap-guard.js +52 -0
- package/tooling/src/guards/protected-path-write-guard.js +67 -0
- package/tooling/src/index/command.js +152 -0
- package/tooling/src/index/storage.js +1061 -0
- package/tooling/src/index/summarizers.js +261 -0
- package/tooling/src/loaders.js +18 -0
- package/tooling/src/project-root.js +22 -0
- package/tooling/src/recall/command.js +225 -0
- package/tooling/src/schema-validator.js +30 -0
- package/tooling/src/state-root.js +40 -0
- package/tooling/src/status/command.js +71 -0
- package/wazir.manifest.yaml +135 -0
- package/workflows/README.md +19 -0
- package/workflows/author.md +42 -0
- package/workflows/clarify.md +38 -0
- package/workflows/design-review.md +46 -0
- package/workflows/design.md +44 -0
- package/workflows/discover.md +37 -0
- package/workflows/execute.md +48 -0
- package/workflows/learn.md +38 -0
- package/workflows/plan-review.md +42 -0
- package/workflows/plan.md +39 -0
- package/workflows/prepare-next.md +37 -0
- package/workflows/review.md +40 -0
- package/workflows/run-audit.md +41 -0
- package/workflows/spec-challenge.md +41 -0
- package/workflows/specify.md +38 -0
- package/workflows/verify.md +37 -0
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
# Motion and Animation -- Design Foundation Module
|
|
2
|
+
|
|
3
|
+
> Motion in UI exists to orient, focus, express, and inform -- never to decorate.
|
|
4
|
+
> Every animation must answer the question: "What does this help the user understand?"
|
|
5
|
+
> If the answer is "nothing," remove it. Motion that lacks purpose is motion that steals attention.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Core Principles
|
|
10
|
+
|
|
11
|
+
### 1.1 The Four Purposes of Motion
|
|
12
|
+
|
|
13
|
+
Motion in user interfaces serves exactly four functions. If an animation does not fulfill at least one, it should not exist.
|
|
14
|
+
|
|
15
|
+
| Purpose | Description | Example |
|
|
16
|
+
|---------|-------------|---------|
|
|
17
|
+
| **Orient** | Show spatial relationships, where things come from and go to | A panel sliding in from the right tells the user they can swipe right to dismiss it |
|
|
18
|
+
| **Focus** | Direct attention to what matters right now | A subtle pulse on a newly appeared notification badge |
|
|
19
|
+
| **Express** | Convey brand personality and emotional tone | A playful bounce on a successful action in a consumer app |
|
|
20
|
+
| **Inform** | Communicate status, feedback, or state changes | A progress bar filling, a skeleton screen shimmer indicating loading |
|
|
21
|
+
|
|
22
|
+
Anti-pattern: Animation used purely for visual flair (spinning logos, gratuitous parallax, decorative particle effects) adds cognitive load without informational value.
|
|
23
|
+
|
|
24
|
+
### 1.2 Disney's 12 Principles Adapted for UI
|
|
25
|
+
|
|
26
|
+
The 12 principles of animation, codified by Ollie Johnston and Frank Thomas in *The Illusion of Life* (1981), translate to digital interfaces as follows:
|
|
27
|
+
|
|
28
|
+
| # | Principle | UI Adaptation |
|
|
29
|
+
|---|-----------|---------------|
|
|
30
|
+
| 1 | **Squash & Stretch** | Subtle scale changes on button press (scale 0.95 on press, 1.0 on release) convey tactility. Never exceed 5-10% deformation in UI -- this is not a cartoon. |
|
|
31
|
+
| 2 | **Anticipation** | A brief pull-back before a card flies off screen. A button slightly depressing before an action fires. Prepares the user for what comes next. |
|
|
32
|
+
| 3 | **Staging** | Draw focus to the primary action. Dim or blur background content when a modal appears. Use motion to establish visual hierarchy. |
|
|
33
|
+
| 4 | **Straight Ahead / Pose to Pose** | In UI, "pose to pose" dominates: define start and end states clearly, let easing handle the in-between. Straight-ahead (frame-by-frame) is reserved for complex illustration animations. |
|
|
34
|
+
| 5 | **Follow Through & Overlapping Action** | When a list scrolls to a stop, items slightly overshoot then settle. A dismissed card's shadow trails behind the card itself. Creates natural feel. |
|
|
35
|
+
| 6 | **Slow In, Slow Out** | The foundation of easing curves. Elements accelerate from rest and decelerate into their final position. Linear motion feels robotic. |
|
|
36
|
+
| 7 | **Arc** | Natural motion follows curved paths. A FAB (floating action button) morphing into a sheet should trace an arc, not teleport linearly. |
|
|
37
|
+
| 8 | **Secondary Action** | A checkmark appearing inside a button after a successful submit, while the button itself changes color. Supports the primary action without competing. |
|
|
38
|
+
| 9 | **Timing** | The single most critical principle for UI. See Section 1.3 for exact values. Wrong timing makes interfaces feel sluggish or jarring. |
|
|
39
|
+
| 10 | **Exaggeration** | Used sparingly: an error shake animation slightly exceeds realistic displacement to ensure visibility. In UI, subtlety almost always wins. |
|
|
40
|
+
| 11 | **Solid Drawing** | Maintain consistent perspective and spatial relationships during transitions. A card expanding should not break the spatial model of the interface. |
|
|
41
|
+
| 12 | **Appeal** | The overall aesthetic quality of motion. Smooth, confident, purposeful motion increases perceived quality and trust. Jittery, inconsistent motion destroys it. |
|
|
42
|
+
|
|
43
|
+
### 1.3 Timing: The Numbers That Matter
|
|
44
|
+
|
|
45
|
+
Research from Nielsen Norman Group establishes these perceptual thresholds:
|
|
46
|
+
|
|
47
|
+
| Duration | User Perception | Typical Use |
|
|
48
|
+
|----------|----------------|-------------|
|
|
49
|
+
| < 100ms | Instantaneous -- user perceives no delay | System feedback (ripple effects, state toggles) |
|
|
50
|
+
| 100-200ms | Fast and responsive | Micro-interactions: button presses, toggles, checkboxes, icon morphs |
|
|
51
|
+
| 200-300ms | Smooth and natural | Small element transitions: tooltips appearing, dropdown menus, tabs switching |
|
|
52
|
+
| 300-500ms | Deliberate and noticeable | Complex transitions: page transitions, modal open/close, expanding cards |
|
|
53
|
+
| 500-1000ms | Slow -- use only for dramatic emphasis | Large-surface transitions: full-screen overlays, onboarding sequences |
|
|
54
|
+
| > 1000ms | Feels broken -- user becomes impatient | Almost never appropriate for UI transitions |
|
|
55
|
+
|
|
56
|
+
Critical rules:
|
|
57
|
+
- **Exit animations should be 20-30% faster than entrance animations.** Users should not wait for things to leave. A modal that takes 300ms to appear should take 200-250ms to dismiss.
|
|
58
|
+
- **Frequent animations must be shorter.** A hover effect seen 50 times per session at 500ms will infuriate users. Keep repeating animations under 200ms.
|
|
59
|
+
- **Mobile animations should be 20-30% shorter than desktop equivalents.** Smaller screens mean shorter travel distances.
|
|
60
|
+
|
|
61
|
+
### 1.4 Easing Curves
|
|
62
|
+
|
|
63
|
+
Linear motion (`cubic-bezier(0, 0, 1, 1)`) feels mechanical and unnatural. Always apply easing.
|
|
64
|
+
|
|
65
|
+
| Easing Type | When to Use | CSS cubic-bezier |
|
|
66
|
+
|-------------|-------------|------------------|
|
|
67
|
+
| **Ease-out (decelerate)** | Elements entering the screen -- they arrive quickly and settle into place | `cubic-bezier(0, 0, 0.2, 1)` |
|
|
68
|
+
| **Ease-in (accelerate)** | Elements leaving the screen -- they start slowly and accelerate away | `cubic-bezier(0.4, 0, 1, 1)` |
|
|
69
|
+
| **Ease-in-out (standard)** | Elements moving between two on-screen positions | `cubic-bezier(0.4, 0, 0.2, 1)` |
|
|
70
|
+
| **Emphasized decelerate** | Important entrances that need to feel weighty | `cubic-bezier(0.05, 0.7, 0.1, 1)` |
|
|
71
|
+
| **Emphasized accelerate** | Important exits that need finality | `cubic-bezier(0.3, 0, 0.8, 0.15)` |
|
|
72
|
+
|
|
73
|
+
Rule of thumb: **Ease-out is your default.** Most UI motion involves something appearing or arriving, which calls for deceleration.
|
|
74
|
+
|
|
75
|
+
### 1.5 Material Design 3 Motion Tokens
|
|
76
|
+
|
|
77
|
+
Material Design 3 defines a systematic token-based motion system. These are the canonical values from the `material-tokens` specification (source: `material-foundation/material-tokens` on GitHub):
|
|
78
|
+
|
|
79
|
+
**Duration tokens:**
|
|
80
|
+
|
|
81
|
+
| Token | Value | Typical Use |
|
|
82
|
+
|-------|-------|-------------|
|
|
83
|
+
| `md.sys.motion.duration.short1` | 50ms | Instant feedback, ripples |
|
|
84
|
+
| `md.sys.motion.duration.short2` | 100ms | Small icon changes, state indicators |
|
|
85
|
+
| `md.sys.motion.duration.short3` | 150ms | Button press feedback, checkbox toggle |
|
|
86
|
+
| `md.sys.motion.duration.short4` | 200ms | Micro-interactions, small reveals |
|
|
87
|
+
| `md.sys.motion.duration.medium1` | 250ms | Dropdown menus, tooltips |
|
|
88
|
+
| `md.sys.motion.duration.medium2` | 300ms | Bottom sheets, navigation rail expansion |
|
|
89
|
+
| `md.sys.motion.duration.medium3` | 350ms | Card expansion, tab transitions |
|
|
90
|
+
| `md.sys.motion.duration.medium4` | 400ms | Dialog open, navigation drawer |
|
|
91
|
+
| `md.sys.motion.duration.long1` | 450ms | Page transitions |
|
|
92
|
+
| `md.sys.motion.duration.long2` | 500ms | Large surface changes |
|
|
93
|
+
| `md.sys.motion.duration.long3` | 550ms | Complex coordinated transitions |
|
|
94
|
+
| `md.sys.motion.duration.long4` | 600ms | Full-screen transitions |
|
|
95
|
+
| `md.sys.motion.duration.extra-long1` | 700ms | Dramatic emphasis transitions |
|
|
96
|
+
| `md.sys.motion.duration.extra-long2` | 800ms | Onboarding sequences |
|
|
97
|
+
| `md.sys.motion.duration.extra-long3` | 900ms | Complex choreographed motion |
|
|
98
|
+
| `md.sys.motion.duration.extra-long4` | 1000ms | Reserved for exceptional cases |
|
|
99
|
+
|
|
100
|
+
**Easing tokens:**
|
|
101
|
+
|
|
102
|
+
| Token | Type | Value (cubic-bezier) |
|
|
103
|
+
|-------|------|----------------------|
|
|
104
|
+
| `md.sys.motion.easing.linear` | Linear | `(0, 0, 1, 1)` |
|
|
105
|
+
| `md.sys.motion.easing.standard` | Standard | `(0.2, 0, 0, 1)` |
|
|
106
|
+
| `md.sys.motion.easing.standard.accelerate` | Standard accelerate | `(0.3, 0, 1, 1)` |
|
|
107
|
+
| `md.sys.motion.easing.standard.decelerate` | Standard decelerate | `(0, 0, 0, 1)` |
|
|
108
|
+
| `md.sys.motion.easing.emphasized.accelerate` | Emphasized accelerate | `(0.3, 0, 0.8, 0.15)` |
|
|
109
|
+
| `md.sys.motion.easing.emphasized.decelerate` | Emphasized decelerate | `(0.05, 0.7, 0.1, 1)` |
|
|
110
|
+
| `md.sys.motion.easing.legacy` | Legacy (M2 compat) | `(0.4, 0, 0.2, 1)` |
|
|
111
|
+
|
|
112
|
+
Note: M3 Expressive (2025+) introduces a physics-based motion system that replaces fixed easing curves with spring dynamics for more natural, responsive motion. The easing tokens above remain available for non-spring contexts.
|
|
113
|
+
|
|
114
|
+
### 1.6 Spring-Based Animations
|
|
115
|
+
|
|
116
|
+
Spring physics produce more natural-feeling motion than cubic-bezier curves because they model real-world inertia. Springs respond to velocity, meaning an interrupted animation continues naturally rather than restarting.
|
|
117
|
+
|
|
118
|
+
**Core spring parameters:**
|
|
119
|
+
|
|
120
|
+
| Parameter | Description | Effect of Higher Values |
|
|
121
|
+
|-----------|-------------|------------------------|
|
|
122
|
+
| **Stiffness** (tension) | How forcefully the spring pulls toward its target | More sudden, snappy movement |
|
|
123
|
+
| **Damping** (friction) | How quickly oscillation dies out | Less bouncing, faster settling |
|
|
124
|
+
| **Mass** | Weight of the animated object | More lethargic, heavier-feeling movement |
|
|
125
|
+
|
|
126
|
+
**Common spring presets (Framer Motion / React Spring):**
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
// Snappy -- button feedback, toggles
|
|
130
|
+
{ type: "spring", stiffness: 500, damping: 30, mass: 1 }
|
|
131
|
+
|
|
132
|
+
// Gentle -- cards, panels sliding
|
|
133
|
+
{ type: "spring", stiffness: 200, damping: 20, mass: 1 }
|
|
134
|
+
|
|
135
|
+
// Bouncy -- playful consumer apps, success states
|
|
136
|
+
{ type: "spring", stiffness: 300, damping: 10, mass: 1 }
|
|
137
|
+
|
|
138
|
+
// Heavy -- large surfaces, page transitions
|
|
139
|
+
{ type: "spring", stiffness: 100, damping: 20, mass: 2 }
|
|
140
|
+
|
|
141
|
+
// SwiftUI default equivalent
|
|
142
|
+
{ type: "spring", stiffness: ~170, damping: ~26, mass: 1 }
|
|
143
|
+
// (response: 0.55, dampingFraction: 0.825)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Duration-based springs** (Framer Motion alternative syntax):
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
// Easier to reason about when you need predictable timing
|
|
150
|
+
{ type: "spring", duration: 0.3, bounce: 0 } // No bounce, 300ms
|
|
151
|
+
{ type: "spring", duration: 0.4, bounce: 0.25 } // Subtle bounce, 400ms
|
|
152
|
+
{ type: "spring", duration: 0.6, bounce: 0.5 } // Playful bounce, 600ms
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
When to use springs vs. curves:
|
|
156
|
+
- **Springs**: Gesture-driven animations (drag, swipe), interruptible transitions, anything that should feel physical
|
|
157
|
+
- **Curves**: Simple state changes (color, opacity fades), CSS-only implementations, animations that must have exact duration
|
|
158
|
+
|
|
159
|
+
### 1.7 Reduced Motion: Non-Negotiable Accessibility
|
|
160
|
+
|
|
161
|
+
Vestibular disorders affect roughly 35% of adults over 40. Motion sensitivity can cause nausea, dizziness, and disorientation. Supporting `prefers-reduced-motion` is not optional.
|
|
162
|
+
|
|
163
|
+
**Implementation strategy:**
|
|
164
|
+
|
|
165
|
+
```css
|
|
166
|
+
/* Approach 1: Opt-in motion (recommended) */
|
|
167
|
+
/* Default: no motion */
|
|
168
|
+
* {
|
|
169
|
+
animation-duration: 0.01ms !important;
|
|
170
|
+
transition-duration: 0.01ms !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Add motion only when user is OK with it */
|
|
174
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
175
|
+
* {
|
|
176
|
+
animation-duration: revert;
|
|
177
|
+
transition-duration: revert;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Approach 2: Opt-out motion (more common) */
|
|
182
|
+
@media (prefers-reduced-motion: reduce) {
|
|
183
|
+
*, *::before, *::after {
|
|
184
|
+
animation-duration: 0.01ms !important;
|
|
185
|
+
animation-iteration-count: 1 !important;
|
|
186
|
+
transition-duration: 0.01ms !important;
|
|
187
|
+
scroll-behavior: auto !important;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Reduced motion does NOT mean no motion.** Replace:
|
|
193
|
+
- Sliding transitions with crossfades (opacity changes)
|
|
194
|
+
- Parallax scrolling with static positioning
|
|
195
|
+
- Bouncing/springing with instant state changes
|
|
196
|
+
- Auto-playing animations with static states or user-triggered playback
|
|
197
|
+
- Spinning loaders with pulsing opacity loaders
|
|
198
|
+
|
|
199
|
+
**JavaScript detection:**
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
const prefersReduced = window.matchMedia(
|
|
203
|
+
'(prefers-reduced-motion: reduce)'
|
|
204
|
+
).matches;
|
|
205
|
+
|
|
206
|
+
// Framer Motion
|
|
207
|
+
<motion.div
|
|
208
|
+
animate={{ x: 100 }}
|
|
209
|
+
transition={prefersReduced
|
|
210
|
+
? { duration: 0 }
|
|
211
|
+
: { type: "spring", stiffness: 300, damping: 20 }
|
|
212
|
+
}
|
|
213
|
+
/>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### 1.8 The 60fps Imperative
|
|
217
|
+
|
|
218
|
+
Animations must run at 60 frames per second (16.67ms per frame). Dropping below this threshold produces visible stutter ("jank") that degrades perceived quality.
|
|
219
|
+
|
|
220
|
+
Rules:
|
|
221
|
+
- **Animate only compositor-friendly properties:** `transform` (translate, scale, rotate) and `opacity`. These skip layout and paint, running entirely on the GPU.
|
|
222
|
+
- **Never animate:** `width`, `height`, `top`, `left`, `right`, `bottom`, `margin`, `padding`, `border-width`, `font-size`. These trigger layout recalculation on every frame.
|
|
223
|
+
- **Use `will-change` sparingly:** `will-change: transform, opacity` promotes an element to its own compositor layer. Apply only to elements that will actually animate, and remove after animation completes.
|
|
224
|
+
- **If an animation cannot hit 60fps, simplify it.** Drop shadow animations, filter animations, and clip-path animations are expensive. Replace with pre-rendered alternatives or simpler motion.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 2. Do's and Don'ts
|
|
229
|
+
|
|
230
|
+
### Do's
|
|
231
|
+
|
|
232
|
+
1. **Do use 100-200ms for micro-interactions** (toggles, checkboxes, icon morphs). These happen frequently and must feel instantaneous. Material's `short2`-`short4` tokens (100-200ms) are ideal.
|
|
233
|
+
|
|
234
|
+
2. **Do use ease-out (decelerate) for entrances.** Elements arriving on screen should decelerate into their resting position: `cubic-bezier(0, 0, 0.2, 1)` or `md.sys.motion.easing.standard.decelerate`.
|
|
235
|
+
|
|
236
|
+
3. **Do make exits 20-30% faster than entrances.** A tooltip appearing at 250ms should disappear at 175-200ms. Users should not wait for departing elements.
|
|
237
|
+
|
|
238
|
+
4. **Do stagger list item animations at 30-50ms intervals.** This creates a cascading "waterfall" effect that reads as a cohesive group. Cap total stagger at ~15 items -- beyond that, use a wave or group fade.
|
|
239
|
+
|
|
240
|
+
5. **Do animate `transform` and `opacity` exclusively whenever possible.** These are GPU-composited and will not trigger layout or paint. A "slide in" uses `translateX`, not `left`.
|
|
241
|
+
|
|
242
|
+
6. **Do use spring animations for gesture-driven interactions.** Drag-to-dismiss, pull-to-refresh, and swipe actions feel natural with springs because springs incorporate velocity from the gesture.
|
|
243
|
+
|
|
244
|
+
7. **Do provide visual continuity between states.** When navigating from a list item to a detail view, use a shared element / container transform transition (300-400ms) so the user understands the spatial relationship.
|
|
245
|
+
|
|
246
|
+
8. **Do use consistent timing across your product.** Define a motion scale (like Material's duration tokens) and reference it everywhere. Inconsistent timing feels amateurish.
|
|
247
|
+
|
|
248
|
+
9. **Do pair animation with haptic feedback on mobile.** A 100ms button press animation paired with a light haptic tap (`UIImpactFeedbackGenerator.style.light` on iOS) multiplies the perceived responsiveness.
|
|
249
|
+
|
|
250
|
+
10. **Do test animations at 0.5x speed in development.** Slowing animations reveals timing issues, easing problems, and z-order conflicts invisible at full speed. Chrome DevTools and Xcode both support this.
|
|
251
|
+
|
|
252
|
+
11. **Do use opacity fades (150-200ms) as a safe fallback.** When in doubt about which transition to use, a simple crossfade is unobtrusive, performant, and accessible.
|
|
253
|
+
|
|
254
|
+
12. **Do animate state changes that would otherwise be invisible.** A counter incrementing should briefly highlight or scale; a price changing should flash. Without motion, users miss updates.
|
|
255
|
+
|
|
256
|
+
13. **Do respect the content density / motion complexity inverse rule.** Dense data dashboards should use minimal, fast motion (100-200ms fades). Sparse consumer apps can use more expressive motion (300-500ms springs).
|
|
257
|
+
|
|
258
|
+
14. **Do use `will-change` before animation starts and remove it after completion.** This prevents unnecessary GPU memory consumption from permanent layer promotion.
|
|
259
|
+
|
|
260
|
+
### Don'ts
|
|
261
|
+
|
|
262
|
+
1. **Don't animate for longer than 500ms for standard transitions.** NNGroup research confirms that beyond 500ms, animations feel like a drag and users perceive the interface as slow. Reserve 500ms+ for truly exceptional moments.
|
|
263
|
+
|
|
264
|
+
2. **Don't use linear easing for UI transitions.** Linear motion `(0, 0, 1, 1)` has no acceleration or deceleration and feels mechanical. The only valid use is looping progress indicators (spinners).
|
|
265
|
+
|
|
266
|
+
3. **Don't animate layout-triggering properties.** Animating `width`, `height`, `top`, `left`, `margin`, or `padding` causes the browser to recalculate layout on every frame, causing jank. Use `transform: scale()` and `transform: translate()` instead.
|
|
267
|
+
|
|
268
|
+
4. **Don't auto-play looping animations without a pause mechanism.** WCAG 2.2 Success Criterion 2.2.2 requires that any animation lasting longer than 5 seconds must be pausable, stoppable, or hideable.
|
|
269
|
+
|
|
270
|
+
5. **Don't use bounce or elastic easing on critical UI elements.** A "bouncing" save button looks playful but undermines confidence in a banking app. Match motion personality to the product's trust level.
|
|
271
|
+
|
|
272
|
+
6. **Don't stagger more than 15 items individually.** A list of 50 items staggering in at 50ms each takes 2.5 seconds to fully render. Group items or use a single wave animation instead.
|
|
273
|
+
|
|
274
|
+
7. **Don't animate on scroll without throttling.** Scroll-linked animations must use `requestAnimationFrame`, Intersection Observer, or CSS `scroll-timeline`. Raw scroll event listeners firing at 120Hz will freeze the main thread.
|
|
275
|
+
|
|
276
|
+
8. **Don't ignore `prefers-reduced-motion`.** Failing to respect this user setting is both an accessibility violation (WCAG 2.3.3) and a potential trigger for vestibular disorders. Every shipped animation needs a reduced-motion alternative.
|
|
277
|
+
|
|
278
|
+
9. **Don't use different easing curves for enter and exit of the same element.** If a dialog enters with `ease-out`, it should exit with `ease-in` -- the logical inverse. Mismatched curves create cognitive dissonance.
|
|
279
|
+
|
|
280
|
+
10. **Don't block user interaction during animations.** Users should be able to tap, click, or navigate even while a transition is in progress. Disable `pointer-events: none` as briefly as possible, or better, make transitions interruptible.
|
|
281
|
+
|
|
282
|
+
11. **Don't chain more than 3 sequential animations.** Serial A-then-B-then-C-then-D animations force users to wait. Use parallel or staggered motion instead, keeping total choreography under 600ms.
|
|
283
|
+
|
|
284
|
+
12. **Don't use motion to hide slow performance.** A fancy loading animation does not excuse a 3-second data fetch. Fix the performance problem; don't distract from it.
|
|
285
|
+
|
|
286
|
+
13. **Don't apply the same animation to every element on the page.** When everything moves, nothing stands out. Motion should create hierarchy: primary actions get the most expressive motion; secondary elements get subtle or no motion.
|
|
287
|
+
|
|
288
|
+
14. **Don't forget to test on low-end devices.** An animation that runs at 60fps on an M3 MacBook may stutter at 20fps on a budget Android phone. Test on real hardware or throttle CPU 4x in DevTools.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 3. Platform Variations
|
|
293
|
+
|
|
294
|
+
### 3.1 iOS (UIKit / SwiftUI)
|
|
295
|
+
|
|
296
|
+
**Default animation model:** Spring-based. Since iOS 17 and SwiftUI's evolution, springs are the default animation type. Calling `withAnimation { }` in SwiftUI uses a spring with `response: 0.55` and `dampingFraction: 0.825`.
|
|
297
|
+
|
|
298
|
+
**Key parameters for SwiftUI springs:**
|
|
299
|
+
- `response`: How quickly the animation reaches its target (seconds). Lower = faster. Default: 0.55.
|
|
300
|
+
- `dampingFraction`: How much oscillation occurs. 0 = infinite bounce, 1 = no bounce (critically damped). Default: 0.825.
|
|
301
|
+
- `blendDuration`: How long to blend with a previous animation. Default: 0.
|
|
302
|
+
|
|
303
|
+
**Common SwiftUI animation patterns:**
|
|
304
|
+
|
|
305
|
+
```swift
|
|
306
|
+
// Default spring (most common)
|
|
307
|
+
withAnimation(.spring()) { isExpanded.toggle() }
|
|
308
|
+
|
|
309
|
+
// Snappy interaction feedback
|
|
310
|
+
withAnimation(.spring(response: 0.3, dampingFraction: 0.7)) { ... }
|
|
311
|
+
|
|
312
|
+
// Bouncy success animation
|
|
313
|
+
withAnimation(.spring(response: 0.5, dampingFraction: 0.5)) { ... }
|
|
314
|
+
|
|
315
|
+
// Quick non-bouncing transition
|
|
316
|
+
withAnimation(.spring(response: 0.25, dampingFraction: 1.0)) { ... }
|
|
317
|
+
|
|
318
|
+
// Matched geometry for shared element transitions
|
|
319
|
+
.matchedGeometryEffect(id: item.id, in: namespace)
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Haptic feedback pairing:**
|
|
323
|
+
- `UIImpactFeedbackGenerator`: `.light`, `.medium`, `.heavy`, `.rigid`, `.soft` -- use for button taps, toggles, collisions.
|
|
324
|
+
- `UISelectionFeedbackGenerator`: Use for picker wheels, segmented controls, selection changes.
|
|
325
|
+
- `UINotificationFeedbackGenerator`: `.success`, `.warning`, `.error` -- use for form submission outcomes.
|
|
326
|
+
- Always call `.prepare()` before triggering to prime the Taptic Engine and eliminate latency.
|
|
327
|
+
|
|
328
|
+
**iOS-specific guidelines:**
|
|
329
|
+
- Navigation pushes/pops use a 350ms interactive spring by default. Do not override unless you have a strong reason.
|
|
330
|
+
- Sheet presentations (`.sheet`, `.fullScreenCover`) use system-provided springs. Customize via `presentationDetents` rather than reimplementing.
|
|
331
|
+
- Respect `UIAccessibility.isReduceMotionEnabled` -- replace slides with crossfades.
|
|
332
|
+
- iOS 26 introduces "Liquid Glass" design language with fluid, translucent motion. Embrace system transitions that leverage this.
|
|
333
|
+
|
|
334
|
+
### 3.2 Android (Material Motion)
|
|
335
|
+
|
|
336
|
+
**Material Motion transition patterns:**
|
|
337
|
+
|
|
338
|
+
| Pattern | Use Case | Duration |
|
|
339
|
+
|---------|----------|----------|
|
|
340
|
+
| **Container Transform** | List item to detail, FAB to full screen | 300-450ms |
|
|
341
|
+
| **Shared Axis** | Navigation between sibling views (tabs, stepper) | 300ms |
|
|
342
|
+
| **Fade Through** | Unrelated view transitions (bottom nav switches) | 300ms |
|
|
343
|
+
| **Fade** | Overlays, dialogs, menus appearing/disappearing | 150-250ms |
|
|
344
|
+
|
|
345
|
+
**Container Transform** is the flagship M3 transition. It creates a visible connection between two UI elements by morphing one container into another, maintaining spatial continuity. Implementation uses `MaterialContainerTransform` with configurable `fadeMode`:
|
|
346
|
+
- `FADE_MODE_IN`: Incoming view fades in over outgoing (default)
|
|
347
|
+
- `FADE_MODE_OUT`: Outgoing fades out before incoming appears
|
|
348
|
+
- `FADE_MODE_THROUGH`: Sequential fade-out then fade-in (minimizes overlap)
|
|
349
|
+
- `FADE_MODE_CROSS`: Both fade simultaneously
|
|
350
|
+
|
|
351
|
+
**Shared Element Transitions** in Android use `ActivityOptionsCompat.makeSceneTransitionAnimation()` or Jetpack Navigation's `FragmentNavigator.Extras`. Always provide a transition name on both source and destination views.
|
|
352
|
+
|
|
353
|
+
**Android-specific guidelines:**
|
|
354
|
+
- Use `MotionLayout` for complex constraint-based animations that respond to scroll or swipe.
|
|
355
|
+
- Jetpack Compose animations use `animateContentSize()`, `AnimatedVisibility`, and `animateXAsState()` as the primary APIs.
|
|
356
|
+
- Compose springs: `spring(dampingRatio = 0.75f, stiffness = 300f)` -- note parameter naming differs from SwiftUI.
|
|
357
|
+
- Material You / M3 Expressive: embrace the new physics-based motion system for components that opt into it.
|
|
358
|
+
|
|
359
|
+
### 3.3 Web (CSS / JavaScript / WAAPI)
|
|
360
|
+
|
|
361
|
+
**Three animation technologies, one performance model:**
|
|
362
|
+
|
|
363
|
+
| Technology | Best For | Complexity | Performance |
|
|
364
|
+
|------------|----------|------------|-------------|
|
|
365
|
+
| **CSS Transitions** | Simple A-to-B state changes (hover, focus, active) | Low | GPU-composited for transform/opacity |
|
|
366
|
+
| **CSS Animations** | Multi-step keyframe sequences, looping animations | Medium | GPU-composited for transform/opacity |
|
|
367
|
+
| **Web Animations API (WAAPI)** | Dynamic, JS-controlled animations, complex choreography | High | Same engine as CSS -- identical perf |
|
|
368
|
+
|
|
369
|
+
They all run on the same browser compositor. Performance is determined by *which properties* you animate, not which API you use.
|
|
370
|
+
|
|
371
|
+
**CSS Transitions (use by default):**
|
|
372
|
+
|
|
373
|
+
```css
|
|
374
|
+
.card {
|
|
375
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1),
|
|
376
|
+
opacity 200ms cubic-bezier(0, 0, 0.2, 1);
|
|
377
|
+
}
|
|
378
|
+
.card:hover {
|
|
379
|
+
transform: translateY(-4px);
|
|
380
|
+
opacity: 0.95;
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**CSS Animations (for keyframes):**
|
|
385
|
+
|
|
386
|
+
```css
|
|
387
|
+
@keyframes slide-in {
|
|
388
|
+
from { transform: translateX(100%); opacity: 0; }
|
|
389
|
+
to { transform: translateX(0); opacity: 1; }
|
|
390
|
+
}
|
|
391
|
+
.panel-enter {
|
|
392
|
+
animation: slide-in 300ms cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
**Web Animations API (for JS control):**
|
|
397
|
+
|
|
398
|
+
```js
|
|
399
|
+
element.animate(
|
|
400
|
+
[
|
|
401
|
+
{ transform: 'translateX(100%)', opacity: 0 },
|
|
402
|
+
{ transform: 'translateX(0)', opacity: 1 }
|
|
403
|
+
],
|
|
404
|
+
{ duration: 300, easing: 'cubic-bezier(0, 0, 0.2, 1)', fill: 'forwards' }
|
|
405
|
+
);
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
**CSS `scroll-timeline` and `view-timeline` (2025+):**
|
|
409
|
+
Modern browsers support scroll-driven animations without JavaScript. Use for parallax, progress indicators, and reveal-on-scroll effects -- far more performant than Intersection Observer + JS animation.
|
|
410
|
+
|
|
411
|
+
**`will-change` optimization:**
|
|
412
|
+
|
|
413
|
+
```css
|
|
414
|
+
/* Apply BEFORE animation starts */
|
|
415
|
+
.about-to-animate { will-change: transform, opacity; }
|
|
416
|
+
|
|
417
|
+
/* Remove AFTER animation ends -- do not leave permanently */
|
|
418
|
+
.done-animating { will-change: auto; }
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Permanent `will-change` on many elements wastes GPU memory and can actually degrade performance. Apply it programmatically, not in base styles.
|
|
422
|
+
|
|
423
|
+
### 3.4 Performance: The Property Tier List
|
|
424
|
+
|
|
425
|
+
Not all CSS properties are equal for animation performance:
|
|
426
|
+
|
|
427
|
+
| Tier | Properties | Cost | Notes |
|
|
428
|
+
|------|-----------|------|-------|
|
|
429
|
+
| **S -- Composite only** | `transform`, `opacity` | Cheapest | GPU-composited, no layout or paint. Always prefer these. |
|
|
430
|
+
| **A -- Paint only** | `background-color`, `color`, `box-shadow`, `border-color` | Moderate | Skip layout but trigger repaint. Acceptable for infrequent animations. |
|
|
431
|
+
| **B -- Layout + Paint** | `width`, `height`, `padding`, `margin`, `border-width` | Expensive | Trigger full layout recalculation. Avoid animating. Use `transform: scale()` instead. |
|
|
432
|
+
| **F -- Never animate** | `top`, `left`, `right`, `bottom` (on positioned elements) | Very expensive | Use `transform: translate()` instead. |
|
|
433
|
+
|
|
434
|
+
**Framer Motion / Motion One performance patterns:**
|
|
435
|
+
|
|
436
|
+
```jsx
|
|
437
|
+
// GOOD: GPU-composited properties only
|
|
438
|
+
<motion.div
|
|
439
|
+
initial={{ opacity: 0, y: 20 }}
|
|
440
|
+
animate={{ opacity: 1, y: 0 }}
|
|
441
|
+
transition={{ duration: 0.3, ease: [0, 0, 0.2, 1] }}
|
|
442
|
+
/>
|
|
443
|
+
|
|
444
|
+
// BAD: Animating height triggers layout
|
|
445
|
+
<motion.div
|
|
446
|
+
initial={{ height: 0 }}
|
|
447
|
+
animate={{ height: "auto" }}
|
|
448
|
+
/>
|
|
449
|
+
|
|
450
|
+
// GOOD alternative: use layout animation
|
|
451
|
+
<motion.div layout>
|
|
452
|
+
<AnimatePresence>
|
|
453
|
+
{isOpen && <motion.div exit={{ opacity: 0 }} />}
|
|
454
|
+
</AnimatePresence>
|
|
455
|
+
</motion.div>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## 4. Common Mistakes in AI-Generated Designs
|
|
461
|
+
|
|
462
|
+
AI code generation tools (Copilot, Claude, GPT, v0, Bolt) frequently produce animation code with the following defects. Review and correct every AI-generated animation against this list.
|
|
463
|
+
|
|
464
|
+
### 4.1 Over-Animation
|
|
465
|
+
|
|
466
|
+
**Problem:** AI tends to add animation to every element because it "looks polished." Result: everything moves, nothing stands out, and the interface feels chaotic.
|
|
467
|
+
|
|
468
|
+
**Detection:** Count the number of simultaneously animating elements on any given screen. If more than 3-4 elements are moving at once, the design is over-animated.
|
|
469
|
+
|
|
470
|
+
**Fix:** Apply the hierarchy rule: only the primary action or content change should get expressive motion. Secondary elements get subtle fades or no animation. Background elements stay static.
|
|
471
|
+
|
|
472
|
+
### 4.2 Wrong Timing Values
|
|
473
|
+
|
|
474
|
+
**Problem:** AI commonly generates 500ms or 1000ms durations for simple transitions, making the interface feel sluggish. It also tends to apply the same duration to all animations regardless of context.
|
|
475
|
+
|
|
476
|
+
**Detection:** Open DevTools, slow animations to 0.25x, and watch for any animation that feels like "waiting." If you are conscious of waiting for an animation to finish, it is too slow.
|
|
477
|
+
|
|
478
|
+
**Fix:** Apply the timing scale from Section 1.3. Micro-interactions: 100-200ms. Transitions: 200-300ms. Complex: 300-500ms. Nothing over 500ms unless exceptional.
|
|
479
|
+
|
|
480
|
+
### 4.3 Missing Reduced Motion Support
|
|
481
|
+
|
|
482
|
+
**Problem:** AI-generated code almost never includes `prefers-reduced-motion` handling. This is both an accessibility failure and a potential legal liability under ADA/EAA.
|
|
483
|
+
|
|
484
|
+
**Detection:** Search the codebase for `prefers-reduced-motion`. If it appears zero times and animations exist, this is a defect.
|
|
485
|
+
|
|
486
|
+
**Fix:** Add the global reduced-motion media query (Section 1.7) and test with the OS setting enabled. Every animation library call should check `prefersReducedMotion`.
|
|
487
|
+
|
|
488
|
+
### 4.4 Animating Layout Properties
|
|
489
|
+
|
|
490
|
+
**Problem:** AI generates `animate={{ width: "100%" }}` or `transition: height 300ms` without understanding the performance cost. This triggers layout recalculation on every frame.
|
|
491
|
+
|
|
492
|
+
**Detection:** Open Chrome DevTools Performance panel, record the animation, and check for long "Layout" blocks in the flame chart. Or enable "Rendering > Layout Shift Regions" to see layout thrashing visually.
|
|
493
|
+
|
|
494
|
+
**Fix:** Replace `width`/`height` animations with `transform: scale()`. Replace `top`/`left` with `transform: translate()`. Use Framer Motion's `layout` prop for true size animations that need to look like width/height changes.
|
|
495
|
+
|
|
496
|
+
### 4.5 Linear Easing Everywhere
|
|
497
|
+
|
|
498
|
+
**Problem:** AI defaults to `transition: all 300ms` which uses `ease` (better than linear but still generic), or explicitly sets `linear` easing. Both produce robotic-feeling motion.
|
|
499
|
+
|
|
500
|
+
**Detection:** Watch animations closely. If elements move at constant speed with no acceleration/deceleration, the easing is wrong.
|
|
501
|
+
|
|
502
|
+
**Fix:** Apply the easing rules from Section 1.4. Entrances: ease-out. Exits: ease-in. Between states: ease-in-out. Use Material's easing tokens for consistency.
|
|
503
|
+
|
|
504
|
+
### 4.6 Jank from Too Many Simultaneous Animations
|
|
505
|
+
|
|
506
|
+
**Problem:** AI generates staggered lists of 50+ items each with individual animations, scroll-linked animations without throttling, or animations on elements outside the viewport.
|
|
507
|
+
|
|
508
|
+
**Detection:** Monitor frame rate during the animation. Chrome DevTools FPS meter or `performance.now()` frame timing. Any frame taking > 16.67ms is a dropped frame.
|
|
509
|
+
|
|
510
|
+
**Fix:**
|
|
511
|
+
- Only animate elements visible in the viewport (use Intersection Observer).
|
|
512
|
+
- Batch staggered animations (animate groups of 3-5 items, not individuals).
|
|
513
|
+
- Use CSS `content-visibility: auto` to skip rendering off-screen elements entirely.
|
|
514
|
+
- Throttle scroll-driven animations to `requestAnimationFrame` cadence.
|
|
515
|
+
|
|
516
|
+
### 4.7 No Exit Animations
|
|
517
|
+
|
|
518
|
+
**Problem:** AI adds entrance animations but forgets exit animations. Elements pop in gracefully but disappear instantly, creating asymmetric transitions.
|
|
519
|
+
|
|
520
|
+
**Detection:** Remove an element or navigate away and observe. If the outgoing state has no transition, this is a defect.
|
|
521
|
+
|
|
522
|
+
**Fix:** Always define both enter and exit states. In Framer Motion, use `<AnimatePresence>` with `exit` props. In CSS, apply transitions to both the adding and removing class.
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## 5. Decision Framework
|
|
527
|
+
|
|
528
|
+
### 5.1 When to Animate vs. When to Snap
|
|
529
|
+
|
|
530
|
+
Use this decision tree for every UI state change:
|
|
531
|
+
|
|
532
|
+
```
|
|
533
|
+
Is the state change visible to the user?
|
|
534
|
+
No --> Snap (no animation needed)
|
|
535
|
+
Yes --> Does animation help the user understand what changed?
|
|
536
|
+
No --> Snap (animation would be decorative)
|
|
537
|
+
Yes --> Is the change small (color, icon, badge)?
|
|
538
|
+
Yes --> Micro-interaction: 100-200ms, ease-out
|
|
539
|
+
No --> Is the change spatial (something moved)?
|
|
540
|
+
Yes --> Transition: 200-350ms, spring or ease-out
|
|
541
|
+
No --> Is the change structural (layout reflow)?
|
|
542
|
+
Yes --> Layout animation: 250-400ms, spring
|
|
543
|
+
No --> Crossfade: 150-250ms, ease-in-out
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
**Always snap (no animation):**
|
|
547
|
+
- Typing feedback in text fields
|
|
548
|
+
- Instant data updates (stock prices, live scores) -- highlight with color instead
|
|
549
|
+
- Menu items appearing after intentional click (the click IS the feedback)
|
|
550
|
+
- Error messages appearing (urgency trumps aesthetics)
|
|
551
|
+
- Any change behind a loading state that the user is waiting for
|
|
552
|
+
|
|
553
|
+
**Always animate:**
|
|
554
|
+
- Navigation between views (spatial continuity)
|
|
555
|
+
- Elements entering or leaving the screen (orient the user)
|
|
556
|
+
- State toggles (on/off, expand/collapse) -- confirm the action happened
|
|
557
|
+
- Drag-and-drop reordering (maintain object identity)
|
|
558
|
+
- Skeleton-to-content transitions (smooth perceived loading)
|
|
559
|
+
|
|
560
|
+
### 5.2 Subtle vs. Expressive Motion
|
|
561
|
+
|
|
562
|
+
The expressiveness of motion should be calibrated to three factors:
|
|
563
|
+
|
|
564
|
+
| Factor | Subtle Motion | Expressive Motion |
|
|
565
|
+
|--------|---------------|-------------------|
|
|
566
|
+
| **Frequency** | High (hover effects, toggles, seen 100x/session) | Low (success confirmation, onboarding, seen 1-3x) |
|
|
567
|
+
| **Content density** | High (dashboards, data tables, admin panels) | Low (landing pages, consumer apps, marketing) |
|
|
568
|
+
| **Trust level** | High-trust (banking, healthcare, legal) | Casual (social, gaming, creative tools) |
|
|
569
|
+
| **User expertise** | Expert users (speed over polish) | Novice users (guidance over speed) |
|
|
570
|
+
|
|
571
|
+
Spectrum with values:
|
|
572
|
+
|
|
573
|
+
```
|
|
574
|
+
No Motion Subtle Moderate Expressive
|
|
575
|
+
|-- snap --|-- 100-150ms --|-- 200-300ms --|-- 300-500ms+ --|
|
|
576
|
+
Typing Hover state Tab switch Onboarding
|
|
577
|
+
Errors Toggle Modal open Achievement
|
|
578
|
+
Live data Tooltip Navigation First-time use
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### 5.3 Performance Budgets
|
|
582
|
+
|
|
583
|
+
Define animation performance budgets per platform:
|
|
584
|
+
|
|
585
|
+
| Metric | Budget | Measurement |
|
|
586
|
+
|--------|--------|-------------|
|
|
587
|
+
| Frame rate | >= 55fps sustained (60fps target) | DevTools Performance panel, `PerformanceObserver` |
|
|
588
|
+
| Frame budget | <= 16.67ms per frame | Long frame detection |
|
|
589
|
+
| Simultaneous animations | <= 5 elements | Code review |
|
|
590
|
+
| Total animation time per interaction | <= 600ms | Stopwatch / slow-motion review |
|
|
591
|
+
| GPU memory for promoted layers | <= 50MB | Chrome DevTools Layers panel |
|
|
592
|
+
| Main thread work per frame | <= 4ms for animation logic | Performance profiling |
|
|
593
|
+
|
|
594
|
+
If any budget is exceeded, simplify:
|
|
595
|
+
1. Reduce the number of animating elements
|
|
596
|
+
2. Switch from spring to simple ease curve (less computation)
|
|
597
|
+
3. Remove secondary animations, keep only the primary
|
|
598
|
+
4. Replace complex transitions with crossfades
|
|
599
|
+
5. Pre-render complex animations as video/Lottie
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
## Quick Reference Checklist
|
|
604
|
+
|
|
605
|
+
Use this checklist before shipping any screen or component with motion:
|
|
606
|
+
|
|
607
|
+
- [ ] **Purpose**: Every animation answers "what does this help the user understand?"
|
|
608
|
+
- [ ] **Timing micro**: Micro-interactions are 100-200ms (Material `short2`-`short4`)
|
|
609
|
+
- [ ] **Timing transitions**: View transitions are 200-400ms (Material `short4`-`medium4`)
|
|
610
|
+
- [ ] **Timing exits**: Exit animations are 20-30% faster than entrance animations
|
|
611
|
+
- [ ] **Easing entrances**: Elements entering use ease-out / decelerate
|
|
612
|
+
- [ ] **Easing exits**: Elements leaving use ease-in / accelerate
|
|
613
|
+
- [ ] **Easing between**: On-screen repositioning uses ease-in-out / standard
|
|
614
|
+
- [ ] **No linear**: No UI transition uses linear easing (spinners excepted)
|
|
615
|
+
- [ ] **GPU properties only**: Animations use only `transform` and `opacity` (or spring-based layout engines)
|
|
616
|
+
- [ ] **Reduced motion**: `prefers-reduced-motion: reduce` is handled; tested with OS setting enabled
|
|
617
|
+
- [ ] **60fps verified**: Animation runs at >= 55fps on target low-end device
|
|
618
|
+
- [ ] **Interruptible**: User can interact during/after animation without waiting
|
|
619
|
+
- [ ] **Exit animations exist**: Elements that animate in also animate out
|
|
620
|
+
- [ ] **Stagger cap**: No more than 15 individually staggered items; groups used beyond that
|
|
621
|
+
- [ ] **No over-animation**: Maximum 3-4 elements animate simultaneously per interaction
|
|
622
|
+
- [ ] **Consistency**: Timing and easing tokens are reused from a defined motion scale, not ad-hoc values
|
|
623
|
+
- [ ] **Mobile haptics**: Touch interactions pair animation with appropriate haptic feedback
|
|
624
|
+
- [ ] **Low-end tested**: Animations verified on budget hardware or with 4x CPU throttling
|
|
625
|
+
- [ ] **WCAG 2.2.2**: Any animation > 5 seconds can be paused, stopped, or hidden
|
|
626
|
+
- [ ] **Spatial logic**: Motion direction matches the spatial model (left-to-right for forward, right-to-left for back)
|
|
627
|
+
|
|
628
|
+
---
|
|
629
|
+
|
|
630
|
+
## Sources
|
|
631
|
+
|
|
632
|
+
- [Material Design 3: Easing and Duration Tokens](https://m3.material.io/styles/motion/easing-and-duration/tokens-specs) -- Official M3 motion token specifications
|
|
633
|
+
- [Material Design 3: Motion Overview](https://m3.material.io/styles/motion/overview/how-it-works) -- How M3 motion system works
|
|
634
|
+
- [Material Design 3: Transitions](https://m3.material.io/styles/motion/transitions) -- Container transform, shared axis, fade through patterns
|
|
635
|
+
- [Material Foundation Motion Tokens (GitHub)](https://github.com/material-foundation/material-tokens/blob/json/json/motion.json) -- Canonical JSON token values
|
|
636
|
+
- [Material Components Android: Motion](https://github.com/material-components/material-components-android/blob/master/docs/theming/Motion.md) -- Android implementation guide
|
|
637
|
+
- [Apple HIG: Motion](https://developer.apple.com/design/human-interface-guidelines/motion) -- Apple motion design guidelines
|
|
638
|
+
- [Apple: Reduced Motion Evaluation Criteria](https://developer.apple.com/help/app-store-connect/manage-app-accessibility/reduced-motion-evaluation-criteria/) -- App Store accessibility requirements
|
|
639
|
+
- [Apple: SwiftUI Spring Animation](https://developer.apple.com/documentation/swiftui/animation/spring(response:dampingfraction:blendduration:)) -- Spring parameter documentation
|
|
640
|
+
- [WWDC23: Animate with Springs](https://developer.apple.com/videos/play/wwdc2023/10158/) -- Apple's spring animation guidance
|
|
641
|
+
- [Nielsen Norman Group: Animation Duration](https://www.nngroup.com/articles/animation-duration/) -- Research-backed timing guidelines
|
|
642
|
+
- [Nielsen Norman Group: Powers of 10 Time Scales](https://www.nngroup.com/articles/powers-of-10-time-scales-in-ux/) -- Perceptual thresholds
|
|
643
|
+
- [Motion.dev (Framer Motion)](https://motion.dev/) -- React animation library documentation
|
|
644
|
+
- [Framer Motion: Transition Configuration](https://www.framer.com/motion/transition/) -- Spring and tween configuration
|
|
645
|
+
- [Motion Magazine: Web Animation Performance Tier List](https://motion.dev/magazine/web-animation-performance-tier-list) -- Property-by-property performance analysis
|
|
646
|
+
- [MDN: CSS vs JavaScript Animation Performance](https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/CSS_JavaScript_animation_performance) -- Browser rendering pipeline
|
|
647
|
+
- [MDN: prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion) -- Reduced motion media query
|
|
648
|
+
- [W3C WCAG 2.1: C39 prefers-reduced-motion](https://www.w3.org/WAI/WCAG21/Techniques/css/C39) -- Accessibility technique
|
|
649
|
+
- [CSS-Tricks: CSS Animations vs Web Animations API](https://css-tricks.com/css-animations-vs-web-animations-api/) -- Technology comparison
|
|
650
|
+
- [IxDF: Disney's 12 Principles Applied to UI](https://ixdf.org/literature/article/ui-animation-how-to-apply-disney-s-12-principles-of-animation-to-ui-design) -- Principle adaptation for digital
|
|
651
|
+
- [UX Collective: Disney's 12 Principles in UX](https://uxdesign.cc/disneys-12-principles-of-animation-exemplified-in-ux-design-5cc7e3dc3f75) -- Practical UX examples
|
|
652
|
+
- [M3 Expressive: New Motion System](https://m3.material.io/blog/m3-expressive-motion-theming) -- Physics-based motion evolution
|
|
653
|
+
- [PatternFly: Motion with Purpose](https://medium.com/patternfly/motion-with-purpose-7ac3bd08efba) -- Building purposeful motion systems
|