ce-worktree
Fungsinya
Skill ini membuat ruang kerja terisolasi di cabang baru atau yang sudah ada, sehingga folder utama Anda tetap seperti semula. Ditujukan untuk pengembang yang mengerjakan beberapa tugas dalam satu repositori.
Kapan dipakai
- βSaat Anda memulai pekerjaan baru dan ingin memisahkannya dari checkout utama.
- βKetika Anda ingin memeriksa pull request atau commit di folder sendiri.
- βSaat sebuah cabang sudah di-checkout di tempat lain, skill ini melaporkan lokasi tersebut alih-alih membuat salinan kedua.
Link skill
https://github.com/EveryInc/compound-engineering-plugin/blob/main/skills/ce-worktree/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βSiapkan ruang kerja terpisah untuk fitur ini agar folder utama saya tetap tidak tersentuh.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill lebih dulu memeriksa apakah pekerjaan sudah terisolasi, lalu memakai alat worktree bawaan atau git biasa untuk membuat ruang kerja baru, dan melaporkan path serta cabangnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Worktree Isolation
Ensure the current work happens in an isolated workspace, without disturbing the user's main checkout. Most coding harnesses now create a worktree by default at session start, so the common case is that isolation already exists.
Done when: the caller is working in an isolated tree β existing or newly created β and its path and branch have been reported, or a blocker has been reported instead.
Order of operations: detect existing isolation -> prefer a native worktree tool -> fall back to plain git. Never create a worktree the harness cannot see.
Two modes, set by the caller's need:
- New work (default). No ref named β create a fresh branch from a base (trunk). This is what
ce-workandce-code-reviewuse when the user picks the worktree option. - Isolate an existing ref. The caller names a PR head, branch, or commit β attach the worktree to that ref instead of creating a new branch. A branch can be checked out in only one worktree at a time. If the named ref is already checked out anywhere (most commonly as the primary checkout's current branch), do not create a second worktree β report that it is already checked out at
<path>and let the caller act (work there in place; or, only if a clean separate tree is essential, create a detached worktree at the same commit).
Step 0: Detect existing isolation
Compare the resolved absolute git dir against the resolved absolute common git dir. Git mixes absolute and relative forms depending on the current directory (from a subdirectory of a normal checkout, --git-dir comes back absolute while --git-common-dir may be relative), so a raw string compare yields a false "already isolated":
git rev-parse --absolute-git-dir # absolute git dir for this worktree
(cd "$(git rev-parse --git-common-dir)" && pwd -P) # absolute shared (common) git dir
Equal -> normal checkout; continue to Step 1.
Different -> a linked worktree or a submodule. Distinguish with git rev-parse --show-superproject-working-tree:
- Non-empty -> submodule; treat it as a normal checkout and continue to Step 1.
- Empty -> already isolated. Report the worktree path (
git rev-parse --show-toplevel) and current branch, then work in place β a worktree-from-worktree lands in the wrong tree and is invisible to the harness that made the current one. In isolate-an-existing-ref mode, check that ref out here (unless it is already current) rather than nesting a worktree.
Step 1: Prefer the harness's native worktree tool
If the harness provides a native worktree primitive β for example an EnterWorktree / WorktreeCreate tool, a /worktree command, or a --worktree flag β use it and stop. Native tools place, track, and clean up the worktree so the harness can manage it. A behind-the-back git worktree add creates phantom state the harness cannot see, navigate to, or clean up.
Step 2: Git fallback
Only when there is no native tool and Step 0 found no existing isolation.
- Run from the repo root:
cd "$(git rev-parse --show-toplevel)". The paths below are repo-root-relative, but the skill runs from the user's current directory β without this,.worktrees/<branch>and the.gitignoreedit land in a subdirectory (e.g.src/.worktrees/...). - Choose a meaningful branch name from the work description (e.g.
feat/login,fix/email-validation) β never an opaque auto-generated one. Base: origin's default branch, elsemain. - Ensure
.worktrees/is gitignored before creating anything:git check-ignore -q .worktrees/β with the trailing slash, so an existing directory-only.worktrees/rule is honored even before the directory exists (without the slash the probe misses it and dirties a correctly-configured repo). Not ignored -> add a.worktrees/line to.gitignore. - Refresh the base with
git fetch origin <from-branch>. This is non-fatal β nooriginremote, a differently-named remote, or a local-only branch is not an abort; continue with the local ref. - Create the worktree, per mode:
- New work:
git worktree add -b <branch-name> .worktrees/<branch-name> origin/<from-branch>(use the local<from-branch>ref iforigin/<from-branch>does not exist). - Existing branch or tag:
git worktree add .worktrees/<slug> <target-ref>. - PR: check it out on a local branch β
git fetch origin pull/<n>/head:pr-<n>then `
- New work:
Pertanyaan umum
Apakah ini akan mengubah checkout utama saya?
Tidak. Skill ini dirancang agar tidak mengganggu checkout utama Anda.
Bisakah ia dilampirkan ke cabang pull request yang sudah ada?
Bisa. Ia dapat melampirkan worktree ke cabang, pull request, atau commit yang sudah ada.
Bagaimana jika cabangnya sudah dipakai?
Ia memberi tahu Anda di mana cabang itu di-checkout, dan Anda yang memutuskan langkah berikutnya.
Detail
Deskripsi asli dari pembuat
Set up isolated git worktrees β create a new branch for fresh work, or attach a worktree to an existing branch, PR, or commit. Use when starting isolated work or isolating an existing ref.
Popularitas
- Bintang GitHub
- 26k
- Peringkat
- #10052
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
ce-babysit-pr
26kMembantu agent Anda menjaga pull request GitHub tetap bergerak menuju merge dengan menangani komentar review, pemeriksaan gagal dan cabang usang dari waktu ke waktu.
ce-bakeoff
26kMembantu agent Anda membuat beberapa solusi yang saling bersaing untuk sebuah masalah, membandingkannya, lalu menggabungkan bagian terkuat menjadi satu pendekatan yang direkomendasikan.
ce-brainstorm
26kMembantu agent Anda mengubah ide yang samar menjadi kumpulan persyaratan yang jelas dan pas ukurannya sebelum pekerjaan dimulai, melalui percakapan terpandu yang singkat.
ce-code-review
26kMembantu agent Anda meninjau perubahan kode atau pull request tertentu untuk mencari bug, regresi, pengujian yang hilang dan masalah standar, lalu melaporkan temuan yang jelas.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.