| name | generate_and_merge |
| description | Build Jupyter notebooks and the LLM catalogue (llms-full.txt + workspace_index.json) from scripts, commit, push, raise a PR to main, merge it, then return to main locally. |
Build notebooks for the autogalaxy_workspace, then open and merge a PR into main, and return to main locally.
Steps
-
Check git state
Run git status and git branch to confirm the working tree state and current branch. If there are uncommitted changes outside notebooks/, stop and tell the user.
-
Create a working branch
Create and check out a new branch named notebooks-update-<YYYY-MM-DD> (use today's date). If the branch already exists, check it out.
-
Generate notebooks and the LLM catalogue
Run from the workspace root (PyAutoHands is PyAutoLabs/PyAutoHands, cloned as a sibling at ../PyAutoHands):
PYTHONPATH=../PyAutoHands/autobuild python3 ../PyAutoHands/autobuild/generate.py autogalaxy
This regenerates all notebooks in notebooks/ from scripts/. It may take a few minutes. The same
run also (re)writes the LLM-facing catalogue at the workspace root — llms-full.txt and
workspace_index.json — from the script docstrings, so they cannot drift from the scripts. The
curated llms.txt is hand-maintained and is never written by the generator; leave it untouched.
-
Commit the generated notebooks and catalogue
Stage all changes under notebooks/, any root-level *.ipynb files, and the generated catalogue
artifacts (by filename), then commit:
git add notebooks/ start_here.ipynb llms-full.txt workspace_index.json
git commit -m "Build notebooks and LLM catalogue from scripts"
If there is nothing to commit (everything already up to date), tell the user and stop.
-
Push the branch
git push -u origin <branch-name>
-
Open a PR into main
Use the gh CLI to create a pull request targeting main (NOT release):
gh pr create --base main --title "Update notebooks" --body "Regenerated notebooks from scripts using generate.py."
-
Merge the PR
Merge with a merge commit (not squash, not rebase) and delete the remote branch after:
gh pr merge --merge --delete-branch
-
Return to main locally
Check out main and pull the merged changes so the local branch is up to date:
git checkout main
git pull origin main
-
Confirm success
Run git log --oneline -5 to confirm the merge commit is present on main. Report the PR URL and merge commit to the user.