agent-skill-kit 3.9.135
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/.agent/global.d.ts +80 -0
- package/.agent/rules/GEMINI.md +210 -0
- package/.agent/rules/autopilot.md +287 -0
- package/.agent/rules/code-rules.md +227 -0
- package/.agent/scripts/audit_workflows.ts +23 -0
- package/.agent/scripts/auto_preview.ts +170 -0
- package/.agent/scripts/checklist.ts +180 -0
- package/.agent/scripts/compile-agents.ts +237 -0
- package/.agent/scripts/fix_skills.ts +49 -0
- package/.agent/scripts/session_manager.ts +222 -0
- package/.agent/scripts/skill-audit.ts +255 -0
- package/.agent/scripts/sync_workflows.ts +54 -0
- package/.agent/scripts/utils/colors.ts +58 -0
- package/.agent/scripts/utils/process-manager.ts +131 -0
- package/.agent/scripts/utils/reporter.ts +192 -0
- package/.agent/scripts/utils/runner.ts +128 -0
- package/.agent/scripts/verify_all.ts +243 -0
- package/.agent/scripts/version-sync.ts +256 -0
- package/.agent/skills/SKILL_INDEX.md +129 -0
- package/.agent/skills/agent-browser/AGENTS.md +728 -0
- package/.agent/skills/agent-browser/SKILL.md +193 -0
- package/.agent/skills/agent-browser/rules/_sections.md +15 -0
- package/.agent/skills/agent-browser/rules/_template.md +32 -0
- package/.agent/skills/agent-browser/rules/engineering-spec.md +528 -0
- package/.agent/skills/agent-browser/scripts/browser_cli.ts +52 -0
- package/.agent/skills/agent-browser/scripts/session_manager.ts +166 -0
- package/.agent/skills/ai-artist/AGENTS.md +1082 -0
- package/.agent/skills/ai-artist/SKILL.md +186 -0
- package/.agent/skills/ai-artist/rules/_sections.md +30 -0
- package/.agent/skills/ai-artist/rules/_template.md +32 -0
- package/.agent/skills/ai-artist/rules/domain-code.md +118 -0
- package/.agent/skills/ai-artist/rules/domain-marketing.md +105 -0
- package/.agent/skills/ai-artist/rules/engineering-spec.md +519 -0
- package/.agent/skills/ai-artist/rules/image-prompts.md +195 -0
- package/.agent/skills/ai-artist/rules/model-syntax.md +115 -0
- package/.agent/skills/ai-artist/scripts/prompt_compiler.ts +72 -0
- package/.agent/skills/ai-artist/templates/image-core.txt +1 -0
- package/.agent/skills/ai-artist/templates/llm-core.txt +6 -0
- package/.agent/skills/api-architect/AGENTS.md +1896 -0
- package/.agent/skills/api-architect/SKILL.md +173 -0
- package/.agent/skills/api-architect/rules/_sections.md +35 -0
- package/.agent/skills/api-architect/rules/_template.md +32 -0
- package/.agent/skills/api-architect/rules/api-style.md +115 -0
- package/.agent/skills/api-architect/rules/auth.md +134 -0
- package/.agent/skills/api-architect/rules/documentation.md +131 -0
- package/.agent/skills/api-architect/rules/engineering-spec.md +505 -0
- package/.agent/skills/api-architect/rules/graphql.md +154 -0
- package/.agent/skills/api-architect/rules/rate-limiting.md +76 -0
- package/.agent/skills/api-architect/rules/response.md +138 -0
- package/.agent/skills/api-architect/rules/rest.md +113 -0
- package/.agent/skills/api-architect/rules/security-testing.md +146 -0
- package/.agent/skills/api-architect/rules/trpc.md +129 -0
- package/.agent/skills/api-architect/rules/versioning.md +100 -0
- package/.agent/skills/api-architect/scripts/api_validator.ts +413 -0
- package/.agent/skills/auth-patterns/AGENTS.md +1830 -0
- package/.agent/skills/auth-patterns/SKILL.md +163 -0
- package/.agent/skills/auth-patterns/rules/_sections.md +30 -0
- package/.agent/skills/auth-patterns/rules/_template.md +32 -0
- package/.agent/skills/auth-patterns/rules/engineering-spec.md +515 -0
- package/.agent/skills/auth-patterns/rules/jwt-deep.md +196 -0
- package/.agent/skills/auth-patterns/rules/mfa.md +174 -0
- package/.agent/skills/auth-patterns/rules/oauth2.md +134 -0
- package/.agent/skills/auth-patterns/rules/passkey.md +243 -0
- package/.agent/skills/auth-patterns/rules/rbac-abac.md +206 -0
- package/.agent/skills/auth-patterns/rules/session.md +183 -0
- package/.agent/skills/auth-patterns/scripts/auth_validator.ts +121 -0
- package/.agent/skills/chrome-devtools/AGENTS.md +952 -0
- package/.agent/skills/chrome-devtools/SKILL.md +160 -0
- package/.agent/skills/chrome-devtools/rules/_sections.md +25 -0
- package/.agent/skills/chrome-devtools/rules/_template.md +32 -0
- package/.agent/skills/chrome-devtools/rules/aria-snapshot.md +95 -0
- package/.agent/skills/chrome-devtools/rules/engineering-spec.md +510 -0
- package/.agent/skills/chrome-devtools/rules/scripts-guide.md +174 -0
- package/.agent/skills/chrome-devtools/scripts/aria-snapshot.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/click.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/console.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/core_cli.ts +79 -0
- package/.agent/skills/chrome-devtools/scripts/evaluate.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/fill.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/navigate.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/network.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/performance.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/screenshot.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/select-ref.ts +3 -0
- package/.agent/skills/cicd-pipeline/AGENTS.md +809 -0
- package/.agent/skills/cicd-pipeline/SKILL.md +164 -0
- package/.agent/skills/cicd-pipeline/rules/_sections.md +15 -0
- package/.agent/skills/cicd-pipeline/rules/_template.md +32 -0
- package/.agent/skills/cicd-pipeline/rules/engineering-spec.md +477 -0
- package/.agent/skills/cicd-pipeline/scripts/flag-manager.ts +253 -0
- package/.agent/skills/cicd-pipeline/scripts/pipeline_validator.ts +133 -0
- package/.agent/skills/code-constitution/AGENTS.md +597 -0
- package/.agent/skills/code-constitution/CHANGELOG.md +216 -0
- package/.agent/skills/code-constitution/SKILL.md +191 -0
- package/.agent/skills/code-constitution/VERSION +3 -0
- package/.agent/skills/code-constitution/examples/violation-backend-mutation/after.tsx +59 -0
- package/.agent/skills/code-constitution/examples/violation-backend-mutation/before.tsx +42 -0
- package/.agent/skills/code-constitution/examples/violation-backend-mutation/explanation.md +91 -0
- package/.agent/skills/code-constitution/examples/violation-chart-injection/after.tsx +99 -0
- package/.agent/skills/code-constitution/examples/violation-chart-injection/before.tsx +57 -0
- package/.agent/skills/code-constitution/examples/violation-chart-injection/explanation.md +120 -0
- package/.agent/skills/code-constitution/knowledge/lessons-learned.yaml +3 -0
- package/.agent/skills/code-constitution/metadata/precedence.yaml +117 -0
- package/.agent/skills/code-constitution/metadata/scope-map.yaml +156 -0
- package/.agent/skills/code-constitution/proposals/v1.1-change-proposal-template.md +201 -0
- package/.agent/skills/code-constitution/resources/AUTHORITY_MODEL.md +115 -0
- package/.agent/skills/code-constitution/resources/ENFORCEMENT_GUIDE.md +246 -0
- package/.agent/skills/code-constitution/resources/LOAD_ORDER.md +86 -0
- package/.agent/skills/code-constitution/rules/_sections.md +15 -0
- package/.agent/skills/code-constitution/rules/_template.md +32 -0
- package/.agent/skills/code-constitution/rules/constitution/master-constitution.md +210 -0
- package/.agent/skills/code-constitution/rules/doctrines/architecture/architecture-doctrine.md +188 -0
- package/.agent/skills/code-constitution/rules/doctrines/backend/backend-data-engine-doctrine.md +218 -0
- package/.agent/skills/code-constitution/rules/doctrines/commercial/commercial-guardrails-doctrine.md +196 -0
- package/.agent/skills/code-constitution/rules/doctrines/data/data-integrity-doctrine.md +202 -0
- package/.agent/skills/code-constitution/rules/doctrines/frontend/frontend-mobile-doctrine.md +169 -0
- package/.agent/skills/code-constitution/rules/doctrines/frontend/interaction-patterns-doctrine.md +176 -0
- package/.agent/skills/code-constitution/rules/doctrines/learning/learning-engine-doctrine.md +192 -0
- package/.agent/skills/code-constitution/rules/doctrines/performance/performance-doctrine.md +180 -0
- package/.agent/skills/code-constitution/rules/doctrines/review/code-review-doctrine.md +174 -0
- package/.agent/skills/code-constitution/rules/enforcement/agents/agent-enforcement-protocol.md +218 -0
- package/.agent/skills/code-constitution/rules/enforcement/agents/agent-system-prompt.md +196 -0
- package/.agent/skills/code-constitution/rules/enforcement/checklists/backend-api-review-checklist.md +131 -0
- package/.agent/skills/code-constitution/rules/enforcement/checklists/chart-component-review-checklist.md +147 -0
- package/.agent/skills/code-constitution/rules/enforcement/checklists/frontend-review-checklist.md +194 -0
- package/.agent/skills/code-constitution/rules/enforcement/playbooks/doctrine-violation-playbook.md +236 -0
- package/.agent/skills/code-constitution/rules/engineering-spec.md +561 -0
- package/.agent/skills/code-constitution/scripts/audit_pr.ts +219 -0
- package/.agent/skills/code-constitution/scripts/check_boundaries.ts +134 -0
- package/.agent/skills/code-constitution/scripts/learn.ts +202 -0
- package/.agent/skills/code-constitution/scripts/validate_doctrine.ts +287 -0
- package/.agent/skills/code-craft/AGENTS.md +803 -0
- package/.agent/skills/code-craft/SKILL.md +170 -0
- package/.agent/skills/code-craft/rules/_sections.md +20 -0
- package/.agent/skills/code-craft/rules/_template.md +32 -0
- package/.agent/skills/code-craft/rules/engineering-spec.md +447 -0
- package/.agent/skills/code-craft/rules/verification-scripts.md +83 -0
- package/.agent/skills/code-craft/scripts/code_quality_checker.ts +193 -0
- package/.agent/skills/code-review/AGENTS.md +1664 -0
- package/.agent/skills/code-review/SKILL.md +152 -0
- package/.agent/skills/code-review/rules/_sections.md +15 -0
- package/.agent/skills/code-review/rules/_template.md +32 -0
- package/.agent/skills/code-review/rules/engineering-spec.md +466 -0
- package/.agent/skills/code-review/scripts/lint_runner.ts +213 -0
- package/.agent/skills/code-review/scripts/type_coverage.ts +118 -0
- package/.agent/skills/context-engineering/AGENTS.md +499 -0
- package/.agent/skills/context-engineering/SKILL.md +147 -0
- package/.agent/skills/context-engineering/rules/_sections.md +15 -0
- package/.agent/skills/context-engineering/rules/_template.md +32 -0
- package/.agent/skills/context-engineering/rules/engineering-spec.md +463 -0
- package/.agent/skills/context-engineering/scripts/context_analyzer.ts +127 -0
- package/.agent/skills/copywriting/AGENTS.md +501 -0
- package/.agent/skills/copywriting/SKILL.md +188 -0
- package/.agent/skills/copywriting/rules/_sections.md +15 -0
- package/.agent/skills/copywriting/rules/_template.md +32 -0
- package/.agent/skills/copywriting/rules/engineering-spec.md +465 -0
- package/.agent/skills/copywriting/scripts/copy_validator.ts +185 -0
- package/.agent/skills/data-modeler/AGENTS.md +814 -0
- package/.agent/skills/data-modeler/SKILL.md +195 -0
- package/.agent/skills/data-modeler/rules/_sections.md +15 -0
- package/.agent/skills/data-modeler/rules/_template.md +32 -0
- package/.agent/skills/data-modeler/rules/database-selection.md +124 -0
- package/.agent/skills/data-modeler/rules/engineering-spec.md +479 -0
- package/.agent/skills/data-modeler/rules/indexing.md +166 -0
- package/.agent/skills/data-modeler/rules/migrations.md +176 -0
- package/.agent/skills/data-modeler/rules/optimization.md +161 -0
- package/.agent/skills/data-modeler/rules/orm-selection.md +155 -0
- package/.agent/skills/data-modeler/rules/schema-design.md +162 -0
- package/.agent/skills/data-modeler/scripts/schema_validator.ts +357 -0
- package/.agent/skills/debug-pro/AGENTS.md +798 -0
- package/.agent/skills/debug-pro/SKILL.md +193 -0
- package/.agent/skills/debug-pro/defense-in-depth/SKILL.md +148 -0
- package/.agent/skills/debug-pro/root-cause-tracing/SKILL.md +196 -0
- package/.agent/skills/debug-pro/root-cause-tracing/find-polluter.sh +63 -0
- package/.agent/skills/debug-pro/rules/_sections.md +15 -0
- package/.agent/skills/debug-pro/rules/_template.md +32 -0
- package/.agent/skills/debug-pro/rules/engineering-spec.md +491 -0
- package/.agent/skills/debug-pro/scripts/debug_verifier.ts +148 -0
- package/.agent/skills/debug-pro/verification-before-completion/SKILL.md +160 -0
- package/.agent/skills/design-system/AGENTS.md +4216 -0
- package/.agent/skills/design-system/SKILL.md +186 -0
- package/.agent/skills/design-system/rules/_sections.md +65 -0
- package/.agent/skills/design-system/rules/_template.md +32 -0
- package/.agent/skills/design-system/rules/animation-guide.md +355 -0
- package/.agent/skills/design-system/rules/color-system.md +335 -0
- package/.agent/skills/design-system/rules/color-systems.md +133 -0
- package/.agent/skills/design-system/rules/decision-trees.md +442 -0
- package/.agent/skills/design-system/rules/design-extraction.md +152 -0
- package/.agent/skills/design-system/rules/engineering-spec.md +484 -0
- package/.agent/skills/design-system/rules/motion-design.md +161 -0
- package/.agent/skills/design-system/rules/motion-graphics.md +330 -0
- package/.agent/skills/design-system/rules/spatial-composition.md +184 -0
- package/.agent/skills/design-system/rules/typography-system.md +369 -0
- package/.agent/skills/design-system/rules/typography.md +124 -0
- package/.agent/skills/design-system/rules/ux-psychology.md +565 -0
- package/.agent/skills/design-system/rules/visual-effects.md +407 -0
- package/.agent/skills/design-system/scripts/accessibility_checker.ts +292 -0
- package/.agent/skills/design-system/scripts/ux_audit.ts +356 -0
- package/.agent/skills/doc-templates/AGENTS.md +820 -0
- package/.agent/skills/doc-templates/SKILL.md +260 -0
- package/.agent/skills/doc-templates/rules/_sections.md +20 -0
- package/.agent/skills/doc-templates/rules/_template.md +32 -0
- package/.agent/skills/doc-templates/rules/doc.md +355 -0
- package/.agent/skills/doc-templates/rules/engineering-spec.md +422 -0
- package/.agent/skills/doc-templates/scripts/editor-server.ts +162 -0
- package/.agent/skills/doc-templates/scripts/inject_otel.ts +22 -0
- package/.agent/skills/doc-templates/scripts/kanban-server.ts +171 -0
- package/.agent/skills/doc-templates/scripts/markdown-server.ts +185 -0
- package/.agent/skills/e2e-automation/AGENTS.md +882 -0
- package/.agent/skills/e2e-automation/SKILL.md +175 -0
- package/.agent/skills/e2e-automation/rules/_sections.md +20 -0
- package/.agent/skills/e2e-automation/rules/_template.md +32 -0
- package/.agent/skills/e2e-automation/rules/aria-snapshot.md +185 -0
- package/.agent/skills/e2e-automation/rules/engineering-spec.md +501 -0
- package/.agent/skills/e2e-automation/scripts/playwright_runner.ts +208 -0
- package/.agent/skills/execution-reporter/AGENTS.md +419 -0
- package/.agent/skills/execution-reporter/SKILL.md +152 -0
- package/.agent/skills/execution-reporter/rules/_sections.md +15 -0
- package/.agent/skills/execution-reporter/rules/_template.md +32 -0
- package/.agent/skills/execution-reporter/rules/engineering-spec.md +389 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +140 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +156 -0
- package/.agent/skills/game-development/AGENTS.md +783 -0
- package/.agent/skills/game-development/SKILL.md +178 -0
- package/.agent/skills/game-development/game-art/SKILL.md +207 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +211 -0
- package/.agent/skills/game-development/game-design/SKILL.md +151 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +130 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +154 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +167 -0
- package/.agent/skills/game-development/rules/_sections.md +15 -0
- package/.agent/skills/game-development/rules/_template.md +32 -0
- package/.agent/skills/game-development/rules/engineering-spec.md +480 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +144 -0
- package/.agent/skills/game-development/web-games/SKILL.md +173 -0
- package/.agent/skills/git-workflow/AGENTS.md +554 -0
- package/.agent/skills/git-workflow/SKILL.md +181 -0
- package/.agent/skills/git-workflow/rules/_sections.md +15 -0
- package/.agent/skills/git-workflow/rules/_template.md +32 -0
- package/.agent/skills/git-workflow/rules/engineering-spec.md +518 -0
- package/.agent/skills/gitops/AGENTS.md +921 -0
- package/.agent/skills/gitops/SKILL.md +163 -0
- package/.agent/skills/gitops/rules/_sections.md +25 -0
- package/.agent/skills/gitops/rules/_template.md +32 -0
- package/.agent/skills/gitops/rules/argocd-setup.md +148 -0
- package/.agent/skills/gitops/rules/engineering-spec.md +450 -0
- package/.agent/skills/gitops/rules/sync-policies.md +145 -0
- package/.agent/skills/google-adk-python/AGENTS.md +1054 -0
- package/.agent/skills/google-adk-python/SKILL.md +168 -0
- package/.agent/skills/google-adk-python/rules/_sections.md +25 -0
- package/.agent/skills/google-adk-python/rules/_template.md +32 -0
- package/.agent/skills/google-adk-python/rules/deployment.md +138 -0
- package/.agent/skills/google-adk-python/rules/engineering-spec.md +451 -0
- package/.agent/skills/google-adk-python/rules/multi-agent.md +146 -0
- package/.agent/skills/google-adk-python/rules/tools.md +131 -0
- package/.agent/skills/idea-storm/AGENTS.md +995 -0
- package/.agent/skills/idea-storm/SKILL.md +160 -0
- package/.agent/skills/idea-storm/rules/_sections.md +25 -0
- package/.agent/skills/idea-storm/rules/_template.md +32 -0
- package/.agent/skills/idea-storm/rules/architecture-debate.md +122 -0
- package/.agent/skills/idea-storm/rules/dynamic-questioning.md +374 -0
- package/.agent/skills/idea-storm/rules/engineering-spec.md +466 -0
- package/.agent/skills/knowledge-compiler/SKILL.md +320 -0
- package/.agent/skills/knowledge-graph/AGENTS.md +762 -0
- package/.agent/skills/knowledge-graph/SKILL.md +157 -0
- package/.agent/skills/knowledge-graph/rules/_sections.md +15 -0
- package/.agent/skills/knowledge-graph/rules/_template.md +32 -0
- package/.agent/skills/knowledge-graph/rules/engineering-spec.md +439 -0
- package/.agent/skills/knowledge-linter/SKILL.md +217 -0
- package/.agent/skills/lifecycle-orchestrator/AGENTS.md +989 -0
- package/.agent/skills/lifecycle-orchestrator/SKILL.md +169 -0
- package/.agent/skills/lifecycle-orchestrator/rules/_sections.md +15 -0
- package/.agent/skills/lifecycle-orchestrator/rules/_template.md +32 -0
- package/.agent/skills/lifecycle-orchestrator/rules/engineering-spec.md +525 -0
- package/.agent/skills/lifecycle-orchestrator/scripts/state_manager.ts +189 -0
- package/.agent/skills/mcp-builder/AGENTS.md +1653 -0
- package/.agent/skills/mcp-builder/SKILL.md +166 -0
- package/.agent/skills/mcp-builder/rules/_sections.md +40 -0
- package/.agent/skills/mcp-builder/rules/_template.md +32 -0
- package/.agent/skills/mcp-builder/rules/best-practices.md +157 -0
- package/.agent/skills/mcp-builder/rules/design-principles.md +105 -0
- package/.agent/skills/mcp-builder/rules/engineering-spec.md +473 -0
- package/.agent/skills/mcp-builder/rules/evaluation.md +103 -0
- package/.agent/skills/mcp-builder/rules/python-implementation.md +249 -0
- package/.agent/skills/mcp-builder/rules/quickstart.md +111 -0
- package/.agent/skills/mcp-builder/rules/typescript-implementation.md +280 -0
- package/.agent/skills/mcp-management/AGENTS.md +837 -0
- package/.agent/skills/mcp-management/SKILL.md +164 -0
- package/.agent/skills/mcp-management/rules/_sections.md +25 -0
- package/.agent/skills/mcp-management/rules/_template.md +32 -0
- package/.agent/skills/mcp-management/rules/cli-usage.md +146 -0
- package/.agent/skills/mcp-management/rules/engineering-spec.md +501 -0
- package/.agent/skills/mcp-management/rules/protocol.md +159 -0
- package/.agent/skills/media-processing/AGENTS.md +479 -0
- package/.agent/skills/media-processing/SKILL.md +176 -0
- package/.agent/skills/media-processing/rules/_sections.md +15 -0
- package/.agent/skills/media-processing/rules/_template.md +32 -0
- package/.agent/skills/media-processing/rules/engineering-spec.md +452 -0
- package/.agent/skills/media-processing/scripts/convert-video.ts +155 -0
- package/.agent/skills/media-processing/scripts/optimize-image.ts +127 -0
- package/.agent/skills/mobile-design/AGENTS.md +6531 -0
- package/.agent/skills/mobile-design/SKILL.md +165 -0
- package/.agent/skills/mobile-design/rules/_sections.md +45 -0
- package/.agent/skills/mobile-design/rules/_template.md +32 -0
- package/.agent/skills/mobile-design/rules/decision-trees.md +540 -0
- package/.agent/skills/mobile-design/rules/engineering-spec.md +467 -0
- package/.agent/skills/mobile-design/rules/mobile-backend.md +516 -0
- package/.agent/skills/mobile-design/rules/mobile-color-system.md +436 -0
- package/.agent/skills/mobile-design/rules/mobile-debugging.md +146 -0
- package/.agent/skills/mobile-design/rules/mobile-design-thinking.md +381 -0
- package/.agent/skills/mobile-design/rules/mobile-navigation.md +474 -0
- package/.agent/skills/mobile-design/rules/mobile-performance.md +783 -0
- package/.agent/skills/mobile-design/rules/mobile-testing.md +380 -0
- package/.agent/skills/mobile-design/rules/mobile-typography.md +449 -0
- package/.agent/skills/mobile-design/rules/platform-android.md +682 -0
- package/.agent/skills/mobile-design/rules/platform-ios.md +577 -0
- package/.agent/skills/mobile-design/rules/touch-psychology.md +553 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.ts +309 -0
- package/.agent/skills/mobile-developer/AGENTS.md +904 -0
- package/.agent/skills/mobile-developer/SKILL.md +194 -0
- package/.agent/skills/mobile-developer/rules/_sections.md +75 -0
- package/.agent/skills/mobile-developer/rules/_template.md +32 -0
- package/.agent/skills/mobile-developer/rules/anti-patterns.md +70 -0
- package/.agent/skills/mobile-developer/rules/app-store-optimization.md +319 -0
- package/.agent/skills/mobile-developer/rules/decision-trees.md +545 -0
- package/.agent/skills/mobile-developer/rules/deep-linking.md +441 -0
- package/.agent/skills/mobile-developer/rules/engineering-spec.md +477 -0
- package/.agent/skills/mobile-developer/rules/flutter.md +475 -0
- package/.agent/skills/mobile-developer/rules/mobile-backend.md +516 -0
- package/.agent/skills/mobile-developer/rules/mobile-color-system.md +444 -0
- package/.agent/skills/mobile-developer/rules/mobile-debugging.md +428 -0
- package/.agent/skills/mobile-developer/rules/mobile-design-thinking.md +367 -0
- package/.agent/skills/mobile-developer/rules/mobile-navigation.md +483 -0
- package/.agent/skills/mobile-developer/rules/mobile-performance.md +778 -0
- package/.agent/skills/mobile-developer/rules/mobile-testing.md +382 -0
- package/.agent/skills/mobile-developer/rules/mobile-typography.md +457 -0
- package/.agent/skills/mobile-developer/rules/native.md +572 -0
- package/.agent/skills/mobile-developer/rules/platform-android.md +676 -0
- package/.agent/skills/mobile-developer/rules/platform-ios.md +571 -0
- package/.agent/skills/mobile-developer/rules/push-notifications.md +599 -0
- package/.agent/skills/mobile-developer/rules/react-native.md +422 -0
- package/.agent/skills/mobile-developer/rules/touch-psychology.md +547 -0
- package/.agent/skills/mobile-developer/scripts/mobile_audit.ts +701 -0
- package/.agent/skills/nextjs-pro/AGENTS.md +3932 -0
- package/.agent/skills/nextjs-pro/SKILL.md +171 -0
- package/.agent/skills/nextjs-pro/rules/_sections.md +50 -0
- package/.agent/skills/nextjs-pro/rules/_template.md +32 -0
- package/.agent/skills/nextjs-pro/rules/advanced-event-handler-refs.md +59 -0
- package/.agent/skills/nextjs-pro/rules/advanced-init-once.md +46 -0
- package/.agent/skills/nextjs-pro/rules/advanced-use-latest.md +43 -0
- package/.agent/skills/nextjs-pro/rules/async-api-routes.md +42 -0
- package/.agent/skills/nextjs-pro/rules/async-defer-await.md +84 -0
- package/.agent/skills/nextjs-pro/rules/async-dependencies.md +55 -0
- package/.agent/skills/nextjs-pro/rules/async-parallel.md +32 -0
- package/.agent/skills/nextjs-pro/rules/async-suspense-boundaries.md +103 -0
- package/.agent/skills/nextjs-pro/rules/bundle-barrel-imports.md +63 -0
- package/.agent/skills/nextjs-pro/rules/bundle-conditional.md +35 -0
- package/.agent/skills/nextjs-pro/rules/bundle-defer-third-party.md +53 -0
- package/.agent/skills/nextjs-pro/rules/bundle-dynamic-imports.md +39 -0
- package/.agent/skills/nextjs-pro/rules/bundle-preload.md +54 -0
- package/.agent/skills/nextjs-pro/rules/client-event-listeners.md +78 -0
- package/.agent/skills/nextjs-pro/rules/client-localstorage-schema.md +75 -0
- package/.agent/skills/nextjs-pro/rules/client-passive-event-listeners.md +52 -0
- package/.agent/skills/nextjs-pro/rules/client-swr-dedup.md +60 -0
- package/.agent/skills/nextjs-pro/rules/engineering-spec.md +440 -0
- package/.agent/skills/nextjs-pro/rules/js-batch-dom-css.md +111 -0
- package/.agent/skills/nextjs-pro/rules/js-cache-function-results.md +84 -0
- package/.agent/skills/nextjs-pro/rules/js-cache-property-access.md +32 -0
- package/.agent/skills/nextjs-pro/rules/js-cache-storage.md +74 -0
- package/.agent/skills/nextjs-pro/rules/js-combine-iterations.md +36 -0
- package/.agent/skills/nextjs-pro/rules/js-early-exit.md +54 -0
- package/.agent/skills/nextjs-pro/rules/js-hoist-regexp.md +49 -0
- package/.agent/skills/nextjs-pro/rules/js-index-maps.md +41 -0
- package/.agent/skills/nextjs-pro/rules/js-length-check-first.md +53 -0
- package/.agent/skills/nextjs-pro/rules/js-min-max-loop.md +86 -0
- package/.agent/skills/nextjs-pro/rules/js-set-map-lookups.md +28 -0
- package/.agent/skills/nextjs-pro/rules/js-tosorted-immutable.md +61 -0
- package/.agent/skills/nextjs-pro/rules/rendering-activity.md +30 -0
- package/.agent/skills/nextjs-pro/rules/rendering-animate-svg-wrapper.md +51 -0
- package/.agent/skills/nextjs-pro/rules/rendering-conditional-render.md +44 -0
- package/.agent/skills/nextjs-pro/rules/rendering-content-visibility.md +42 -0
- package/.agent/skills/nextjs-pro/rules/rendering-hoist-jsx.md +50 -0
- package/.agent/skills/nextjs-pro/rules/rendering-hydration-no-flicker.md +86 -0
- package/.agent/skills/nextjs-pro/rules/rendering-hydration-suppress-warning.md +34 -0
- package/.agent/skills/nextjs-pro/rules/rendering-svg-precision.md +32 -0
- package/.agent/skills/nextjs-pro/rules/rendering-usetransition-loading.md +79 -0
- package/.agent/skills/nextjs-pro/rules/rerender-defer-reads.md +43 -0
- package/.agent/skills/nextjs-pro/rules/rerender-dependencies.md +49 -0
- package/.agent/skills/nextjs-pro/rules/rerender-derived-state-no-effect.md +44 -0
- package/.agent/skills/nextjs-pro/rules/rerender-derived-state.md +33 -0
- package/.agent/skills/nextjs-pro/rules/rerender-functional-setstate.md +78 -0
- package/.agent/skills/nextjs-pro/rules/rerender-lazy-state-init.md +62 -0
- package/.agent/skills/nextjs-pro/rules/rerender-memo-with-default-value.md +42 -0
- package/.agent/skills/nextjs-pro/rules/rerender-memo.md +48 -0
- package/.agent/skills/nextjs-pro/rules/rerender-move-effect-to-event.md +49 -0
- package/.agent/skills/nextjs-pro/rules/rerender-simple-expression-in-memo.md +39 -0
- package/.agent/skills/nextjs-pro/rules/rerender-transitions.md +44 -0
- package/.agent/skills/nextjs-pro/rules/rerender-use-ref-transient-values.md +77 -0
- package/.agent/skills/nextjs-pro/rules/schema.json +34 -0
- package/.agent/skills/nextjs-pro/rules/server-after-nonblocking.md +77 -0
- package/.agent/skills/nextjs-pro/rules/server-auth-actions.md +100 -0
- package/.agent/skills/nextjs-pro/rules/server-cache-lru.md +45 -0
- package/.agent/skills/nextjs-pro/rules/server-cache-react.md +80 -0
- package/.agent/skills/nextjs-pro/rules/server-dedup-props.md +69 -0
- package/.agent/skills/nextjs-pro/rules/server-parallel-fetching.md +87 -0
- package/.agent/skills/nextjs-pro/rules/server-serialization.md +42 -0
- package/.agent/skills/nodejs-pro/AGENTS.md +866 -0
- package/.agent/skills/nodejs-pro/SKILL.md +172 -0
- package/.agent/skills/nodejs-pro/rules/_sections.md +50 -0
- package/.agent/skills/nodejs-pro/rules/_template.md +32 -0
- package/.agent/skills/nodejs-pro/rules/architecture-patterns.md +229 -0
- package/.agent/skills/nodejs-pro/rules/async-patterns.md +246 -0
- package/.agent/skills/nodejs-pro/rules/engineering-spec.md +438 -0
- package/.agent/skills/nodejs-pro/rules/error-handling.md +257 -0
- package/.agent/skills/nodejs-pro/rules/framework-selection.md +220 -0
- package/.agent/skills/nodejs-pro/rules/runtime-modules.md +176 -0
- package/.agent/skills/nodejs-pro/rules/testing-strategy.md +266 -0
- package/.agent/skills/nodejs-pro/rules/validation-security.md +205 -0
- package/.agent/skills/observability/AGENTS.md +607 -0
- package/.agent/skills/observability/SKILL.md +178 -0
- package/.agent/skills/observability/rules/_sections.md +15 -0
- package/.agent/skills/observability/rules/_template.md +32 -0
- package/.agent/skills/observability/rules/engineering-spec.md +440 -0
- package/.agent/skills/offensive-sec/AGENTS.md +849 -0
- package/.agent/skills/offensive-sec/SKILL.md +191 -0
- package/.agent/skills/offensive-sec/rules/_sections.md +15 -0
- package/.agent/skills/offensive-sec/rules/_template.md +32 -0
- package/.agent/skills/offensive-sec/rules/engineering-spec.md +470 -0
- package/.agent/skills/perf-optimizer/AGENTS.md +870 -0
- package/.agent/skills/perf-optimizer/SKILL.md +189 -0
- package/.agent/skills/perf-optimizer/rules/_sections.md +15 -0
- package/.agent/skills/perf-optimizer/rules/_template.md +32 -0
- package/.agent/skills/perf-optimizer/rules/backend-patterns.md +312 -0
- package/.agent/skills/perf-optimizer/rules/engineering-spec.md +428 -0
- package/.agent/skills/perf-optimizer/scripts/lighthouse_audit.ts +201 -0
- package/.agent/skills/problem-checker/AGENTS.md +519 -0
- package/.agent/skills/problem-checker/SKILL.md +189 -0
- package/.agent/skills/problem-checker/rules/_sections.md +15 -0
- package/.agent/skills/problem-checker/rules/_template.md +32 -0
- package/.agent/skills/problem-checker/rules/engineering-spec.md +483 -0
- package/.agent/skills/problem-checker/scripts/check_problems.ts +396 -0
- package/.agent/skills/project-planner/AGENTS.md +2698 -0
- package/.agent/skills/project-planner/SKILL.md +166 -0
- package/.agent/skills/project-planner/rules/_sections.md +15 -0
- package/.agent/skills/project-planner/rules/_template.md +32 -0
- package/.agent/skills/project-planner/rules/engineering-spec.md +420 -0
- package/.agent/skills/python-pro/AGENTS.md +1871 -0
- package/.agent/skills/python-pro/SKILL.md +182 -0
- package/.agent/skills/python-pro/rules/_sections.md +50 -0
- package/.agent/skills/python-pro/rules/_template.md +32 -0
- package/.agent/skills/python-pro/rules/async-patterns.md +168 -0
- package/.agent/skills/python-pro/rules/django-patterns.md +194 -0
- package/.agent/skills/python-pro/rules/engineering-spec.md +442 -0
- package/.agent/skills/python-pro/rules/fastapi-patterns.md +179 -0
- package/.agent/skills/python-pro/rules/framework-selection.md +167 -0
- package/.agent/skills/python-pro/rules/project-structure.md +181 -0
- package/.agent/skills/python-pro/rules/testing-patterns.md +212 -0
- package/.agent/skills/python-pro/rules/type-hints.md +159 -0
- package/.agent/skills/react-pro/AGENTS.md +963 -0
- package/.agent/skills/react-pro/SKILL.md +232 -0
- package/.agent/skills/react-pro/rules/_sections.md +40 -0
- package/.agent/skills/react-pro/rules/_template.md +32 -0
- package/.agent/skills/react-pro/rules/component-patterns.md +145 -0
- package/.agent/skills/react-pro/rules/composition-compound.md +82 -0
- package/.agent/skills/react-pro/rules/data-fetching.md +133 -0
- package/.agent/skills/react-pro/rules/engineering-spec.md +453 -0
- package/.agent/skills/react-pro/rules/error-boundary.md +61 -0
- package/.agent/skills/react-pro/rules/file-organization.md +158 -0
- package/.agent/skills/react-pro/rules/hooks-custom.md +61 -0
- package/.agent/skills/react-pro/rules/mui-styling.md +138 -0
- package/.agent/skills/react-pro/rules/patterns.md +24 -0
- package/.agent/skills/react-pro/rules/performance-optimization.md +65 -0
- package/.agent/skills/react-pro/rules/performance.md +137 -0
- package/.agent/skills/react-pro/rules/react19-hooks.md +85 -0
- package/.agent/skills/react-pro/rules/state-management.md +90 -0
- package/.agent/skills/react-pro/rules/testing-patterns.md +52 -0
- package/.agent/skills/registry.json +1251 -0
- package/.agent/skills/security-scanner/AGENTS.md +851 -0
- package/.agent/skills/security-scanner/SKILL.md +182 -0
- package/.agent/skills/security-scanner/rules/_sections.md +15 -0
- package/.agent/skills/security-scanner/rules/_template.md +32 -0
- package/.agent/skills/security-scanner/rules/auth-patterns.md +281 -0
- package/.agent/skills/security-scanner/rules/checklists.md +186 -0
- package/.agent/skills/security-scanner/rules/engineering-spec.md +440 -0
- package/.agent/skills/security-scanner/scripts/security_scan.ts +513 -0
- package/.agent/skills/seo-optimizer/AGENTS.md +839 -0
- package/.agent/skills/seo-optimizer/SKILL.md +180 -0
- package/.agent/skills/seo-optimizer/rules/_sections.md +15 -0
- package/.agent/skills/seo-optimizer/rules/_template.md +32 -0
- package/.agent/skills/seo-optimizer/rules/engineering-spec.md +433 -0
- package/.agent/skills/seo-optimizer/scripts/geo_checker.ts +109 -0
- package/.agent/skills/seo-optimizer/scripts/seo_checker.ts +308 -0
- package/.agent/skills/server-ops/AGENTS.md +643 -0
- package/.agent/skills/server-ops/SKILL.md +194 -0
- package/.agent/skills/server-ops/rules/_sections.md +15 -0
- package/.agent/skills/server-ops/rules/_template.md +32 -0
- package/.agent/skills/server-ops/rules/engineering-spec.md +450 -0
- package/.agent/skills/shell-script/AGENTS.md +499 -0
- package/.agent/skills/shell-script/SKILL.md +205 -0
- package/.agent/skills/shell-script/rules/_sections.md +15 -0
- package/.agent/skills/shell-script/rules/_template.md +32 -0
- package/.agent/skills/shell-script/rules/engineering-spec.md +463 -0
- package/.agent/skills/skill-generator/SKILL.md +147 -0
- package/.agent/skills/smart-router/SKILL.md +95 -0
- package/.agent/skills/studio/AGENTS.md +636 -0
- package/.agent/skills/studio/SKILL.md +178 -0
- package/.agent/skills/studio/data/charts.csv +26 -0
- package/.agent/skills/studio/data/colors.csv +97 -0
- package/.agent/skills/studio/data/icons.csv +101 -0
- package/.agent/skills/studio/data/landing.csv +31 -0
- package/.agent/skills/studio/data/products.csv +97 -0
- package/.agent/skills/studio/data/prompts.csv +24 -0
- package/.agent/skills/studio/data/react-performance.csv +45 -0
- package/.agent/skills/studio/data/stacks/flutter.csv +52 -0
- package/.agent/skills/studio/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/studio/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/studio/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/studio/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/studio/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/studio/data/stacks/react-native.csv +52 -0
- package/.agent/skills/studio/data/stacks/react.csv +54 -0
- package/.agent/skills/studio/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/studio/data/stacks/svelte.csv +54 -0
- package/.agent/skills/studio/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/studio/data/stacks/vue.csv +50 -0
- package/.agent/skills/studio/data/styles.csv +59 -0
- package/.agent/skills/studio/data/typography.csv +58 -0
- package/.agent/skills/studio/data/ui-reasoning.csv +101 -0
- package/.agent/skills/studio/data/ux-guidelines.csv +100 -0
- package/.agent/skills/studio/data/web-interface.csv +31 -0
- package/.agent/skills/studio/rules/_sections.md +15 -0
- package/.agent/skills/studio/rules/_template.md +32 -0
- package/.agent/skills/studio/rules/engineering-spec.md +455 -0
- package/.agent/skills/studio/scripts/core.ts +345 -0
- package/.agent/skills/studio/scripts/design_system.ts +953 -0
- package/.agent/skills/studio/scripts/search.ts +197 -0
- package/.agent/skills/studio/scripts/types.ts +147 -0
- package/.agent/skills/studio/scripts/utils/component-specs.ts +154 -0
- package/.agent/skills/studio/scripts/utils/config-loader.ts +165 -0
- package/.agent/skills/studio/scripts/utils/css-templates.ts +169 -0
- package/.agent/skills/studio/scripts/utils/css-validator.ts +95 -0
- package/.agent/skills/studio/scripts/utils/csv-loader.ts +52 -0
- package/.agent/skills/studio/scripts/utils/intelligent-overrides.ts +129 -0
- package/.agent/skills/studio/scripts/utils/page-override-formatter.ts +143 -0
- package/.agent/skills/studio/scripts/utils/page-type-detector.ts +124 -0
- package/.agent/skills/studio/scripts/utils/search-cache.ts +165 -0
- package/.agent/skills/studio/scripts/utils/text-utils.ts +44 -0
- package/.agent/skills/system-design/AGENTS.md +597 -0
- package/.agent/skills/system-design/SKILL.md +153 -0
- package/.agent/skills/system-design/rules/_sections.md +15 -0
- package/.agent/skills/system-design/rules/_template.md +32 -0
- package/.agent/skills/system-design/rules/context-discovery.md +117 -0
- package/.agent/skills/system-design/rules/engineering-spec.md +437 -0
- package/.agent/skills/system-design/rules/examples.md +180 -0
- package/.agent/skills/system-design/rules/pattern-selection.md +130 -0
- package/.agent/skills/system-design/rules/patterns-reference.md +110 -0
- package/.agent/skills/system-design/rules/trade-off-analysis.md +169 -0
- package/.agent/skills/tailwind-kit/AGENTS.md +1135 -0
- package/.agent/skills/tailwind-kit/SKILL.md +171 -0
- package/.agent/skills/tailwind-kit/rules/_sections.md +20 -0
- package/.agent/skills/tailwind-kit/rules/_template.md +32 -0
- package/.agent/skills/tailwind-kit/rules/components.md +232 -0
- package/.agent/skills/tailwind-kit/rules/engineering-spec.md +435 -0
- package/.agent/skills/tailwind-kit/rules/responsive.md +221 -0
- package/.agent/skills/tailwind-kit/rules/v4-config.md +72 -0
- package/.agent/skills/test-architect/AGENTS.md +851 -0
- package/.agent/skills/test-architect/SKILL.md +176 -0
- package/.agent/skills/test-architect/rules/_sections.md +15 -0
- package/.agent/skills/test-architect/rules/_template.md +32 -0
- package/.agent/skills/test-architect/rules/engineering-spec.md +434 -0
- package/.agent/skills/test-architect/scripts/test_runner.ts +265 -0
- package/.agent/skills/typescript-expert/AGENTS.md +1045 -0
- package/.agent/skills/typescript-expert/SKILL.md +200 -0
- package/.agent/skills/typescript-expert/rules/_sections.md +20 -0
- package/.agent/skills/typescript-expert/rules/_template.md +32 -0
- package/.agent/skills/typescript-expert/rules/engineering-spec.md +433 -0
- package/.agent/skills/typescript-expert/rules/tsconfig-strict.json +92 -0
- package/.agent/skills/typescript-expert/rules/typescript-cheatsheet.md +407 -0
- package/.agent/skills/typescript-expert/rules/utility-types.ts +264 -0
- package/.agent/skills/typescript-expert/scripts/ts_diagnostic.ts +321 -0
- package/.agent/skills/vercel-deploy/AGENTS.md +490 -0
- package/.agent/skills/vercel-deploy/SKILL.md +175 -0
- package/.agent/skills/vercel-deploy/rules/_sections.md +15 -0
- package/.agent/skills/vercel-deploy/rules/_template.md +32 -0
- package/.agent/skills/vercel-deploy/rules/engineering-spec.md +463 -0
- package/.agent/skills/vercel-deploy/scripts/deploy.sh +310 -0
- package/.agent/workflows/api.md +377 -0
- package/.agent/workflows/autopilot.md +344 -0
- package/.agent/workflows/build.md +338 -0
- package/.agent/workflows/chronicle.md +279 -0
- package/.agent/workflows/cook.md +217 -0
- package/.agent/workflows/diagnose.md +302 -0
- package/.agent/workflows/fix.md +253 -0
- package/.agent/workflows/game.md +329 -0
- package/.agent/workflows/inspect.md +276 -0
- package/.agent/workflows/knowledge.md +212 -0
- package/.agent/workflows/launch.md +345 -0
- package/.agent/workflows/mobile.md +354 -0
- package/.agent/workflows/monitor.md +239 -0
- package/.agent/workflows/optimize.md +269 -0
- package/.agent/workflows/plan.md +278 -0
- package/.agent/workflows/stage.md +286 -0
- package/.agent/workflows/studio.md +276 -0
- package/.agent/workflows/think.md +262 -0
- package/.agent/workflows/validate.md +289 -0
- package/.agentignore +161 -0
- package/.gitattributes +16 -0
- package/CHANGELOG.md +198 -0
- package/LICENSE +40 -0
- package/README.md +173 -0
- package/docs/SKILL_DESIGN_GUIDE.md +561 -0
- package/docs/The-Complete-Guide-to-Building-Skills-for-Claude.md +1207 -0
- package/docs/WORKFLOW_DESIGN_GUIDE.md +325 -0
- package/package.json +33 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,4216 @@
|
|
|
1
|
+
# design-system
|
|
2
|
+
|
|
3
|
+
**Version 1.0.0**
|
|
4
|
+
Engineering
|
|
5
|
+
March 2026
|
|
6
|
+
|
|
7
|
+
> **Note:**
|
|
8
|
+
> This document is for agents and LLMs to follow when working on design-system domain.
|
|
9
|
+
> Optimized for automation and consistency by AI-assisted workflows.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Design System — UI Design Decisions
|
|
14
|
+
|
|
15
|
+
> Every pixel has purpose. Restraint is luxury. User psychology drives decisions.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
**Required:** None — Design System is a knowledge-based skill with no external dependencies.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## When to Use
|
|
26
|
+
|
|
27
|
+
| Situation | Action |
|
|
28
|
+
|-----------|--------|
|
|
29
|
+
| Color selection | Invoke color-palette; read `rules/color-system.md` |
|
|
30
|
+
| Typography | Invoke typography-system; read `rules/typography-system.md` |
|
|
31
|
+
| Visual effects | Invoke visual-effect; read `rules/visual-effects.md` |
|
|
32
|
+
| Animation/motion | Invoke animation-select; read `rules/animation-guide.md` |
|
|
33
|
+
| UX validation | Invoke ux-audit; read `rules/ux-psychology.md` |
|
|
34
|
+
| Design decisions | Read `rules/decision-trees.md` |
|
|
35
|
+
| Architecture review | Read `rules/engineering-spec.md` |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## System Boundaries
|
|
40
|
+
|
|
41
|
+
| Owned by This Skill | NOT Owned |
|
|
42
|
+
|---------------------|-----------|
|
|
43
|
+
| Color theory (3 harmony types + semantic palette) | CSS/Tailwind generation (→ tailwind-kit) |
|
|
44
|
+
| Typography system (max 2 families, modular scale) | AI style recommendations (→ studio) |
|
|
45
|
+
| Visual effects selection criteria | Component implementation |
|
|
46
|
+
| Animation principles (3 functional categories) | WCAG accessibility (→ web-design-guidelines) |
|
|
47
|
+
| UX psychology audit (Hick's, Fitts's, Gestalt) | Image/asset generation (→ ai-artist) |
|
|
48
|
+
| 3 design anti-pattern bans | Frontend code architecture (→ frontend-design) |
|
|
49
|
+
|
|
50
|
+
**Pure decision skill:** Produces design specifications. Zero side effects (except UX audit script reads files).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## ⚠️ Anti-Pattern Bans (Enforced on ALL Outputs)
|
|
55
|
+
|
|
56
|
+
| # | Ban | Reason |
|
|
57
|
+
|---|-----|--------|
|
|
58
|
+
| 1 | **Purple Ban** | Do not use generic purple themes (AI-generated cliché) |
|
|
59
|
+
| 2 | **Bento Ban** | Do not default to Bento grids without explicit justification |
|
|
60
|
+
| 3 | **Dark Mode Default** | Do not assume dark mode unless `dark_mode_requested = true` |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Color System (Quick Reference)
|
|
65
|
+
|
|
66
|
+
| Project + Mood | Harmony |
|
|
67
|
+
|---------------|---------|
|
|
68
|
+
| Professional / Corporate | Complementary |
|
|
69
|
+
| Creative / Playful | Triadic |
|
|
70
|
+
| Minimal / Luxury | Analogous |
|
|
71
|
+
|
|
72
|
+
Every palette includes: primary, secondary, accent, 5 neutrals, 4 semantic (success/warning/error/info).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Typography Rules
|
|
77
|
+
|
|
78
|
+
| Rule | Constraint |
|
|
79
|
+
|------|-----------|
|
|
80
|
+
| Max font families | 2 (heading + body) |
|
|
81
|
+
| Scale | Modular ratio (1.25 or 1.333) |
|
|
82
|
+
| Line height | 1.4–1.6 for body text |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Animation Categories
|
|
87
|
+
|
|
88
|
+
| Category | Purpose | Duration |
|
|
89
|
+
|----------|---------|----------|
|
|
90
|
+
| **Feedback** | Confirm user action | 100–200ms |
|
|
91
|
+
| **Orientation** | Guide spatial awareness | 200–400ms |
|
|
92
|
+
| **Continuity** | Connect state transitions | 300–500ms |
|
|
93
|
+
|
|
94
|
+
Every animation must serve one of these 3 functions. Decorative-only motion is not allowed.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Studio Integration
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Generate complete design system
|
|
102
|
+
node .agent/skills/studio/scripts/search.ts "<query>" --design-system
|
|
103
|
+
|
|
104
|
+
# Search specific domain
|
|
105
|
+
node .agent/skills/studio/scripts/search.ts "<query>" --domain style
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Available domains:** style, color, typography, landing, ux, chart, product
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Error Taxonomy
|
|
113
|
+
|
|
114
|
+
| Code | Recoverable | Trigger |
|
|
115
|
+
|------|-------------|---------|
|
|
116
|
+
| `ERR_INVALID_REQUEST_TYPE` | No | Request type not supported |
|
|
117
|
+
| `ERR_MISSING_PROJECT_TYPE` | Yes | Project type not provided |
|
|
118
|
+
| `ERR_MISSING_BRAND_MOOD` | Yes | Brand mood not provided |
|
|
119
|
+
| `ERR_RULE_NOT_FOUND` | No | Rule file missing |
|
|
120
|
+
| `WARN_ANTI_PATTERN` | Yes | Purple/bento/dark mode ban violated |
|
|
121
|
+
| `WARN_UX_VIOLATION` | Yes | UX psychology law violated |
|
|
122
|
+
|
|
123
|
+
**Zero internal retries.** Deterministic; same context = same design.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 📑 Content Map
|
|
128
|
+
|
|
129
|
+
| File | Description | When to Read |
|
|
130
|
+
|------|-------------|--------------|
|
|
131
|
+
| [ux-psychology.md](rules/ux-psychology.md) | 🔴 **REQUIRED** — Core UX psychology laws | Always |
|
|
132
|
+
| [color-system.md](rules/color-system.md) | Color theory and palette selection | Color decisions |
|
|
133
|
+
| [typography-system.md](rules/typography-system.md) | Font pairing and scale | Typography |
|
|
134
|
+
| [visual-effects.md](rules/visual-effects.md) | Shadows, gradients, glassmorphism | Effects selection |
|
|
135
|
+
| [animation-guide.md](rules/animation-guide.md) | Motion principles | Animation |
|
|
136
|
+
| [motion-graphics.md](rules/motion-graphics.md) | Advanced motion (Lottie, 3D) | Complex animation |
|
|
137
|
+
| [decision-trees.md](rules/decision-trees.md) | Design decision framework | All decisions |
|
|
138
|
+
| [engineering-spec.md](rules/engineering-spec.md) | Full engineering spec | Architecture review |
|
|
139
|
+
|
|
140
|
+
| Script | Purpose |
|
|
141
|
+
|--------|---------|
|
|
142
|
+
| `scripts/ux_audit.ts` | UX psychology audit |
|
|
143
|
+
| `scripts/accessibility_checker.ts` | WCAG compliance audit |
|
|
144
|
+
|
|
145
|
+
**Selective reading:** Read ONLY files relevant to the request.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🔗 Related
|
|
150
|
+
|
|
151
|
+
| Item | Type | Purpose |
|
|
152
|
+
|------|------|---------|
|
|
153
|
+
| `studio` | Skill | AI-powered design recommendations |
|
|
154
|
+
| `tailwind-kit` | Skill | CSS/Tailwind implementation |
|
|
155
|
+
| `frontend-design` | Skill | Frontend code architecture |
|
|
156
|
+
| `/studio` | Workflow | Comprehensive design workflow |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Detailed Rules
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### Rule: animation-guide
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
name: animation-guide
|
|
173
|
+
description: Animation principles — duration psychology, easing, micro-interactions, loading states, scroll animations
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
# Animation Guidelines Reference
|
|
177
|
+
|
|
178
|
+
> Animation principles and timing psychology - learn to decide, not copy.
|
|
179
|
+
> **No fixed durations to memorize - understand what affects timing.**
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 1. Duration Principles
|
|
184
|
+
|
|
185
|
+
### What Affects Timing
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
Factors that determine animation speed:
|
|
189
|
+
├── DISTANCE: Further travel = longer duration
|
|
190
|
+
├── SIZE: Larger elements = slower animations
|
|
191
|
+
├── COMPLEXITY: Complex = slower to process
|
|
192
|
+
├── IMPORTANCE: Critical actions = clear feedback
|
|
193
|
+
└── CONTEXT: Urgent = fast, luxurious = slow
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Duration Ranges by Purpose
|
|
197
|
+
|
|
198
|
+
| Purpose | Range | Why |
|
|
199
|
+
|---------|-------|-----|
|
|
200
|
+
| Instant feedback | 50-100ms | Below perception threshold |
|
|
201
|
+
| Micro-interactions | 100-200ms | Quick but noticeable |
|
|
202
|
+
| Standard transitions | 200-300ms | Comfortable pace |
|
|
203
|
+
| Complex animations | 300-500ms | Time to follow |
|
|
204
|
+
| Page transitions | 400-600ms | Smooth handoff |
|
|
205
|
+
| **Wow/Premium Effects** | 800ms+ | Dramatic, organic spring-based, layered |
|
|
206
|
+
|
|
207
|
+
### Choosing Duration
|
|
208
|
+
|
|
209
|
+
Ask yourself:
|
|
210
|
+
1. How far is the element moving?
|
|
211
|
+
2. How important is it to notice this change?
|
|
212
|
+
3. Is the user waiting, or is this background?
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 2. Easing Principles
|
|
217
|
+
|
|
218
|
+
### What Easing Does
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
Easing = how speed changes over time
|
|
222
|
+
├── Linear: constant speed (mechanical, robotic)
|
|
223
|
+
├── Ease-out: fast start, slow end (natural entry)
|
|
224
|
+
├── Ease-in: slow start, fast end (natural exit)
|
|
225
|
+
└── Ease-in-out: slow both ends (smooth, deliberate)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### When to Use Each
|
|
229
|
+
|
|
230
|
+
| Easing | Best For | Feels Like |
|
|
231
|
+
|--------|----------|------------|
|
|
232
|
+
| **Ease-out** | Elements entering | Arriving, settling |
|
|
233
|
+
| **Ease-in** | Elements leaving | Departing, exiting |
|
|
234
|
+
| **Ease-in-out** | Emphasis, loops | Deliberate, smooth |
|
|
235
|
+
| **Linear** | Continuous motion | Mechanical, constant |
|
|
236
|
+
| **Bounce/Elastic** | Playful UI | Fun, energetic |
|
|
237
|
+
|
|
238
|
+
### The Pattern
|
|
239
|
+
|
|
240
|
+
```css
|
|
241
|
+
/* Entering view = ease-out (decelerate) */
|
|
242
|
+
.enter {
|
|
243
|
+
animation-timing-function: ease-out;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* Leaving view = ease-in (accelerate) */
|
|
247
|
+
.exit {
|
|
248
|
+
animation-timing-function: ease-in;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Continuous = ease-in-out */
|
|
252
|
+
.continuous {
|
|
253
|
+
animation-timing-function: ease-in-out;
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 3. Micro-Interaction Principles
|
|
260
|
+
|
|
261
|
+
### What Makes Good Micro-Interactions
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
Purpose of micro-interactions:
|
|
265
|
+
├── FEEDBACK: Confirm the action happened
|
|
266
|
+
├── GUIDANCE: Show what's possible
|
|
267
|
+
├── STATUS: Indicate current state
|
|
268
|
+
└── DELIGHT: Small moments of joy
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Button States
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
Hover → slight visual change (lift, color, scale)
|
|
275
|
+
Active → pressed feeling (scale down, shadow change)
|
|
276
|
+
Focus → clear indicator (outline, ring)
|
|
277
|
+
Loading → progress indicator (spinner, skeleton)
|
|
278
|
+
Success → confirmation (check, color)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Principles
|
|
282
|
+
|
|
283
|
+
1. **Respond immediately** (under 100ms perception)
|
|
284
|
+
2. **Match the action** (press = `scale(0.95)`, hover = `translateY(-4px) + glow`)
|
|
285
|
+
3. **Be bold but smooth** (Usta işi hissettir)
|
|
286
|
+
4. **Be consistent** (same actions = same feedback)
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## 4. Loading States Principles
|
|
291
|
+
|
|
292
|
+
### Types by Context
|
|
293
|
+
|
|
294
|
+
| Situation | Approach |
|
|
295
|
+
|-----------|----------|
|
|
296
|
+
| Quick load (<1s) | No indicator needed |
|
|
297
|
+
| Medium (1-3s) | Spinner or simple animation |
|
|
298
|
+
| Long (3s+) | Progress bar or skeleton |
|
|
299
|
+
| Unknown duration | Indeterminate indicator |
|
|
300
|
+
|
|
301
|
+
### Skeleton Screens
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
Purpose: Reduce perceived wait time
|
|
305
|
+
├── Show layout shape immediately
|
|
306
|
+
├── Animate subtly (shimmer, pulse)
|
|
307
|
+
├── Replace with content when ready
|
|
308
|
+
└── Feels faster than spinner
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Progress Indicators
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
When to show progress:
|
|
315
|
+
├── User-initiated action
|
|
316
|
+
├── File uploads/downloads
|
|
317
|
+
├── Multi-step processes
|
|
318
|
+
└── Long operations
|
|
319
|
+
|
|
320
|
+
When NOT needed:
|
|
321
|
+
├── Very quick operations
|
|
322
|
+
├── Background tasks
|
|
323
|
+
└── Initial page loads (skeleton better)
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 5. Page Transitions Principles
|
|
329
|
+
|
|
330
|
+
### Transition Strategy
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
Simple rule: exit fast, enter slower
|
|
334
|
+
├── Outgoing content fades quickly
|
|
335
|
+
├── Incoming content animates in
|
|
336
|
+
└── Avoids "everything moving at once"
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### Common Patterns
|
|
340
|
+
|
|
341
|
+
| Pattern | When to Use |
|
|
342
|
+
|---------|-------------|
|
|
343
|
+
| **Fade** | Safe default, works everywhere |
|
|
344
|
+
| **Slide** | Sequential navigation (prev/next) |
|
|
345
|
+
| **Scale** | Opening/closing modals |
|
|
346
|
+
| **Shared element** | Maintaining visual continuity |
|
|
347
|
+
|
|
348
|
+
### Direction Matching
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
Navigation direction = animation direction
|
|
352
|
+
├── Forward → slide from right
|
|
353
|
+
├── Backward → slide from left
|
|
354
|
+
├── Deeper → scale up from center
|
|
355
|
+
├── Back up → scale down
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 6. Scroll Animation Principles
|
|
361
|
+
|
|
362
|
+
### Progressive Reveal
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
Content appears as user scrolls:
|
|
366
|
+
├── Reduces initial cognitive load
|
|
367
|
+
├── Rewards exploration
|
|
368
|
+
├── Must not feel sluggish
|
|
369
|
+
└── Option to disable (accessibility)
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### Trigger Points
|
|
373
|
+
|
|
374
|
+
| When to Trigger | Effect |
|
|
375
|
+
|-----------------|--------|
|
|
376
|
+
| Just entering viewport | Standard reveal |
|
|
377
|
+
| Centered in viewport | For emphasis |
|
|
378
|
+
| Partially visible | Earlier reveal |
|
|
379
|
+
| Fully visible | Late trigger |
|
|
380
|
+
|
|
381
|
+
### Animation Properties
|
|
382
|
+
|
|
383
|
+
- Fade in (opacity)
|
|
384
|
+
- Slide up (transform)
|
|
385
|
+
- Scale (transform)
|
|
386
|
+
- Combination of above
|
|
387
|
+
|
|
388
|
+
### Performance
|
|
389
|
+
|
|
390
|
+
- Use Intersection Observer
|
|
391
|
+
- Animate only transform/opacity
|
|
392
|
+
- Reduce on mobile if needed
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 7. Hover Effects Principles
|
|
397
|
+
|
|
398
|
+
### Matching Effect to Action
|
|
399
|
+
|
|
400
|
+
| Element | Effect | Intent |
|
|
401
|
+
|---------|--------|--------|
|
|
402
|
+
| **Clickable card** | Lift + shadow | "This is interactive" |
|
|
403
|
+
| **Button** | Color/brightness change | "Press me" |
|
|
404
|
+
| **Image** | Zoom/scale | "View closer" |
|
|
405
|
+
| **Link** | Underline/color | "Navigate here" |
|
|
406
|
+
|
|
407
|
+
### Principles
|
|
408
|
+
|
|
409
|
+
1. **Signal interactivity** - hover shows it's clickable
|
|
410
|
+
2. **Don't overdo it** - subtle changes work
|
|
411
|
+
3. **Match importance** - bigger change = more important
|
|
412
|
+
4. **Touch alternatives** - hover doesn't work on mobile
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## 8. Feedback Animation Principles
|
|
417
|
+
|
|
418
|
+
### Success States
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
Celebrate appropriately:
|
|
422
|
+
├── Minor action → subtle check/color
|
|
423
|
+
├── Major action → more pronounced animation
|
|
424
|
+
├── Completion → satisfying animation
|
|
425
|
+
└── Match brand personality
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### Error States
|
|
429
|
+
|
|
430
|
+
```
|
|
431
|
+
Draw attention without panic:
|
|
432
|
+
├── Color change (semantic red)
|
|
433
|
+
├── Shake animation (brief!)
|
|
434
|
+
├── Focus on error field
|
|
435
|
+
└── Clear messaging
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Timing
|
|
439
|
+
|
|
440
|
+
- Success: slightly longer (enjoy the moment)
|
|
441
|
+
- Error: quick (don't delay action)
|
|
442
|
+
- Loading: continuous until complete
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## 9. Performance Principles
|
|
447
|
+
|
|
448
|
+
### What's Cheap to Animate
|
|
449
|
+
|
|
450
|
+
```
|
|
451
|
+
GPU-accelerated (FAST):
|
|
452
|
+
├── transform: translate, scale, rotate
|
|
453
|
+
└── opacity: 0 to 1
|
|
454
|
+
|
|
455
|
+
CPU-intensive (SLOW):
|
|
456
|
+
├── width, height
|
|
457
|
+
├── top, left, right, bottom
|
|
458
|
+
├── margin, padding
|
|
459
|
+
├── border-radius changes
|
|
460
|
+
└── box-shadow changes
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### Optimization Strategies
|
|
464
|
+
|
|
465
|
+
1. **Animate transform/opacity** whenever possible
|
|
466
|
+
2. **Avoid layout triggers** (size/position changes)
|
|
467
|
+
3. **Use will-change sparingly** (hints to browser)
|
|
468
|
+
4. **Test on low-end devices** (not just dev machine)
|
|
469
|
+
|
|
470
|
+
### Respecting User Preferences
|
|
471
|
+
|
|
472
|
+
```css
|
|
473
|
+
@media (prefers-reduced-motion: reduce) {
|
|
474
|
+
/* Honor this preference */
|
|
475
|
+
/* Essential animations only */
|
|
476
|
+
/* Reduce or remove decorative motion */
|
|
477
|
+
}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## 10. Animation Decision Checklist
|
|
483
|
+
|
|
484
|
+
Before adding animation:
|
|
485
|
+
|
|
486
|
+
- [ ] **Is there a purpose?** (feedback/guidance/delight)
|
|
487
|
+
- [ ] **Is timing appropriate?** (not too fast/slow)
|
|
488
|
+
- [ ] **Did you pick correct easing?** (enter/exit/emphasis)
|
|
489
|
+
- [ ] **Is it performant?** (transform/opacity only)
|
|
490
|
+
- [ ] **Tested reduced motion?** (accessibility)
|
|
491
|
+
- [ ] **Consistent with other animations?** (same timing feel)
|
|
492
|
+
- [ ] **Not your default settings?** (variety check)
|
|
493
|
+
- [ ] **Asked user about style if unclear?**
|
|
494
|
+
|
|
495
|
+
### Anti-Patterns
|
|
496
|
+
|
|
497
|
+
- ❌ Same timing values every project
|
|
498
|
+
- ❌ Animation for animation's sake
|
|
499
|
+
- ❌ Ignoring reduced-motion preference
|
|
500
|
+
- ❌ Animating expensive properties
|
|
501
|
+
- ❌ Too many things animating at once
|
|
502
|
+
- ❌ Delays that frustrate users
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
> **Remember**: Animation is communication. Every motion should have meaning and serve the user experience.
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
## 🔗 Related
|
|
515
|
+
|
|
516
|
+
| File | When to Read |
|
|
517
|
+
|------|-------------|
|
|
518
|
+
| [motion-graphics.md](motion-graphics.md) | Advanced Lottie, GSAP, particle effects |
|
|
519
|
+
| [visual-effects.md](visual-effects.md) | CSS effects to animate |
|
|
520
|
+
| [ux-psychology.md](ux-psychology.md) | Feedback psychology for micro-interactions |
|
|
521
|
+
| [../SKILL.md](../SKILL.md) | Animation categories quick reference |
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
### Rule: color-system
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
name: color-system
|
|
529
|
+
description: Color theory, 60-30-10 rule, HSL palette generation, dark mode, WCAG accessibility, Purple Ban
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
# Color System Reference
|
|
533
|
+
|
|
534
|
+
> Color theory principles, selection process, and decision-making guidelines.
|
|
535
|
+
> **No memorized hex codes - learn to THINK about color.**
|
|
536
|
+
|
|
537
|
+
---
|
|
538
|
+
|
|
539
|
+
## 1. Color Theory Fundamentals
|
|
540
|
+
|
|
541
|
+
### The Color Wheel
|
|
542
|
+
|
|
543
|
+
```
|
|
544
|
+
YELLOW
|
|
545
|
+
│
|
|
546
|
+
Yellow- │ Yellow-
|
|
547
|
+
Green │ Orange
|
|
548
|
+
╲ │ ╱
|
|
549
|
+
╲ │ ╱
|
|
550
|
+
GREEN ─────────── ● ─────────── ORANGE
|
|
551
|
+
╱ │ ╲
|
|
552
|
+
╱ │ ╲
|
|
553
|
+
Blue- │ Red-
|
|
554
|
+
Green │ Orange
|
|
555
|
+
│
|
|
556
|
+
RED
|
|
557
|
+
│
|
|
558
|
+
PURPLE
|
|
559
|
+
╱ ╲
|
|
560
|
+
Blue- Red-
|
|
561
|
+
Purple Purple
|
|
562
|
+
╲ ╱
|
|
563
|
+
BLUE
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### Color Relationships
|
|
567
|
+
|
|
568
|
+
| Scheme | How to Create | When to Use |
|
|
569
|
+
|--------|---------------|-------------|
|
|
570
|
+
| **Monochromatic** | Pick ONE hue, vary only lightness/saturation | Minimal, professional, cohesive |
|
|
571
|
+
| **Analogous** | Pick 2-3 ADJACENT hues on wheel | Harmonious, calm, nature-inspired |
|
|
572
|
+
| **Complementary** | Pick OPPOSITE hues on wheel | High contrast, vibrant, attention |
|
|
573
|
+
| **Split-Complementary** | Base + 2 colors adjacent to complement | Dynamic but balanced |
|
|
574
|
+
| **Triadic** | 3 hues EQUIDISTANT on wheel | Vibrant, playful, creative |
|
|
575
|
+
|
|
576
|
+
### How to Choose a Scheme:
|
|
577
|
+
1. **What's the project mood?** Calm → Analogous. Bold → Complementary.
|
|
578
|
+
2. **How many colors needed?** Minimal → Monochromatic. Complex → Triadic.
|
|
579
|
+
3. **Who's the audience?** Conservative → Monochromatic. Young → Triadic.
|
|
580
|
+
|
|
581
|
+
---
|
|
582
|
+
|
|
583
|
+
## 2. The 60-30-10 Rule
|
|
584
|
+
|
|
585
|
+
### Distribution Principle
|
|
586
|
+
```
|
|
587
|
+
┌─────────────────────────────────────────────────┐
|
|
588
|
+
│ │
|
|
589
|
+
│ 60% PRIMARY (Background, large areas) │
|
|
590
|
+
│ → Should be neutral or calming │
|
|
591
|
+
│ → Carries the overall tone │
|
|
592
|
+
│ │
|
|
593
|
+
├────────────────────────────────────┬────────────┤
|
|
594
|
+
│ │ │
|
|
595
|
+
│ 30% SECONDARY │ 10% ACCENT │
|
|
596
|
+
│ (Cards, sections, headers) │ (CTAs, │
|
|
597
|
+
│ → Supports without dominating │ highlights)│
|
|
598
|
+
│ │ → Draws │
|
|
599
|
+
│ │ attention│
|
|
600
|
+
└────────────────────────────────────┴────────────┘
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
### Implementation Pattern
|
|
604
|
+
```css
|
|
605
|
+
:root {
|
|
606
|
+
/* 60% - Pick based on light/dark mode and mood */
|
|
607
|
+
--color-bg: /* neutral: white, off-white, or dark gray */
|
|
608
|
+
--color-surface: /* slightly different from bg */
|
|
609
|
+
|
|
610
|
+
/* 30% - Pick based on brand or context */
|
|
611
|
+
--color-secondary: /* muted version of primary or neutral */
|
|
612
|
+
|
|
613
|
+
/* 10% - Pick based on desired action/emotion */
|
|
614
|
+
--color-accent: /* vibrant, attention-grabbing */
|
|
615
|
+
}
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
## 3. Color Psychology - Meaning & Selection
|
|
621
|
+
|
|
622
|
+
### How to Choose Based on Context
|
|
623
|
+
|
|
624
|
+
| If Project Is... | Consider These Hues | Why |
|
|
625
|
+
|------------------|---------------------|-----|
|
|
626
|
+
| **Finance, Tech, Healthcare** | Blues, Teals | Trust, stability, calm |
|
|
627
|
+
| **Eco, Wellness, Nature** | Greens, Earth tones | Growth, health, organic |
|
|
628
|
+
| **Food, Energy, Youth** | Orange, Yellow, Warm | Appetite, excitement, warmth |
|
|
629
|
+
| **Luxury, Beauty, Creative** | Deep Teal, Gold, Black | Sophistication, premium |
|
|
630
|
+
| **Urgency, Sales, Alerts** | Red, Orange | Action, attention, passion |
|
|
631
|
+
|
|
632
|
+
### Emotional Associations (For Decision Making)
|
|
633
|
+
|
|
634
|
+
| Hue Family | Positive Associations | Cautions |
|
|
635
|
+
|------------|----------------------|----------|
|
|
636
|
+
| **Blue** | Trust, calm, professional | Can feel cold, corporate |
|
|
637
|
+
| **Green** | Growth, nature, success | Can feel boring if overused |
|
|
638
|
+
| **Red** | Passion, urgency, energy | High arousal, use sparingly |
|
|
639
|
+
| **Orange** | Warmth, friendly, creative | Can feel cheap if saturated |
|
|
640
|
+
| **Purple** | ⚠️ **BANNED** - AI overuses this! | Use Deep Teal/Maroon/Emerald instead |
|
|
641
|
+
| **Yellow** | Optimism, attention, happy | Hard to read, use as accent |
|
|
642
|
+
| **Black** | Elegance, power, modern | Can feel heavy |
|
|
643
|
+
| **White** | Clean, minimal, open | Can feel sterile |
|
|
644
|
+
|
|
645
|
+
### Selection Process:
|
|
646
|
+
1. **What industry?** → Narrow to 2-3 hue families
|
|
647
|
+
2. **What emotion?** → Pick primary hue
|
|
648
|
+
3. **What contrast?** → Decide light vs dark mode
|
|
649
|
+
4. **ASK USER** → Confirm before proceeding
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
653
|
+
## 4. Palette Generation Principles
|
|
654
|
+
|
|
655
|
+
### From a Single Color (HSL Method)
|
|
656
|
+
|
|
657
|
+
Instead of memorizing hex codes, learn to **manipulate HSL**:
|
|
658
|
+
|
|
659
|
+
```
|
|
660
|
+
HSL = Hue, Saturation, Lightness
|
|
661
|
+
|
|
662
|
+
Hue (0-360): The color family
|
|
663
|
+
0/360 = Red
|
|
664
|
+
60 = Yellow
|
|
665
|
+
120 = Green
|
|
666
|
+
180 = Cyan
|
|
667
|
+
240 = Blue
|
|
668
|
+
300 = Purple
|
|
669
|
+
|
|
670
|
+
Saturation (0-100%): Color intensity
|
|
671
|
+
Low = Muted, sophisticated
|
|
672
|
+
High = Vibrant, energetic
|
|
673
|
+
|
|
674
|
+
Lightness (0-100%): Brightness
|
|
675
|
+
0% = Black
|
|
676
|
+
50% = Pure color
|
|
677
|
+
100% = White
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
### Generating a Full Palette
|
|
681
|
+
|
|
682
|
+
Given ANY base color, create a scale:
|
|
683
|
+
|
|
684
|
+
```
|
|
685
|
+
Lightness Scale:
|
|
686
|
+
50 (lightest) → L: 97%
|
|
687
|
+
100 → L: 94%
|
|
688
|
+
200 → L: 86%
|
|
689
|
+
300 → L: 74%
|
|
690
|
+
400 → L: 66%
|
|
691
|
+
500 (base) → L: 50-60%
|
|
692
|
+
600 → L: 48%
|
|
693
|
+
700 → L: 38%
|
|
694
|
+
800 → L: 30%
|
|
695
|
+
900 (darkest) → L: 20%
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
### Saturation Adjustments
|
|
699
|
+
|
|
700
|
+
| Context | Saturation Level |
|
|
701
|
+
|---------|-----------------|
|
|
702
|
+
| **Professional/Corporate** | Lower (40-60%) |
|
|
703
|
+
| **Playful/Youth** | Higher (70-90%) |
|
|
704
|
+
| **Dark Mode** | Reduce by 10-20% |
|
|
705
|
+
| **Accessibility** | Ensure contrast, may need adjustment |
|
|
706
|
+
|
|
707
|
+
---
|
|
708
|
+
|
|
709
|
+
## 5. Context-Based Selection Guide
|
|
710
|
+
|
|
711
|
+
### Instead of Copying Palettes, Follow This Process:
|
|
712
|
+
|
|
713
|
+
**Step 1: Identify the Context**
|
|
714
|
+
```
|
|
715
|
+
What type of project?
|
|
716
|
+
├── E-commerce → Need trust + urgency balance
|
|
717
|
+
├── SaaS/Dashboard → Need low-fatigue, data focus
|
|
718
|
+
├── Health/Wellness → Need calming, natural feel
|
|
719
|
+
├── Luxury/Premium → Need understated elegance
|
|
720
|
+
├── Creative/Portfolio → Need personality, memorable
|
|
721
|
+
└── Other → ASK the user
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
**Step 2: Select Primary Hue Family**
|
|
725
|
+
```
|
|
726
|
+
Based on context, pick ONE:
|
|
727
|
+
- Blue family (trust)
|
|
728
|
+
- Green family (growth)
|
|
729
|
+
- Warm family (energy)
|
|
730
|
+
- Neutral family (elegant)
|
|
731
|
+
- OR ask user preference
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
**Step 3: Decide Light/Dark Mode**
|
|
735
|
+
```
|
|
736
|
+
Consider:
|
|
737
|
+
- User preference?
|
|
738
|
+
- Industry standard?
|
|
739
|
+
- Content type? (text-heavy = light preferred)
|
|
740
|
+
- Time of use? (evening app = dark option)
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
**Step 4: Generate Palette Using Principles**
|
|
744
|
+
- Use HSL manipulation
|
|
745
|
+
- Follow 60-30-10 rule
|
|
746
|
+
- Check contrast (WCAG)
|
|
747
|
+
- Test with actual content
|
|
748
|
+
|
|
749
|
+
---
|
|
750
|
+
|
|
751
|
+
## 6. Dark Mode Principles
|
|
752
|
+
|
|
753
|
+
### Key Rules (No Fixed Codes)
|
|
754
|
+
|
|
755
|
+
1. **Never pure black** → Use very dark gray with slight hue
|
|
756
|
+
2. **Never pure white text** → Use 87-92% lightness
|
|
757
|
+
3. **Reduce saturation** → Vibrant colors strain eyes in dark mode
|
|
758
|
+
4. **Elevation = brightness** → Higher elements slightly lighter
|
|
759
|
+
|
|
760
|
+
### Contrast in Dark Mode
|
|
761
|
+
|
|
762
|
+
```
|
|
763
|
+
Background layers (darker → lighter as elevation increases):
|
|
764
|
+
Layer 0 (base) → Darkest
|
|
765
|
+
Layer 1 (cards) → Slightly lighter
|
|
766
|
+
Layer 2 (modals) → Even lighter
|
|
767
|
+
Layer 3 (popups) → Lightest dark
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
### Adapting Colors for Dark Mode
|
|
771
|
+
|
|
772
|
+
| Light Mode | Dark Mode Adjustment |
|
|
773
|
+
|------------|---------------------|
|
|
774
|
+
| High saturation accent | Reduce saturation 10-20% |
|
|
775
|
+
| Pure white background | Dark gray with brand hue tint |
|
|
776
|
+
| Black text | Light gray (not pure white) |
|
|
777
|
+
| Colorful backgrounds | Desaturated, darker versions |
|
|
778
|
+
|
|
779
|
+
---
|
|
780
|
+
|
|
781
|
+
## 7. Accessibility Guidelines
|
|
782
|
+
|
|
783
|
+
### Contrast Requirements (WCAG)
|
|
784
|
+
|
|
785
|
+
| Level | Normal Text | Large Text |
|
|
786
|
+
|-------|-------------|------------|
|
|
787
|
+
| AA (minimum) | 4.5:1 | 3:1 |
|
|
788
|
+
| AAA (enhanced) | 7:1 | 4.5:1 |
|
|
789
|
+
|
|
790
|
+
### How to Check Contrast
|
|
791
|
+
|
|
792
|
+
1. **Convert colors to luminance**
|
|
793
|
+
2. **Calculate ratio**: (lighter + 0.05) / (darker + 0.05)
|
|
794
|
+
3. **Adjust until ratio meets requirement**
|
|
795
|
+
|
|
796
|
+
### Safe Patterns
|
|
797
|
+
|
|
798
|
+
| Use Case | Guideline |
|
|
799
|
+
|----------|-----------|
|
|
800
|
+
| **Text on light bg** | Use lightness 35% or less |
|
|
801
|
+
| **Text on dark bg** | Use lightness 85% or more |
|
|
802
|
+
| **Primary on white** | Ensure dark enough variant |
|
|
803
|
+
| **Buttons** | High contrast between bg and text |
|
|
804
|
+
|
|
805
|
+
---
|
|
806
|
+
|
|
807
|
+
## 8. Color Selection Checklist
|
|
808
|
+
|
|
809
|
+
Before finalizing any color choice, verify:
|
|
810
|
+
|
|
811
|
+
- [ ] **Asked user preference?** (if not specified)
|
|
812
|
+
- [ ] **Matches project context?** (industry, audience)
|
|
813
|
+
- [ ] **Follows 60-30-10?** (proper distribution)
|
|
814
|
+
- [ ] **WCAG compliant?** (contrast checked)
|
|
815
|
+
- [ ] **Works in both modes?** (if dark mode needed)
|
|
816
|
+
- [ ] **NOT your default/favorite?** (variety check)
|
|
817
|
+
- [ ] **Different from last project?** (avoid repetition)
|
|
818
|
+
|
|
819
|
+
---
|
|
820
|
+
|
|
821
|
+
## 9. Anti-Patterns to Avoid
|
|
822
|
+
|
|
823
|
+
### ❌ DON'T:
|
|
824
|
+
- Copy the same hex codes every project
|
|
825
|
+
- Default to purple/violet (AI tendency)
|
|
826
|
+
- Default to dark mode + neon (AI tendency)
|
|
827
|
+
- Use pure black (#000000) backgrounds
|
|
828
|
+
- Use pure white (#FFFFFF) text on dark
|
|
829
|
+
- Ignore user's industry context
|
|
830
|
+
- Skip asking user preference
|
|
831
|
+
|
|
832
|
+
### ✅ DO:
|
|
833
|
+
- Generate fresh palette per project
|
|
834
|
+
- Ask user about color preferences
|
|
835
|
+
- Consider industry and audience
|
|
836
|
+
- Use HSL for flexible manipulation
|
|
837
|
+
- Test contrast and accessibility
|
|
838
|
+
- Offer light AND dark options
|
|
839
|
+
|
|
840
|
+
---
|
|
841
|
+
|
|
842
|
+
> **Remember**: Colors are decisions, not defaults. Every project deserves thoughtful selection based on its unique context.
|
|
843
|
+
|
|
844
|
+
---
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
---
|
|
849
|
+
|
|
850
|
+
## 🔗 Related
|
|
851
|
+
|
|
852
|
+
| File | When to Read |
|
|
853
|
+
|------|-------------|
|
|
854
|
+
| [ux-psychology.md](ux-psychology.md) | Emotion-color mapping and trust signals |
|
|
855
|
+
| [decision-trees.md](decision-trees.md) | Color selection decision tree |
|
|
856
|
+
| [visual-effects.md](visual-effects.md) | Gradient and glow effects using palette |
|
|
857
|
+
| [../SKILL.md](../SKILL.md) | Purple Ban enforcement |
|
|
858
|
+
|
|
859
|
+
---
|
|
860
|
+
|
|
861
|
+
### Rule: color-systems
|
|
862
|
+
|
|
863
|
+
---
|
|
864
|
+
name: color-systems
|
|
865
|
+
description: Color commitment strategy — dominant + accent + neutral, 4 aesthetic palettes, dark mode
|
|
866
|
+
---
|
|
867
|
+
|
|
868
|
+
# Color Systems
|
|
869
|
+
|
|
870
|
+
> Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
|
|
871
|
+
|
|
872
|
+
---
|
|
873
|
+
|
|
874
|
+
## Principle: Commit Fully
|
|
875
|
+
|
|
876
|
+
Don't distribute color evenly. Choose:
|
|
877
|
+
- **1 dominant color** (60-70% of palette)
|
|
878
|
+
- **1 sharp accent** (10-20% for emphasis)
|
|
879
|
+
- **1-2 neutrals** (supporting roles)
|
|
880
|
+
|
|
881
|
+
---
|
|
882
|
+
|
|
883
|
+
## Color System Setup
|
|
884
|
+
|
|
885
|
+
```css
|
|
886
|
+
:root {
|
|
887
|
+
/* Primary - dominant presence */
|
|
888
|
+
--color-primary: #1A202C;
|
|
889
|
+
--color-primary-light: #2D3748;
|
|
890
|
+
--color-primary-dark: #0F1419;
|
|
891
|
+
|
|
892
|
+
/* Accent - sharp, attention-grabbing */
|
|
893
|
+
--color-accent: #F56565;
|
|
894
|
+
--color-accent-hover: #E53E3E;
|
|
895
|
+
|
|
896
|
+
/* Neutrals - supporting */
|
|
897
|
+
--color-neutral-50: #FAFAFA;
|
|
898
|
+
--color-neutral-100: #F5F5F5;
|
|
899
|
+
--color-neutral-200: #E5E5E5;
|
|
900
|
+
--color-neutral-300: #D4D4D4;
|
|
901
|
+
--color-neutral-700: #525252;
|
|
902
|
+
--color-neutral-900: #171717;
|
|
903
|
+
|
|
904
|
+
/* Semantic */
|
|
905
|
+
--color-success: #10B981;
|
|
906
|
+
--color-warning: #F59E0B;
|
|
907
|
+
--color-error: #EF4444;
|
|
908
|
+
}
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
---
|
|
912
|
+
|
|
913
|
+
## Aesthetic Palettes
|
|
914
|
+
|
|
915
|
+
### Dark + Bold Accent
|
|
916
|
+
```css
|
|
917
|
+
--color-bg: #0F0F0F;
|
|
918
|
+
--color-text: #FAFAFA;
|
|
919
|
+
--color-accent: #FF6B35;
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
### Light Editorial
|
|
923
|
+
```css
|
|
924
|
+
--color-bg: #FAFAF9;
|
|
925
|
+
--color-text: #1C1917;
|
|
926
|
+
--color-accent: #DC2626;
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
### Muted Earth
|
|
930
|
+
```css
|
|
931
|
+
--color-bg: #F5F1EB;
|
|
932
|
+
--color-text: #3D3D3D;
|
|
933
|
+
--color-accent: #8B7355;
|
|
934
|
+
```
|
|
935
|
+
|
|
936
|
+
### Neon Cyber
|
|
937
|
+
```css
|
|
938
|
+
--color-bg: #0D1117;
|
|
939
|
+
--color-text: #C9D1D9;
|
|
940
|
+
--color-accent: #58A6FF;
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
---
|
|
944
|
+
|
|
945
|
+
## Anti-Patterns
|
|
946
|
+
|
|
947
|
+
| ❌ Don't | ✅ Do |
|
|
948
|
+
|---------|-------|
|
|
949
|
+
| 5+ equally-weighted colors | 1 dominant + 1 accent |
|
|
950
|
+
| Default blue (#0066CC) | Distinctive, contextual colors |
|
|
951
|
+
| Random gradient | Intentional gradient direction |
|
|
952
|
+
| No dark mode | Full dark mode support |
|
|
953
|
+
| Hard-coded colors | CSS variables |
|
|
954
|
+
|
|
955
|
+
---
|
|
956
|
+
|
|
957
|
+
## Dark Mode
|
|
958
|
+
|
|
959
|
+
```css
|
|
960
|
+
:root {
|
|
961
|
+
--color-bg: #FAFAFA;
|
|
962
|
+
--color-text: #1A1A1A;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
@media (prefers-color-scheme: dark) {
|
|
966
|
+
:root {
|
|
967
|
+
--color-bg: #1A1A1A;
|
|
968
|
+
--color-text: #FAFAFA;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/* Or manual toggle */
|
|
973
|
+
[data-theme="dark"] {
|
|
974
|
+
--color-bg: #1A1A1A;
|
|
975
|
+
--color-text: #FAFAFA;
|
|
976
|
+
}
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
---
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
---
|
|
984
|
+
|
|
985
|
+
## 🔗 Related
|
|
986
|
+
|
|
987
|
+
| File | When to Read |
|
|
988
|
+
|------|-------------|
|
|
989
|
+
| [typography.md](typography.md) | Font pairings that complement colors |
|
|
990
|
+
| [motion-design.md](motion-design.md) | Animate color transitions |
|
|
991
|
+
| [../SKILL.md](../SKILL.md) | Max 3 brand colors constraint |
|
|
992
|
+
|
|
993
|
+
---
|
|
994
|
+
|
|
995
|
+
### Rule: decision-trees
|
|
996
|
+
|
|
997
|
+
---
|
|
998
|
+
name: decision-trees
|
|
999
|
+
description: Design decision framework — master tree, audience routing, color/typography/layout selection, page templates
|
|
1000
|
+
---
|
|
1001
|
+
|
|
1002
|
+
# Decision Trees & Context Templates
|
|
1003
|
+
|
|
1004
|
+
> Context-based design THINKING, not fixed solutions.
|
|
1005
|
+
> **These are decision GUIDES, not copy-paste templates.**
|
|
1006
|
+
> **For UX psychology principles (Hick's, Fitts', etc.) see:** [ux-psychology.md](ux-psychology.md)
|
|
1007
|
+
|
|
1008
|
+
---
|
|
1009
|
+
|
|
1010
|
+
## ⚠️ How to Use This File
|
|
1011
|
+
|
|
1012
|
+
This file helps you DECIDE, not copy.
|
|
1013
|
+
|
|
1014
|
+
- Decision trees → Help you THINK through options
|
|
1015
|
+
- Templates → Show STRUCTURE and PRINCIPLES, not exact values
|
|
1016
|
+
- **Always ask user preferences** before applying
|
|
1017
|
+
- **Generate fresh palettes** based on context, don't copy hex codes
|
|
1018
|
+
- **Apply UX laws** from ux-psychology.md to validate decisions
|
|
1019
|
+
|
|
1020
|
+
---
|
|
1021
|
+
|
|
1022
|
+
## 1. Master Decision Tree
|
|
1023
|
+
|
|
1024
|
+
```
|
|
1025
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
1026
|
+
│ WHAT ARE YOU BUILDING? │
|
|
1027
|
+
└─────────────────────────────────────────────────────────────┘
|
|
1028
|
+
│
|
|
1029
|
+
┌─────────────────────┼─────────────────────┐
|
|
1030
|
+
│ │ │
|
|
1031
|
+
▼ ▼ ▼
|
|
1032
|
+
E-COMMERCE SaaS/APP CONTENT
|
|
1033
|
+
- Product pages - Dashboard - Blog
|
|
1034
|
+
- Checkout - Tools - Portfolio
|
|
1035
|
+
- Catalog - Admin - Landing
|
|
1036
|
+
│ │ │
|
|
1037
|
+
▼ ▼ ▼
|
|
1038
|
+
PRINCIPLES: PRINCIPLES: PRINCIPLES:
|
|
1039
|
+
- Trust - Functionality - Storytelling
|
|
1040
|
+
- Action - Clarity - Emotion
|
|
1041
|
+
- Urgency - Efficiency - Creativity
|
|
1042
|
+
```
|
|
1043
|
+
|
|
1044
|
+
---
|
|
1045
|
+
|
|
1046
|
+
## 2. Audience Decision Tree
|
|
1047
|
+
|
|
1048
|
+
### Who is your target user?
|
|
1049
|
+
|
|
1050
|
+
```
|
|
1051
|
+
TARGET AUDIENCE
|
|
1052
|
+
│
|
|
1053
|
+
├── Gen Z (18-25)
|
|
1054
|
+
│ ├── Colors: Bold, vibrant, unexpected combinations
|
|
1055
|
+
│ ├── Type: Large, expressive, variable
|
|
1056
|
+
│ ├── Layout: Mobile-first, vertical, snackable
|
|
1057
|
+
│ ├── Effects: Motion, gamification, interactive
|
|
1058
|
+
│ └── Approach: Authentic, fast, no corporate feel
|
|
1059
|
+
│
|
|
1060
|
+
├── Millennials (26-41)
|
|
1061
|
+
│ ├── Colors: Muted, earthy, sophisticated
|
|
1062
|
+
│ ├── Type: Clean, readable, functional
|
|
1063
|
+
│ ├── Layout: Responsive, card-based, organized
|
|
1064
|
+
│ ├── Effects: Subtle, purposeful only
|
|
1065
|
+
│ └── Approach: Value-driven, transparent, sustainable
|
|
1066
|
+
│
|
|
1067
|
+
├── Gen X (42-57)
|
|
1068
|
+
│ ├── Colors: Professional, trusted, conservative
|
|
1069
|
+
│ ├── Type: Familiar, clear, no-nonsense
|
|
1070
|
+
│ ├── Layout: Traditional hierarchy, predictable
|
|
1071
|
+
│ ├── Effects: Minimal, functional feedback
|
|
1072
|
+
│ └── Approach: Direct, efficient, reliable
|
|
1073
|
+
│
|
|
1074
|
+
├── Boomers (58+)
|
|
1075
|
+
│ ├── Colors: High contrast, simple, clear
|
|
1076
|
+
│ ├── Type: Large sizes, high readability
|
|
1077
|
+
│ ├── Layout: Simple, linear, uncluttered
|
|
1078
|
+
│ ├── Effects: None or very minimal
|
|
1079
|
+
│ └── Approach: Clear, detailed, trustworthy
|
|
1080
|
+
│
|
|
1081
|
+
└── B2B / Enterprise
|
|
1082
|
+
├── Colors: Professional palette, muted
|
|
1083
|
+
├── Type: Clean, data-friendly, scannable
|
|
1084
|
+
├── Layout: Grid-based, organized, efficient
|
|
1085
|
+
├── Effects: Professional, subtle
|
|
1086
|
+
└── Approach: Expert, solution-focused, ROI-driven
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
---
|
|
1090
|
+
|
|
1091
|
+
## 3. Color Selection Decision Tree
|
|
1092
|
+
|
|
1093
|
+
### Instead of fixed hex codes, use this process:
|
|
1094
|
+
|
|
1095
|
+
```
|
|
1096
|
+
WHAT EMOTION/ACTION DO YOU WANT?
|
|
1097
|
+
│
|
|
1098
|
+
├── Trust & Security
|
|
1099
|
+
│ └── Consider: Blue family, professional neutrals
|
|
1100
|
+
│ → ASK user for specific shade preference
|
|
1101
|
+
│
|
|
1102
|
+
├── Growth & Health
|
|
1103
|
+
│ └── Consider: Green family, natural tones
|
|
1104
|
+
│ → ASK user if eco/nature/wellness focus
|
|
1105
|
+
│
|
|
1106
|
+
├── Urgency & Action
|
|
1107
|
+
│ └── Consider: Warm colors (orange/red) as ACCENTS
|
|
1108
|
+
│ → Use sparingly, ASK if appropriate
|
|
1109
|
+
│
|
|
1110
|
+
├── Luxury & Premium
|
|
1111
|
+
│ └── Consider: Deep darks, metallics, restrained palette
|
|
1112
|
+
│ → ASK about brand positioning
|
|
1113
|
+
│
|
|
1114
|
+
├── Creative & Playful
|
|
1115
|
+
│ └── Consider: Multi-color, unexpected combinations
|
|
1116
|
+
│ → ASK about brand personality
|
|
1117
|
+
│
|
|
1118
|
+
└── Calm & Minimal
|
|
1119
|
+
└── Consider: Neutrals with single accent
|
|
1120
|
+
→ ASK what accent color fits brand
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
### The Process:
|
|
1124
|
+
1. Identify the emotion needed
|
|
1125
|
+
2. Narrow to color FAMILY
|
|
1126
|
+
3. ASK user for preference within family
|
|
1127
|
+
4. Generate fresh palette using HSL principles
|
|
1128
|
+
|
|
1129
|
+
---
|
|
1130
|
+
|
|
1131
|
+
## 4. Typography Decision Tree
|
|
1132
|
+
|
|
1133
|
+
```
|
|
1134
|
+
WHAT'S THE CONTENT TYPE?
|
|
1135
|
+
│
|
|
1136
|
+
├── Data-Heavy (Dashboard, SaaS)
|
|
1137
|
+
│ ├── Style: Sans-serif, clear, compact
|
|
1138
|
+
│ ├── Scale: Tighter ratio (1.125-1.2)
|
|
1139
|
+
│ └── Priority: Scannability, density
|
|
1140
|
+
│
|
|
1141
|
+
├── Editorial (Blog, Magazine)
|
|
1142
|
+
│ ├── Style: Serif heading + Sans body works well
|
|
1143
|
+
│ ├── Scale: More dramatic (1.333+)
|
|
1144
|
+
│ └── Priority: Reading comfort, hierarchy
|
|
1145
|
+
│
|
|
1146
|
+
├── Modern Tech (Startup, SaaS Marketing)
|
|
1147
|
+
│ ├── Style: Geometric or humanist sans
|
|
1148
|
+
│ ├── Scale: Balanced (1.25)
|
|
1149
|
+
│ └── Priority: Modern feel, clarity
|
|
1150
|
+
│
|
|
1151
|
+
├── Luxury (Fashion, Premium)
|
|
1152
|
+
│ ├── Style: Elegant serif or thin sans
|
|
1153
|
+
│ ├── Scale: Dramatic (1.5-1.618)
|
|
1154
|
+
│ └── Priority: Sophistication, whitespace
|
|
1155
|
+
│
|
|
1156
|
+
└── Playful (Kids, Games, Casual)
|
|
1157
|
+
├── Style: Rounded, friendly fonts
|
|
1158
|
+
├── Scale: Varied, expressive
|
|
1159
|
+
└── Priority: Fun, approachable, readable
|
|
1160
|
+
```
|
|
1161
|
+
|
|
1162
|
+
### Selection Process:
|
|
1163
|
+
1. Identify content type
|
|
1164
|
+
2. Choose style DIRECTION
|
|
1165
|
+
3. ASK user if they have brand fonts
|
|
1166
|
+
4. Select fonts that match direction
|
|
1167
|
+
|
|
1168
|
+
---
|
|
1169
|
+
|
|
1170
|
+
## 5. E-commerce Guidelines {#e-commerce}
|
|
1171
|
+
|
|
1172
|
+
### Key Principles (Not Fixed Rules)
|
|
1173
|
+
- **Trust first:** How will you show security?
|
|
1174
|
+
- **Action-oriented:** Where are the CTAs?
|
|
1175
|
+
- **Scannable:** Can users compare quickly?
|
|
1176
|
+
|
|
1177
|
+
### Color Thinking:
|
|
1178
|
+
```
|
|
1179
|
+
E-commerce typically needs:
|
|
1180
|
+
├── Trust color (often blue family) → ASK preference
|
|
1181
|
+
├── Clean background (white/neutral) → depends on brand
|
|
1182
|
+
├── Action accent (for CTAs, sales) → depends on urgency level
|
|
1183
|
+
├── Success/error semantics → standard conventions work
|
|
1184
|
+
└── Brand integration → ASK about existing colors
|
|
1185
|
+
```
|
|
1186
|
+
|
|
1187
|
+
### Layout Principles:
|
|
1188
|
+
```
|
|
1189
|
+
┌────────────────────────────────────────────────────┐
|
|
1190
|
+
│ HEADER: Brand + Search + Cart │
|
|
1191
|
+
│ (Keep essential actions visible) │
|
|
1192
|
+
├────────────────────────────────────────────────────┤
|
|
1193
|
+
│ TRUST ZONE: Why trust this site? │
|
|
1194
|
+
│ (Shipping, returns, security - if applicable) │
|
|
1195
|
+
├────────────────────────────────────────────────────┤
|
|
1196
|
+
│ HERO: Primary message or offer │
|
|
1197
|
+
│ (Clear CTA, single focus) │
|
|
1198
|
+
├────────────────────────────────────────────────────┤
|
|
1199
|
+
│ CATEGORIES: Easy navigation │
|
|
1200
|
+
│ (Visual, filterable, scannable) │
|
|
1201
|
+
├────────────────────────────────────────────────────┤
|
|
1202
|
+
│ PRODUCTS: Easy comparison │
|
|
1203
|
+
│ (Price, rating, quick actions visible) │
|
|
1204
|
+
├────────────────────────────────────────────────────┤
|
|
1205
|
+
│ SOCIAL PROOF: Why others trust │
|
|
1206
|
+
│ (Reviews, testimonials - if available) │
|
|
1207
|
+
├────────────────────────────────────────────────────┤
|
|
1208
|
+
│ FOOTER: All the details │
|
|
1209
|
+
│ (Policies, contact, trust badges) │
|
|
1210
|
+
└────────────────────────────────────────────────────┘
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
### Psychology to Apply:
|
|
1214
|
+
- Hick's Law: Limit navigation choices
|
|
1215
|
+
- Fitts' Law: Size CTAs appropriately
|
|
1216
|
+
- Social proof: Show where relevant
|
|
1217
|
+
- Scarcity: Use honestly if at all
|
|
1218
|
+
|
|
1219
|
+
---
|
|
1220
|
+
|
|
1221
|
+
## 6. SaaS Dashboard Guidelines {#saas}
|
|
1222
|
+
|
|
1223
|
+
### Key Principles
|
|
1224
|
+
- **Functional first:** Data clarity over decoration
|
|
1225
|
+
- **Calm UI:** Reduce cognitive load
|
|
1226
|
+
- **Consistent:** Predictable patterns
|
|
1227
|
+
|
|
1228
|
+
### Color Thinking:
|
|
1229
|
+
```
|
|
1230
|
+
Dashboard typically needs:
|
|
1231
|
+
├── Background: Light OR dark (ASK preference)
|
|
1232
|
+
├── Surface: Slight contrast from background
|
|
1233
|
+
├── Primary accent: For key actions
|
|
1234
|
+
├── Data colors: Success/warning/danger semantics
|
|
1235
|
+
└── Muted: For secondary information
|
|
1236
|
+
```
|
|
1237
|
+
|
|
1238
|
+
### Layout Principles:
|
|
1239
|
+
```
|
|
1240
|
+
Consider these patterns (not mandated):
|
|
1241
|
+
|
|
1242
|
+
OPTION A: Sidebar + Content
|
|
1243
|
+
├── Fixed sidebar for navigation
|
|
1244
|
+
└── Main area for content
|
|
1245
|
+
|
|
1246
|
+
OPTION B: Top nav + Content
|
|
1247
|
+
├── Horizontal navigation
|
|
1248
|
+
└── More horizontal content space
|
|
1249
|
+
|
|
1250
|
+
OPTION C: Collapsed + Expandable
|
|
1251
|
+
├── Icon-only sidebar expands
|
|
1252
|
+
└── Maximum content area
|
|
1253
|
+
|
|
1254
|
+
→ ASK user about their navigation preference
|
|
1255
|
+
```
|
|
1256
|
+
|
|
1257
|
+
### Psychology to Apply:
|
|
1258
|
+
- Hick's Law: Group navigation items
|
|
1259
|
+
- Miller's Law: Chunk information
|
|
1260
|
+
- Cognitive Load: Whitespace, consistency
|
|
1261
|
+
|
|
1262
|
+
---
|
|
1263
|
+
|
|
1264
|
+
## 7. Landing Page Guidelines {#landing-page}
|
|
1265
|
+
|
|
1266
|
+
### Key Principles
|
|
1267
|
+
- **Hero-centric:** First impression matters most
|
|
1268
|
+
- **Single focus:** One primary CTA
|
|
1269
|
+
- **Emotional:** Connect before selling
|
|
1270
|
+
|
|
1271
|
+
### Color Thinking:
|
|
1272
|
+
```
|
|
1273
|
+
Landing page typically needs:
|
|
1274
|
+
├── Brand primary: Hero background or accent
|
|
1275
|
+
├── Clean secondary: Most of page
|
|
1276
|
+
├── CTA color: Stands out from everything
|
|
1277
|
+
├── Supporting: For sections, testimonials
|
|
1278
|
+
└── ASK about brand colors first!
|
|
1279
|
+
```
|
|
1280
|
+
|
|
1281
|
+
### Structure Principles:
|
|
1282
|
+
```
|
|
1283
|
+
┌────────────────────────────────────────────────────┐
|
|
1284
|
+
│ Navigation: Minimal, CTA visible │
|
|
1285
|
+
├────────────────────────────────────────────────────┤
|
|
1286
|
+
│ HERO: Hook + Value + CTA │
|
|
1287
|
+
│ (Most important section, biggest impact) │
|
|
1288
|
+
├────────────────────────────────────────────────────┤
|
|
1289
|
+
│ PROBLEM: What pain do they have? │
|
|
1290
|
+
├────────────────────────────────────────────────────┤
|
|
1291
|
+
│ SOLUTION: How you solve it │
|
|
1292
|
+
├────────────────────────────────────────────────────┤
|
|
1293
|
+
│ PROOF: Why believe you? │
|
|
1294
|
+
│ (Testimonials, logos, stats) │
|
|
1295
|
+
├────────────────────────────────────────────────────┤
|
|
1296
|
+
│ HOW: Simple explanation of process │
|
|
1297
|
+
├────────────────────────────────────────────────────┤
|
|
1298
|
+
│ PRICING: If applicable │
|
|
1299
|
+
├────────────────────────────────────────────────────┤
|
|
1300
|
+
│ FAQ: Address objections │
|
|
1301
|
+
├────────────────────────────────────────────────────┤
|
|
1302
|
+
│ FINAL CTA: Repeat main action │
|
|
1303
|
+
└────────────────────────────────────────────────────┘
|
|
1304
|
+
```
|
|
1305
|
+
|
|
1306
|
+
### Psychology to Apply:
|
|
1307
|
+
- Visceral: Beautiful hero impression
|
|
1308
|
+
- Serial Position: Key info top/bottom
|
|
1309
|
+
- Social Proof: Testimonials work
|
|
1310
|
+
|
|
1311
|
+
---
|
|
1312
|
+
|
|
1313
|
+
## 8. Portfolio Guidelines {#portfolio}
|
|
1314
|
+
|
|
1315
|
+
### Key Principles
|
|
1316
|
+
- **Personality:** Show who you are
|
|
1317
|
+
- **Work-focused:** Let projects speak
|
|
1318
|
+
- **Memorable:** Stand out from templates
|
|
1319
|
+
|
|
1320
|
+
### Color Thinking:
|
|
1321
|
+
```
|
|
1322
|
+
Portfolio is personal - many options:
|
|
1323
|
+
├── Minimal: Neutrals + one signature accent
|
|
1324
|
+
├── Bold: Unexpected color choices
|
|
1325
|
+
├── Dark: Moody, artistic feel
|
|
1326
|
+
├── Light: Clean, professional feel
|
|
1327
|
+
└── ASK about personal brand identity!
|
|
1328
|
+
```
|
|
1329
|
+
|
|
1330
|
+
### Structure Principles:
|
|
1331
|
+
```
|
|
1332
|
+
┌────────────────────────────────────────────────────┐
|
|
1333
|
+
│ Navigation: Unique to your personality │
|
|
1334
|
+
├────────────────────────────────────────────────────┤
|
|
1335
|
+
│ INTRO: Who you are, what you do │
|
|
1336
|
+
│ (Make it memorable, not generic) │
|
|
1337
|
+
├────────────────────────────────────────────────────┤
|
|
1338
|
+
│ WORK: Featured projects │
|
|
1339
|
+
│ (Large, visual, interactive) │
|
|
1340
|
+
├────────────────────────────────────────────────────┤
|
|
1341
|
+
│ ABOUT: Personal story │
|
|
1342
|
+
│ (Creates connection) │
|
|
1343
|
+
├────────────────────────────────────────────────────┤
|
|
1344
|
+
│ CONTACT: Easy to reach │
|
|
1345
|
+
│ (Clear, direct) │
|
|
1346
|
+
└────────────────────────────────────────────────────┘
|
|
1347
|
+
```
|
|
1348
|
+
|
|
1349
|
+
### Psychology to Apply:
|
|
1350
|
+
- Von Restorff: Be uniquely memorable
|
|
1351
|
+
- Reflective: Personal story creates connection
|
|
1352
|
+
- Emotional: Personality over professionalism
|
|
1353
|
+
|
|
1354
|
+
---
|
|
1355
|
+
|
|
1356
|
+
## 9. Pre-Design Checklists
|
|
1357
|
+
|
|
1358
|
+
### Before Starting ANY Design
|
|
1359
|
+
|
|
1360
|
+
- [ ] **Audience defined?** (who exactly)
|
|
1361
|
+
- [ ] **Primary goal identified?** (what action)
|
|
1362
|
+
- [ ] **Constraints known?** (time, brand, tech)
|
|
1363
|
+
- [ ] **Content available?** (or placeholders needed)
|
|
1364
|
+
- [ ] **User preferences asked?** (colors, style, layout)
|
|
1365
|
+
|
|
1366
|
+
### Before Choosing Colors
|
|
1367
|
+
|
|
1368
|
+
- [ ] **Asked user preference?**
|
|
1369
|
+
- [ ] **Considered context?** (industry, emotion)
|
|
1370
|
+
- [ ] **Different from your default?**
|
|
1371
|
+
- [ ] **Checked accessibility?**
|
|
1372
|
+
|
|
1373
|
+
### Before Finalizing Layout
|
|
1374
|
+
|
|
1375
|
+
- [ ] **Hierarchy clear?**
|
|
1376
|
+
- [ ] **Primary CTA obvious?**
|
|
1377
|
+
- [ ] **Mobile considered?**
|
|
1378
|
+
- [ ] **Content fits structure?**
|
|
1379
|
+
|
|
1380
|
+
### Before Delivery
|
|
1381
|
+
|
|
1382
|
+
- [ ] **Looks premium, not generic?**
|
|
1383
|
+
- [ ] **Would you be proud of this?**
|
|
1384
|
+
- [ ] **Different from last project?**
|
|
1385
|
+
|
|
1386
|
+
---
|
|
1387
|
+
|
|
1388
|
+
## 10. Complexity Estimation
|
|
1389
|
+
|
|
1390
|
+
### Quick Projects (Hours)
|
|
1391
|
+
```
|
|
1392
|
+
Simple landing page
|
|
1393
|
+
Small portfolio
|
|
1394
|
+
Basic form
|
|
1395
|
+
Single component
|
|
1396
|
+
```
|
|
1397
|
+
→ Approach: Minimal decisions, focused execution
|
|
1398
|
+
|
|
1399
|
+
### Medium Projects (Days)
|
|
1400
|
+
```
|
|
1401
|
+
Multi-page site
|
|
1402
|
+
Dashboard with modules
|
|
1403
|
+
E-commerce category
|
|
1404
|
+
Complex forms
|
|
1405
|
+
```
|
|
1406
|
+
→ Approach: Establish tokens, custom components
|
|
1407
|
+
|
|
1408
|
+
### Large Projects (Weeks)
|
|
1409
|
+
```
|
|
1410
|
+
Full SaaS application
|
|
1411
|
+
E-commerce platform
|
|
1412
|
+
Custom design system
|
|
1413
|
+
Complex workflows
|
|
1414
|
+
```
|
|
1415
|
+
→ Approach: Full design system, documentation, testing
|
|
1416
|
+
|
|
1417
|
+
---
|
|
1418
|
+
|
|
1419
|
+
> **Remember**: These templates show STRUCTURE and THINKING process. Every project needs fresh color, typography, and styling decisions based on its unique context. ASK when unclear.
|
|
1420
|
+
|
|
1421
|
+
---
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
---
|
|
1426
|
+
|
|
1427
|
+
## 🔗 Related
|
|
1428
|
+
|
|
1429
|
+
| File | When to Read |
|
|
1430
|
+
|------|-------------|
|
|
1431
|
+
| [ux-psychology.md](ux-psychology.md) | UX laws applied in each template |
|
|
1432
|
+
| [color-system.md](color-system.md) | HSL palette generation after color decision |
|
|
1433
|
+
| [typography-system.md](typography-system.md) | Font selection after type decision |
|
|
1434
|
+
| [../SKILL.md](../SKILL.md) | Anti-pattern bans and quick reference |
|
|
1435
|
+
|
|
1436
|
+
---
|
|
1437
|
+
|
|
1438
|
+
### Rule: design-extraction
|
|
1439
|
+
|
|
1440
|
+
---
|
|
1441
|
+
name: design-extraction
|
|
1442
|
+
description: Screenshot analysis process — 4-step extract-document-implement-verify workflow
|
|
1443
|
+
---
|
|
1444
|
+
|
|
1445
|
+
# Design Extraction from Screenshots
|
|
1446
|
+
|
|
1447
|
+
> Never jump straight to code. Analyze first.
|
|
1448
|
+
|
|
1449
|
+
---
|
|
1450
|
+
|
|
1451
|
+
## Extraction Process
|
|
1452
|
+
|
|
1453
|
+
```
|
|
1454
|
+
Screenshot → Analyze → Document → Implement → Verify
|
|
1455
|
+
```
|
|
1456
|
+
|
|
1457
|
+
### Step 1: Analyze Screenshot
|
|
1458
|
+
|
|
1459
|
+
Extract these elements:
|
|
1460
|
+
|
|
1461
|
+
| Category | What to Extract |
|
|
1462
|
+
|----------|-----------------|
|
|
1463
|
+
| **Colors** | All hex codes (primary, accent, neutral, background) |
|
|
1464
|
+
| **Typography** | Font families, sizes, weights, line-heights |
|
|
1465
|
+
| **Spacing** | Margin/padding patterns, spacing scale |
|
|
1466
|
+
| **Layout** | Grid structure, flexbox patterns, positioning |
|
|
1467
|
+
| **Components** | Button styles, card styles, form elements |
|
|
1468
|
+
| **Visual** | Shadows, borders, gradients, textures |
|
|
1469
|
+
|
|
1470
|
+
---
|
|
1471
|
+
|
|
1472
|
+
### Step 2: Document Findings
|
|
1473
|
+
|
|
1474
|
+
Create `design-guidelines.md`:
|
|
1475
|
+
|
|
1476
|
+
```markdown
|
|
1477
|
+
# Extracted Design System
|
|
1478
|
+
|
|
1479
|
+
## Colors
|
|
1480
|
+
- Primary: #2D3748
|
|
1481
|
+
- Accent: #ED8936
|
|
1482
|
+
- Background: #F7FAFC
|
|
1483
|
+
- Text: #1A202C
|
|
1484
|
+
|
|
1485
|
+
## Typography
|
|
1486
|
+
### Headings
|
|
1487
|
+
- Font: Playfair Display
|
|
1488
|
+
- Sizes: 48px (h1), 32px (h2), 24px (h3)
|
|
1489
|
+
- Weight: 700
|
|
1490
|
+
- Line-height: 1.2
|
|
1491
|
+
|
|
1492
|
+
### Body
|
|
1493
|
+
- Font: Source Sans Pro
|
|
1494
|
+
- Size: 16px
|
|
1495
|
+
- Weight: 400
|
|
1496
|
+
- Line-height: 1.6
|
|
1497
|
+
|
|
1498
|
+
## Spacing Scale
|
|
1499
|
+
- xs: 4px
|
|
1500
|
+
- sm: 8px
|
|
1501
|
+
- md: 16px
|
|
1502
|
+
- lg: 24px
|
|
1503
|
+
- xl: 32px
|
|
1504
|
+
- 2xl: 48px
|
|
1505
|
+
|
|
1506
|
+
## Layout
|
|
1507
|
+
- Max width: 1200px
|
|
1508
|
+
- Grid: 12 columns
|
|
1509
|
+
- Gutter: 24px
|
|
1510
|
+
|
|
1511
|
+
## Components
|
|
1512
|
+
### Buttons
|
|
1513
|
+
- Padding: 12px 24px
|
|
1514
|
+
- Border-radius: 8px
|
|
1515
|
+
- Font-weight: 600
|
|
1516
|
+
```
|
|
1517
|
+
|
|
1518
|
+
---
|
|
1519
|
+
|
|
1520
|
+
### Step 3: Implement with Precision
|
|
1521
|
+
|
|
1522
|
+
```css
|
|
1523
|
+
/* Match EXACT specifications */
|
|
1524
|
+
:root {
|
|
1525
|
+
--color-primary: #2D3748;
|
|
1526
|
+
--color-accent: #ED8936;
|
|
1527
|
+
--color-background: #F7FAFC;
|
|
1528
|
+
|
|
1529
|
+
--font-heading: 'Playfair Display', serif;
|
|
1530
|
+
--font-body: 'Source Sans Pro', sans-serif;
|
|
1531
|
+
|
|
1532
|
+
--space-xs: 4px;
|
|
1533
|
+
--space-sm: 8px;
|
|
1534
|
+
--space-md: 16px;
|
|
1535
|
+
--space-lg: 24px;
|
|
1536
|
+
--space-xl: 32px;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.heading {
|
|
1540
|
+
font-family: var(--font-heading);
|
|
1541
|
+
font-size: 48px;
|
|
1542
|
+
font-weight: 700;
|
|
1543
|
+
line-height: 1.2;
|
|
1544
|
+
color: var(--color-primary);
|
|
1545
|
+
}
|
|
1546
|
+
```
|
|
1547
|
+
|
|
1548
|
+
---
|
|
1549
|
+
|
|
1550
|
+
### Step 4: Verify Quality
|
|
1551
|
+
|
|
1552
|
+
Compare implementation to original:
|
|
1553
|
+
|
|
1554
|
+
| Check | Criteria |
|
|
1555
|
+
|-------|----------|
|
|
1556
|
+
| **Colors** | Exact hex match |
|
|
1557
|
+
| **Typography** | Font, size, weight, line-height |
|
|
1558
|
+
| **Spacing** | Margins, padding consistent |
|
|
1559
|
+
| **Layout** | Grid alignment, proportions |
|
|
1560
|
+
| **Components** | Visual identical |
|
|
1561
|
+
| **Responsiveness** | Same breakpoint behavior |
|
|
1562
|
+
|
|
1563
|
+
---
|
|
1564
|
+
|
|
1565
|
+
## Common Extraction Mistakes
|
|
1566
|
+
|
|
1567
|
+
| ❌ Mistake | ✅ Fix |
|
|
1568
|
+
|-----------|-------|
|
|
1569
|
+
| Guessing colors | Use eyedropper tool |
|
|
1570
|
+
| Assuming fonts | Identify with WhatFont |
|
|
1571
|
+
| Ignoring spacing | Measure precisely |
|
|
1572
|
+
| Skipping small details | Note every shadow, border |
|
|
1573
|
+
| One-off extraction | Create reusable system |
|
|
1574
|
+
|
|
1575
|
+
---
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
---
|
|
1580
|
+
|
|
1581
|
+
## 🔗 Related
|
|
1582
|
+
|
|
1583
|
+
| File | When to Read |
|
|
1584
|
+
|------|-------------|
|
|
1585
|
+
| [color-systems.md](color-systems.md) | Extracted color systematization |
|
|
1586
|
+
| [typography.md](typography.md) | Identify extracted font pairings |
|
|
1587
|
+
| [../SKILL.md](../SKILL.md) | Workflow 1: From Screenshots |
|
|
1588
|
+
|
|
1589
|
+
---
|
|
1590
|
+
|
|
1591
|
+
### Rule: engineering-spec
|
|
1592
|
+
|
|
1593
|
+
---
|
|
1594
|
+
name: frontend-design-engineering-spec
|
|
1595
|
+
description: Full 21-section engineering spec — contracts, anti-slop enforcement, compliance matrix, production checklist
|
|
1596
|
+
---
|
|
1597
|
+
|
|
1598
|
+
# Frontend Design — Engineering Specification
|
|
1599
|
+
|
|
1600
|
+
> Production-grade specification for distinctive frontend interface design decisions at FAANG scale.
|
|
1601
|
+
|
|
1602
|
+
---
|
|
1603
|
+
|
|
1604
|
+
## 1. Overview
|
|
1605
|
+
|
|
1606
|
+
Frontend Design provides structured decision frameworks for creating distinctive, production-grade web interfaces: aesthetic direction selection (5 styles), anti-AI-slop enforcement, design extraction from screenshots, typography pairing, color system commitment, and motion orchestration. The skill operates as an expert knowledge base with 5 reference files — it produces design direction decisions, aesthetic specifications, and implementation guidance. It does not write CSS, create components, or render UI.
|
|
1607
|
+
|
|
1608
|
+
**Contract Version:** 2.0.0
|
|
1609
|
+
**Backward Compatibility:** breaking (first hardened version)
|
|
1610
|
+
**Breaking Changes:** None — new spec for first hardening
|
|
1611
|
+
|
|
1612
|
+
---
|
|
1613
|
+
|
|
1614
|
+
## 2. Problem Statement
|
|
1615
|
+
|
|
1616
|
+
Frontend design at scale faces four quantified problems:
|
|
1617
|
+
|
|
1618
|
+
| Problem | Measurement | Impact |
|
|
1619
|
+
|---------|-------------|--------|
|
|
1620
|
+
| Generic AI-generated UIs | 75% of AI-built interfaces use Inter + purple gradient + bento grid | Indistinguishable products |
|
|
1621
|
+
| Timid color choices | 60% of projects use safe, muted palettes | No visual identity |
|
|
1622
|
+
| Scattered animations | 45% of motion has no choreographic purpose | Visual noise, performance cost |
|
|
1623
|
+
| Layout conformity | 70% of layouts follow identical card-grid patterns | No design differentiation |
|
|
1624
|
+
|
|
1625
|
+
Frontend Design eliminates these with bold aesthetic direction commitment, anti-AI-slop rules, and intentional design decisions.
|
|
1626
|
+
|
|
1627
|
+
---
|
|
1628
|
+
|
|
1629
|
+
## 3. Design Goals
|
|
1630
|
+
|
|
1631
|
+
| ID | Goal | Measurable Constraint |
|
|
1632
|
+
|----|------|-----------------------|
|
|
1633
|
+
| G1 | Distinctive aesthetics | 1 of 5 committed directions; no "safe middle" |
|
|
1634
|
+
| G2 | Anti-AI-slop | No generic fonts (Inter/Roboto alone), no pure RGB, no basic shadows |
|
|
1635
|
+
| G3 | Bold typography | Display font + body font pairing; heading ≥ 48px |
|
|
1636
|
+
| G4 | Committed color | Dominant primary + sharp accent; no more than 3 brand colors |
|
|
1637
|
+
| G5 | Orchestrated motion | Single entrance sequence with staggered timing |
|
|
1638
|
+
| G6 | Faithful reproduction | Screenshot → implementation match ≥ 95% accuracy |
|
|
1639
|
+
|
|
1640
|
+
---
|
|
1641
|
+
|
|
1642
|
+
## 4. Non-Goals
|
|
1643
|
+
|
|
1644
|
+
| ID | Excluded | Rationale |
|
|
1645
|
+
|----|----------|-----------|
|
|
1646
|
+
| NG1 | CSS/Tailwind code generation | Owned by `tailwind-kit` / caller |
|
|
1647
|
+
| NG2 | Design token systems | Owned by `design-system` skill |
|
|
1648
|
+
| NG3 | AI-powered style search | Owned by `studio` skill |
|
|
1649
|
+
| NG4 | Asset/image generation | Owned by `ai-artist` skill |
|
|
1650
|
+
| NG5 | Component architecture | Framework-specific concern |
|
|
1651
|
+
| NG6 | WCAG accessibility | Owned by `web-design-guidelines` skill |
|
|
1652
|
+
|
|
1653
|
+
---
|
|
1654
|
+
|
|
1655
|
+
## 5. System Boundaries
|
|
1656
|
+
|
|
1657
|
+
| Boundary | Owned | Not Owned |
|
|
1658
|
+
|----------|-------|-----------|
|
|
1659
|
+
| Aesthetic direction selection (5 styles) | Decision framework | CSS implementation |
|
|
1660
|
+
| Anti-AI-slop enforcement (4 banned patterns) | Ban list and alternatives | Automated linting |
|
|
1661
|
+
| Design extraction from screenshots | Extraction process (4 steps) | Screenshot capture |
|
|
1662
|
+
| Typography pairing guidance | Font pair selection, sizing rules | Font loading |
|
|
1663
|
+
| Color system commitment | Palette strategy (dominant + accent) | CSS custom properties |
|
|
1664
|
+
| Motion orchestration | Choreography patterns | Animation library code |
|
|
1665
|
+
|
|
1666
|
+
**Side-effect boundary:** Frontend Design produces design decisions, aesthetic guidelines, and implementation specifications. It does not create files, write CSS, or render components.
|
|
1667
|
+
|
|
1668
|
+
---
|
|
1669
|
+
|
|
1670
|
+
## 6. Integration Model
|
|
1671
|
+
|
|
1672
|
+
### 6.1 Agent Contract
|
|
1673
|
+
|
|
1674
|
+
#### Input Schema
|
|
1675
|
+
|
|
1676
|
+
```
|
|
1677
|
+
Request_Type: string # "aesthetic-direction" | "screenshot-extract" | "typography-guide" |
|
|
1678
|
+
# "color-system" | "motion-guide" | "anti-slop-check" |
|
|
1679
|
+
# "full-design-spec"
|
|
1680
|
+
Context: {
|
|
1681
|
+
project_type: string # "landing-page" | "dashboard" | "e-commerce" | "saas" | "portfolio"
|
|
1682
|
+
brand_tone: string # "bold" | "minimal" | "editorial" | "retro" | "organic" | "industrial"
|
|
1683
|
+
screenshot_url: string | null # URL or path to screenshot for extraction
|
|
1684
|
+
existing_fonts: Array<string> | null # Already committed fonts
|
|
1685
|
+
existing_colors: Array<string> | null # Already committed hex values
|
|
1686
|
+
content_type: string | null # "text-heavy" | "data-heavy" | "media-heavy" | "mixed"
|
|
1687
|
+
}
|
|
1688
|
+
contract_version: string # "2.0.0"
|
|
1689
|
+
```
|
|
1690
|
+
|
|
1691
|
+
#### Output Schema
|
|
1692
|
+
|
|
1693
|
+
```
|
|
1694
|
+
Status: "success" | "violations" | "error"
|
|
1695
|
+
Data: {
|
|
1696
|
+
aesthetic: {
|
|
1697
|
+
direction: string # "brutally-minimal" | "editorial-magazine" |
|
|
1698
|
+
# "retro-futuristic" | "organic-natural" | "industrial-utilitarian"
|
|
1699
|
+
description: string
|
|
1700
|
+
key_traits: Array<string>
|
|
1701
|
+
} | null
|
|
1702
|
+
extraction: {
|
|
1703
|
+
colors: Array<string> # Hex values extracted
|
|
1704
|
+
fonts: Array<string> # Identified font families
|
|
1705
|
+
spacing: string # Spacing system description
|
|
1706
|
+
layout: string # Layout structure description
|
|
1707
|
+
} | null
|
|
1708
|
+
typography: {
|
|
1709
|
+
display_font: string # Recommended display font
|
|
1710
|
+
body_font: string # Recommended body font
|
|
1711
|
+
min_heading_size: string # e.g., "clamp(48px, 8vw, 120px)"
|
|
1712
|
+
line_height: number # e.g., 0.95 for headings
|
|
1713
|
+
} | null
|
|
1714
|
+
color: {
|
|
1715
|
+
dominant: string # Primary color hex
|
|
1716
|
+
accent: string # Accent color hex
|
|
1717
|
+
neutral: string # Neutral color hex
|
|
1718
|
+
max_brand_colors: number # Always 3
|
|
1719
|
+
} | null
|
|
1720
|
+
motion: {
|
|
1721
|
+
pattern: string # "staggered-entrance" | "scroll-reveal" | "orchestrated-sequence"
|
|
1722
|
+
duration_ms: number # Base duration
|
|
1723
|
+
stagger_ms: number # Delay between elements
|
|
1724
|
+
} | null
|
|
1725
|
+
anti_slop_violations: Array<{
|
|
1726
|
+
pattern: string
|
|
1727
|
+
alternative: string
|
|
1728
|
+
}> | null
|
|
1729
|
+
reference_file: string | null
|
|
1730
|
+
metadata: {
|
|
1731
|
+
contract_version: string
|
|
1732
|
+
backward_compatibility: string
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
Error: ErrorSchema | null
|
|
1736
|
+
```
|
|
1737
|
+
|
|
1738
|
+
#### Error Schema
|
|
1739
|
+
|
|
1740
|
+
```
|
|
1741
|
+
Code: string # From Error Taxonomy (Section 11)
|
|
1742
|
+
Message: string
|
|
1743
|
+
Request_Type: string
|
|
1744
|
+
Recoverable: boolean
|
|
1745
|
+
```
|
|
1746
|
+
|
|
1747
|
+
#### Deterministic Guarantees
|
|
1748
|
+
|
|
1749
|
+
- Same `brand_tone` = same aesthetic direction.
|
|
1750
|
+
- Aesthetic selection is deterministic: tone → direction mapping is fixed.
|
|
1751
|
+
- Anti-slop check uses fixed 4-ban list (generic fonts, pure RGB, basic shadows, scattered micro-interactions).
|
|
1752
|
+
- Typography always pairs display + body font; heading minimum 48px.
|
|
1753
|
+
- Color system always limits to 3 brand colors (dominant + accent + neutral).
|
|
1754
|
+
- Motion always uses one orchestrated entrance pattern.
|
|
1755
|
+
|
|
1756
|
+
#### What Agents May Assume
|
|
1757
|
+
|
|
1758
|
+
- Aesthetic direction is committed (no "safe middle" options).
|
|
1759
|
+
- Typography pairing is distinctive (not Inter/Roboto default).
|
|
1760
|
+
- Color palette includes dominant, accent, and neutral.
|
|
1761
|
+
- Anti-slop check covers all 4 banned AI patterns.
|
|
1762
|
+
|
|
1763
|
+
#### What Agents Must NOT Assume
|
|
1764
|
+
|
|
1765
|
+
- The skill generates CSS, HTML, or component code.
|
|
1766
|
+
- Font files are available or loaded.
|
|
1767
|
+
- Color values pass WCAG contrast requirements (→ web-design-guidelines).
|
|
1768
|
+
- The skill creates design system tokens (→ design-system).
|
|
1769
|
+
|
|
1770
|
+
#### Side-Effect Boundaries
|
|
1771
|
+
|
|
1772
|
+
| Operation | Side Effects |
|
|
1773
|
+
|-----------|-------------|
|
|
1774
|
+
| Aesthetic direction | None; decision output |
|
|
1775
|
+
| Screenshot extract | None; analysis output |
|
|
1776
|
+
| Typography guide | None; recommendation |
|
|
1777
|
+
| Color system | None; palette specification |
|
|
1778
|
+
| Motion guide | None; choreography recommendation |
|
|
1779
|
+
| Anti-slop check | None; violation list |
|
|
1780
|
+
|
|
1781
|
+
### 6.2 Workflow Contract
|
|
1782
|
+
|
|
1783
|
+
#### Workflow 1: From Screenshots
|
|
1784
|
+
|
|
1785
|
+
```
|
|
1786
|
+
1. Receive screenshot URL/path
|
|
1787
|
+
2. Invoke screenshot-extract to analyze design
|
|
1788
|
+
3. Document extracted specs (caller's responsibility)
|
|
1789
|
+
4. Implement matching design (caller's responsibility)
|
|
1790
|
+
5. Verify side-by-side (caller's responsibility)
|
|
1791
|
+
```
|
|
1792
|
+
|
|
1793
|
+
#### Workflow 2: From Scratch
|
|
1794
|
+
|
|
1795
|
+
```
|
|
1796
|
+
1. Define project type and brand tone
|
|
1797
|
+
2. Invoke aesthetic-direction for committed style
|
|
1798
|
+
3. Invoke typography-guide for font pairing
|
|
1799
|
+
4. Invoke color-system for palette
|
|
1800
|
+
5. Invoke motion-guide for choreography
|
|
1801
|
+
6. Invoke anti-slop-check to validate decisions
|
|
1802
|
+
7. Implement design (caller's responsibility)
|
|
1803
|
+
```
|
|
1804
|
+
|
|
1805
|
+
#### Execution Guarantees
|
|
1806
|
+
|
|
1807
|
+
- Each invocation produces a complete, self-contained recommendation.
|
|
1808
|
+
- Anti-slop check can be invoked at any point for validation.
|
|
1809
|
+
|
|
1810
|
+
#### Failure Propagation Model
|
|
1811
|
+
|
|
1812
|
+
| Failure Severity | Propagation | Workflow Action |
|
|
1813
|
+
|-----------------|-------------|-----------------|
|
|
1814
|
+
| Invalid request type | Return error to caller | Use supported type |
|
|
1815
|
+
| Missing brand tone | Return error to caller | Supply brand tone |
|
|
1816
|
+
| Anti-slop violation | Return violations status | Revise design choice |
|
|
1817
|
+
| Screenshot not found | Return error to caller | Supply valid screenshot |
|
|
1818
|
+
|
|
1819
|
+
#### Retry Boundaries
|
|
1820
|
+
|
|
1821
|
+
- Zero internal retries. Deterministic output.
|
|
1822
|
+
|
|
1823
|
+
#### Isolation Model
|
|
1824
|
+
|
|
1825
|
+
- Each invocation is stateless and independent.
|
|
1826
|
+
|
|
1827
|
+
#### Idempotency Expectations
|
|
1828
|
+
|
|
1829
|
+
| Operation | Idempotent | Notes |
|
|
1830
|
+
|-----------|-----------|-------|
|
|
1831
|
+
| Aesthetic direction | Yes | Same tone = same direction |
|
|
1832
|
+
| Screenshot extract | Yes | Same screenshot = same analysis |
|
|
1833
|
+
| Typography guide | Yes | Same context = same pairing |
|
|
1834
|
+
| Color system | Yes | Same context = same palette |
|
|
1835
|
+
| Motion guide | Yes | Same context = same choreography |
|
|
1836
|
+
| Anti-slop check | Yes | Same input = same violations |
|
|
1837
|
+
|
|
1838
|
+
---
|
|
1839
|
+
|
|
1840
|
+
## 7. Execution Model
|
|
1841
|
+
|
|
1842
|
+
### 3-Phase Lifecycle
|
|
1843
|
+
|
|
1844
|
+
| Phase | Action | Output |
|
|
1845
|
+
|-------|--------|--------|
|
|
1846
|
+
| **Parse** | Validate request type, brand tone, project type | Validated input or error |
|
|
1847
|
+
| **Evaluate** | Traverse aesthetic decision tree; check anti-slop bans | Design recommendation |
|
|
1848
|
+
| **Emit** | Return structured output with reference file link | Complete output schema |
|
|
1849
|
+
|
|
1850
|
+
All phases synchronous. No async pipeline.
|
|
1851
|
+
|
|
1852
|
+
---
|
|
1853
|
+
|
|
1854
|
+
## 8. Deterministic Design Principles
|
|
1855
|
+
|
|
1856
|
+
| Principle | Enforcement |
|
|
1857
|
+
|-----------|-------------|
|
|
1858
|
+
| Fixed aesthetic directions | 5 styles; no hybrid or "safe" options |
|
|
1859
|
+
| Fixed anti-slop bans | 4 bans: generic fonts, pure RGB, basic shadows, scattered motion |
|
|
1860
|
+
| Fixed typography minimum | Heading ≥ 48px; max 2 font families |
|
|
1861
|
+
| Fixed color limit | Max 3 brand colors (dominant + accent + neutral) |
|
|
1862
|
+
| Fixed motion rule | One orchestrated entrance; no scattered micro-interactions |
|
|
1863
|
+
| Bold commitment | Every decision demands a committed direction |
|
|
1864
|
+
| No external calls | All decisions based on embedded rules + reference files |
|
|
1865
|
+
|
|
1866
|
+
---
|
|
1867
|
+
|
|
1868
|
+
## 9. State & Idempotency Model
|
|
1869
|
+
|
|
1870
|
+
Stateless. Fully idempotent. No persistent state.
|
|
1871
|
+
|
|
1872
|
+
Each invocation produces an identical output for identical inputs. No design history, no accumulated preferences.
|
|
1873
|
+
|
|
1874
|
+
---
|
|
1875
|
+
|
|
1876
|
+
## 10. Failure Handling Strategy
|
|
1877
|
+
|
|
1878
|
+
| Failure Class | Behavior | Caller Recovery |
|
|
1879
|
+
|---------------|----------|-----------------|
|
|
1880
|
+
| Unknown request type | Return `ERR_INVALID_REQUEST_TYPE` | Use supported type |
|
|
1881
|
+
| Missing brand tone | Return `ERR_MISSING_BRAND_TONE` | Supply brand tone |
|
|
1882
|
+
| Missing project type | Return `ERR_MISSING_PROJECT_TYPE` | Supply project type |
|
|
1883
|
+
| Screenshot not found | Return `ERR_SCREENSHOT_NOT_FOUND` | Supply valid path |
|
|
1884
|
+
| Anti-slop violation | Return `WARN_AI_SLOP` with violations | Revise design |
|
|
1885
|
+
| Reference file missing | Return `ERR_REFERENCE_NOT_FOUND` | Verify installation |
|
|
1886
|
+
|
|
1887
|
+
**Invariant:** Every failure returns a structured error. No silent fallback to "safe" defaults.
|
|
1888
|
+
|
|
1889
|
+
---
|
|
1890
|
+
|
|
1891
|
+
## 11. Error Taxonomy
|
|
1892
|
+
|
|
1893
|
+
| Code | Category | Recoverable | Description |
|
|
1894
|
+
|------|----------|-------------|-------------|
|
|
1895
|
+
| `ERR_INVALID_REQUEST_TYPE` | Validation | No | Request type not supported |
|
|
1896
|
+
| `ERR_MISSING_BRAND_TONE` | Validation | Yes | Brand tone not provided |
|
|
1897
|
+
| `ERR_MISSING_PROJECT_TYPE` | Validation | Yes | Project type not provided |
|
|
1898
|
+
| `ERR_SCREENSHOT_NOT_FOUND` | Validation | Yes | Screenshot path invalid |
|
|
1899
|
+
| `ERR_REFERENCE_NOT_FOUND` | Infrastructure | No | Reference file missing |
|
|
1900
|
+
| `WARN_AI_SLOP` | Design | Yes | Generic AI pattern detected |
|
|
1901
|
+
|
|
1902
|
+
---
|
|
1903
|
+
|
|
1904
|
+
## 12. Timeout & Retry Policy
|
|
1905
|
+
|
|
1906
|
+
| Parameter | Default | Maximum | Rationale |
|
|
1907
|
+
|-----------|---------|---------|-----------|
|
|
1908
|
+
| Decision timeout | N/A | N/A | Synchronous; < 50ms |
|
|
1909
|
+
| Internal retries | Zero | Zero | Deterministic output |
|
|
1910
|
+
|
|
1911
|
+
---
|
|
1912
|
+
|
|
1913
|
+
## 13. Observability & Logging Schema
|
|
1914
|
+
|
|
1915
|
+
### Log Entry Format
|
|
1916
|
+
|
|
1917
|
+
```json
|
|
1918
|
+
{
|
|
1919
|
+
"trace_id": "uuid",
|
|
1920
|
+
"skill_name": "frontend-design",
|
|
1921
|
+
"contract_version": "2.0.0",
|
|
1922
|
+
"execution_id": "uuid",
|
|
1923
|
+
"timestamp": "ISO-8601",
|
|
1924
|
+
"request_type": "string",
|
|
1925
|
+
"brand_tone": "string|null",
|
|
1926
|
+
"aesthetic_direction": "string|null",
|
|
1927
|
+
"anti_slop_violations": "number",
|
|
1928
|
+
"status": "success|violations|error",
|
|
1929
|
+
"error_code": "string|null",
|
|
1930
|
+
"duration_ms": "number"
|
|
1931
|
+
}
|
|
1932
|
+
```
|
|
1933
|
+
|
|
1934
|
+
### Required Log Points
|
|
1935
|
+
|
|
1936
|
+
| Event | Log Level | Fields |
|
|
1937
|
+
|-------|-----------|--------|
|
|
1938
|
+
| Direction selected | INFO | aesthetic_direction, brand_tone |
|
|
1939
|
+
| Anti-slop violation | WARN | pattern, alternative |
|
|
1940
|
+
| Decision failed | ERROR | error_code, message |
|
|
1941
|
+
|
|
1942
|
+
### Metrics
|
|
1943
|
+
|
|
1944
|
+
| Metric | Type | Unit |
|
|
1945
|
+
|--------|------|------|
|
|
1946
|
+
| `frontenddesign.decision.duration` | Histogram | ms |
|
|
1947
|
+
| `frontenddesign.direction.selected` | Counter | per direction |
|
|
1948
|
+
| `frontenddesign.slop_violation.count` | Counter | per pattern |
|
|
1949
|
+
| `frontenddesign.request_type.distribution` | Counter | per type |
|
|
1950
|
+
|
|
1951
|
+
---
|
|
1952
|
+
|
|
1953
|
+
## 14. Security & Trust Model
|
|
1954
|
+
|
|
1955
|
+
### Data Handling
|
|
1956
|
+
|
|
1957
|
+
- Frontend Design does not access user data, credentials, or PII.
|
|
1958
|
+
- Screenshot paths are used for analysis guidance; no file access by this skill.
|
|
1959
|
+
- Color values and font names are treated as configuration data.
|
|
1960
|
+
|
|
1961
|
+
---
|
|
1962
|
+
|
|
1963
|
+
## 15. Scalability Model
|
|
1964
|
+
|
|
1965
|
+
| Dimension | Constraint | Mitigation |
|
|
1966
|
+
|-----------|-----------|------------|
|
|
1967
|
+
| Throughput | CPU-bound decision tree | < 50ms; scales linearly |
|
|
1968
|
+
| Concurrency | Stateless invocations | Unlimited parallel |
|
|
1969
|
+
| Reference storage | 5 files (~8 KB total) | Static; no growth |
|
|
1970
|
+
| Memory per invocation | < 1 MB | No accumulation |
|
|
1971
|
+
| Network | Zero network calls | No external dependency |
|
|
1972
|
+
|
|
1973
|
+
---
|
|
1974
|
+
|
|
1975
|
+
## 16. Concurrency Model
|
|
1976
|
+
|
|
1977
|
+
Fully parallel. No shared state. No coordination required.
|
|
1978
|
+
|
|
1979
|
+
---
|
|
1980
|
+
|
|
1981
|
+
## 17. Resource Lifecycle Management
|
|
1982
|
+
|
|
1983
|
+
All resources scoped to invocation. No persistent handles.
|
|
1984
|
+
|
|
1985
|
+
---
|
|
1986
|
+
|
|
1987
|
+
## 18. Performance Constraints
|
|
1988
|
+
|
|
1989
|
+
| Operation | P50 Target | P99 Target | Hard Limit |
|
|
1990
|
+
|-----------|-----------|-----------|------------|
|
|
1991
|
+
| Direction selection | < 5 ms | < 15 ms | 50 ms |
|
|
1992
|
+
| Full design spec | < 15 ms | < 40 ms | 100 ms |
|
|
1993
|
+
| Anti-slop check | < 3 ms | < 10 ms | 30 ms |
|
|
1994
|
+
| Output size | ≤ 1,000 chars | ≤ 3,000 chars | 5,000 chars |
|
|
1995
|
+
|
|
1996
|
+
---
|
|
1997
|
+
|
|
1998
|
+
## 19. Operational Risks
|
|
1999
|
+
|
|
2000
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
2001
|
+
|------|-----------|--------|------------|
|
|
2002
|
+
| Aesthetic direction too extreme | Low | Client rejection | 5 directions cover broad spectrum |
|
|
2003
|
+
| Anti-slop false positive | Medium | Blocks valid choices | 4 specific bans, not blanket rules |
|
|
2004
|
+
| Typography pairing mismatch | Low | Readability issues | Display + body pairing is well-established |
|
|
2005
|
+
| Color fails WCAG contrast | Medium | Accessibility violation | Downstream check by web-design-guidelines |
|
|
2006
|
+
| Screenshot extraction inaccurate | Medium | Wrong implementation | 4-step verification process |
|
|
2007
|
+
|
|
2008
|
+
---
|
|
2009
|
+
|
|
2010
|
+
## 20. Compliance with skill-design-guide.md
|
|
2011
|
+
|
|
2012
|
+
| Requirement | Status | Evidence |
|
|
2013
|
+
|-------------|--------|----------|
|
|
2014
|
+
| YAML frontmatter complete | ✅ | name, description, metadata with category, version, triggers, coordinates_with, success_metrics |
|
|
2015
|
+
| SKILL.md < 200 lines | ✅ | Entry point under 200 lines |
|
|
2016
|
+
| Prerequisites documented | ✅ | HTML/CSS/JS + optional skills |
|
|
2017
|
+
| When to Use section | ✅ | Workflow-based routing table |
|
|
2018
|
+
| Core content matches skill type | ✅ | Expert type: decision trees, aesthetic selection |
|
|
2019
|
+
| Troubleshooting section | ✅ | Anti-patterns table |
|
|
2020
|
+
| Related section | ✅ | Cross-links to design-system, studio, ai-artist |
|
|
2021
|
+
| Content Map for multi-file | ✅ | Links to 5 reference files + engineering-spec.md |
|
|
2022
|
+
| Contract versioning | ✅ | contract_version, backward_compatibility, breaking_changes |
|
|
2023
|
+
| Compliance matrix structured | ✅ | This table with ✅/❌ + evidence |
|
|
2024
|
+
|
|
2025
|
+
---
|
|
2026
|
+
|
|
2027
|
+
## 21. Production Readiness Checklist
|
|
2028
|
+
|
|
2029
|
+
| Category | Check | Status |
|
|
2030
|
+
|----------|-------|--------|
|
|
2031
|
+
| **Functionality** | 5 aesthetic directions with committed traits | ✅ |
|
|
2032
|
+
| **Functionality** | Anti-AI-slop enforcement (4 banned patterns) | ✅ |
|
|
2033
|
+
| **Functionality** | 2 workflows (from screenshot, from scratch) | ✅ |
|
|
2034
|
+
| **Functionality** | Typography pairing (display + body, heading ≥ 48px) | ✅ |
|
|
2035
|
+
| **Functionality** | Color commitment (dominant + accent + neutral, max 3) | ✅ |
|
|
2036
|
+
| **Functionality** | Motion orchestration (single entrance pattern) | ✅ |
|
|
2037
|
+
| **Contracts** | Input/output/error schemas in pseudo-schema format | ✅ |
|
|
2038
|
+
| **Contracts** | Contract versioning with semver | ✅ |
|
|
2039
|
+
| **Failure** | Error taxonomy with 6 categorized codes | ✅ |
|
|
2040
|
+
| **Failure** | No silent fallback to "safe" defaults | ✅ |
|
|
2041
|
+
| **Failure** | Zero internal retries | ✅ |
|
|
2042
|
+
| **Determinism** | Fixed directions, fixed bans, fixed limits | ✅ |
|
|
2043
|
+
| **Security** | No PII, no credential exposure | ✅ |
|
|
2044
|
+
| **Observability** | Structured log schema with 5 mandatory fields | ✅ |
|
|
2045
|
+
| **Observability** | 4 metrics defined | ✅ |
|
|
2046
|
+
| **Performance** | P50/P99 targets for all operations | ✅ |
|
|
2047
|
+
| **Scalability** | Stateless; unlimited parallel invocations | ✅ |
|
|
2048
|
+
| **Compliance** | All skill-design-guide.md sections mapped with evidence | ✅ |
|
|
2049
|
+
|
|
2050
|
+
---
|
|
2051
|
+
|
|
2052
|
+
|
|
2053
|
+
|
|
2054
|
+
---
|
|
2055
|
+
|
|
2056
|
+
## 🔗 Related
|
|
2057
|
+
|
|
2058
|
+
| File | When to Read |
|
|
2059
|
+
|------|-------------|
|
|
2060
|
+
| [typography.md](typography.md) | Font pairings and scale |
|
|
2061
|
+
| [color-systems.md](color-systems.md) | Color commitment strategy |
|
|
2062
|
+
| [motion-design.md](motion-design.md) | Animation choreography |
|
|
2063
|
+
| [spatial-composition.md](spatial-composition.md) | Layout innovation |
|
|
2064
|
+
| [design-extraction.md](design-extraction.md) | Screenshot analysis |
|
|
2065
|
+
| [../SKILL.md](../SKILL.md) | Quick reference and anti-slop bans |
|
|
2066
|
+
|
|
2067
|
+
---
|
|
2068
|
+
|
|
2069
|
+
### Rule: motion-design
|
|
2070
|
+
|
|
2071
|
+
---
|
|
2072
|
+
name: motion-design
|
|
2073
|
+
description: Orchestrated entrances — CSS stagger, Framer Motion variants, Anime.js timeline, duration guide
|
|
2074
|
+
---
|
|
2075
|
+
|
|
2076
|
+
# Motion Design
|
|
2077
|
+
|
|
2078
|
+
> One orchestrated animation > many scattered micro-interactions.
|
|
2079
|
+
|
|
2080
|
+
---
|
|
2081
|
+
|
|
2082
|
+
## Principle: Orchestrated Entrances
|
|
2083
|
+
|
|
2084
|
+
Don't scatter animations. Create one impactful page load sequence:
|
|
2085
|
+
|
|
2086
|
+
```css
|
|
2087
|
+
/* Staggered entrance animation */
|
|
2088
|
+
.hero-title {
|
|
2089
|
+
animation: fadeInUp 0.6s ease-out;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
.hero-subtitle {
|
|
2093
|
+
animation: fadeInUp 0.6s ease-out 0.2s;
|
|
2094
|
+
animation-fill-mode: backwards;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
.hero-cta {
|
|
2098
|
+
animation: fadeInUp 0.6s ease-out 0.4s;
|
|
2099
|
+
animation-fill-mode: backwards;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
@keyframes fadeInUp {
|
|
2103
|
+
from {
|
|
2104
|
+
opacity: 0;
|
|
2105
|
+
transform: translateY(20px);
|
|
2106
|
+
}
|
|
2107
|
+
to {
|
|
2108
|
+
opacity: 1;
|
|
2109
|
+
transform: translateY(0);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
```
|
|
2113
|
+
|
|
2114
|
+
---
|
|
2115
|
+
|
|
2116
|
+
## Animation Timing
|
|
2117
|
+
|
|
2118
|
+
| Easing | Use Case |
|
|
2119
|
+
|--------|----------|
|
|
2120
|
+
| `ease-out` | Entrances (fast start, slow end) |
|
|
2121
|
+
| `ease-in` | Exits (slow start, fast end) |
|
|
2122
|
+
| `ease-in-out` | Continuous motion |
|
|
2123
|
+
| `cubic-bezier(0.34, 1.56, 0.64, 1)` | Bouncy, playful |
|
|
2124
|
+
|
|
2125
|
+
---
|
|
2126
|
+
|
|
2127
|
+
## Duration Guidelines
|
|
2128
|
+
|
|
2129
|
+
| Element | Duration |
|
|
2130
|
+
|---------|----------|
|
|
2131
|
+
| Micro-interactions | 100-200ms |
|
|
2132
|
+
| Component transitions | 200-400ms |
|
|
2133
|
+
| Page transitions | 400-600ms |
|
|
2134
|
+
| Hero animations | 600-1000ms |
|
|
2135
|
+
|
|
2136
|
+
---
|
|
2137
|
+
|
|
2138
|
+
## React Motion Library
|
|
2139
|
+
|
|
2140
|
+
```jsx
|
|
2141
|
+
import { motion } from 'framer-motion';
|
|
2142
|
+
|
|
2143
|
+
const fadeUp = {
|
|
2144
|
+
hidden: { opacity: 0, y: 20 },
|
|
2145
|
+
visible: { opacity: 1, y: 0 }
|
|
2146
|
+
};
|
|
2147
|
+
|
|
2148
|
+
const staggerContainer = {
|
|
2149
|
+
hidden: {},
|
|
2150
|
+
visible: {
|
|
2151
|
+
transition: {
|
|
2152
|
+
staggerChildren: 0.2
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
|
|
2157
|
+
function Hero() {
|
|
2158
|
+
return (
|
|
2159
|
+
<motion.div
|
|
2160
|
+
variants={staggerContainer}
|
|
2161
|
+
initial="hidden"
|
|
2162
|
+
animate="visible"
|
|
2163
|
+
>
|
|
2164
|
+
<motion.h1 variants={fadeUp}>Title</motion.h1>
|
|
2165
|
+
<motion.p variants={fadeUp}>Subtitle</motion.p>
|
|
2166
|
+
<motion.button variants={fadeUp}>CTA</motion.button>
|
|
2167
|
+
</motion.div>
|
|
2168
|
+
);
|
|
2169
|
+
}
|
|
2170
|
+
```
|
|
2171
|
+
|
|
2172
|
+
---
|
|
2173
|
+
|
|
2174
|
+
## Anime.js for Complex Animations
|
|
2175
|
+
|
|
2176
|
+
```javascript
|
|
2177
|
+
import anime from 'animejs';
|
|
2178
|
+
|
|
2179
|
+
// Timeline for orchestrated sequence
|
|
2180
|
+
const tl = anime.timeline({
|
|
2181
|
+
easing: 'easeOutExpo',
|
|
2182
|
+
duration: 750
|
|
2183
|
+
});
|
|
2184
|
+
|
|
2185
|
+
tl
|
|
2186
|
+
.add({
|
|
2187
|
+
targets: '.hero-title',
|
|
2188
|
+
opacity: [0, 1],
|
|
2189
|
+
translateY: [50, 0]
|
|
2190
|
+
})
|
|
2191
|
+
.add({
|
|
2192
|
+
targets: '.hero-subtitle',
|
|
2193
|
+
opacity: [0, 1],
|
|
2194
|
+
translateY: [30, 0]
|
|
2195
|
+
}, '-=500') // Overlap by 500ms
|
|
2196
|
+
.add({
|
|
2197
|
+
targets: '.hero-cta',
|
|
2198
|
+
opacity: [0, 1],
|
|
2199
|
+
scale: [0.9, 1]
|
|
2200
|
+
}, '-=400');
|
|
2201
|
+
```
|
|
2202
|
+
|
|
2203
|
+
---
|
|
2204
|
+
|
|
2205
|
+
## Anti-Patterns
|
|
2206
|
+
|
|
2207
|
+
| ❌ Don't | ✅ Do |
|
|
2208
|
+
|---------|-------|
|
|
2209
|
+
| Animate everything | Selective, purposeful motion |
|
|
2210
|
+
| Random timing | Consistent timing system |
|
|
2211
|
+
| Competing animations | Single focal point |
|
|
2212
|
+
| Slow entrances (>1s) | Quick, impactful (<600ms) |
|
|
2213
|
+
| Animation without purpose | Motion that guides attention |
|
|
2214
|
+
|
|
2215
|
+
---
|
|
2216
|
+
|
|
2217
|
+
|
|
2218
|
+
|
|
2219
|
+
---
|
|
2220
|
+
|
|
2221
|
+
## 🔗 Related
|
|
2222
|
+
|
|
2223
|
+
| File | When to Read |
|
|
2224
|
+
|------|-------------|
|
|
2225
|
+
| [spatial-composition.md](spatial-composition.md) | Layout to animate |
|
|
2226
|
+
| [color-systems.md](color-systems.md) | Color transitions |
|
|
2227
|
+
| [../SKILL.md](../SKILL.md) | 1 orchestrated entrance rule |
|
|
2228
|
+
|
|
2229
|
+
---
|
|
2230
|
+
|
|
2231
|
+
### Rule: motion-graphics
|
|
2232
|
+
|
|
2233
|
+
---
|
|
2234
|
+
name: motion-graphics
|
|
2235
|
+
description: Advanced motion — Lottie, GSAP, SVG animation, 3D CSS, particles, scroll-driven animations
|
|
2236
|
+
---
|
|
2237
|
+
|
|
2238
|
+
# Motion Graphics Reference
|
|
2239
|
+
|
|
2240
|
+
> Advanced animation techniques for premium web experiences - Lottie, GSAP, SVG, 3D, Particles.
|
|
2241
|
+
> **Learn the principles, create WOW effects.**
|
|
2242
|
+
|
|
2243
|
+
---
|
|
2244
|
+
|
|
2245
|
+
## 1. Lottie Animations
|
|
2246
|
+
|
|
2247
|
+
### What is Lottie?
|
|
2248
|
+
|
|
2249
|
+
```
|
|
2250
|
+
JSON-based vector animations:
|
|
2251
|
+
├── Exported from After Effects via Bodymovin
|
|
2252
|
+
├── Lightweight (smaller than GIF/video)
|
|
2253
|
+
├── Scalable (vector-based, no pixelation)
|
|
2254
|
+
├── Interactive (control playback, segments)
|
|
2255
|
+
└── Cross-platform (web, iOS, Android, React Native)
|
|
2256
|
+
```
|
|
2257
|
+
|
|
2258
|
+
### When to Use Lottie
|
|
2259
|
+
|
|
2260
|
+
| Use Case | Why Lottie? |
|
|
2261
|
+
|----------|-------------|
|
|
2262
|
+
| **Loading animations** | Branded, smooth, lightweight |
|
|
2263
|
+
| **Empty states** | Engaging illustrations |
|
|
2264
|
+
| **Onboarding flows** | Complex multi-step animations |
|
|
2265
|
+
| **Success/Error feedback** | Delightful micro-interactions |
|
|
2266
|
+
| **Animated icons** | Consistent cross-platform |
|
|
2267
|
+
|
|
2268
|
+
### Principles
|
|
2269
|
+
|
|
2270
|
+
- Keep file size under 100KB for performance
|
|
2271
|
+
- Use loop sparingly (avoid distraction)
|
|
2272
|
+
- Provide static fallback for reduced-motion
|
|
2273
|
+
- Lazy load animation files when possible
|
|
2274
|
+
|
|
2275
|
+
### Sources
|
|
2276
|
+
|
|
2277
|
+
- LottieFiles.com (free library)
|
|
2278
|
+
- After Effects + Bodymovin (custom)
|
|
2279
|
+
- Figma plugins (export from design)
|
|
2280
|
+
|
|
2281
|
+
---
|
|
2282
|
+
|
|
2283
|
+
## 2. GSAP (GreenSock)
|
|
2284
|
+
|
|
2285
|
+
### What Makes GSAP Different
|
|
2286
|
+
|
|
2287
|
+
```
|
|
2288
|
+
Professional timeline-based animation:
|
|
2289
|
+
├── Precise control over sequences
|
|
2290
|
+
├── ScrollTrigger for scroll-driven animations
|
|
2291
|
+
├── MorphSVG for shape transitions
|
|
2292
|
+
├── Physics-based easing
|
|
2293
|
+
└── Works with any DOM element
|
|
2294
|
+
```
|
|
2295
|
+
|
|
2296
|
+
### Core Concepts
|
|
2297
|
+
|
|
2298
|
+
| Concept | Purpose |
|
|
2299
|
+
|---------|---------|
|
|
2300
|
+
| **Tween** | Single A→B animation |
|
|
2301
|
+
| **Timeline** | Sequenced/overlapping animations |
|
|
2302
|
+
| **ScrollTrigger** | Scroll position controls playback |
|
|
2303
|
+
| **Stagger** | Cascade effect across elements |
|
|
2304
|
+
|
|
2305
|
+
### When to Use GSAP
|
|
2306
|
+
|
|
2307
|
+
- ✅ Complex sequenced animations
|
|
2308
|
+
- ✅ Scroll-triggered reveals
|
|
2309
|
+
- ✅ Precise timing control needed
|
|
2310
|
+
- ✅ SVG morphing effects
|
|
2311
|
+
- ❌ Simple hover/focus effects (use CSS)
|
|
2312
|
+
- ❌ Performance-critical mobile (heavier)
|
|
2313
|
+
|
|
2314
|
+
### Principles
|
|
2315
|
+
|
|
2316
|
+
- Use timeline for orchestration (not individual tweens)
|
|
2317
|
+
- Stagger delay: 0.05-0.15s between items
|
|
2318
|
+
- ScrollTrigger: start at 70-80% viewport entry
|
|
2319
|
+
- Kill animations on unmount (prevent memory leaks)
|
|
2320
|
+
|
|
2321
|
+
---
|
|
2322
|
+
|
|
2323
|
+
## 3. SVG Animations
|
|
2324
|
+
|
|
2325
|
+
### Types of SVG Animation
|
|
2326
|
+
|
|
2327
|
+
| Type | Technique | Use Case |
|
|
2328
|
+
|------|-----------|----------|
|
|
2329
|
+
| **Line Drawing** | stroke-dashoffset | Logo reveals, signatures |
|
|
2330
|
+
| **Morph** | Path interpolation | Icon transitions |
|
|
2331
|
+
| **Transform** | rotate, scale, translate | Interactive icons |
|
|
2332
|
+
| **Color** | fill/stroke transition | State changes |
|
|
2333
|
+
|
|
2334
|
+
### Line Drawing Principles
|
|
2335
|
+
|
|
2336
|
+
```
|
|
2337
|
+
How stroke-dashoffset drawing works:
|
|
2338
|
+
├── Set dasharray to path length
|
|
2339
|
+
├── Set dashoffset equal to dasharray (hidden)
|
|
2340
|
+
├── Animate dashoffset to 0 (revealed)
|
|
2341
|
+
└── Create "drawing" effect
|
|
2342
|
+
```
|
|
2343
|
+
|
|
2344
|
+
### When to Use SVG Animations
|
|
2345
|
+
|
|
2346
|
+
- ✅ Logo reveals, brand moments
|
|
2347
|
+
- ✅ Icon state transitions (hamburger ↔ X)
|
|
2348
|
+
- ✅ Infographics, data visualization
|
|
2349
|
+
- ✅ Interactive illustrations
|
|
2350
|
+
- ❌ Photo-realistic content (use video)
|
|
2351
|
+
- ❌ Very complex scenes (performance)
|
|
2352
|
+
|
|
2353
|
+
### Principles
|
|
2354
|
+
|
|
2355
|
+
- Get path length dynamically for accuracy
|
|
2356
|
+
- Duration: 1-3s for full drawings
|
|
2357
|
+
- Easing: ease-out for natural feel
|
|
2358
|
+
- Simple fills complement, don't compete
|
|
2359
|
+
|
|
2360
|
+
---
|
|
2361
|
+
|
|
2362
|
+
## 4. 3D CSS Transforms
|
|
2363
|
+
|
|
2364
|
+
### Core Properties
|
|
2365
|
+
|
|
2366
|
+
```
|
|
2367
|
+
CSS 3D Space:
|
|
2368
|
+
├── perspective: depth of 3D field (500-1500px typical)
|
|
2369
|
+
├── transform-style: preserve-3d (enable children 3D)
|
|
2370
|
+
├── rotateX/Y/Z: rotation per axis
|
|
2371
|
+
├── translateZ: move toward/away from viewer
|
|
2372
|
+
└── backface-visibility: show/hide back side
|
|
2373
|
+
```
|
|
2374
|
+
|
|
2375
|
+
### Common 3D Patterns
|
|
2376
|
+
|
|
2377
|
+
| Pattern | Use Case |
|
|
2378
|
+
|---------|----------|
|
|
2379
|
+
| **Card flip** | Reveals, flashcards, product views |
|
|
2380
|
+
| **Tilt on hover** | Interactive cards, 3D depth |
|
|
2381
|
+
| **Parallax layers** | Hero sections, immersive scrolling |
|
|
2382
|
+
| **3D carousel** | Image galleries, sliders |
|
|
2383
|
+
|
|
2384
|
+
### Principles
|
|
2385
|
+
|
|
2386
|
+
- Perspective: 800-1200px for subtle, 400-600px for dramatic
|
|
2387
|
+
- Keep transforms simple (rotate + translate)
|
|
2388
|
+
- Ensure backface-visibility: hidden for flips
|
|
2389
|
+
- Test on Safari (different rendering)
|
|
2390
|
+
|
|
2391
|
+
---
|
|
2392
|
+
|
|
2393
|
+
## 5. Particle Effects
|
|
2394
|
+
|
|
2395
|
+
### Types of Particle Systems
|
|
2396
|
+
|
|
2397
|
+
| Type | Feel | Use Case |
|
|
2398
|
+
|------|------|----------|
|
|
2399
|
+
| **Geometric** | Tech, network | SaaS, tech sites |
|
|
2400
|
+
| **Confetti** | Celebration | Success moments |
|
|
2401
|
+
| **Snow/Rain** | Atmospheric | Seasonal, mood |
|
|
2402
|
+
| **Dust/Bokeh** | Dreamy | Photography, luxury |
|
|
2403
|
+
| **Fireflies** | Magical | Games, fantasy |
|
|
2404
|
+
|
|
2405
|
+
### Libraries
|
|
2406
|
+
|
|
2407
|
+
| Library | Best For |
|
|
2408
|
+
|---------|----------|
|
|
2409
|
+
| **tsParticles** | Configurable, lightweight |
|
|
2410
|
+
| **particles.js** | Simple backgrounds |
|
|
2411
|
+
| **Canvas API** | Custom, maximum control |
|
|
2412
|
+
| **Three.js** | Complex 3D particles |
|
|
2413
|
+
|
|
2414
|
+
### Principles
|
|
2415
|
+
|
|
2416
|
+
- Default: 30-50 particles (not overwhelming)
|
|
2417
|
+
- Movement: slow, organic (speed 0.5-2)
|
|
2418
|
+
- Opacity: 0.3-0.6 (don't compete with content)
|
|
2419
|
+
- Connections: subtle lines for "network" feel
|
|
2420
|
+
- ⚠️ Disable or reduce on mobile
|
|
2421
|
+
|
|
2422
|
+
### When to Use
|
|
2423
|
+
|
|
2424
|
+
- ✅ Hero backgrounds (atmospheric)
|
|
2425
|
+
- ✅ Success celebrations (confetti burst)
|
|
2426
|
+
- ✅ Tech visualization (connected nodes)
|
|
2427
|
+
- ❌ Content-heavy pages (distraction)
|
|
2428
|
+
- ❌ Low-powered devices (battery drain)
|
|
2429
|
+
|
|
2430
|
+
---
|
|
2431
|
+
|
|
2432
|
+
## 6. Scroll-Driven Animations
|
|
2433
|
+
|
|
2434
|
+
### Native CSS (Modern)
|
|
2435
|
+
|
|
2436
|
+
```
|
|
2437
|
+
CSS Scroll Timelines:
|
|
2438
|
+
├── animation-timeline: scroll() - document scroll
|
|
2439
|
+
├── animation-timeline: view() - element in viewport
|
|
2440
|
+
├── animation-range: entry/exit thresholds
|
|
2441
|
+
└── No JavaScript required
|
|
2442
|
+
```
|
|
2443
|
+
|
|
2444
|
+
### Principles
|
|
2445
|
+
|
|
2446
|
+
| Trigger Point | Use Case |
|
|
2447
|
+
|---------------|----------|
|
|
2448
|
+
| **Entry 0%** | When element starts entering |
|
|
2449
|
+
| **Entry 50%** | When half visible |
|
|
2450
|
+
| **Cover 50%** | When centered in viewport |
|
|
2451
|
+
| **Exit 100%** | When fully exited |
|
|
2452
|
+
|
|
2453
|
+
### Best Practices
|
|
2454
|
+
|
|
2455
|
+
- Reveal animations: start at ~25% entry
|
|
2456
|
+
- Parallax: continuous scroll progress
|
|
2457
|
+
- Sticky elements: use cover range
|
|
2458
|
+
- Always test scroll performance
|
|
2459
|
+
|
|
2460
|
+
---
|
|
2461
|
+
|
|
2462
|
+
## 7. Performance Principles
|
|
2463
|
+
|
|
2464
|
+
### GPU vs CPU Animation
|
|
2465
|
+
|
|
2466
|
+
```
|
|
2467
|
+
CHEAP (GPU-accelerated):
|
|
2468
|
+
├── transform (translate, scale, rotate)
|
|
2469
|
+
├── opacity
|
|
2470
|
+
└── filter (use sparingly)
|
|
2471
|
+
|
|
2472
|
+
EXPENSIVE (triggers reflow):
|
|
2473
|
+
├── width, height
|
|
2474
|
+
├── top, left, right, bottom
|
|
2475
|
+
├── padding, margin
|
|
2476
|
+
└── complex box-shadow
|
|
2477
|
+
```
|
|
2478
|
+
|
|
2479
|
+
### Optimization Checklist
|
|
2480
|
+
|
|
2481
|
+
- [ ] Animate only transform/opacity
|
|
2482
|
+
- [ ] Use `will-change` before heavy animations (remove after)
|
|
2483
|
+
- [ ] Test on low-end devices
|
|
2484
|
+
- [ ] Implement `prefers-reduced-motion`
|
|
2485
|
+
- [ ] Lazy load animation libraries
|
|
2486
|
+
- [ ] Throttle scroll-based calculations
|
|
2487
|
+
|
|
2488
|
+
---
|
|
2489
|
+
|
|
2490
|
+
## 8. Motion Graphics Decision Tree
|
|
2491
|
+
|
|
2492
|
+
```
|
|
2493
|
+
What animation do you need?
|
|
2494
|
+
│
|
|
2495
|
+
├── Complex branded animation?
|
|
2496
|
+
│ └── Lottie (After Effects export)
|
|
2497
|
+
│
|
|
2498
|
+
├── Sequenced scroll-triggered?
|
|
2499
|
+
│ └── GSAP + ScrollTrigger
|
|
2500
|
+
│
|
|
2501
|
+
├── Logo/icon animation?
|
|
2502
|
+
│ └── SVG animation (stroke or morph)
|
|
2503
|
+
│
|
|
2504
|
+
├── Interactive 3D effect?
|
|
2505
|
+
│ └── CSS 3D Transforms (simple) or Three.js (complex)
|
|
2506
|
+
│
|
|
2507
|
+
├── Atmospheric background?
|
|
2508
|
+
│ └── tsParticles or Canvas
|
|
2509
|
+
│
|
|
2510
|
+
└── Simple entrance/hover?
|
|
2511
|
+
└── CSS @keyframes or Framer Motion
|
|
2512
|
+
```
|
|
2513
|
+
|
|
2514
|
+
---
|
|
2515
|
+
|
|
2516
|
+
## 9. Anti-Patterns
|
|
2517
|
+
|
|
2518
|
+
| ❌ Don't | ✅ Do |
|
|
2519
|
+
|----------|-------|
|
|
2520
|
+
| Animate everything at once | Stagger and sequence |
|
|
2521
|
+
| Use heavy libraries for simple effects | Start with CSS |
|
|
2522
|
+
| Ignore reduced-motion | Always provide fallback |
|
|
2523
|
+
| Block main thread | Optimize for 60fps |
|
|
2524
|
+
| Same particles every project | Match brand/context |
|
|
2525
|
+
| Complex effects on mobile | Feature detection |
|
|
2526
|
+
|
|
2527
|
+
---
|
|
2528
|
+
|
|
2529
|
+
## 10. Quick Reference
|
|
2530
|
+
|
|
2531
|
+
| Effect | Tool | Performance |
|
|
2532
|
+
|--------|------|-------------|
|
|
2533
|
+
| Loading spinner | CSS/Lottie | Light |
|
|
2534
|
+
| Staggered reveal | GSAP/Framer | Medium |
|
|
2535
|
+
| SVG path draw | CSS stroke | Light |
|
|
2536
|
+
| 3D card flip | CSS transforms | Light |
|
|
2537
|
+
| Particle background | tsParticles | Heavy |
|
|
2538
|
+
| Scroll parallax | GSAP ScrollTrigger | Medium |
|
|
2539
|
+
| Shape morphing | GSAP MorphSVG | Medium |
|
|
2540
|
+
|
|
2541
|
+
---
|
|
2542
|
+
|
|
2543
|
+
> **Remember**: Motion graphics should enhance, not distract. Every animation must serve a PURPOSE—feedback, guidance, delight, or storytelling.
|
|
2544
|
+
|
|
2545
|
+
---
|
|
2546
|
+
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
---
|
|
2550
|
+
|
|
2551
|
+
## 🔗 Related
|
|
2552
|
+
|
|
2553
|
+
| File | When to Read |
|
|
2554
|
+
|------|-------------|
|
|
2555
|
+
| [animation-guide.md](animation-guide.md) | Core animation timing and easing principles |
|
|
2556
|
+
| [visual-effects.md](visual-effects.md) | CSS glassmorphism, gradients, shadows |
|
|
2557
|
+
| [ux-psychology.md](ux-psychology.md) | Emotional design and feedback psychology |
|
|
2558
|
+
| [../SKILL.md](../SKILL.md) | Animation categories quick reference |
|
|
2559
|
+
|
|
2560
|
+
---
|
|
2561
|
+
|
|
2562
|
+
### Rule: spatial-composition
|
|
2563
|
+
|
|
2564
|
+
---
|
|
2565
|
+
name: spatial-composition
|
|
2566
|
+
description: Layout innovation — asymmetric grids, overlapping elements, diagonal flow, negative space
|
|
2567
|
+
---
|
|
2568
|
+
|
|
2569
|
+
# Spatial Composition
|
|
2570
|
+
|
|
2571
|
+
> Break the grid. Create unexpected layouts.
|
|
2572
|
+
|
|
2573
|
+
---
|
|
2574
|
+
|
|
2575
|
+
## Principle: Break Expectations
|
|
2576
|
+
|
|
2577
|
+
Don't default to centered, symmetrical layouts. Create visual tension:
|
|
2578
|
+
|
|
2579
|
+
- **Asymmetric arrangements**
|
|
2580
|
+
- **Overlapping elements**
|
|
2581
|
+
- **Diagonal flow**
|
|
2582
|
+
- **Generous negative space OR controlled density**
|
|
2583
|
+
|
|
2584
|
+
---
|
|
2585
|
+
|
|
2586
|
+
## Grid Breaking Techniques
|
|
2587
|
+
|
|
2588
|
+
### Asymmetric Grid
|
|
2589
|
+
```css
|
|
2590
|
+
.layout {
|
|
2591
|
+
display: grid;
|
|
2592
|
+
grid-template-columns: 2fr 1fr; /* Unequal columns */
|
|
2593
|
+
gap: 48px;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
/* Or magazine-style */
|
|
2597
|
+
.layout-magazine {
|
|
2598
|
+
display: grid;
|
|
2599
|
+
grid-template-columns: 1fr 2fr 1fr;
|
|
2600
|
+
grid-template-rows: auto auto;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
.featured {
|
|
2604
|
+
grid-column: 2 / 3;
|
|
2605
|
+
grid-row: 1 / 3;
|
|
2606
|
+
}
|
|
2607
|
+
```
|
|
2608
|
+
|
|
2609
|
+
### Overlapping Elements
|
|
2610
|
+
```css
|
|
2611
|
+
.card-overlap {
|
|
2612
|
+
position: relative;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
.card-image {
|
|
2616
|
+
position: relative;
|
|
2617
|
+
z-index: 1;
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
.card-content {
|
|
2621
|
+
position: relative;
|
|
2622
|
+
z-index: 2;
|
|
2623
|
+
margin-top: -60px;
|
|
2624
|
+
margin-left: 40px;
|
|
2625
|
+
background: white;
|
|
2626
|
+
padding: 32px;
|
|
2627
|
+
}
|
|
2628
|
+
```
|
|
2629
|
+
|
|
2630
|
+
### Diagonal Flow
|
|
2631
|
+
```css
|
|
2632
|
+
.diagonal-section {
|
|
2633
|
+
clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 95%);
|
|
2634
|
+
padding: 120px 0;
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
/* Or with transform */
|
|
2638
|
+
.diagonal-bg {
|
|
2639
|
+
transform: skewY(-3deg);
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
.diagonal-content {
|
|
2643
|
+
transform: skewY(3deg); /* Counter-rotate content */
|
|
2644
|
+
}
|
|
2645
|
+
```
|
|
2646
|
+
|
|
2647
|
+
---
|
|
2648
|
+
|
|
2649
|
+
## Negative Space
|
|
2650
|
+
|
|
2651
|
+
### Generous Whitespace
|
|
2652
|
+
```css
|
|
2653
|
+
.hero {
|
|
2654
|
+
padding: 160px 0;
|
|
2655
|
+
min-height: 100vh;
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
.section {
|
|
2659
|
+
padding: 120px 0;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
.content {
|
|
2663
|
+
max-width: 720px; /* Narrow reading width */
|
|
2664
|
+
margin: 0 auto;
|
|
2665
|
+
}
|
|
2666
|
+
```
|
|
2667
|
+
|
|
2668
|
+
### Controlled Density
|
|
2669
|
+
```css
|
|
2670
|
+
.dense-grid {
|
|
2671
|
+
display: grid;
|
|
2672
|
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
2673
|
+
gap: 8px; /* Tight gap */
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
.dense-card {
|
|
2677
|
+
padding: 16px;
|
|
2678
|
+
aspect-ratio: 1;
|
|
2679
|
+
}
|
|
2680
|
+
```
|
|
2681
|
+
|
|
2682
|
+
---
|
|
2683
|
+
|
|
2684
|
+
## Position Breaking
|
|
2685
|
+
|
|
2686
|
+
### Off-center Hero
|
|
2687
|
+
```css
|
|
2688
|
+
.hero {
|
|
2689
|
+
display: grid;
|
|
2690
|
+
grid-template-columns: 1fr 1.5fr;
|
|
2691
|
+
gap: 80px;
|
|
2692
|
+
align-items: center;
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
.hero-content {
|
|
2696
|
+
padding-left: 10%; /* Offset from edge */
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
.hero-image {
|
|
2700
|
+
margin-right: -80px; /* Bleed off edge */
|
|
2701
|
+
}
|
|
2702
|
+
```
|
|
2703
|
+
|
|
2704
|
+
### Sticky Sidebar
|
|
2705
|
+
```css
|
|
2706
|
+
.layout-sticky {
|
|
2707
|
+
display: grid;
|
|
2708
|
+
grid-template-columns: 300px 1fr;
|
|
2709
|
+
gap: 48px;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
.sidebar {
|
|
2713
|
+
position: sticky;
|
|
2714
|
+
top: 24px;
|
|
2715
|
+
height: fit-content;
|
|
2716
|
+
}
|
|
2717
|
+
```
|
|
2718
|
+
|
|
2719
|
+
---
|
|
2720
|
+
|
|
2721
|
+
## Anti-Patterns
|
|
2722
|
+
|
|
2723
|
+
| ❌ Generic | ✅ Distinctive |
|
|
2724
|
+
|-----------|---------------|
|
|
2725
|
+
| Everything centered | Intentional asymmetry |
|
|
2726
|
+
| Equal padding everywhere | Varied spacing with purpose |
|
|
2727
|
+
| Straight edges only | Occasional diagonals, curves |
|
|
2728
|
+
| No overlap | Strategic layering |
|
|
2729
|
+
| Predictable grid | Broken expectations |
|
|
2730
|
+
|
|
2731
|
+
---
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
---
|
|
2736
|
+
|
|
2737
|
+
## 🔗 Related
|
|
2738
|
+
|
|
2739
|
+
| File | When to Read |
|
|
2740
|
+
|------|-------------|
|
|
2741
|
+
| [motion-design.md](motion-design.md) | Animate layout transitions |
|
|
2742
|
+
| [typography.md](typography.md) | Typography scale for layout hierarchy |
|
|
2743
|
+
| [../SKILL.md](../SKILL.md) | Aesthetic directions and constraints |
|
|
2744
|
+
|
|
2745
|
+
---
|
|
2746
|
+
|
|
2747
|
+
### Rule: typography
|
|
2748
|
+
|
|
2749
|
+
---
|
|
2750
|
+
name: typography
|
|
2751
|
+
description: Distinctive font pairings, fluid typography scale, display vs body rules, variable fonts
|
|
2752
|
+
---
|
|
2753
|
+
|
|
2754
|
+
# Typography for Distinctive Design
|
|
2755
|
+
|
|
2756
|
+
> Break the default. Stop using Inter, Roboto, Arial.
|
|
2757
|
+
|
|
2758
|
+
---
|
|
2759
|
+
|
|
2760
|
+
## Distinctive Font Pairings
|
|
2761
|
+
|
|
2762
|
+
| Pairing | Display | Body | Mood |
|
|
2763
|
+
|---------|---------|------|------|
|
|
2764
|
+
| **Editorial** | Playfair Display | Source Sans Pro | Elegant, magazine |
|
|
2765
|
+
| **Modern Tech** | Syne | IBM Plex Sans | Bold, technical |
|
|
2766
|
+
| **Refined** | Fraunces | Work Sans | Warm, crafted |
|
|
2767
|
+
| **Clean Cut** | DM Serif Display | DM Sans | Sharp, professional |
|
|
2768
|
+
| **Brutalist** | Space Mono | Space Grotesk | Raw, technical |
|
|
2769
|
+
| **Luxe** | Cormorant Garamond | Inter | Sophisticated |
|
|
2770
|
+
|
|
2771
|
+
---
|
|
2772
|
+
|
|
2773
|
+
## Typography Scale
|
|
2774
|
+
|
|
2775
|
+
```css
|
|
2776
|
+
:root {
|
|
2777
|
+
/* Fluid typography with clamp */
|
|
2778
|
+
--text-xs: clamp(12px, 1vw, 14px);
|
|
2779
|
+
--text-sm: clamp(14px, 1.2vw, 16px);
|
|
2780
|
+
--text-base: clamp(16px, 1.5vw, 18px);
|
|
2781
|
+
--text-lg: clamp(18px, 2vw, 20px);
|
|
2782
|
+
--text-xl: clamp(24px, 3vw, 30px);
|
|
2783
|
+
--text-2xl: clamp(32px, 4vw, 40px);
|
|
2784
|
+
--text-3xl: clamp(40px, 5vw, 56px);
|
|
2785
|
+
--text-4xl: clamp(48px, 6vw, 72px);
|
|
2786
|
+
--text-hero: clamp(56px, 8vw, 120px);
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
/* Line heights */
|
|
2790
|
+
--leading-tight: 0.95;
|
|
2791
|
+
--leading-snug: 1.1;
|
|
2792
|
+
--leading-normal: 1.5;
|
|
2793
|
+
--leading-relaxed: 1.65;
|
|
2794
|
+
```
|
|
2795
|
+
|
|
2796
|
+
---
|
|
2797
|
+
|
|
2798
|
+
## Display vs Body
|
|
2799
|
+
|
|
2800
|
+
**Display fonts** (headings): Character, personality, memorable
|
|
2801
|
+
- Use sparingly: hero, h1, h2
|
|
2802
|
+
- Large sizes: 32px+
|
|
2803
|
+
- Tight line-height: 0.95-1.1
|
|
2804
|
+
- Negative letter-spacing: -0.02em to -0.04em
|
|
2805
|
+
|
|
2806
|
+
**Body fonts** (text): Readable, neutral, comfortable
|
|
2807
|
+
- Use everywhere else
|
|
2808
|
+
- 16-20px base size
|
|
2809
|
+
- Relaxed line-height: 1.5-1.65
|
|
2810
|
+
- Normal letter-spacing
|
|
2811
|
+
|
|
2812
|
+
---
|
|
2813
|
+
|
|
2814
|
+
## Anti-Pattern: Generic Typography
|
|
2815
|
+
|
|
2816
|
+
| ❌ Don't | ✅ Do |
|
|
2817
|
+
|---------|-------|
|
|
2818
|
+
| Inter everywhere | Distinctive display + neutral body |
|
|
2819
|
+
| System fonts | Custom Google Fonts |
|
|
2820
|
+
| Same size for all headings | Clear hierarchy with scale |
|
|
2821
|
+
| Default line-height | Tight for display, relaxed for body |
|
|
2822
|
+
| No letter-spacing | Adjust per context |
|
|
2823
|
+
|
|
2824
|
+
---
|
|
2825
|
+
|
|
2826
|
+
## Loading Fonts
|
|
2827
|
+
|
|
2828
|
+
```html
|
|
2829
|
+
<!-- Preconnect for performance -->
|
|
2830
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
2831
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
2832
|
+
|
|
2833
|
+
<!-- Load specific weights -->
|
|
2834
|
+
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Source+Sans+Pro:wght@400;600&display=swap" rel="stylesheet">
|
|
2835
|
+
```
|
|
2836
|
+
|
|
2837
|
+
---
|
|
2838
|
+
|
|
2839
|
+
## Variable Fonts
|
|
2840
|
+
|
|
2841
|
+
For advanced control:
|
|
2842
|
+
|
|
2843
|
+
```css
|
|
2844
|
+
@font-face {
|
|
2845
|
+
font-family: 'Inter Variable';
|
|
2846
|
+
src: url('/fonts/Inter-Variable.woff2') format('woff2');
|
|
2847
|
+
font-weight: 100 900;
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
.dynamic-weight {
|
|
2851
|
+
font-family: 'Inter Variable', sans-serif;
|
|
2852
|
+
font-weight: 450; /* Any value 100-900 */
|
|
2853
|
+
}
|
|
2854
|
+
```
|
|
2855
|
+
|
|
2856
|
+
---
|
|
2857
|
+
|
|
2858
|
+
|
|
2859
|
+
|
|
2860
|
+
---
|
|
2861
|
+
|
|
2862
|
+
## 🔗 Related
|
|
2863
|
+
|
|
2864
|
+
| File | When to Read |
|
|
2865
|
+
|------|-------------|
|
|
2866
|
+
| [color-systems.md](color-systems.md) | Color palette to complement typography |
|
|
2867
|
+
| [spatial-composition.md](spatial-composition.md) | Layout for text-heavy pages |
|
|
2868
|
+
| [../SKILL.md](../SKILL.md) | Design constraints and anti-slop bans |
|
|
2869
|
+
|
|
2870
|
+
---
|
|
2871
|
+
|
|
2872
|
+
### Rule: typography-system
|
|
2873
|
+
|
|
2874
|
+
---
|
|
2875
|
+
name: typography-system
|
|
2876
|
+
description: Modular scale, font pairing, line height/length, fluid typography, weight hierarchy, F-pattern reading
|
|
2877
|
+
---
|
|
2878
|
+
|
|
2879
|
+
# Typography System Reference
|
|
2880
|
+
|
|
2881
|
+
> Typography principles and decision-making - learn to think, not memorize.
|
|
2882
|
+
> **No fixed font names or sizes - understand the system.**
|
|
2883
|
+
|
|
2884
|
+
---
|
|
2885
|
+
|
|
2886
|
+
## 1. Modular Scale Principles
|
|
2887
|
+
|
|
2888
|
+
### What is a Modular Scale?
|
|
2889
|
+
|
|
2890
|
+
```
|
|
2891
|
+
A mathematical relationship between font sizes:
|
|
2892
|
+
├── Pick a BASE size (usually body text)
|
|
2893
|
+
├── Pick a RATIO (multiplier)
|
|
2894
|
+
└── Generate all sizes using: base × ratio^n
|
|
2895
|
+
```
|
|
2896
|
+
|
|
2897
|
+
### Common Ratios and When to Use
|
|
2898
|
+
|
|
2899
|
+
| Ratio | Value | Feeling | Best For |
|
|
2900
|
+
|-------|-------|---------|----------|
|
|
2901
|
+
| Minor Second | 1.067 | Very subtle | Dense UI, small screens |
|
|
2902
|
+
| Major Second | 1.125 | Subtle | Compact interfaces |
|
|
2903
|
+
| Minor Third | 1.2 | Comfortable | Mobile apps, cards |
|
|
2904
|
+
| Major Third | 1.25 | Balanced | General web (most common) |
|
|
2905
|
+
| Perfect Fourth | 1.333 | Noticeable | Editorial, blogs |
|
|
2906
|
+
| Perfect Fifth | 1.5 | Dramatic | Headlines, marketing |
|
|
2907
|
+
| Golden Ratio | 1.618 | Maximum impact | Hero sections, display |
|
|
2908
|
+
|
|
2909
|
+
### Generate Your Scale
|
|
2910
|
+
|
|
2911
|
+
```
|
|
2912
|
+
Given: base = YOUR_BASE_SIZE, ratio = YOUR_RATIO
|
|
2913
|
+
|
|
2914
|
+
Scale:
|
|
2915
|
+
├── xs: base ÷ ratio²
|
|
2916
|
+
├── sm: base ÷ ratio
|
|
2917
|
+
├── base: YOUR_BASE_SIZE
|
|
2918
|
+
├── lg: base × ratio
|
|
2919
|
+
├── xl: base × ratio²
|
|
2920
|
+
├── 2xl: base × ratio³
|
|
2921
|
+
├── 3xl: base × ratio⁴
|
|
2922
|
+
└── ... continue as needed
|
|
2923
|
+
```
|
|
2924
|
+
|
|
2925
|
+
### Choosing Base Size
|
|
2926
|
+
|
|
2927
|
+
| Context | Base Size Range | Why |
|
|
2928
|
+
|---------|-----------------|-----|
|
|
2929
|
+
| Mobile-first | 16-18px | Readability on small screens |
|
|
2930
|
+
| Desktop app | 14-16px | Information density |
|
|
2931
|
+
| Editorial | 18-21px | Long-form reading comfort |
|
|
2932
|
+
| Accessibility focus | 18px+ | Easier to read |
|
|
2933
|
+
|
|
2934
|
+
---
|
|
2935
|
+
|
|
2936
|
+
## 2. Font Pairing Principles
|
|
2937
|
+
|
|
2938
|
+
### What Makes Fonts Work Together
|
|
2939
|
+
|
|
2940
|
+
```
|
|
2941
|
+
Contrast + Harmony:
|
|
2942
|
+
├── Different ENOUGH to create hierarchy
|
|
2943
|
+
├── Similar ENOUGH to feel cohesive
|
|
2944
|
+
└── Usually: serif + sans, or display + neutral
|
|
2945
|
+
```
|
|
2946
|
+
|
|
2947
|
+
### Pairing Strategies
|
|
2948
|
+
|
|
2949
|
+
| Strategy | How | Result |
|
|
2950
|
+
|----------|-----|--------|
|
|
2951
|
+
| **Contrast** | Serif heading + Sans body | Classic, editorial feel |
|
|
2952
|
+
| **Same Family** | One variable font, different weights | Cohesive, modern |
|
|
2953
|
+
| **Same Designer** | Fonts by same foundry | Often harmonious proportions |
|
|
2954
|
+
| **Era Match** | Fonts from same time period | Historical consistency |
|
|
2955
|
+
|
|
2956
|
+
### What to Look For
|
|
2957
|
+
|
|
2958
|
+
```
|
|
2959
|
+
When pairing, compare:
|
|
2960
|
+
├── x-height (height of lowercase letters)
|
|
2961
|
+
├── Letter width (narrow vs wide)
|
|
2962
|
+
├── Stroke contrast (thin/thick variation)
|
|
2963
|
+
└── Overall mood (formal vs casual)
|
|
2964
|
+
```
|
|
2965
|
+
|
|
2966
|
+
### Safe Pairing Patterns
|
|
2967
|
+
|
|
2968
|
+
| Heading Style | Body Style | Mood |
|
|
2969
|
+
|---------------|------------|------|
|
|
2970
|
+
| Geometric sans | Humanist sans | Modern, friendly |
|
|
2971
|
+
| Display serif | Clean sans | Editorial, sophisticated |
|
|
2972
|
+
| Neutral sans | Same sans | Minimal, tech |
|
|
2973
|
+
| Bold geometric | Light geometric | Contemporary |
|
|
2974
|
+
|
|
2975
|
+
### Avoid
|
|
2976
|
+
|
|
2977
|
+
- ❌ Two decorative fonts together
|
|
2978
|
+
- ❌ Similar fonts that conflict
|
|
2979
|
+
- ❌ More than 2-3 font families
|
|
2980
|
+
- ❌ Fonts with very different x-heights
|
|
2981
|
+
|
|
2982
|
+
---
|
|
2983
|
+
|
|
2984
|
+
## 3. Line Height Principles
|
|
2985
|
+
|
|
2986
|
+
### The Relationship
|
|
2987
|
+
|
|
2988
|
+
```
|
|
2989
|
+
Line height depends on:
|
|
2990
|
+
├── Font size (larger text = less line height needed)
|
|
2991
|
+
├── Line length (longer lines = more line height)
|
|
2992
|
+
├── Font design (some fonts need more space)
|
|
2993
|
+
└── Content type (headings vs body)
|
|
2994
|
+
```
|
|
2995
|
+
|
|
2996
|
+
### Guidelines by Context
|
|
2997
|
+
|
|
2998
|
+
| Content Type | Line Height Range | Why |
|
|
2999
|
+
|--------------|-------------------|-----|
|
|
3000
|
+
| **Headings** | 1.1 - 1.3 | Short lines, want compact |
|
|
3001
|
+
| **Body text** | 1.4 - 1.6 | Comfortable reading |
|
|
3002
|
+
| **Long-form** | 1.6 - 1.8 | Maximum readability |
|
|
3003
|
+
| **UI elements** | 1.2 - 1.4 | Space efficiency |
|
|
3004
|
+
|
|
3005
|
+
### Adjustment Factors
|
|
3006
|
+
|
|
3007
|
+
- **Longer line length** → Increase line height
|
|
3008
|
+
- **Larger font size** → Decrease line height ratio
|
|
3009
|
+
- **All caps** → May need more line height
|
|
3010
|
+
- **Tight tracking** → May need more line height
|
|
3011
|
+
|
|
3012
|
+
---
|
|
3013
|
+
|
|
3014
|
+
## 4. Line Length Principles
|
|
3015
|
+
|
|
3016
|
+
### Optimal Reading Width
|
|
3017
|
+
|
|
3018
|
+
```
|
|
3019
|
+
The sweet spot: 45-75 characters per line
|
|
3020
|
+
├── < 45: Too choppy, breaks flow
|
|
3021
|
+
├── 45-75: Comfortable reading
|
|
3022
|
+
├── > 75: Eye tracking strain
|
|
3023
|
+
```
|
|
3024
|
+
|
|
3025
|
+
### How to Measure
|
|
3026
|
+
|
|
3027
|
+
```css
|
|
3028
|
+
/* Character-based (recommended) */
|
|
3029
|
+
max-width: 65ch; /* ch = width of "0" character */
|
|
3030
|
+
|
|
3031
|
+
/* This adapts to font size automatically */
|
|
3032
|
+
```
|
|
3033
|
+
|
|
3034
|
+
### Context Adjustments
|
|
3035
|
+
|
|
3036
|
+
| Context | Character Range |
|
|
3037
|
+
|---------|-----------------|
|
|
3038
|
+
| Desktop article | 60-75 characters |
|
|
3039
|
+
| Mobile | 35-50 characters |
|
|
3040
|
+
| Sidebar text | 30-45 characters |
|
|
3041
|
+
| Wide monitors | Still cap at ~75ch |
|
|
3042
|
+
|
|
3043
|
+
---
|
|
3044
|
+
|
|
3045
|
+
## 5. Responsive Typography Principles
|
|
3046
|
+
|
|
3047
|
+
### The Problem
|
|
3048
|
+
|
|
3049
|
+
```
|
|
3050
|
+
Fixed sizes don't scale well:
|
|
3051
|
+
├── Desktop size too big on mobile
|
|
3052
|
+
├── Mobile size too small on desktop
|
|
3053
|
+
└── Breakpoint jumps feel jarring
|
|
3054
|
+
```
|
|
3055
|
+
|
|
3056
|
+
### Fluid Typography (clamp)
|
|
3057
|
+
|
|
3058
|
+
```css
|
|
3059
|
+
/* Syntax: clamp(MIN, PREFERRED, MAX) */
|
|
3060
|
+
font-size: clamp(
|
|
3061
|
+
MINIMUM_SIZE,
|
|
3062
|
+
FLUID_CALCULATION,
|
|
3063
|
+
MAXIMUM_SIZE
|
|
3064
|
+
);
|
|
3065
|
+
|
|
3066
|
+
/* FLUID_CALCULATION typically:
|
|
3067
|
+
base + viewport-relative-unit */
|
|
3068
|
+
```
|
|
3069
|
+
|
|
3070
|
+
### Scaling Strategy
|
|
3071
|
+
|
|
3072
|
+
| Element | Scaling Behavior |
|
|
3073
|
+
|---------|-----------------|
|
|
3074
|
+
| Body text | Slight scaling (1rem → 1.125rem) |
|
|
3075
|
+
| Subheadings | Moderate scaling |
|
|
3076
|
+
| Headings | More dramatic scaling |
|
|
3077
|
+
| Display text | Most dramatic scaling |
|
|
3078
|
+
|
|
3079
|
+
---
|
|
3080
|
+
|
|
3081
|
+
## 6. Weight and Emphasis Principles
|
|
3082
|
+
|
|
3083
|
+
### Semantic Weight Usage
|
|
3084
|
+
|
|
3085
|
+
| Weight Range | Name | Use For |
|
|
3086
|
+
|--------------|------|---------|
|
|
3087
|
+
| 300-400 | Light/Normal | Body text, paragraphs |
|
|
3088
|
+
| 500 | Medium | Subtle emphasis |
|
|
3089
|
+
| 600 | Semibold | Subheadings, labels |
|
|
3090
|
+
| 700 | Bold | Headings, strong emphasis |
|
|
3091
|
+
| 800-900 | Heavy/Black | Display, hero text |
|
|
3092
|
+
|
|
3093
|
+
### Creating Contrast
|
|
3094
|
+
|
|
3095
|
+
```
|
|
3096
|
+
Good contrast = skip at least 2 weight levels
|
|
3097
|
+
├── 400 body + 700 heading = good
|
|
3098
|
+
├── 400 body + 500 emphasis = subtle
|
|
3099
|
+
├── 600 heading + 700 subheading = too similar
|
|
3100
|
+
```
|
|
3101
|
+
|
|
3102
|
+
### Avoid
|
|
3103
|
+
|
|
3104
|
+
- ❌ Too many weights (max 3-4 per page)
|
|
3105
|
+
- ❌ Adjacent weights for hierarchy (400/500)
|
|
3106
|
+
- ❌ Heavy weights for long text
|
|
3107
|
+
|
|
3108
|
+
---
|
|
3109
|
+
|
|
3110
|
+
## 7. Letter Spacing (Tracking)
|
|
3111
|
+
|
|
3112
|
+
### Principles
|
|
3113
|
+
|
|
3114
|
+
```
|
|
3115
|
+
Large text (headings): tighter tracking
|
|
3116
|
+
├── Letters are big, gaps feel larger
|
|
3117
|
+
└── Slight negative tracking looks better
|
|
3118
|
+
|
|
3119
|
+
Small text (body): normal or slightly wider
|
|
3120
|
+
├── Improves readability at small sizes
|
|
3121
|
+
└── Never negative for body text
|
|
3122
|
+
|
|
3123
|
+
ALL CAPS: always wider tracking
|
|
3124
|
+
├── Uppercase lacks ascenders/descenders
|
|
3125
|
+
└── Needs more space to feel right
|
|
3126
|
+
```
|
|
3127
|
+
|
|
3128
|
+
### Adjustment Guidelines
|
|
3129
|
+
|
|
3130
|
+
| Context | Tracking Adjustment |
|
|
3131
|
+
|---------|---------------------|
|
|
3132
|
+
| Display/Hero | -2% to -4% |
|
|
3133
|
+
| Headings | -1% to -2% |
|
|
3134
|
+
| Body text | 0% (normal) |
|
|
3135
|
+
| Small text | +1% to +2% |
|
|
3136
|
+
| ALL CAPS | +5% to +10% |
|
|
3137
|
+
|
|
3138
|
+
---
|
|
3139
|
+
|
|
3140
|
+
## 8. Hierarchy Principles
|
|
3141
|
+
|
|
3142
|
+
### Visual Hierarchy Through Type
|
|
3143
|
+
|
|
3144
|
+
```
|
|
3145
|
+
Ways to create hierarchy:
|
|
3146
|
+
├── SIZE (most obvious)
|
|
3147
|
+
├── WEIGHT (bold stands out)
|
|
3148
|
+
├── COLOR (contrast levels)
|
|
3149
|
+
├── SPACING (margins separate sections)
|
|
3150
|
+
└── POSITION (top = important)
|
|
3151
|
+
```
|
|
3152
|
+
|
|
3153
|
+
### Typical Hierarchy
|
|
3154
|
+
|
|
3155
|
+
| Level | Characteristics |
|
|
3156
|
+
|-------|-----------------|
|
|
3157
|
+
| Primary (H1) | Largest, boldest, most distinct |
|
|
3158
|
+
| Secondary (H2) | Noticeably smaller but still bold |
|
|
3159
|
+
| Tertiary (H3) | Medium size, may use weight only |
|
|
3160
|
+
| Body | Standard size and weight |
|
|
3161
|
+
| Caption/Meta | Smaller, often lighter color |
|
|
3162
|
+
|
|
3163
|
+
### Testing Hierarchy
|
|
3164
|
+
|
|
3165
|
+
Ask: "Can I tell what's most important at a glance?"
|
|
3166
|
+
|
|
3167
|
+
If squinting at the page, the hierarchy should still be clear.
|
|
3168
|
+
|
|
3169
|
+
---
|
|
3170
|
+
|
|
3171
|
+
## 9. Readability Psychology
|
|
3172
|
+
|
|
3173
|
+
### F-Pattern Reading
|
|
3174
|
+
|
|
3175
|
+
```
|
|
3176
|
+
Users scan in F-pattern:
|
|
3177
|
+
├── Across the top (first line)
|
|
3178
|
+
├── Down the left side
|
|
3179
|
+
├── Across again (subheading)
|
|
3180
|
+
└── Continue down left
|
|
3181
|
+
```
|
|
3182
|
+
|
|
3183
|
+
**Implication**: Key info on left and in headings
|
|
3184
|
+
|
|
3185
|
+
### Chunking for Comprehension
|
|
3186
|
+
|
|
3187
|
+
- Short paragraphs (3-4 lines max)
|
|
3188
|
+
- Clear subheadings
|
|
3189
|
+
- Bullet points for lists
|
|
3190
|
+
- White space between sections
|
|
3191
|
+
|
|
3192
|
+
### Cognitive Ease
|
|
3193
|
+
|
|
3194
|
+
- Familiar fonts = easier reading
|
|
3195
|
+
- High contrast = less strain
|
|
3196
|
+
- Consistent patterns = predictable
|
|
3197
|
+
|
|
3198
|
+
---
|
|
3199
|
+
|
|
3200
|
+
## 10. Typography Selection Checklist
|
|
3201
|
+
|
|
3202
|
+
Before finalizing typography:
|
|
3203
|
+
|
|
3204
|
+
- [ ] **Asked user for font preferences?**
|
|
3205
|
+
- [ ] **Considered brand/context?**
|
|
3206
|
+
- [ ] **Selected appropriate scale ratio?**
|
|
3207
|
+
- [ ] **Limited to 2-3 font families?**
|
|
3208
|
+
- [ ] **Tested readability at all sizes?**
|
|
3209
|
+
- [ ] **Checked line length (45-75ch)?**
|
|
3210
|
+
- [ ] **Verified contrast for accessibility?**
|
|
3211
|
+
- [ ] **Different from your last project?**
|
|
3212
|
+
|
|
3213
|
+
### Anti-Patterns
|
|
3214
|
+
|
|
3215
|
+
- ❌ Same fonts every project
|
|
3216
|
+
- ❌ Too many font families
|
|
3217
|
+
- ❌ Ignoring readability for style
|
|
3218
|
+
- ❌ Fixed sizes without responsiveness
|
|
3219
|
+
- ❌ Decorative fonts for body text
|
|
3220
|
+
|
|
3221
|
+
---
|
|
3222
|
+
|
|
3223
|
+
> **Remember**: Typography is about communication clarity. Choose based on content needs and audience, not personal preference.
|
|
3224
|
+
|
|
3225
|
+
---
|
|
3226
|
+
|
|
3227
|
+
|
|
3228
|
+
|
|
3229
|
+
---
|
|
3230
|
+
|
|
3231
|
+
## 🔗 Related
|
|
3232
|
+
|
|
3233
|
+
| File | When to Read |
|
|
3234
|
+
|------|-------------|
|
|
3235
|
+
| [decision-trees.md](decision-trees.md) | Typography decision tree by content type |
|
|
3236
|
+
| [ux-psychology.md](ux-psychology.md) | Readability psychology and cognitive load |
|
|
3237
|
+
| [color-system.md](color-system.md) | Text contrast and accessibility |
|
|
3238
|
+
| [../SKILL.md](../SKILL.md) | Typography quick rules |
|
|
3239
|
+
|
|
3240
|
+
---
|
|
3241
|
+
|
|
3242
|
+
### Rule: ux-psychology
|
|
3243
|
+
|
|
3244
|
+
---
|
|
3245
|
+
name: ux-psychology
|
|
3246
|
+
description: Core UX laws (Hick's, Fitts', Miller's, Von Restorff), emotional design, trust signals, cognitive load, persona guide
|
|
3247
|
+
---
|
|
3248
|
+
|
|
3249
|
+
# UX Psychology Reference
|
|
3250
|
+
|
|
3251
|
+
> Deep dive into UX laws, emotional design, trust building, and behavioral psychology.
|
|
3252
|
+
|
|
3253
|
+
---
|
|
3254
|
+
|
|
3255
|
+
## 1. Core UX Laws
|
|
3256
|
+
|
|
3257
|
+
### Hick's Law
|
|
3258
|
+
|
|
3259
|
+
**Principle:** The time to make a decision increases logarithmically with the number of choices.
|
|
3260
|
+
|
|
3261
|
+
```
|
|
3262
|
+
Decision Time = a + b × log₂(n + 1)
|
|
3263
|
+
Where n = number of choices
|
|
3264
|
+
```
|
|
3265
|
+
|
|
3266
|
+
**Application:**
|
|
3267
|
+
- Navigation: Max 5-7 top-level items
|
|
3268
|
+
- Forms: Break into steps (progressive disclosure)
|
|
3269
|
+
- Options: Default selections when possible
|
|
3270
|
+
- Filters: Prioritize most-used, hide advanced
|
|
3271
|
+
|
|
3272
|
+
**Example:**
|
|
3273
|
+
```
|
|
3274
|
+
❌ Bad: 15 menu items in one nav
|
|
3275
|
+
✅ Good: 5 main categories + "More"
|
|
3276
|
+
|
|
3277
|
+
❌ Bad: 20 form fields at once
|
|
3278
|
+
✅ Good: 3-step wizard with 5-7 fields each
|
|
3279
|
+
```
|
|
3280
|
+
|
|
3281
|
+
---
|
|
3282
|
+
|
|
3283
|
+
### Fitts' Law
|
|
3284
|
+
|
|
3285
|
+
**Principle:** Time to reach a target = function of distance and size.
|
|
3286
|
+
|
|
3287
|
+
```
|
|
3288
|
+
MT = a + b × log₂(1 + D/W)
|
|
3289
|
+
Where D = distance, W = width
|
|
3290
|
+
```
|
|
3291
|
+
|
|
3292
|
+
**Application:**
|
|
3293
|
+
- CTAs: Make primary buttons larger (min 44px height)
|
|
3294
|
+
- Touch targets: 44×44px minimum on mobile
|
|
3295
|
+
- Placement: Important actions near natural cursor position
|
|
3296
|
+
- Corners: "Magic corners" (infinite edge = easy to hit)
|
|
3297
|
+
|
|
3298
|
+
**Button Sizing:**
|
|
3299
|
+
```css
|
|
3300
|
+
/* Size by importance */
|
|
3301
|
+
.btn-primary { height: 48px; padding: 0 24px; }
|
|
3302
|
+
.btn-secondary { height: 40px; padding: 0 16px; }
|
|
3303
|
+
.btn-tertiary { height: 36px; padding: 0 12px; }
|
|
3304
|
+
|
|
3305
|
+
/* Mobile touch targets */
|
|
3306
|
+
@media (hover: none) {
|
|
3307
|
+
.btn { min-height: 44px; min-width: 44px; }
|
|
3308
|
+
}
|
|
3309
|
+
```
|
|
3310
|
+
|
|
3311
|
+
---
|
|
3312
|
+
|
|
3313
|
+
### Miller's Law
|
|
3314
|
+
|
|
3315
|
+
**Principle:** Average person can hold 7±2 chunks in working memory.
|
|
3316
|
+
|
|
3317
|
+
**Application:**
|
|
3318
|
+
- Lists: Group into chunks of 5-7 items
|
|
3319
|
+
- Navigation: Max 7 menu items
|
|
3320
|
+
- Content: Break long content with headings
|
|
3321
|
+
- Phone numbers: 555-123-4567 (chunked)
|
|
3322
|
+
|
|
3323
|
+
**Chunking Example:**
|
|
3324
|
+
```
|
|
3325
|
+
❌ 5551234567
|
|
3326
|
+
✅ 555-123-4567
|
|
3327
|
+
|
|
3328
|
+
❌ Long paragraph of text without breaks
|
|
3329
|
+
✅ Short paragraphs
|
|
3330
|
+
With bullet points
|
|
3331
|
+
And subheadings
|
|
3332
|
+
```
|
|
3333
|
+
|
|
3334
|
+
---
|
|
3335
|
+
|
|
3336
|
+
### Von Restorff Effect (Isolation Effect)
|
|
3337
|
+
|
|
3338
|
+
**Principle:** An item that stands out is more likely to be remembered.
|
|
3339
|
+
|
|
3340
|
+
**Application:**
|
|
3341
|
+
- CTA buttons: Distinct color from other elements
|
|
3342
|
+
- Pricing: Highlight recommended plan
|
|
3343
|
+
- Important info: Visual differentiation
|
|
3344
|
+
- New features: Badge or callout
|
|
3345
|
+
|
|
3346
|
+
**Example:**
|
|
3347
|
+
```css
|
|
3348
|
+
/* All buttons gray, primary stands out */
|
|
3349
|
+
.btn { background: #E5E7EB; }
|
|
3350
|
+
.btn-primary { background: #3B82F6; }
|
|
3351
|
+
|
|
3352
|
+
/* Recommended plan highlighted */
|
|
3353
|
+
.pricing-card { border: 1px solid #E5E7EB; }
|
|
3354
|
+
.pricing-card.popular {
|
|
3355
|
+
border: 2px solid #3B82F6;
|
|
3356
|
+
box-shadow: var(--shadow-lg);
|
|
3357
|
+
}
|
|
3358
|
+
```
|
|
3359
|
+
|
|
3360
|
+
---
|
|
3361
|
+
|
|
3362
|
+
### Serial Position Effect
|
|
3363
|
+
|
|
3364
|
+
**Principle:** Items at the beginning (primacy) and end (recency) of a list are remembered best.
|
|
3365
|
+
|
|
3366
|
+
**Application:**
|
|
3367
|
+
- Navigation: Most important items first and last
|
|
3368
|
+
- Lists: Key info at top and bottom
|
|
3369
|
+
- Forms: Most critical fields at start
|
|
3370
|
+
- CTAs: Repeat at top and bottom of long pages
|
|
3371
|
+
|
|
3372
|
+
**Example:**
|
|
3373
|
+
```
|
|
3374
|
+
Navigation: Home | [key items] | Contact
|
|
3375
|
+
|
|
3376
|
+
Long landing page:
|
|
3377
|
+
- CTA at hero (top)
|
|
3378
|
+
- Content sections
|
|
3379
|
+
- CTA repeated at bottom
|
|
3380
|
+
```
|
|
3381
|
+
|
|
3382
|
+
---
|
|
3383
|
+
|
|
3384
|
+
## 2. Emotional Design (Don Norman)
|
|
3385
|
+
|
|
3386
|
+
### Three Levels of Processing
|
|
3387
|
+
|
|
3388
|
+
```
|
|
3389
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
3390
|
+
│ VISCERAL (Lizard Brain) │
|
|
3391
|
+
│ ───────────────────── │
|
|
3392
|
+
│ ⬢ Immediate, automatic reaction │
|
|
3393
|
+
│ ⬢ First impressions (first 50ms) │
|
|
3394
|
+
│ ⬢ Aesthetics: colors, shapes, imagery │
|
|
3395
|
+
│ ⬢ "Wow, this looks beautiful!" │
|
|
3396
|
+
├─────────────────────────────────────────────────────────────┤
|
|
3397
|
+
│ BEHAVIORAL (Functional Brain) │
|
|
3398
|
+
│ ───────────────────────────── │
|
|
3399
|
+
│ ⬢ Usability and function │
|
|
3400
|
+
│ ⬢ Pleasure from effective use │
|
|
3401
|
+
│ ⬢ Performance, reliability, ease │
|
|
3402
|
+
│ ⬢ "This works exactly how I expected!" │
|
|
3403
|
+
├─────────────────────────────────────────────────────────────┤
|
|
3404
|
+
│ REFLECTIVE (Conscious Brain) │
|
|
3405
|
+
│ ───────────────────────────── │
|
|
3406
|
+
│ ⬢ Conscious thought and meaning │
|
|
3407
|
+
│ ⬢ Personal identity and values │
|
|
3408
|
+
│ ⬢ Long-term memory and loyalty │
|
|
3409
|
+
│ ⬢ "This brand represents who I am" │
|
|
3410
|
+
└─────────────────────────────────────────────────────────────┘
|
|
3411
|
+
```
|
|
3412
|
+
|
|
3413
|
+
### Designing for Each Level
|
|
3414
|
+
|
|
3415
|
+
**Visceral:**
|
|
3416
|
+
```css
|
|
3417
|
+
/* Beautiful first impression */
|
|
3418
|
+
.hero {
|
|
3419
|
+
background: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%);
|
|
3420
|
+
color: white;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
/* Pleasing microinteractions */
|
|
3424
|
+
.button:hover {
|
|
3425
|
+
transform: translateY(-2px);
|
|
3426
|
+
box-shadow: var(--shadow-lg);
|
|
3427
|
+
}
|
|
3428
|
+
```
|
|
3429
|
+
|
|
3430
|
+
**Behavioral:**
|
|
3431
|
+
```javascript
|
|
3432
|
+
// Instant feedback
|
|
3433
|
+
button.onclick = () => {
|
|
3434
|
+
button.disabled = true;
|
|
3435
|
+
button.textContent = 'Saving...';
|
|
3436
|
+
|
|
3437
|
+
save().then(() => {
|
|
3438
|
+
showSuccess('Saved!'); // Immediate confirmation
|
|
3439
|
+
});
|
|
3440
|
+
};
|
|
3441
|
+
```
|
|
3442
|
+
|
|
3443
|
+
**Reflective:**
|
|
3444
|
+
```html
|
|
3445
|
+
<!-- Brand story and values -->
|
|
3446
|
+
<section class="about">
|
|
3447
|
+
<h2>Why We Exist</h2>
|
|
3448
|
+
<p>We believe technology should empower, not complicate...</p>
|
|
3449
|
+
</section>
|
|
3450
|
+
|
|
3451
|
+
<!-- Social proof connecting to identity -->
|
|
3452
|
+
<blockquote>
|
|
3453
|
+
"This tool helped me become the designer I wanted to be."
|
|
3454
|
+
</blockquote>
|
|
3455
|
+
```
|
|
3456
|
+
|
|
3457
|
+
---
|
|
3458
|
+
|
|
3459
|
+
## 3. Trust Building System
|
|
3460
|
+
|
|
3461
|
+
### Trust Signal Categories
|
|
3462
|
+
|
|
3463
|
+
| Category | Elements | Implementation |
|
|
3464
|
+
|----------|----------|----------------|
|
|
3465
|
+
| **Security** | SSL, badges, encryption | Visible padlock, security logos on forms |
|
|
3466
|
+
| **Social Proof** | Reviews, testimonials, logos | Star ratings, customer photos, brand logos |
|
|
3467
|
+
| **Transparency** | Policies, pricing, contact | Clear links, no hidden fees, real address |
|
|
3468
|
+
| **Professional** | Design quality, consistency | No broken elements, consistent branding |
|
|
3469
|
+
| **Authority** | Certifications, awards, media | "As seen in...", industry certifications |
|
|
3470
|
+
|
|
3471
|
+
### Trust Signal Placement
|
|
3472
|
+
|
|
3473
|
+
```
|
|
3474
|
+
┌────────────────────────────────────────────────────┐
|
|
3475
|
+
│ HEADER: Trust banner ("Free shipping | 30-day │
|
|
3476
|
+
│ returns | Secure checkout") │
|
|
3477
|
+
├────────────────────────────────────────────────────┤
|
|
3478
|
+
│ HERO: Social proof ("Trusted by 10,000+") │
|
|
3479
|
+
├────────────────────────────────────────────────────┤
|
|
3480
|
+
│ PRODUCT: Reviews visible, security badges │
|
|
3481
|
+
├────────────────────────────────────────────────────┤
|
|
3482
|
+
│ CHECKOUT: Payment icons, SSL badge, guarantee │
|
|
3483
|
+
├────────────────────────────────────────────────────┤
|
|
3484
|
+
│ FOOTER: Contact info, policies, certifications │
|
|
3485
|
+
└────────────────────────────────────────────────────┘
|
|
3486
|
+
```
|
|
3487
|
+
|
|
3488
|
+
### Trust-Building CSS Patterns
|
|
3489
|
+
|
|
3490
|
+
```css
|
|
3491
|
+
/* Trust badge styling */
|
|
3492
|
+
.trust-badge {
|
|
3493
|
+
display: flex;
|
|
3494
|
+
align-items: center;
|
|
3495
|
+
gap: 8px;
|
|
3496
|
+
padding: 12px 16px;
|
|
3497
|
+
background: #F0FDF4; /* Light green = security */
|
|
3498
|
+
border-radius: 2px; /* Sharp for trust = precision feel */
|
|
3499
|
+
font-size: 14px;
|
|
3500
|
+
color: #166534;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
/* Secure form indicator */
|
|
3504
|
+
.secure-form::before {
|
|
3505
|
+
content: '🔒 Secure form';
|
|
3506
|
+
display: block;
|
|
3507
|
+
font-size: 12px;
|
|
3508
|
+
color: #166534;
|
|
3509
|
+
margin-bottom: 8px;
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
/* Testimonial card */
|
|
3513
|
+
.testimonial {
|
|
3514
|
+
display: flex;
|
|
3515
|
+
gap: 16px;
|
|
3516
|
+
padding: 24px;
|
|
3517
|
+
background: white;
|
|
3518
|
+
border-radius: 16px; /* Friendly = larger radius */
|
|
3519
|
+
box-shadow: var(--shadow-sm);
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
.testimonial-avatar {
|
|
3523
|
+
width: 48px;
|
|
3524
|
+
height: 48px;
|
|
3525
|
+
border-radius: 50%; /* Real photos > initials */
|
|
3526
|
+
}
|
|
3527
|
+
```
|
|
3528
|
+
|
|
3529
|
+
---
|
|
3530
|
+
|
|
3531
|
+
## 4. Cognitive Load Management
|
|
3532
|
+
|
|
3533
|
+
### Three Types of Cognitive Load
|
|
3534
|
+
|
|
3535
|
+
| Type | Definition | Designer's Role |
|
|
3536
|
+
|------|------------|-----------------|
|
|
3537
|
+
| **Intrinsic** | Inherent complexity of task | Break into smaller steps |
|
|
3538
|
+
| **Extraneous** | Load from poor design | Eliminate this! |
|
|
3539
|
+
| **Germane** | Effort for learning | Support and encourage |
|
|
3540
|
+
|
|
3541
|
+
### Reduction Strategies
|
|
3542
|
+
|
|
3543
|
+
**1. Simplify (Reduce Extraneous)**
|
|
3544
|
+
```css
|
|
3545
|
+
/* Visual noise → Clean */
|
|
3546
|
+
.card-busy {
|
|
3547
|
+
border: 2px solid red;
|
|
3548
|
+
background: linear-gradient(...);
|
|
3549
|
+
box-shadow: 0 0 20px ...;
|
|
3550
|
+
/* Too much! */
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
.card-clean {
|
|
3554
|
+
background: white;
|
|
3555
|
+
border-radius: 16px;
|
|
3556
|
+
box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
|
|
3557
|
+
/* Calm, focused */
|
|
3558
|
+
}
|
|
3559
|
+
```
|
|
3560
|
+
|
|
3561
|
+
**2. Chunk Information**
|
|
3562
|
+
```html
|
|
3563
|
+
<!-- Overwhelming -->
|
|
3564
|
+
<form>
|
|
3565
|
+
<!-- 15 fields at once -->
|
|
3566
|
+
</form>
|
|
3567
|
+
|
|
3568
|
+
<!-- Chunked -->
|
|
3569
|
+
<form>
|
|
3570
|
+
<fieldset>
|
|
3571
|
+
<legend>Step 1: Personal Info</legend>
|
|
3572
|
+
<!-- 3-4 fields -->
|
|
3573
|
+
</fieldset>
|
|
3574
|
+
<fieldset>
|
|
3575
|
+
<legend>Step 2: Shipping</legend>
|
|
3576
|
+
<!-- 3-4 fields -->
|
|
3577
|
+
</fieldset>
|
|
3578
|
+
</form>
|
|
3579
|
+
```
|
|
3580
|
+
|
|
3581
|
+
**3. Progressive Disclosure**
|
|
3582
|
+
```html
|
|
3583
|
+
<!-- Hide complexity until needed -->
|
|
3584
|
+
<div class="filters">
|
|
3585
|
+
<div class="filters-basic">
|
|
3586
|
+
<!-- Common filters visible -->
|
|
3587
|
+
</div>
|
|
3588
|
+
<button onclick="toggleAdvanced()">
|
|
3589
|
+
Advanced Options ▼
|
|
3590
|
+
</button>
|
|
3591
|
+
<div class="filters-advanced" hidden>
|
|
3592
|
+
<!-- Complex filters hidden -->
|
|
3593
|
+
</div>
|
|
3594
|
+
</div>
|
|
3595
|
+
```
|
|
3596
|
+
|
|
3597
|
+
**4. Use Familiar Patterns**
|
|
3598
|
+
```
|
|
3599
|
+
✅ Standard navigation placement
|
|
3600
|
+
✅ Expected icon meanings (🔍 = search)
|
|
3601
|
+
✅ Conventional form layouts
|
|
3602
|
+
✅ Common gesture patterns (swipe, pinch)
|
|
3603
|
+
```
|
|
3604
|
+
|
|
3605
|
+
**5. Offload Information**
|
|
3606
|
+
```html
|
|
3607
|
+
<!-- Don't make users remember -->
|
|
3608
|
+
<label>
|
|
3609
|
+
Card Number
|
|
3610
|
+
<input type="text" inputmode="numeric"
|
|
3611
|
+
autocomplete="cc-number"
|
|
3612
|
+
placeholder="1234 5678 9012 3456">
|
|
3613
|
+
</label>
|
|
3614
|
+
|
|
3615
|
+
<!-- Show what they entered -->
|
|
3616
|
+
<div class="order-summary">
|
|
3617
|
+
<p>Shipping to: <strong>John Doe, 123 Main St...</strong></p>
|
|
3618
|
+
<a href="#">Edit</a>
|
|
3619
|
+
</div>
|
|
3620
|
+
```
|
|
3621
|
+
|
|
3622
|
+
---
|
|
3623
|
+
|
|
3624
|
+
## 5. Persuasive Design (Ethical)
|
|
3625
|
+
|
|
3626
|
+
### Ethical Persuasion Techniques
|
|
3627
|
+
|
|
3628
|
+
| Technique | Ethical Use | Dark Pattern (Avoid) |
|
|
3629
|
+
|-----------|-------------|----------------------|
|
|
3630
|
+
| **Scarcity** | Real stock levels | Fake countdown timers |
|
|
3631
|
+
| **Social Proof** | Genuine reviews | Fake testimonials |
|
|
3632
|
+
| **Authority** | Real credentials | Misleading badges |
|
|
3633
|
+
| **Urgency** | Real deadlines | Manufactured FOMO |
|
|
3634
|
+
| **Commitment** | Progress saving | Guilt-tripping |
|
|
3635
|
+
|
|
3636
|
+
### Nudge Patterns
|
|
3637
|
+
|
|
3638
|
+
**Smart Defaults:**
|
|
3639
|
+
```html
|
|
3640
|
+
<!-- Pre-select the recommended option -->
|
|
3641
|
+
<input type="radio" name="plan" value="monthly">
|
|
3642
|
+
<input type="radio" name="plan" value="annual" checked>
|
|
3643
|
+
Annual (Save 20%)
|
|
3644
|
+
```
|
|
3645
|
+
|
|
3646
|
+
**Anchoring:**
|
|
3647
|
+
```html
|
|
3648
|
+
<!-- Show original price to frame discount -->
|
|
3649
|
+
<div class="price">
|
|
3650
|
+
<span class="original">$99</span>
|
|
3651
|
+
<span class="current">$79</span>
|
|
3652
|
+
<span class="savings">Save 20%</span>
|
|
3653
|
+
</div>
|
|
3654
|
+
```
|
|
3655
|
+
|
|
3656
|
+
**Social Proof:**
|
|
3657
|
+
```html
|
|
3658
|
+
<!-- Real-time activity -->
|
|
3659
|
+
<div class="activity">
|
|
3660
|
+
<span class="avatar">👤</span>
|
|
3661
|
+
<span>Sarah from NYC just purchased</span>
|
|
3662
|
+
</div>
|
|
3663
|
+
|
|
3664
|
+
<!-- Aggregate proof -->
|
|
3665
|
+
<p>Join 50,000+ designers who use our tool</p>
|
|
3666
|
+
```
|
|
3667
|
+
|
|
3668
|
+
**Progress & Commitment:**
|
|
3669
|
+
```html
|
|
3670
|
+
<!-- Show progress to encourage completion -->
|
|
3671
|
+
<div class="progress">
|
|
3672
|
+
<div class="progress-bar" style="width: 60%"></div>
|
|
3673
|
+
<span>60% complete - almost there!</span>
|
|
3674
|
+
</div>
|
|
3675
|
+
```
|
|
3676
|
+
|
|
3677
|
+
---
|
|
3678
|
+
|
|
3679
|
+
## 6. User Persona Quick Reference
|
|
3680
|
+
|
|
3681
|
+
### Gen Z (Born 1997-2012)
|
|
3682
|
+
|
|
3683
|
+
```
|
|
3684
|
+
CHARACTERISTICS:
|
|
3685
|
+
- Digital natives, mobile-first
|
|
3686
|
+
- Value authenticity, diversity
|
|
3687
|
+
- Short attention spans
|
|
3688
|
+
- Visual learners
|
|
3689
|
+
|
|
3690
|
+
DESIGN APPROACH:
|
|
3691
|
+
├── Colors: Vibrant, hypercolor, bold gradients
|
|
3692
|
+
├── Typography: Large, variable, experimental
|
|
3693
|
+
├── Layout: Vertical scroll, mobile-native
|
|
3694
|
+
├── Interactions: Fast, gamified, gesture-based
|
|
3695
|
+
├── Content: Short-form video, memes, stories
|
|
3696
|
+
└── Trust: Peer reviews > authority
|
|
3697
|
+
```
|
|
3698
|
+
|
|
3699
|
+
### Millennials (Born 1981-1996)
|
|
3700
|
+
|
|
3701
|
+
```
|
|
3702
|
+
CHARACTERISTICS:
|
|
3703
|
+
- Value experiences over things
|
|
3704
|
+
- Research before buying
|
|
3705
|
+
- Socially conscious
|
|
3706
|
+
- Price-sensitive but quality-aware
|
|
3707
|
+
|
|
3708
|
+
DESIGN APPROACH:
|
|
3709
|
+
├── Colors: Muted pastels, earth tones
|
|
3710
|
+
├── Typography: Clean, readable sans-serif
|
|
3711
|
+
├── Layout: Responsive, card-based
|
|
3712
|
+
├── Interactions: Smooth, purposeful animations
|
|
3713
|
+
├── Content: Value-driven, transparent
|
|
3714
|
+
└── Trust: Reviews, sustainability, values
|
|
3715
|
+
```
|
|
3716
|
+
|
|
3717
|
+
### Gen X (Born 1965-1980)
|
|
3718
|
+
|
|
3719
|
+
```
|
|
3720
|
+
CHARACTERISTICS:
|
|
3721
|
+
- Independent, self-reliant
|
|
3722
|
+
- Value efficiency
|
|
3723
|
+
- Skeptical of marketing
|
|
3724
|
+
- Balanced tech comfort
|
|
3725
|
+
|
|
3726
|
+
DESIGN APPROACH:
|
|
3727
|
+
├── Colors: Professional, trustworthy
|
|
3728
|
+
├── Typography: Familiar, conservative
|
|
3729
|
+
├── Layout: Clear hierarchy, traditional
|
|
3730
|
+
├── Interactions: Functional, not flashy
|
|
3731
|
+
├── Content: Direct, fact-based
|
|
3732
|
+
└── Trust: Expertise, track record
|
|
3733
|
+
```
|
|
3734
|
+
|
|
3735
|
+
### Baby Boomers (Born 1946-1964)
|
|
3736
|
+
|
|
3737
|
+
```
|
|
3738
|
+
CHARACTERISTICS:
|
|
3739
|
+
- Detail-oriented
|
|
3740
|
+
- Loyal when trusted
|
|
3741
|
+
- Value personal service
|
|
3742
|
+
- Less tech-confident
|
|
3743
|
+
|
|
3744
|
+
DESIGN APPROACH:
|
|
3745
|
+
├── Colors: High contrast, simple palette
|
|
3746
|
+
├── Typography: Large (18px+), high contrast
|
|
3747
|
+
├── Layout: Simple, linear, spacious
|
|
3748
|
+
├── Interactions: Minimal, clear feedback
|
|
3749
|
+
├── Content: Comprehensive, detailed
|
|
3750
|
+
└── Trust: Phone numbers, real people
|
|
3751
|
+
```
|
|
3752
|
+
|
|
3753
|
+
---
|
|
3754
|
+
|
|
3755
|
+
## 7. Emotion Color Mapping
|
|
3756
|
+
|
|
3757
|
+
```
|
|
3758
|
+
┌────────────────────────────────────────────────────┐
|
|
3759
|
+
│ EMOTION │ COLORS │ USE │
|
|
3760
|
+
├───────────────────┼───────────────────┼────────────┤
|
|
3761
|
+
│ Trust │ Blue, Green │ Finance │
|
|
3762
|
+
│ Excitement │ Red, Orange │ Sales │
|
|
3763
|
+
│ Calm │ Blue, Soft green │ Wellness │
|
|
3764
|
+
│ Luxury │ Black, Gold │ Premium │
|
|
3765
|
+
│ Creativity │ Teal, Pink │ Art │
|
|
3766
|
+
│ Energy │ Yellow, Orange │ Sports │
|
|
3767
|
+
│ Nature │ Green, Brown │ Eco │
|
|
3768
|
+
│ Happiness │ Yellow, Orange │ Kids │
|
|
3769
|
+
│ Sophistication │ Gray, Navy │ Corporate │
|
|
3770
|
+
│ Urgency │ Red │ Errors │
|
|
3771
|
+
└───────────────────┴───────────────────┴────────────┘
|
|
3772
|
+
```
|
|
3773
|
+
|
|
3774
|
+
---
|
|
3775
|
+
|
|
3776
|
+
## 8. Psychology Checklist
|
|
3777
|
+
|
|
3778
|
+
### Before Launch
|
|
3779
|
+
|
|
3780
|
+
- [ ] **Hick's Law:** No more than 7 choices in navigation
|
|
3781
|
+
- [ ] **Fitts' Law:** Primary CTAs are large and reachable
|
|
3782
|
+
- [ ] **Miller's Law:** Content is chunked appropriately
|
|
3783
|
+
- [ ] **Von Restorff:** CTAs stand out from surroundings
|
|
3784
|
+
- [ ] **Trust:** Security badges, reviews, policies visible
|
|
3785
|
+
- [ ] **Emotional:** Design evokes intended feeling
|
|
3786
|
+
- [ ] **Cognitive Load:** Interface is clean, not overwhelming
|
|
3787
|
+
- [ ] **Familiar Patterns:** Standard conventions used
|
|
3788
|
+
- [ ] **Feedback:** All actions have clear responses
|
|
3789
|
+
- [ ] **Accessibility:** Inclusive for all users
|
|
3790
|
+
|
|
3791
|
+
---
|
|
3792
|
+
|
|
3793
|
+
|
|
3794
|
+
|
|
3795
|
+
---
|
|
3796
|
+
|
|
3797
|
+
## 🔗 Related
|
|
3798
|
+
|
|
3799
|
+
| File | When to Read |
|
|
3800
|
+
|------|-------------|
|
|
3801
|
+
| [decision-trees.md](decision-trees.md) | Apply UX laws to design decisions |
|
|
3802
|
+
| [color-system.md](color-system.md) | Emotion-color mapping for trust/urgency |
|
|
3803
|
+
| [animation-guide.md](animation-guide.md) | Feedback animation timing |
|
|
3804
|
+
| [../SKILL.md](../SKILL.md) | Anti-pattern bans and quick reference |
|
|
3805
|
+
|
|
3806
|
+
---
|
|
3807
|
+
|
|
3808
|
+
### Rule: visual-effects
|
|
3809
|
+
|
|
3810
|
+
---
|
|
3811
|
+
name: visual-effects
|
|
3812
|
+
description: Glassmorphism, neumorphism, shadow hierarchy, gradients, glow, overlays, modern CSS techniques
|
|
3813
|
+
---
|
|
3814
|
+
|
|
3815
|
+
# Visual Effects Reference
|
|
3816
|
+
|
|
3817
|
+
> Modern CSS effect principles and techniques - learn the concepts, create variations.
|
|
3818
|
+
> **No fixed values to copy - understand the patterns.**
|
|
3819
|
+
|
|
3820
|
+
---
|
|
3821
|
+
|
|
3822
|
+
## 1. Glassmorphism Principles
|
|
3823
|
+
|
|
3824
|
+
### What Makes Glassmorphism Work
|
|
3825
|
+
|
|
3826
|
+
```
|
|
3827
|
+
Key Properties:
|
|
3828
|
+
├── Semi-transparent background (not solid)
|
|
3829
|
+
├── Backdrop blur (frosted glass effect)
|
|
3830
|
+
├── Subtle border (for definition)
|
|
3831
|
+
└── Often: light shadow for depth
|
|
3832
|
+
```
|
|
3833
|
+
|
|
3834
|
+
### The Pattern (Customize Values)
|
|
3835
|
+
|
|
3836
|
+
```css
|
|
3837
|
+
.glass {
|
|
3838
|
+
/* Transparency: adjust opacity based on content readability */
|
|
3839
|
+
background: rgba(R, G, B, OPACITY);
|
|
3840
|
+
/* OPACITY: 0.1-0.3 for dark bg, 0.5-0.8 for light bg */
|
|
3841
|
+
|
|
3842
|
+
/* Blur: higher = more frosted */
|
|
3843
|
+
backdrop-filter: blur(AMOUNT);
|
|
3844
|
+
/* AMOUNT: 8-12px subtle, 16-24px strong */
|
|
3845
|
+
|
|
3846
|
+
/* Border: defines edges */
|
|
3847
|
+
border: 1px solid rgba(255, 255, 255, OPACITY);
|
|
3848
|
+
/* OPACITY: 0.1-0.3 typically */
|
|
3849
|
+
|
|
3850
|
+
/* Radius: match your design system */
|
|
3851
|
+
border-radius: YOUR_RADIUS;
|
|
3852
|
+
}
|
|
3853
|
+
```
|
|
3854
|
+
|
|
3855
|
+
### When to Use Glassmorphism
|
|
3856
|
+
- ✅ Over colorful/image backgrounds
|
|
3857
|
+
- ✅ Modals, overlays, cards
|
|
3858
|
+
- ✅ Navigation bars with scrolling content behind
|
|
3859
|
+
- ❌ Text-heavy content (readability issues)
|
|
3860
|
+
- ❌ Simple solid backgrounds (pointless)
|
|
3861
|
+
|
|
3862
|
+
### When NOT to Use
|
|
3863
|
+
- Low contrast situations
|
|
3864
|
+
- Accessibility-critical content
|
|
3865
|
+
- Performance-constrained devices
|
|
3866
|
+
|
|
3867
|
+
---
|
|
3868
|
+
|
|
3869
|
+
## 2. Neomorphism Principles
|
|
3870
|
+
|
|
3871
|
+
### What Makes Neomorphism Work
|
|
3872
|
+
|
|
3873
|
+
```
|
|
3874
|
+
Key Concept: Soft, extruded elements using DUAL shadows
|
|
3875
|
+
├── Light shadow (from light source direction)
|
|
3876
|
+
├── Dark shadow (opposite direction)
|
|
3877
|
+
└── Background matches surrounding (same color)
|
|
3878
|
+
```
|
|
3879
|
+
|
|
3880
|
+
### The Pattern
|
|
3881
|
+
|
|
3882
|
+
```css
|
|
3883
|
+
.neo-raised {
|
|
3884
|
+
/* Background MUST match parent */
|
|
3885
|
+
background: SAME_AS_PARENT;
|
|
3886
|
+
|
|
3887
|
+
/* Two shadows: light direction + dark direction */
|
|
3888
|
+
box-shadow:
|
|
3889
|
+
OFFSET OFFSET BLUR rgba(light-color),
|
|
3890
|
+
-OFFSET -OFFSET BLUR rgba(dark-color);
|
|
3891
|
+
|
|
3892
|
+
/* OFFSET: typically 6-12px */
|
|
3893
|
+
/* BLUR: typically 12-20px */
|
|
3894
|
+
}
|
|
3895
|
+
|
|
3896
|
+
.neo-pressed {
|
|
3897
|
+
/* Inset creates "pushed in" effect */
|
|
3898
|
+
box-shadow:
|
|
3899
|
+
inset OFFSET OFFSET BLUR rgba(dark-color),
|
|
3900
|
+
inset -OFFSET -OFFSET BLUR rgba(light-color);
|
|
3901
|
+
}
|
|
3902
|
+
```
|
|
3903
|
+
|
|
3904
|
+
### Accessibility Warning
|
|
3905
|
+
⚠️ **Low contrast** - use sparingly, ensure clear boundaries
|
|
3906
|
+
|
|
3907
|
+
### When to Use
|
|
3908
|
+
- Decorative elements
|
|
3909
|
+
- Subtle interactive states
|
|
3910
|
+
- Minimalist UI with flat colors
|
|
3911
|
+
|
|
3912
|
+
---
|
|
3913
|
+
|
|
3914
|
+
## 3. Shadow Hierarchy Principles
|
|
3915
|
+
|
|
3916
|
+
### Concept: Shadows Indicate Elevation
|
|
3917
|
+
|
|
3918
|
+
```
|
|
3919
|
+
Higher elevation = larger shadow
|
|
3920
|
+
├── Level 0: No shadow (flat on surface)
|
|
3921
|
+
├── Level 1: Subtle shadow (slightly raised)
|
|
3922
|
+
├── Level 2: Medium shadow (cards, buttons)
|
|
3923
|
+
├── Level 3: Large shadow (modals, dropdowns)
|
|
3924
|
+
└── Level 4: Deep shadow (floating elements)
|
|
3925
|
+
```
|
|
3926
|
+
|
|
3927
|
+
### Shadow Properties to Adjust
|
|
3928
|
+
|
|
3929
|
+
```css
|
|
3930
|
+
box-shadow: OFFSET-X OFFSET-Y BLUR SPREAD COLOR;
|
|
3931
|
+
|
|
3932
|
+
/* Offset: direction of shadow */
|
|
3933
|
+
/* Blur: softness (larger = softer) */
|
|
3934
|
+
/* Spread: size expansion */
|
|
3935
|
+
/* Color: typically black with low opacity */
|
|
3936
|
+
```
|
|
3937
|
+
|
|
3938
|
+
### Principles for Natural Shadows
|
|
3939
|
+
|
|
3940
|
+
1. **Y-offset larger than X** (light comes from above)
|
|
3941
|
+
2. **Low opacity** (5-15% for subtle, 15-25% for pronounced)
|
|
3942
|
+
3. **Multiple layers** for realism (ambient + direct)
|
|
3943
|
+
4. **Blur scales with offset** (larger offset = larger blur)
|
|
3944
|
+
|
|
3945
|
+
### Dark Mode Shadows
|
|
3946
|
+
- Shadows less visible on dark backgrounds
|
|
3947
|
+
- May need to increase opacity
|
|
3948
|
+
- Or use glow/highlight instead
|
|
3949
|
+
|
|
3950
|
+
---
|
|
3951
|
+
|
|
3952
|
+
## 4. Gradient Principles
|
|
3953
|
+
|
|
3954
|
+
### Types and When to Use
|
|
3955
|
+
|
|
3956
|
+
| Type | Pattern | Use Case |
|
|
3957
|
+
|------|---------|----------|
|
|
3958
|
+
| **Linear** | Color A → Color B along line | Backgrounds, buttons, headers |
|
|
3959
|
+
| **Radial** | Center → outward | Spotlights, focal points |
|
|
3960
|
+
| **Conic** | Around center | Pie charts, creative effects |
|
|
3961
|
+
|
|
3962
|
+
### Creating Harmonious Gradients
|
|
3963
|
+
|
|
3964
|
+
```
|
|
3965
|
+
Good Gradient Rules:
|
|
3966
|
+
├── Use ADJACENT colors on wheel (analogous)
|
|
3967
|
+
├── Or same hue with different lightness
|
|
3968
|
+
├── Avoid complementary (can look harsh)
|
|
3969
|
+
└── Add middle stops for smoother transitions
|
|
3970
|
+
```
|
|
3971
|
+
|
|
3972
|
+
### Gradient Syntax Pattern
|
|
3973
|
+
|
|
3974
|
+
```css
|
|
3975
|
+
.gradient {
|
|
3976
|
+
background: linear-gradient(
|
|
3977
|
+
DIRECTION, /* angle or to-keyword */
|
|
3978
|
+
COLOR-STOP-1, /* color + optional position */
|
|
3979
|
+
COLOR-STOP-2,
|
|
3980
|
+
/* ... more stops */
|
|
3981
|
+
);
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
/* DIRECTION examples: */
|
|
3985
|
+
/* 90deg, 135deg, to right, to bottom right */
|
|
3986
|
+
```
|
|
3987
|
+
|
|
3988
|
+
### Mesh Gradients
|
|
3989
|
+
|
|
3990
|
+
```
|
|
3991
|
+
Multiple radial gradients overlapped:
|
|
3992
|
+
├── Each at different position
|
|
3993
|
+
├── Each with transparent falloff
|
|
3994
|
+
├── **Mandatory for "Wow" factor in Hero sections**
|
|
3995
|
+
└── Creates organic, colorful effect (Search: "Aurora Gradient CSS")
|
|
3996
|
+
```
|
|
3997
|
+
|
|
3998
|
+
---
|
|
3999
|
+
|
|
4000
|
+
## 5. Border Effects Principles
|
|
4001
|
+
|
|
4002
|
+
### Gradient Borders
|
|
4003
|
+
|
|
4004
|
+
```
|
|
4005
|
+
Technique: Pseudo-element with gradient background
|
|
4006
|
+
├── Element has padding = border width
|
|
4007
|
+
├── Pseudo-element fills with gradient
|
|
4008
|
+
└── Mask or clip creates border effect
|
|
4009
|
+
```
|
|
4010
|
+
|
|
4011
|
+
### Animated Borders
|
|
4012
|
+
|
|
4013
|
+
```
|
|
4014
|
+
Technique: Rotating gradient or conic sweep
|
|
4015
|
+
├── Pseudo-element larger than content
|
|
4016
|
+
├── Animation rotates the gradient
|
|
4017
|
+
└── Overflow hidden clips to shape
|
|
4018
|
+
```
|
|
4019
|
+
|
|
4020
|
+
### Glow Borders
|
|
4021
|
+
|
|
4022
|
+
```css
|
|
4023
|
+
/* Multiple box-shadows create glow */
|
|
4024
|
+
box-shadow:
|
|
4025
|
+
0 0 SMALL-BLUR COLOR,
|
|
4026
|
+
0 0 MEDIUM-BLUR COLOR,
|
|
4027
|
+
0 0 LARGE-BLUR COLOR;
|
|
4028
|
+
|
|
4029
|
+
/* Each layer adds to the glow */
|
|
4030
|
+
```
|
|
4031
|
+
|
|
4032
|
+
---
|
|
4033
|
+
|
|
4034
|
+
## 6. Glow Effects Principles
|
|
4035
|
+
|
|
4036
|
+
### Text Glow
|
|
4037
|
+
|
|
4038
|
+
```css
|
|
4039
|
+
text-shadow:
|
|
4040
|
+
0 0 BLUR-1 COLOR,
|
|
4041
|
+
0 0 BLUR-2 COLOR,
|
|
4042
|
+
0 0 BLUR-3 COLOR;
|
|
4043
|
+
|
|
4044
|
+
/* Multiple layers = stronger glow */
|
|
4045
|
+
/* Larger blur = softer spread */
|
|
4046
|
+
```
|
|
4047
|
+
|
|
4048
|
+
### Element Glow
|
|
4049
|
+
|
|
4050
|
+
```css
|
|
4051
|
+
box-shadow:
|
|
4052
|
+
0 0 BLUR-1 COLOR,
|
|
4053
|
+
0 0 BLUR-2 COLOR;
|
|
4054
|
+
|
|
4055
|
+
/* Use color matching element for realistic glow */
|
|
4056
|
+
/* Lower opacity for subtle, higher for neon */
|
|
4057
|
+
```
|
|
4058
|
+
|
|
4059
|
+
### Pulsing Glow Animation
|
|
4060
|
+
|
|
4061
|
+
```css
|
|
4062
|
+
@keyframes glow-pulse {
|
|
4063
|
+
0%, 100% { box-shadow: 0 0 SMALL-BLUR COLOR; }
|
|
4064
|
+
50% { box-shadow: 0 0 LARGE-BLUR COLOR; }
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
/* Easing and duration affect feel */
|
|
4068
|
+
```
|
|
4069
|
+
|
|
4070
|
+
---
|
|
4071
|
+
|
|
4072
|
+
## 7. Overlay Techniques
|
|
4073
|
+
|
|
4074
|
+
### Gradient Overlay on Images
|
|
4075
|
+
|
|
4076
|
+
```
|
|
4077
|
+
Purpose: Improve text readability over images
|
|
4078
|
+
Pattern: Gradient from transparent to opaque
|
|
4079
|
+
Position: Where text will appear
|
|
4080
|
+
```
|
|
4081
|
+
|
|
4082
|
+
```css
|
|
4083
|
+
.overlay::after {
|
|
4084
|
+
content: '';
|
|
4085
|
+
position: absolute;
|
|
4086
|
+
inset: 0;
|
|
4087
|
+
background: linear-gradient(
|
|
4088
|
+
DIRECTION,
|
|
4089
|
+
transparent PERCENTAGE,
|
|
4090
|
+
rgba(0,0,0,OPACITY) 100%
|
|
4091
|
+
);
|
|
4092
|
+
}
|
|
4093
|
+
```
|
|
4094
|
+
|
|
4095
|
+
### Colored Overlay
|
|
4096
|
+
|
|
4097
|
+
```css
|
|
4098
|
+
/* Blend mode or layered gradient */
|
|
4099
|
+
background:
|
|
4100
|
+
linear-gradient(YOUR-COLOR-WITH-OPACITY),
|
|
4101
|
+
url('image.jpg');
|
|
4102
|
+
```
|
|
4103
|
+
|
|
4104
|
+
---
|
|
4105
|
+
|
|
4106
|
+
## 8. Modern CSS Techniques
|
|
4107
|
+
|
|
4108
|
+
### Container Queries (Concept)
|
|
4109
|
+
|
|
4110
|
+
```
|
|
4111
|
+
Instead of viewport breakpoints:
|
|
4112
|
+
├── Component responds to ITS container
|
|
4113
|
+
├── Truly modular, reusable components
|
|
4114
|
+
└── Syntax: @container (condition) { }
|
|
4115
|
+
```
|
|
4116
|
+
|
|
4117
|
+
### :has() Selector (Concept)
|
|
4118
|
+
|
|
4119
|
+
```
|
|
4120
|
+
Parent styling based on children:
|
|
4121
|
+
├── "Parent that has X child"
|
|
4122
|
+
├── Enables previously impossible patterns
|
|
4123
|
+
└── Progressive enhancement approach
|
|
4124
|
+
```
|
|
4125
|
+
|
|
4126
|
+
### Scroll-Driven Animations (Concept)
|
|
4127
|
+
|
|
4128
|
+
```
|
|
4129
|
+
Animation progress tied to scroll:
|
|
4130
|
+
├── Entry/exit animations on scroll
|
|
4131
|
+
├── Parallax effects
|
|
4132
|
+
├── Progress indicators
|
|
4133
|
+
└── View-based or scroll-based timeline
|
|
4134
|
+
```
|
|
4135
|
+
|
|
4136
|
+
---
|
|
4137
|
+
|
|
4138
|
+
## 9. Performance Principles
|
|
4139
|
+
|
|
4140
|
+
### GPU-Accelerated Properties
|
|
4141
|
+
|
|
4142
|
+
```
|
|
4143
|
+
CHEAP to animate (GPU):
|
|
4144
|
+
├── transform (translate, scale, rotate)
|
|
4145
|
+
└── opacity
|
|
4146
|
+
|
|
4147
|
+
EXPENSIVE to animate (CPU):
|
|
4148
|
+
├── width, height
|
|
4149
|
+
├── top, left, right, bottom
|
|
4150
|
+
├── margin, padding
|
|
4151
|
+
└── box-shadow (recalculates)
|
|
4152
|
+
```
|
|
4153
|
+
|
|
4154
|
+
### will-change Usage
|
|
4155
|
+
|
|
4156
|
+
```css
|
|
4157
|
+
/* Use sparingly, only for heavy animations */
|
|
4158
|
+
.heavy-animation {
|
|
4159
|
+
will-change: transform;
|
|
4160
|
+
}
|
|
4161
|
+
|
|
4162
|
+
/* Remove after animation if possible */
|
|
4163
|
+
```
|
|
4164
|
+
|
|
4165
|
+
### Reduced Motion
|
|
4166
|
+
|
|
4167
|
+
```css
|
|
4168
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4169
|
+
/* Disable or minimize animations */
|
|
4170
|
+
/* Respect user preference */
|
|
4171
|
+
}
|
|
4172
|
+
```
|
|
4173
|
+
|
|
4174
|
+
---
|
|
4175
|
+
|
|
4176
|
+
## 10. Effect Selection Checklist
|
|
4177
|
+
|
|
4178
|
+
Before applying any effect:
|
|
4179
|
+
|
|
4180
|
+
- [ ] **Does it serve a purpose?** (not just decoration)
|
|
4181
|
+
- [ ] **Is it appropriate for the context?** (brand, audience)
|
|
4182
|
+
- [ ] **Have you varied from previous projects?** (avoid repetition)
|
|
4183
|
+
- [ ] **Is it accessible?** (contrast, motion sensitivity)
|
|
4184
|
+
- [ ] **Is it performant?** (especially on mobile)
|
|
4185
|
+
- [ ] **Did you ask user preference?** (if style open-ended)
|
|
4186
|
+
|
|
4187
|
+
### Anti-Patterns
|
|
4188
|
+
|
|
4189
|
+
- ❌ Glassmorphism on every element (kitsch)
|
|
4190
|
+
- ❌ Dark + neon as default (lazy AI look)
|
|
4191
|
+
- ❌ **Static/Flat designs with no depth (FAILED)**
|
|
4192
|
+
- ❌ Effects that hurt readability
|
|
4193
|
+
- ❌ Animations without purpose
|
|
4194
|
+
|
|
4195
|
+
---
|
|
4196
|
+
|
|
4197
|
+
> **Remember**: Effects enhance meaning. Choose based on purpose and context, not because it "looks cool."
|
|
4198
|
+
|
|
4199
|
+
---
|
|
4200
|
+
|
|
4201
|
+
|
|
4202
|
+
|
|
4203
|
+
---
|
|
4204
|
+
|
|
4205
|
+
## 🔗 Related
|
|
4206
|
+
|
|
4207
|
+
| File | When to Read |
|
|
4208
|
+
|------|-------------|
|
|
4209
|
+
| [animation-guide.md](animation-guide.md) | Animation timing for effects |
|
|
4210
|
+
| [motion-graphics.md](motion-graphics.md) | Advanced Lottie, GSAP, 3D effects |
|
|
4211
|
+
| [color-system.md](color-system.md) | Color for gradients and glows |
|
|
4212
|
+
| [../SKILL.md](../SKILL.md) | Anti-pattern bans |
|
|
4213
|
+
|
|
4214
|
+
---
|
|
4215
|
+
|
|
4216
|
+
⚡ PikaKit v3.9.134
|