ai-playbook 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -0
- package/agents/README.md +168 -0
- package/agents/SKILL.md +633 -0
- package/agents/architect/AGENT.md +44 -0
- package/agents/architect/README.md +5 -0
- package/agents/coder/AGENT.md +43 -0
- package/agents/coder/README.md +5 -0
- package/agents/debugger/AGENT.md +42 -0
- package/agents/debugger/README.md +6 -0
- package/agents/devops/AGENT.md +43 -0
- package/agents/devops/README.md +5 -0
- package/agents/documentation/AGENT.md +45 -0
- package/agents/documentation/README.md +5 -0
- package/agents/examples.md +550 -0
- package/agents/performance/AGENT.md +45 -0
- package/agents/performance/README.md +6 -0
- package/agents/planner/AGENT.md +44 -0
- package/agents/planner/README.md +6 -0
- package/agents/product-owner/AGENT.md +46 -0
- package/agents/product-owner/README.md +6 -0
- package/agents/refactorer/AGENT.md +44 -0
- package/agents/refactorer/README.md +6 -0
- package/agents/release-manager/AGENT.md +45 -0
- package/agents/release-manager/README.md +6 -0
- package/agents/researcher/AGENT.md +44 -0
- package/agents/researcher/README.md +6 -0
- package/agents/reviewer/AGENT.md +43 -0
- package/agents/reviewer/README.md +6 -0
- package/agents/security/AGENT.md +46 -0
- package/agents/security/README.md +6 -0
- package/agents/support/AGENT.md +45 -0
- package/agents/support/README.md +6 -0
- package/agents/tester/AGENT.md +46 -0
- package/agents/tester/README.md +5 -0
- package/bin/cli.js +186 -0
- package/commands/README.md +266 -0
- package/commands/build.md +135 -0
- package/commands/clean.md +126 -0
- package/commands/deploy-prod.md +171 -0
- package/commands/deploy-staging.md +147 -0
- package/commands/deps.md +169 -0
- package/commands/dev.md +132 -0
- package/commands/format.md +142 -0
- package/commands/lint.md +125 -0
- package/commands/migrate.md +159 -0
- package/commands/release.md +183 -0
- package/commands/rollback.md +152 -0
- package/commands/seed.md +178 -0
- package/commands/setup.md +109 -0
- package/commands/test.md +134 -0
- package/commands/validate.md +147 -0
- package/context/README.md +7 -0
- package/context/aem.md +47 -0
- package/context/architecture.md +51 -0
- package/context/bullminder.md +57 -0
- package/context/coding-style.md +42 -0
- package/context/communication.md +53 -0
- package/context/company.md +46 -0
- package/context/engineering.md +63 -0
- package/context/project-template.md +71 -0
- package/context/trading.md +52 -0
- package/hooks/README.md +326 -0
- package/hooks/code-review/README.md +6 -0
- package/hooks/code-review/check-coverage.md +101 -0
- package/hooks/custom/README.md +6 -0
- package/hooks/custom/project-specific-hooks.md +273 -0
- package/hooks/deployment/README.md +6 -0
- package/hooks/deployment/health-check.md +102 -0
- package/hooks/deployment/pre-deploy-check.md +84 -0
- package/hooks/documentation/README.md +6 -0
- package/hooks/documentation/update-changelog.md +146 -0
- package/hooks/post-task/README.md +5 -0
- package/hooks/post-task/run-tests.md +61 -0
- package/hooks/pre-commit/README.md +6 -0
- package/hooks/pre-commit/format.md +63 -0
- package/hooks/pre-commit/lint.md +62 -0
- package/hooks/pre-commit/type-check.md +78 -0
- package/hooks/pre-task/README.md +6 -0
- package/hooks/pre-task/check-branch.md +48 -0
- package/hooks/pre-task/validate-environment.md +48 -0
- package/hooks/security-check/README.md +6 -0
- package/hooks/security-check/dependency-audit.md +85 -0
- package/hooks/security-check/secrets-scan.md +77 -0
- package/hooks/test-before-finish/README.md +6 -0
- package/hooks/test-before-finish/run-all-tests.md +128 -0
- package/index.js +69 -0
- package/knowledge/README.md +33 -0
- package/knowledge/ai-agents.md +74 -0
- package/knowledge/decision-making.md +73 -0
- package/knowledge/documentation.md +67 -0
- package/knowledge/engineering-principles.md +65 -0
- package/knowledge/product-discovery.md +68 -0
- package/knowledge/security-privacy.md +54 -0
- package/knowledge/testing-quality.md +63 -0
- package/package.json +63 -0
- package/patterns/README.md +7 -0
- package/prompts/README.md +208 -0
- package/prompts/architect/README.md +96 -0
- package/prompts/architect/design-system.md +140 -0
- package/prompts/debugger/README.md +96 -0
- package/prompts/debugger/diagnose-issue.md +141 -0
- package/prompts/developer/README.md +129 -0
- package/prompts/developer/fix-bug.md +136 -0
- package/prompts/developer/implement-feature.md +133 -0
- package/prompts/product-owner/README.md +116 -0
- package/prompts/product-owner/define-feature.md +145 -0
- package/prompts/reviewer/README.md +91 -0
- package/prompts/reviewer/code-review.md +129 -0
- package/prompts/support/README.md +154 -0
- package/prompts/support/resolve-issue.md +124 -0
- package/roles/README.md +6 -0
- package/roles/design-architect/README.md +98 -0
- package/roles/design-architect/accessibility/README.md +33 -0
- package/roles/design-architect/accessibility/checklists.md +29 -0
- package/roles/design-architect/accessibility/examples.md +35 -0
- package/roles/design-architect/checklists.md +76 -0
- package/roles/design-architect/component-library/README.md +35 -0
- package/roles/design-architect/component-library/checklists.md +29 -0
- package/roles/design-architect/component-library/examples.md +35 -0
- package/roles/design-architect/design-system/README.md +35 -0
- package/roles/design-architect/design-system/checklists.md +27 -0
- package/roles/design-architect/design-system/examples.md +41 -0
- package/roles/design-architect/examples/README.md +31 -0
- package/roles/design-architect/examples/checklists.md +26 -0
- package/roles/design-architect/examples/examples.md +46 -0
- package/roles/design-architect/examples.md +90 -0
- package/roles/design-architect/figma/README.md +33 -0
- package/roles/design-architect/figma/checklists.md +27 -0
- package/roles/design-architect/figma/examples.md +38 -0
- package/roles/design-architect/responsibilities.md +73 -0
- package/roles/design-architect/responsive/README.md +34 -0
- package/roles/design-architect/responsive/checklists.md +26 -0
- package/roles/design-architect/responsive/examples.md +39 -0
- package/roles/design-architect/role.md +129 -0
- package/roles/design-architect/skill-map.md +42 -0
- package/roles/design-architect/triggers.md +110 -0
- package/roles/design-architect/ui/README.md +36 -0
- package/roles/design-architect/ui/checklists.md +29 -0
- package/roles/design-architect/ui/examples.md +28 -0
- package/roles/design-architect/usability/README.md +34 -0
- package/roles/design-architect/usability/checklists.md +28 -0
- package/roles/design-architect/usability/examples.md +31 -0
- package/roles/design-architect/ux/README.md +36 -0
- package/roles/design-architect/ux/checklists.md +28 -0
- package/roles/design-architect/ux/examples.md +37 -0
- package/roles/design-architect/wireframes/README.md +34 -0
- package/roles/design-architect/wireframes/checklists.md +25 -0
- package/roles/design-architect/wireframes/examples.md +32 -0
- package/roles/design-architect/workflow.md +80 -0
- package/roles/devops/README.md +101 -0
- package/roles/devops/ansible/README.md +6 -0
- package/roles/devops/checklists.md +413 -0
- package/roles/devops/ci-cd/README.md +169 -0
- package/roles/devops/ci-cd/checklists.md +289 -0
- package/roles/devops/ci-cd/examples.md +429 -0
- package/roles/devops/cloud-platforms/README.md +109 -0
- package/roles/devops/cost-optimization/README.md +131 -0
- package/roles/devops/disaster-recovery/README.md +118 -0
- package/roles/devops/docker/README.md +6 -0
- package/roles/devops/examples/README.md +6 -0
- package/roles/devops/examples.md +775 -0
- package/roles/devops/github-actions/README.md +6 -0
- package/roles/devops/helm/README.md +6 -0
- package/roles/devops/infrastructure-as-code/README.md +160 -0
- package/roles/devops/infrastructure-as-code/checklists.md +124 -0
- package/roles/devops/jenkins/README.md +6 -0
- package/roles/devops/kubernetes/README.md +150 -0
- package/roles/devops/kubernetes/checklists.md +192 -0
- package/roles/devops/kubernetes/examples.md +189 -0
- package/roles/devops/monitoring/README.md +93 -0
- package/roles/devops/networking/README.md +83 -0
- package/roles/devops/performance/README.md +104 -0
- package/roles/devops/responsibilities.md +95 -0
- package/roles/devops/role.md +130 -0
- package/roles/devops/security/README.md +126 -0
- package/roles/devops/skill-map.md +162 -0
- package/roles/devops/terraform/README.md +6 -0
- package/roles/devops/triggers.md +241 -0
- package/roles/devops/workflow.md +197 -0
- package/roles/qa/README.md +16 -0
- package/roles/qa/api-testing/README.md +6 -0
- package/roles/qa/automation/README.md +6 -0
- package/roles/qa/checklists.md +24 -0
- package/roles/qa/examples/README.md +6 -0
- package/roles/qa/examples.md +27 -0
- package/roles/qa/performance/README.md +6 -0
- package/roles/qa/playwright/README.md +6 -0
- package/roles/qa/responsibilities.md +16 -0
- package/roles/qa/role.md +47 -0
- package/roles/qa/selenium/README.md +6 -0
- package/roles/qa/skill-map.md +14 -0
- package/roles/qa/triggers.md +10 -0
- package/roles/qa/workflow.md +9 -0
- package/roles/software-architect/README.md +16 -0
- package/roles/software-architect/agents/README.md +6 -0
- package/roles/software-architect/ai-architecture/README.md +6 -0
- package/roles/software-architect/aws/README.md +6 -0
- package/roles/software-architect/azure/README.md +6 -0
- package/roles/software-architect/caching/README.md +6 -0
- package/roles/software-architect/checklists.md +25 -0
- package/roles/software-architect/cloud/README.md +6 -0
- package/roles/software-architect/database-design/README.md +6 -0
- package/roles/software-architect/diagrams/README.md +6 -0
- package/roles/software-architect/distributed-systems/README.md +7 -0
- package/roles/software-architect/docker/README.md +6 -0
- package/roles/software-architect/event-driven/README.md +7 -0
- package/roles/software-architect/examples/README.md +6 -0
- package/roles/software-architect/examples.md +22 -0
- package/roles/software-architect/gcp/README.md +6 -0
- package/roles/software-architect/kubernetes/README.md +6 -0
- package/roles/software-architect/messaging/README.md +6 -0
- package/roles/software-architect/rag/README.md +7 -0
- package/roles/software-architect/responsibilities.md +17 -0
- package/roles/software-architect/role.md +46 -0
- package/roles/software-architect/scalability/README.md +6 -0
- package/roles/software-architect/security/README.md +6 -0
- package/roles/software-architect/skill-map.md +15 -0
- package/roles/software-architect/system-design/README.md +6 -0
- package/roles/software-architect/triggers.md +10 -0
- package/roles/software-architect/vector-db/README.md +6 -0
- package/roles/software-architect/workflow.md +9 -0
- package/roles/software-developer/README.md +116 -0
- package/roles/software-developer/api/README.md +365 -0
- package/roles/software-developer/api/checklist.md +131 -0
- package/roles/software-developer/api/examples.md +459 -0
- package/roles/software-developer/authentication/README.md +26 -0
- package/roles/software-developer/authentication/checklists.md +22 -0
- package/roles/software-developer/authentication/examples.md +32 -0
- package/roles/software-developer/authorization/README.md +26 -0
- package/roles/software-developer/authorization/checklists.md +21 -0
- package/roles/software-developer/authorization/examples.md +27 -0
- package/roles/software-developer/backend/README.md +26 -0
- package/roles/software-developer/backend/checklists.md +21 -0
- package/roles/software-developer/backend/examples.md +21 -0
- package/roles/software-developer/cache/README.md +25 -0
- package/roles/software-developer/cache/checklists.md +21 -0
- package/roles/software-developer/cache/examples.md +22 -0
- package/roles/software-developer/checklists.md +122 -0
- package/roles/software-developer/code-review/README.md +23 -0
- package/roles/software-developer/code-review/checklists.md +22 -0
- package/roles/software-developer/code-review/examples.md +20 -0
- package/roles/software-developer/database/README.md +27 -0
- package/roles/software-developer/database/checklists.md +21 -0
- package/roles/software-developer/database/examples.md +27 -0
- package/roles/software-developer/debugging/README.md +24 -0
- package/roles/software-developer/debugging/checklists.md +20 -0
- package/roles/software-developer/debugging/examples.md +28 -0
- package/roles/software-developer/examples/README.md +22 -0
- package/roles/software-developer/examples/checklists.md +8 -0
- package/roles/software-developer/examples/examples.md +25 -0
- package/roles/software-developer/examples.md +378 -0
- package/roles/software-developer/frontend/README.md +76 -0
- package/roles/software-developer/frontend/accessibility/README.md +136 -0
- package/roles/software-developer/frontend/accessibility/best-practices.md +368 -0
- package/roles/software-developer/frontend/code-quality/README.md +136 -0
- package/roles/software-developer/frontend/code-quality/best-practices.md +309 -0
- package/roles/software-developer/frontend/components/README.md +65 -0
- package/roles/software-developer/frontend/components/best-practices.md +273 -0
- package/roles/software-developer/frontend/debugging/README.md +149 -0
- package/roles/software-developer/frontend/debugging/best-practices.md +329 -0
- package/roles/software-developer/frontend/examples/README.md +19 -0
- package/roles/software-developer/frontend/examples/checklists.md +8 -0
- package/roles/software-developer/frontend/examples/examples.md +17 -0
- package/roles/software-developer/frontend/logging-observability/README.md +196 -0
- package/roles/software-developer/frontend/logging-observability/best-practices.md +430 -0
- package/roles/software-developer/frontend/performance/README.md +99 -0
- package/roles/software-developer/frontend/performance/best-practices.md +350 -0
- package/roles/software-developer/frontend/state-management/README.md +85 -0
- package/roles/software-developer/frontend/state-management/best-practices.md +344 -0
- package/roles/software-developer/frontend/testing/README.md +114 -0
- package/roles/software-developer/frontend/testing/best-practices.md +272 -0
- package/roles/software-developer/fullstack/README.md +25 -0
- package/roles/software-developer/fullstack/checklists.md +19 -0
- package/roles/software-developer/fullstack/examples.md +14 -0
- package/roles/software-developer/graphql/README.md +24 -0
- package/roles/software-developer/graphql/checklists.md +20 -0
- package/roles/software-developer/graphql/examples.md +24 -0
- package/roles/software-developer/integration-tests/README.md +25 -0
- package/roles/software-developer/integration-tests/checklists.md +20 -0
- package/roles/software-developer/integration-tests/examples.md +18 -0
- package/roles/software-developer/java/README.md +24 -0
- package/roles/software-developer/java/checklists.md +16 -0
- package/roles/software-developer/java/examples.md +22 -0
- package/roles/software-developer/javascript/README.md +24 -0
- package/roles/software-developer/javascript/checklists.md +15 -0
- package/roles/software-developer/javascript/examples.md +18 -0
- package/roles/software-developer/logging/README.md +105 -0
- package/roles/software-developer/logging/checklists.md +48 -0
- package/roles/software-developer/logging/examples.md +135 -0
- package/roles/software-developer/messaging/README.md +24 -0
- package/roles/software-developer/messaging/checklists.md +21 -0
- package/roles/software-developer/messaging/examples.md +26 -0
- package/roles/software-developer/microservices/README.md +25 -0
- package/roles/software-developer/microservices/checklists.md +21 -0
- package/roles/software-developer/microservices/examples.md +21 -0
- package/roles/software-developer/node/README.md +25 -0
- package/roles/software-developer/node/checklists.md +15 -0
- package/roles/software-developer/node/examples.md +15 -0
- package/roles/software-developer/nosql/README.md +24 -0
- package/roles/software-developer/nosql/checklists.md +21 -0
- package/roles/software-developer/nosql/examples.md +20 -0
- package/roles/software-developer/observability/README.md +25 -0
- package/roles/software-developer/observability/checklists.md +21 -0
- package/roles/software-developer/observability/examples.md +22 -0
- package/roles/software-developer/performance/README.md +26 -0
- package/roles/software-developer/performance/checklists.md +20 -0
- package/roles/software-developer/performance/examples.md +20 -0
- package/roles/software-developer/python/README.md +25 -0
- package/roles/software-developer/python/checklists.md +15 -0
- package/roles/software-developer/python/examples.md +17 -0
- package/roles/software-developer/react/README.md +24 -0
- package/roles/software-developer/react/checklists.md +15 -0
- package/roles/software-developer/react/examples.md +22 -0
- package/roles/software-developer/refactoring/README.md +23 -0
- package/roles/software-developer/refactoring/checklists.md +21 -0
- package/roles/software-developer/refactoring/examples.md +11 -0
- package/roles/software-developer/responsibilities.md +58 -0
- package/roles/software-developer/role.md +127 -0
- package/roles/software-developer/skill-map.md +88 -0
- package/roles/software-developer/springboot/README.md +25 -0
- package/roles/software-developer/springboot/checklists.md +15 -0
- package/roles/software-developer/springboot/examples.md +21 -0
- package/roles/software-developer/sql/README.md +24 -0
- package/roles/software-developer/sql/checklists.md +22 -0
- package/roles/software-developer/sql/examples.md +20 -0
- package/roles/software-developer/testing/README.md +25 -0
- package/roles/software-developer/testing/checklists.md +21 -0
- package/roles/software-developer/testing/examples.md +19 -0
- package/roles/software-developer/triggers.md +550 -0
- package/roles/software-developer/typescript/README.md +25 -0
- package/roles/software-developer/typescript/checklists.md +15 -0
- package/roles/software-developer/typescript/examples.md +18 -0
- package/roles/software-developer/unit-tests/README.md +24 -0
- package/roles/software-developer/unit-tests/checklists.md +19 -0
- package/roles/software-developer/unit-tests/examples.md +22 -0
- package/roles/software-developer/workflow.md +196 -0
- package/roles/sre/README.md +16 -0
- package/roles/sre/alerts/README.md +6 -0
- package/roles/sre/availability/README.md +6 -0
- package/roles/sre/chaos/README.md +6 -0
- package/roles/sre/checklists.md +24 -0
- package/roles/sre/examples/README.md +6 -0
- package/roles/sre/examples.md +19 -0
- package/roles/sre/observability/README.md +6 -0
- package/roles/sre/reliability/README.md +6 -0
- package/roles/sre/responsibilities.md +16 -0
- package/roles/sre/role.md +46 -0
- package/roles/sre/skill-map.md +14 -0
- package/roles/sre/slos/README.md +6 -0
- package/roles/sre/triggers.md +10 -0
- package/roles/sre/workflow.md +9 -0
- package/roles/support-engineer/README.md +16 -0
- package/roles/support-engineer/checklists.md +24 -0
- package/roles/support-engineer/datadog/README.md +6 -0
- package/roles/support-engineer/examples/README.md +6 -0
- package/roles/support-engineer/examples.md +17 -0
- package/roles/support-engineer/incident-response/README.md +6 -0
- package/roles/support-engineer/kubernetes/README.md +6 -0
- package/roles/support-engineer/linux/README.md +6 -0
- package/roles/support-engineer/logs/README.md +6 -0
- package/roles/support-engineer/monitoring/README.md +6 -0
- package/roles/support-engineer/networking/README.md +6 -0
- package/roles/support-engineer/newrelic/README.md +6 -0
- package/roles/support-engineer/postmortem/README.md +6 -0
- package/roles/support-engineer/production/README.md +6 -0
- package/roles/support-engineer/responsibilities.md +16 -0
- package/roles/support-engineer/role.md +47 -0
- package/roles/support-engineer/root-cause-analysis/README.md +6 -0
- package/roles/support-engineer/runbooks/README.md +6 -0
- package/roles/support-engineer/skill-map.md +14 -0
- package/roles/support-engineer/splunk/README.md +6 -0
- package/roles/support-engineer/triggers.md +10 -0
- package/roles/support-engineer/troubleshooting/README.md +6 -0
- package/roles/support-engineer/workflow.md +9 -0
- package/setup.sh +204 -0
- package/skills/.claude/README.md +7 -0
- package/skills/README.md +21 -0
- package/skills/ai-agents/README.md +207 -0
- package/skills/ai-agents/examples.md +335 -0
- package/skills/ai-agents/skill.md +392 -0
- package/skills/architecture/README.md +198 -0
- package/skills/architecture/examples.md +316 -0
- package/skills/architecture/skill.md +189 -0
- package/skills/design-architecture/README.md +107 -0
- package/skills/design-architecture/examples.md +84 -0
- package/skills/design-architecture/skill.md +192 -0
- package/skills/devops/README.md +177 -0
- package/skills/devops/examples.md +376 -0
- package/skills/devops/skill.md +210 -0
- package/skills/documentation/README.md +182 -0
- package/skills/documentation/examples.md +364 -0
- package/skills/documentation/skill.md +200 -0
- package/skills/performance/README.md +177 -0
- package/skills/performance/examples.md +376 -0
- package/skills/performance/skill.md +199 -0
- package/skills/qa/README.md +106 -0
- package/skills/qa/examples.md +84 -0
- package/skills/qa/skill.md +384 -0
- package/skills/security/README.md +108 -0
- package/skills/security/examples.md +85 -0
- package/skills/security/skill.md +223 -0
- package/skills/software-development/README.md +239 -0
- package/skills/software-development/assessment.md +0 -0
- package/skills/software-development/checklists.md +0 -0
- package/skills/software-development/examples.md +375 -0
- package/skills/software-development/prompts.md +0 -0
- package/skills/software-development/skill.md +390 -0
- package/skills/software-development/templates/README.md +7 -0
- package/skills/software-development/templates/api-development.md +0 -0
- package/skills/software-development/templates/bug-fix.md +0 -0
- package/skills/software-development/templates/code-review.md +0 -0
- package/skills/software-development/templates/feature-implementation.md +0 -0
- package/skills/software-development/templates/llm-integration.md +0 -0
- package/skills/software-development/templates/performance-review.md +0 -0
- package/skills/software-development/templates/security-review.md +0 -0
- package/skills/software-development/templates/test-generation.md +0 -0
- package/skills/software-development/tools.md +0 -0
- package/skills/software-development/workflows.md +0 -0
- package/skills/sre/README.md +107 -0
- package/skills/sre/examples.md +379 -0
- package/skills/sre/skill.md +256 -0
- package/skills/support-engineering/README.md +107 -0
- package/skills/support-engineering/examples.md +85 -0
- package/skills/support-engineering/skill.md +103 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# rollback Command
|
|
2
|
+
|
|
3
|
+
**Purpose:** Rollback to previous version in case of deployment issues
|
|
4
|
+
**Usage:** `npm run rollback` or `FORCE=true npm run rollback`
|
|
5
|
+
**Trigger:** EMERGENCY - Production is broken
|
|
6
|
+
|
|
7
|
+
## CRITICAL SITUATION
|
|
8
|
+
|
|
9
|
+
🚨 Use this only when:
|
|
10
|
+
- Production is broken
|
|
11
|
+
- Cannot fix immediately
|
|
12
|
+
- Users are impacted
|
|
13
|
+
- Rollback is safer than fix
|
|
14
|
+
|
|
15
|
+
## What Rollback Does
|
|
16
|
+
|
|
17
|
+
1. Finds previous version
|
|
18
|
+
2. Restores application
|
|
19
|
+
3. Restores database (if possible)
|
|
20
|
+
4. Verifies health
|
|
21
|
+
5. Notifies team
|
|
22
|
+
|
|
23
|
+
## Rollback Process
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
1. Determine previous version
|
|
27
|
+
↓
|
|
28
|
+
2. Request confirmation
|
|
29
|
+
↓
|
|
30
|
+
3. Restore application code
|
|
31
|
+
↓
|
|
32
|
+
4. Restore database if possible
|
|
33
|
+
↓
|
|
34
|
+
5. Verify health checks
|
|
35
|
+
↓
|
|
36
|
+
6. Notify team
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Confirmation
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
⚠️ WARNING: This will rollback to the previous version
|
|
43
|
+
Continue? (y/N)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Success Criteria
|
|
47
|
+
|
|
48
|
+
✓ Previous version restored
|
|
49
|
+
✓ Health checks pass
|
|
50
|
+
✓ Service responds
|
|
51
|
+
✓ No data loss
|
|
52
|
+
|
|
53
|
+
## What Gets Rolled Back
|
|
54
|
+
|
|
55
|
+
- ✓ Application code
|
|
56
|
+
- ✓ Static assets
|
|
57
|
+
- ✓ Configuration (in some cases)
|
|
58
|
+
- ✗ Database (if migrations ran)
|
|
59
|
+
|
|
60
|
+
## Database Considerations
|
|
61
|
+
|
|
62
|
+
**If migrations ran:**
|
|
63
|
+
- Automatic rollback: Limited
|
|
64
|
+
- Manual rollback: May be needed
|
|
65
|
+
- Backup restore: May be necessary
|
|
66
|
+
|
|
67
|
+
**Migration rollback:**
|
|
68
|
+
1. Identify problematic migration
|
|
69
|
+
2. Run rollback migration
|
|
70
|
+
3. Restore previous schema
|
|
71
|
+
4. Verify data integrity
|
|
72
|
+
|
|
73
|
+
## Time Impact
|
|
74
|
+
|
|
75
|
+
- Application: 1-5 minutes
|
|
76
|
+
- Database: Depends on size
|
|
77
|
+
- Verification: 2-5 minutes
|
|
78
|
+
- Total: 5-15 minutes typical
|
|
79
|
+
|
|
80
|
+
## After Rollback
|
|
81
|
+
|
|
82
|
+
✓ Service restored
|
|
83
|
+
✓ Users can access
|
|
84
|
+
✓ Team investigates
|
|
85
|
+
✓ Root cause found
|
|
86
|
+
✓ Fix developed
|
|
87
|
+
✓ Redeploy when ready
|
|
88
|
+
|
|
89
|
+
## Post-Rollback Actions
|
|
90
|
+
|
|
91
|
+
1. **Immediately:**
|
|
92
|
+
- Verify service works
|
|
93
|
+
- Check error logs
|
|
94
|
+
- Monitor metrics
|
|
95
|
+
|
|
96
|
+
2. **Within 30 minutes:**
|
|
97
|
+
- Notify stakeholders
|
|
98
|
+
- Begin investigation
|
|
99
|
+
- Create incident report
|
|
100
|
+
|
|
101
|
+
3. **Within 24 hours:**
|
|
102
|
+
- Root cause analysis
|
|
103
|
+
- Fix implementation
|
|
104
|
+
- Staging test
|
|
105
|
+
- Redeploy
|
|
106
|
+
|
|
107
|
+
## Communication
|
|
108
|
+
|
|
109
|
+
- [ ] Team notified
|
|
110
|
+
- [ ] Status page updated
|
|
111
|
+
- [ ] Customers informed
|
|
112
|
+
- [ ] Incident created
|
|
113
|
+
- [ ] Post-mortem scheduled
|
|
114
|
+
|
|
115
|
+
## Related Commands
|
|
116
|
+
|
|
117
|
+
- `deploy-prod` - Production deployment
|
|
118
|
+
- `deploy-staging` - Staging deployment
|
|
119
|
+
- `migrate` - Database migrations
|
|
120
|
+
|
|
121
|
+
## Prevention
|
|
122
|
+
|
|
123
|
+
Prevent rollbacks by:
|
|
124
|
+
- ✓ Thorough testing
|
|
125
|
+
- ✓ Stage before prod
|
|
126
|
+
- ✓ Feature flags
|
|
127
|
+
- ✓ Canary deployments
|
|
128
|
+
- ✓ Health checks
|
|
129
|
+
|
|
130
|
+
## Incident Response
|
|
131
|
+
|
|
132
|
+
After rollback:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
1. Stabilize (Done - rollback)
|
|
136
|
+
2. Communicate (Notify team/users)
|
|
137
|
+
3. Investigate (Root cause)
|
|
138
|
+
4. Fix (Develop solution)
|
|
139
|
+
5. Test (Verify fix)
|
|
140
|
+
6. Deploy (Redeploy fixed version)
|
|
141
|
+
7. Monitor (Watch for issues)
|
|
142
|
+
8. Review (Post-mortem)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Notes
|
|
146
|
+
|
|
147
|
+
- Rollback is last resort
|
|
148
|
+
- Always try hot fix first
|
|
149
|
+
- Document what went wrong
|
|
150
|
+
- Use for learning
|
|
151
|
+
- Improve deployment process
|
|
152
|
+
- Prevention is key
|
package/commands/seed.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# seed Command
|
|
2
|
+
|
|
3
|
+
**Purpose:** Seed database with initial test data
|
|
4
|
+
**Usage:** `npm run seed`
|
|
5
|
+
**Trigger:** Initial setup, reset test data
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
Populates database with test data for development and testing.
|
|
10
|
+
|
|
11
|
+
## Test Data Included
|
|
12
|
+
|
|
13
|
+
- **Users:** Admin, test users
|
|
14
|
+
- **Posts:** Sample posts
|
|
15
|
+
- **Comments:** Sample comments
|
|
16
|
+
- **Products:** Test products
|
|
17
|
+
- **Orders:** Test orders
|
|
18
|
+
|
|
19
|
+
## When to Seed
|
|
20
|
+
|
|
21
|
+
- **Initial setup:** Fresh database
|
|
22
|
+
- **Testing:** Reset to known state
|
|
23
|
+
- **Demo:** Show features
|
|
24
|
+
- **Development:** Populate for testing
|
|
25
|
+
|
|
26
|
+
## Seeding Process
|
|
27
|
+
|
|
28
|
+
1. Check database exists
|
|
29
|
+
2. Run migrations first
|
|
30
|
+
3. Populate tables
|
|
31
|
+
4. Create relationships
|
|
32
|
+
5. Verify data created
|
|
33
|
+
|
|
34
|
+
## Success Criteria
|
|
35
|
+
|
|
36
|
+
✓ Data inserted
|
|
37
|
+
✓ No errors
|
|
38
|
+
✓ Relationships valid
|
|
39
|
+
✓ Ready to test
|
|
40
|
+
|
|
41
|
+
## Running Seed
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Seed database
|
|
45
|
+
npm run seed
|
|
46
|
+
|
|
47
|
+
# Force reset
|
|
48
|
+
FORCE=true npm run seed
|
|
49
|
+
|
|
50
|
+
# Interactive (asks for confirmation)
|
|
51
|
+
npm run seed
|
|
52
|
+
|
|
53
|
+
# With specific data set
|
|
54
|
+
npm run seed -- --dataset=demo
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Test User Credentials
|
|
58
|
+
|
|
59
|
+
After seeding, login with:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Email: test@example.com
|
|
63
|
+
Password: testpassword123
|
|
64
|
+
|
|
65
|
+
Admin Email: admin@example.com
|
|
66
|
+
Password: adminpassword123
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Data Models
|
|
70
|
+
|
|
71
|
+
| Model | Count | Sample |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| Users | 5 | John, Jane, Admin... |
|
|
74
|
+
| Posts | 20 | "Hello World", "Test"... |
|
|
75
|
+
| Comments | 50 | Sample comments |
|
|
76
|
+
| Products | 10 | Product A, B, C... |
|
|
77
|
+
|
|
78
|
+
## Seeding Methods
|
|
79
|
+
|
|
80
|
+
### Prisma
|
|
81
|
+
```bash
|
|
82
|
+
npx prisma db seed
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Django
|
|
86
|
+
```bash
|
|
87
|
+
python manage.py loaddata fixtures/*.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### SQL
|
|
91
|
+
```bash
|
|
92
|
+
psql -f sql/seeds/data.sql
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Seed Files
|
|
96
|
+
|
|
97
|
+
Located in:
|
|
98
|
+
- `prisma/seed.ts` - Prisma seed
|
|
99
|
+
- `scripts/seed.py` - Python seed
|
|
100
|
+
- `sql/seeds/` - SQL seed files
|
|
101
|
+
- `fixtures/` - Django fixtures
|
|
102
|
+
|
|
103
|
+
## Reset Data
|
|
104
|
+
|
|
105
|
+
To clear and reseed:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Clear all data
|
|
109
|
+
npm run db:reset
|
|
110
|
+
|
|
111
|
+
# Or manually
|
|
112
|
+
npm run migrate rollback
|
|
113
|
+
npm run migrate
|
|
114
|
+
npm run seed
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Development vs Testing
|
|
118
|
+
|
|
119
|
+
**Development seed:**
|
|
120
|
+
- More variety
|
|
121
|
+
- Realistic data
|
|
122
|
+
- Multiple users
|
|
123
|
+
- Complex relationships
|
|
124
|
+
|
|
125
|
+
**Testing seed:**
|
|
126
|
+
- Minimal data
|
|
127
|
+
- Known values
|
|
128
|
+
- Predictable state
|
|
129
|
+
- Fast to run
|
|
130
|
+
|
|
131
|
+
## Verification
|
|
132
|
+
|
|
133
|
+
After seeding, verify:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Count records
|
|
137
|
+
SELECT COUNT(*) FROM users;
|
|
138
|
+
|
|
139
|
+
# Check data
|
|
140
|
+
SELECT * FROM users LIMIT 5;
|
|
141
|
+
|
|
142
|
+
# Verify relationships
|
|
143
|
+
SELECT * FROM posts WHERE user_id = 1;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Clearing Seed Data
|
|
147
|
+
|
|
148
|
+
To remove test data:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Delete all data (dangerous!)
|
|
152
|
+
npm run db:clear
|
|
153
|
+
|
|
154
|
+
# Or reset to migrations only
|
|
155
|
+
npm run db:reset
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Related Commands
|
|
159
|
+
|
|
160
|
+
- `setup` - Initial environment
|
|
161
|
+
- `migrate` - Database schema
|
|
162
|
+
- `dev` - Start with seeded data
|
|
163
|
+
- `test` - Tests with clean data
|
|
164
|
+
|
|
165
|
+
## Environment Variables
|
|
166
|
+
|
|
167
|
+
- `SEED_DATA=demo` - Use demo seed
|
|
168
|
+
- `SEED_DATA=test` - Use test seed
|
|
169
|
+
- `FORCE=true` - Skip confirmation
|
|
170
|
+
|
|
171
|
+
## Notes
|
|
172
|
+
|
|
173
|
+
- Seeding is idempotent (safe to repeat)
|
|
174
|
+
- Test data is not production data
|
|
175
|
+
- Use realistic values for testing
|
|
176
|
+
- Update seeds when schema changes
|
|
177
|
+
- Keep seeds small for fast startup
|
|
178
|
+
- Use transactions for consistency
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# setup Command
|
|
2
|
+
|
|
3
|
+
**Purpose:** Initialize development environment with all dependencies and configuration
|
|
4
|
+
**Usage:** `npm run setup` or manual script invocation
|
|
5
|
+
**Trigger:** First-time setup, environment reset
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
Prepares development environment for work by installing dependencies, configuring files, and initializing database.
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. Check prerequisites (git, node, npm)
|
|
14
|
+
2. Install npm dependencies
|
|
15
|
+
3. Install Python dependencies (if applicable)
|
|
16
|
+
4. Create `.env` from template
|
|
17
|
+
5. Run database migrations
|
|
18
|
+
6. Seed database with test data
|
|
19
|
+
7. Build project
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
- Node.js 18+
|
|
24
|
+
- npm or yarn
|
|
25
|
+
- Git
|
|
26
|
+
- Python 3.8+ (if applicable)
|
|
27
|
+
- PostgreSQL/MySQL (if applicable)
|
|
28
|
+
|
|
29
|
+
## Success Criteria
|
|
30
|
+
|
|
31
|
+
✓ Dependencies installed
|
|
32
|
+
✓ `.env` file created
|
|
33
|
+
✓ Database migrations run
|
|
34
|
+
✓ Database seeded
|
|
35
|
+
✓ Project builds
|
|
36
|
+
|
|
37
|
+
## What Gets Installed
|
|
38
|
+
|
|
39
|
+
- npm packages from `package.json`
|
|
40
|
+
- Python packages from `requirements.txt`
|
|
41
|
+
- Development tools
|
|
42
|
+
- Git hooks
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
After setup:
|
|
47
|
+
1. Edit `.env` with your configuration
|
|
48
|
+
2. Update database credentials
|
|
49
|
+
3. Configure API keys
|
|
50
|
+
4. Verify health check passes
|
|
51
|
+
|
|
52
|
+
## Environment Variables
|
|
53
|
+
|
|
54
|
+
No special variables needed. Uses defaults from `.env.example`.
|
|
55
|
+
|
|
56
|
+
## Failure Handling
|
|
57
|
+
|
|
58
|
+
| Issue | Solution |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Missing Node.js | Install from nodejs.org |
|
|
61
|
+
| npm errors | Delete node_modules, reinstall |
|
|
62
|
+
| DB connection fails | Check credentials in .env |
|
|
63
|
+
| Migration fails | Check database exists |
|
|
64
|
+
|
|
65
|
+
## Typical Output
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
✓ Prerequisites found
|
|
69
|
+
✓ npm dependencies installed
|
|
70
|
+
✓ Created .env from template
|
|
71
|
+
✓ Database migrated
|
|
72
|
+
✓ Database seeded
|
|
73
|
+
✓ Project built
|
|
74
|
+
✓ Setup complete!
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Next Steps
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Start development server
|
|
81
|
+
npm run dev
|
|
82
|
+
|
|
83
|
+
# Run tests
|
|
84
|
+
npm test
|
|
85
|
+
|
|
86
|
+
# Check code quality
|
|
87
|
+
npm run lint
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Troubleshooting
|
|
91
|
+
|
|
92
|
+
- **Port already in use**: Change port in .env
|
|
93
|
+
- **Database locked**: Kill other connections
|
|
94
|
+
- **Module not found**: Run npm install again
|
|
95
|
+
- **Permission denied**: Check file permissions
|
|
96
|
+
|
|
97
|
+
## Related Commands
|
|
98
|
+
|
|
99
|
+
- `dev` - Start development server
|
|
100
|
+
- `test` - Run tests
|
|
101
|
+
- `migrate` - Run migrations
|
|
102
|
+
- `seed` - Seed database
|
|
103
|
+
|
|
104
|
+
## Notes
|
|
105
|
+
|
|
106
|
+
- Safe to run multiple times
|
|
107
|
+
- Idempotent (won't duplicate data)
|
|
108
|
+
- Takes 2-5 minutes typically
|
|
109
|
+
- Internet required for npm install
|
package/commands/test.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# test Command
|
|
2
|
+
|
|
3
|
+
**Purpose:** Run all tests with coverage reporting
|
|
4
|
+
**Usage:** `npm test`
|
|
5
|
+
**Trigger:** Validate code changes work
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
Runs complete test suite including unit tests, integration tests, and generates coverage reports.
|
|
10
|
+
|
|
11
|
+
## Test Types
|
|
12
|
+
|
|
13
|
+
| Type | Scope | Blocking |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| Unit tests | Individual functions | Yes |
|
|
16
|
+
| Integration tests | Component interactions | Yes |
|
|
17
|
+
| Coverage report | Test coverage % | Yes |
|
|
18
|
+
|
|
19
|
+
## What Gets Tested
|
|
20
|
+
|
|
21
|
+
- Business logic
|
|
22
|
+
- API endpoints
|
|
23
|
+
- Database operations
|
|
24
|
+
- Error handling
|
|
25
|
+
- Edge cases
|
|
26
|
+
- User workflows
|
|
27
|
+
|
|
28
|
+
## Success Criteria
|
|
29
|
+
|
|
30
|
+
✓ All unit tests pass
|
|
31
|
+
✓ All integration tests pass
|
|
32
|
+
✓ Coverage >= 80%
|
|
33
|
+
✓ No regressions
|
|
34
|
+
|
|
35
|
+
## Running Tests
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# All tests
|
|
39
|
+
npm test
|
|
40
|
+
|
|
41
|
+
# Specific test file
|
|
42
|
+
npm test -- auth.test.js
|
|
43
|
+
|
|
44
|
+
# Watch mode
|
|
45
|
+
npm test -- --watch
|
|
46
|
+
|
|
47
|
+
# With coverage
|
|
48
|
+
npm test -- --coverage
|
|
49
|
+
|
|
50
|
+
# Verbose output
|
|
51
|
+
npm test -- --verbose
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Test Runners
|
|
55
|
+
|
|
56
|
+
| Language | Runner | Command |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| JavaScript | Jest | npm test |
|
|
59
|
+
| Python | pytest | pytest |
|
|
60
|
+
| Go | go test | go test ./... |
|
|
61
|
+
|
|
62
|
+
## Coverage Report
|
|
63
|
+
|
|
64
|
+
- Located in `coverage/`
|
|
65
|
+
- HTML report: `coverage/lcov-report/index.html`
|
|
66
|
+
- Summary: Printed in console
|
|
67
|
+
- Threshold: 80% default
|
|
68
|
+
|
|
69
|
+
## Failure Handling
|
|
70
|
+
|
|
71
|
+
| Scenario | Behavior |
|
|
72
|
+
|---|---|
|
|
73
|
+
| Test fails | Shows error, fails command |
|
|
74
|
+
| Coverage low | Fails if below 80% |
|
|
75
|
+
| Timeout | Test fails after 5s |
|
|
76
|
+
| Module error | Shows import error |
|
|
77
|
+
|
|
78
|
+
## Environment Variables
|
|
79
|
+
|
|
80
|
+
- `CI=true` - Strict mode
|
|
81
|
+
- `SKIP_TESTS=true` - Skip tests
|
|
82
|
+
- `COVERAGE=true` - Generate coverage
|
|
83
|
+
|
|
84
|
+
## Performance
|
|
85
|
+
|
|
86
|
+
Typical test times:
|
|
87
|
+
- Unit tests: 5-30 seconds
|
|
88
|
+
- Integration: 10-60 seconds
|
|
89
|
+
- Coverage: +5 seconds
|
|
90
|
+
|
|
91
|
+
## Common Issues
|
|
92
|
+
|
|
93
|
+
| Issue | Solution |
|
|
94
|
+
|---|---|
|
|
95
|
+
| Timeout | Increase timeout, optimize test |
|
|
96
|
+
| Flaky test | Add retries, fix timing |
|
|
97
|
+
| Import error | Install dependency |
|
|
98
|
+
| Coverage low | Write more tests |
|
|
99
|
+
|
|
100
|
+
## Test Patterns
|
|
101
|
+
|
|
102
|
+
✓ Test happy path
|
|
103
|
+
✓ Test error cases
|
|
104
|
+
✓ Test edge cases
|
|
105
|
+
✓ Test with mocks
|
|
106
|
+
✓ Test with real data
|
|
107
|
+
|
|
108
|
+
## Debugging Tests
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Run single test
|
|
112
|
+
npm test -- auth.test.js
|
|
113
|
+
|
|
114
|
+
# Run matching pattern
|
|
115
|
+
npm test -- --testNamePattern="auth"
|
|
116
|
+
|
|
117
|
+
# Debug in Chrome
|
|
118
|
+
node --inspect-brk node_modules/.bin/jest --runInBand
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Related Commands
|
|
122
|
+
|
|
123
|
+
- `lint` - Code quality
|
|
124
|
+
- `type-check` - Type validation
|
|
125
|
+
- `validate` - All checks
|
|
126
|
+
- `build` - Production build
|
|
127
|
+
|
|
128
|
+
## Notes
|
|
129
|
+
|
|
130
|
+
- Tests should be fast
|
|
131
|
+
- Keep tests isolated
|
|
132
|
+
- Mock external services
|
|
133
|
+
- Test behavior, not implementation
|
|
134
|
+
- Commit passing tests only
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# validate Command
|
|
2
|
+
|
|
3
|
+
**Purpose:** Run all validation checks (pre-commit, pre-push)
|
|
4
|
+
**Usage:** `npm run validate`
|
|
5
|
+
**Trigger:** Before commit or push
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
Comprehensive validation suite combining linting, testing, type checking, and security checks.
|
|
10
|
+
|
|
11
|
+
## Checks Performed
|
|
12
|
+
|
|
13
|
+
| Check | Tool | Blocking |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| Linting | ESLint | Yes |
|
|
16
|
+
| Testing | Jest/pytest | Yes |
|
|
17
|
+
| Type checking | tsc | Yes |
|
|
18
|
+
| Security | npm audit | Yes |
|
|
19
|
+
| Coverage | Coverage.js | Yes |
|
|
20
|
+
| Build | Webpack/tsc | Yes |
|
|
21
|
+
|
|
22
|
+
## Execution Order
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
1. Lint checks
|
|
26
|
+
↓
|
|
27
|
+
2. Type checks
|
|
28
|
+
↓
|
|
29
|
+
3. Unit tests
|
|
30
|
+
↓
|
|
31
|
+
4. Integration tests
|
|
32
|
+
↓
|
|
33
|
+
5. Security audit
|
|
34
|
+
↓
|
|
35
|
+
6. Build verification
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Success Criteria
|
|
39
|
+
|
|
40
|
+
✓ No lint errors
|
|
41
|
+
✓ No type errors
|
|
42
|
+
✓ All tests pass
|
|
43
|
+
✓ No vulnerabilities
|
|
44
|
+
✓ Coverage >= 80%
|
|
45
|
+
✓ Build succeeds
|
|
46
|
+
|
|
47
|
+
## Running Validation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Full validation
|
|
51
|
+
npm run validate
|
|
52
|
+
|
|
53
|
+
# Skip tests (faster)
|
|
54
|
+
SKIP_TESTS=true npm run validate
|
|
55
|
+
|
|
56
|
+
# Verbose output
|
|
57
|
+
VERBOSE=true npm run validate
|
|
58
|
+
|
|
59
|
+
# Dry-run
|
|
60
|
+
DRY_RUN=true npm run validate
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Typical Output
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Running code quality checks...
|
|
67
|
+
✓ Lint passed
|
|
68
|
+
✓ Type check passed
|
|
69
|
+
|
|
70
|
+
Running tests...
|
|
71
|
+
✓ Tests passed
|
|
72
|
+
|
|
73
|
+
Running security checks...
|
|
74
|
+
✓ No vulnerabilities
|
|
75
|
+
|
|
76
|
+
Verifying build...
|
|
77
|
+
✓ Build successful
|
|
78
|
+
|
|
79
|
+
✓ All validation checks passed!
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Failure Scenarios
|
|
83
|
+
|
|
84
|
+
| Failure | Action |
|
|
85
|
+
|---|---|
|
|
86
|
+
| Lint fails | Fix style issues |
|
|
87
|
+
| Tests fail | Debug and fix |
|
|
88
|
+
| Type errors | Update types |
|
|
89
|
+
| Vulnerabilities | Update packages |
|
|
90
|
+
| Build fails | Check errors |
|
|
91
|
+
|
|
92
|
+
## Environment Variables
|
|
93
|
+
|
|
94
|
+
- `SKIP_TESTS=true` - Skip tests
|
|
95
|
+
- `CI=true` - Strict mode
|
|
96
|
+
- `VERBOSE=true` - Show all output
|
|
97
|
+
- `DRY_RUN=true` - Preview only
|
|
98
|
+
|
|
99
|
+
## Performance
|
|
100
|
+
|
|
101
|
+
Typical time: 30-120 seconds
|
|
102
|
+
- Lint: 2-5s
|
|
103
|
+
- Tests: 10-60s
|
|
104
|
+
- Type check: 1-10s
|
|
105
|
+
- Security: 5-10s
|
|
106
|
+
- Build: 5-30s
|
|
107
|
+
|
|
108
|
+
## Pre-push Checklist
|
|
109
|
+
|
|
110
|
+
✓ Validate passes locally
|
|
111
|
+
✓ All tests green
|
|
112
|
+
✓ No console errors
|
|
113
|
+
✓ Commit message clear
|
|
114
|
+
✓ Branch up to date
|
|
115
|
+
✓ No sensitive data
|
|
116
|
+
|
|
117
|
+
## Failure Recovery
|
|
118
|
+
|
|
119
|
+
If validation fails:
|
|
120
|
+
1. Read error message carefully
|
|
121
|
+
2. Fix the issue
|
|
122
|
+
3. Re-run validate
|
|
123
|
+
4. Repeat until passing
|
|
124
|
+
5. Then commit/push
|
|
125
|
+
|
|
126
|
+
## Related Commands
|
|
127
|
+
|
|
128
|
+
- `test` - Run tests only
|
|
129
|
+
- `lint` - Lint only
|
|
130
|
+
- `type-check` - Type check only
|
|
131
|
+
- `build` - Build verification
|
|
132
|
+
|
|
133
|
+
## CI/CD Integration
|
|
134
|
+
|
|
135
|
+
Validation runs in CI before merge:
|
|
136
|
+
- Blocks merge on failure
|
|
137
|
+
- Reports all issues
|
|
138
|
+
- Prevents bad code
|
|
139
|
+
- Ensures quality
|
|
140
|
+
|
|
141
|
+
## Notes
|
|
142
|
+
|
|
143
|
+
- Run before every push
|
|
144
|
+
- Faster than CI/CD
|
|
145
|
+
- Catch issues early
|
|
146
|
+
- Save time overall
|
|
147
|
+
- Reduces deploy delays
|