worktree SKILL.md skillA
worktree from lixiuxiu559/agentforge is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add lixiuxiu559/agentforge/worktree@git:20261030.ed65f43Pins git:20261030.ed65f43 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- lixiuxiu559/agentforge
- Path
skills/worktree/SKILL.md- Versions recorded
- 4
- Latest version
- git:20261030.ed65f43, committed Oct 30, 2026
- First version recorded
- Sep 22, 2026
- Size
- 5,262 bytes
- Repository stars
- 4
- License
- MIT
创建和删除 Git worktree,目录固定在目标项目根的 worktree/ 下并保留分支层级。add 从本地或远端基线创建新分支;remove 移除工作树并保留分支。用户要求创建、删除 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
# Worktree 管理
```text
/agentforge:worktree add dev feature/login
/agentforge:worktree remove feature/login
```
add 接受 from、新分支两个参数;remove 接受一个分支参数,动作不可省略。不接受目录参数,目标固定为 `<项目主工作树根>/worktree/<分支>/`,如 `worktree/feature/login/`。
## 公共规则
- 用 `git -C "<目标项目目录>" worktree list --porcelain` 确定主工作树根 `$root`;在 linked worktree 中调用也使用该根,不使用技能安装目录或当前 shell 目录。裸仓库不支持。之后所有仓库命令都显式写 `git -C "$root"` 或 `git -C "$target"`,不依赖当前工作目录。
- 校验动作、参数数量及分支名:用 `git check-ref-format "refs/heads/$branch"`,拒绝以 `-` 开头的名称,不展开 checkout 简写。远端名来自仓库配置,同样视为不可信:必须精确出现在 `git -C "$root" remote` 的输出中,且不能以 `-` 开头、不能含空白或控制字符,否则停止并报告。命令参数安全传递,shell 变量始终引用,远端名放在 `--` 之后,防止被 Git 解析为选项。
- 目标必须在根 `worktree/` 内,目标和父路径不能经过符号链接、嵌入另一工作树或独立仓库。
- 旧 `.worktree/` 中的工作树不自动迁移或删除;remove仅核对新约定路径,旧路径另有登记时报告实际位置,不把同名目录当作目标。
- 使用原生 Git,不要求当前分支为 dev。不切换分支、不自动暂存、提交、stash、推送、删除分支或安装依赖。
- 检查失败就停止并报告实际状态;不把查询失败当作不存在,不自动覆盖、解锁、prune 或清理残留。强制删除必须先说明具体数据风险并获得用户对本次丢弃的明确同意。
## add
1. **选择来源**:询问 from 使用本地还是远端;对话已明确时不重复询问。默认远端为 origin,没有 origin 时使用唯一远端,存在多个则补问;选定后按公共规则校验远端名。无远端或无法查询就停止,即使 from 选择本地也要检查远端重名。
2. **锁定基线**:本地用 `git -C "$root" rev-parse --verify --end-of-options "refs/heads/$from^{commit}"` 解析;远端先获取指定分支,再解析远端跟踪引用,记录完整 OID。例如:
```bash
…Read the whole file at its exact version.
How to install
mdr add lixiuxiu559/agentforge/worktree@sha256:41c00aa6009df6e1The line at the top of this page pins the label git:20261030.ed65f43, 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_mksdhyac74qalqjk)
1 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 4 versions of this file, between Sep 22, 2026 and Oct 30, 2026, about one every 13 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261030.ed65f43 latest | 2026-10-30 | ed65f43 | 5,262 B | A | view · diff |
| git:20261029.8c195f5 | 2026-10-29 | 8c195f5 | 4,726 B | A | view · diff |
| git:20261028.42f4dae | 2026-10-28 | 42f4dae | 4,559 B | A | view · diff |
| git:20260922.c2d70a5 | 2026-09-22 | c2d70a5 | 3,996 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 (5262 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
lixiuxiu559/agentforge · 4 stars · license MIT · pushed 2026-10-31 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_mksdhyac74qalqjk GET https://markdownregistry.com/api/v1/resolve?ref=lixiuxiu559/agentforge/worktree GET https://markdownregistry.com/api/v1/blob/41c00aa6009df6e1c5239569bfbbb9f1c1a684830429e48dcdf99533766e0961
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 lixiuxiu559/agentforge
Every file in lixiuxiu559/agentforge