main is the stable branch.
Protected Branch Rules (enforced by GitHub):
- 🔒 Direct pushes are BLOCKED — All changes must go through Pull Request
- ✅ Pull Request required — At least 1 approval needed
- 🔄 Linear history — No merge commits, use squash or rebase
- 💬 Conversation resolution — All discussions must be resolved before merge
⚠️ Administrators included — Even admins must follow PR process
Additional Rules:
- Never commit feature work directly to
main. mainshould always represent a buildable and stable state.- Only merge completed, reviewed, and verified changes into
main.
Why This Matters:
- Ensures all changes are reviewed
- Maintains clean commit history
- Protects against accidental pushes
- Creates audit trail for all modifications
All work must happen on dedicated branches.
Branch naming convention:
feature/<short-description>
fix/<short-description>
docs/<short-description>
refactor/<short-description>
Examples:
feature/project-foundation
feature/tauri-foundation
feature/agent-runtime
feature/artifact-system
feature/research-workspace
fix/ipc-connection-error
fix/sqlite-migration-issue
docs/update-architecture
refactor/rust-error-handling
Use Conventional Commits:
<type>: <description>
Allowed types:
feat New feature
fix Bug fix
docs Documentation only
refactor Code change that neither fixes a bug nor adds a feature
test Adding or updating tests
chore Build process, tooling, or auxiliary changes
perf Performance improvement
build Build system or external dependencies
ci CI configuration
Good examples:
feat: add react application shell
feat: add rust ipc commands
chore: initialize tauri desktop application
chore: initialize sqlite migration system
docs: update architecture documentation
test: add ipc integration tests
fix: resolve sqlite migration startup failure
Avoid:
update files
changes
fix stuff
work in progress
asdf
Before every commit, run relevant checks:
Frontend changes:
pnpm lint
pnpm typecheck
pnpm testRust changes:
cargo fmt
cargo clippy
cargo testDo not commit known broken code unless explicitly requested.
Create a commit when:
- A complete milestone is finished — after verifying the application works.
- A logical subsystem is complete — frontend API layer, Rust IPC layer, SQLite setup, etc.
- Before risky changes — large refactors, dependency upgrades, architecture changes.
Preferred frequency:
- Several meaningful commits per phase.
- Each commit should leave the repository buildable whenever practical.
Avoid:
- One giant commit after many unrelated changes.
- Hundreds of tiny commits for trivial edits.
Every PR should be minimal, focused, and reviewable.
See PR_BEST_PRACTICES.md for detailed guidelines.
Key Rules:
- Single Purpose: Each PR solves ONE problem
- Under 800 Lines: PR should be reviewable in < 60 minutes
- Related Changes: All changes should belong together
- Clear Scope: Document what's included and excluded
For large features, use sub-branches:
feature/agent-runtime (Parent)
├── feature/agent-runtime/domain (Sub-branch 1)
├── feature/agent-runtime/runtime (Sub-branch 2)
└── feature/agent-runtime/tests (Sub-branch 3)
Sub-Branch Rules:
- Sub-branch PRs merge to parent branch (not directly to main)
- Sub-branch PRs still require review
- After all sub-branches merged, parent PR merges to main
- Maintains linear history on parent
When a feature is complete:
- Verify the branch.
- Run all relevant checks.
- Review changed files.
- Update documentation if architecture changed.
- Create a Pull Request.
PR description should include:
## Summary
What changed (2-3 sentences).
## Scope
**Included:**
- What's in this PR
**NOT Included:**
- What's in separate PRs
## Testing
Commands executed and results.
## Checklist
- [ ] All checks pass
- [ ] Tests written
- [ ] Docs updatedNever execute without explicit user permission:
git reset --hard
git clean -fd
git push --force
git branch -D
git rebase mainNever delete user changes. Never overwrite uncommitted work.
- PR_BEST_PRACTICES.md — Detailed PR guidelines
- CONTRIBUTING.md — Contribution workflow