awesome-slash 2.4.2

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.
Files changed (95) hide show
  1. package/.claude-plugin/marketplace.json +54 -0
  2. package/.claude-plugin/plugin.json +11 -0
  3. package/.mcp.json +8 -0
  4. package/CHANGELOG.md +261 -0
  5. package/LICENSE +21 -0
  6. package/README.md +363 -0
  7. package/SECURITY.md +101 -0
  8. package/adapters/README.md +256 -0
  9. package/adapters/codex/README.md +272 -0
  10. package/adapters/codex/install.sh +179 -0
  11. package/adapters/opencode/README.md +301 -0
  12. package/adapters/opencode/install.sh +223 -0
  13. package/lib/patterns/review-patterns.js +511 -0
  14. package/lib/patterns/slop-patterns.js +647 -0
  15. package/lib/platform/detect-platform.js +535 -0
  16. package/lib/platform/verify-tools.js +235 -0
  17. package/lib/state/workflow-state.js +635 -0
  18. package/lib/state/workflow-state.schema.json +282 -0
  19. package/lib/utils/context-optimizer.js +227 -0
  20. package/mcp-server/index.js +303 -0
  21. package/mcp-server/package.json +23 -0
  22. package/package.json +63 -0
  23. package/plugins/deslop-around/.claude-plugin/plugin.json +20 -0
  24. package/plugins/deslop-around/commands/deslop-around.md +220 -0
  25. package/plugins/deslop-around/lib/patterns/review-patterns.js +511 -0
  26. package/plugins/deslop-around/lib/patterns/slop-patterns.js +641 -0
  27. package/plugins/deslop-around/lib/platform/detect-platform.js +514 -0
  28. package/plugins/deslop-around/lib/platform/verify-tools.js +235 -0
  29. package/plugins/deslop-around/lib/state/workflow-state.js +635 -0
  30. package/plugins/deslop-around/lib/state/workflow-state.schema.json +282 -0
  31. package/plugins/deslop-around/lib/utils/context-optimizer.js +222 -0
  32. package/plugins/next-task/.claude-plugin/plugin.json +24 -0
  33. package/plugins/next-task/agents/ci-fixer.md +236 -0
  34. package/plugins/next-task/agents/ci-monitor.md +291 -0
  35. package/plugins/next-task/agents/delivery-validator.md +451 -0
  36. package/plugins/next-task/agents/deslop-work.md +272 -0
  37. package/plugins/next-task/agents/docs-updater.md +506 -0
  38. package/plugins/next-task/agents/exploration-agent.md +277 -0
  39. package/plugins/next-task/agents/implementation-agent.md +427 -0
  40. package/plugins/next-task/agents/planning-agent.md +236 -0
  41. package/plugins/next-task/agents/policy-selector.md +248 -0
  42. package/plugins/next-task/agents/review-orchestrator.md +521 -0
  43. package/plugins/next-task/agents/simple-fixer.md +136 -0
  44. package/plugins/next-task/agents/task-discoverer.md +357 -0
  45. package/plugins/next-task/agents/test-coverage-checker.md +447 -0
  46. package/plugins/next-task/agents/worktree-manager.md +419 -0
  47. package/plugins/next-task/commands/delivery-approval.md +331 -0
  48. package/plugins/next-task/commands/next-task.md +627 -0
  49. package/plugins/next-task/commands/update-docs-around.md +418 -0
  50. package/plugins/next-task/hooks/hooks.json +14 -0
  51. package/plugins/next-task/lib/patterns/review-patterns.js +511 -0
  52. package/plugins/next-task/lib/patterns/slop-patterns.js +641 -0
  53. package/plugins/next-task/lib/platform/detect-platform.js +514 -0
  54. package/plugins/next-task/lib/platform/verify-tools.js +235 -0
  55. package/plugins/next-task/lib/state/tasks-registry.schema.json +85 -0
  56. package/plugins/next-task/lib/state/workflow-state.js +635 -0
  57. package/plugins/next-task/lib/state/workflow-state.schema.json +282 -0
  58. package/plugins/next-task/lib/state/worktree-status.schema.json +219 -0
  59. package/plugins/next-task/lib/utils/context-optimizer.js +222 -0
  60. package/plugins/project-review/.claude-plugin/plugin.json +20 -0
  61. package/plugins/project-review/commands/project-review-agents.md +286 -0
  62. package/plugins/project-review/commands/project-review-github.md +142 -0
  63. package/plugins/project-review/commands/project-review.md +273 -0
  64. package/plugins/project-review/lib/patterns/review-patterns.js +511 -0
  65. package/plugins/project-review/lib/patterns/slop-patterns.js +641 -0
  66. package/plugins/project-review/lib/platform/detect-platform.js +514 -0
  67. package/plugins/project-review/lib/platform/verify-tools.js +235 -0
  68. package/plugins/project-review/lib/state/workflow-state.js +635 -0
  69. package/plugins/project-review/lib/state/workflow-state.schema.json +282 -0
  70. package/plugins/project-review/lib/utils/context-optimizer.js +222 -0
  71. package/plugins/reality-check/.claude-plugin/plugin.json +23 -0
  72. package/plugins/reality-check/README.md +156 -0
  73. package/plugins/reality-check/agents/code-explorer.md +353 -0
  74. package/plugins/reality-check/agents/doc-analyzer.md +337 -0
  75. package/plugins/reality-check/agents/issue-scanner.md +231 -0
  76. package/plugins/reality-check/agents/plan-synthesizer.md +479 -0
  77. package/plugins/reality-check/commands/scan.md +242 -0
  78. package/plugins/reality-check/commands/set.md +203 -0
  79. package/plugins/reality-check/lib/state/reality-check-state.js +509 -0
  80. package/plugins/reality-check/skills/reality-analysis/SKILL.md +317 -0
  81. package/plugins/ship/.claude-plugin/plugin.json +21 -0
  82. package/plugins/ship/commands/ship-ci-review-loop.md +443 -0
  83. package/plugins/ship/commands/ship-deployment.md +330 -0
  84. package/plugins/ship/commands/ship-error-handling.md +254 -0
  85. package/plugins/ship/commands/ship.md +370 -0
  86. package/plugins/ship/lib/patterns/review-patterns.js +511 -0
  87. package/plugins/ship/lib/patterns/slop-patterns.js +641 -0
  88. package/plugins/ship/lib/platform/detect-platform.js +514 -0
  89. package/plugins/ship/lib/platform/verify-tools.js +235 -0
  90. package/plugins/ship/lib/state/workflow-state.js +635 -0
  91. package/plugins/ship/lib/state/workflow-state.schema.json +282 -0
  92. package/plugins/ship/lib/utils/context-optimizer.js +222 -0
  93. package/scripts/install/claude.sh +50 -0
  94. package/scripts/install/codex.sh +181 -0
  95. package/scripts/install/opencode.sh +211 -0
