Agent skill · Audited from source
Using Git Worktrees
skill · jnMetaCode/superpowers-zhMIT licenceAudited 7 Oct 2026 · source 61f7309eda3e
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 61f7309eda3e and found no filesystem, network or shell access and no hard-coded secrets. What it does: 当需要开始与当前工作区隔离的功能开发,或在执行实现计划之前使用——通过原生工具或 git worktree 回退机制确保隔离工作区存在
Cite
Cite this page
ModelsAtlas. “Using Git Worktrees (jnMetaCode/superpowers-zh)”. Retrieved 7 Oct 2026. https://modelsatlas.com/skills/jnmetacode/using-git-worktrees
6 skills are called “Using Git Worktrees”. You are viewing jnMetaCode/superpowers-zh.
- jnMetaCode/superpowers-zh★ 8.3k✓SAFE
- obra/superpowers★ 307k✓SAFE
- xintaofei/codeg★ 3.9k✓SAFE
- FreedomIntelligence/OpenClaw-Medical-Skills★ 3.1k✓SAFE
- GanyuanRan/Aegis★ 1.4k✓SAFE
and 1 more with this name.
Trust audit
Audit 0.4.1 · source read 7 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 1 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (1)
LOWInventory / provenanceinv.symlink · AGENTS.md
AGENTS.md
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha 61f7309eda3e · 7 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- PublisherjnMetaCode GitHub userOwner of the repository this skill is read from
- Source folderjnMetaCode/superpowers-zh/skills/using-git-worktreesThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdict61f7309eda3eA new audit runs when the source changes
- Repository statusNot archivedLast push 2 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: 当需要开始与当前工作区隔离的功能开发,或在执行实现计划之前使用——通过原生工具或 git worktree 回退机制确保隔离工作区存在
---
name: using-git-worktrees
description: 当需要开始与当前工作区隔离的功能开发,或在执行实现计划之前使用——通过原生工具或 git worktree 回退机制确保隔离工作区存在
version: "1.0.0"
license: MIT
metadata:
hermes:
tags: [git, workflow]
---
# 使用 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 工具(首选)
用户已经请求隔离工作区(步骤 0 已获同意)。你是否已经有创建 worktree 的方法?可能是名为 `EnterWorktree`、`WorktreeCreate` 的工具、`/worktree` 命令,或 `--worktree` 标志。如果有,用它,然后跳到步骤 2。
原生工具自动处理目录放置、分支创建和清理。在你已经有原生工具的情况下使用 `git worktree add`,会创建你的 harness 看不到也无法管理的"幻影状态"。
只有在没有原生 worktree 工具可用时,才进入步骤 1b。
### 1b. Git Worktree 回退
**只在步骤 1a 不适用时使用** —— 你没有可用的原生 worktree 工具。手动用 git 创建 worktree。
#### 目录选择
按以下优先级。明确的用户偏好始终优先于观察到的文件系统状态。
1. **检查你的 instructions 里是否声明过 worktree 目录偏好。** 如果用户已指定,不再询问直接用。
2. **检查是否存在项目本地的 worktree 目录:**
```bash
ls -d .worktrees 2>/dev/null # 首选(隐藏目录)
ls -d worktrees 2>/dev/null # 备选
```
找到就用。如果两者都存在,`.worktrees` 优先。
3. **如果没有其他可参考的信息**,默认用项目根目录下的 `.worktrees/`。
#### 安全验证(仅项目本地目录)
**创建 worktree 前必须验证目录已被忽略:**
```bash
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
```
**如果未被忽略:** 添加到 .gitignore,提交该改动,然后继续。
**为什么关键:** 防止 worktree 内容被意外提交到仓库。
#### 创建工作树
```bash
# 根据选定位置确定路径
path="$LOCATION/$BRANCH_NAME"
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"
```
**沙盒回退:** 如果 `git worktree add` 因权限错误(沙盒拒绝)失败,告诉用户沙盒阻止了 worktree 创建,你将在当前目录原地工作。然后原地运行 setup 和基线测试。
## 步骤 2:项目设置
自动检测并运行相应的设置命令:
```bash
# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi
```
## 步骤 3:验证基线干净
运行测试确保工作区初始状态干净:
```bash
# 使用项目对应的命令
npm test / cargo test / pytest / go test ./...
```
**如果测试失败:** 报告失败,询问是继续还是排查。
**如果测试通过:** 报告就绪。
### 报告
```
工作树已就绪:<full-path>
测试通过(<N> 个测试,0 个失败)
准备实现 <feature-name>
```
## 快速参考
| 情况 | 操作 |
|------|------|
| 已在 linked worktree 内 | 跳过创建(步骤 0) |
| 在 submodule 内 | 按普通仓库处理(步骤 0 守卫) |
| 有原生 worktree 工具 | 用它(步骤 1a) |
| 没有原生工具 | git worktree 回退(步骤 1b) |
| `.worktrees/` 存在 | 用它(验证已忽略) |
| `worktrees/` 存在 | 用它(验证已忽略) |
| 两者都存在 | 用 `.worktrees/` |
| 都不存在 | 检查 instructions 文件,再默认 `.worktrees/` |
| 目录未被忽略 | 添加到 .gitignore + 提交 |
| 创建时权限错误 | 沙盒回退,原地工作 |
| 基线测试失败 | 报告失败 + 询问 |
| 无 package.json/Cargo.toml | 跳过依赖安装 |
## 常见的合理化借口
| 借口 | 现实 |
|------|------|
| "我显然不在 worktree 里,不用检查" | 跑步骤 0。宿主环境创建的隔离和 submodule 都能骗过肉眼;只有检测命令能定论。 |
| "`git worktree add` 比去找原生工具快" | 原生工具(如 `EnterWorktree`)掌管位置、分支和清理。绕过它是**第一大错误** —— 会造出你的宿主环境看不见也管不了的幽灵状态。 |
| "这个 worktree 目录肯定已经被忽略了" | 跑 `git check-ignore`。一个没被忽略的 worktree 目录会把整棵树提交进仓库。 |
| "目录名随便取都行" | 明确指示 > 已存在的项目内目录 > `.worktrees/` 默认值。 |
| "工作区是全新的,基线测试可以先放放" | 基线不干净会让之后每一次失败都含义不明。现在就跑测试;越过失败继续是你人类伙伴的决定。 |Excerpt, first 3,926 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 61f7309
git clone https://github.com/jnMetaCode/superpowers-zh git -C superpowers-zh checkout 61f7309eda3e
The author documents no install command, so this uses the repository directly. Our verdict covers commit 61f7309eda3e only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
61f7309eda3e
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/jnmetacode/using-git-worktrees/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →jnMetaCode/superpowers-zh
中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
jnMetaCode/superpowers-zh
中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。
jnMetaCode/superpowers-zh
中文文档排版参考——中英文空格、全半角标点、术语保留、链接格式、中文文案排版指北约定。仅在用户显式 /chinese-documentation 时调用,不要根据上下文自动触发。
jnMetaCode/superpowers-zh
国内 Git 平台配置参考——Gitee、Coding.net、极狐 GitLab、CNB 的 SSH/HTTPS/凭据/CI 接入差异与镜像同步配置。仅在用户显式 /chinese-git-workflow 时调用,不要根据上下文自动触发。
jnMetaCode/superpowers-zh
当面对 2 个以上可以独立进行、无共享状态或顺序依赖的任务时使用
jnMetaCode/superpowers-zh
当你要在当前会话里亲自担任实现者执行一份实现计划时使用——你的人类伙伴选择了内联执行,或者没有可用的子智能体工具
Add this badge to your README
[](https://modelsatlas.com/skills/jnmetacode/using-git-worktrees/)
<a href="https://modelsatlas.com/skills/jnmetacode/using-git-worktrees/"><img src="https://modelsatlas.com/skills/jnmetacode/using-git-worktrees/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Using Git Worktrees
What does the Using Git Worktrees skill do?
Is Using Git Worktrees safe to install?
What can Using Git Worktrees access on my machine?
How current is this page?
Sources
- github.com/jnMetaCode/superpowers-zh/tree/main/skills/using-git- — the audited source at commit 61f7309eda3e and every finding aboveObserved · 7 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Using Git Worktrees skill do?
- Is Using Git Worktrees safe to install?
- What can Using Git Worktrees access on my machine?