Skip to content

Commit 2d7a3de

Browse files
authored
chore: upgrade node to 24 and fix client's supabase startup (#367)
1 parent 5635d40 commit 2d7a3de

File tree

17 files changed

+435
-266
lines changed

17 files changed

+435
-266
lines changed

.claude/skills/restack/SKILL.md

Lines changed: 36 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -1,221 +1,65 @@
1-
# Restack
2-
3-
Use when user asks to "restack", "resolve conflicts", "gt restack", or mentions restack conflicts. Guides through gt restack conflicts with intelligent diagnostics and resolution. (project)
1+
---
2+
name: restack
3+
description: Use when user asks to "restack", "resolve conflicts", "gt restack", or mentions restack conflicts. Guides through gt restack conflicts with intelligent diagnostics and resolution.
4+
allowed-tools: Bash(gt restack:*), Bash(gt continue:*), Bash(git show:*), Bash(git diff:*), Bash(git log:*), Bash(git ls-tree:*), Bash(pnpm install:*), Bash(git status:*), Bash(gt log:*), Bash(rm pnpm-lock.yaml), Bash(gt add -A:*), Bash(git checkout --theirs:*), Bash(git checkout --ours:*)
5+
---
46

57
<critical>
6-
- ALWAYS check current state first (supports both: starting fresh or mid-conflict)
7-
- If already in conflict, skip running gt restack and go straight to resolution
8-
- Differentiate simple (lockfile-only) vs complex (multi-file) conflicts
8+
- Analyze embedded state below before acting
9+
- If conflict shown, skip gt restack and route immediately
910
- Loop until restack completes successfully
10-
- Use AskUserQuestion for confirmations and choices
11+
- Use AskUserQuestion for all confirmations
1112
</critical>
1213

13-
## Workflow
14+
## Current State
1415

15-
### 1. Detect Current State
16+
**Repository status:**
17+
!`git --no-pager -c color.ui=false status`
1618

17-
First, check if restack is already in progress:
19+
**Current stack:**
20+
!`gt --no-color log short --stack`
1821

19-
```bash
20-
git status
21-
```
22+
## Workflow
2223

23-
**Check for**:
24-
- "rebase in progress"
25-
- "You are currently rebasing"
26-
- "Unmerged paths"
27-
- "both modified:" or other conflict indicators
24+
### 1. Analyze State
2825

29-
**Outcomes**:
30-
- Already in conflict (user ran `gt restack` manually) → Skip to step 3 (Gather Diagnostics)
31-
- Clean state → Proceed to step 2 (Run Restack)
26+
Check `git status` output above:
27+
- **"rebase in progress"** or **"Unmerged paths"** → Already in conflict, skip to step 3
28+
- **Clean working tree** → Proceed to step 2
3229

33-
### 2. Run Restack (if not already in progress)
30+
### 2. Run Restack (if clean state)
3431

3532
```bash
3633
gt restack
3734
```
3835

39-
**Outcomes**:
40-
- Success → Acknowledge and exit
41-
- Conflicts → Proceed to step 3
42-
43-
### 3. Gather Diagnostics
44-
45-
When conflicts are detected (either from step 1 or step 2), run:
46-
47-
```bash
48-
# Check which files are conflicted
49-
git status
50-
51-
# Show stack structure (where conflict occurred)
52-
gt log short
53-
54-
# Check for broken lockfile warning
55-
pnpm install --dry-run 2>&1 | grep -i "broken\|duplicated\|ignoring"
56-
57-
# For each conflicted file, show diff
58-
git diff <file>
59-
```
60-
61-
### 3. Explain Conflict Type
62-
63-
**Simple conflict** (lockfile-only):
64-
- Only `pnpm-lock.yaml` in unmerged files
65-
- Explain: Lockfile is generated content, safe to regenerate
66-
- Propose: `pnpm install && gt add -A && gt continue`
67-
68-
**Complex conflict** (multi-file):
69-
- Multiple files in unmerged files
70-
- Explain each file's conflict
71-
- Guide through resolution strategy
72-
73-
### 4. Resolve Based on Type
74-
75-
#### Simple Conflict Resolution
76-
77-
Use AskUserQuestion:
78-
```
79-
question: "Only pnpm-lock.yaml is conflicted. Regenerate and continue?"
80-
header: "Simple Resolution"
81-
options:
82-
- label: "Yes, run one-liner"
83-
description: "pnpm install && gt add -A && gt continue"
84-
- label: "Let me inspect first"
85-
description: "Show git diff pnpm-lock.yaml before proceeding"
86-
```
87-
88-
If confirmed → Execute → Check output of `gt continue`:
89-
- Another conflict → Loop back to step 3 (Gather Diagnostics)
90-
- Success message → Proceed to step 6 (Success & Reminder)
36+
**Outcomes:**
37+
- **Success** → Acknowledge and skip to step 4
38+
- **Conflicts** → Proceed to step 3
9139

