@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,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: deployment-and-delivery-standard
|
|
3
|
+
title: 部署与交付规范(商业级必读)
|
|
4
|
+
domain: cicd
|
|
5
|
+
category: 01-standards
|
|
6
|
+
difficulty: intermediate
|
|
7
|
+
tags: [部署, 交付, deployment, ci, cd, dockerfile, 多阶段, 蓝绿, 金丝雀, 回滚, rollback, 零停机, 迁移, 环境, 商业级]
|
|
8
|
+
quality_score: 95
|
|
9
|
+
last_updated: 2026-06-19
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 部署与交付规范(商业级必读)
|
|
13
|
+
|
|
14
|
+
> 能跑通 ≠ 能交付。商业级项目要可重复构建、自动化流水线、零停机部署、一键回滚、环境隔离。这是从"demo"到"上线产品"的关键一段。
|
|
15
|
+
|
|
16
|
+
## 1. 容器化(Dockerfile)
|
|
17
|
+
|
|
18
|
+
- **多阶段构建**:build 阶段装依赖/编译,运行阶段只拷产物 → 镜像小、攻击面小。
|
|
19
|
+
- 基础镜像用**小而固定版本**(`node:20-slim`、`python:3.12-slim`、distroless),不用 `latest`。
|
|
20
|
+
- **非 root 运行**:建专用用户,`USER app`,不用 root。
|
|
21
|
+
- 善用层缓存:先拷依赖清单装依赖,再拷源码(改代码不重装依赖)。
|
|
22
|
+
- `.dockerignore` 排除 node_modules/.git/test 等;不把密钥/`.env` 打进镜像。
|
|
23
|
+
- 声明 `HEALTHCHECK`、`EXPOSE`、合理的启动命令(前台进程、正确处理信号)。
|
|
24
|
+
|
|
25
|
+
## 2. CI 流水线(每次 PR/push 自动)
|
|
26
|
+
|
|
27
|
+
标准顺序,任一步失败即**阻断合并**:
|
|
28
|
+
```
|
|
29
|
+
checkout → 装依赖(带缓存) → lint/format 检查 → 类型检查 → 单元+集成测试 →
|
|
30
|
+
构建 → 安全扫描(依赖审计/SAST/镜像扫描) → 质量门 → 产出制品
|
|
31
|
+
```
|
|
32
|
+
- 测试与质量门失败必须红、阻断;不允许"重跑就过"的 flaky 长期存在。
|
|
33
|
+
- 依赖漏洞扫描(npm audit / pip-audit / cargo audit / trivy)纳入流水线。
|
|
34
|
+
- 制品/镜像打**不可变版本标签**(git sha / 语义版本),不用 `latest` 部署。
|
|
35
|
+
|
|
36
|
+
## 3. CD 部署策略(零停机)
|
|
37
|
+
|
|
38
|
+
- **滚动更新 Rolling**:逐批替换,配合就绪探针,默认零停机。
|
|
39
|
+
- **蓝绿 Blue-Green**:新版整套起好、切流量、有问题秒切回——回滚最快。
|
|
40
|
+
- **金丝雀 Canary**:先放小比例流量验证指标,再逐步放量。
|
|
41
|
+
- 部署期间新旧版本可能并存 → 接口与数据库必须**向后兼容**(见 §4)。
|
|
42
|
+
- 所有部署经流水线,**禁止手动 ssh 改生产**。
|
|
43
|
+
|
|
44
|
+
## 4. 数据库迁移与零停机
|
|
45
|
+
|
|
46
|
+
- 迁移作为部署的一步,**自动执行**且幂等、可回滚。
|
|
47
|
+
- 破坏性 schema 变更走 **expand-contract**(加列→双写→回填→切读→删旧),分多次发布,避免与并存的旧版本不兼容。
|
|
48
|
+
- 大表 DDL 用在线方式、回填分批,别锁表停服。
|
|
49
|
+
|
|
50
|
+
## 5. 环境与配置/密钥
|
|
51
|
+
|
|
52
|
+
- 至少 dev / staging / prod 三套环境,**同一份代码 + 不同配置**(12-Factor)。
|
|
53
|
+
- 配置/密钥按环境注入(env / 密钥管理 / CI secrets),**绝不进仓库、不进镜像、不进日志**。
|
|
54
|
+
- staging 尽量贴近 prod;上 prod 前在 staging 验证。
|
|
55
|
+
|
|
56
|
+
## 6. 回滚与发布安全
|
|
57
|
+
|
|
58
|
+
- **一键回滚**:保留上一个可用版本,出问题能快速切回(蓝绿/旧镜像重部署)。
|
|
59
|
+
- 发布后盯关键指标(错误率、p99、支付成功率);异常自动/手动回滚。
|
|
60
|
+
- 高风险变更用 feature flag 灰度,可不发版即关闭。
|
|
61
|
+
- 重要发布避开高峰;有发布记录与可观测。
|
|
62
|
+
|
|
63
|
+
## 7. 健康检查与运行时
|
|
64
|
+
|
|
65
|
+
- liveness / readiness 探针;readiness 未就绪不接流量。
|
|
66
|
+
- 优雅停机:SIGTERM 后停接新请求、处理完在途、释放资源再退出。
|
|
67
|
+
- 资源 requests/limits 合理;崩溃自动重启;日志到 stdout 由平台收集。
|
|
68
|
+
|
|
69
|
+
## 8. 交付物完备(商业项目应随附)
|
|
70
|
+
|
|
71
|
+
- `Dockerfile`(多阶段、非root) + `docker-compose`(本地一键起 app+db) 或 k8s 清单。
|
|
72
|
+
- CI 配置(lint+test+scan+构建+质量门)。
|
|
73
|
+
- 数据库迁移脚本。
|
|
74
|
+
- `.env.example`(列全变量、占位值)。
|
|
75
|
+
- README:本地启动、环境变量、部署步骤、回滚方式。
|
|
76
|
+
|
|
77
|
+
## 9. 反模式(出现即不合格)
|
|
78
|
+
|
|
79
|
+
- 单阶段大镜像、root 运行、用 `latest` 部署。
|
|
80
|
+
- 手动 ssh 改生产、无流水线、无版本制品。
|
|
81
|
+
- 部署停服(无滚动/蓝绿);破坏性迁移直接上导致旧版本崩。
|
|
82
|
+
- 密钥进镜像/仓库/日志;prod 与 dev 同配置。
|
|
83
|
+
- 无回滚方案;发布后不看指标。
|
|
84
|
+
|
|
85
|
+
## 10. 最低交付 checklist
|
|
86
|
+
|
|
87
|
+
- [ ] 多阶段、固定版本、非 root 的 Dockerfile + .dockerignore + HEALTHCHECK。
|
|
88
|
+
- [ ] CI:lint+类型+单元+集成+安全扫描+质量门,失败阻断合并;制品打不可变版本。
|
|
89
|
+
- [ ] CD:滚动/蓝绿/金丝雀之一,零停机;禁止手改生产。
|
|
90
|
+
- [ ] 迁移自动化、幂等、expand-contract、向后兼容、不锁表停服。
|
|
91
|
+
- [ ] dev/staging/prod 环境隔离,配置/密钥按环境注入不入仓库。
|
|
92
|
+
- [ ] 一键回滚 + 发布后指标监控;健康探针 + 优雅停机。
|
|
93
|
+
- [ ] 随附 Dockerfile/compose、CI、迁移、.env.example、部署 README。
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
**参考**:12-Factor App、Docker 多阶段构建最佳实践、蓝绿/金丝雀部署、Expand-Contract 迁移、Google SRE 发布工程。
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: github-actions-complete
|
|
3
|
+
title: GitHub Actions 完整指南
|
|
4
|
+
domain: cicd
|
|
5
|
+
category: 01-standards
|
|
6
|
+
difficulty: intermediate
|
|
7
|
+
tags: [actions, agent, changes, checklist, cicd, complete, github, 安全最佳实践]
|
|
8
|
+
quality_score: 70
|
|
9
|
+
last_updated: 2026-06-15
|
|
10
|
+
---
|
|
11
|
+
# GitHub Actions 完整指南
|
|
12
|
+
|
|
13
|
+
## 概述
|
|
14
|
+
|
|
15
|
+
GitHub Actions 是 GitHub 原生的 CI/CD 平台,允许直接在仓库中定义自动化工作流。通过 YAML 文件配置,支持构建、测试、部署、发布等全生命周期自动化。
|
|
16
|
+
|
|
17
|
+
### 核心优势
|
|
18
|
+
|
|
19
|
+
- **原生集成**: 与 GitHub 深度集成,无需额外工具
|
|
20
|
+
- **丰富市场**: 16000+ 社区 Actions 可复用
|
|
21
|
+
- **矩阵构建**: 并行测试多个环境/版本
|
|
22
|
+
- **自托管 Runner**: 支持自定义执行环境
|
|
23
|
+
- **免费额度**: 公开仓库免费,私有仓库 2000 分钟/月
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 核心概念
|
|
28
|
+
|
|
29
|
+
### Workflow 结构
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
# .github/workflows/ci.yml
|
|
33
|
+
name: CI Pipeline # 工作流名称
|
|
34
|
+
|
|
35
|
+
on: # 触发条件
|
|
36
|
+
push:
|
|
37
|
+
branches: [main, develop]
|
|
38
|
+
pull_request:
|
|
39
|
+
branches: [main]
|
|
40
|
+
schedule:
|
|
41
|
+
- cron: '0 2 * * 1' # 每周一凌晨2点
|
|
42
|
+
workflow_dispatch: # 手动触发
|
|
43
|
+
inputs:
|
|
44
|
+
environment:
|
|
45
|
+
description: 'Deploy environment'
|
|
46
|
+
required: true
|
|
47
|
+
default: 'staging'
|
|
48
|
+
type: choice
|
|
49
|
+
options: [staging, production]
|
|
50
|
+
|
|
51
|
+
env: # 全局环境变量
|
|
52
|
+
NODE_VERSION: '20'
|
|
53
|
+
PYTHON_VERSION: '3.11'
|
|
54
|
+
|
|
55
|
+
jobs: # 作业定义
|
|
56
|
+
lint:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
- name: Run linter
|
|
61
|
+
run: npm run lint
|
|
62
|
+
|
|
63
|
+
test:
|
|
64
|
+
needs: lint # 依赖 lint 完成
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
strategy:
|
|
67
|
+
matrix:
|
|
68
|
+
node: [18, 20, 22] # 矩阵测试
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
- uses: actions/setup-node@v4
|
|
72
|
+
with:
|
|
73
|
+
node-version: ${{ matrix.node }}
|
|
74
|
+
- run: npm ci
|
|
75
|
+
- run: npm test
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 触发事件详解
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
on:
|
|
82
|
+
# Push 事件
|
|
83
|
+
push:
|
|
84
|
+
branches: [main, 'release/**']
|
|
85
|
+
tags: ['v*']
|
|
86
|
+
paths:
|
|
87
|
+
- 'src/**'
|
|
88
|
+
- '!src/**/*.test.ts' # 排除测试文件
|
|
89
|
+
|
|
90
|
+
# PR 事件
|
|
91
|
+
pull_request:
|
|
92
|
+
types: [opened, synchronize, reopened]
|
|
93
|
+
branches: [main]
|
|
94
|
+
|
|
95
|
+
# 定时任务
|
|
96
|
+
schedule:
|
|
97
|
+
- cron: '30 5 * * 1-5' # 工作日 5:30 UTC
|
|
98
|
+
|
|
99
|
+
# 其他仓库事件
|
|
100
|
+
issues:
|
|
101
|
+
types: [opened, labeled]
|
|
102
|
+
release:
|
|
103
|
+
types: [published]
|
|
104
|
+
workflow_run:
|
|
105
|
+
workflows: ["Build"]
|
|
106
|
+
types: [completed]
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 实战模板
|
|
112
|
+
|
|
113
|
+
### 1. Python CI/CD
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
name: Python CI/CD
|
|
117
|
+
|
|
118
|
+
on:
|
|
119
|
+
push:
|
|
120
|
+
branches: [main]
|
|
121
|
+
pull_request:
|
|
122
|
+
branches: [main]
|
|
123
|
+
|
|
124
|
+
jobs:
|
|
125
|
+
test:
|
|
126
|
+
runs-on: ubuntu-latest
|
|
127
|
+
strategy:
|
|
128
|
+
matrix:
|
|
129
|
+
python-version: ['3.10', '3.11', '3.12']
|
|
130
|
+
|
|
131
|
+
services:
|
|
132
|
+
postgres:
|
|
133
|
+
image: postgres:16
|
|
134
|
+
env:
|
|
135
|
+
POSTGRES_PASSWORD: test
|
|
136
|
+
POSTGRES_DB: testdb
|
|
137
|
+
ports: ['5432:5432']
|
|
138
|
+
options: >-
|
|
139
|
+
--health-cmd pg_isready
|
|
140
|
+
--health-interval 10s
|
|
141
|
+
--health-timeout 5s
|
|
142
|
+
--health-retries 5
|
|
143
|
+
|
|
144
|
+
redis:
|
|
145
|
+
image: redis:7
|
|
146
|
+
ports: ['6379:6379']
|
|
147
|
+
|
|
148
|
+
steps:
|
|
149
|
+
- uses: actions/checkout@v4
|
|
150
|
+
|
|
151
|
+
- name: Set up Python
|
|
152
|
+
uses: actions/setup-python@v5
|
|
153
|
+
with:
|
|
154
|
+
python-version: ${{ matrix.python-version }}
|
|
155
|
+
cache: 'pip'
|
|
156
|
+
|
|
157
|
+
- name: Install dependencies
|
|
158
|
+
run: |
|
|
159
|
+
python -m pip install --upgrade pip
|
|
160
|
+
pip install -e ".[dev]"
|
|
161
|
+
|
|
162
|
+
- name: Lint
|
|
163
|
+
run: |
|
|
164
|
+
ruff check .
|
|
165
|
+
black --check .
|
|
166
|
+
mypy src/
|
|
167
|
+
|
|
168
|
+
- name: Test
|
|
169
|
+
env:
|
|
170
|
+
DATABASE_URL: postgresql://postgres:test@localhost:5432/testdb
|
|
171
|
+
REDIS_URL: redis://localhost:6379
|
|
172
|
+
run: |
|
|
173
|
+
pytest --cov=src --cov-report=xml -v
|
|
174
|
+
|
|
175
|
+
- name: Upload coverage
|
|
176
|
+
if: matrix.python-version == '3.11'
|
|
177
|
+
uses: codecov/codecov-action@v4
|
|
178
|
+
with:
|
|
179
|
+
file: coverage.xml
|
|
180
|
+
|
|
181
|
+
deploy:
|
|
182
|
+
needs: test
|
|
183
|
+
if: github.ref == 'refs/heads/main'
|
|
184
|
+
runs-on: ubuntu-latest
|
|
185
|
+
environment: production
|
|
186
|
+
|
|
187
|
+
steps:
|
|
188
|
+
- uses: actions/checkout@v4
|
|
189
|
+
|
|
190
|
+
- name: Deploy
|
|
191
|
+
env:
|
|
192
|
+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
|
|
193
|
+
run: |
|
|
194
|
+
echo "Deploying to production..."
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### 2. Node.js + Docker 构建
|
|
198
|
+
|
|
199
|
+
```yaml
|
|
200
|
+
name: Build & Push Docker
|
|
201
|
+
|
|
202
|
+
on:
|
|
203
|
+
push:
|
|
204
|
+
tags: ['v*']
|
|
205
|
+
|
|
206
|
+
jobs:
|
|
207
|
+
build:
|
|
208
|
+
runs-on: ubuntu-latest
|
|
209
|
+
permissions:
|
|
210
|
+
contents: read
|
|
211
|
+
packages: write
|
|
212
|
+
|
|
213
|
+
steps:
|
|
214
|
+
- uses: actions/checkout@v4
|
|
215
|
+
|
|
216
|
+
- name: Set up Docker Buildx
|
|
217
|
+
uses: docker/setup-buildx-action@v3
|
|
218
|
+
|
|
219
|
+
- name: Login to GHCR
|
|
220
|
+
uses: docker/login-action@v3
|
|
221
|
+
with:
|
|
222
|
+
registry: ghcr.io
|
|
223
|
+
username: ${{ github.actor }}
|
|
224
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
225
|
+
|
|
226
|
+
- name: Extract metadata
|
|
227
|
+
id: meta
|
|
228
|
+
uses: docker/metadata-action@v5
|
|
229
|
+
with:
|
|
230
|
+
images: ghcr.io/${{ github.repository }}
|
|
231
|
+
tags: |
|
|
232
|
+
type=semver,pattern={{version}}
|
|
233
|
+
type=semver,pattern={{major}}.{{minor}}
|
|
234
|
+
type=sha
|
|
235
|
+
|
|
236
|
+
- name: Build and push
|
|
237
|
+
uses: docker/build-push-action@v5
|
|
238
|
+
with:
|
|
239
|
+
context: .
|
|
240
|
+
push: true
|
|
241
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
242
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
243
|
+
cache-from: type=gha
|
|
244
|
+
cache-to: type=gha,mode=max
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### 3. 矩阵构建 + 跨平台
|
|
248
|
+
|
|
249
|
+
```yaml
|
|
250
|
+
name: Cross-Platform Build
|
|
251
|
+
|
|
252
|
+
on: [push, pull_request]
|
|
253
|
+
|
|
254
|
+
jobs:
|
|
255
|
+
build:
|
|
256
|
+
strategy:
|
|
257
|
+
fail-fast: false
|
|
258
|
+
matrix:
|
|
259
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
260
|
+
node: [18, 20]
|
|
261
|
+
include:
|
|
262
|
+
- os: ubuntu-latest
|
|
263
|
+
node: 20
|
|
264
|
+
coverage: true
|
|
265
|
+
exclude:
|
|
266
|
+
- os: windows-latest
|
|
267
|
+
node: 18
|
|
268
|
+
|
|
269
|
+
runs-on: ${{ matrix.os }}
|
|
270
|
+
|
|
271
|
+
steps:
|
|
272
|
+
- uses: actions/checkout@v4
|
|
273
|
+
- uses: actions/setup-node@v4
|
|
274
|
+
with:
|
|
275
|
+
node-version: ${{ matrix.node }}
|
|
276
|
+
- run: npm ci
|
|
277
|
+
- run: npm test
|
|
278
|
+
- name: Coverage
|
|
279
|
+
if: matrix.coverage
|
|
280
|
+
run: npm run test:coverage
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 4. 自动化发布
|
|
284
|
+
|
|
285
|
+
```yaml
|
|
286
|
+
name: Release
|
|
287
|
+
|
|
288
|
+
on:
|
|
289
|
+
push:
|
|
290
|
+
tags: ['v*']
|
|
291
|
+
|
|
292
|
+
permissions:
|
|
293
|
+
contents: write
|
|
294
|
+
|
|
295
|
+
jobs:
|
|
296
|
+
release:
|
|
297
|
+
runs-on: ubuntu-latest
|
|
298
|
+
steps:
|
|
299
|
+
- uses: actions/checkout@v4
|
|
300
|
+
with:
|
|
301
|
+
fetch-depth: 0
|
|
302
|
+
|
|
303
|
+
- name: Generate changelog
|
|
304
|
+
id: changelog
|
|
305
|
+
run: |
|
|
306
|
+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
307
|
+
if [ -n "$PREV_TAG" ]; then
|
|
308
|
+
CHANGELOG=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
|
|
309
|
+
else
|
|
310
|
+
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges -20)
|
|
311
|
+
fi
|
|
312
|
+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
|
313
|
+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
|
314
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
315
|
+
|
|
316
|
+
- name: Create Release
|
|
317
|
+
uses: softprops/action-gh-release@v2
|
|
318
|
+
with:
|
|
319
|
+
body: |
|
|
320
|
+
## Changes
|
|
321
|
+
${{ steps.changelog.outputs.changelog }}
|
|
322
|
+
draft: false
|
|
323
|
+
prerelease: ${{ contains(github.ref, '-rc') }}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 高级技巧
|
|
329
|
+
|
|
330
|
+
### Secrets 管理
|
|
331
|
+
|
|
332
|
+
```yaml
|
|
333
|
+
# 在 Settings → Secrets and variables → Actions 中设置
|
|
334
|
+
env:
|
|
335
|
+
API_KEY: ${{ secrets.API_KEY }}
|
|
336
|
+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
337
|
+
|
|
338
|
+
# 环境级 Secrets (需要审批)
|
|
339
|
+
jobs:
|
|
340
|
+
deploy:
|
|
341
|
+
environment:
|
|
342
|
+
name: production
|
|
343
|
+
url: https://myapp.com
|
|
344
|
+
steps:
|
|
345
|
+
- run: echo "Using ${{ secrets.PROD_API_KEY }}"
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### 缓存优化
|
|
349
|
+
|
|
350
|
+
```yaml
|
|
351
|
+
# pip 缓存
|
|
352
|
+
- uses: actions/setup-python@v5
|
|
353
|
+
with:
|
|
354
|
+
python-version: '3.11'
|
|
355
|
+
cache: 'pip'
|
|
356
|
+
|
|
357
|
+
# npm 缓存
|
|
358
|
+
- uses: actions/setup-node@v4
|
|
359
|
+
with:
|
|
360
|
+
node-version: '20'
|
|
361
|
+
cache: 'npm'
|
|
362
|
+
|
|
363
|
+
# 自定义缓存
|
|
364
|
+
- uses: actions/cache@v4
|
|
365
|
+
with:
|
|
366
|
+
path: |
|
|
367
|
+
~/.cargo/registry
|
|
368
|
+
~/.cargo/git
|
|
369
|
+
target/
|
|
370
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
371
|
+
restore-keys: |
|
|
372
|
+
${{ runner.os }}-cargo-
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### 可复用工作流
|
|
376
|
+
|
|
377
|
+
```yaml
|
|
378
|
+
# .github/workflows/reusable-test.yml
|
|
379
|
+
name: Reusable Test
|
|
380
|
+
on:
|
|
381
|
+
workflow_call:
|
|
382
|
+
inputs:
|
|
383
|
+
python-version:
|
|
384
|
+
required: true
|
|
385
|
+
type: string
|
|
386
|
+
secrets:
|
|
387
|
+
codecov-token:
|
|
388
|
+
required: false
|
|
389
|
+
|
|
390
|
+
jobs:
|
|
391
|
+
test:
|
|
392
|
+
runs-on: ubuntu-latest
|
|
393
|
+
steps:
|
|
394
|
+
- uses: actions/checkout@v4
|
|
395
|
+
- uses: actions/setup-python@v5
|
|
396
|
+
with:
|
|
397
|
+
python-version: ${{ inputs.python-version }}
|
|
398
|
+
- run: pytest
|
|
399
|
+
|
|
400
|
+
# 调用方
|
|
401
|
+
# .github/workflows/ci.yml
|
|
402
|
+
jobs:
|
|
403
|
+
test:
|
|
404
|
+
uses: ./.github/workflows/reusable-test.yml
|
|
405
|
+
with:
|
|
406
|
+
python-version: '3.11'
|
|
407
|
+
secrets:
|
|
408
|
+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### 条件执行
|
|
412
|
+
|
|
413
|
+
```yaml
|
|
414
|
+
steps:
|
|
415
|
+
# 只在 main 分支执行
|
|
416
|
+
- if: github.ref == 'refs/heads/main'
|
|
417
|
+
run: echo "On main branch"
|
|
418
|
+
|
|
419
|
+
# 只在 PR 中执行
|
|
420
|
+
- if: github.event_name == 'pull_request'
|
|
421
|
+
run: echo "In PR"
|
|
422
|
+
|
|
423
|
+
# 前一步成功才执行
|
|
424
|
+
- if: success()
|
|
425
|
+
run: echo "Previous step succeeded"
|
|
426
|
+
|
|
427
|
+
# 前一步失败时执行
|
|
428
|
+
- if: failure()
|
|
429
|
+
run: echo "Previous step failed"
|
|
430
|
+
|
|
431
|
+
# 总是执行 (清理)
|
|
432
|
+
- if: always()
|
|
433
|
+
run: echo "Always runs"
|
|
434
|
+
|
|
435
|
+
# 包含特定标签
|
|
436
|
+
- if: contains(github.event.pull_request.labels.*.name, 'deploy')
|
|
437
|
+
run: echo "Has deploy label"
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## 安全最佳实践
|
|
443
|
+
|
|
444
|
+
1. **✅ 最小权限**: 使用 `permissions` 限制 GITHUB_TOKEN 权限
|
|
445
|
+
2. **✅ 固定版本**: 使用 `actions/checkout@v4` 而非 `@main`
|
|
446
|
+
3. **✅ 审查第三方 Actions**: 检查源码,使用 SHA 固定版本
|
|
447
|
+
4. **✅ 保护 Secrets**: 不在日志中打印,使用环境级 Secrets
|
|
448
|
+
5. **✅ 保护分支**: 要求 PR 审查和状态检查通过
|
|
449
|
+
6. **❌ 不要**: 在 PR 中运行不受信任的代码(`pull_request_target`风险)
|
|
450
|
+
7. **❌ 不要**: 硬编码密钥在工作流文件中
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## Agent Checklist
|
|
455
|
+
|
|
456
|
+
Agent 在配置 CI/CD 时必须检查:
|
|
457
|
+
|
|
458
|
+
- [ ] 工作流是否覆盖 lint/test/build/deploy 全流程?
|
|
459
|
+
- [ ] 是否使用矩阵测试覆盖多版本?
|
|
460
|
+
- [ ] Secrets 是否通过 GitHub Secrets 管理(非硬编码)?
|
|
461
|
+
- [ ] 是否配置缓存优化构建速度?
|
|
462
|
+
- [ ] Docker 构建是否使用多阶段构建和缓存?
|
|
463
|
+
- [ ] 生产部署是否需要环境审批?
|
|
464
|
+
- [ ] 是否有自动化发布流程(tag触发)?
|
|
465
|
+
- [ ] Actions 版本是否固定(SHA或major版本)?
|
|
466
|
+
- [ ] 工作流权限是否遵循最小权限原则?
|
|
467
|
+
- [ ] 是否有失败通知机制?
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
**文档版本**: v1.0
|
|
472
|
+
**最后更新**: 2026-03-28
|
|
473
|
+
**质量评分**: 90/100
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: release-and-store-submission
|
|
3
|
+
title: 发布与上架审核标准(多端 · 商业级)
|
|
4
|
+
domain: cicd
|
|
5
|
+
category: 01-standards
|
|
6
|
+
difficulty: intermediate
|
|
7
|
+
tags: [发布, 上架, 审核, app-store, google-play, 华为, 微信小程序, 公证, 隐私, 合规, 提审, 发布, 商业级]
|
|
8
|
+
quality_score: 92
|
|
9
|
+
last_updated: 2026-06-19
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 发布与上架审核标准(多端 · 商业级)
|
|
13
|
+
|
|
14
|
+
> "做完"不等于"能上架"。各平台审核严格,缺隐私声明、权限说明、资质就被拒。本标准给出各端上架前的硬性 checklist,避免反复被拒。
|
|
15
|
+
|
|
16
|
+
## 1. 通用(所有端)
|
|
17
|
+
|
|
18
|
+
- **隐私政策 + 用户协议** 可访问;明确收集了什么数据、用途、第三方 SDK。
|
|
19
|
+
- 权限**按需 + 说明用途**;删除未使用的权限/SDK(多余权限是被拒常见原因)。
|
|
20
|
+
- 内容合规(无违规/侵权/敏感内容);版本号/构建号规范;崩溃率达标。
|
|
21
|
+
- 各环境配置正确(生产 API、密钥、关闭调试日志)。
|
|
22
|
+
|
|
23
|
+
## 2. iOS / App Store
|
|
24
|
+
|
|
25
|
+
- **App Privacy(隐私营养标签)** 如实填写数据收集;如有跟踪需 **ATT (App Tracking Transparency)** 弹窗。
|
|
26
|
+
- 权限在 `Info.plist` 配 **用途说明文案(Usage Description)**,缺了直接崩/拒。
|
|
27
|
+
- 不下发可执行代码/不绕过审核;用 IAP 卖数字内容(不能用三方支付绕苹果分成)。
|
|
28
|
+
- 截图/预览/描述合规;测试账号给审核;支持最新系统与机型;适配深色/动态字体。
|
|
29
|
+
- 证书/描述文件/签名正确;构建用正式证书。
|
|
30
|
+
|
|
31
|
+
## 3. Android / Google Play & 华为应用市场
|
|
32
|
+
|
|
33
|
+
- **数据安全表单(Data Safety)** 如实填;目标 API level 满足最新要求;64 位支持。
|
|
34
|
+
- 权限敏感(定位/短信/通讯录等)需说明与合理性;前台服务/精确闹钟等受限权限需符合政策。
|
|
35
|
+
- 用 **App Bundle (.aab)** 上传;签名(Play App Signing);混淆/资源压缩。
|
|
36
|
+
- 华为应用市场:额外资质(类目)、隐私、HMS(如用推送)适配;鸿蒙单独提审。
|
|
37
|
+
|
|
38
|
+
## 4. 微信小程序 / 各小程序
|
|
39
|
+
|
|
40
|
+
- 类目**资质**齐全(如电商/医疗/金融需对应资质);服务器域名 **HTTPS + 白名单**配置。
|
|
41
|
+
- 隐私协议 + 用户授权弹窗合规;遵守诱导分享/虚拟支付等运营规范。
|
|
42
|
+
- 体验评分(性能/可用性)达标;提审填写完整、测试账号、功能页路径。
|
|
43
|
+
- 包大小符合限制(主包/分包)。
|
|
44
|
+
|
|
45
|
+
## 5. 桌面应用
|
|
46
|
+
|
|
47
|
+
- **代码签名**:Windows 代码签名证书;**macOS 签名 + 公证(notarization)** + Gatekeeper 通过(不签名用户装不上/报毒)。
|
|
48
|
+
- Linux 多发行版打包(AppImage/Flatpak/deb/rpm)。
|
|
49
|
+
- 自动更新签名校验;安装包来源可信(HTTPS)。
|
|
50
|
+
|
|
51
|
+
## 6. Web
|
|
52
|
+
|
|
53
|
+
- 生产构建(压缩/Tree-shaking/source map 处理);环境变量/密钥正确不泄漏。
|
|
54
|
+
- HTTPS + 安全头(CSP/HSTS);SEO 基础(sitemap/robots/meta);监控与告警接好。
|
|
55
|
+
- 回滚预案;灰度/蓝绿;健康检查。
|
|
56
|
+
|
|
57
|
+
## 7. 反模式(出现即不合格)
|
|
58
|
+
|
|
59
|
+
- 缺隐私政策/权限说明/数据安全表单 → 必被拒。
|
|
60
|
+
- iOS 缺 Usage Description(崩溃)/用三方支付卖数字内容/有跟踪不弹 ATT。
|
|
61
|
+
- Android 不用 aab/目标 API 过低/敏感权限无理由。
|
|
62
|
+
- 小程序无资质/域名未配白名单/诱导分享。
|
|
63
|
+
- 桌面不签名不公证;生产泄漏密钥/开调试。
|
|
64
|
+
|
|
65
|
+
## 8. 最低交付 checklist(提审前)
|
|
66
|
+
|
|
67
|
+
- [ ] 通用:隐私政策+协议、权限按需+说明、删多余权限/SDK、内容合规、生产配置正确。
|
|
68
|
+
- [ ] iOS:App Privacy + ATT(如需) + Info.plist 用途说明 + IAP + 截图/测试账号 + 正式签名。
|
|
69
|
+
- [ ] Android:Data Safety + 目标 API + aab 签名 + 敏感权限说明;华为/鸿蒙单独资质提审。
|
|
70
|
+
- [ ] 小程序:类目资质 + 域名白名单 + 隐私授权合规 + 体验达标 + 包大小。
|
|
71
|
+
- [ ] 桌面:Win 签名 + macOS 签名公证 + 多发行版打包 + 更新签名校验。
|
|
72
|
+
- [ ] Web:生产构建 + 安全头 + SEO + 监控告警 + 回滚/灰度 + 健康检查。
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
**参考(官方)**:App Store Review Guidelines、Google Play 政策、华为应用市场审核、微信小程序审核规范、macOS 公证、Google Search Central。
|