CodeMie Pull Request Workflow
Instructions
- Check Current State
Always start by checking git status:
Current branch
git branch --show-current
Uncommitted changes
git status --short
Existing PR for current branch
gh pr list --head $(git branch --show-current) 2>/dev/null || echo "No PR"
- Handle Based on User Request
"commit changes" → Commit only:
git add . git commit -m "<type>(<scope>): <description>"
"push changes" → Push only:
git push origin $(git branch --show-current)
"create PR" → Full workflow below.
- Create PR Workflow
If on main branch:
-
Create feature branch first: git checkout -b <type>/<description>
-
Then proceed with commit/push/PR
If PR already exists:
git push origin $(git branch --show-current)
Inform: "Changes pushed to existing PR: <url>"
If no PR exists:
Push changes
git push origin $(git branch --show-current)
Create PR - read .github/PULL_REQUEST_TEMPLATE.md for structure
gh pr create
--title "<type>(<scope>): brief description"
--body "$(cat <<'EOF'
[Fill template from .github/PULL_REQUEST_TEMPLATE.md]
EOF
)"
Template location: .github/PULL_REQUEST_TEMPLATE.md
Read the template file and fill all sections based on commits and changes.
Commit Format
Pattern: <type>(<scope>): <subject>
Types:
-
feat : New feature
-
fix : Bug fix
-
docs : Documentation
-
refactor : Code refactoring
-
test : Tests
-
chore : Maintenance
Scopes (optional): cli , agents , providers , config , workflows , utils , deps
Examples:
git commit -m "feat(agents): add Gemini plugin support" git commit -m "fix: resolve npm timeout issues" git commit -m "docs(readme): update installation steps"
Branch Format
Pattern: <type>/<description>
Examples:
-
feat/add-gemini-support
-
fix/npm-install-error
-
docs/update-readme
Troubleshooting
Error: "gh: command not found"
Solution: Create PR manually at:
https://github.com/codemie-ai/codemie-code/compare/main...<branch>?expand=1
Use structure from .github/PULL_REQUEST_TEMPLATE.md for PR body.
Error: Already on main branch
Solution: Create feature branch first:
git checkout -b <type>/<short-description>
Error: No changes to commit
Solution: Check git status
- nothing to commit or changes already staged.
PR already exists
Action: Just push updates to existing PR, don't create new one.
Examples
User: "commit the auth changes"
git add . git commit -m "feat(auth): add OAuth2 support"
User: "push and create PR"
-
Check for existing PR
-
If none: Read .github/PULL_REQUEST_TEMPLATE.md , fill sections, create PR
-
If exists: Push to existing PR
User: "create PR for the bug fix"
-
Verify not on main
-
Push changes
-
Read template, create PR with fix(...) title