Logo : Concurrent Branches

Concurrent Branches

CommunautéPopulaire
kajisho5
concurrent-branches

Résolvez les conflits et les fusions lorsque plusieurs branches sont ouvertes simultanément sur un même dépôt : les fichiers sensibles que chaque modification doit toucher (manifestes de registre, champ de version unique, configuration d’outils partagée, module de test agrégé, fichiers de build suivis), les trois bonnes méthodes de résolution — fusionner les éléments, recalculer ou reconstruire —, les artefacts générés qu’il ne faut jamais fusionner, la sérialisation non déterministe qui provoque des conflits dans chaque branche, les identifiants renumérotés que Git ne peut pas vous signaler, et pourquoi une fusion automatique sans conflit ne signifie pas que les tests passent. À utiliser pour rebaser ou fusionner une branche de longue durée, résoudre des marqueurs de conflit, examiner un commit de fusion, décider quels fichiers un dépôt doit commiter ou générer, ou préparer un dépôt à recevoir des contributions en parallèle.

Add to TypingMind

Présentation

Éditeurkajisho5
Dépôtffmpeg-skill
Nom de la compétenceconcurrent-branches
Étoiles
1.8K
Forks
144
Fichiers inclus
Instructions uniquement
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Tout dans les instructions

    Tout ce dont le modèle a besoin se trouve dans les instructions : aucun fichier supplémentaire à synchroniser.

  • Open source

    Publiée par kajisho5 sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Concurrent Branches dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/kajisho5/ffmpeg-skill/tree/main/.claude/skills/concurrent-branches
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kajisho5/ffmpeg-skill.git /tmp/ffmpeg-skill
mkdir -p .claude/skills
cp -r /tmp/ffmpeg-skill/.claude/skills/concurrent-branches .claude/skills/concurrent-branches
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Concurrent Branches dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Concurrent Branches dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Concurrent Branches n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Merging Concurrent Branches

When several branches are open against the same repo at once, the conflicts do not land in the code you were thinking about. They land in a small, predictable set of hotspot files that nearly every change has to touch — a registry manifest, a version field, shared tool config, one aggregated test module, a tracked build output.

Each hotspot has exactly one correct resolution, and they are not the same rule. "Take ours" / "take theirs" is right for almost none of them. Worse, getting one wrong is silent: the dropped entry, the collided version, the stale bundle all merge green and are found later by someone who cannot reproduce them.

Find the hotspots before you need to resolve them

Files touched by nearly every commit are the files your branch will conflict on.

bash
# the 15 files most commits touch — your hotspot list
git log --format= --name-only -n 200 | sort | uniq -c | sort -rn | head -15

Write the resolution rule for each one into the contributing docs. Under conflict pressure, with a stale branch and a red CI run, nobody re-derives "the version field is recomputed, not merged" correctly.

Additive registries: union both sides, never choose one

A manifest that lists every component — plugin entries, module paths, exported names, a feature list. Two branches each append an entry, and the conflict spans both additions:

jsonc
<<<<<<< HEAD
    "./components/exporter",
    "./components/importer"        // theirs, already merged to main
=======
    "./components/exporter",
    "./components/validator"       // yours
>>>>>>> feature/validator

Both sides are correct and neither is a substitute for the other. Resolve by keeping every entry from both sides. Taking a side deletes a component that is still fully present in the tree — the code compiles, the tests pass, and the component is simply never registered or installed.

Nothing catches that unless you check the registry against the filesystem:

bash
# every registered path exists
jq -r '.plugins[].components[]' manifest.json | while read -r p; do
  [ -e "${p#./}" ] || echo "registered but missing: $p"
