skills/project-worktrees/SKILL.md
项目级 Git worktree 管理工具,面向协同 Agent 设计。支持在项目 .worktrees 目录下创建隔离开发环境,自动依赖安装和测试验证。
npx skillsauth add sampx/agent-tools project-worktreesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
项目级 Git worktree 管理工具,专为协同 Agent 设计。在项目的 .worktrees/ 目录下创建隔离的开发环境,支持并行开发、实验性功能隔离。
与 git-worktrees 的区别:
| 特性 | git-worktrees | project-worktrees |
|------|--------------|-------------------|
| 管理层级 | 工作空间级 | 项目级 |
| worktree 路径 | <workspace>/.worktrees/<project>-<branch> | <project>/.worktrees/<branch> |
| 项目参数 | 需要 <project> | 不需要 |
| OpenSpec 集成 | 有 | 无 |
| 目标用户 | Wopal 主 Agent | 沙箱内的协同 Agent |
# 在项目根目录执行
./scripts/worktree.sh create <branch>
./scripts/worktree.sh list
./scripts/worktree.sh remove <branch>
# 创建新分支(默认)
./scripts/worktree.sh create feature-auth
# 跳过依赖安装
./scripts/worktree.sh create feature/test --no-install
# 跳过测试
./scripts/worktree.sh create feature/test --no-test
# 使用已存在的分支
./scripts/worktree.sh create hotfix-123 --checkout
创建新的 worktree。
语法:
./scripts/worktree.sh create <branch> [选项]
参数:
<branch>: 分支名(分支中的 / 会自动转换为 -)选项:
| 选项 | 说明 |
|------|------|
| --no-install | 跳过依赖安装 |
| --no-test | 跳过测试运行 |
| --checkout | 使用已存在的分支(不创建新分支) |
路径规则:
<project>/.worktrees/<branch>
示例:
feature/auth.worktrees/feature-auth列出当前项目的所有 worktree。
./scripts/worktree.sh list
删除 worktree。
语法:
./scripts/worktree.sh remove <branch> [--force]
选项:
| 选项 | 说明 |
|------|------|
| --force, -f | 跳过确认直接删除(适合 Agent 使用) |
清理已删除分支的 worktree 记录。
./scripts/worktree.sh prune
创建 worktree 时自动执行:
${project}/.worktrees/${branch})--no-install 跳过)--no-test 跳过)脚本会根据锁文件自动选择包管理器:
| 锁文件 | 包管理器 |
|--------|---------|
| pnpm-lock.yaml | pnpm install |
| package-lock.json | npm install |
| yarn.lock | yarn install |
| bun.lockb | bun install |
| 无锁文件 | 优先 pnpm(如果可用) |
# 创建多个隔离环境
./scripts/worktree.sh create feature/auth --no-test
./scripts/worktree.sh create feature/logging --no-test
# 在不同环境工作
cd .worktrees/feature-auth
# ... 开发 ...
# 创建隔离环境
./scripts/worktree.sh create hotfix/security-patch
# 修复完成后清理
cd .worktrees/hotfix-security-patch
git commit -m "fix: 安全补丁"
cd ../..
./scripts/worktree.sh remove hotfix/security-patch --force
# 适合 Agent 使用的完整流程
./scripts/worktree.sh create feature/agent-task --no-test
cd .worktrees/feature-agent-task
# ... Agent 执行任务 ...
git add . && git commit -m "feat: 完成任务"
cd ../..
./scripts/worktree.sh remove feature/agent-task --force
# 1. 创建功能分支 worktree
./scripts/worktree.sh create feature/new-skill
# 2. 切换到 worktree
cd .worktrees/feature-new-skill
# 3. 开发
# ... 编写代码、测试 ...
# 4. 提交
git add .
git commit -m "feat: 添加新技能"
# 5. 回到主工作区合并
cd ..
git checkout main
git merge feature/new-skill --no-ff
# 6. 清理 worktree
./scripts/worktree.sh remove feature/new-skill --force
remove 清理,避免僵尸目录--force 选项可跳过交互确认,适合 Agent 自动化场景tools
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
development
Workspace-level Git worktree management — create, list, remove, and prune isolated development environments. Use this skill whenever the user needs to create a worktree, set up an isolated workspace, work on multiple features in parallel, list existing worktrees, check what worktrees exist, remove or delete a worktree, clean up stale worktrees, or manage git working trees in any way. Triggers include "create worktree", "new worktree", "list worktrees", "show worktrees", "remove worktree", "delete worktree", "clean up worktree", "prune worktree", "isolated environment", "parallel development", "worktree for <project>", or any request involving git worktree operations.
development
Issue/Plan-driven development workflow. Tasks must be backed by a GitHub Issue or Plan. Trigger: issue references like #14, creating issues, creating plans, implementing plans, executing plans, checking plans, verifying plans, Plan lifecycle transitions (approve/complete/verify/archive), decomposing PRDs into Issues. Skip: spec-driven workflows, research/discussion/explanation only, small ad-hoc changes that don't need an Issue or Plan.
testing
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.