agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…
fix drizzle migrations after rebasing onto upstream/main when migrations diverged
$ npx -y skills add humanlayer/humanlayer --skill rebase-drizzle-migration --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/rebase-drizzle-migrationContext preview
The summary Claude sees to decide when to auto-load this skill.
fix drizzle migrations after rebasing onto upstream/main when migrations diverged
name: rebase-drizzle-migration description: fix drizzle migrations after rebasing onto upstream/main when migrations diverged
Guide the user through recovering from a messy drizzle migration state after rebasing onto upstream/main.
1. **Diagnose** - Analyze the current state and identify what's wrong 2. **Explain** - Tell the user what happened and why 3. **Fix** - Run the necessary commands to fix the migration state 4. **Verify** - Check results after each step
When this skill is invoked, first diagnose the problem:
# Check for duplicate journal entries cat packages/db/drizzle/meta/_journal.json | tail -30 # List migration files ls packages/db/drizzle/*.sql # Check diff against upstream git diff upstream/main --stat -- packages/db/ # Check what upstream has git show upstream/main:packages/db/drizzle/meta/_journal.json | tail -20 # Find the merge base git merge-base HEAD upstream/main
Look for:
Drizzle migrations are sequential and tracked in `packages/db/drizzle/meta/_journal.json`. The issue occurs when: 1. You branched off main at migration `0008` 2. You added your own migration `0009` (or overwrote `0008`) 3. Meanwhile, upstream added their own `0009` 4. You rebased onto upstream
This results in:
---
Switch to upstream/main to get a clean database state:
git checkout upstream/main
---
Run the migration command:
bun --bun --cwd packages/db drizzle-kit migrate
---
Switch back to the feature branch:
git checkout <branch-name>
---
Run cleanup commands:
# Identify what needs cleanup by checking diff git diff upstream/main --stat -- packages/db/drizzle/ # Check current journal state cat packages/db/drizzle/meta/_journal.json | tail -20
Then perform cleanup:
---
Run verification:
git diff upstream/main --stat -- packages/db/
The diff should now show ONLY schema file changes (e.g., `sessions.ts`), not migration files.
---
Ask the user (DO NOT DO THIS YOURSELF UNLESS YOU ARE ASKED TO DO SO) to reset the database state to the upstream/main state.
# reset the database volumes docker compose down -v && docker compose up -d # then seed the existing migrations bun --bun --cwd packages/db drizzle-kit migrate
This will delete all data in the local database and re-apply the upstream migrations.
---
Generate a fresh migration for the schema changes:
bun run db:migrations:generate
This should create a new migration file (e.g., `0010_something.sql`) with just the changes.
---
Apply the new migration to the local database:
bun --bun --cwd packages/db drizzle-kit migrate
---
After migration succeeds, verify:
# Check the final diff git diff upstream/main --stat -- packages/db/ # Run typecheck bun run typecheck # Run tests bun --bun run test
The diff should show:
The schema doesn't match what drizzle expects. Check if:
Fix: `git checkout upstream/main -- packages/db/src/tables/<file>.ts` for files you didn't intend to modify.
The checkout didn't work or there are staged changes. Run:
git checkout upstream/main -- packages/db/drizzle/meta/_journal.json
Run migrate on upstream/main again, then switch back to branch.
# All commands are non-interactive and safe for agent to run: git diff upstream/main --stat -- packages/db/ git show upstream/main:packages/db/drizzle/meta/_journal.json cat packages/db/drizzle/meta/_journal.json ls packages/db/drizzle/*.sql git checkout upstream/main -- <file> # restore specific file rm packages/db/drizzle/0010_*.sql # cleanup bun run db:migrations:generate bun --bun --cwd packages/db drizzle-kit migrate
HumanLayer runs coding agents (Claude Code, Codex, OpenCode, Pi) on your machines and lets your team steer them from one place: tasks, sessions, plans, and reviews, synced between a desktop app, a web app, and a daemon on each host. This repo holds all of it.
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…
Rewrites ambiguous English into ASD-STE100 style — one meaning per word, active voice, simple tense, short sentences. Use when…
Use for 1) inspecting PR state, 2) reading review threads, or 3) debugging CI failures. Otherwise use the gh CLI.
Bump the base version of one or more packages (riptide-native, cli, linear-cli, rpi-plugin) on a PR - updates every synced file,…
Diff call stacks across git commits for agentic code review (22 languages). Run `calldiff --help` for usage details.
Use this to skill to write shell scripts or run shell commands to automate tasks in the browser or otherwise use Chrome DevTools…