name: upgrade-examples description: This skill should be used when upgrading the cocoindex package version in all example pyproject.toml files. It uses regex-based sed commands to efficiently update version constraints across multiple files at once.
Upgrade Example Dependencies
Upgrade the cocoindex version in all example pyproject.toml files.
Usage
/upgrade-examples <version>
Example: /upgrade-examples 1.0.0a5
Instructions
To upgrade all example dependencies (replace VERSION with the actual version, e.g., 1.0.0a10):
- Create a new branch for the changes:
git checkout -b ex-dep-VERSION
- Run the following command to update all example pyproject.toml files.
Important: Use the literal version string directly in the sed command. Do not use shell variables as quoting issues can cause the version to be omitted.
find examples -name "pyproject.toml" -not -path "*/.venv/*" -exec grep -l "cocoindex" {} \; | xargs sed -i '' 's/cocoindex\([^>]*\)>=[0-9][0-9a-zA-Z.]*/cocoindex\1>=VERSION/g'
- Verify the changes show the correct version:
grep -r "cocoindex.*>=" examples --include="pyproject.toml" | grep -v ".venv"
- Commit and push the changes:
git add examples/*/pyproject.toml
git commit -m "chore: upgrade examples deps to cocoindex-VERSION"
git push -u origin ex-dep-VERSION
- Create a PR using the
ghCLI and capture the PR URL from its output:
gh pr create --base v1 --title "chore: upgrade examples deps to cocoindex-VERSION" --body ""
- Switch back to the previous branch and delete the local branch:
git checkout v1
git branch -d ex-dep-VERSION
- Report the number of files updated and provide the PR link from the
gh pr createoutput to the user.