Last Updated: 2025-11-07 Applies to: All developers (human and AI agents)
🎉 NEW: Automated PR Workflow!
- ✅ Branch protection enforces PR-based workflow (no direct commits to
main) - ✅ Issue status auto-updates when PR created (
status/in-review) - ✅ Issues auto-close when PR merges (
status/done) - ✅ Branches auto-delete after merge
- ✅ PR title MUST include issue number:
feat: Description (#123)
ALL code changes must follow this workflow:
- ✅ Create feature branch
- ✅ Implement changes (following TDD)
- ✅ Run tests locally
- ✅ Commit with descriptive message
- ✅ Push to remote
- ✅ Create Pull Request
- ✅ Wait for CI/CD checks
- ✅ Review and merge
- ✅ Delete feature branch
No exceptions. This applies to:
- Backend API changes (go-backend-developer agent)
- Frontend web changes (frontend-developer agent)
- CLI changes
- Documentation changes
- Database migrations
<type>/<short-description>
Types:
- feature/ - New features
- fix/ - Bug fixes
- docs/ - Documentation only
- refactor/ - Code refactoring
- test/ - Test additions/changes
- chore/ - Maintenance tasks
Examples:
- feature/web-ui-foundation
- fix/employee-integration-test
- docs/api-endpoints
- refactor/auth-middleware
- test/e2e-dashboard
- chore/cleanup-unused-files
- Always branch from:
main - Always merge to:
main - Never push directly to:
main
<type>: <short summary> (#<issue-number>)
<detailed description>
## <section title>
- Bullet points for details
Closes #<issue-number>
🚀 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
feat:- New featurefix:- Bug fixdocs:- Documentationstyle:- Formatting, missing semicolons, etcrefactor:- Code restructuringtest:- Adding testschore:- Maintenance
Good:
feat: Add Web UI foundation with Next.js 14 and authentication (#12)
Implements Issue #12 - Web UI Foundation & Authentication
## Features
- Next.js 14 App Router with TypeScript strict mode
- Tailwind CSS + shadcn/ui component library
- Auto-generated API client from OpenAPI spec
Closes #12
🚀 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Bad:
updated files
Option A: Traditional Branch (Single Task)
# Start from main
git checkout main
git pull origin main
# Create feature branch
git checkout -b feature/your-feature-nameOption B: Git Worktree (Parallel Tasks) ⭐ RECOMMENDED for parallel work
# Create a new worktree in a separate directory
git worktree add ../arfa-issue-<number> -b feature/your-feature-name
# Move to the new worktree directory
cd ../arfa-issue-<number>
# Now you can work independently from the main repo
# Multiple worktrees = Multiple agents working in parallel!Why Use Worktrees for Parallel Development?
- ✅ No Conflicts: Each worktree has its own working directory
- ✅ Parallel Agents: Frontend + backend agents can work simultaneously
- ✅ No Stashing: Switch between tasks without committing incomplete work
- ✅ Independent State: Each worktree has its own branch checkout
- ✅ Easy Cleanup: Remove worktree after PR merge
Example: Running 2 Agents in Parallel
# Agent 1: Frontend work on Issue #13
git worktree add ../arfa-issue-13 -b feature/agent-catalog-page
# Frontend agent works in ../arfa-issue-13
# Agent 2: Backend work on Issue #3
git worktree add ../arfa-issue-3 -b fix/employee-integration-test
# Backend agent works in ../arfa-issue-3
# Both agents can commit, push, and create PRs independently!Cleanup After PR Merge:
# Return to main repo
cd /path/to/arfa
# Remove worktree
git worktree remove ../arfa-issue-13
# Delete branch (if needed)
git branch -d feature/agent-catalog-page# Make your changes following TDD
# Stage changes
git add <files>
# Commit with detailed message
git commit -m "$(cat <<'EOF'
feat: Your feature title (#<issue>)
Detailed description here...
Closes #<issue>
EOF
)"# Push branch
git push -u origin feature/your-feature-name# Create PR with gh CLI
gh pr create \
--title "feat: Your Feature Title (#<issue>)" \
--body "$(cat <<'EOF'
## Summary
Brief description of changes
## Changes
- Change 1
- Change 2
## Testing
- Test 1
- Test 2
Closes #<issue>
EOF
)" \
--base main \
--head feature/your-feature-namePR Title Format:
<type>: <Title> (#<issue-number>)
Examples:
- feat: Web UI Foundation with Next.js 14 (#12)
- fix: Employee integration test nil pointer (#3)
- docs: Add API endpoint documentation (#45)
# Check PR status
gh pr checks <PR-number>
# Wait for all checks to pass (green ✅)Do NOT merge until:
- ✅ All CI/CD checks pass
- ✅ Code review approved (if applicable)
- ✅ No merge conflicts
# Merge PR (after checks pass)
gh pr merge <PR-number> --merge
# Or merge via GitHub UI
# Click "Merge pull request" → "Confirm merge"# Switch back to main
git checkout main
# Pull latest
git pull origin main
# Delete local branch
git branch -d feature/your-feature-name
# Delete remote branch (usually auto-deleted)
git push origin --delete feature/your-feature-nameIMPORTANT: Both go-backend-developer and frontend-developer agents now automatically wait for CI checks before completing tasks.
# 1. Pick task from GitHub Projects
gh issue list --label="backend,status/ready"
# 2. Create branch + workspace
git checkout -b feature/123-feature-description
git worktree add ../arfa-issue-123 feature/123-feature-description
cd ../arfa-issue-123
# 3. Implement feature (TDD)
# - Write failing tests
# - Implement code
# - All tests pass locally
# 4. Create PR with issue number in title (REQUIRED for automation!)
gh pr create --title "feat: Feature description (#123)" --body "..." --label "backend"
PR_NUM=$(gh pr view --json number -q .number)
# 5. Wait for CI checks (CRITICAL!)
gh pr checks $PR_NUM --watch --interval 10
# 6. Verify CI passed
CI_STATUS=$(gh pr checks $PR_NUM --json state -q 'map(select(.state == "FAILURE" or .state == "CANCELLED")) | length')
if [ "$CI_STATUS" -eq 0 ]; then
# All checks passed!
# ✅ GitHub Actions automatically:
# - Updates issue status to "In Review"
# - Adds status/in-review label
# - Posts comment linking PR to issue
echo "✅ PR #${PR_NUM} created and all CI checks passing."
echo "✅ GitHub automation updated issue #123 status to 'In Review'."
else
# Checks failed - investigate and fix
gh pr checks $PR_NUM
echo "❌ CI checks failed for PR #${PR_NUM}. Fix failures and push again."
# Fix failures and push again - CI will re-run automatically
fi- ✅ Quality Gate: All tests must pass in CI before moving to review
- ✅ Automated: Agents handle the entire workflow without manual intervention
- ✅ Visibility: GitHub Project status auto-updates to "In Review" when ready
- ✅ Fast Feedback: Failures caught immediately, not during code review
- ✅ Clean Pipeline: No broken PRs waiting for review
✨ NEW: Status updates are now automated! Just include issue number in PR title:
# PR title format (automation triggers on this!)
gh pr create --title "feat: Your feature (#123)" ...
# When PR is created with passing CI:
# → Issue status automatically updates to "In Review"
# → status/in-review label added
# → Comment posted linking PR to issue
# When PR is merged:
# → Issue automatically closes
# → status/done label added
# → Branch automatically deletedManual status updates only needed for:
- Moving issues to "In Progress" when starting work
- Marking issues as "Blocked"
- Non-PR status changes (e.g., research tasks)
# Manual status update (rarely needed now)
./scripts/update-project-status.sh --issue 123 --status "In Progress"
./scripts/update-project-status.sh --issue 123 --status "Blocked"See agent configurations:
.claude/agents/go-backend-developer.md- Backend workflow (versioned in project).claude/agents/frontend-developer.md- Frontend workflow (versioned in project)
Always follow this workflow when implementing backend features:
- Create feature branch:
feature/<feature-name> - Write failing tests (TDD)
- Implement feature to pass tests
- Run full test suite:
make test - Verify coverage:
make test-coverage - Commit changes
- Push to remote
- Create PR
- Wait for CI checks
- Report completion to user
Example Task Completion:
Task: Implement GET /employees endpoint
Steps:
1. git checkout -b feature/list-employees-endpoint
2. Write failing test in tests/integration/employees_test.go
3. Implement handler in internal/handlers/employees.go
4. Run: make test
5. git commit -m "feat: Add GET /employees endpoint (#5)"
6. git push -u origin feature/list-employees-endpoint
7. gh pr create --title "feat: List Employees Endpoint (#5)" ...
8. Wait for checks
9. Report: "PR #XX created, all checks passing, ready for review"
Always follow this workflow when implementing frontend features:
- Create feature branch:
feature/<feature-name> - Write E2E tests first (TDD)
- Implement UI components
- Run type-check:
npm run type-check - Run lint:
npm run lint - Run build:
npm run build - Run E2E tests:
npm run test:e2e - Commit changes
- Push to remote
- Create PR
- Wait for CI checks
- Report completion to user
Example Task Completion:
Task: Implement Agent Catalog Page
Steps:
1. git checkout -b feature/agent-catalog-page
2. Write E2E test in tests/e2e/agent-catalog.spec.ts
3. Implement components in app/(dashboard)/agents/
4. npm run type-check && npm run lint && npm run build
5. git commit -m "feat: Add Agent Catalog Page (#13)"
6. git push -u origin feature/agent-catalog-page
7. gh pr create --title "feat: Agent Catalog Page (#13)" ...
8. Wait for checks
9. Report: "PR #XX created, all checks passing, ready for review"
- TypeScript: No compilation errors
- ESLint: No linting errors
- Tests: All tests passing
- Build: Production build successful
- Review error logs
- Fix issues locally
- Push fixes to same branch
- Checks will re-run automatically
- All tests pass locally
- Code follows project style guide
- No console.log or debug statements
- Documentation updated (if needed)
- CHANGELOG.md updated (for major changes)
- Code is clean and maintainable
- Tests cover new functionality
- No security vulnerabilities
- Performance considerations addressed
- Accessibility requirements met (for UI)
- Push directly to
mainbranch - Commit without running tests
- Create PR with failing tests
- Merge before checks pass
- Use vague commit messages ("fixed stuff")
- Skip pull request process
- Commit without linking to issue
- Leave commented-out code
- Commit secrets or credentials
- Ignore CI/CD failures
- Always create feature branch
- Run tests before committing
- Write descriptive commit messages
- Link commits/PRs to issues
- Wait for CI/CD checks
- Clean up branches after merge
- Follow TDD methodology
- Document complex changes
- Keep PRs focused and small
- Respond to review feedback
# 1. Create branch
git checkout main && git pull
git checkout -b feature/my-feature
# 2. Make changes
# ... write code, tests ...
# 3. Test
make test # Backend
npm run build && npm run test:e2e # Frontend
# 4. Commit
git add .
git commit -m "feat: My feature (#<issue>)
Details here...
Closes #<issue>
🚀 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>"
# 5. Push
git push -u origin feature/my-feature
# 6. Create PR
gh pr create \
--title "feat: My Feature (#<issue>)" \
--body "Summary...
Closes #<issue>"
# 7. Check status
gh pr checks <PR-number>
# 8. Merge (after checks pass)
gh pr merge <PR-number> --merge
# 9. Cleanup
git checkout main
git pull
git branch -d feature/my-featureCloses #123
Fixes #123
Resolves #123
Part of #123
Ref #123
Closes #123
Fixes #123
Resolves #123
Auto-closes issue when PR is merged.
# API changes
cd services/api
make test
# CLI changes
cd services/cli
go test ./...
# Web changes
cd services/web
npm run buildIf changes affect multiple services:
- Test each service individually
- Test integration between services
- Note dependencies in PR description
- Testing Guide - TDD workflow and test patterns
- Contributing - Contribution guidelines
- Project Structure - Project overview
For EVERY code change:
- ✅ Feature branch
- ✅ TDD (tests first)
- ✅ Commit
- ✅ Push
- ✅ PR
- ✅ Wait for checks
- ✅ Merge
- ✅ Cleanup
No shortcuts. No exceptions.
🚀 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com