using-git-worktrees SKILL.md skillA
using-git-worktrees from jnmetacode/superpowers-zh is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add jnmetacode/superpowers-zh/using-git-worktrees@v1.0.0Pins v1.0.0 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- jnmetacode/superpowers-zh
- Path
skills/using-git-worktrees/SKILL.md- Versions recorded
- 5
- Latest version
- v1.0.0, committed Aug 7, 2026
- First version recorded
- Mar 20, 2026
- Size
- 6,789 bytes
- Repository stars
- 8,348
- License
- MIT
当需要开始与当前工作区隔离的功能开发,或在执行实现计划之前使用——通过原生工具或 git worktree 回退机制确保隔离工作区存在.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 使用 Git 工作树 ## 概述 确保工作发生在隔离的工作区中。优先使用你的平台的原生 worktree 工具。仅在没有原生工具可用时,再回退到手动 git worktree。 **核心原则:** 先检测现有隔离。然后用原生工具。再回退到 git。绝不与 harness 对抗。 **开始时宣布:** "我正在使用 using-git-worktrees 技能来建立一个隔离的工作区。" ## 步骤 0:检测现有隔离 **创建任何东西之前,先检查你是否已经在一个隔离的工作区里。** ```bash GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P) GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P) BRANCH=$(git branch --show-current) ``` **Submodule 守卫:** 在 git submodule 内 `GIT_DIR != GIT_COMMON` 也为真。在判定"已经在 worktree 内"之前,先确认你不在 submodule 里: ```bash # 如果这条命令返回路径,说明你在 submodule 里,不是 worktree —— 按普通仓库处理 git rev-parse --show-superproject-working-tree 2>/dev/null ``` **如果 `GIT_DIR != GIT_COMMON`(且不是 submodule):** 你已经在一个 linked worktree 内。跳到步骤 2(项目设置)。**不要**再创建一个 worktree。 按分支状态报告: - 在某个分支上:"已经在隔离工作区 `<path>`,分支 `<name>`。" - 分离 HEAD:"已经在隔离工作区 `<path>`(分离 HEAD,由外部管理)。完成时需要创建分支。" **如果 `GIT_DIR == GIT_COMMON`(或在 submodule 内):** 你在一个普通的仓库检出里。 用户是否已经在你的 instructions 里表明过 worktree 偏好?如果没有,创建 worktree 之前先征求同意: > "你希望我搭一个隔离的 worktree 吗?它能保护你当前分支不被改动。" 如果用户已声明过偏好,直接遵循,不再询问。如果用户拒绝同意,原地工作并跳到步骤 2。 ## 步骤 1:创建隔离工作区 **你有两种机制。按这个顺序尝试。** ### 1a. 原生 Worktree 工具(首选) …
Read the whole file at its exact version.
How to install
mdr add jnmetacode/superpowers-zh/using-git-worktrees@sha256:13ec7407756b0ad5The line at the top of this page pins the label v1.0.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_oswes2frr6x2z6jh)
5 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 5 versions of this file, between Mar 20, 2026 and Aug 7, 2026, about one every 35 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| v1.0.0 latest | 2026-08-07 | 02d2551 | 6,789 B | A | view · diff |
| v1.0.0 | 2026-06-19 | cf5f6da | 7,739 B | A | view · diff |
| v1.0.0 | 2026-06-16 | 952fc29 | 8,252 B | A | view · diff |
| git:20260512.473b011 | 2026-05-12 | 473b011 | 8,176 B | A | view · diff |
| git:20260320.80bc100 | 2026-03-20 | 80bc100 | 5,484 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (6789 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
jnmetacode/superpowers-zh · 8,348 stars · license MIT · pushed 2026-10-19 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_oswes2frr6x2z6jh GET https://markdownregistry.com/api/v1/resolve?ref=jnmetacode/superpowers-zh/using-git-worktrees GET https://markdownregistry.com/api/v1/blob/13ec7407756b0ad5594afae3736af0531899db10e2bcd7a93cc4f5d836c09d4d
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from jnmetacode/superpowers-zh
Every file in jnmetacode/superpowers-zh