images/dev/skills/git-workflow/SKILL.md
# Skill: Git Workflow ## Overview All code changes go through Git using a branch-based workflow. DEV never commits directly to `main`. Every change lives on a feature branch, goes through a pull request, and gets reviewed by CQ before merging. This skill covers the full workflow from cloning to PR creation. ## Configuration | Variable | Description | |-------------|--------------------------------------| | `REPO_URL` | Git remote URL for the repository | Git
npx skillsauth add dwoolworth/devteam images/dev/skills/git-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
All code changes go through Git using a branch-based workflow. DEV never
commits directly to main. Every change lives on a feature branch, goes
through a pull request, and gets reviewed by CQ before merging. This skill
covers the full workflow from cloning to PR creation.
| Variable | Description |
|-------------|--------------------------------------|
| REPO_URL | Git remote URL for the repository |
Git authentication is handled via SSH keys pre-configured in the container.
GitHub CLI (gh) is pre-installed and authenticated.
On first setup, clone the project repository into the workspace.
git clone ${REPO_URL} /home/agent/workspace/repo
cd /home/agent/workspace/repo
If the repo is already cloned, make sure you are up to date:
cd /home/agent/workspace/repo
git checkout main
git pull origin main
Every ticket gets its own branch. Create it from an up-to-date main.
git checkout main
git pull origin main
git checkout -b feature/TICKET-42-user-authentication
Branch naming convention:
feature/{TICKET-ID}-{brief-description}
Rules:
feature/TICKET-42)Examples:
feature/TICKET-42-user-authenticationfeature/TICKET-17-fix-cart-totalfeature/TICKET-103-add-rate-limitingfeature/TICKET-8-refactor-db-queriesNever branch from another feature branch. Always branch from main.
Write your code, then stage and commit in logical, atomic units. Each commit should represent one coherent change.
# Stage specific files (preferred over git add .)
git add src/auth/middleware.js src/auth/middleware.test.js
# Commit with conventional commit format
git commit -m "feat(TICKET-42): add JWT authentication middleware"
Conventional commit format:
{type}({TICKET-ID}): {description}
{optional body}
{optional footer}
Commit types:
| Type | When to Use |
|------------|----------------------------------------------------|
| feat | A new feature or capability |
| fix | A bug fix |
| refactor | Code change that neither fixes a bug nor adds a feature |
| test | Adding or updating tests only |
| docs | Documentation changes only |
| chore | Build process, tooling, or dependency changes |
| style | Formatting, whitespace, semicolons (no logic change)|
| perf | Performance improvement |
Commit message rules:
Examples of good commits:
feat(TICKET-42): add JWT authentication middleware
Implements token verification for all protected routes.
Uses RS256 signing with rotating keys from the auth service.
fix(TICKET-42): handle expired token gracefully
Previously returned a 500 error. Now returns 401 with a clear
message telling the client to refresh their token.
test(TICKET-42): add integration tests for auth flow
Covers login, registration, token refresh, and invalid
credential scenarios.
refactor(TICKET-42): extract token validation into helper
Reduces complexity in the middleware by moving validation
logic to a dedicated module. Addresses CQ feedback on
function length.
Examples of bad commits:
# Too vague
fix(TICKET-42): fix bug
# No ticket ID
feat: add authentication
# Past tense
feat(TICKET-42): added authentication
# Too long
feat(TICKET-42): add JWT authentication middleware with RS256 signing and rotating keys from auth service with graceful error handling
Push your feature branch to the remote. Use -u on the first push to set
the upstream tracking reference.
# First push
git push -u origin feature/TICKET-42-user-authentication
# Subsequent pushes
git push
If the push is rejected because main has moved ahead, rebase:
git fetch origin
git rebase origin/main
# Resolve any conflicts
git push --force-with-lease
Use --force-with-lease instead of --force. It prevents you from
accidentally overwriting someone else's changes.
Use the GitHub CLI to create a PR. The PR title should include the ticket ID, and the body should follow the template below.
gh pr create \
--title "TICKET-42: Implement user authentication flow" \
--body "## Summary
Implements JWT-based user authentication per the requirements in TICKET-42.
## Changes
- Added JWT authentication middleware for protected routes
- Created login endpoint with email/password validation
- Created registration endpoint with input sanitization
- Added rate limiting (5 attempts per minute per IP)
- Added comprehensive test suite (unit + integration)
## Acceptance Criteria
- [x] Users can register with email and password
- [x] Users can log in and receive a JWT
- [x] Protected routes reject unauthenticated requests
- [x] Rate limiting prevents brute force attacks
- [x] All error responses follow the standard format
## Testing
- Unit tests: 24 passing
- Integration tests: 8 passing
- Docker build and test: passing
- Manual verification: login, register, token refresh all working
## Ticket
Resolves TICKET-42"
PR template breakdown:
| Section | Purpose | |----------------------|--------------------------------------------------| | Summary | 1-2 sentences explaining what and why | | Changes | Bulleted list of what was changed | | Acceptance Criteria | Checklist from the ticket, checked off | | Testing | What tests were run, what was verified | | Ticket | Reference to the ticket using "Resolves TICKET-X"|
Once the PR is created:
in-review on the planning boardIf CQ requests changes:
When QA passes the ticket and moves it to completed, you merge the PR to main:
Check out main and pull latest:
git checkout main
git pull origin main
Merge the PR using GitHub CLI:
gh pr merge {pr_number} --merge --delete-branch
Use --merge (not squash, not rebase) unless the project specifies otherwise.
The --delete-branch flag cleans up the remote feature branch.
Verify the merge:
git pull origin main
git log --oneline -3
Stop the running test instance (QA is done with it):
kill %1 # or kill the app process
Move the ticket to rfp on the planning board
Add a comment: "PR merged to main. Feature branch cleaned up. Moving to rfp."
Post on Meeting Board #review channel
Merging completed work is your FIRST priority in every heartbeat. Check
the completed column before fixing bugs or picking up new work.
git fetch origin
git rebase origin/main
# If conflicts arise:
# 1. Edit the conflicting files to resolve
# 2. Stage the resolved files
git add <resolved-files>
# 3. Continue the rebase
git rebase --continue
# Push the rebased branch
git push --force-with-lease
If you have many small commits that should be one logical change, squash them before requesting review. Use interactive rebase with care:
# Squash the last 3 commits into one
git rebase -i HEAD~3
# In the editor: mark the commits to squash with 's'
# Write a clean, combined commit message
git push --force-with-lease
# View your open PRs
gh pr list --author @me
# View a specific PR with details
gh pr view 18
# Check CI/review status
gh pr checks 18
gh pr edit 18 --body "updated description here"
completed.completed column before starting new work.development
Run Playwright browser tests and curl API tests to validate tickets against acceptance criteria.
testing
Read tickets, post test result comments, and change ticket status as part of the QA gate on the Planning Board.
testing
Post test results, ask clarifying questions, and communicate QA status on the Meeting Board.
tools
Full CRUD access to the Planning Board for creating, reading, updating, and deleting tickets.