Add Trunk-Based Development workflow documentation to CLAUDE.md

This commit is contained in:
Dan 2025-10-26 15:21:14 -07:00
parent 2dfe4ea829
commit fb27e5b709

View file

@ -129,6 +129,75 @@ ssh root@45.77.205.49 'sudo -u postgres pg_dump mautrix_slack' > backup.sql
6. Test functionality 6. Test functionality
7. Monitor for stability 7. Monitor for stability
## Git Workflow
This project uses **Trunk-Based Development** for simplified collaboration and deployment.
### Branch Strategy
- **main**: Single long-lived branch, always deployable
- **Feature branches**: Short-lived (hours to days), naming: `###-feature-name`
- **No long-lived branches**: Feature branches merge or delete quickly
### Feature Development Workflow
```bash
# 1. Start feature from latest main
git checkout main
git pull origin main
git checkout -b 003-feature-name
# 2. Develop with frequent commits
# Make changes, commit often with clear messages
# 3. Keep main in sync (if feature takes >1 day)
git checkout main
git pull origin main
git checkout 003-feature-name
git rebase main
# 4. When feature complete, merge to main
git checkout main
git merge 003-feature-name # Fast-forward merge preferred
# 5. Tag release if deploying
git tag -a v0.3.0 -m "Release notes..."
git push origin main --tags
# 6. Delete feature branch
git branch -d 003-feature-name
```
### Release Tagging
- **Version scheme**: v0.MINOR.PATCH (semver-like)
- **When to tag**: After completing and merging a feature
- **Tag format**: Annotated tags with comprehensive release notes
- **Example**:
```bash
git tag -a v0.3.0 -m "Release v0.3.0: Feature Description
- Key changes
- Architecture updates
- Known issues
"
```
### Branch Naming Convention
- Format: `###-short-description`
- Examples: `002-slack-bridge-integration`, `003-monitoring-setup`
- Number matches spec directory in `specs/###-feature-name/`
### Commit Guidelines
- Clear, concise commit messages
- No emojis or marketing language
- Focus on "what" and "why" not "how"
- Group related changes in single commit
- Example: "Fix bridge homeserver URL to use IPv4 (127.0.0.1) instead of localhost"
### Main Branch Protection
- Always keep main deployable
- Test before merging to main
- Document breaking changes in commit message
- Tag releases for deployment milestones
## Recent Changes ## Recent Changes
- 001-extract-matrix-platform: Added Nix 2.x, NixOS 24.05+, Bash 5.x (for scripts) - 001-extract-matrix-platform: Added Nix 2.x, NixOS 24.05+, Bash 5.x (for scripts)
- 002-slack-bridge-integration: Deployed mautrix-slack bridge with Socket Mode (2025-10-26) - 002-slack-bridge-integration: Deployed mautrix-slack bridge with Socket Mode (2025-10-26)