done
# every component on disk is registered
for d in components/*/; do
  grep -q "\"./${d%/}\"" manifest.json || echo "present but unregistered: $d"
done

Run it as a repo test, not as a merge-day ritual. It is the only thing standing between a mis-resolved conflict and a component that quietly does not ship.

Single-value counters: recompute from the integration branch

A version field, a sequence number, a "latest migration" pointer. Both branches bumped 2.17.0 to 2.18.0; both are wrong now, because a third branch already merged and main is at 2.18.0 too.

Union is meaningless here and picking a side reintroduces a collision. The rule is recompute from the current integration branch, not from either side of the conflict — every change that merged since you branched consumed one increment:

bash
git fetch origin main
git show origin/main:manifest.json | jq -r '.metadata.version'   # -> 2.18.0
# your branch takes 2.19.0, regardless of what your branch said before

Do this as the last step before pushing, not during the merge. If another branch lands while you resolve, you redo only one line.

Generated artifacts: rebuild, never merge

A committed minified bundle, a built PDF, a compiled schema, a checked-in snapshot. Git will happily produce a merge for the text ones and force a binary choice for the rest — and every such result is wrong, because a derived file's only correct content is whatever the merged sources generate.

Resolve the sources, then regenerate:

bash
git checkout --merge -- src/ ui/app.jsx   # resolve the real inputs first
make build                                 # regenerate the artifact
git add dist/bundle.js docs/handbook.pdf

Two things make this reviewable rather than a leap of faith:

  • Pin the generator version. If the bundler or typesetter is pinned, its output is byte-identical anywhere, and a reviewer can regenerate and diff to confirm the artifact matches the source. Unpinned, the artifact diff is a mix of your change and a tool upgrade, and nobody can tell them apart.
  • Verify only the expected regions moved. A rebuilt document reflows: a one-paragraph edit typically spreads across two or three consecutive pages. Raster-diff or diff the rebuilt artifact against one built from the base commit in the same environment, and say in the PR which regions changed and why. Anything else that moved is your merge, not your edit.

Non-deterministic serialization turns every branch into a conflict

If a tracked file is written by iterating a map, set, or dict whose order is not stable, the whole file is rewritten on every run. Then every branch conflicts on every line, diffs are unreviewable, and real conflicts hide inside the churn.

Sort before writing:

python
# BAD — map iteration order; the file is rewritten differently every time
records = [to_record(k, v) for k, v in index.items()]

# GOOD — a stable key. ISO-8601 dates sort chronologically as plain strings,
# so no date parsing is needed to get a deterministic, reviewable file.
records = sorted((to_record(k, v) for k, v in index.items()), key=lambda r: r["date"])

This applies to any code path that rebuilds a committed file from an unordered collection, including the ones added later. Once one path forgets, the file is churny again.

Shared tool config: take the base file, re-apply your delta

pyproject.toml, package.json, lint config, a CI workflow — files where your branch added three lines and four other branches added their own. Reconciling hunks by hand is where dev-dependency pins and tool sections get silently dropped.

Take the integration branch's copy wholesale — it already carries everything that landed while you were away — then re-add only the lines your branch introduced:

bash
git checkout origin/main -- pyproject.toml
# re-add just your delta, then confirm nothing else moved
git diff origin/main -- pyproject.toml

That last git diff should show your addition and nothing else. If it shows a pin reverting or a tool section disappearing, you took a side by accident.

Aggregated test modules: keep both suites, then check for shadowing

Two branches append cases to the same test file. Union them — but a union can produce two tests with the same name, and in Python and JavaScript the later definition simply replaces the earlier one. The file looks longer, the suite count looks plausible, and one branch's case never runs.

bash
grep -oE '^\s*(def test_[A-Za-z0-9_]+|it\(.[^,]*|test\(.[^,]*)' tests/test_thing.py \
  | sort | uniq -d

The same shape bites production code: two branches independently add the same module-level helper, the resolution keeps both, and the second shadows the first.

Append; never renumber a shared identifier

Repos that carry stable identifiers cited from elsewhere — claim IDs in a source ledger, migration numbers, fixture keys, snapshot names — break in a way conflict markers cannot show you. Renumbering C7-C12 to make room is a clean, conflict-free edit that invalidates every citation of those IDs in files your merge never touched.

Add new identifiers by continuing the numbering past the highest one that exists anywhere, and never reuse or renumber one. If two branches both claimed C17, renumber yours and fix your own references; do not renumber the side that already merged.

A clean auto-merge is not verification

Two branches editing far-apart regions of one large file merge cleanly and can still be semantically wrong: one side's change depends on a helper the other removed, or both added equivalent logic under different names, or one side's edit now sits inside a branch the other made unreachable.

After any non-trivial merge, confirm both sides survived — grep the merged tree for a distinctive string from each:

bash
git grep -n "computes the retry budget"     # a phrase only their change added
git grep -n "REDACTION_PLACEHOLDER"         # a symbol only yours added

Present and consistent, not just present. Then read the two regions together.

Match the repo's integration style, and re-run the real gate

bash
git log --graph --oneline -20    # merge commits, or a linear rebased history?

Follow whichever the history already uses. Then run the repo's actual CI commands locally before pushing: a resolved merge is code that has never existed anywhere before, and neither branch's CI run covered it. A green check on your branch and a green check on main say nothing about their union. See reproducing-ci-locally for deriving the commands the runner actually uses.

Checklist

  • Hotspot files identified from git log --name-only before branching
  • Registry/manifest conflicts resolved by union; every entry from both sides kept
  • Registry checked against the filesystem in both directions, in CI
  • Version/counter fields recomputed from origin/main, not taken from either side
  • Generated artifacts rebuilt from merged sources, never text- or binary-merged
  • Generator version pinned so a reviewer can regenerate and diff
  • Files serialized from maps/sets sorted by a stable key
  • Shared tool config taken from base, delta re-applied, git diff shows only your lines
  • Merged test modules checked for duplicate test names
  • New shared identifiers appended; none reused or renumbered
  • A distinctive string from each side found in the merged tree
  • Repo's real CI gate run locally on the merged result before pushing

Note for this repository (ffmpeg-skill)

This is exactly the pattern seen across the PR #28-#37 merge cascade for the 0.10.0 release: CHANGELOG.md was the hotspot file nearly every PR touched, and the correct resolution every time was "union both sides, never choose one" (keep every bullet, verify no leftover conflict markers). package.json's version field is the single-value-counter case: it should be recomputed once, after all merges land, not carried through each individual merge.

Learn More

  • reproducing-ci-locally (also added to this repo's .claude/skills/) — running the runner's real commands on the merged tree

Source: wdm0006/python-skills (MIT).

Foire aux questions

À quoi sert la compétence IA Concurrent Branches ?

Résolvez les conflits et les fusions lorsque plusieurs branches sont ouvertes simultanément sur un même dépôt : les fichiers sensibles que chaque modification doit toucher (manifestes de registre, champ de version unique, configuration d’outils partagée, module de test agrégé, fichiers de build suivis), les trois bonnes méthodes de résolution — fusionner les éléments, recalculer ou reconstruire —, les artefacts générés qu’il ne faut jamais fusionner, la sérialisation non déterministe qui provoque des conflits dans chaque branche, les identifiants renumérotés que Git ne peut pas vous signale...

Pourquoi utiliser Concurrent Branches sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Concurrent Branches se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Concurrent Branches dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/kajisho5/ffmpeg-skill/tree/main/.claude/skills/concurrent-branches. TypingMind lit le fichier SKILL.md et l’installe sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Concurrent Branches ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Concurrent Branches ?

Autant que vous le souhaitez. Vous pouvez utiliser Concurrent Branches avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Concurrent Branches est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par kajisho5 sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