branching
Skill0 starsChanged 2 months agoMITView on GitHub
Use when the user wants to create a feature branch, sync work to a staging/sandbox release branch, or prepare a production merge in a repo that uses a paired feature-branch (main/dev) + long-lived releases/* deploy-branch git model. Triggers on "buat branch buat PB ini", "sync ke sandbox", "cherry-pick ke staging", "mau deploy ke sandbox/staging", "branch buat fitur ini", or when releases/sandbox and releases/main branches with CI auto-deploy are detected in the repo. Not for repos using plain GitHub Flow (single main + short-lived feature branches merged via PR) or trunk-based development — detect the convention first (Step 0) rather than assuming this model applies.
In this repository29 other files it gives its agents.
- agent-doctorSkill
- ai-discoverabilitySkill
- api-designSkill
- api-testingSkill
- backend-patternsSkill
- brd-readerSkill
- codebase-explainSkill
- code-review-and-qualitySkill
- database-migrationsSkill
- debuggingSkill
- dependency-updateSkill
- deploymentSkill
- docker-patternsSkill
- e2e-testingSkill
- exec-todoSkill
- incremental-implementationSkill
- modern-web-guidanceSkill
- mysql-patternsSkill
- prd-grillSkill
- project-bootstrapSkill
- react-patternsSkill
- react-testingSkill
- security-and-hardeningSkill
- security-reviewSkill
- skill-syncSkill
- nama-skill-contohSkill
- test-case-matrixSkill
- test-driven-developmentSkill
- webapp-testingSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 36
Before doing anything, verify this repo actually uses this model — don't assume:
- Distinctive: line 51
If it does apply, read the repo's own docs (often in README.md) for the
- Very specific: line 60
If only one of releases/sandbox / releases/staging exists, use that one.
- Distinctive: line 62
If both exist, don't guess which is the real staging target — ask the user to clarify (they may be two different environments, or one may …
- Distinctive: line 74
Check the repo's commit-message convention from recent history (git log --oneline -20 on a similar existing branch) before assuming one — …
- Very specific: line 102
Only these are candidates to cherry-pick — never re-pick anything already reachable from -dev.
- Very specific: line 104
If -dev doesn't exist yet, create it from the current -main head (first sync for this feature) rather than from releases/sandbox — the dev …
- Very specific: line 117
Before merging/pushing -dev into the shared staging branch, check what's already there that might overlap:
- Distinctive: line 129
Never force-push a shared release/staging branch: If history there needs correcting, that's a decision for whoever owns the release …
- Distinctive: line 159
Not a generic git-flow/GitHub-flow guide — it's specific to the paired-branch + cherry-pick-to-staging model.
- Distinctive: line 162
Not a substitute for checking this repo's own documented convention — the exact branch names, commit-message rules, and review requirements …
- Distinctive: line 166
Not a way to bypass required reviews/testing sign-off to move faster — the sync/promote gates exist on purpose.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
branching
Manage feature branches in a paired branch + long-lived release-branch
git model: work happens on a -main-suffixed branch, gets cherry-picked
onto a -dev-suffixed companion branch to reach a shared releases/sandbox
staging branch, and finally gets promoted to main/releases/main for
production. See references/knitto-api-example.md for a concrete worked
example this skill is modeled on.
This is not generic git-flow — don't apply GitHub Flow or trunk-based instincts here. The defining trait is that promotion to staging happens via cherry-pick onto a separate branch, not a direct merge of the working branch, specifically so the shared staging branch doesn't inherit in-progress/messy commit history from every feature.
Step 0 — Detect whether this model applies
Before doing anything, verify this repo actually uses this model — don't assume:
git branch -a | grep -E 'releases/(sandbox|staging|main)'
git branch -a | grep -E '\-(main|dev)$'Also check CI config (.github/workflows/*.yml or equivalent) for deploy
jobs triggered on push to releases/* branches — that confirms these are
long-lived deploy branches, not throwaway ones. If none of this is present,
this skill doesn't apply — fall back to whatever branching convention the
repo's CONTRIBUTING/README actually documents, or plain feature-branch +
PR-to-main.
If it does apply, read the repo's own docs (often in README.md) for the
exact branch naming and commit-message convention — the names below
(-main/-dev, releases/sandbox, releases/main) are the pattern to
recognize, not to hardcode; a given repo may use staging instead of
sandbox, or a different suffix scheme.
Naming isn't fixed — check which one this repo actually has. The
git branch -a | grep -E 'releases/(sandbox|staging|main)' above matches
both releases/sandbox and releases/staging. Don't default to one:
- If only one of
releases/sandbox/releases/stagingexists, use that one. - If both exist, don't guess which is the real staging target — ask the user to clarify (they may be two different environments, or one may be stale/deprecated) before opening any sync/promote PR against either.
new <slug> — start a new feature branch
- Confirm the base: create the working branch from the trunk (
main, or whatever this repo's default branch is) — never fromreleases/sandboxor another feature branch, even if that's what's currently checked out. - Name it per this repo's convention (e.g.
feat/<slug>-main,fix/<slug>-main,hotfix/<slug>-main— prefix matches the change type, same as a conventional-commits-style prefix would). - Check the repo's commit-message convention from recent history
(
git log --oneline -20on a similar existing branch) before assuming one — some repos require a feature-name prefix on every commit (e.g.`nama fitur`: pesan commit) specifically because commits get cherry-picked later and need to stay identifiable out of context.
sync <slug> — get the feature onto staging
This is the step most likely to go wrong, and the reason this skill exists:
the staging branch (releases/sandbox/releases/staging) is a shared
integration branch that many features cherry-pick into concurrently. Two
failure modes to actively guard against:
- Duplicate cherry-picks — re-picking a commit that's already on staging (from an earlier sync) creates a duplicate/conflicting commit.
- Missed commits — new commits added to the
-mainbranch since the last sync don't make it to-dev/staging, so staging silently falls behind what's actually been built (this is the "staging ketinggalan banyak fitur" problem — it compounds when this check is skipped repeatedly across many features).
Procedure:
- Identify what's new: compare the
-mainbranch against its-devcompanion to find commits not yet cherry-picked:
Only these are candidates to cherry-pick — never re-pick anything already reachable fromgit log <slug>-dev..<slug>-main --oneline-dev. - If
-devdoesn't exist yet, create it from the current-mainhead (first sync for this feature) rather than fromreleases/sandbox— the dev branch's job is to mirror-main's content, not to start from staging's current state. - Checkout
-dev, cherry-pick the identified commits in order, usinggit cherry-pick -xso each picked commit records its origin SHA — this is what makes step 1's diffing reliable on the next sync, and lets anyone trace a staging commit back to its source. - Resolve conflicts commit-by-commit as they arise; don't resolve by force-taking one side wholesale — a cherry-pick conflict usually means another feature already touched the same code on staging, and the correct resolution requires understanding both changes, not picking a winner blindly.
- Before merging/pushing
-devinto the shared staging branch, check what's already there that might overlap:
The second command shows exactly what this sync is about to add — sanity check it's what you expect, not more or less.git log releases/sandbox --oneline -20 git log releases/sandbox..<slug>-dev --oneline - Merge or open a PR into the staging branch per this repo's convention (some repos merge directly, others require PR + review even for staging — check for branch protection or an explicit review-request step in the repo's docs before assuming).
- Never force-push a shared release/staging branch. If history there needs correcting, that's a decision for whoever owns the release process, not something to do unilaterally mid-sync.
promote <slug> — open the production PR
This step is git-PR mechanics only — it never checks CI, never checks
whether a merge triggers a deploy, and never touches a releases/main-style
branch. Confirm /qa//gate (or this repo's equivalent verification +
review sign-off) already passed before opening the PR — don't promote on
the assumption that "it works on staging" alone is sufficient if the
repo's process requires explicit sign-off.
- Open a PR from
<slug>-main(the working branch — not-dev, which is a staging-only artifact) into the trunk (main). - That's the whole step. Whatever happens after the PR merges (deploy
triggers, a separate
releases/mainpush, CI gates) is outside this skill's scope — don't chase it. - Once the PR is merged, offer to clean up the merged
-mainand-devbranches — ask first, don't delete unilaterally, since-devmay still be referenced by the staging branch's history via the-xcherry-pick trailers.
In this repo's pipeline, sync <slug> and promote <slug> are both run
from inside /promote (see commands/promote/) rather than invoked as
separate user-facing steps — /promote opens the trunk PR and runs the
sync-to-staging PR together, in one pass, once /gate has approved.
What this skill is not
- Not a generic git-flow/GitHub-flow guide — it's specific to the paired-branch + cherry-pick-to-staging model. Verify Step 0 before applying any of this.
- Not a substitute for checking this repo's own documented convention — the exact branch names, commit-message rules, and review requirements vary per repo; this skill teaches the shape of the workflow and the failure modes to avoid, not a fixed script.
- Not a way to bypass required reviews/testing sign-off to move faster — the sync/promote gates exist on purpose.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

