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.

Install it, pinned
mdr add jnmetacode/superpowers-zh/using-git-worktrees@v1.0.0

Pins 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

The exact contents, by fingerprint
mdr add jnmetacode/superpowers-zh/using-git-worktrees@sha256:13ec7407756b0ad5

The 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.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_oswes2frr6x2z6jh.svg)](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.

versioncommittedcommitsizeaudit
v1.0.0 latest2026-08-07 02d2551 6,789 BA view · diff
v1.0.02026-06-19 cf5f6da 7,739 BA view · diff
v1.0.02026-06-16 952fc29 8,252 BA view · diff
git:20260512.473b0112026-05-12 473b011 8,176 BA view · diff
git:20260320.80bc1002026-03-20 80bc100 5,484 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • 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

GitHub

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

AGENTS.md AGENTS.md file
jnmetacode/superpowers-zh · AGENTS.md
git:20260510.a9e02b5 · audit B · 8,348 stars
CLAUDE.md CLAUDE.md file
jnmetacode/superpowers-zh · CLAUDE.md
git:20260907.3437ce2 · audit A · 8,348 stars
brainstorming SKILL.md skill
jnmetacode/superpowers-zh · skills/brainstorming/SKILL.md · 在任何创造性工作之前必须使用此技能——创建功能、构建组件、添加功能、修改行为,或筹划任何新东西,无论是软件还是软件之外(一场分享、一门生意、一次装修)。
v1.0.0 · audit A · 8,348 stars
chinese-code-review SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-code-review/SKILL.md · 中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
v1.0.0 · audit A · 8,348 stars
chinese-commit-conventions SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-commit-conventions/SKILL.md · 中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog…
v1.0.0 · audit A · 8,348 stars
chinese-documentation SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-documentation/SKILL.md · 中文文档排版参考——中英文空格、全半角标点、术语保留、链接格式、中文文案排版指北约定。仅在用户显式 /chinese-documentation 时调用,不要根据上下文自动触发。
v1.0.0 · audit A · 8,348 stars
chinese-git-workflow SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-git-workflow/SKILL.md · 国内 Git 平台配置参考——Gitee、Coding.net、极狐 GitLab、CNB 的 SSH/HTTPS/凭据/CI 接入差异与镜像同步配置。仅在用户显式 /chinese-git-workflow…
v1.0.0 · audit A · 8,348 stars
diagnosing-superpowers SKILL.md skill
jnmetacode/superpowers-zh · skills/diagnosing-superpowers/SKILL.md · 当一次 superpowers 会话出了问题、你的人类伙伴想知道原因时使用——重复劳动、无视计划、磕磕绊绊、结果质量差、某个技能没触发、"太慢了"、"为什么这么贵"、"它到底在干什么"——或者想给 superpowers 维护者整理一份…
v1.0.0 · audit A · 8,348 stars
dispatching-parallel-agents SKILL.md skill
jnmetacode/superpowers-zh · skills/dispatching-parallel-agents/SKILL.md · 当面对 2 个以上可以独立进行、无共享状态或顺序依赖的任务时使用
v1.0.0 · audit A · 8,348 stars
executing-plans SKILL.md skill
jnmetacode/superpowers-zh · skills/executing-plans/SKILL.md · 当你要在当前会话里亲自担任实现者执行一份实现计划时使用——你的人类伙伴选择了内联执行,或者没有可用的子智能体工具
v1.0.0 · audit A · 8,348 stars
finishing-a-development-branch SKILL.md skill
jnmetacode/superpowers-zh · skills/finishing-a-development-branch/SKILL.md · 当实现完成、所有测试通过、需要决定如何集成这份工作时使用
v1.0.0 · audit A · 8,348 stars
mcp-builder SKILL.md skill
jnmetacode/superpowers-zh · skills/mcp-builder/SKILL.md · 在构建 MCP 服务器或 MCP 工具时使用 —— 系统化的生产级 MCP 构建方法论,覆盖工具设计、错误处理、传输层选择与测试,让 AI 助手连接外部能力
v1.0.0 · audit A · 8,348 stars

Every file in jnmetacode/superpowers-zh

Other files named using-git-worktrees

using-git-worktrees SKILL.md skill
obra/superpowers · skills/using-git-worktrees/SKILL.md · Use when starting feature work that needs isolation from current workspace or before executing implementation plans -…
git:20260724.bc86802 · audit A · 302,424 stars
using-git-worktrees SKILL.md skill
a5c-ai/babysitter · library/methodologies/superpowers/skills/using-git-worktrees/SKILL.md · Use when starting feature work that needs isolation from current workspace or before executing implementation plans.
git:20260601.da7723a · audit A · 1,862 stars
using-git-worktrees SKILL.md skill
ganyuanran/aegis · skills/using-git-worktrees/SKILL.md · Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or…
git:20260827.661bec4 · audit A · 1,371 stars
using-git-worktrees SKILL.md skill
coco-research/coco · skills/using-git-worktrees/SKILL.md · Use when starting feature work that needs isolation from current workspace or before executing implementation plans -…
git:20260802.1479e32 · audit A · 827 stars
using-git-worktrees SKILL.md skill
xu123-bob/baize · agent/skills/superpowers/5.1.0/skills/using-git-worktrees/SKILL.md · Use when starting feature work that needs isolation from current workspace or before executing implementation plans -…
git:20260912.5e131e8 · audit A · 581 stars
using-git-worktrees SKILL.md skill
jamditis/claude-skills-journalism · superjawn/skills/using-git-worktrees/SKILL.md · Creates isolated git worktrees with smart directory selection and safety checks. Use when starting isolated feature…
git:20260818.3e0e3a8 · audit A · 427 stars
using-git-worktrees SKILL.md skill
ibrahim-3d/orchestrator-supaconductor · skills/using-git-worktrees/SKILL.md · Use when starting feature work that needs isolation from current workspace or before executing implementation plans -…
git:20260312.c37221c · audit A · 380 stars
using-git-worktrees SKILL.md skill
ed3dai/ed3d-plugins · plugins/ed3d-plan-and-execute/skills/using-git-worktrees/SKILL.md · Use when starting feature work that needs isolation from current workspace or before executing implementation plans -…
git:20260204.611bfd1 · audit A · 253 stars

Browse by kind, by grade A, or by owner.