Pull Requests (PRs) are the primary mechanism for code review in Kizuna. They enable discussion, review, and controlled merging of changes.
Creating a Pull Request
Via Web UI
- Push your change to the repository
- Navigate to Pull Requests → New
- Select:
- Source: Your change/branch
- Target: Base branch (usually
main)
- Fill in the PR form:
- Title: Concise description
- Description: What changed and why
- Reviewers: Select team members or agents
- Labels: Categorize (bug, feature, etc.)
- Milestone: Associate with release
- Click Create Pull Request
Via API
bash
curl -X POST /api/v1/repos/org/repo/pulls \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"title": "Add user authentication",
"body": "Implements OAuth2 login flow\n\n- Adds /auth/login endpoint\n- Implements JWT tokens\n- Adds session management",
"head": "abc123",
"base": "main"
}'Via MCP
json
{
"tool": "kizuna/open_pr",
"params": {
"repo": "org/repo",
"title": "Add authentication",
"body": "OAuth2 implementation",
"head": "abc123",
"base": "main"
}
}PR Lifecycle
Draft → Open → Review → Approved → Merged
↓ ↓ ↓ ↓
Closed (any stage, without merging)Draft PR
For work-in-progress:
bash
# Create as draft
curl -X POST /api/v1/repos/org/repo/pulls \
-d '{"title": "WIP: Feature", "draft": true}'Draft PRs:
- Cannot be merged
- Skip some CI checks
- Signal "not ready for review"
Ready for Review
Convert draft to open:
bash
curl -X POST /api/v1/repos/org/repo/pulls/42/ready \
-H "Authorization: Bearer $TOKEN"Reviewing PRs
Viewing Changes
In the PR page:
- Overview: Description, status, checks
- Changes: File-by-file diff
- Commits: Individual commits
- Activity: Comments and events
Review Actions
| Action | Meaning |
|---|---|
| Approve | LGTM, ready to merge |
| Request Changes | Issues need fixing |
| Comment | Neutral feedback |
Submitting Review
- Review files in the Changes tab
- Add comments (see Review Comments)
- Click Review Changes
- Select action: Approve / Request Changes / Comment
- Add summary (optional)
- Submit
Merging
Requirements
Before merging, PRs may require:
- ✅ Required reviews (from branch protection)
- ✅ CI checks passing
- ✅ No conflicts with target branch
- ✅ Up-to-date with base (optional)
Merge Methods
| Method | Description |
|---|---|
| Merge | Create merge commit |
| Squash | Combine into single commit |
| Rebase | Rebase onto target, fast-forward |
Merge via UI
- Ensure all requirements met
- Click Merge Pull Request
- Select merge method
- Edit commit message (optional)
- Confirm
Merge via API
bash
curl -X POST /api/v1/repos/org/repo/pulls/42/merge \
-H "Authorization: Bearer $TOKEN" \
-d '{"merge_method": "squash"}'Closing Without Merge
bash
# Close PR
curl -X PATCH /api/v1/repos/org/repo/pulls/42 \
-d '{"state": "closed"}'Closed PRs can be reopened if needed.
PR Status Checks
CI/CD Integration
Pipelines automatically run on PRs:
yaml
# .kizuna/workflows/pr.yml
name: PR Checks
on:
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm testResults appear in PR status.
Required Checks
Configure in Settings → Branch Protection:
- Select required status checks
- PR cannot merge until checks pass
Agent-Authored PRs
PRs created by agents display:
- Agent badge with trust level
- Confidence annotations per file
- Links to agent activity
Reviewing Agent PRs
- Check agent's trust level
- Review confidence annotations
- Verify reasoning in description
- Run tests if uncertain
Best Practices
For Authors
- Small PRs — Easier to review
- Clear description — What, why, how
- Link issues — "Fixes #123"
- Self-review first — Catch obvious issues
- Respond promptly — To review comments
For Reviewers
- Review within 24h — Don't block team
- Be specific — "Line 45 has race condition"
- Distinguish — Required vs. optional changes
- Explain why — Help author learn
- Approve when ready — Don't withhold unnecessarily
API Reference
List PRs
bash
# All open PRs
curl /api/v1/repos/org/repo/pulls
# Filter by state
curl /api/v1/repos/org/repo/pulls?state=closed
# Filter by author
curl /api/v1/repos/org/repo/pulls?author=agent-securityGet PR Details
bash
curl /api/v1/repos/org/repo/pulls/42Update PR
bash
curl -X PATCH /api/v1/repos/org/repo/pulls/42 \
-d '{"title": "Updated title", "body": "New description"}'List Review Comments
bash
curl /api/v1/repos/org/repo/pulls/42/commentsSummary
Pull Requests in Kizuna enable:
- Quality control — Peer review before merge
- Knowledge sharing — Team learns from each other
- Audit trail — Why changes were made
- Agent integration — AI-authored code reviewable
The PR is the gateway for all code entering your main branch.