branch-policy
Branch model and merge flow for this project. Feature branches merge to dev via PR, dev merges to main via PR. Use when creating branches, opening PRs, pushing code, committing, or starting any new work — prevents incorrect base branch selection and direct pushes.
How do I install this agent skill?
npx skills add https://github.com/loxosceles-dev/dev-skills --skill branch-policyIs this agent skill safe to install?
- Gen Agent Trust Hubfail
This skill defines a git branching strategy and merge policy. It includes instructions that require the agent to access and verify sensitive system paths, specifically SSH private keys and AWS credential files, along with commands to check identity status.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Branch Policy
Branch Model
main ← production. Updated ONLY by PR from dev. Never push directly.
dev ← integration branch. Updated ONLY by PR from feature branches.
feat/* ← feature work, branched FROM dev
fix/* ← bug fixes, branched FROM dev
chore/* ← maintenance, branched FROM dev
The #1 Rule: Always Create a Branch First
Before writing ANY code — even a one-line fix — create a feature/fix/chore branch from dev.
Do NOT:
- Start coding on
devand "move it to a branch later" - Push a "quick fix" directly to
dev - Assume small changes don't need a branch
If you're on dev and about to make changes, STOP and run:
git checkout -b feat/descriptive-name dev
One Feature = One Branch
A feature branch lives until the feature is complete. All related work happens on that branch:
- PR review feedback → fix on the same branch, push
- Copilot comments → fix on the same branch, push
- Multiple rounds of iteration → same branch
Do NOT create a new fix/ branch for issues found during review of an open PR. Stay on the feature branch until the PR is merged.
A new branch is only needed when starting genuinely new, unrelated work.
Flow
git checkout -b feat/thing dev— create branch BEFORE any code changes- Make commits on the feature branch
- Push feature branch, open PR to dev (never to main)
- Address review feedback on the same branch, push again
- Merge PR to dev when approved
- When dev is stable, open PR from dev to main
Push Rules
| Action | Allowed? |
|---|---|
| Push to feature branch | ✅ Always |
Push to dev | ❌ Only if user explicitly says "push to dev" |
Push to main | ❌ Never. Main is updated only by merging a PR. |
If the user says "commit this" or "let's commit" while on dev, do NOT push. Ask: "Should I create a feature branch for this?"
PR Base Branch
| Source branch | PR base |
|---|---|
feat/*, fix/*, chore/* | dev |
dev | main |
If you're about to create a PR with --base main from a feature branch, STOP — the base must be dev.
Devcontainer — SSH and AWS
SSH keys are mounted directly from ~/.ssh/contexts/personal/ into /home/vscode/.ssh. There is no agent forwarding — SSH_AUTH_SOCK is irrelevant. git push works because the key file is there, not because of a forwarded socket.
Verify before first push:
ssh -T git@github.com # must say "Hi loxosceles!"
aws sts get-caller-identity # must return account info
If SSH fails: check ~/.ssh/contexts/personal/id_ed25519 exists on the host and known_hosts has the github.com entry. If AWS fails: check ~/.aws/contexts/<name>/credentials has a valid [default] profile. Which context is mounted is in .devcontainer/docker-compose.yml.
Common Mistakes to Avoid
- Starting work without a branch — Always check
git branch --show-currentbefore coding. If it saysdev, create a branch first. - Pushing "small fixes" to dev — No fix is small enough to skip the branch+PR flow. This causes cherry-pick pain later.
- Opening PR to main from a feature branch — Feature branches always target dev.
- Forgetting to create a branch after the user says "let's do X" — The first action for any new task is
git checkout -b. - Creating a new branch for review fixes — Stay on the current feature branch. One feature = one branch until merged.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/loxosceles-dev/dev-skills/branch-policy">View branch-policy on skillZs</a>