add-worktree
Skill2 starsChanged 22 days agoMITView on GitHub
Use when the user wants to work on something in parallel without touching the current tree — "new worktree", "spin up a branch for this", "work on X separately". 本仓库 无 .git,等价做法是「复制源码树 + 新建工程树」,路径为 `<aitools>/src/<task>` 与 `<aitools>/project/<task>`。
- Deletes or force-pushes
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- niki914/zafiroedited, first seen Oct 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- niki914/zafiro★ 34620% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- answer-me-with-htmlSkill
- extract-apkSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- proceed-videoSkill
- prompt-engineeringSkill
- release-new-versionSkill
- test-hang-watchdogSkill
- test-triageSkill
- writing-for-agentsSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 76
Run removal only on explicit request.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Worktree
本仓库无 git 历史,没有
.git,git worktree全部命令不可用。 等价语义:一条"工作线"=src/<task>(可编辑副本)+project/<task>(构建镜像)+ 可选独立包名/根域。
Worktrees live in a sibling directory of the primary repo, one directory per branch:
<parent of primary repo>/zafiro-worktrees/<branch name>The directory is the branch name, character for character. A slashed name (fix/latex-render) nests: zafiro-worktrees/fix/latex-render. dev-to-main at /Users/niki/.repo/android/zafiro-worktrees/dev-to-main is a lived example of the layout.
1 — Name the branch from the requirement
本仓库无 git 分支,本节用于任务目录命名(
src/<task>与project/<task>同名);命名规范原文保留。
<type>-<kebab-case-summary>, following the repo's existing branch convention (feat/agent-status, refactor/aidl-state-sync).
| Type | For |
feat | new capability |
fix | bug fix |
refactor | behaviour-preserving restructure |
perf | speed / memory |
chore | build, deps, tooling |
test | tests only |
docs | docs only |
Rules: lowercase ASCII, hyphens only, summary describes the change (fix/latex-blank-render, not fix/niki-work); ≤ 40 characters total, since the name is also the directory name; no ticket numbers, no dates.
The summary comes from what the user asked for. If the user asks for a parallel line without saying what the work is, ask before naming — a task name guessed from nothing is a rename later. 目录名用连字符,不用斜杠(避免与 project/<tree> 的层级冲突)。
2 — Resolve the paths
A=/data/local/aitools # 根域;测试包可能是 $A-btN
TASK=fix-latex-blank-render # from step 1
S=$A/src/$TASK # 可编辑副本(约 70 MB,含 assets)
P=$A/project/$TASK # 构建镜像;必须与源码树同名
ls -d "$S" "$P" 2>/dev/null && echo "REFUSE: 已存在,先收线"build-src.sh 的硬性要求:project/<名> 与 src/<名> 同名一一对应,否则拒绝构建。
3 — Create it
Base 是当前主线 src/zafiro-15-1.8.1-Fork,除非用户指定别的基线。
cp -a $A/src/zafiro-15-1.8.1-Fork "$S"
mkdir -p "$P" && rsync -a --exclude build --exclude .gradle --exclude .kotlin "$S/" "$P/"
# 构建这条线(必须显式 --src=,且 VARIANT=debug)
cd $A && ZAFIRO_VARIANT=debug ZAFIRO_APK_NAME="Forge-$TASK.apk" \
sh env.sh build --src="$P" --max-workers=1真机并行验证时给测试线换包名,根域自动分到 $A-btN:
sed -i 's/applicationId = "com.hoerire.tools"/applicationId = "com.hoerire.tools.bt"/' "$P/app/build.gradle.kts"Report the absolute paths ($S, $P, 产物 APK) back to the user.
4 — Remove it
rm -rf "$S" "$P"
pm uninstall com.hoerire.tools.bt 2>/dev/nullRun removal only on explicit request; leftover trees with uncommitted work are the user's to discard. 收线前先把要保留的改动人工挑回主线(rsync -a --dry-run 先看差异,勿整目录覆盖)。
5 — 共用环境,不要复制
$A/环境(rootfs + SDK + Gradle,约 2.8 GB)唯一,两条线共用。换根域构建前清残留 bind 挂载:
for p in $(awk '{print $2}' /proc/mounts | grep -F "$A/env/rootfs/"); do umount -l "$p"; doneDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

