@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,384 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Flutter 完整开发标准
|
|
3
|
+
category: mobile/standards
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
last_updated: 2026-03-20
|
|
6
|
+
maintainer: Excellent(11964948@qq.com)
|
|
7
|
+
knowledge_score: 9.3/10
|
|
8
|
+
domain: mobile
|
|
9
|
+
difficulty: intermediate
|
|
10
|
+
quality_score: 70
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# 开发:Excellent(11964948@qq.com)
|
|
14
|
+
|
|
15
|
+
## Flutter 完整开发标准
|
|
16
|
+
|
|
17
|
+
### 1. 架构与分层
|
|
18
|
+
- 遵循 Clean Architecture 或 MVVM 模式。
|
|
19
|
+
- 表现层、领域层、数据层严格分离。
|
|
20
|
+
- 依赖注入使用 get_it 或 Provider。
|
|
21
|
+
- 路由管理使用 go_router 或 auto_route。
|
|
22
|
+
|
|
23
|
+
### 2. 组件设计原则
|
|
24
|
+
- Widget 单一职责,代码不超过 300 行。
|
|
25
|
+
- 使用 const 构造函数优化性能。
|
|
26
|
+
- 拆分 StatelessWidget 和 StatefulWidget。
|
|
27
|
+
- 复用组件提取到独立文件。
|
|
28
|
+
|
|
29
|
+
### 3. 状态管理策略
|
|
30
|
+
- 简单状态:Provider + ChangeNotifier。
|
|
31
|
+
- 复杂状态:Riverpod 或 Bloc。
|
|
32
|
+
- 表单状态:FormKey + TextEditingController。
|
|
33
|
+
- 避免过度使用全局状态。
|
|
34
|
+
|
|
35
|
+
### 4. 性能优化策略
|
|
36
|
+
- 使用 const Widget 减少重建。
|
|
37
|
+
- ListView.builder 渲染长列表。
|
|
38
|
+
- 图片使用 cached_network_image。
|
|
39
|
+
- 避免在 build 方法中执行耗时操作。
|
|
40
|
+
- 使用 Isolate 执行 CPU 密集型任务。
|
|
41
|
+
|
|
42
|
+
### 5. 原生集成与插件
|
|
43
|
+
- 使用 Platform Channel 与原生通信。
|
|
44
|
+
- 复杂功能使用现有插件(相机、地图、支付)。
|
|
45
|
+
- 处理好 Android/iOS 平台差异。
|
|
46
|
+
- 权限申请使用 permission_handler。
|
|
47
|
+
|
|
48
|
+
### 6. 网络与数据存储
|
|
49
|
+
- 网络请求使用 dio + retrofit。
|
|
50
|
+
- 本地存储使用 Hive 或 Drift。
|
|
51
|
+
- 离线优先策略(Offline First)。
|
|
52
|
+
- 网络状态监听和重试机制。
|
|
53
|
+
|
|
54
|
+
### 7. 错误处理与监控
|
|
55
|
+
- 全局错误捕获(FlutterError.onError)。
|
|
56
|
+
- 网络错误统一处理。
|
|
57
|
+
- 集成 Sentry 或 Firebase Crashlytics。
|
|
58
|
+
- 关键路径埋点监控。
|
|
59
|
+
|
|
60
|
+
### 8. 测试策略
|
|
61
|
+
- 单元测试:业务逻辑、工具类。
|
|
62
|
+
- Widget 测试:组件交互和渲染。
|
|
63
|
+
- 集成测试:关键流程端到端。
|
|
64
|
+
- 测试覆盖率 >= 70%。
|
|
65
|
+
|
|
66
|
+
### 9. 安全规范
|
|
67
|
+
- 敏感数据使用 flutter_secure_storage。
|
|
68
|
+
- 禁止硬编码密钥,使用 .env 文件。
|
|
69
|
+
- HTTPS 强制开启。
|
|
70
|
+
- 代码混淆(--obfuscate)。
|
|
71
|
+
|
|
72
|
+
### 10. 国际化与适配
|
|
73
|
+
- 使用 intl 和 flutter_localizations。
|
|
74
|
+
- 文案抽取为 ARB 文件。
|
|
75
|
+
- 适配不同屏幕尺寸(MediaQuery)。
|
|
76
|
+
- 支持 RTL 布局。
|
|
77
|
+
|
|
78
|
+
## 代码示例
|
|
79
|
+
|
|
80
|
+
### Widget 组件示例
|
|
81
|
+
```dart
|
|
82
|
+
// 开发:Excellent(11964948@qq.com)
|
|
83
|
+
// 功能:用户头像组件
|
|
84
|
+
// 作用:展示用户头像,支持默认头像和加载状态
|
|
85
|
+
// 创建时间:2026-03-20
|
|
86
|
+
// 最后修改:2026-03-20
|
|
87
|
+
|
|
88
|
+
import 'package:flutter/material.dart';
|
|
89
|
+
import 'package:cached_network_image/cached_network_image.dart';
|
|
90
|
+
|
|
91
|
+
class UserAvatar extends StatelessWidget {
|
|
92
|
+
final String? imageUrl;
|
|
93
|
+
final double size;
|
|
94
|
+
final bool isLoading;
|
|
95
|
+
|
|
96
|
+
const UserAvatar({
|
|
97
|
+
Key? key,
|
|
98
|
+
this.imageUrl,
|
|
99
|
+
this.size = 48.0,
|
|
100
|
+
this.isLoading = false,
|
|
101
|
+
}) : super(key: key);
|
|
102
|
+
|
|
103
|
+
@override
|
|
104
|
+
Widget build(BuildContext context) {
|
|
105
|
+
if (isLoading) {
|
|
106
|
+
return Container(
|
|
107
|
+
width: size,
|
|
108
|
+
height: size,
|
|
109
|
+
decoration: BoxDecoration(
|
|
110
|
+
color: Colors.grey[200],
|
|
111
|
+
shape: BoxShape.circle,
|
|
112
|
+
),
|
|
113
|
+
child: Center(
|
|
114
|
+
child: SizedBox(
|
|
115
|
+
width: size * 0.5,
|
|
116
|
+
height: size * 0.5,
|
|
117
|
+
child: const CircularProgressIndicator(strokeWidth: 2),
|
|
118
|
+
),
|
|
119
|
+
),
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return ClipOval(
|
|
124
|
+
child: CachedNetworkImage(
|
|
125
|
+
imageUrl: imageUrl ?? 'https://via.placeholder.com/150',
|
|
126
|
+
width: size,
|
|
127
|
+
height: size,
|
|
128
|
+
fit: BoxFit.cover,
|
|
129
|
+
placeholder: (context, url) => Container(
|
|
130
|
+
color: Colors.grey[200],
|
|
131
|
+
child: Icon(
|
|
132
|
+
Icons.person,
|
|
133
|
+
size: size * 0.6,
|
|
134
|
+
color: Colors.grey[400],
|
|
135
|
+
),
|
|
136
|
+
),
|
|
137
|
+
errorWidget: (context, url, error) => Container(
|
|
138
|
+
color: Colors.grey[200],
|
|
139
|
+
child: Icon(
|
|
140
|
+
Icons.error_outline,
|
|
141
|
+
size: size * 0.6,
|
|
142
|
+
color: Colors.red,
|
|
143
|
+
),
|
|
144
|
+
),
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 网络请求封装示例
|
|
152
|
+
```dart
|
|
153
|
+
// 开发:Excellent(11964948@qq.com)
|
|
154
|
+
// 功能:API 客户端封装
|
|
155
|
+
// 作用:统一管理网络请求,包含认证和错误处理
|
|
156
|
+
// 创建时间:2026-03-20
|
|
157
|
+
// 最后修改:2026-03-20
|
|
158
|
+
|
|
159
|
+
import 'package:dio/dio.dart';
|
|
160
|
+
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|
161
|
+
|
|
162
|
+
class ApiClient {
|
|
163
|
+
static const String baseUrl = 'https://api.example.com';
|
|
164
|
+
final Dio _dio;
|
|
165
|
+
final FlutterSecureStorage _storage = const FlutterSecureStorage();
|
|
166
|
+
|
|
167
|
+
ApiClient() : _dio = Dio(BaseOptions(baseUrl: baseUrl)) {
|
|
168
|
+
_dio.interceptors.add(
|
|
169
|
+
InterceptorsWrapper(
|
|
170
|
+
onRequest: (options, handler) async {
|
|
171
|
+
final token = await _storage.read(key: 'auth_token');
|
|
172
|
+
if (token != null) {
|
|
173
|
+
options.headers['Authorization'] = 'Bearer $token';
|
|
174
|
+
}
|
|
175
|
+
return handler.next(options);
|
|
176
|
+
},
|
|
177
|
+
onError: (error, handler) {
|
|
178
|
+
if (error.response?.statusCode == 401) {
|
|
179
|
+
// 处理认证失败
|
|
180
|
+
_handleUnauthorized();
|
|
181
|
+
}
|
|
182
|
+
return handler.next(error);
|
|
183
|
+
},
|
|
184
|
+
),
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
Future<T> get<T>(String endpoint) async {
|
|
189
|
+
try {
|
|
190
|
+
final response = await _dio.get<T>(endpoint);
|
|
191
|
+
return response.data as T;
|
|
192
|
+
} on DioException catch (e) {
|
|
193
|
+
throw _handleError(e);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
Future<T> post<T>(String endpoint, dynamic data) async {
|
|
198
|
+
try {
|
|
199
|
+
final response = await _dio.post<T>(endpoint, data: data);
|
|
200
|
+
return response.data as T;
|
|
201
|
+
} on DioException catch (e) {
|
|
202
|
+
throw _handleError(e);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
Exception _handleError(DioException error) {
|
|
207
|
+
switch (error.type) {
|
|
208
|
+
case DioExceptionType.connectionTimeout:
|
|
209
|
+
case DioExceptionType.sendTimeout:
|
|
210
|
+
case DioExceptionType.receiveTimeout:
|
|
211
|
+
return Exception('网络请求超时,请检查网络连接');
|
|
212
|
+
case DioExceptionType.badResponse:
|
|
213
|
+
final message = error.response?.data['message'] ?? '请求失败';
|
|
214
|
+
return Exception(message);
|
|
215
|
+
default:
|
|
216
|
+
return Exception('网络请求失败:${error.message}');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
void _handleUnauthorized() {
|
|
221
|
+
// 清除本地存储的 token
|
|
222
|
+
_storage.delete(key: 'auth_token');
|
|
223
|
+
// 跳转到登录页面
|
|
224
|
+
// 需要通过全局导航器处理
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
final apiClient = ApiClient();
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 状态管理示例(Provider)
|
|
232
|
+
```dart
|
|
233
|
+
// 开发:Excellent(11964948@qq.com)
|
|
234
|
+
// 功能:用户状态管理
|
|
235
|
+
// 作用:管理用户登录状态和用户信息
|
|
236
|
+
// 创建时间:2026-03-20
|
|
237
|
+
// 最后修改:2026-03-20
|
|
238
|
+
|
|
239
|
+
import 'package:flutter/material.dart';
|
|
240
|
+
|
|
241
|
+
class User {
|
|
242
|
+
final String id;
|
|
243
|
+
final String name;
|
|
244
|
+
final String email;
|
|
245
|
+
final String? avatar;
|
|
246
|
+
|
|
247
|
+
User({
|
|
248
|
+
required this.id,
|
|
249
|
+
required this.name,
|
|
250
|
+
required this.email,
|
|
251
|
+
this.avatar,
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
factory User.fromJson(Map<String, dynamic> json) {
|
|
255
|
+
return User(
|
|
256
|
+
id: json['id'],
|
|
257
|
+
name: json['name'],
|
|
258
|
+
email: json['email'],
|
|
259
|
+
avatar: json['avatar'],
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
class UserProvider extends ChangeNotifier {
|
|
265
|
+
User? _user;
|
|
266
|
+
bool _isLoading = false;
|
|
267
|
+
String? _error;
|
|
268
|
+
|
|
269
|
+
User? get user => _user;
|
|
270
|
+
bool get isLoading => _isLoading;
|
|
271
|
+
String? get error => _error;
|
|
272
|
+
bool get isAuthenticated => _user != null;
|
|
273
|
+
|
|
274
|
+
Future<void> login(String email, String password) async {
|
|
275
|
+
_isLoading = true;
|
|
276
|
+
_error = null;
|
|
277
|
+
notifyListeners();
|
|
278
|
+
|
|
279
|
+
try {
|
|
280
|
+
// 模拟 API 调用
|
|
281
|
+
await Future.delayed(const Duration(seconds: 2));
|
|
282
|
+
|
|
283
|
+
_user = User(
|
|
284
|
+
id: '1',
|
|
285
|
+
name: 'John Doe',
|
|
286
|
+
email: email,
|
|
287
|
+
avatar: 'https://via.placeholder.com/150',
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
_isLoading = false;
|
|
291
|
+
notifyListeners();
|
|
292
|
+
} catch (e) {
|
|
293
|
+
_isLoading = false;
|
|
294
|
+
_error = e.toString();
|
|
295
|
+
notifyListeners();
|
|
296
|
+
rethrow;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
Future<void> logout() async {
|
|
301
|
+
_user = null;
|
|
302
|
+
notifyListeners();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
void clearError() {
|
|
306
|
+
_error = null;
|
|
307
|
+
notifyListeners();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// 使用示例
|
|
312
|
+
class UserAvatarWidget extends StatelessWidget {
|
|
313
|
+
const UserAvatarWidget({Key? key}) : super(key: key);
|
|
314
|
+
|
|
315
|
+
@override
|
|
316
|
+
Widget build(BuildContext context) {
|
|
317
|
+
return Consumer<UserProvider>(
|
|
318
|
+
builder: (context, userProvider, child) {
|
|
319
|
+
if (userProvider.isLoading) {
|
|
320
|
+
return const CircularProgressIndicator();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (!userProvider.isAuthenticated) {
|
|
324
|
+
return const Icon(Icons.person);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return UserAvatar(
|
|
328
|
+
imageUrl: userProvider.user?.avatar,
|
|
329
|
+
size: 48,
|
|
330
|
+
);
|
|
331
|
+
},
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## 反模式识别
|
|
338
|
+
|
|
339
|
+
### 反模式列表
|
|
340
|
+
- 在 build 方法中执行耗时操作或网络请求。
|
|
341
|
+
- 过度使用 StatefulWidget 导致性能下降。
|
|
342
|
+
- 未使用 const 构造函数导致不必要的重建。
|
|
343
|
+
- ListView 未使用 builder 导致内存问题。
|
|
344
|
+
- 状态管理混乱,全局状态滥用。
|
|
345
|
+
- 未处理网络请求失败和超时。
|
|
346
|
+
- 图片未缓存导致重复加载。
|
|
347
|
+
- 未做权限检查直接调用原生功能。
|
|
348
|
+
|
|
349
|
+
## 检查清单
|
|
350
|
+
|
|
351
|
+
### 开发阶段
|
|
352
|
+
- [ ] 架构分层清晰,职责明确
|
|
353
|
+
- [ ] 使用 const Widget 优化性能
|
|
354
|
+
- [ ] ListView 使用 builder 渲染长列表
|
|
355
|
+
- [ ] 图片使用缓存策略
|
|
356
|
+
- [ ] 状态管理合理,避免过度共享
|
|
357
|
+
- [ ] 网络请求封装统一,包含错误处理
|
|
358
|
+
- [ ] 敏感数据存储使用安全存储方案
|
|
359
|
+
- [ ] 权限申请流程完整
|
|
360
|
+
- [ ] 关键路径添加埋点监控
|
|
361
|
+
- [ ] 国际化文案抽取完成
|
|
362
|
+
|
|
363
|
+
### 测试阶段
|
|
364
|
+
- [ ] 单元测试覆盖率 >= 70%
|
|
365
|
+
- [ ] Widget 测试覆盖关键组件
|
|
366
|
+
- [ ] 集成测试覆盖关键流程
|
|
367
|
+
- [ ] 不同设备尺寸适配测试
|
|
368
|
+
- [ ] 网络异常场景测试
|
|
369
|
+
- [ ] 性能指标符合基线
|
|
370
|
+
|
|
371
|
+
### 发布阶段
|
|
372
|
+
- [ ] 生产环境配置正确
|
|
373
|
+
- [ ] 代码混淆和加固完成
|
|
374
|
+
- [ ] 崩溃监控集成完成
|
|
375
|
+
- [ ] 版本号和构建号更新
|
|
376
|
+
- [ ] 应用商店素材准备完成
|
|
377
|
+
- [ ] 更新日志编写完成
|
|
378
|
+
|
|
379
|
+
## 参考资料
|
|
380
|
+
- Flutter 官方文档:https://flutter.dev/docs
|
|
381
|
+
- Dart 官方文档:https://dart.dev/guides
|
|
382
|
+
- Provider 文档:https://pub.dev/packages/provider
|
|
383
|
+
- Riverpod 文档:https://riverpod.dev/
|
|
384
|
+
- Dio 文档:https://pub.dev/packages/dio
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ios-design-hig
|
|
3
|
+
title: iOS 设计规范(Apple Human Interface Guidelines · 官方)
|
|
4
|
+
domain: mobile
|
|
5
|
+
category: 01-standards
|
|
6
|
+
difficulty: intermediate
|
|
7
|
+
tags: [ios, 设计规范, hig, human-interface-guidelines, apple, sf字体, dynamic-type, 导航, tabbar, 安全区, 深色模式, sf-symbols, 商业级]
|
|
8
|
+
quality_score: 95
|
|
9
|
+
last_updated: 2026-06-19
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# iOS 设计规范(Apple Human Interface Guidelines · 官方)
|
|
13
|
+
|
|
14
|
+
> 纯 Claude/Codex 写 iOS UI 常常"web 味"很重、不像原生。本标准是 Apple 官方 HIG 的落地要点——做出**像 iOS 原生**的界面。设计 iOS 应用前必读。
|
|
15
|
+
|
|
16
|
+
## 1. 四大核心原则(HIG)
|
|
17
|
+
|
|
18
|
+
- **Clarity 清晰**:内容优先,文字清晰可读,图标精准,留白充分。
|
|
19
|
+
- **Deference 谦让**:UI 让位于内容,不喧宾夺主;用半透明/模糊衬托而非抢戏。
|
|
20
|
+
- **Depth 层次**:用真实的层级与过渡传达结构(卡片、模态滑入、层叠)。
|
|
21
|
+
- **Consistency 一致**:用系统标准组件与交互,符合用户跨 Apple 生态的既有习惯。
|
|
22
|
+
|
|
23
|
+
## 2. 排版(Typography)
|
|
24
|
+
|
|
25
|
+
- 用系统字体 **San Francisco (SF Pro)**:正文 SF Pro Text(≤19pt),大标题 SF Pro Display(≥20pt);中文用苹方(PingFang SC)。
|
|
26
|
+
- **必须支持 Dynamic Type**(用户可调字号,无障碍)——用文本样式(Large Title/Title/Body/Caption…)而非写死字号,布局随字号弹性。
|
|
27
|
+
- 建立清晰的字阶层级(Large Title → Title → Headline → Body → Footnote)。
|
|
28
|
+
|
|
29
|
+
## 3. 颜色与材质
|
|
30
|
+
|
|
31
|
+
- 用**语义系统颜色**(`label`/`secondaryLabel`/`systemBackground`/`systemBlue`…)而非硬编码,自动适配深浅色。
|
|
32
|
+
- 一个克制的品牌强调色 + 系统色;不要满屏高饱和。
|
|
33
|
+
- 善用材质(Materials/毛玻璃)做层次;遵循系统的浅色/深色双模式。
|
|
34
|
+
|
|
35
|
+
## 4. 布局与适配
|
|
36
|
+
|
|
37
|
+
- 内容尊重**安全区(Safe Area)**:避开刘海/灵动岛/Home Indicator/状态栏。
|
|
38
|
+
- 标准边距与对齐;触控目标 **≥44×44pt**。
|
|
39
|
+
- 适配各机型尺寸、横竖屏、iPad(分屏/多窗);用 Auto Layout/SwiftUI 自适应,不写死像素。
|
|
40
|
+
- 尊重 reduce motion / increase contrast 等无障碍设置。
|
|
41
|
+
|
|
42
|
+
## 5. 导航范式(iOS 特有,别套 web)
|
|
43
|
+
|
|
44
|
+
- **Tab Bar**:底部,切换 App 顶层模块,iPhone 上**最多 5 个**。
|
|
45
|
+
- **Navigation Bar**:层级钻取(drill-down),左上返回,标题居中/大标题。
|
|
46
|
+
- **Modal Sheet**:聚焦单一任务(新建/编辑),可下拉关闭;破坏性确认用 Action Sheet/Alert。
|
|
47
|
+
- 手势:边缘左滑返回、列表左滑操作、下拉刷新——符合系统习惯。
|
|
48
|
+
|
|
49
|
+
## 6. 组件(用系统标准件)
|
|
50
|
+
|
|
51
|
+
- 优先用系统组件(按钮、列表 List、表单、分段控件、开关、Picker、搜索栏、上下文菜单),自带正确外观/交互/无障碍。
|
|
52
|
+
- 图标用 **SF Symbols**(与系统一致、随字重/字号缩放、支持多色),**不要用 emoji 当功能图标**。
|
|
53
|
+
- 列表用 inset grouped 等系统样式;空态/加载态/错误态都要做。
|
|
54
|
+
|
|
55
|
+
## 7. 体验细节
|
|
56
|
+
|
|
57
|
+
- 即时反馈:点击态、加载指示、触感反馈(Haptics)。
|
|
58
|
+
- 流畅自然的转场动画(遵循系统时长/曲线),不要花哨突兀。
|
|
59
|
+
- 首次启动/权限请求有上下文说明;尊重用户选择。
|
|
60
|
+
|
|
61
|
+
## 8. 反模式(出现即不合格 / "不像 iOS")
|
|
62
|
+
|
|
63
|
+
- 把 web/安卓的 UI 范式硬搬到 iOS(如安卓 FAB、底部抽屉当主导航乱用)。
|
|
64
|
+
- 写死字号不支持 Dynamic Type;硬编码颜色不适配深色。
|
|
65
|
+
- 忽略安全区导致内容被刘海/Home 条遮挡;触控目标过小。
|
|
66
|
+
- 用 emoji 当图标而非 SF Symbols;自绘一堆非标准控件却没做无障碍。
|
|
67
|
+
- Tab 超过 5 个;模态/导航滥用,不符系统手势。
|
|
68
|
+
|
|
69
|
+
## 9. 最低交付 checklist
|
|
70
|
+
|
|
71
|
+
- [ ] 遵循 Clarity/Deference/Depth/Consistency;用系统标准组件。
|
|
72
|
+
- [ ] SF/苹方字体 + Dynamic Type + 清晰字阶;语义系统颜色 + 深色适配。
|
|
73
|
+
- [ ] 安全区适配 + ≥44pt 触控 + 多机型/横竖屏/iPad 自适应。
|
|
74
|
+
- [ ] 导航用 Tab(≤5)/Nav Bar/Modal + 系统手势;SF Symbols 图标无 emoji。
|
|
75
|
+
- [ ] 反馈/Haptics/自然转场 + 三态 + 无障碍(VoiceOver/对比度/reduce motion)。
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
**参考(官方)**:Apple Human Interface Guidelines (developer.apple.com/design/human-interface-guidelines)、SF Symbols、Dynamic Type、Safe Area、SwiftUI。
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: mobile-app-standard
|
|
3
|
+
title: 移动 App 开发标准(iOS/Android/跨平台 · 商业级)
|
|
4
|
+
domain: mobile
|
|
5
|
+
category: 01-standards
|
|
6
|
+
difficulty: intermediate
|
|
7
|
+
tags: [移动, mobile, ios, android, swiftui, jetpack compose, flutter, react-native, mvvm, 导航, 离线, 推送, hig, material, 商业级]
|
|
8
|
+
quality_score: 95
|
|
9
|
+
last_updated: 2026-06-19
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 移动 App 开发标准(iOS/Android/跨平台 · 商业级)
|
|
13
|
+
|
|
14
|
+
> 移动 App 不是"把网页塞进手机"。要遵循平台设计规范、处理生命周期/离线/弱网、做好性能与发布。本标准覆盖原生(SwiftUI/Compose)与跨平台(Flutter/RN)。
|
|
15
|
+
|
|
16
|
+
## 1. 架构(客户端也要分层)
|
|
17
|
+
|
|
18
|
+
- 用 **MVVM / MVI** 等单向数据流架构:View(声明式 UI) ↔ ViewModel/State(状态+逻辑) ↔ Repository(数据访问) ↔ 领域/网络/本地存储。
|
|
19
|
+
- UI 与业务逻辑分离;ViewModel 不持有 UI 引用、可测试。
|
|
20
|
+
- 数据访问统一 Repository:网络(API)、本地(DB/缓存)在此封装,UI 不直接调网络。
|
|
21
|
+
- 依赖注入装配;按 feature 模块组织。
|
|
22
|
+
- 声明式 UI(SwiftUI / Jetpack Compose / Flutter / RN)优先,注意避免不必要重组/重建。
|
|
23
|
+
|
|
24
|
+
## 2. 平台设计规范(UI/交互按平台,别用 web 范式)
|
|
25
|
+
|
|
26
|
+
- **iOS**:遵循 **Human Interface Guidelines (HIG)**——原生导航(NavigationStack)、SF Symbols 图标、原生手势、安全区(notch/灵动岛)、动效自然。
|
|
27
|
+
- **Android**:遵循 **Material Design 3**——Material 组件、返回手势、自适应布局、动态取色(Material You)。
|
|
28
|
+
- 尊重各平台导航范式(iOS 顶部返回 + tab;Android 系统返回);不要把一端的导航硬搬另一端。
|
|
29
|
+
- 适配多屏尺寸、刘海/挖孔、深色模式、字体缩放(动态字体/无障碍)、横竖屏。
|
|
30
|
+
|
|
31
|
+
## 3. 生命周期与状态
|
|
32
|
+
|
|
33
|
+
- 正确处理 App/页面生命周期(前后台切换、被系统回收恢复、配置变更如旋转)。
|
|
34
|
+
- 状态保存与恢复:进程被杀后能恢复关键状态。
|
|
35
|
+
- 后台限制:遵守平台后台执行规则,长任务用平台机制(WorkManager/BGTaskScheduler)。
|
|
36
|
+
|
|
37
|
+
## 4. 网络、离线与弱网
|
|
38
|
+
|
|
39
|
+
- 统一网络层 + 超时/重试;处理弱网/无网,给明确反馈而非卡死。
|
|
40
|
+
- **离线优先**(适用场景):本地缓存/数据库(SQLite/Room/CoreData/Realm),离线可读,联网同步;冲突有解决策略。
|
|
41
|
+
- 列表分页 + 下拉刷新 + 上拉加载;图片懒加载 + 缓存 + 占位。
|
|
42
|
+
- 乐观更新提升体感,失败回滚。
|
|
43
|
+
|
|
44
|
+
## 5. 性能
|
|
45
|
+
|
|
46
|
+
- 列表用平台高效列表(LazyColumn/List/FlatList/ListView.builder)+ 回收复用,不一次渲染全部。
|
|
47
|
+
- 图片:合适尺寸/格式、缓存、避免主线程解码大图。
|
|
48
|
+
- 主线程不做重计算/IO(避免掉帧/ANR);耗时放后台线程/协程/isolate。
|
|
49
|
+
- 控制重组/重渲染(Compose 稳定性、SwiftUI 最小化 body、RN memo/FlatList 优化)。
|
|
50
|
+
- 启动速度、包体积(按需加载、资源压缩、Android App Bundle)。
|
|
51
|
+
|
|
52
|
+
## 6. 原生能力与权限
|
|
53
|
+
|
|
54
|
+
- 权限**按需申请 + 说明用途**(相机/定位/通知/相册),尊重拒绝,提供降级。
|
|
55
|
+
- 推送:iOS APNs / Android FCM / 鸿蒙 Push;处理 token、点击跳转、前后台展示。
|
|
56
|
+
- 安全存储敏感数据用 Keychain(iOS)/Keystore+EncryptedSharedPrefs(Android),**不用明文 SharedPreferences/UserDefaults 存 token**。
|
|
57
|
+
- 深链接(Universal Links/App Links)、分享、支付(IAP/三方)按平台规范。
|
|
58
|
+
|
|
59
|
+
## 7. 发布与合规
|
|
60
|
+
|
|
61
|
+
- 商店审核:iOS App Store / Google Play / 华为应用市场各有规范(隐私清单、权限说明、内容合规)。
|
|
62
|
+
- 版本/热更新:遵守平台政策(iOS 禁止下发可执行代码);崩溃监控(Crashlytics/Sentry)。
|
|
63
|
+
- 隐私合规:隐私政策、数据收集声明(App Privacy)、个保法/GDPR。
|
|
64
|
+
|
|
65
|
+
## 8. 反模式(出现即不合格)
|
|
66
|
+
|
|
67
|
+
- 用 web 的 UI/交互范式套移动端;忽略 HIG/Material。
|
|
68
|
+
- UI 直接调网络、无 Repository/分层;ViewModel 持有 View。
|
|
69
|
+
- 不处理生命周期/进程回收/弱网;列表一次渲染全部。
|
|
70
|
+
- 主线程做重 IO/计算导致卡顿/ANR。
|
|
71
|
+
- token 明文存 UserDefaults/SharedPreferences;权限一次性全要不说明。
|
|
72
|
+
- 不做崩溃监控、不适配深色/多尺寸/动态字体。
|
|
73
|
+
|
|
74
|
+
## 9. 最低交付 checklist
|
|
75
|
+
|
|
76
|
+
- [ ] MVVM/MVI 分层 + Repository 数据访问 + 声明式 UI + feature 模块。
|
|
77
|
+
- [ ] 遵循 iOS HIG / Android Material;导航按平台;适配多屏/深色/动态字体/安全区。
|
|
78
|
+
- [ ] 正确生命周期 + 状态保存恢复 + 后台规则。
|
|
79
|
+
- [ ] 统一网络层 + 弱网/离线处理 + 列表分页/缓存 + 乐观更新。
|
|
80
|
+
- [ ] 列表复用 + 图片优化 + 主线程不阻塞 + 控制重组 + 包体优化。
|
|
81
|
+
- [ ] 权限按需+说明、敏感数据安全存储、推送、深链、IAP 按规范。
|
|
82
|
+
- [ ] 商店合规 + 崩溃监控 + 隐私声明。
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
**参考**:Apple HIG、Material Design 3、SwiftUI/Jetpack Compose、Flutter/React Native 最佳实践、离线优先、移动安全存储。
|