Development Workflow
Branching strategy, commit conventions, and PR process for Portfolio OS
Development Workflow
Learn the recommended development process, branching strategy, and collaboration patterns for Portfolio OS.
Branching Strategy
Portfolio OS uses a Git Flow-inspired branching model:
Branch Types
| Branch | Purpose | Naming | Base | Merge To |
|---|---|---|---|---|
main | Production code | main | - | - |
develop | Integration branch | develop | main | main |
feature/* | New features | feature/feature-name | develop | develop |
fix/* | Bug fixes | fix/bug-description | develop | develop |
hotfix/* | Critical fixes | hotfix/critical-bug | main | main + develop |
release/* | Release prep | release/v1.0.0 | develop | main |
Workflow Steps
Create Feature Branch
Always branch from develop for new features:
git checkout develop
git pull origin develop
git checkout -b feature/add-dark-mode
Develop and Commit
Make changes following coding standards:
# Make changes
git add .
git commit -m "feat(site): add dark mode toggle"
Keep Branch Updated
Regularly sync with develop to avoid conflicts:
git checkout develop
git pull origin develop
git checkout feature/add-dark-mode
git rebase develop
Push and Create PR
git push origin feature/add-dark-mode
# Then create PR on GitHub
Code Review and Merge
After approval, squash and merge to develop
Commit Convention
Portfolio OS follows Conventional Commits specification.
Commit Format
<type>(<scope>): <description>
[optional body]
[optional footer]
Commit Types
| Type | Usage | Example |
|---|---|---|
feat | New feature | feat(blog): add comment system |
fix | Bug fix | fix(dashboard): resolve login issue |
docs | Documentation | docs: update installation guide |
style | Code style/formatting | style: format with prettier |
refactor | Code refactoring | refactor(ui): simplify button component |
perf | Performance improvement | perf(site): optimize image loading |
test | Add/update tests | test(lib): add unit tests for cache |
chore | Maintenance | chore: update dependencies |
ci | CI/CD changes | ci: add e2e tests to workflow |
Scopes
Common scopes in Portfolio OS:
site- Site appdashboard- Dashboard appdocs- Documentation appui- UI packagelib- Lib packagedb- Database packagescripts- Automation scripts
Examples
feat(site): add RSS feed for blog posts
fix(dashboard): resolve media upload timeout
docs(getting-started): add environment setup guide
refactor(ui): extract button variants to shared config
perf(site): implement Redis caching for blog posts
Reduces page load time by 60%
Closes #123
chore(deps): upgrade Next.js to 14.2.32
test(lib): add integration tests for Hashnode client
Note:
Commits that don't follow the convention may be rejected by CI checks.
Pull Request Process
Creating a PR
Prepare Your Branch
# Ensure tests pass
pnpm test
# Ensure linting passes
pnpm lint
# Type check
pnpm typecheck
# Build to catch errors
pnpm build
Push to GitHub
git push origin feature/your-feature
Create Pull Request
Go to GitHub and click "New Pull Request"
PR Title Format:
feat(scope): Brief description
PR Description Template:
## What
Brief description of what this PR does
## Why
Explanation of why this change is needed
## How
Technical approach and implementation details
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
## Screenshots
(if applicable)
## Breaking Changes
(if any)
Closes #issue_number
Address Review Comments
Push additional commits to address feedback:
git add .
git commit -m "fix: address review comments"
git push origin feature/your-feature
Merge
Once approved, use Squash and Merge to keep history clean
PR Checklist
Before requesting review, ensure:
- Code follows coding standards
- Tests are added/updated and passing
- Documentation is updated
- No console errors or warnings
- Build passes successfully
- Linting passes
- TypeScript has no errors
- Commit messages follow convention
- PR description is complete
Review Guidelines
For Reviewers:
- Code Quality: Check for clarity, maintainability
- Testing: Verify adequate test coverage
- Performance: Look for potential bottlenecks
- Security: Check for vulnerabilities
- Documentation: Ensure changes are documented
Providing Feedback:
✅ Good: "Consider extracting this logic into a separate function for reusability"
❌ Bad: "This code is bad"
✅ Good: "This could cause a memory leak. Try using useEffect cleanup"
❌ Bad: "Won't work"
Release Process
Version Numbers
Portfolio OS follows Semantic Versioning:
- Major (x.0.0): Breaking changes
- Minor (0.x.0): New features (backward compatible)
- Patch (0.0.x): Bug fixes
Creating a Release
Create Release Branch
git checkout develop
git pull origin develop
git checkout -b release/v1.2.0
Update Version Numbers
# Update package.json versions
# Update CHANGELOG.md
Test Thoroughly
pnpm install
pnpm build
pnpm test
# Manual testing
Merge to Main
git checkout main
git merge release/v1.2.0
git tag v1.2.0
git push origin main --tags
Merge Back to Develop
git checkout develop
git merge main
git push origin develop
Hotfix Process
For critical production bugs:
Create Hotfix Branch
git checkout main
git checkout -b hotfix/critical-security-fix
Fix and Test
# Make fix
git commit -m "fix: resolve critical security vulnerability"
pnpm test
Merge to Main and Develop
git checkout main
git merge hotfix/critical-security-fix
git tag v1.2.1
git push origin main --tags
git checkout develop
git merge hotfix/critical-security-fix
git push origin develop
Development Best Practices
1. Small, Focused PRs
Note:
Good PR: Adds dark mode toggle (200 lines) Bad PR: Adds dark mode, refactors navigation, updates dependencies (2000 lines)
2. Regular Commits
Commit frequently with meaningful messages:
git commit -m "feat(site): add dark mode context"
git commit -m "feat(site): implement theme toggle button"
git commit -m "feat(site): persist theme preference"
git commit -m "test(site): add dark mode tests"
3. Keep Dependencies Updated
# Check for outdated packages
pnpm outdated
# Update safely
pnpm update --latest --interactive
4. Sync Frequently
# Sync with develop daily
git checkout develop
git pull origin develop
git checkout your-branch
git rebase develop
Automation Tools
Portfolio OS includes PowerShell scripts for common workflows:
# Create new feature branch
.\scripts\branch-management\create-branch.ps1 -Type feature -Name "add-comments"
# Create PR
.\scripts\pr-management\create-pr.ps1 -Title "feat(blog): add comment system"
# Sync all worktrees
.\scripts\agent-management\sync-agents.ps1
See Scripts Reference for details.
Multi-Agent Development
For parallel development with multiple agents:
# Create agent worktree
.\scripts\agent-management\create-agent.ps1 -AgentName "agent-1"
# Assign task to agent
.\scripts\agent-management\assign-task.ps1 -AgentName "agent-1" -Task "Implement dark mode"
See Multi-Agent System for more.
Next Steps
- Coding Standards - Learn code quality guidelines
- Monorepo Structure - Understand workspace organization
- Scripts Reference - Explore automation tools
Note:
Following this workflow ensures consistent, high-quality contributions. Questions? Check Troubleshooting.