
Theme Rebase
Rebase all theme-* branches onto main, one commit per theme, preserving each theme's...
Install
npx skills add yournextstore/yournextstore --skill theme-rebase -g -a claude-code -y- Repository
- yournextstore/yournextstore5.5k
- Category
- AI and agents
- Updated
- 4d ago
- License
- MIT
- Context cost
- Lightabout 1,066 tokens
- Runs scripts
- Yes, review before use
What it does
Rebase all theme-* branches onto main, one commit per theme, preserving each theme's visual identity. A script does the mechanics and a headless agent resolves only what needs judgment; pushes with backup tags. Run as a scheduled task or one-off.
Rebase theme branches onto main
Each theme-* branch is one commit on top of main: the theme's own theme NNN: … commit (README, "Themes"). theme-rebase.sh rebuilds every theme that way on the current main. For each theme, in its own worktree, it:
- squash-merges the theme onto
main: one 3-way merge, however many commits the branch has; - settles what needs no judgment:
bun.lock,package.json, and every path only copied commits touched, which take main's side; then runs the codemods over the merged files and over both sides of each remaining conflict, so a rewrite main made everywhere stops conflicting with the theme's edits around it; - starts one headless Claude session for what is left, with rules.md as its instructions;
- runs
bun run checkandbun run build, resuming the session once on a failure; - commits with the theme commit's message and author, and sends anything doubtful to review.
Nothing leaves the machine until push.
Run it
S=.agents/skills/theme-rebase/theme-rebase.sh
bash $S run theme-002 theme-003 # or --all
bash $S push # the last run's ok themes, one at a time
bash $S clean [theme…] # drop leftover worktrees and theme-rebase/* branches
| Setting | Default | |
|---|---|---|
JOBS | 3 | themes in parallel |
AGENT | claude | none: stop at needs-agent instead of starting a session |
BUILD | 1 | 0 skips bun run build |
AGENT_BUDGET | 10 | USD cap per agent session |
AGENT_MODEL | claude-sonnet-5-5 | claude-opus-5-5 for a theme Sonnet got wrong |
The build reads live store data, so it needs YNS_API_KEY in .env. A free census of what a run would hit: AGENT=none BUILD=0 bash $S run --all.
Roll a large run out in batches of about 20: run, read the table, push, then the next batch. A scheduled run is run --all, then push, then the table as the report.

