Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)33k · #8814

worktree-guide

Skill này làm gì

Hướng dẫn này dạy bạn cách làm nhiều tác vụ cùng lúc trong một dự án git, dùng worktree, bảng terminal và Lazygit. Nó dành cho người muốn một cách thiết lập thực tế, từng bước.

Khi nào nên dùng

  • ✓Khi bạn muốn thiết lập nhiều tác vụ song song mà không phải chuyển nhánh.
  • ✓Khi bạn mới làm quen với git worktree và muốn một hướng dẫn có định hướng.
  • ✓Khi bạn muốn tài liệu tham khảo để theo dõi nhiều worktree bằng Lazygit.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/worktree-guide/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/worktree-guide/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy hướng dẫn tôi thiết lập worktree song song để tôi có thể làm hai tính năng cùng lúc.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Hướng dẫn trước tiên kiểm tra thư mục của bạn có phải là dự án git không, rồi giải thích một bố cục với các bảng terminal, và giúp bạn tạo và quản lý worktree từng bước một.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Guide the user through parallel development workflows using Ghostty terminal panels, git worktrees, and Lazygit. This is both a teaching experience and a practical reference.


Preflight

Before starting, detect the user's environment:

git rev-parse --is-inside-work-tree 2>&1 && echo "GIT_OK" || echo "NOT_GIT"

If not a git repo:

This isn't a git repository. Navigate to a git project first, then come back to /worktree-guide.

Check if we're in a worktree or main repo:

git worktree list
pwd

Note the context for later guidance.


Phase 1: Welcome & Context Detection

Display based on environment:

If in main repo:

## Worktree Parallel Development Guide

Welcome! I'll guide you through setting up and using parallel worktrees for multi-task development.

┌─────────────────────────────────────────────────────────────┐
│  Ghostty Terminal                                           │
│  ┌──────────────────────┬──────────────────────┐           │
│  │                      │                      │           │
│  │   Claude (Task 1)    │   Claude (Task 2)    │           │
│  │   claude/login-page   │   claude/fix-auth-bug │           │
│  │                      │                      │           │
│  ├──────────────────────┴──────────────────────┤           │
│  │              Lazygit (monitoring)           │           │
│  └─────────────────────────────────────────────┘           │
└─────────────────────────────────────────────────────────────┘

**Your workflow:**
1. Create worktrees → `/worktree-init`
2. Open Ghostty panels → `Cmd+D` / `Cmd+Shift+D`
3. Run Claude in each panel → `cd <worktree> && claude`
4. Deliver when done → `/worktree-deliver`
5. Clean up → `/worktree-cleanup`

What would you like to do?

Use AskUserQuestion:

  • "Learn the full workflow" — Start from Phase 2
  • "Just show keybindings" — Jump to Quick Reference
  • "Create worktrees now" — Suggest /worktree-init
  • "Something else" — Ask what they need

If already in a worktree:

## Worktree Status

You're already inside a worktree! Let me check your status.

Then run the equivalent of /worktree-check and provide contextual guidance.


Phase 2: Ghostty Essentials

EXPLAIN:

## Ghostty Panel Management

Ghostty's panel system is perfect for parallel development. Here are the essential keybindings:

SHOW:

┌─────────────────────────────────────────────────────────────┐
│                    GHOSTTY KEYBINDINGS                      │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  SPLITTING                                                  │
│  ─────────                                                  │
│  Cmd+D           Split panel to the right                   │
│  Cmd+Shift+D     Split panel below                          │
│                                                             │
│  NAVIGATION                                                 │
│  ─────────                                                  │
│  Cmd+Alt+←/→/↑/↓ Move focus between panels                  │
│  Cmd+[/]         Cycle through panels                       │
│                                                             │
│  SIZING                                                     │
│  ─────────                                                  │
│  Cmd+Shift+E     Equalize all panel sizes                   │
│  Cmd+Shift+F     Toggle zoom (fullscreen current panel)     │
│                                                             │
│  CLOSING                                                    │
│  ─────────                                                  │
│  Cmd+W           Close current panel                        │
│                                                             │
└─────────────────────────────────────────────────────────────┘

**Pro tip:** Use Cmd+Shift+F to zoom into a panel when you need focus, then press it again to return to the multi-panel view.

PAUSE - "Ready to learn about Lazygit? (Or skip to workflow)"


Phase 3: Lazygit Essentials

EXPLAIN:

## Lazygit for Monitoring Worktrees

Lazygit gives you a visual overview of all your worktrees and their changes. Run it from your main repo to monitor everything.

SHOW:

┌─────────────────────────────────────────────────────────────┐
│                    LAZYGIT KEYBINDINGS                      │
Câu hỏi thường gặp

Tôi có cần Ghostty để dùng không?

Hướng dẫn được xây dựng quanh Ghostty và Lazygit, nên đó là các công cụ nó gợi ý cho thiết lập này.

Nếu tôi không ở trong một dự án git thì sao?

Hướng dẫn bảo bạn mở một dự án git trước, rồi chạy lại.

Nó chỉ là một bộ hướng dẫn thôi sao?

Không. Nó mang tính tương tác, nên agent của bạn có thể kiểm tra môi trường và hướng dẫn bạn qua từng bước.

Chi tiết

Mô tả gốc của tác giả

Interactive guide for parallel development with Ghostty, git worktrees, and Lazygit. Use when setting up multi-task workflows or learning the worktree system.

repo: davila7/claude-code-templates

Độ phổ biến

Sao GitHub
33k
Vị trí xếp hạng
#8814
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự