3.1 KiB
Skill: New Branch Bootstrap
Description
Canonical recipe for spinning up a fresh working branch off the latest upstream main. Use this skill
whenever the user says things like "make a new branch off fetched origin/main", "peel off a fresh
branch", "dust off #NNNN", or otherwise signals the start of a new unit of work.
This replaces the ad-hoc prose that used to be retyped at the start of every session.
When to Use
- Starting any new feature, fix, chore, or refactor.
- Rebasing a stale PR onto current
main(see Rebase variant). - Reproducing a CI failure from a clean baseline.
Preconditions (verify before branching)
- Clean worktree. If
git status --porcelainis non-empty, ask the user before proceeding. - Upstream remote present.
git remote -vmust listupstreampointing atmeshtastic/Meshtastic-Android. If onlyoriginexists on a fork, treatoriginas upstream. - Submodules initialised.
core/proto/src/main/protomust be populated — see AGENTS.md workspace bootstrap rules. - Secrets bootstrapped. If
local.propertiesis missing, copysecrets.defaults.properties(required forgoogleflavor builds).
Standard Recipe
# 1. Fetch latest upstream
git fetch upstream --prune --tags
# 2. Create the branch from upstream/main (never from a local stale main)
git switch -c <branch-name> upstream/main
# 3. Ensure submodules track the new base
git submodule update --init --recursive
# 4. Sanity check
git --no-pager log -1 --oneline
Branch Naming
Use conventional-commit style prefixes that match the PR title convention in AGENTS.md
<git_and_prs>:
| Prefix | Use for |
|---|---|
feat/<scope> |
New user-visible behavior |
fix/<scope> |
Bug fixes |
refactor/<scope> |
Code structure changes, no behavior change |
chore/<scope> |
Tooling, deps, CI, cleanup |
docs/<scope> |
Documentation only |
Keep the slug short and kebab-case, e.g. fix/r8-animation-release, chore/koin-application-migration.
Rebase Variant
When the user says "rebase #NNNN" or "dust off PR NNNN":
git fetch upstream --prune
gh pr checkout <NNNN> # checks out the PR head locally
git rebase upstream/main
git submodule update --init --recursive
# Resolve conflicts, then:
git push --force-with-lease
Never use plain --force. Always --force-with-lease to avoid clobbering collaborator pushes.
Post-Branch Checklist
- Branch name follows conventional prefix.
- Submodules up to date.
local.propertiesexists.ANDROID_HOMEexported (see AGENTS.md workspace bootstrap).- Optional: run
./gradlew assembleDebugonce to catch environment regressions before editing.
Tip: Prefer /delegate for Long Audits
If the user's opening prompt is a sweeping audit or investigation (e.g. "audit changes since
v2.7.13 for regressions", "investigate why animations are broken on release"), consider
suggesting /delegate — the GitHub cloud agent can execute the branch + investigation + PR
end-to-end while the user keeps working locally. See AGENTS.md <copilot_cli_workflow>.