92-
#### Complex Conflict Resolution
40+
### 3. Route by Conflict Type
9341

94-
For each non-lockfile conflict:
42+
Analyze conflicted files from status above:
9543

96-
**a) Show the conflict**:
97-
```bash
98-
git diff <file>
99-
```
100-
101-
**b) Explain the conflict** (extract from diff):
102-
- What changed in base (HEAD)
103-
- What changed in branch (incoming)
104-
- Why it conflicts
44+
**Only pnpm-lock.yaml conflicted?**
45+
→ See [lockfile-conflict.md](lockfile-conflict.md)
10546

106-
**c) Ask resolution strategy** using AskUserQuestion:
107-
```
108-
question: "How to resolve <file>?"
109-
header: "Resolution"
110-
options:
111-
- label: "--theirs (main's version)"
112-
description: "Accept base branch - good for style/formatting consistency"
113-
- label: "--ours (branch's version)"
114-
description: "Keep your branch changes - good for features/dependencies"
115-
- label: "Manual edit"
116-
description: "I'll resolve it manually, just continue after I'm done"
117-
- label: "Show original file"
118-
description: "Show git show HEAD:<file> and git show :<stage>:<file> to inspect"
119-
```
47+
**Multiple files conflicted?**
48+
→ See [complex-conflict.md](complex-conflict.md)
12049

121-
**d) Execute choice**:
122-
- `--theirs`: `git checkout --theirs <file>`
123-
- `--ours`: `git checkout --ours <file>`
124-
- Manual: Wait for user confirmation
125-
- Show original: Display and ask again
126-
127-
**e) After all non-lockfile conflicts resolved**:
128-
```bash
129-
pnpm install && gt add -A && gt continue
130-
```
50+
**Unexpected errors or state?**
51+
→ See [troubleshooting.md](troubleshooting.md)
13152

132-
**f) Check output of `gt continue`**:
133-
- Another conflict → Loop back to step 3 (Gather Diagnostics)
134-
- Success message → Proceed to step 6 (Success & Reminder)
53+
### 4. Success
13554

136-
### 5. Handle Broken Lockfile
137-
138-
If diagnostics show "broken lockfile" warning:
139-
140-
Use AskUserQuestion:
141-
```
142-
question: "Lockfile is corrupted. Delete and regenerate?"
143-
header: "Broken Lockfile"
144-
options:
145-
- label: "Yes, delete and regenerate"
146-
description: "rm pnpm-lock.yaml && pnpm install && gt add -A && gt continue"
147-
- label: "Try pnpm install first"
148-
description: "pnpm might auto-fix, try without deleting first"
149-
```
150-
151-
After executing choice, check output of command:
152-
- Another conflict → Loop back to step 3 (Gather Diagnostics)
153-
- Success message → Proceed to step 6 (Success & Reminder)
154-
155-
### 6. Success & Reminder
156-
157-
When `gt restack` completes without conflicts:
158-
159-
```
16055
Restack completed successfully!
16156

162-
Next step: Force push your stack
163-
gt stack submit --force
164-
# Or individual branch:
165-
git push --force-with-lease origin <branch-name>
166-
167-
Note: Always use --force-with-lease for safety
168-
```
169-
170-
## Quick Reference
171-
172-
**Simple lockfile conflict**:
173-
```bash
174-
pnpm install && gt add -A && gt continue
175-
```
57+
**Next step:** Force push your stack
17658

177-
**Multiple files conflicted**:
17859
```bash
179-
git diff <file> # Inspect
180-
git checkout --ours/--theirs <file> # Resolve
181-
pnpm install && gt add -A && gt continue
60+
gt stack submit --force
61+
# Or individual branch:
62+
git push --force-with-lease origin <branch-name>
18263
```
18364

