@umacloud/knowledge 1.0.1
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/00-governance/governance-capabilities.md +557 -0
- package/00-governance/knowledge-map.md +39 -0
- package/00-governance/maintenance-policy.md +76 -0
- package/00-governance/review-checklist.md +81 -0
- package/README.md +13 -0
- package/ai/01-standards/agent-development-complete.md +691 -0
- package/ai/01-standards/llm-application-complete.md +488 -0
- package/ai/01-standards/mlops-complete.md +798 -0
- package/ai/01-standards/prompt-engineering-complete.md +646 -0
- package/ai/01-standards/rag-architecture-complete.md +649 -0
- package/ai/02-playbooks/llm-evaluation-playbook.md +847 -0
- package/ai/03-checklists/ai-project-checklist.md +215 -0
- package/ai/04-antipatterns/ai-antipatterns.md +661 -0
- package/ai/05-cases/case-rag-production.md +147 -0
- package/ai/06-glossary/ai-glossary.md +162 -0
- package/ai/agent-evaluation-benchmark.md +53 -0
- package/ai/ai-agent-memory-context-management.md +41 -0
- package/ai/ai-cost-capacity-optimization-playbook.md +42 -0
- package/ai/ai-data-security-and-compliance-playbook.md +37 -0
- package/ai/ai-domain-index-and-checklist.md +40 -0
- package/ai/ai-governance-maturity-model.md +50 -0
- package/ai/ai-model-selection-and-routing-strategy.md +47 -0
- package/ai/ai-observability-and-oncall-runbook.md +52 -0
- package/ai/ai-rag-engineering-playbook.md +42 -0
- package/ai/ai-red-team-and-safety-evaluation.md +42 -0
- package/ai/ai-release-readiness-and-rollback-gate.md +42 -0
- package/ai/llm-agent-engineering-deep-dive.md +57 -0
- package/ai/prompt-and-tool-guardrails.md +52 -0
- package/api/01-standards/enterprise-api-standards.md +198 -0
- package/api/01-standards/rest-api-design-guide.md +63 -0
- package/api/02-playbooks/api-pagination-playbook.md +93 -0
- package/api/02-playbooks/graphql-production-playbook.md +176 -0
- package/api/03-checklists/api-review-checklist.md +55 -0
- package/api/04-antipatterns/api-antipatterns.md +112 -0
- package/architecture/01-standards/api-gateway-patterns.md +496 -0
- package/architecture/01-standards/cloud-native-patterns.md +644 -0
- package/architecture/01-standards/distributed-systems-patterns.md +591 -0
- package/architecture/01-standards/event-driven-architecture.md +595 -0
- package/architecture/01-standards/microservices-patterns-complete.md +968 -0
- package/architecture/01-standards/microservices-patterns.md +495 -0
- package/architecture/01-standards/system-design-interview.md +664 -0
- package/architecture/02-playbooks/microservices-patterns-playbook.md +137 -0
- package/architecture/02-playbooks/migration-playbook.md +780 -0
- package/architecture/02-playbooks/system-design-playbook.md +779 -0
- package/architecture/03-checklists/architecture-decision-checklist.md +297 -0
- package/architecture/04-antipatterns/architecture-antipatterns.md +417 -0
- package/architecture/05-cases/case-netflix-microservices.md +413 -0
- package/architecture/06-glossary/architecture-glossary.md +164 -0
- package/architecture/adr-template-and-examples.md +38 -0
- package/architecture/api-gateway-deep-dive.md +1291 -0
- package/architecture/configuration-management.md +1162 -0
- package/architecture/distributed-transactions.md +1220 -0
- package/architecture/microservices-complete.md +735 -0
- package/architecture/resilience-and-disaster-patterns.md +37 -0
- package/architecture/service-governance.md +1198 -0
- package/architecture/system-architecture-deep-dive.md +37 -0
- package/backend/01-standards/analytics-and-growth.md +65 -0
- package/backend/01-standards/api-and-error-conventions.md +120 -0
- package/backend/01-standards/application-layering-and-packaging.md +160 -0
- package/backend/01-standards/auth-implementation.md +104 -0
- package/backend/01-standards/backend-framework-idioms.md +74 -0
- package/backend/01-standards/background-jobs-and-async.md +66 -0
- package/backend/01-standards/caching-strategies-complete.md +390 -0
- package/backend/01-standards/config-and-observability.md +77 -0
- package/backend/01-standards/data-modeling-and-persistence.md +94 -0
- package/backend/01-standards/django-complete.md +1765 -0
- package/backend/01-standards/email-and-notifications.md +64 -0
- package/backend/01-standards/fastapi-complete.md +925 -0
- package/backend/01-standards/file-upload-and-storage.md +66 -0
- package/backend/01-standards/graphql-api-complete.md +416 -0
- package/backend/01-standards/llm-application-standard.md +78 -0
- package/backend/01-standards/message-queue-patterns.md +379 -0
- package/backend/01-standards/microservices-and-distributed.md +78 -0
- package/backend/01-standards/nestjs-complete.md +2167 -0
- package/backend/01-standards/payment-integration.md +80 -0
- package/backend/01-standards/rate-limiting-complete.md +451 -0
- package/backend/01-standards/realtime-and-websocket.md +65 -0
- package/backend/01-standards/search-and-filtering.md +64 -0
- package/backend/01-standards/spring-boot-complete.md +445 -0
- package/backend/02-playbooks/api-design-playbook.md +718 -0
- package/backend/02-playbooks/email-send-playbook.md +130 -0
- package/backend/02-playbooks/file-upload-s3-playbook.md +153 -0
- package/backend/02-playbooks/typescript-enterprise-playbook.md +133 -0
- package/backend/02-playbooks/websocket-realtime-playbook.md +154 -0
- package/backend/03-checklists/api-launch-checklist.md +189 -0
- package/backend/04-antipatterns/backend-antipatterns.md +1051 -0
- package/blockchain/01-standards/blockchain-basics.md +557 -0
- package/blockchain/01-standards/smart-contract-development.md +1315 -0
- package/cicd/01-standards/deployment-and-delivery-standard.md +96 -0
- package/cicd/01-standards/github-actions-complete.md +473 -0
- package/cicd/01-standards/release-and-store-submission.md +75 -0
- package/cicd/02-playbooks/cicd-pipeline-playbook.md +144 -0
- package/cicd/02-playbooks/release-management-playbook.md +605 -0
- package/cicd/03-checklists/pipeline-security-checklist.md +168 -0
- package/cicd/04-antipatterns/cicd-antipatterns.md +589 -0
- package/cicd/05-cases/case-deployment-automation.md +221 -0
- package/cicd/05-cases/case-gitops-transformation.md +212 -0
- package/cicd/06-glossary/cicd-glossary.md +114 -0
- package/cicd/cicd-blueprint-deep-dive.md +38 -0
- package/cicd/release-readiness-gate.md +37 -0
- package/cloud-native/01-standards/container-security.md +741 -0
- package/cloud-native/01-standards/kubernetes-complete.md +812 -0
- package/cloud-native/02-playbooks/api-gateway-playbook.md +155 -0
- package/cloud-native/02-playbooks/gitops-with-argocd.md +760 -0
- package/cloud-native/02-playbooks/k8s-troubleshooting-playbook.md +1942 -0
- package/cloud-native/02-playbooks/message-queue-playbook.md +129 -0
- package/cloud-native/02-playbooks/multicloud-governance.md +726 -0
- package/cloud-native/02-playbooks/serverless-patterns.md +788 -0
- package/cloud-native/02-playbooks/service-mesh-playbook.md +612 -0
- package/cloud-native/02-playbooks/terraform-iac-playbook.md +143 -0
- package/cloud-native/03-checklists/container-security-checklist.md +431 -0
- package/cloud-native/03-checklists/k8s-production-readiness-checklist.md +460 -0
- package/cloud-native/04-antipatterns/container-antipatterns.md +660 -0
- package/cloud-native/04-antipatterns/k8s-antipatterns.md +743 -0
- package/cloud-native/05-cases/case-k8s-migration.md +478 -0
- package/cloud-native/05-cases/case-k8s-scaling.md +642 -0
- package/cloud-native/05-cases/case-k8s-security-incident.md +397 -0
- package/cloud-native/06-glossary/cloud-native-glossary.md +337 -0
- package/cross-platform/01-standards/cross-platform-frameworks.md +83 -0
- package/cross-platform/01-standards/platform-selection-and-architecture.md +77 -0
- package/data/01-standards/elasticsearch-complete.md +2098 -0
- package/data/01-standards/postgresql-complete.md +1613 -0
- package/data/01-standards/redis-complete.md +1527 -0
- package/data/02-playbooks/database-optimization-playbook.md +403 -0
- package/data/02-playbooks/elasticsearch-production-playbook.md +132 -0
- package/data/03-checklists/database-launch-checklist.md +187 -0
- package/data/04-antipatterns/database-antipatterns.md +873 -0
- package/data/05-cases/case-database-migration.md +310 -0
- package/data/06-glossary/database-glossary.md +440 -0
- package/data/data-governance-and-modeling-deep-dive.md +39 -0
- package/data-engineering/01-standards/airflow-complete.md +523 -0
- package/data-engineering/01-standards/kafka-complete.md +1521 -0
- package/data-engineering/02-playbooks/spark-etl-playbook.md +496 -0
- package/data-engineering/03-checklists/pipeline-launch-checklist.md +194 -0
- package/data-engineering/04-antipatterns/data-pipeline-antipatterns.md +684 -0
- package/data-engineering/05-cases/case-real-time-pipeline.md +355 -0
- package/data-engineering/06-glossary/data-engineering-glossary.md +429 -0
- package/database/01-standards/database-schema-standards.md +147 -0
- package/database/02-playbooks/postgresql-optimization-quick.md +52 -0
- package/database/02-playbooks/postgresql-performance-optimization.md +58 -0
- package/database/02-playbooks/postgresql-production-playbook.md +146 -0
- package/database/02-playbooks/redis-caching-playbook.md +117 -0
- package/database/03-checklists/database-review-checklist.md +50 -0
- package/database/04-antipatterns/database-antipatterns.md +112 -0
- package/design/01-standards/ui-design-system-complete.md +423 -0
- package/design/02-playbooks/design-handoff-playbook.md +254 -0
- package/design/02-playbooks/design-review-playbook.md +388 -0
- package/design/03-checklists/design-review-checklist.md +246 -0
- package/design/04-antipatterns/design-antipatterns.md +378 -0
- package/design/05-cases/case-design-system-adoption.md +328 -0
- package/design/06-glossary/design-glossary.md +329 -0
- package/design/ui-full-lifecycle-cross-platform-playbook.md +571 -0
- package/design/ux-system-deep-dive.md +38 -0
- package/design-systems/00-craft-rules.md +71 -0
- package/design-systems/aesthetic-families.md +43 -0
- package/design-systems/anti-ai-slop.md +162 -0
- package/design-systems/bold-geometric.md +120 -0
- package/design-systems/brutalist-bold.md +103 -0
- package/design-systems/editorial-clean.md +109 -0
- package/design-systems/glass-aurora.md +108 -0
- package/design-systems/modern-minimal.md +145 -0
- package/design-systems/premium-luxury.md +106 -0
- package/design-systems/product-type-design-map.md +48 -0
- package/design-systems/soft-warm.md +123 -0
- package/design-systems/tech-utility.md +113 -0
- package/desktop/01-standards/desktop-app-standard.md +72 -0
- package/desktop/01-standards/desktop-design.md +71 -0
- package/development/00-governance/document-template.md +41 -0
- package/development/01-standards/api-versioning-strategies.md +432 -0
- package/development/01-standards/authentication-patterns-complete.md +479 -0
- package/development/01-standards/css-architecture-complete.md +550 -0
- package/development/01-standards/database-migration-strategies.md +484 -0
- package/development/01-standards/elasticsearch-complete.md +347 -0
- package/development/01-standards/git-complete.md +371 -0
- package/development/01-standards/golang-complete.md +1565 -0
- package/development/01-standards/graphql-complete.md +298 -0
- package/development/01-standards/javascript-bundlers-complete.md +469 -0
- package/development/01-standards/javascript-typescript-complete.md +528 -0
- package/development/01-standards/jest-complete.md +275 -0
- package/development/01-standards/linux-complete.md +234 -0
- package/development/01-standards/logging-observability-complete.md +526 -0
- package/development/01-standards/microservices-communication.md +502 -0
- package/development/01-standards/mongodb-complete.md +406 -0
- package/development/01-standards/oauth2-complete.md +285 -0
- package/development/01-standards/performance-optimization-complete.md +289 -0
- package/development/01-standards/playwright-complete.md +247 -0
- package/development/01-standards/postgresql-complete.md +456 -0
- package/development/01-standards/pytest-complete.md +340 -0
- package/development/01-standards/python-async-programming.md +902 -0
- package/development/01-standards/python-complete.md +956 -0
- package/development/01-standards/python-decorators-complete.md +799 -0
- package/development/01-standards/python-design-patterns.md +2854 -0
- package/development/01-standards/python-packaging-distribution.md +420 -0
- package/development/01-standards/python-testing-strategies.md +607 -0
- package/development/01-standards/python-web-frameworks-comparison.md +471 -0
- package/development/01-standards/redis-complete.md +317 -0
- package/development/01-standards/rest-api-complete.md +316 -0
- package/development/01-standards/rust-complete.md +578 -0
- package/development/01-standards/typescript-advanced-types.md +1513 -0
- package/development/01-standards/web-security-complete.md +292 -0
- package/development/02-playbooks/api-design-playbook.md +810 -0
- package/development/02-playbooks/database-migration-playbook.md +580 -0
- package/development/02-playbooks/debugging-playbook.md +692 -0
- package/development/02-playbooks/feature-delivery-playbook.md +430 -0
- package/development/02-playbooks/incident-hotfix-playbook.md +387 -0
- package/development/02-playbooks/performance-optimization-playbook.md +531 -0
- package/development/02-playbooks/performance-tuning-playbook.md +652 -0
- package/development/02-playbooks/refactor-playbook.md +403 -0
- package/development/02-playbooks/release-playbook.md +469 -0
- package/development/03-checklists/architecture-review-checklist.md +168 -0
- package/development/03-checklists/data-migration-checklist.md +157 -0
- package/development/03-checklists/oncall-handover-checklist.md +173 -0
- package/development/03-checklists/pr-checklist.md +158 -0
- package/development/03-checklists/production-readiness-checklist.md +190 -0
- package/development/03-checklists/release-readiness-checklist.md +154 -0
- package/development/03-checklists/security-review-checklist.md +182 -0
- package/development/04-antipatterns/api-antipatterns.md +657 -0
- package/development/04-antipatterns/architecture-antipatterns.md +686 -0
- package/development/04-antipatterns/backend-antipatterns.md +648 -0
- package/development/04-antipatterns/cicd-antipatterns.md +540 -0
- package/development/04-antipatterns/code-smell-antipatterns.md +571 -0
- package/development/04-antipatterns/data-antipatterns.md +658 -0
- package/development/04-antipatterns/database-antipatterns.md +578 -0
- package/development/04-antipatterns/frontend-antipatterns.md +635 -0
- package/development/04-antipatterns/reliability-antipatterns.md +700 -0
- package/development/04-antipatterns/security-antipatterns.md +747 -0
- package/development/05-cases/case-api-version-migration.md +428 -0
- package/development/05-cases/case-authorization-hardening.md +383 -0
- package/development/05-cases/case-bluegreen-rollback.md +466 -0
- package/development/05-cases/case-cache-snowball-protection.md +485 -0
- package/development/05-cases/case-ci-cd-pipeline.md +544 -0
- package/development/05-cases/case-database-scaling.md +500 -0
- package/development/05-cases/case-db-hotspot-optimization.md +487 -0
- package/development/05-cases/case-incident-mttr-reduction.md +563 -0
- package/development/05-cases/case-microservice-migration.md +375 -0
- package/development/05-cases/case-performance-optimization.md +406 -0
- package/development/05-cases/case-security-incident-response.md +345 -0
- package/development/06-glossary/full-stack-glossary.md +166 -0
- package/development/09-maturity/quarterly-audit-template.md +35 -0
- package/development/11-ui-excellence/ui-aesthetic-system.md +41 -0
- package/development/11-ui-excellence/ui-engineering-excellence.md +435 -0
- package/development/12-scenarios/development-scenarios-guide.md +565 -0
- package/development/13-implementation-assets/implementation-toolkit.md +282 -0
- package/development/13-implementation-assets/knowledge-gates-execution.md +43 -0
- package/development/14-full-lifecycle/software-lifecycle-gates.md +511 -0
- package/development/15-lifecycle-templates/project-templates-collection.md +791 -0
- package/development/api-contract-and-versioning-guide.md +36 -0
- package/development/api-governance-complete.md +43 -0
- package/development/backend-engineering-complete.md +43 -0
- package/development/code-review-quality-complete.md +43 -0
- package/development/concurrency-reliability-complete.md +43 -0
- package/development/database-engineering-complete.md +43 -0
- package/development/engineering-effectiveness-complete.md +43 -0
- package/development/engineering-standards-deep-dive.md +38 -0
- package/development/frontend-engineering-complete.md +43 -0
- package/development/performance-capacity-complete.md +43 -0
- package/development/refactor-migration-complete.md +42 -0
- package/development/refactoring-and-techdebt-playbook.md +37 -0
- package/development/security-in-development-complete.md +43 -0
- package/devops/01-standards/cicd-pipeline-complete.md +262 -0
- package/devops/01-standards/docker-complete.md +1490 -0
- package/devops/01-standards/github-actions-complete.md +337 -0
- package/devops/01-standards/kubernetes-complete.md +638 -0
- package/devops/01-standards/terraform-complete.md +2117 -0
- package/devops/02-playbooks/docker-compose-playbook.md +233 -0
- package/devops/02-playbooks/docker-k8s-production-playbook.md +186 -0
- package/devops/02-playbooks/docker-production-playbook.md +952 -0
- package/edge-iot/01-standards/edge-iot-complete.md +473 -0
- package/experts/architect/api-design.md +178 -0
- package/experts/architect/methodology.md +124 -0
- package/experts/architect/security.md +75 -0
- package/experts/backend-lead/methodology.md +216 -0
- package/experts/devops/methodology.md +160 -0
- package/experts/frontend-lead/methodology.md +178 -0
- package/experts/product-manager/industry/ecommerce.md +43 -0
- package/experts/product-manager/industry/saas.md +40 -0
- package/experts/product-manager/methodology.md +97 -0
- package/experts/qa-lead/methodology.md +123 -0
- package/experts/qa-lead/test-strategy.md +128 -0
- package/experts/uiux-designer/methodology.md +125 -0
- package/frontend/01-standards/accessibility-complete.md +532 -0
- package/frontend/01-standards/accessibility-standard.md +74 -0
- package/frontend/01-standards/admin-dashboard-and-crud.md +72 -0
- package/frontend/01-standards/design-tokens-complete.md +444 -0
- package/frontend/01-standards/forms-and-validation.md +77 -0
- package/frontend/01-standards/frontend-architecture-and-layering.md +119 -0
- package/frontend/01-standards/i18n-and-localization.md +65 -0
- package/frontend/01-standards/nextjs-complete.md +451 -0
- package/frontend/01-standards/react-complete.md +713 -0
- package/frontend/01-standards/react-hooks-complete-guide.md +1100 -0
- package/frontend/01-standards/react-hooks-complete.md +1171 -0
- package/frontend/01-standards/seo-and-web-vitals.md +77 -0
- package/frontend/01-standards/state-management-complete.md +444 -0
- package/frontend/01-standards/vue-complete.md +499 -0
- package/frontend/01-standards/vue3-complete.md +2002 -0
- package/frontend/01-standards/web-framework-best-practices.md +64 -0
- package/frontend/01-standards/web-performance-complete.md +495 -0
- package/frontend/02-playbooks/accessibility-a11y-playbook.md +161 -0
- package/frontend/02-playbooks/frontend-performance-playbook.md +707 -0
- package/frontend/02-playbooks/i18n-internationalization-playbook.md +120 -0
- package/frontend/02-playbooks/performance-optimization-playbook.md +163 -0
- package/frontend/02-playbooks/react-nextjs-production-playbook.md +167 -0
- package/frontend/02-playbooks/react-state-management-playbook.md +173 -0
- package/frontend/03-checklists/component-quality-checklist.md +166 -0
- package/frontend/03-checklists/frontend-launch-checklist.md +299 -0
- package/frontend/04-antipatterns/frontend-antipatterns.md +886 -0
- package/frontend/05-cases/case-performance-optimization.md +274 -0
- package/harmony/01-standards/harmonyos-arkts-standard.md +75 -0
- package/harmony/01-standards/harmonyos-design.md +65 -0
- package/high-quality-engineering-playbook.md +54 -0
- package/incident/01-standards/incident-response-complete.md +303 -0
- package/incident/02-playbooks/chaos-engineering-playbook.md +883 -0
- package/incident/02-playbooks/postmortem-playbook.md +398 -0
- package/incident/03-checklists/incident-readiness-checklist.md +181 -0
- package/incident/04-antipatterns/incident-antipatterns.md +490 -0
- package/incident/05-cases/case-cascade-failure.md +176 -0
- package/incident/06-glossary/incident-glossary.md +114 -0
- package/incident/postmortem-and-response-deep-dive.md +39 -0
- package/industries/ecommerce/ecommerce-complete.md +631 -0
- package/industries/education/education-complete.md +555 -0
- package/industries/fintech/fintech-complete.md +501 -0
- package/industries/gaming/gaming-complete.md +587 -0
- package/industries/healthcare/healthcare-complete.md +452 -0
- package/low-code/01-standards/low-code-complete.md +944 -0
- package/miniprogram/01-standards/ai-common-mistakes.md +61 -0
- package/miniprogram/01-standards/miniprogram-custom-navbar-capsule.md +77 -0
- package/miniprogram/01-standards/miniprogram-design.md +61 -0
- package/miniprogram/01-standards/miniprogram-standard.md +81 -0
- package/mobile/01-standards/android-material-design.md +70 -0
- package/mobile/01-standards/flutter-complete.md +384 -0
- package/mobile/01-standards/ios-design-hig.md +78 -0
- package/mobile/01-standards/mobile-app-standard.md +85 -0
- package/mobile/01-standards/react-native-complete.md +352 -0
- package/mobile/02-playbooks/mobile-cross-platform-playbook.md +175 -0
- package/mobile/02-playbooks/mobile-performance.md +473 -0
- package/mobile/03-checklists/mobile-release-checklist.md +234 -0
- package/mobile/04-antipatterns/mobile-antipatterns.md +798 -0
- package/mobile/05-cases/case-app-performance.md +500 -0
- package/mobile/05-cases/case-app-startup-optimization.md +218 -0
- package/mobile/06-glossary/mobile-glossary.md +484 -0
- package/observability/01-standards/observability-standards.md +103 -0
- package/observability/02-playbooks/prometheus-grafana-playbook.md +135 -0
- package/observability/02-playbooks/structured-logging-playbook.md +73 -0
- package/observability/03-checklists/observability-checklist.md +54 -0
- package/observability/04-antipatterns/observability-antipatterns.md +106 -0
- package/operations/01-standards/prometheus-monitoring-complete.md +1578 -0
- package/operations/02-playbooks/capacity-planning-playbook.md +620 -0
- package/operations/03-checklists/production-launch-checklist.md +365 -0
- package/operations/04-antipatterns/operations-antipatterns.md +664 -0
- package/operations/05-cases/case-sre-practices.md +581 -0
- package/operations/06-glossary/operations-glossary.md +120 -0
- package/operations/aiops-anomaly-detection.md +758 -0
- package/operations/capacity-planning.md +1061 -0
- package/operations/chaos-engineering.md +659 -0
- package/operations/incident-command-system.md +38 -0
- package/operations/observability-complete.md +442 -0
- package/operations/slo-sli-playbook.md +517 -0
- package/operations/sre-operations-deep-dive.md +39 -0
- package/package.json +8 -0
- package/performance/01-standards/performance-and-scalability.md +80 -0
- package/performance/01-standards/performance-standards.md +156 -0
- package/performance/02-playbooks/query-optimization-playbook.md +103 -0
- package/performance/03-checklists/performance-checklist.md +56 -0
- package/performance/04-antipatterns/performance-antipatterns.md +146 -0
- package/product/01-standards/product-management-complete.md +285 -0
- package/product/02-playbooks/feature-launch-playbook.md +207 -0
- package/product/02-playbooks/user-research-playbook.md +532 -0
- package/product/03-checklists/feature-launch-checklist.md +275 -0
- package/product/04-antipatterns/product-antipatterns.md +355 -0
- package/product/05-cases/case-mvp-to-scale.md +384 -0
- package/product/06-glossary/product-glossary.md +462 -0
- package/product/feature-prioritization-framework.md +40 -0
- package/product/kpi-and-metric-tree.md +37 -0
- package/product/product-discovery-and-prd-deep-dive.md +41 -0
- package/quantum/01-standards/quantum-complete.md +1186 -0
- package/security/01-standards/api-security-complete.md +511 -0
- package/security/01-standards/container-runtime-security.md +574 -0
- package/security/01-standards/data-protection-gdpr.md +543 -0
- package/security/01-standards/owasp-top10-complete.md +1890 -0
- package/security/01-standards/secure-coding-baseline.md +90 -0
- package/security/01-standards/supply-chain-security.md +441 -0
- package/security/01-standards/web-security-checklist.md +108 -0
- package/security/01-standards/zero-trust-architecture.md +521 -0
- package/security/02-playbooks/auth-sso-playbook.md +166 -0
- package/security/02-playbooks/incident-response-security-playbook.md +588 -0
- package/security/02-playbooks/owasp-api-security-playbook.md +129 -0
- package/security/02-playbooks/payment-integration-playbook.md +119 -0
- package/security/02-playbooks/penetration-testing-playbook.md +517 -0
- package/security/03-checklists/security-audit-checklist.md +356 -0
- package/security/04-antipatterns/security-coding-antipatterns.md +580 -0
- package/security/05-cases/case-log4shell-incident.md +537 -0
- package/security/05-cases/case-major-breaches.md +468 -0
- package/security/06-glossary/security-glossary.md +212 -0
- package/security/compliance-automation.md +993 -0
- package/security/container-security.md +680 -0
- package/security/devsecops-complete.md +426 -0
- package/security/sast-dast-sca.md +775 -0
- package/security/secrets-management.md +594 -0
- package/security/security-architecture-deep-dive.md +37 -0
- package/security/threat-modeling-stride-playbook.md +40 -0
- package/seed-templates/auth-system.md +59 -0
- package/seed-templates/blog-content.md +94 -0
- package/seed-templates/dashboard.md +89 -0
- package/seed-templates/docs-site.md +73 -0
- package/seed-templates/e-commerce.md +50 -0
- package/seed-templates/saas-landing.md +92 -0
- package/seed-templates/settings-page.md +51 -0
- package/testing/01-standards/test-strategy-and-layering.md +83 -0
- package/testing/01-standards/testing-strategy-complete.md +422 -0
- package/testing/01-standards/unit-testing-best-practices.md +118 -0
- package/testing/02-playbooks/e2e-testing-playbook.md +988 -0
- package/testing/02-playbooks/testing-strategy-playbook.md +126 -0
- package/testing/03-checklists/test-strategy-checklist.md +208 -0
- package/testing/04-antipatterns/testing-antipatterns.md +718 -0
- package/testing/05-cases/case-testing-transformation.md +300 -0
- package/testing/06-glossary/testing-glossary.md +110 -0
- package/testing/risk-based-test-matrix.md +36 -0
- package/testing/testing-strategy-deep-dive.md +37 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ui-design-system-complete
|
|
3
|
+
title: UI 设计系统完整指南
|
|
4
|
+
domain: design
|
|
5
|
+
category: 01-standards
|
|
6
|
+
difficulty: intermediate
|
|
7
|
+
tags: [accessibility, complete, design, system, tokens, 动效系统, 响应式设计, 无障碍]
|
|
8
|
+
quality_score: 70
|
|
9
|
+
last_updated: 2026-06-15
|
|
10
|
+
---
|
|
11
|
+
# UI 设计系统完整指南
|
|
12
|
+
|
|
13
|
+
## 概述
|
|
14
|
+
|
|
15
|
+
设计系统 (Design System) 是一套可复用的组件、模式和标准的集合,用于保证产品的视觉一致性和开发效率。本指南覆盖设计系统的核心元素、构建方法和实施策略。
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 设计令牌 (Design Tokens)
|
|
20
|
+
|
|
21
|
+
设计令牌是设计系统的基础原子,定义颜色、字体、间距等基本视觉属性。
|
|
22
|
+
|
|
23
|
+
### 颜色系统
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
:root {
|
|
27
|
+
/* 主色 */
|
|
28
|
+
--color-primary-50: #eff6ff;
|
|
29
|
+
--color-primary-100: #dbeafe;
|
|
30
|
+
--color-primary-500: #3b82f6;
|
|
31
|
+
--color-primary-600: #2563eb;
|
|
32
|
+
--color-primary-700: #1d4ed8;
|
|
33
|
+
--color-primary-900: #1e3a5f;
|
|
34
|
+
|
|
35
|
+
/* 语义色 */
|
|
36
|
+
--color-success: #22c55e;
|
|
37
|
+
--color-warning: #f59e0b;
|
|
38
|
+
--color-error: #ef4444;
|
|
39
|
+
--color-info: #3b82f6;
|
|
40
|
+
|
|
41
|
+
/* 中性色 */
|
|
42
|
+
--color-gray-50: #f9fafb;
|
|
43
|
+
--color-gray-100: #f3f4f6;
|
|
44
|
+
--color-gray-200: #e5e7eb;
|
|
45
|
+
--color-gray-500: #6b7280;
|
|
46
|
+
--color-gray-700: #374151;
|
|
47
|
+
--color-gray-900: #111827;
|
|
48
|
+
|
|
49
|
+
/* 背景 */
|
|
50
|
+
--bg-primary: #ffffff;
|
|
51
|
+
--bg-secondary: #f9fafb;
|
|
52
|
+
--bg-tertiary: #f3f4f6;
|
|
53
|
+
|
|
54
|
+
/* 文字 */
|
|
55
|
+
--text-primary: #111827;
|
|
56
|
+
--text-secondary: #4b5563;
|
|
57
|
+
--text-tertiary: #9ca3af;
|
|
58
|
+
--text-inverse: #ffffff;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* 暗色模式 */
|
|
62
|
+
[data-theme="dark"] {
|
|
63
|
+
--bg-primary: #111827;
|
|
64
|
+
--bg-secondary: #1f2937;
|
|
65
|
+
--bg-tertiary: #374151;
|
|
66
|
+
--text-primary: #f9fafb;
|
|
67
|
+
--text-secondary: #d1d5db;
|
|
68
|
+
--text-tertiary: #6b7280;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 排版系统
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
:root {
|
|
76
|
+
/* 字体族 */
|
|
77
|
+
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
78
|
+
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
|
|
79
|
+
|
|
80
|
+
/* 字号 (使用 rem,基于 16px) */
|
|
81
|
+
--text-xs: 0.75rem; /* 12px */
|
|
82
|
+
--text-sm: 0.875rem; /* 14px */
|
|
83
|
+
--text-base: 1rem; /* 16px */
|
|
84
|
+
--text-lg: 1.125rem; /* 18px */
|
|
85
|
+
--text-xl: 1.25rem; /* 20px */
|
|
86
|
+
--text-2xl: 1.5rem; /* 24px */
|
|
87
|
+
--text-3xl: 1.875rem; /* 30px */
|
|
88
|
+
--text-4xl: 2.25rem; /* 36px */
|
|
89
|
+
|
|
90
|
+
/* 行高 */
|
|
91
|
+
--leading-tight: 1.25;
|
|
92
|
+
--leading-normal: 1.5;
|
|
93
|
+
--leading-relaxed: 1.75;
|
|
94
|
+
|
|
95
|
+
/* 字重 */
|
|
96
|
+
--font-normal: 400;
|
|
97
|
+
--font-medium: 500;
|
|
98
|
+
--font-semibold: 600;
|
|
99
|
+
--font-bold: 700;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 间距系统
|
|
104
|
+
|
|
105
|
+
```css
|
|
106
|
+
:root {
|
|
107
|
+
/* 4px 基准网格 */
|
|
108
|
+
--space-0: 0;
|
|
109
|
+
--space-1: 0.25rem; /* 4px */
|
|
110
|
+
--space-2: 0.5rem; /* 8px */
|
|
111
|
+
--space-3: 0.75rem; /* 12px */
|
|
112
|
+
--space-4: 1rem; /* 16px */
|
|
113
|
+
--space-5: 1.25rem; /* 20px */
|
|
114
|
+
--space-6: 1.5rem; /* 24px */
|
|
115
|
+
--space-8: 2rem; /* 32px */
|
|
116
|
+
--space-10: 2.5rem; /* 40px */
|
|
117
|
+
--space-12: 3rem; /* 48px */
|
|
118
|
+
--space-16: 4rem; /* 64px */
|
|
119
|
+
--space-20: 5rem; /* 80px */
|
|
120
|
+
|
|
121
|
+
/* 圆角 */
|
|
122
|
+
--radius-sm: 0.25rem;
|
|
123
|
+
--radius-md: 0.375rem;
|
|
124
|
+
--radius-lg: 0.5rem;
|
|
125
|
+
--radius-xl: 0.75rem;
|
|
126
|
+
--radius-2xl: 1rem;
|
|
127
|
+
--radius-full: 9999px;
|
|
128
|
+
|
|
129
|
+
/* 阴影 */
|
|
130
|
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
131
|
+
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
|
132
|
+
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
133
|
+
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 组件设计原则
|
|
140
|
+
|
|
141
|
+
### 1. 组件层次
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Tokens (设计令牌)
|
|
145
|
+
└── Atoms (原子组件): Button, Input, Badge, Icon, Avatar
|
|
146
|
+
└── Molecules (分子组件): SearchBar, FormField, Card, Dropdown
|
|
147
|
+
└── Organisms (有机体): Header, Sidebar, DataTable, Form
|
|
148
|
+
└── Templates (模板): DashboardLayout, AuthLayout
|
|
149
|
+
└── Pages (页面): LoginPage, DashboardPage
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 2. Button 组件设计
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
// React 组件示例
|
|
156
|
+
interface ButtonProps {
|
|
157
|
+
variant: 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
|
|
158
|
+
size: 'sm' | 'md' | 'lg';
|
|
159
|
+
disabled?: boolean;
|
|
160
|
+
loading?: boolean;
|
|
161
|
+
leftIcon?: React.ReactNode;
|
|
162
|
+
rightIcon?: React.ReactNode;
|
|
163
|
+
children: React.ReactNode;
|
|
164
|
+
onClick?: () => void;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const Button: React.FC<ButtonProps> = ({
|
|
168
|
+
variant = 'primary',
|
|
169
|
+
size = 'md',
|
|
170
|
+
disabled = false,
|
|
171
|
+
loading = false,
|
|
172
|
+
leftIcon,
|
|
173
|
+
rightIcon,
|
|
174
|
+
children,
|
|
175
|
+
onClick,
|
|
176
|
+
}) => {
|
|
177
|
+
const baseStyles = 'inline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50';
|
|
178
|
+
|
|
179
|
+
const variants = {
|
|
180
|
+
primary: 'bg-primary-600 text-white hover:bg-primary-700 focus-visible:ring-primary-500',
|
|
181
|
+
secondary: 'bg-gray-100 text-gray-900 hover:bg-gray-200 focus-visible:ring-gray-500',
|
|
182
|
+
outline: 'border border-gray-300 bg-transparent hover:bg-gray-50 focus-visible:ring-gray-500',
|
|
183
|
+
ghost: 'bg-transparent hover:bg-gray-100 focus-visible:ring-gray-500',
|
|
184
|
+
destructive: 'bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-500',
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const sizes = {
|
|
188
|
+
sm: 'h-8 px-3 text-sm rounded-md gap-1.5',
|
|
189
|
+
md: 'h-10 px-4 text-sm rounded-lg gap-2',
|
|
190
|
+
lg: 'h-12 px-6 text-base rounded-lg gap-2.5',
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<button
|
|
195
|
+
className={`${baseStyles} ${variants[variant]} ${sizes[size]}`}
|
|
196
|
+
disabled={disabled || loading}
|
|
197
|
+
onClick={onClick}
|
|
198
|
+
>
|
|
199
|
+
{loading ? <Spinner size={size} /> : leftIcon}
|
|
200
|
+
{children}
|
|
201
|
+
{rightIcon}
|
|
202
|
+
</button>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### 3. 表单组件设计
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
interface FormFieldProps {
|
|
211
|
+
label: string;
|
|
212
|
+
error?: string;
|
|
213
|
+
hint?: string;
|
|
214
|
+
required?: boolean;
|
|
215
|
+
children: React.ReactNode;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const FormField: React.FC<FormFieldProps> = ({ label, error, hint, required, children }) => (
|
|
219
|
+
<div className="space-y-1.5">
|
|
220
|
+
<label className="text-sm font-medium text-gray-700">
|
|
221
|
+
{label}
|
|
222
|
+
{required && <span className="text-red-500 ml-0.5">*</span>}
|
|
223
|
+
</label>
|
|
224
|
+
{children}
|
|
225
|
+
{error && <p className="text-sm text-red-600">{error}</p>}
|
|
226
|
+
{hint && !error && <p className="text-sm text-gray-500">{hint}</p>}
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 响应式设计
|
|
234
|
+
|
|
235
|
+
### 断点系统
|
|
236
|
+
|
|
237
|
+
```css
|
|
238
|
+
/* Mobile First 断点 */
|
|
239
|
+
/* xs: 0px — 手机竖屏 */
|
|
240
|
+
/* sm: 640px — 手机横屏 */
|
|
241
|
+
/* md: 768px — 平板 */
|
|
242
|
+
/* lg: 1024px — 桌面 */
|
|
243
|
+
/* xl: 1280px — 大屏 */
|
|
244
|
+
/* 2xl: 1536px — 超大屏 */
|
|
245
|
+
|
|
246
|
+
/* Tailwind CSS 示例 */
|
|
247
|
+
.container {
|
|
248
|
+
@apply px-4 sm:px-6 md:px-8 lg:px-12;
|
|
249
|
+
@apply max-w-full sm:max-w-xl md:max-w-3xl lg:max-w-5xl xl:max-w-7xl;
|
|
250
|
+
@apply mx-auto;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* Grid 布局 */
|
|
254
|
+
.grid-layout {
|
|
255
|
+
@apply grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4;
|
|
256
|
+
@apply gap-4 sm:gap-6;
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 无障碍 (Accessibility)
|
|
263
|
+
|
|
264
|
+
### WCAG 2.1 核心要求
|
|
265
|
+
|
|
266
|
+
```tsx
|
|
267
|
+
// 1. 颜色对比度 >= 4.5:1 (普通文字) / >= 3:1 (大文字)
|
|
268
|
+
// 使用工具验证: https://webaim.org/resources/contrastchecker/
|
|
269
|
+
|
|
270
|
+
// 2. 键盘导航
|
|
271
|
+
const Dialog = ({ isOpen, onClose, children }) => {
|
|
272
|
+
const dialogRef = useRef(null);
|
|
273
|
+
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
if (isOpen) {
|
|
276
|
+
// 焦点陷阱
|
|
277
|
+
dialogRef.current?.focus();
|
|
278
|
+
}
|
|
279
|
+
}, [isOpen]);
|
|
280
|
+
|
|
281
|
+
const handleKeyDown = (e) => {
|
|
282
|
+
if (e.key === 'Escape') onClose();
|
|
283
|
+
// Tab 焦点陷阱逻辑...
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
return isOpen ? (
|
|
287
|
+
<div
|
|
288
|
+
role="dialog"
|
|
289
|
+
aria-modal="true"
|
|
290
|
+
aria-labelledby="dialog-title"
|
|
291
|
+
ref={dialogRef}
|
|
292
|
+
onKeyDown={handleKeyDown}
|
|
293
|
+
tabIndex={-1}
|
|
294
|
+
>
|
|
295
|
+
<h2 id="dialog-title">标题</h2>
|
|
296
|
+
{children}
|
|
297
|
+
</div>
|
|
298
|
+
) : null;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// 3. ARIA 属性
|
|
302
|
+
<button aria-label="关闭菜单" aria-expanded={isOpen}>
|
|
303
|
+
<MenuIcon />
|
|
304
|
+
</button>
|
|
305
|
+
|
|
306
|
+
// 4. 跳过导航链接
|
|
307
|
+
<a href="#main-content" className="sr-only focus:not-sr-only">
|
|
308
|
+
跳到主要内容
|
|
309
|
+
</a>
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 动效系统
|
|
315
|
+
|
|
316
|
+
```css
|
|
317
|
+
:root {
|
|
318
|
+
/* 时长 */
|
|
319
|
+
--duration-fast: 150ms;
|
|
320
|
+
--duration-normal: 250ms;
|
|
321
|
+
--duration-slow: 350ms;
|
|
322
|
+
|
|
323
|
+
/* 缓动函数 */
|
|
324
|
+
--ease-in: cubic-bezier(0.4, 0, 1, 1);
|
|
325
|
+
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
326
|
+
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
327
|
+
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/* 进入动画 */
|
|
331
|
+
@keyframes fadeIn {
|
|
332
|
+
from { opacity: 0; }
|
|
333
|
+
to { opacity: 1; }
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@keyframes slideUp {
|
|
337
|
+
from { transform: translateY(8px); opacity: 0; }
|
|
338
|
+
to { transform: translateY(0); opacity: 1; }
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.animate-fade-in {
|
|
342
|
+
animation: fadeIn var(--duration-normal) var(--ease-out);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.animate-slide-up {
|
|
346
|
+
animation: slideUp var(--duration-normal) var(--ease-out);
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## 暗色模式
|
|
353
|
+
|
|
354
|
+
```tsx
|
|
355
|
+
// React 暗色模式实现
|
|
356
|
+
function useTheme() {
|
|
357
|
+
const [theme, setTheme] = useState(() => {
|
|
358
|
+
if (typeof window !== 'undefined') {
|
|
359
|
+
return localStorage.getItem('theme') ||
|
|
360
|
+
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
361
|
+
}
|
|
362
|
+
return 'light';
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
367
|
+
localStorage.setItem('theme', theme);
|
|
368
|
+
}, [theme]);
|
|
369
|
+
|
|
370
|
+
const toggleTheme = () => setTheme(t => t === 'light' ? 'dark' : 'light');
|
|
371
|
+
|
|
372
|
+
return { theme, toggleTheme };
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## 常见反模式
|
|
379
|
+
|
|
380
|
+
### 1. 紫色渐变 + emoji图标 (AI模板味)
|
|
381
|
+
❌ 过度使用渐变背景、emoji作为图标、默认系统字体
|
|
382
|
+
✅ 使用克制的颜色、专业图标库 (Lucide/Heroicons)、定制字体
|
|
383
|
+
|
|
384
|
+
### 2. 不一致的间距
|
|
385
|
+
❌ 随意使用 13px, 17px, 23px 等非标准间距
|
|
386
|
+
✅ 使用 4px 基准网格: 4, 8, 12, 16, 24, 32, 48, 64
|
|
387
|
+
|
|
388
|
+
### 3. 忽视移动端
|
|
389
|
+
❌ 只设计桌面版,移动端靠缩放
|
|
390
|
+
✅ Mobile First 设计,渐进增强
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## Agent Checklist
|
|
395
|
+
|
|
396
|
+
Agent 在实现 UI 时必须检查:
|
|
397
|
+
|
|
398
|
+
- [ ] 是否定义了设计令牌(颜色/字体/间距/阴影)?
|
|
399
|
+
- [ ] 组件是否遵循原子设计方法论?
|
|
400
|
+
- [ ] 是否支持暗色模式?
|
|
401
|
+
- [ ] 颜色对比度是否满足 WCAG 4.5:1?
|
|
402
|
+
- [ ] 是否支持键盘导航?
|
|
403
|
+
- [ ] 是否使用了语义化 HTML 和 ARIA?
|
|
404
|
+
- [ ] 响应式是否覆盖 mobile/tablet/desktop?
|
|
405
|
+
- [ ] 动效是否使用统一的时长和缓动?
|
|
406
|
+
- [ ] 是否避免了 AI 模板感(紫色渐变/emoji图标)?
|
|
407
|
+
- [ ] 间距是否使用 4px 基准网格?
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## 参考资料
|
|
412
|
+
|
|
413
|
+
- [Tailwind CSS](https://tailwindcss.com/)
|
|
414
|
+
- [Radix UI](https://www.radix-ui.com/)
|
|
415
|
+
- [shadcn/ui](https://ui.shadcn.com/)
|
|
416
|
+
- [Material Design 3](https://m3.material.io/)
|
|
417
|
+
- [WCAG 2.1](https://www.w3.org/WAI/WCAG21/quickref/)
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
**文档版本**: v1.0
|
|
422
|
+
**最后更新**: 2026-03-28
|
|
423
|
+
**质量评分**: 88/100
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: design-handoff-playbook
|
|
3
|
+
title: Design Handoff Playbook
|
|
4
|
+
domain: design
|
|
5
|
+
category: 02-playbooks
|
|
6
|
+
difficulty: intermediate
|
|
7
|
+
tags: [agent, checklist, design, handoff, playbook, token, 导出, 常见问题与解决方案]
|
|
8
|
+
quality_score: 70
|
|
9
|
+
last_updated: 2026-06-15
|
|
10
|
+
---
|
|
11
|
+
# Design Handoff Playbook
|
|
12
|
+
|
|
13
|
+
## 概述
|
|
14
|
+
|
|
15
|
+
设计交付(Design Handoff)是设计稿从设计师到开发工程师的完整传递流程。一个高质量的交付流程能显著减少返工、降低沟通成本,并确保最终产品与设计意图一致。本 Playbook 覆盖从 Figma 标注到最终走查验收的完整链路,适用于 Web、移动端和跨平台项目。
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 阶段一:设计稿准备与标注
|
|
20
|
+
|
|
21
|
+
### 1.1 图层与命名规范
|
|
22
|
+
|
|
23
|
+
- 所有图层使用语义化命名:`header/nav/logo`、`card/product/title`
|
|
24
|
+
- 禁止出现 `Frame 123`、`Group 45` 等默认命名
|
|
25
|
+
- 组件实例与 Master Component 保持同步,不允许 detach 后修改
|
|
26
|
+
- 隐藏图层必须清理,交付稿中不包含废弃设计
|
|
27
|
+
|
|
28
|
+
### 1.2 Figma 标注要求
|
|
29
|
+
|
|
30
|
+
| 标注项 | 要求 | 工具 |
|
|
31
|
+
|--------|------|------|
|
|
32
|
+
| 间距与尺寸 | Auto Layout 约束,非手动标注 | Figma Auto Layout |
|
|
33
|
+
| 颜色 | 引用 Design Token,非硬编码 HEX | Figma Variables |
|
|
34
|
+
| 字体 | 引用 Text Style,标注 font-family/size/weight/line-height | Figma Text Styles |
|
|
35
|
+
| 圆角 | 统一使用变量:`radius-sm/md/lg/xl` | Figma Variables |
|
|
36
|
+
| 阴影 | 引用 Effect Style,标注 x/y/blur/spread/color | Figma Effect Styles |
|
|
37
|
+
| 图标 | SVG 导出,统一命名:`icon-{category}-{name}` | Figma Export |
|
|
38
|
+
|
|
39
|
+
### 1.3 状态覆盖
|
|
40
|
+
|
|
41
|
+
每个交互组件必须包含以下状态的设计稿:
|
|
42
|
+
|
|
43
|
+
- Default / Hover / Active / Focus / Disabled
|
|
44
|
+
- Loading / Empty / Error / Success
|
|
45
|
+
- 移动端额外状态:Pressed / Swiped
|
|
46
|
+
|
|
47
|
+
### 1.4 响应式断点
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Mobile: 320px - 767px
|
|
51
|
+
Tablet: 768px - 1023px
|
|
52
|
+
Desktop: 1024px - 1439px
|
|
53
|
+
Wide: 1440px+
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
每个关键页面至少提供 Mobile + Desktop 两套设计稿。
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 阶段二:Design Token 导出
|
|
61
|
+
|
|
62
|
+
### 2.1 Token 结构
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"color": {
|
|
67
|
+
"primary": { "50": "#E3F2FD", "500": "#2196F3", "900": "#0D47A1" },
|
|
68
|
+
"neutral": { "0": "#FFFFFF", "100": "#F5F5F5", "900": "#212121" },
|
|
69
|
+
"semantic": { "success": "#4CAF50", "warning": "#FF9800", "error": "#F44336" }
|
|
70
|
+
},
|
|
71
|
+
"spacing": {
|
|
72
|
+
"xs": "4px", "sm": "8px", "md": "16px", "lg": "24px", "xl": "32px", "2xl": "48px"
|
|
73
|
+
},
|
|
74
|
+
"typography": {
|
|
75
|
+
"heading-1": { "fontSize": "32px", "fontWeight": 700, "lineHeight": 1.25 },
|
|
76
|
+
"body-md": { "fontSize": "16px", "fontWeight": 400, "lineHeight": 1.5 }
|
|
77
|
+
},
|
|
78
|
+
"radius": { "sm": "4px", "md": "8px", "lg": "12px", "xl": "16px", "full": "9999px" },
|
|
79
|
+
"shadow": {
|
|
80
|
+
"sm": "0 1px 2px rgba(0,0,0,0.05)",
|
|
81
|
+
"md": "0 4px 6px rgba(0,0,0,0.07)",
|
|
82
|
+
"lg": "0 10px 15px rgba(0,0,0,0.1)"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2.2 导出工具链
|
|
88
|
+
|
|
89
|
+
- **Figma Tokens Studio** -> JSON -> Style Dictionary -> CSS Variables / Tailwind Config
|
|
90
|
+
- 确保 Token 命名在设计稿与代码中保持一致
|
|
91
|
+
- Token 变更需走 PR 流程,设计师与开发共同 Review
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 阶段三:组件映射表
|
|
96
|
+
|
|
97
|
+
### 3.1 映射文档格式
|
|
98
|
+
|
|
99
|
+
| Figma 组件 | 前端组件 | Props | 备注 |
|
|
100
|
+
|------------|---------|-------|------|
|
|
101
|
+
| Button/Primary | `<Button variant="primary">` | size, disabled, loading | 包含 icon 插槽 |
|
|
102
|
+
| Card/Product | `<ProductCard>` | title, image, price, rating | 响应式宽度 |
|
|
103
|
+
| Input/Text | `<TextField>` | label, error, helper, disabled | 支持前后缀 |
|
|
104
|
+
| Modal/Confirm | `<ConfirmDialog>` | title, message, onConfirm, onCancel | 带遮罩层 |
|
|
105
|
+
| Toast/Success | `<Toast variant="success">` | message, duration, action | 自动消失 |
|
|
106
|
+
|
|
107
|
+
### 3.2 组件分级
|
|
108
|
+
|
|
109
|
+
- **Tier 1 - 原子组件**:Button、Input、Icon、Badge、Avatar
|
|
110
|
+
- **Tier 2 - 分子组件**:Card、ListItem、FormField、MenuItem
|
|
111
|
+
- **Tier 3 - 有机体组件**:Header、Sidebar、DataTable、Form
|
|
112
|
+
- **Tier 4 - 页面模板**:DashboardLayout、AuthLayout、SettingsLayout
|
|
113
|
+
|
|
114
|
+
优先交付 Tier 1-2,确保基础组件 100% 覆盖后再构建上层。
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 阶段四:交付会议
|
|
119
|
+
|
|
120
|
+
### 4.1 会议准备
|
|
121
|
+
|
|
122
|
+
- 设计师提前 1 天发送交付页面链接和标注说明
|
|
123
|
+
- 开发提前浏览设计稿,准备技术可行性问题
|
|
124
|
+
- PM 准备需求优先级和时间排期
|
|
125
|
+
|
|
126
|
+
### 4.2 会议议程(60 分钟)
|
|
127
|
+
|
|
128
|
+
1. **全局走查**(15 min):页面流程、导航逻辑、关键路径
|
|
129
|
+
2. **组件细节**(20 min):交互状态、边界情况、动效说明
|
|
130
|
+
3. **技术讨论**(15 min):实现难点、性能考量、兼容性
|
|
131
|
+
4. **确认与排期**(10 min):确认交付范围、分期计划、验收标准
|
|
132
|
+
|
|
133
|
+
### 4.3 会议产出
|
|
134
|
+
|
|
135
|
+
- 交付确认清单(Checklist)签字
|
|
136
|
+
- 技术难点 Spike 任务分配
|
|
137
|
+
- 各组件开发排期到人到天
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 阶段五:开发实现
|
|
142
|
+
|
|
143
|
+
### 5.1 开发规范
|
|
144
|
+
|
|
145
|
+
- 组件 Props 命名与 Figma 属性名保持一致
|
|
146
|
+
- 使用 Design Token 变量,禁止硬编码颜色/间距/字号
|
|
147
|
+
- 响应式实现使用设计稿定义的断点
|
|
148
|
+
- 动效参数(duration、easing、delay)从设计标注中获取
|
|
149
|
+
|
|
150
|
+
### 5.2 实现顺序
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
1. Token 系统搭建(颜色/字体/间距/圆角/阴影)
|
|
154
|
+
2. 原子组件库(Button/Input/Icon 等)
|
|
155
|
+
3. 分子组件(Card/ListItem 等)
|
|
156
|
+
4. 页面布局(Grid/Layout/Navigation)
|
|
157
|
+
5. 页面组装与数据对接
|
|
158
|
+
6. 动效与微交互
|
|
159
|
+
7. 响应式适配与兼容性
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 5.3 实现过程中的沟通
|
|
163
|
+
|
|
164
|
+
- 遇到设计稿不清晰的地方,在 Figma 中添加 Comment 并 @ 设计师
|
|
165
|
+
- 技术限制导致无法完全还原时,提出替代方案并记录差异
|
|
166
|
+
- 每完成一个组件/页面立即推送预览链接
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 阶段六:设计走查(Design QA)
|
|
171
|
+
|
|
172
|
+
### 6.1 走查准备
|
|
173
|
+
|
|
174
|
+
- 部署到 Staging 环境或提供预览链接
|
|
175
|
+
- 准备设计稿与实现的并排对比环境
|
|
176
|
+
- 记录已知差异和技术限制说明
|
|
177
|
+
|
|
178
|
+
### 6.2 走查维度
|
|
179
|
+
|
|
180
|
+
| 维度 | 检查内容 | 优先级 |
|
|
181
|
+
|------|---------|--------|
|
|
182
|
+
| 布局 | 间距、对齐、网格一致性 | P0 |
|
|
183
|
+
| 颜色 | Token 使用正确性、对比度 | P0 |
|
|
184
|
+
| 字体 | 字号/字重/行高/字间距 | P0 |
|
|
185
|
+
| 交互 | 各状态(hover/focus/disabled)还原度 | P0 |
|
|
186
|
+
| 响应式 | 各断点布局、元素隐显 | P1 |
|
|
187
|
+
| 动效 | 过渡效果、缓动函数、时长 | P1 |
|
|
188
|
+
| 内容 | 长文本截断、空状态、错误提示 | P1 |
|
|
189
|
+
| 无障碍 | 键盘导航、屏幕阅读器、对比度 | P1 |
|
|
190
|
+
|
|
191
|
+
### 6.3 问题记录格式
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
[页面] 首页 > Hero 区域
|
|
195
|
+
[问题] 标题字号偏大,设计稿为 32px 实际为 36px
|
|
196
|
+
[优先级] P0
|
|
197
|
+
[截图] {设计稿截图} vs {实现截图}
|
|
198
|
+
[修复建议] 修改 heading-1 token 值
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 6.4 走查轮次
|
|
202
|
+
|
|
203
|
+
- **第一轮**:整体布局与视觉还原度(修复 P0)
|
|
204
|
+
- **第二轮**:交互状态与响应式(修复 P1)
|
|
205
|
+
- **第三轮**:细节打磨与边界情况(收尾)
|
|
206
|
+
- 每轮走查后 48 小时内修复,修复后触发下一轮
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 阶段七:验收与归档
|
|
211
|
+
|
|
212
|
+
### 7.1 验收标准
|
|
213
|
+
|
|
214
|
+
- P0 问题全部修复
|
|
215
|
+
- P1 问题修复率 >= 90%
|
|
216
|
+
- 主流程 100% 还原
|
|
217
|
+
- 响应式三端(Mobile/Tablet/Desktop)达标
|
|
218
|
+
- 无障碍基础检查通过(WCAG 2.1 AA)
|
|
219
|
+
|
|
220
|
+
### 7.2 归档产出
|
|
221
|
+
|
|
222
|
+
- 组件映射表最终版(含实际 Props 和差异说明)
|
|
223
|
+
- Design Token 版本号与代码同步记录
|
|
224
|
+
- 走查问题汇总与修复状态
|
|
225
|
+
- 设计师签字确认验收通过
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 常见问题与解决方案
|
|
230
|
+
|
|
231
|
+
| 问题 | 原因 | 解决方案 |
|
|
232
|
+
|------|------|---------|
|
|
233
|
+
| 颜色不一致 | 未使用 Token | 强制使用 CSS Variables |
|
|
234
|
+
| 间距偏差 | 手动标注 vs Auto Layout | 统一使用 Auto Layout |
|
|
235
|
+
| 字体渲染差异 | 系统字体差异 | 指定 font-display 策略 |
|
|
236
|
+
| 动效不流畅 | GPU 合成层问题 | 使用 transform/opacity |
|
|
237
|
+
| 响应式断裂 | 断点未对齐 | 使用设计稿定义的断点 |
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Agent Checklist
|
|
242
|
+
|
|
243
|
+
以下为 AI Agent 在执行设计交付流程时的检查要点:
|
|
244
|
+
|
|
245
|
+
- [ ] 确认设计稿图层命名规范,无默认命名
|
|
246
|
+
- [ ] 确认所有交互组件包含完整状态设计
|
|
247
|
+
- [ ] 确认 Design Token 已导出并与代码同步
|
|
248
|
+
- [ ] 确认组件映射表已建立并经双方确认
|
|
249
|
+
- [ ] 确认响应式断点与设计稿一致
|
|
250
|
+
- [ ] 确认开发实现使用 Token 变量而非硬编码
|
|
251
|
+
- [ ] 确认每个组件/页面完成后立即进行设计走查
|
|
252
|
+
- [ ] 确认 P0 问题全部修复后方可进入下一阶段
|
|
253
|
+
- [ ] 确认最终验收由设计师签字确认
|
|
254
|
+
- [ ] 确认所有走查记录和差异说明已归档
|