agentsys 5.3.4 → 5.3.5

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