GitHub Integration
How Clotion creates and manages pull requests
GitHub Integration
Clotion automatically creates pull requests when Claude completes a task. This guide explains how PR creation works and how to customize it.
How PRs Are Created
When Claude outputs TASK_COMPLETE:
- Push branch to origin
- Create PR via GitHub CLI
- Link to Notion card (via PR URL property)
- Update Notion status to "In Review"
PR Format
Title
feat(CLO-123): Add user authentication
Format: {type}({clotion-id}): {card title}
Types are inferred from the task:
feat- New featuresfix- Bug fixesrefactor- Code refactoringdocs- Documentationtest- Test additions
Body
## Summary
Implements user authentication for the API.
## Notion Card
CLO-123
## Changes
- Added JWT token generation
- Created login/logout endpoints
- Added password hashing
---
Generated by Clotion
GitHub CLI Authentication
Clotion uses gh for PR creation. Ensure it's authenticated:
gh auth status
If not authenticated:
gh auth login
Select:
- GitHub.com
- HTTPS
- Authenticate with browser
Repository Setup
Remote Configuration
Your repo needs an origin remote:
git remote -v
# origin git@github.com:user/repo.git (fetch)
# origin git@github.com:user/repo.git (push)
Branch Protection
If your main branch has protection rules:
- Required reviews: PRs will wait for review
- Required checks: CI must pass
- No force push: Already compatible
Clotion respects all branch protection rules.
Customization
Base Branch
By default, PRs target main. To change:
# In .env
BASE_BRANCH=develop
PR Template
Clotion uses a built-in template. Custom templates coming soon.
Auto-Merge
When you move a Notion card to "Done":
- Clotion checks PR status
- If all checks pass, merges via
gh pr merge - Cleans up worktree and branch
Merge Strategy
Default: Squash merge
gh pr merge --squash
This keeps your main branch history clean.
Notion Updates
When a PR is created, these Notion properties update:
| Property | Value |
|---|---|
| Status | In Review |
| PR URL | GitHub PR link |
| Current Status | "PR created" |
| Branch | Branch name |
This lets you:
- Click directly to the PR from Notion
- See PR status at a glance
- Track which branch corresponds to which task
Troubleshooting
PR Creation Fails
Check GitHub CLI:
gh auth status
Check remote access:
git push origin HEAD --dry-run
Check permissions:
- You need write access to the repo
- GitHub CLI needs repo scope
Wrong Base Branch
If PR targets wrong branch:
- Close the PR
- Update
BASE_BRANCHin.env - Retry the task
CI Failures
If CI fails on the PR:
- Review the failure
- Add a comment on the Notion card
- Claude will see your feedback and fix
PR URL Not Updating in Notion
If the PR is created but Notion doesn't update:
- Check Clotion logs for errors
- Verify Notion integration has write access
- The property might need to be created first (restart Clotion)