@@ -0,0 +1,330 @@
1
+ # Phases 7-10: Deploy & Validate - Reference
2
+
3
+ This file contains platform-specific deployment and validation for `/ship`.
4
+
5
+ **Parent document**: `ship.md`
6
+
7
+ **Note**: Skip all phases if `WORKFLOW="single-branch"`.
8
+
9
+ ## Phase 7: Deploy to Development
10
+
11
+ ### Railway
12
+
13
+ ```bash
14
+ if [ "$DEPLOYMENT" = "railway" ]; then
15
+ echo "Waiting for Railway development deployment..."
16
+
17
+ SERVICE_NAME=$(railway service list --json | jq -r '.[0].name')
18
+ DEPLOY_ID=$(railway deployment list --service $SERVICE_NAME --json | jq -r '.[0].id')
19
+
20
+ while true; do
21
+ STATUS=$(railway deployment get $DEPLOY_ID --json | jq -r '.status')
22
+
23
+ if [ "$STATUS" = "SUCCESS" ]; then
24
+ DEV_URL=$(railway domain list --service $SERVICE_NAME --json | jq -r '.[0].domain')
25
+ echo "✓ Deployed to development: https://$DEV_URL"
26
+ break
27
+ elif [ "$STATUS" = "FAILED" ]; then
28
+ echo "✗ Development deployment failed"
29
+ railway logs --deployment $DEPLOY_ID
30
+ exit 1
31
+ fi
32
+
33
+ sleep 10
34
+ done
35
+ fi
36
+ ```
37
+
38
+ ### Vercel
39
+
40
+ ```bash
41
+ if [ "$DEPLOYMENT" = "vercel" ]; then
42
+ echo "Waiting for Vercel development deployment..."
43
+
44
+ DEPLOY_URL=$(vercel ls --json | jq -r '.[0].url')
45
+
46
+ while true; do
47
+ STATUS=$(vercel inspect $DEPLOY_URL --json | jq -r '.readyState')
48
+
49
+ if [ "$STATUS" = "READY" ]; then
50
+ echo "✓ Deployed to development: https://$DEPLOY_URL"
51
+ DEV_URL="https://$DEPLOY_URL"
52
+ break
53
+ elif [ "$STATUS" = "ERROR" ]; then
54
+ echo "✗ Development deployment failed"
55
+ vercel logs $DEPLOY_URL
56
+ exit 1
57
+ fi
58
+
59
+ sleep 10
60
+ done
61
+ fi
62
+ ```
63
+
64
+ ### Netlify
65
+
66
+ ```bash
67
+ if [ "$DEPLOYMENT" = "netlify" ]; then
68
+ echo "Waiting for Netlify development deployment..."
69
+
70
+ SITE_ID=$(netlify status --json | jq -r '.site_id')
71
+ DEPLOY_ID=$(netlify api listSiteDeploys --data "{ \"site_id\": \"$SITE_ID\" }" | jq -r '.[0].id')
72
+
73
+ while true; do
74
+ STATUS=$(netlify api getDeploy --data "{ \"deploy_id\": \"$DEPLOY_ID\" }" | jq -r '.state')
75
+
76
+ if [ "$STATUS" = "ready" ]; then
77
+ DEV_URL=$(netlify api getDeploy --data "{ \"deploy_id\": \"$DEPLOY_ID\" }" | jq -r '.deploy_ssl_url')
78
+ echo "✓ Deployed to development: $DEV_URL"
79
+ break
80
+ elif [ "$STATUS" = "error" ]; then
81
+ echo "✗ Development deployment failed"
82
+ exit 1
83
+ fi
84
+
85
+ sleep 10
86
+ done
87
+ fi
88
+ ```
89
+
90
+ ### Generic / Unknown
91
+
92
+ ```bash
93
+ if [ -z "$DEPLOYMENT" ] || [ "$DEPLOYMENT" = "null" ]; then
94
+ echo "No deployment platform detected"
95
+ echo "Assuming merge to $MAIN_BRANCH means deployment"
96
+ DEV_URL="N/A"
97
+ fi
98
+ ```
99
+
100
+ ## Phase 8: Validate Development
101
+
102
+ ### Health Check
103
+
104
+ ```bash
105
+ echo "Running smoke tests on development..."
106
+
107
+ # Wait for deployment to stabilize
108
+ sleep 30
109
+
110
+ # Basic health check
111
+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" $DEV_URL/health || echo "000")
112
+
113
+ if [ "$HTTP_STATUS" = "200" ] || [ "$HTTP_STATUS" = "301" ] || [ "$HTTP_STATUS" = "302" ]; then
114
+ echo "✓ Health check passed: $HTTP_STATUS"
115
+ else
116
+ echo "✗ Health check failed: $HTTP_STATUS"
117
+ echo "Investigate deployment issues before proceeding to production"
118
+ exit 1
119
+ fi
120
+ ```
121
+
122
+ ### Error Log Monitoring
123
+
124
+ ```bash
125
+ echo "Checking logs for errors..."
126
+
127
+ if [ "$DEPLOYMENT" = "railway" ]; then
128
+ ERROR_COUNT=$(railway logs --tail 100 | grep -iE "(error|exception|fatal)" | wc -l)
129
+ elif [ "$DEPLOYMENT" = "vercel" ]; then
130
+ ERROR_COUNT=$(vercel logs $DEV_URL --since 5m | grep -iE "(error|exception|fatal)" | wc -l)
131
+ elif [ "$DEPLOYMENT" = "netlify" ]; then
132
+ ERROR_COUNT=$(netlify logs --since 5m | grep -iE "(error|exception|fatal)" | wc -l)
133
+ else
134
+ ERROR_COUNT=0
135
+ fi
136
+
137
+ if [ "$ERROR_COUNT" -gt 10 ]; then
138
+ echo "✗ High error rate detected: $ERROR_COUNT errors in last 5 minutes"
139
+ echo "Review logs before proceeding to production"
140
+ exit 1
141
+ else
142
+ echo "✓ Error rate acceptable: $ERROR_COUNT errors"
143
+ fi
144
+ ```
145
+
146
+ ### Project Smoke Tests
147
+
148
+ ```bash
149
+ if jq -e '.scripts["smoke-test"]' package.json > /dev/null 2>&1; then
150
+ echo "Running project smoke tests..."
151
+
152
+ export SMOKE_TEST_URL=$DEV_URL
153
+ $PACKAGE_MGR run smoke-test
154
+
155
+ if [ $? -eq 0 ]; then
156
+ echo "✓ Smoke tests passed"
157
+ else
158
+ echo "✗ Smoke tests failed"
159
+ exit 1
160
+ fi
161
+ fi
162
+ ```
163
+
164
+ ### Validation Summary
165
+
166
+ ```markdown
167
+ ## Development Validation ✓
168
+
169
+ **URL**: ${DEV_URL}
170
+ **Health Check**: ✓ ${HTTP_STATUS}
171
+ **Error Rate**: ✓ ${ERROR_COUNT} errors
172
+ **Smoke Tests**: ✓ Passed
173
+
174
+ Proceeding to production...
175
+ ```
176
+
177
+ ## Phase 9: Deploy to Production
178
+
179
+ ### Merge to Production Branch
180
+
181
+ ```bash
182
+ echo "Merging $MAIN_BRANCH → $PROD_BRANCH..."
183
+
184
+ git checkout $PROD_BRANCH
185
+ git pull origin $PROD_BRANCH
186
+
187
+ git merge $MAIN_BRANCH --no-edit
188
+
189
+ if [ $? -ne 0 ]; then
190
+ echo "✗ Merge to production failed (conflicts)"
191
+ git merge --abort
192
+ exit 1
193
+ fi
194
+
195
+ git push origin $PROD_BRANCH
196
+
197
+ if [ $? -eq 0 ]; then
198
+ PROD_SHA=$(git rev-parse HEAD)
199
+ echo "✓ Production branch at: $PROD_SHA"
200
+ else
201
+ echo "✗ Push to production failed"
202
+ exit 1
203
+ fi
204
+ ```
205
+
206
+ ### Wait for Production Deployment
207
+
208
+ Same platform-specific logic as Phase 7, but targeting production environment.
209
+
210
+ ```bash
211
+ echo "Waiting for production deployment..."
212
+
213
+ # Platform-specific deployment monitoring
214
+ # (Similar to Phase 7)
215
+
216
+ echo "✓ Deployed to production: $PROD_URL"
217
+ ```
218
+
219
+ ## Phase 10: Validate Production
220
+
221
+ ### Conservative Validation
222
+
223
+ ```bash
224
+ echo "Validating production deployment..."
225
+
226
+ # Wait longer for production to stabilize
227
+ sleep 60
228
+
229
+ # Health check
230
+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" $PROD_URL/health || echo "000")
231
+
232
+ if [ "$HTTP_STATUS" = "200" ] || [ "$HTTP_STATUS" = "301" ] || [ "$HTTP_STATUS" = "302" ]; then
233
+ echo "✓ Production health check: $HTTP_STATUS"
234
+ else
235
+ echo "✗ Production health check failed: $HTTP_STATUS"
236
+ rollback_production
237
+ fi
238
+ ```
239
+
240
+ ### Production Error Monitoring
241
+
242
+ ```bash
243
+ echo "Monitoring production logs..."
244
+
245
+ if [ "$DEPLOYMENT" = "railway" ]; then
246
+ ERROR_COUNT=$(railway logs --tail 100 | grep -iE "(error|exception|fatal)" | wc -l)
247
+ elif [ "$DEPLOYMENT" = "vercel" ]; then
248
+ ERROR_COUNT=$(vercel logs $PROD_URL --since 5m | grep -iE "(error|exception|fatal)" | wc -l)
249
+ fi
250
+
251
+ if [ "$ERROR_COUNT" -gt 20 ]; then
252
+ echo "✗ CRITICAL: High error rate in production: $ERROR_COUNT errors"
253
+ rollback_production
254
+ else
255
+ echo "✓ Production error rate acceptable: $ERROR_COUNT errors"
256
+ fi
257
+ ```
258
+
259
+ ### Production Smoke Tests
260
+
261
+ ```bash
262
+ if jq -e '.scripts["smoke-test:prod"]' package.json > /dev/null 2>&1; then
263
+ echo "Running production smoke tests..."
264
+
265
+ export SMOKE_TEST_URL=$PROD_URL
266
+ $PACKAGE_MGR run smoke-test:prod
267
+
268
+ if [ $? -ne 0 ]; then
269
+ echo "✗ Production smoke tests failed"
270
+ rollback_production
271
+ fi
272
+ fi
273
+ ```
274
+
275
+ ## Rollback Mechanism
276
+
277
+ **Triggered automatically on any production validation failure.**
278
+
279
+ ```bash
280
+ rollback_production() {
281
+ echo "========================================"
282
+ echo "ROLLBACK INITIATED"
283
+ echo "========================================"
284
+ echo "WARNING: Force pushing to $PROD_BRANCH to revert"
285
+
286
+ git checkout $PROD_BRANCH
287
+ git reset --hard HEAD~1
288
+
289
+ # Use --force-with-lease for safety
290
+ if ! git push --force-with-lease origin $PROD_BRANCH; then
291
+ echo "✗ Force push failed - remote may have unexpected changes"
292
+ echo "Manual intervention required"
293
+ exit 1
294
+ fi
295
+
296
+ echo "✓ Rolled back production to previous deployment"
297
+ echo "Previous version will redeploy automatically"
298
+
299
+ # Wait for rollback deployment
300
+ sleep 30
301
+
302
+ # Verify rollback succeeded
303
+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" $PROD_URL/health || echo "000")
304
+ if [ "$HTTP_STATUS" = "200" ]; then
305
+ echo "✓ Rollback successful, production is healthy"
306
+ else
307
+ echo "⚠ Rollback deployed but health check unclear"
308
+ echo "Manual investigation required"
309
+ fi
310
+
311
+ exit 1
312
+ }
313
+ ```
314
+
315
+ ## Platform Detection Reference
316
+
317
+ The `detect-platform.js` script returns:
318
+
319
+ ```json
320
+ {
321
+ "ci": "github-actions|gitlab-ci|circleci|jenkins|travis|null",
322
+ "deployment": "railway|vercel|netlify|heroku|null",
323
+ "branchStrategy": "single-branch|multi-branch",
324
+ "mainBranch": "main|master",
325
+ "projectType": "nodejs|python|rust|go",
326
+ "packageManager": "npm|yarn|pnpm|pip|cargo"
327
+ }
328
+ ```
329
+
330
+ Use these values to adapt deployment monitoring to your specific platform.
@@ -0,0 +1,254 @@
1
+ # Error Handling & Recovery - Reference
2
+
3
+ This file contains error handling procedures for `/ship`.
4
+
5
+ **Parent document**: `ship.md`
6
+
7
+ ## GitHub CLI Not Available
8
+
9
+ ```markdown
10
+ ERROR: GitHub CLI (gh) not found
11
+
12
+ Install: https://cli.github.com
13
+
14
+ Or use package manager:
15
+ macOS: brew install gh
16
+ Windows: winget install GitHub.cli
17
+ Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md
18
+
19
+ Then authenticate:
20
+ gh auth login
21
+ ```
22
+
23
+ ## CI Failure
24
+
25
+ ```markdown
26
+ ✗ CI checks failed for PR #${PR_NUMBER}
27
+
28
+ View details:
29
+ ${CI_URL}
30
+
31
+ Fix the failing tests/checks and push again.
32
+ The /ship command will resume from Phase 4 (CI monitoring).
33
+
34
+ To retry:
35
+ git push
36
+ /ship
37
+ ```
38
+
39
+ ### CI Fix with ci-fixer Agent
40
+
41
+ When CI fails, use the ci-fixer agent:
42
+
43
+ ```javascript
44
+ Task({
45
+ subagent_type: "next-task:ci-fixer",
46
+ prompt: `Fix CI failure for PR #${PR_NUMBER}
47
+
48
+ CI Output:
49
+ ${CI_OUTPUT}
50
+
51
+ Failed checks:
52
+ ${FAILED_CHECKS}
53
+
54
+ Requirements:
55
+ 1. Analyze the failure reason
56
+ 2. Make minimal fix to pass CI
57
+ 3. Do not introduce unrelated changes
58
+ 4. Ensure all tests pass after fix`
59
+ });
60
+ ```
61
+
62
+ ## Merge Conflicts
63
+
64
+ ```markdown
65
+ ✗ Cannot merge PR #${PR_NUMBER}: conflicts with ${MAIN_BRANCH}
66
+
67
+ Resolve conflicts:
68
+ git fetch origin
69
+ git merge origin/${MAIN_BRANCH}
70
+ # Resolve conflicts in your editor
71
+ git add .
72
+ git commit
73
+ git push
74
+
75
+ Then retry:
76
+ /ship
77
+ ```
78
+
79
+ ## Deployment Failure
80
+
81
+ ```markdown
82
+ ✗ Deployment failed
83
+
84
+ ${WORKFLOW === 'dev-prod' ? 'Development' : 'Production'} deployment did not succeed.
85
+
86
+ Check deployment logs:
87
+ ${DEPLOYMENT === 'railway' ? 'railway logs' : ''}
88
+ ${DEPLOYMENT === 'vercel' ? 'vercel logs' : ''}
89
+ ${DEPLOYMENT === 'netlify' ? 'netlify logs' : ''}
90
+
91
+ Once fixed, deployment will retry automatically.
92
+ ```
93
+
94
+ ## Production Validation Failure with Rollback
95
+
96
+ ```markdown
97
+ ✗ Production validation failed
98
+
99
+ ROLLBACK INITIATED
100
+
101
+ Production has been rolled back to previous version.
102
+ Previous deployment: ${PREVIOUS_SHA}
103
+
104
+ Issues detected:
105
+ ${VALIDATION_ISSUES}
106
+
107
+ Fix the issues and try shipping again:
108
+ /ship
109
+ ```
110
+
111
+ ## Push Failure
112
+
113
+ ```markdown
114
+ ✗ Push to remote failed
115
+
116
+ Possible causes:
117
+ 1. Authentication issue: gh auth status
118
+ 2. Remote branch protected: check branch protection rules
119
+ 3. Out of date: git pull --rebase origin ${CURRENT_BRANCH}
120
+
121
+ Resolve and retry:
122
+ /ship
123
+ ```
124
+
125
+ ## PR Creation Failure
126
+
127
+ ```markdown
128
+ ✗ Failed to create PR
129
+
130
+ Possible causes:
131
+ 1. Already exists: gh pr list --head ${CURRENT_BRANCH}
132
+ 2. No commits: git log ${MAIN_BRANCH}..HEAD
133
+ 3. Same branch: ensure not on ${MAIN_BRANCH}
134
+
135
+ Check existing PRs:
136
+ gh pr list --state all --head ${CURRENT_BRANCH}
137
+ ```
138
+
139
+ ## Max Review Iterations Reached
140
+
141
+ ```markdown
142
+ ✗ Max iterations (${MAX_ITERATIONS}) reached
143
+
144
+ Unable to resolve all review comments automatically.
145
+ Manual intervention required.
146
+
147
+ Remaining unresolved threads: ${UNRESOLVED_COUNT}
148
+
149
+ View PR: ${PR_URL}
150
+
151
+ Options:
152
+ 1. Manually address remaining comments
153
+ 2. Request reviewer to close non-blocking items
154
+ 3. Continue with /ship after resolving
155
+ ```
156
+
157
+ ## Worktree Cleanup Failure
158
+
159
+ ```markdown
160
+ ⚠ Failed to clean up worktree
161
+
162
+ Worktree at: ${WORKTREE_PATH}
163
+
164
+ Manual cleanup:
165
+ git worktree remove ${WORKTREE_PATH} --force
166
+ git worktree prune
167
+ ```
168
+
169
+ ## Force Push Safety
170
+
171
+ When rollback requires force push:
172
+
173
+ ```bash
174
+ # ALWAYS use --force-with-lease instead of --force
175
+ # This prevents overwriting unexpected remote changes
176
+
177
+ if ! git push --force-with-lease origin $PROD_BRANCH; then
178
+ echo "✗ Force push failed - remote has unexpected changes"
179
+ echo "Someone else may have pushed to production"
180
+ echo "Manual investigation required"
181
+ exit 1
182
+ fi
183
+ ```
184
+
185
+ ## Recovery Procedures
186
+
187
+ ### Resume After CI Fix
188
+
189
+ ```bash
190
+ # After fixing CI locally
191
+ git add .
192
+ git commit -m "fix: address CI failures"
193
+ git push
194
+
195
+ # Resume shipping
196
+ /ship
197
+ ```
198
+
199
+ ### Resume After Conflict Resolution
200
+
201
+ ```bash
202
+ # After resolving merge conflicts
203
+ git add .
204
+ git commit
205
+ git push
206
+
207
+ # Resume shipping
208
+ /ship
209
+ ```
210
+
211
+ ### Resume After Manual Review Resolution
212
+
213
+ ```bash
214
+ # After manually addressing review comments
215
+ git add .
216
+ git commit -m "fix: address review feedback"
217
+ git push
218
+
219
+ # Resume shipping
220
+ /ship
221
+ ```
222
+
223
+ ### Cancel and Cleanup
224
+
225
+ ```bash
226
+ # If you need to abandon the PR
227
+ gh pr close $PR_NUMBER --delete-branch
228
+
229
+ # Clean up local
230
+ git checkout $MAIN_BRANCH
231
+ git branch -D $CURRENT_BRANCH
232
+ ```
233
+
234
+ ## Exit Codes
235
+
236
+ | Code | Meaning |
237
+ |------|---------|
238
+ | 0 | Success - PR merged |
239
+ | 1 | General failure |
240
+ | 2 | CI failure (retryable) |
241
+ | 3 | Review timeout (manual intervention) |
242
+ | 4 | Deployment failure |
243
+ | 5 | Rollback triggered |
244
+
245
+ ## Logging for Debugging
246
+
247
+ Enable verbose logging:
248
+
249
+ ```bash
250
+ export SHIP_DEBUG=1
251
+ /ship
252
+ ```
253
+
254
+ This will output detailed information about each phase for troubleshooting.