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

BranchPurposeNamingBaseMerge To
mainProduction codemain--
developIntegration branchdevelopmainmain
feature/*New featuresfeature/feature-namedevelopdevelop
fix/*Bug fixesfix/bug-descriptiondevelopdevelop
hotfix/*Critical fixeshotfix/critical-bugmainmain + develop
release/*Release preprelease/v1.0.0developmain

Workflow Steps

1

Create Feature Branch

Always branch from develop for new features:

git checkout develop
git pull origin develop
git checkout -b feature/add-dark-mode
2

Develop and Commit

Make changes following coding standards:

# Make changes
git add .
git commit -m "feat(site): add dark mode toggle"
3

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
4

Push and Create PR

git push origin feature/add-dark-mode
# Then create PR on GitHub
5

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

TypeUsageExample
featNew featurefeat(blog): add comment system
fixBug fixfix(dashboard): resolve login issue
docsDocumentationdocs: update installation guide
styleCode style/formattingstyle: format with prettier
refactorCode refactoringrefactor(ui): simplify button component
perfPerformance improvementperf(site): optimize image loading
testAdd/update teststest(lib): add unit tests for cache
choreMaintenancechore: update dependencies
ciCI/CD changesci: add e2e tests to workflow

Scopes

Common scopes in Portfolio OS:

  • site - Site app
  • dashboard - Dashboard app
  • docs - Documentation app
  • ui - UI package
  • lib - Lib package
  • db - Database package
  • scripts - 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

1

Prepare Your Branch

# Ensure tests pass
pnpm test

# Ensure linting passes
pnpm lint

# Type check
pnpm typecheck

# Build to catch errors
pnpm build
2

Push to GitHub

git push origin feature/your-feature
3

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
4

Address Review Comments

Push additional commits to address feedback:

git add .
git commit -m "fix: address review comments"
git push origin feature/your-feature
5

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:

  1. Code Quality: Check for clarity, maintainability
  2. Testing: Verify adequate test coverage
  3. Performance: Look for potential bottlenecks
  4. Security: Check for vulnerabilities
  5. 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

1

Create Release Branch

git checkout develop
git pull origin develop
git checkout -b release/v1.2.0
2

Update Version Numbers

# Update package.json versions
# Update CHANGELOG.md
3

Test Thoroughly

pnpm install
pnpm build
pnpm test
# Manual testing
4

Merge to Main

git checkout main
git merge release/v1.2.0
git tag v1.2.0
git push origin main --tags
5

Merge Back to Develop

git checkout develop
git merge main
git push origin develop

Hotfix Process

For critical production bugs:

1

Create Hotfix Branch

git checkout main
git checkout -b hotfix/critical-security-fix
2

Fix and Test

# Make fix
git commit -m "fix: resolve critical security vulnerability"
pnpm test
3

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

Note:

Following this workflow ensures consistent, high-quality contributions. Questions? Check Troubleshooting.