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
package/bin/cli.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { execSync } from 'child_process';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
const playbookDir = path.join(__dirname, '..');
|
|
11
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE;
|
|
12
|
+
|
|
13
|
+
const colors = {
|
|
14
|
+
reset: '\x1b[0m',
|
|
15
|
+
green: '\x1b[32m',
|
|
16
|
+
yellow: '\x1b[33m',
|
|
17
|
+
blue: '\x1b[34m',
|
|
18
|
+
cyan: '\x1b[36m',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function log(message, color = 'reset') {
|
|
22
|
+
console.log(`${colors[color]}${message}${colors.reset}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getFolderSize(dir) {
|
|
26
|
+
try {
|
|
27
|
+
const result = execSync(`du -sh "${dir}" 2>/dev/null | cut -f1`, { encoding: 'utf-8' });
|
|
28
|
+
return result.trim();
|
|
29
|
+
} catch {
|
|
30
|
+
return 'N/A';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function countFiles(dir, extension = null) {
|
|
35
|
+
try {
|
|
36
|
+
let cmd = `find "${dir}" -type f`;
|
|
37
|
+
if (extension) {
|
|
38
|
+
cmd += ` -name "*.${extension}"`;
|
|
39
|
+
}
|
|
40
|
+
cmd += ' | wc -l';
|
|
41
|
+
const result = execSync(cmd, { encoding: 'utf-8' });
|
|
42
|
+
return parseInt(result.trim());
|
|
43
|
+
} catch {
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function printHeader() {
|
|
49
|
+
log('', 'cyan');
|
|
50
|
+
log('╔════════════════════════════════════════╗', 'cyan');
|
|
51
|
+
log('║ AI PLAYBOOK - CLI TOOL ║', 'cyan');
|
|
52
|
+
log('╚════════════════════════════════════════╝', 'cyan');
|
|
53
|
+
log('', 'cyan');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function setupCommand() {
|
|
57
|
+
log('Setting up AI Playbook...', 'yellow');
|
|
58
|
+
log('', 'yellow');
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
execSync(`bash "${playbookDir}/setup.sh"`, { stdio: 'inherit' });
|
|
62
|
+
log('\nSetup complete!', 'green');
|
|
63
|
+
} catch (error) {
|
|
64
|
+
log(`Setup failed: ${error.message}`, 'red');
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function listCommand() {
|
|
70
|
+
printHeader();
|
|
71
|
+
|
|
72
|
+
const folders = [
|
|
73
|
+
{ name: 'agents', desc: 'Specialized AI agents (15 agents)' },
|
|
74
|
+
{ name: 'commands', desc: 'Development commands (16 commands)' },
|
|
75
|
+
{ name: 'hooks', desc: 'Automation hooks (15+ hooks)' },
|
|
76
|
+
{ name: 'prompts', desc: 'Prompt templates (12 prompts)' },
|
|
77
|
+
{ name: 'skills', desc: 'Domain expertise and skills' },
|
|
78
|
+
{ name: 'patterns', desc: 'Reusable solution patterns' },
|
|
79
|
+
{ name: 'roles', desc: 'Engineering role definitions' },
|
|
80
|
+
{ name: 'context', desc: 'Communication context' },
|
|
81
|
+
{ name: 'knowledge', desc: 'Reference knowledge' },
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
log('📁 Available Folders:\n', 'blue');
|
|
85
|
+
|
|
86
|
+
folders.forEach((folder) => {
|
|
87
|
+
const dir = path.join(playbookDir, folder.name);
|
|
88
|
+
const exists = fs.existsSync(dir);
|
|
89
|
+
const size = exists ? getFolderSize(dir) : 'N/A';
|
|
90
|
+
const files = exists ? countFiles(dir, 'md') : 0;
|
|
91
|
+
|
|
92
|
+
if (exists) {
|
|
93
|
+
log(` ✓ ${folder.name.padEnd(15)} - ${folder.desc.padEnd(35)} (${size}, ${files} files)`, 'green');
|
|
94
|
+
} else {
|
|
95
|
+
log(` ✗ ${folder.name.padEnd(15)} - ${folder.desc}`, 'yellow');
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
log('\n📦 Sync Locations:\n', 'blue');
|
|
100
|
+
|
|
101
|
+
const locations = [
|
|
102
|
+
{ name: 'Claude Code', path: `${homeDir}/.claude/playbook` },
|
|
103
|
+
{ name: 'GitHub CLI (Codex)', path: `${homeDir}/.config/gh/extensions/playbook` },
|
|
104
|
+
{ name: 'Warp Terminal', path: `${homeDir}/Library/Application Support/Warp/playbook` },
|
|
105
|
+
{ name: 'Cursor Editor', path: `${homeDir}/.config/Cursor/playbook` },
|
|
106
|
+
{ name: 'VS Code', path: `${homeDir}/.vscode-playbook` },
|
|
107
|
+
{ name: 'Aider CLI', path: `${homeDir}/.aider/playbook` },
|
|
108
|
+
{ name: 'Continue IDE', path: `${homeDir}/.continue/playbook` },
|
|
109
|
+
{ name: 'Ollama', path: `${homeDir}/.ollama/playbook` },
|
|
110
|
+
{ name: 'Generic Location', path: `${homeDir}/.ai-playbook` },
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
locations.forEach((loc) => {
|
|
114
|
+
const exists = fs.existsSync(loc.path);
|
|
115
|
+
if (exists) {
|
|
116
|
+
log(` ✓ ${loc.name.padEnd(20)} → ${loc.path}`, 'green');
|
|
117
|
+
} else {
|
|
118
|
+
log(` ○ ${loc.name.padEnd(20)} → ${loc.path}`, 'yellow');
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
log('', 'cyan');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function helpCommand() {
|
|
126
|
+
printHeader();
|
|
127
|
+
|
|
128
|
+
log('Usage: ai-playbook [command]\n', 'cyan');
|
|
129
|
+
|
|
130
|
+
log('Commands:\n', 'blue');
|
|
131
|
+
log(' setup Sync playbook to all AI tool directories', 'cyan');
|
|
132
|
+
log(' list Show playbook contents and sync locations', 'cyan');
|
|
133
|
+
log(' help Show this help message', 'cyan');
|
|
134
|
+
|
|
135
|
+
log('\nInstallation:\n', 'blue');
|
|
136
|
+
log(' npm install -g ai-playbook', 'cyan');
|
|
137
|
+
log(' ai-playbook setup\n', 'cyan');
|
|
138
|
+
|
|
139
|
+
log('Usage in Tools:\n', 'blue');
|
|
140
|
+
log(' • Claude Code: Reference ~/.claude/playbook', 'cyan');
|
|
141
|
+
log(' • VS Code: Reference ~/.vscode-playbook', 'cyan');
|
|
142
|
+
log(' • Cursor: Reference ~/.config/Cursor/playbook', 'cyan');
|
|
143
|
+
log(' • Warp: Reference ~/Library/Application Support/Warp/playbook', 'cyan');
|
|
144
|
+
log(' • Generic: Reference ~/.ai-playbook\n', 'cyan');
|
|
145
|
+
|
|
146
|
+
log('Examples:\n', 'blue');
|
|
147
|
+
log(' ai-playbook setup # Sync to all tools', 'cyan');
|
|
148
|
+
log(' ai-playbook list # Show structure', 'cyan');
|
|
149
|
+
log(' ai-playbook help # Show this message\n', 'cyan');
|
|
150
|
+
|
|
151
|
+
log('Documentation:\n', 'blue');
|
|
152
|
+
log(' README: ', 'cyan');
|
|
153
|
+
log(' https://github.com/srikanthkanteti/ai-playbook', 'cyan');
|
|
154
|
+
log(' Playbook Location: ', 'cyan');
|
|
155
|
+
log(` ${playbookDir}\n`, 'cyan');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function versionCommand() {
|
|
159
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(playbookDir, 'package.json'), 'utf-8'));
|
|
160
|
+
log(`AI Playbook v${pkg.version}`, 'cyan');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const command = process.argv[2] || 'help';
|
|
164
|
+
|
|
165
|
+
switch (command) {
|
|
166
|
+
case 'setup':
|
|
167
|
+
setupCommand();
|
|
168
|
+
break;
|
|
169
|
+
case 'list':
|
|
170
|
+
listCommand();
|
|
171
|
+
break;
|
|
172
|
+
case 'help':
|
|
173
|
+
case '-h':
|
|
174
|
+
case '--help':
|
|
175
|
+
helpCommand();
|
|
176
|
+
break;
|
|
177
|
+
case 'version':
|
|
178
|
+
case '-v':
|
|
179
|
+
case '--version':
|
|
180
|
+
versionCommand();
|
|
181
|
+
break;
|
|
182
|
+
default:
|
|
183
|
+
log(`Unknown command: ${command}`, 'yellow');
|
|
184
|
+
log('Run "ai-playbook help" for usage information\n', 'yellow');
|
|
185
|
+
process.exit(1);
|
|
186
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Commands
|
|
2
|
+
|
|
3
|
+
Reusable command recipes and workflow definitions for development, validation, and operations.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Commands are automation patterns for common development tasks. Each command is self-contained and can be:
|
|
8
|
+
- Invoked individually
|
|
9
|
+
- Chained together
|
|
10
|
+
- Integrated into CI/CD
|
|
11
|
+
- Run locally or in automation
|
|
12
|
+
|
|
13
|
+
## Command Categories
|
|
14
|
+
|
|
15
|
+
### Development Commands
|
|
16
|
+
|
|
17
|
+
Local development setup and iteration:
|
|
18
|
+
- `setup` - Initialize development environment
|
|
19
|
+
- `dev` - Start development server
|
|
20
|
+
- `build` - Build project artifacts
|
|
21
|
+
- `watch` - Watch files and rebuild on change
|
|
22
|
+
- `clean` - Clean build artifacts
|
|
23
|
+
|
|
24
|
+
### Testing Commands
|
|
25
|
+
|
|
26
|
+
Quality validation:
|
|
27
|
+
- `test` - Run all tests
|
|
28
|
+
- `test-unit` - Run unit tests only
|
|
29
|
+
- `test-integration` - Run integration tests
|
|
30
|
+
- `test-coverage` - Run tests with coverage report
|
|
31
|
+
- `test-watch` - Watch and run tests on file change
|
|
32
|
+
|
|
33
|
+
### Code Quality Commands
|
|
34
|
+
|
|
35
|
+
Code standards and analysis:
|
|
36
|
+
- `lint` - Run linters
|
|
37
|
+
- `format` - Format code
|
|
38
|
+
- `type-check` - Run type checker
|
|
39
|
+
- `analyze` - Static analysis
|
|
40
|
+
- `audit` - Dependency audit
|
|
41
|
+
|
|
42
|
+
### Validation Commands
|
|
43
|
+
|
|
44
|
+
Pre-commit and pre-push validation:
|
|
45
|
+
- `validate` - Run all validation checks
|
|
46
|
+
- `validate-security` - Security checks
|
|
47
|
+
- `validate-performance` - Performance checks
|
|
48
|
+
- `validate-types` - Type checking
|
|
49
|
+
|
|
50
|
+
### Deployment Commands
|
|
51
|
+
|
|
52
|
+
Release and deployment:
|
|
53
|
+
- `release` - Create release
|
|
54
|
+
- `deploy-staging` - Deploy to staging
|
|
55
|
+
- `deploy-prod` - Deploy to production
|
|
56
|
+
- `rollback` - Rollback deployment
|
|
57
|
+
|
|
58
|
+
### Utility Commands
|
|
59
|
+
|
|
60
|
+
Helper tasks:
|
|
61
|
+
- `deps` - Check and update dependencies
|
|
62
|
+
- `migrate` - Run database migrations
|
|
63
|
+
- `seed` - Seed database
|
|
64
|
+
- `reset` - Reset environment
|
|
65
|
+
|
|
66
|
+
## Command Format
|
|
67
|
+
|
|
68
|
+
Each command file contains:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
# Command Name
|
|
72
|
+
|
|
73
|
+
## Purpose
|
|
74
|
+
What this command does and when to use it
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
How to invoke the command
|
|
78
|
+
|
|
79
|
+
## Prerequisites
|
|
80
|
+
What needs to be installed/configured
|
|
81
|
+
|
|
82
|
+
## Steps
|
|
83
|
+
Step-by-step what the command does
|
|
84
|
+
|
|
85
|
+
## Outputs
|
|
86
|
+
What the command produces
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
Examples of using the command
|
|
90
|
+
|
|
91
|
+
## Troubleshooting
|
|
92
|
+
Common issues and solutions
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Using Commands
|
|
96
|
+
|
|
97
|
+
### Run a Single Command
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
source commands/[command-name].sh
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Chain Commands
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
source commands/setup.sh && source commands/dev.sh
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### In CI/CD
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
- name: Run validation
|
|
113
|
+
run: source commands/validate.sh
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Command Dependencies
|
|
117
|
+
|
|
118
|
+
Some commands depend on others:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
setup
|
|
122
|
+
├─ dev (requires setup)
|
|
123
|
+
├─ build (requires setup)
|
|
124
|
+
└─ test (requires setup)
|
|
125
|
+
|
|
126
|
+
validate
|
|
127
|
+
├─ lint (requires setup)
|
|
128
|
+
├─ type-check (requires setup)
|
|
129
|
+
└─ test (requires setup)
|
|
130
|
+
|
|
131
|
+
release
|
|
132
|
+
├─ validate
|
|
133
|
+
├─ build
|
|
134
|
+
└─ deploy-staging
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Creating New Commands
|
|
138
|
+
|
|
139
|
+
### Command Template
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
#!/bin/bash
|
|
143
|
+
# [command-name].sh
|
|
144
|
+
# Purpose: [describe what this does]
|
|
145
|
+
|
|
146
|
+
set -e # Exit on error
|
|
147
|
+
|
|
148
|
+
# Validate prerequisites
|
|
149
|
+
if ! command -v [tool] &> /dev/null; then
|
|
150
|
+
echo "Error: [tool] not found"
|
|
151
|
+
exit 1
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
# Main command steps
|
|
155
|
+
echo "Starting [command-name]..."
|
|
156
|
+
|
|
157
|
+
# Step 1
|
|
158
|
+
echo "Step 1: ..."
|
|
159
|
+
|
|
160
|
+
# Step 2
|
|
161
|
+
echo "Step 2: ..."
|
|
162
|
+
|
|
163
|
+
echo "[command-name] complete!"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Best Practices
|
|
167
|
+
|
|
168
|
+
- ✅ Use `set -e` to exit on error
|
|
169
|
+
- ✅ Validate prerequisites exist
|
|
170
|
+
- ✅ Provide clear progress messages
|
|
171
|
+
- ✅ Return meaningful exit codes
|
|
172
|
+
- ✅ Clean up on failure
|
|
173
|
+
- ✅ Support dry-run mode
|
|
174
|
+
- ✅ Document prerequisites
|
|
175
|
+
- ✅ Keep commands focused
|
|
176
|
+
|
|
177
|
+
## Common Patterns
|
|
178
|
+
|
|
179
|
+
### Error Handling
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
if ! [command]; then
|
|
183
|
+
echo "Error: [message]" >&2
|
|
184
|
+
exit 1
|
|
185
|
+
fi
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Conditional Steps
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
if [ "$SKIP_TESTS" != "true" ]; then
|
|
192
|
+
echo "Running tests..."
|
|
193
|
+
# run tests
|
|
194
|
+
fi
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Dry Run Support
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
if [ "$DRY_RUN" = "true" ]; then
|
|
201
|
+
echo "[Would execute: command]"
|
|
202
|
+
else
|
|
203
|
+
command
|
|
204
|
+
fi
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Progress Output
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
211
|
+
echo "Step: [description]"
|
|
212
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Environment Variables
|
|
216
|
+
|
|
217
|
+
Common variables for commands:
|
|
218
|
+
|
|
219
|
+
- `DRY_RUN=true` - Show what would run without executing
|
|
220
|
+
- `SKIP_TESTS=true` - Skip test steps
|
|
221
|
+
- `VERBOSE=true` - Show more output
|
|
222
|
+
- `CI=true` - Running in CI environment
|
|
223
|
+
- `ENVIRONMENT=staging|prod` - Target environment
|
|
224
|
+
|
|
225
|
+
## Integration with Tools
|
|
226
|
+
|
|
227
|
+
### With Make
|
|
228
|
+
|
|
229
|
+
```makefile
|
|
230
|
+
.PHONY: setup
|
|
231
|
+
setup:
|
|
232
|
+
source commands/setup.sh
|
|
233
|
+
|
|
234
|
+
.PHONY: validate
|
|
235
|
+
validate:
|
|
236
|
+
source commands/validate.sh
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### With npm/package.json
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"scripts": {
|
|
244
|
+
"setup": "source commands/setup.sh",
|
|
245
|
+
"dev": "source commands/dev.sh",
|
|
246
|
+
"test": "source commands/test.sh",
|
|
247
|
+
"validate": "source commands/validate.sh"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### With GitHub Actions
|
|
253
|
+
|
|
254
|
+
```yaml
|
|
255
|
+
- name: Setup
|
|
256
|
+
run: source commands/setup.sh
|
|
257
|
+
|
|
258
|
+
- name: Validate
|
|
259
|
+
run: source commands/validate.sh
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Version
|
|
263
|
+
|
|
264
|
+
**Version:** 1.0
|
|
265
|
+
|
|
266
|
+
Commands are templates for common workflows. Customize for your project's specific needs.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# build Command
|
|
2
|
+
|
|
3
|
+
**Purpose:** Build project artifacts for production
|
|
4
|
+
**Usage:** `npm run build`
|
|
5
|
+
**Trigger:** Release preparation
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
Compiles and optimizes code for production deployment. Validates quality and tests before building.
|
|
10
|
+
|
|
11
|
+
## Build Process
|
|
12
|
+
|
|
13
|
+
1. Validate code quality
|
|
14
|
+
2. Run tests
|
|
15
|
+
3. Compile/transpile code
|
|
16
|
+
4. Optimize assets
|
|
17
|
+
5. Generate build artifacts
|
|
18
|
+
6. Verify build size
|
|
19
|
+
|
|
20
|
+
## Success Criteria
|
|
21
|
+
|
|
22
|
+
✓ Lint passes
|
|
23
|
+
✓ Tests pass
|
|
24
|
+
✓ Build compiles
|
|
25
|
+
✓ Assets optimized
|
|
26
|
+
✓ No errors
|
|
27
|
+
✓ Output generated
|
|
28
|
+
|
|
29
|
+
## Build Artifacts
|
|
30
|
+
|
|
31
|
+
| Framework | Output |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Next.js | `.next/` directory |
|
|
34
|
+
| React | `build/` directory |
|
|
35
|
+
| Vue | `dist/` directory |
|
|
36
|
+
| Node | `dist/` or `build/` |
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
- `webpack.config.js` - Webpack config
|
|
41
|
+
- `.babelrc` - Babel config
|
|
42
|
+
- `tsconfig.json` - TypeScript config
|
|
43
|
+
- `vite.config.js` - Vite config (if used)
|
|
44
|
+
|
|
45
|
+
## Running Build
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Production build
|
|
49
|
+
npm run build
|
|
50
|
+
|
|
51
|
+
# Development build
|
|
52
|
+
npm run build:dev
|
|
53
|
+
|
|
54
|
+
# With analysis
|
|
55
|
+
npm run build:analyze
|
|
56
|
+
|
|
57
|
+
# Watch mode
|
|
58
|
+
npm run build:watch
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Build Verification
|
|
62
|
+
|
|
63
|
+
After build, check:
|
|
64
|
+
- **Size:** artifacts/.size file
|
|
65
|
+
- **Output:** dist/ or build/ exists
|
|
66
|
+
- **Errors:** None in logs
|
|
67
|
+
- **Assets:** CSS, JS minified
|
|
68
|
+
|
|
69
|
+
## Performance
|
|
70
|
+
|
|
71
|
+
Typical build times:
|
|
72
|
+
- Small project: 10-30 seconds
|
|
73
|
+
- Medium project: 30-60 seconds
|
|
74
|
+
- Large project: 1-3 minutes
|
|
75
|
+
|
|
76
|
+
## Optimization
|
|
77
|
+
|
|
78
|
+
Build includes:
|
|
79
|
+
- Code minification
|
|
80
|
+
- Tree shaking
|
|
81
|
+
- Code splitting
|
|
82
|
+
- Asset compression
|
|
83
|
+
- Sourcemap generation
|
|
84
|
+
|
|
85
|
+
## Failure Handling
|
|
86
|
+
|
|
87
|
+
| Error | Solution |
|
|
88
|
+
|---|---|
|
|
89
|
+
| Compilation error | Fix TypeScript/Babel errors |
|
|
90
|
+
| Missing file | Check imports, paths |
|
|
91
|
+
| Build too large | Enable code splitting |
|
|
92
|
+
| Memory exceeded | Increase Node memory |
|
|
93
|
+
|
|
94
|
+
## Environment Variables
|
|
95
|
+
|
|
96
|
+
- `CI=true` - CI mode (stricter)
|
|
97
|
+
- `ANALYZE=true` - Bundle analysis
|
|
98
|
+
- `SKIP_TESTS=true` - Skip tests (not recommended)
|
|
99
|
+
|
|
100
|
+
## Docker Build
|
|
101
|
+
|
|
102
|
+
If using Docker:
|
|
103
|
+
```bash
|
|
104
|
+
docker build -t myapp:latest .
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Deployment After Build
|
|
108
|
+
|
|
109
|
+
1. Run build successfully
|
|
110
|
+
2. Commit if needed (or use CI artifact)
|
|
111
|
+
3. Deploy build artifact
|
|
112
|
+
4. Verify in staging
|
|
113
|
+
5. Deploy to production
|
|
114
|
+
|
|
115
|
+
## Related Commands
|
|
116
|
+
|
|
117
|
+
- `dev` - Development server
|
|
118
|
+
- `test` - Run tests
|
|
119
|
+
- `validate` - All checks
|
|
120
|
+
- `deploy-staging` - Deploy build
|
|
121
|
+
|
|
122
|
+
## CI/CD Integration
|
|
123
|
+
|
|
124
|
+
- Build triggered on commit
|
|
125
|
+
- Artifact stored in CI
|
|
126
|
+
- Deploy pulls from artifact
|
|
127
|
+
- Build cached for performance
|
|
128
|
+
|
|
129
|
+
## Notes
|
|
130
|
+
|
|
131
|
+
- Always build before deploying
|
|
132
|
+
- Test build locally first
|
|
133
|
+
- Build artifacts are not source code
|
|
134
|
+
- Keep build artifacts (.gitignore)
|
|
135
|
+
- Production build is immutable
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# clean Command
|
|
2
|
+
|
|
3
|
+
**Purpose:** Clean build artifacts and temporary files
|
|
4
|
+
**Usage:** `npm run clean`
|
|
5
|
+
**Trigger:** Reset environment, free disk space
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
Removes generated files and temporary directories, resetting project to clean state.
|
|
10
|
+
|
|
11
|
+
## Directories Removed
|
|
12
|
+
|
|
13
|
+
| Directory | Contents |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `dist/` | Compiled output |
|
|
16
|
+
| `build/` | Build artifacts |
|
|
17
|
+
| `.next/` | Next.js cache |
|
|
18
|
+
| `.cache/` | Build cache |
|
|
19
|
+
| `node_modules/` | (optional) Dependencies |
|
|
20
|
+
| `coverage/` | Test reports |
|
|
21
|
+
| `__pycache__/` | Python cache |
|
|
22
|
+
|
|
23
|
+
## Files Removed
|
|
24
|
+
|
|
25
|
+
- Compiled files (`.js` from `.ts`)
|
|
26
|
+
- Cache files (`.swp`, `.swo`)
|
|
27
|
+
- OS files (`.DS_Store`)
|
|
28
|
+
- Log files (`*.log`)
|
|
29
|
+
- Temporary files
|
|
30
|
+
|
|
31
|
+
## Success Criteria
|
|
32
|
+
|
|
33
|
+
✓ Build artifacts deleted
|
|
34
|
+
✓ Cache cleared
|
|
35
|
+
✓ Logs removed
|
|
36
|
+
✓ Disk space freed
|
|
37
|
+
|
|
38
|
+
## Running Clean
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Interactive (asks for confirmation)
|
|
42
|
+
npm run clean
|
|
43
|
+
|
|
44
|
+
# Force without prompt
|
|
45
|
+
FORCE=true npm run clean
|
|
46
|
+
|
|
47
|
+
# Only specific directories
|
|
48
|
+
rm -rf dist/
|
|
49
|
+
rm -rf coverage/
|
|
50
|
+
|
|
51
|
+
# With Docker
|
|
52
|
+
docker system prune -f
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## What's Safe to Delete
|
|
56
|
+
|
|
57
|
+
✓ `dist/` - Always safe
|
|
58
|
+
✓ `build/` - Always safe
|
|
59
|
+
✓ `coverage/` - Always safe
|
|
60
|
+
✓ `.cache/` - Always safe
|
|
61
|
+
✓ `__pycache__/` - Always safe
|
|
62
|
+
|
|
63
|
+
## What's Dangerous
|
|
64
|
+
|
|
65
|
+
✗ `node_modules/` - Need reinstall
|
|
66
|
+
✗ `.env` - Configuration lost
|
|
67
|
+
✗ `src/` - Source code!
|
|
68
|
+
✗ `.git/` - Repository!
|
|
69
|
+
|
|
70
|
+
## Disk Space Impact
|
|
71
|
+
|
|
72
|
+
Typical sizes freed:
|
|
73
|
+
- `node_modules/`: 200-500MB
|
|
74
|
+
- `dist/`: 10-50MB
|
|
75
|
+
- `.cache/`: 10-100MB
|
|
76
|
+
- `coverage/`: 1-10MB
|
|
77
|
+
|
|
78
|
+
## After Clean
|
|
79
|
+
|
|
80
|
+
After cleaning, you need to:
|
|
81
|
+
1. Reinstall dependencies: `npm install`
|
|
82
|
+
2. Rebuild: `npm run build`
|
|
83
|
+
3. Restart dev server: `npm run dev`
|
|
84
|
+
|
|
85
|
+
## When to Clean
|
|
86
|
+
|
|
87
|
+
- Disk space needed
|
|
88
|
+
- Mysterious build errors
|
|
89
|
+
- Switching git branches
|
|
90
|
+
- Large files accumulating
|
|
91
|
+
- Performance issues
|
|
92
|
+
|
|
93
|
+
## Related Commands
|
|
94
|
+
|
|
95
|
+
- `setup` - Reinitialize environment
|
|
96
|
+
- `build` - Rebuild artifacts
|
|
97
|
+
- `dev` - Restart dev server
|
|
98
|
+
|
|
99
|
+
## Safety
|
|
100
|
+
|
|
101
|
+
- Confirmation required (interactive)
|
|
102
|
+
- Safe to run multiple times
|
|
103
|
+
- Doesn't delete source code
|
|
104
|
+
- Doesn't delete configuration
|
|
105
|
+
- Can use `git clean` for git files
|
|
106
|
+
|
|
107
|
+
## Advanced Cleaning
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Remove untracked files
|
|
111
|
+
git clean -fd
|
|
112
|
+
|
|
113
|
+
# Remove node_modules only
|
|
114
|
+
rm -rf node_modules/ && npm install
|
|
115
|
+
|
|
116
|
+
# Docker cleanup
|
|
117
|
+
docker system prune -a --volumes
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Notes
|
|
121
|
+
|
|
122
|
+
- Always ask before deleting
|
|
123
|
+
- Build fresh after clean
|
|
124
|
+
- May take time to reinstall
|
|
125
|
+
- Network required for reinstall
|
|
126
|
+
- IDE may need restart
|