Aller au contenu
Skillpedia
Déploiement et cloud (DevOps)10k · #12020

worktrees

Ce qu’il fait

Ce skill gère les worktrees Git comme des voies séparées et isolées pour les travaux de code complexes ou risqués. Il s'adresse aux développeurs et aux orchestrateurs d'IA qui traitent plusieurs tâches en même temps.

Quand l’utiliser

  • ✓Quand plusieurs tâches de code doivent s'exécuter en parallèle sans toucher aux mêmes fichiers.
  • ✓Quand une expérience risquée doit être gardée séparée du projet principal.
  • ✓Quand vous devez relire le travail de voies séparées et le réintégrer dans une seule branche.

Lien du skill

https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/worktrees/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/worktrees/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Mets en place un worktree séparé pour ce refactoring risqué afin qu'il ne perturbe pas ma branche principale.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Le skill place chaque voie dans son propre dossier sous le répertoire .slim du projet, avec sa propre branche et un responsable clair. Il suit l'état des voies et gère le nettoyage à la fin.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Worktrees Orchestration Protocol

The worktrees skill provides an opinionated, safe orchestration protocol for managing Git worktrees as isolated coding lanes. Its value is giving the Orchestrator a consistent OMO workflow for parallel agents, risky experiments, integration review, and cleanup.

Core Contract

This is an orchestrator-only workflow. Other specialists such as @fixer or @designer can be assigned tasks inside a worktree lane, but the Orchestrator owns lane planning, branch/path selection, file ownership, delegation, diff validation, integration, and cleanup.

All worktrees reside under the default path:

.slim/worktrees/<slug>/

Do not create worktrees as sibling directories of the main repository.

State Tracking (.slim/worktrees.json)

Use the optional local metadata manifest .slim/worktrees.json to maintain structural tracking:

{
  "version": "1.0.0",
  "updatedAt": "2026-06-14T00:00:00.000Z",
  "lanes": [
    {
      "slug": "feature-auth-v2",
      "branch": "omos/feature-auth-v2",
      "path": ".slim/worktrees/feature-auth-v2",
      "base": "main",
      "purpose": "refactor authentication flow to use OAuth2",
      "owner": "orchestrator",
      "status": "active",
      "areas": ["src/auth", "src/config"],
      "createdAt": "2026-06-14T12:00:00.000Z"
    }
  ]
}

If .slim/worktrees.json does not exist, create it when initializing a lane, and keep it updated as lanes are transitioned, integrated, or pruned. Treat it as local workflow metadata by default; ask before making it part of a committed project convention.


Safety Guidelines

Before executing any Git mutation command, the Orchestrator must observe the following guards:

1. Pre-Flight Checklist

  • Confirm the current directory is inside a Git repository.
  • Check the current branch, base branch, and dirty/uncommitted state.
  • Inspect the output of git worktree list to avoid path or branch conflicts.
  • Ensure the branch name (e.g. omos/<slug> or custom project convention) does not already exist locally or on remote.
  • Ensure .slim/worktrees/ is ignored by Git before creating nested worktrees.

2. Mandatory User Confirmation

You must seek explicit user confirmation before executing:

  • git worktree add or git worktree remove
  • Branch creation, deletion, or renaming
  • Merges, rebases, or cherry-picks
  • git prune or git worktree prune
  • Destructive commands (e.g., git reset --hard, git clean, git push --force, or removing a dirty worktree directory).

Never execute destructive commands, delete branches, remove dirty worktrees, or clean uncommitted changes without explicit user confirmation for that exact operation.

3. Ignore File Setup

Before creating or cleaning lanes, inspect existing .gitignore and .ignore. Update the managed block in place when present; otherwise append it. Add only the missing exact lines below, never duplicate entries or modify unrelated rules. These blocks keep lane artifacts git-local while the .ignore allowlist keeps them readable to OpenCode.

.gitignore:

# BEGIN oh-my-opencode-slim worktrees
.slim/worktrees/
.slim/worktrees.json
# END oh-my-opencode-slim worktrees

.ignore:

# BEGIN oh-my-opencode-slim worktrees
!.slim/
!.slim/worktrees.json
!.slim/worktrees/
!.slim/worktrees/**
# END oh-my-opencode-slim worktrees

Workflow Guide

Phase 1: Planning & Setup

  1. Identify the task scope and determine a short <slug> for the worktree.
  2. Formulate a branch name. Default to omos/<slug> unless project/user conventions dictate otherwise.
  3. Validate repository safety. Ask the user for confirmation to initialize the lane.
  4. Before creating the lane, ensure the managed ignore blocks are present using the Ignore File Setup rules above.
  5. Run:
    git worktree add -b <branch-name> .slim/worktrees/<slug> <base-commit/branch>
    
  6. Register the metadata in .slim/worktrees.json.

Phase 2: Execution & Delegation

  1. Run all sub-agents with their working directory set strictly to the worktree path, such as .slim/worktrees/<slug>.
  2. Do not modify the main checkout for lane work. Keep build, test, and edit operations isolated inside the lane.
  3. Track file or folder ownership per lane to avoid merge conflicts between parallel agents.
  4. Commit progress within the worktree only when the user asked for commits or approved local checkpoint commits.

Questions fréquentes

Où sont stockés les worktrees ?

Dans un dossier .slim/worktrees à l'intérieur du projet, et non à côté du dépôt principal.

Suit-il les voies ?

Oui. Il peut tenir un fichier de manifeste facultatif avec la branche, l'objectif et l'état de chaque voie.

Qui contrôle les voies ?

L'orchestrateur gère la planification, la délégation, les contrôles et le nettoyage, tandis que les spécialistes peuvent travailler à l'intérieur d'une voie.

Détails

Description originale de l’auteur

Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.

repo: alvinunreal/oh-my-opencode-slim

Popularité

Étoiles GitHub
10k
Position au classement
#12020
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires