$npx -y skills add One-Man-Company/Skills-ContextManager --skill deployment-proceduresProduction deployment principles and decision-making. Safe deployment workflows, rollback strategies, and verification. Teaches thinking, not scripts.
| 1 | # Deployment Procedures |
| 2 | |
| 3 | > Deployment principles and decision-making for safe production releases. |
| 4 | > **Learn to THINK, not memorize scripts.** |
| 5 | |
| 6 | --- |
| 7 | |
| 8 | ## ⚠️ How to Use This Skill |
| 9 | |
| 10 | This skill teaches **deployment principles**, not bash scripts to copy. |
| 11 | |
| 12 | - Every deployment is unique |
| 13 | - Understand the WHY behind each step |
| 14 | - Adapt procedures to your platform |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## 1. Platform Selection |
| 19 | |
| 20 | ### Decision Tree |
| 21 | |
| 22 | ``` |
| 23 | What are you deploying? |
| 24 | │ |
| 25 | ├── Static site / JAMstack |
| 26 | │ └── Vercel, Netlify, Cloudflare Pages |
| 27 | │ |
| 28 | ├── Simple web app |
| 29 | │ ├── Managed → Railway, Render, Fly.io |
| 30 | │ └── Control → VPS + PM2/Docker |
| 31 | │ |
| 32 | ├── Microservices |
| 33 | │ └── Container orchestration |
| 34 | │ |
| 35 | └── Serverless |
| 36 | └── Edge functions, Lambda |
| 37 | ``` |
| 38 | |
| 39 | ### Each Platform Has Different Procedures |
| 40 | |
| 41 | | Platform | Deployment Method | |
| 42 | |----------|------------------| |
| 43 | | **Vercel/Netlify** | Git push, auto-deploy | |
| 44 | | **Railway/Render** | Git push or CLI | |
| 45 | | **VPS + PM2** | SSH + manual steps | |
| 46 | | **Docker** | Image push + orchestration | |
| 47 | | **Kubernetes** | kubectl apply | |
| 48 | |
| 49 | --- |
| 50 | |
| 51 | ## 2. Pre-Deployment Principles |
| 52 | |
| 53 | ### The 4 Verification Categories |
| 54 | |
| 55 | | Category | What to Check | |
| 56 | |----------|--------------| |
| 57 | | **Code Quality** | Tests passing, linting clean, reviewed | |
| 58 | | **Build** | Production build works, no warnings | |
| 59 | | **Environment** | Env vars set, secrets current | |
| 60 | | **Safety** | Backup done, rollback plan ready | |
| 61 | |
| 62 | ### Pre-Deployment Checklist |
| 63 | |
| 64 | - [ ] All tests passing |
| 65 | - [ ] Code reviewed and approved |
| 66 | - [ ] Production build successful |
| 67 | - [ ] Environment variables verified |
| 68 | - [ ] Database migrations ready (if any) |
| 69 | - [ ] Rollback plan documented |
| 70 | - [ ] Team notified |
| 71 | - [ ] Monitoring ready |
| 72 | |
| 73 | --- |
| 74 | |
| 75 | ## 3. Deployment Workflow Principles |
| 76 | |
| 77 | ### The 5-Phase Process |
| 78 | |
| 79 | ``` |
| 80 | 1. PREPARE |
| 81 | └── Verify code, build, env vars |
| 82 | |
| 83 | 2. BACKUP |
| 84 | └── Save current state before changing |
| 85 | |
| 86 | 3. DEPLOY |
| 87 | └── Execute with monitoring open |
| 88 | |
| 89 | 4. VERIFY |
| 90 | └── Health check, logs, key flows |
| 91 | |
| 92 | 5. CONFIRM or ROLLBACK |
| 93 | └── All good? Confirm. Issues? Rollback. |
| 94 | ``` |
| 95 | |
| 96 | ### Phase Principles |
| 97 | |
| 98 | | Phase | Principle | |
| 99 | |-------|-----------| |
| 100 | | **Prepare** | Never deploy untested code | |
| 101 | | **Backup** | Can't rollback without backup | |
| 102 | | **Deploy** | Watch it happen, don't walk away | |
| 103 | | **Verify** | Trust but verify | |
| 104 | | **Confirm** | Have rollback trigger ready | |
| 105 | |
| 106 | --- |
| 107 | |
| 108 | ## 4. Post-Deployment Verification |
| 109 | |
| 110 | ### What to Verify |
| 111 | |
| 112 | | Check | Why | |
| 113 | |-------|-----| |
| 114 | | **Health endpoint** | Service is running | |
| 115 | | **Error logs** | No new errors | |
| 116 | | **Key user flows** | Critical features work | |
| 117 | | **Performance** | Response times acceptable | |
| 118 | |
| 119 | ### Verification Window |
| 120 | |
| 121 | - **First 5 minutes**: Active monitoring |
| 122 | - **15 minutes**: Confirm stable |
| 123 | - **1 hour**: Final verification |
| 124 | - **Next day**: Review metrics |
| 125 | |
| 126 | --- |
| 127 | |
| 128 | ## 5. Rollback Principles |
| 129 | |
| 130 | ### When to Rollback |
| 131 | |
| 132 | | Symptom | Action | |
| 133 | |---------|--------| |
| 134 | | Service down | Rollback immediately | |
| 135 | | Critical errors | Rollback | |
| 136 | | Performance >50% degraded | Consider rollback | |
| 137 | | Minor issues | Fix forward if quick | |
| 138 | |
| 139 | ### Rollback Strategy by Platform |
| 140 | |
| 141 | | Platform | Rollback Method | |
| 142 | |----------|----------------| |
| 143 | | **Vercel/Netlify** | Redeploy previous commit | |
| 144 | | **Railway/Render** | Rollback in dashboard | |
| 145 | | **VPS + PM2** | Restore backup, restart | |
| 146 | | **Docker** | Previous image tag | |
| 147 | | **K8s** | kubectl rollout undo | |
| 148 | |
| 149 | ### Rollback Principles |
| 150 | |
| 151 | 1. **Speed over perfection**: Rollback first, debug later |
| 152 | 2. **Don't compound errors**: One rollback, not multiple changes |
| 153 | 3. **Communicate**: Tell team what happened |
| 154 | 4. **Post-mortem**: Understand why after stable |
| 155 | |
| 156 | --- |
| 157 | |
| 158 | ## 6. Zero-Downtime Deployment |
| 159 | |
| 160 | ### Strategies |
| 161 | |
| 162 | | Strategy | How It Works | |
| 163 | |----------|--------------| |
| 164 | | **Rolling** | Replace instances one by one | |
| 165 | | **Blue-Green** | Switch traffic between environments | |
| 166 | | **Canary** | Gradual traffic shift | |
| 167 | |
| 168 | ### Selection Principles |
| 169 | |
| 170 | | Scenario | Strategy | |
| 171 | |----------|----------| |
| 172 | | Standard release | Rolling | |
| 173 | | High-risk change | Blue-green (easy rollback) | |
| 174 | | Need validation | Canary (test with real traffic) | |
| 175 | |
| 176 | --- |
| 177 | |
| 178 | ## 7. Emergency Procedures |
| 179 | |
| 180 | ### Service Down Priority |
| 181 | |
| 182 | 1. **Assess**: What's the symptom? |
| 183 | 2. **Quick fix**: Restart if unclear |
| 184 | 3. **Rollback**: If restart doesn't help |
| 185 | 4. **Investigate**: After stable |
| 186 | |
| 187 | ### Investigation Order |
| 188 | |
| 189 | | Check | Common Issues | |
| 190 | |-------|--------------| |
| 191 | | **Logs** | Errors, exceptions | |
| 192 | | **Resources** | Disk full, memory | |
| 193 | | **Network** | DNS, firewall | |
| 194 | | **Dependencies** | Database, APIs | |
| 195 | |
| 196 | --- |
| 197 | |
| 198 | ## 8. Anti-Patterns |
| 199 | |
| 200 | | ❌ Don't | ✅ Do | |
| 201 | |----------|-------| |
| 202 | | Deploy on Friday | Deploy early in week | |
| 203 | | Rush deployment | Follow the process | |
| 204 | | Skip staging | Always test first | |
| 205 | | Deploy without backup | Backup before deploy | |
| 206 | | Walk away after deploy | Monitor for 15+ min | |
| 207 | | Multiple changes at once | One change at a time | |
| 208 | |
| 209 | --- |
| 210 | |
| 211 | ## 9. Decisio |