184-
**Broken lockfile**:
185-
```bash
186-
rm pnpm-lock.yaml
187-
pnpm install && gt add -A && gt continue
188-
```
189-
190-
**Cancel restack**:
191-
```bash
192-
gt abort
193-
```
194-
195-
## Resolution Strategy Guide
196-
197-
**When to use `--theirs` (accept main's version)**:
198-
- Style/formatting conflicts (e.g., quoted vs unquoted YAML)
199-
- Configuration files where consistency with main matters
200-
- Files you didn't intentionally change
201-
202-
**When to use `--ours` (keep branch's version)**:
203-
- Your branch added dependencies (e.g., pnpm-workspace.yaml)
204-
- Feature changes you need to preserve
205-
- Files where your changes are the whole point
206-
207-
**Rule of thumb**: When in doubt, choose consistency with main (`--theirs`).
208-
209-
## Troubleshooting
210-
211-
**Problem**: `gt continue` fails with error
212-
**Solution**: Check `git status` for unresolved conflicts or unstaged files
213-
214-
**Problem**: pnpm install shows warnings about bin files
215-
**Solution**: Usually safe to ignore - supabase CLI has known installation quirks
216-
217-
**Problem**: Not sure whether to use --ours or --theirs
218-
**Solution**: Skill will show both versions and explain - use AskUserQuestion to decide
219-
220-
**Problem**: Multiple files conflicted, unclear which to resolve first
221-
**Solution**: Skill resolves non-lockfiles first, then regenerates lockfile last
65+
**Note:** Always use `--force-with-lease` for safety
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Multi-File Conflict Resolution
2+
3+
Multiple files are conflicted. Resolve non-lockfiles first, then regenerate lockfile.
4+
5+
## Conflicted Files
6+
7+
!`git --no-pager -c color.ui=false diff --name-only --diff-filter=U --no-renames`
8+
9+
## Resolution Strategy
10+
11+
For each non-lockfile conflict:
12+
13+
### 1. Show the conflict
14+
15+
```bash
16+
git --no-pager -c color.ui=false diff <file>
17+
```
18+
19+
### 2. Explain conflict
20+
21+
Extract from diff:
22+
- What changed in base (HEAD)
23+
- What changed in branch (incoming)
24+
- Why it conflicts
25+
26+
### 3. Ask resolution via AskUserQuestion
27+
28+
```
29+
question: "How to resolve <file>?"
30+
header: "Resolution"
31+
options:
32+
- label: "--theirs (main's version)"
33+
description: "Accept base branch - good for style/formatting consistency"
34+
- label: "--ours (branch's version)"
35+
description: "Keep your branch changes - good for features/dependencies"
36+
- label: "Manual edit"
37+
description: "I'll resolve manually, continue after I'm done"
38+
- label: "Show context"
39+
description: "Show git show HEAD:<file> to inspect"
40+
```
41+
42+
### 4. Execute choice
43+
44+
```bash
45+
# --theirs
46+
git checkout --theirs <file>
47+
48+
# --ours
49+
git checkout --ours <file>
50+
51+
# Manual: Wait for user confirmation
52+
```
53+
54+
## After All Non-Lockfiles Resolved
55+
56+
Regenerate lockfile and continue:
57+
58+
```bash
59+
pnpm install && gt add -A && gt continue
60+
```
61+
62+
## Check Result
63+
64+
After `gt continue`:
65+
- **Another conflict** → Loop back (return to SKILL.md routing)
66+
- **Success** → Proceed to success message in SKILL.md
67+
68+
## Resolution Guidelines
69+
70+
**Use `--theirs` (main's version) for:**
71+
- Style/formatting conflicts (e.g., quoted vs unquoted YAML)
72+
- Configuration files where consistency with main matters
73+
- Files you didn't intentionally change
74+
75+
**Use `--ours` (branch's version) for:**
76+
- Your branch added dependencies (e.g., pnpm-workspace.yaml)
77+
- Feature changes you need to preserve
78+
- Files where your changes are the whole point
79+
80+
**Rule of thumb:** When in doubt, choose consistency with main (`--theirs`).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Lockfile-Only Conflict Resolution
2+
3+
Simple case: Only `pnpm-lock.yaml` is conflicted. Lockfile is generated content, safe to regenerate.
4+
5+
## Resolution
6+
7+
Use AskUserQuestion:
8+
9+
```
10+
question: "Only pnpm-lock.yaml is conflicted. Regenerate and continue?"
11+
header: "Simple Resolution"
12+
options:
13+
- label: "Yes, regenerate"
14+
description: "pnpm install && gt add -A && gt continue"
15+
- label: "Inspect first"
16+
description: "Show git diff pnpm-lock.yaml before proceeding"
17+
```
18+
19+
If confirmed, execute:
20+
21+
```bash
22+
pnpm install && gt add -A && gt continue
23+
```
24+
25+
## Check Result
26+
27+
After `gt continue`:
28+
- **Another conflict** → Return to SKILL.md routing
29+
- **Success** → Proceed to success message in SKILL.md
30+
31+
## Broken Lockfile
32+
33+
If `pnpm install` shows "broken lockfile" warnings, ask:
34+
35+
```
36+
question: "Lockfile corrupted. Delete and regenerate?"
37+
header: "Broken Lockfile"
38+
options:
39+
- label: "Yes, delete"
40+
description: "rm pnpm-lock.yaml && pnpm install && gt add -A && gt continue"
41+
- label: "Try auto-fix"
42+
description: "pnpm install might auto-fix without deleting"
43+
```

0 commit comments

Comments
 (0)