@yottagraph-app/aether-instructions 1.0.1

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.
@@ -0,0 +1,278 @@
1
+ # Vercel Deploy
2
+
3
+ Deploy the current state of the project to Vercel via Git integration.
4
+
5
+ ## Overview
6
+
7
+ This command helps the user deploy their code to Vercel. It handles committing changes, choosing production vs. preview (branch) deployment, pushing to the right branch, and confirming the deployment succeeded.
8
+
9
+ **Prerequisite:** The project must already be set up with Vercel (linked, env vars synced, etc.). If it hasn't been set up yet, redirect the user to `/vercel_setup`.
10
+
11
+ ---
12
+
13
+ ## Step 1: Verify Vercel is Set Up
14
+
15
+ Check that the project is linked to Vercel by checking whether `.vercel/project.json` exists (read the file or check the directory).
16
+
17
+ **If the file does not exist:** The project hasn't been set up yet. Tell the user:
18
+
19
+ > This project hasn't been connected to Vercel yet. Let's run the setup first.
20
+
21
+ Then stop and redirect them to run `/vercel_setup`.
22
+
23
+ Also verify there's at least one prior deployment:
24
+
25
+ ```bash
26
+ npx vercel ls 2>&1
27
+ ```
28
+
29
+ **If no deployments are listed:** Same as above — redirect to `/vercel_setup`.
30
+
31
+ **If deployments exist:** Continue.
32
+
33
+ ---
34
+
35
+ ## Step 2: Check for Uncommitted Changes
36
+
37
+ ```bash
38
+ git status
39
+ ```
40
+
41
+ **If the working tree is clean** (nothing to commit): Continue to Step 3.
42
+
43
+ **If there are uncommitted changes:** Show the user what's changed:
44
+
45
+ ```bash
46
+ git status --short
47
+ ```
48
+
49
+ Then ask:
50
+
51
+ ```
52
+ AskQuestion({
53
+ title: "Uncommitted Changes",
54
+ questions: [
55
+ {
56
+ id: "commit-changes",
57
+ prompt: "You have uncommitted changes. These need to be committed before deploying.\n\n[paste the git status output here]\n\nWould you like me to commit them now?",
58
+ options: [
59
+ { id: "commit", label: "Yes — commit all changes and continue" },
60
+ { id: "review", label: "Let me review first — I'll commit manually" }
61
+ ]
62
+ }
63
+ ]
64
+ })
65
+ ```
66
+
67
+ If the user selects "commit": Follow the commit workflow in `git-support.mdc` (format, stage, commit). Do not proceed to Step 3 with a failed commit.
68
+
69
+ If the user selects "review": Stop and wait for them to come back after committing manually.
70
+
71
+ ---
72
+
73
+ ## Step 3: Choose Deployment Target
74
+
75
+ Determine the current branch and the main branch:
76
+
77
+ ```bash
78
+ git branch --show-current
79
+ git remote show origin | grep 'HEAD branch'
80
+ ```
81
+
82
+ Then ask the user where they want to deploy:
83
+
84
+ ```
85
+ AskQuestion({
86
+ title: "Deployment Target",
87
+ questions: [
88
+ {
89
+ id: "deploy-target",
90
+ prompt: "Where would you like to deploy?\n\nYou're currently on branch: [current-branch]",
91
+ options: [
92
+ { id: "production", label: "Production — deploy to main branch (live site)" },
93
+ { id: "preview", label: "Preview — deploy to a branch (staging/test URL)" }
94
+ ]
95
+ }
96
+ ]
97
+ })
98
+ ```
99
+
100
+ Then follow the appropriate path below.
101
+
102
+ ---
103
+
104
+ ### Path A: Deploy to Production
105
+
106
+ The user wants to deploy to the main branch.
107
+
108
+ **If already on main:**
109
+
110
+ ```bash
111
+ git push origin main 2>&1
112
+ ```
113
+
114
+ **If the push is rejected:** Pull the latest changes first with `git pull --rebase origin main`, then try pushing again. If branch protection rules prevent direct pushes to main, the user will need to use the PR path instead.
115
+
116
+ **If on a feature branch:**
117
+
118
+ The user's changes need to get to main. Ask how:
119
+
120
+ ```
121
+ AskQuestion({
122
+ title: "Merge to Main",
123
+ questions: [
124
+ {
125
+ id: "merge-strategy",
126
+ prompt: "You're on branch [current-branch]. To deploy to production, your changes need to be on main.\n\nHow would you like to proceed?",
127
+ options: [
128
+ { id: "merge", label: "Merge [current-branch] into main and push" },
129
+ { id: "pr", label: "Create a pull request instead (I'll merge it myself)" }
130
+ ]
131
+ }
132
+ ]
133
+ })
134
+ ```
135
+
136
+ If "merge":
137
+
138
+ ```bash
139
+ git checkout main
140
+ git pull origin main
141
+ git merge [feature-branch] --no-edit
142
+ git push origin main
143
+ ```
144
+
145
+ If the merge has conflicts, stop and tell the user:
146
+
147
+ > There are merge conflicts that need to be resolved manually. After resolving them, commit the merge and run this command again.
148
+
149
+ **If the push is rejected:** Pull the latest changes with `git pull --rebase origin main` and try pushing again. If branch protection rules prevent direct pushes to main, the user will need to use the PR path instead.
150
+
151
+ If "pr":
152
+
153
+ First push the branch if needed:
154
+
155
+ ```bash
156
+ git push -u origin [feature-branch]
157
+ ```
158
+
159
+ Then create a PR:
160
+
161
+ ```bash
162
+ gh pr create --title "Deploy [feature-branch] to production" --body "$(cat <<'EOF'
163
+ [Summarize the actual changes — see below]
164
+ EOF
165
+ )"
166
+ ```
167
+
168
+ Before creating the PR, analyze the commits on the branch (using `git log main..[branch] --oneline`) and draft a meaningful PR description summarizing the changes, rather than using a generic message.
169
+
170
+ Return the PR URL and tell the user:
171
+
172
+ > Pull request created: [PR URL]
173
+ >
174
+ > Merge it on GitHub to trigger a production deployment. Vercel will auto-deploy when the merge lands on main.
175
+
176
+ Then stop — the deployment will happen automatically when they merge.
177
+
178
+ ---
179
+
180
+ ### Path B: Deploy to Preview (Branch)
181
+
182
+ The user wants a preview deployment on a branch.
183
+
184
+ **If already on a feature branch:**
185
+
186
+ Push the current branch:
187
+
188
+ ```bash
189
+ git push -u origin [current-branch] 2>&1
190
+ ```
191
+
192
+ **If the push is rejected:** Pull the latest changes with `git pull --rebase origin [current-branch]` and try pushing again. If there are rebase conflicts, stop and let the user resolve them.
193
+
194
+ **If on main:**
195
+
196
+ The user needs a branch. Ask for a name:
197
+
198
+ ```
199
+ AskQuestion({
200
+ title: "Branch Name",
201
+ questions: [
202
+ {
203
+ id: "branch-name",
204
+ prompt: "You're on main. To create a preview deployment, we need a branch.\n\nWhat would you like to call it? (e.g., 'dev', 'staging', 'leah/feature-x')",
205
+ options: [
206
+ { id: "dev", label: "dev" },
207
+ { id: "staging", label: "staging" },
208
+ { id: "custom", label: "I'll type a custom branch name" }
209
+ ]
210
+ }
211
+ ]
212
+ })
213
+ ```
214
+
215
+ If the user picks "custom", ask them to provide the branch name.
216
+
217
+ Create and push the branch:
218
+
219
+ ```bash
220
+ git checkout -b [branch-name]
221
+ git push -u origin [branch-name] 2>&1
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Step 4: Confirm Deployment
227
+
228
+ After pushing, Vercel's Git integration will automatically start a build. Monitor it:
229
+
230
+ ```bash
231
+ sleep 5
232
+ npx vercel ls 2>&1
233
+ ```
234
+
235
+ Look for the latest deployment matching the push. It may show status as `● Building` initially.
236
+
237
+ If the deployment is building, wait and poll:
238
+
239
+ ```bash
240
+ sleep 15
241
+ npx vercel ls 2>&1
242
+ ```
243
+
244
+ Keep polling (with increasing intervals: 15s, 30s, 30s) until the status changes to `● Ready` or shows an error. If the build hasn't completed after ~5 minutes of polling, provide the Vercel dashboard link and suggest the user check the build logs there.
245
+
246
+ **If status is `● Ready`:**
247
+
248
+ Get the deployment URL from the output. Then verify static assets are served correctly:
249
+
250
+ ```bash
251
+ curl -sI "https://<deployment-url>/_nuxt/<any-chunk>.js" | head -5
252
+ ```
253
+
254
+ Confirm `content-type: application/javascript`.
255
+
256
+ Present the result to the user:
257
+
258
+ > Deployment successful!
259
+ >
260
+ > **URL:** [deployment URL]
261
+ > **Environment:** [Production / Preview]
262
+ > **Branch:** [branch name]
263
+ >
264
+ > [If production and custom domain exists]: Also available at: [custom domain URL]
265
+
266
+ **If the build failed:**
267
+
268
+ Check the logs:
269
+
270
+ ```bash
271
+ npx vercel logs <deployment-url> 2>&1 | tail -30
272
+ ```
273
+
274
+ Common failures:
275
+
276
+ - **E401 npm install:** `NPM_TOKEN` not set for this environment. See `/vercel_setup` Step 1 (NPM Authentication).
277
+ - **Build error:** Show the user the relevant log lines and help them debug.
278
+ - **Missing env vars:** Env vars may not be set for the preview environment. See `/vercel_setup` Step 5 (Sync Environment Variables).