worktrunk by max-sixty/worktrunk
npx skills add https://github.com/max-sixty/worktrunk --skill worktrunk帮助用户使用 Worktrunk,这是一个用于管理 git worktree 的 CLI 工具。
参考文件从 worktrunk.dev 文档同步:
对于特定命令的选项,请运行 wt <command> --help。对于配置,请遵循以下工作流程。
Worktrunk 使用两个独立的配置文件,它们具有不同的作用域和行为:
~/.config/worktrunk/config.toml)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
~/.config/worktrunk/config.tomlreference/config.md 获取详细指南.config/wt.toml)<repo>/.config/wt.toml(提交到 git)reference/hook.md 获取详细指南当用户请求配置帮助时,根据以下情况确定类型:
用户配置指标 :
项目配置指标 :
可能需要两种配置 : 例如,设置提交信息生成需要用户配置,但自动化质量检查需要项目配置。
最常见的请求。支持的工具和确切命令语法请参见 reference/llm-commits.md。
检测可用工具
which claude codex llm aichat 2>/dev/null
如果未安装任何工具,推荐 Claude Code(在 Claude Code 会话中已可用)
提议配置更改 — 从 reference/llm-commits.md 获取确切命令
[commit.generation]
command = "..." # 工具特定命令请参见 reference/llm-commits.md
询问:"我是否应该将此添加到您的配置中?"
批准后,应用
wt config showwt config create建议测试
wt step commit --show-prompt | head # 验证提示构建
wt merge # 在具有未提交更改的仓库中
工作流自动化的常见请求。遵循发现流程:
检测项目类型
ls package.json Cargo.toml pyproject.toml
识别可用命令
package.json 脚本设计适当的钩子(有 7 种钩子类型可用)
post-createpre-commit 或 pre-mergepost-startpost-switchpost-mergepre-remove验证命令有效
npm run lint # 验证存在
which cargo # 验证工具存在
创建.config/wt.toml
# 创建 worktree 时安装依赖项
post-create = "npm install"
# 提交前验证代码质量
[pre-commit]
lint = "npm run lint"
typecheck = "npm run typecheck"
# 合并前运行测试
pre-merge = "npm test"
添加注释解释选择
建议测试
wt switch --create test-hooks
完整细节请参见reference/hook.md。
当用户想要向现有项目添加自动化时:
读取现有配置 : cat .config/wt.toml
确定钩子类型 - 此操作应在何时运行?
post-createpost-startpost-switchpre-commitpre-mergepost-mergepre-remove如果需要,处理格式转换
从单个命令到命名表:
# 之前
post-create = "npm install"
# 之后(添加 db:migrate)
[post-create]
install = "npm install"
migrate = "npm run db:migrate"
4. 保留现有结构和注释
在添加钩子之前,验证:
# 验证命令存在
which npm
which cargo
# 对于 npm,验证脚本存在
npm run lint --dry-run
# 对于 shell 命令,检查语法
bash -n -c "if [ true ]; then echo ok; fi"
危险模式 — 在创建包含以下内容的钩子之前警告用户:
rm -rf、DROP TABLEcurl http://...sudoreference/llm-commits.mdreference/config.md#worktree-path-templatereference/llm-commits.md#templatesreference/config.md#command-settingsreference/config.md#user-hooksreference/hook.mdreference/hook.md#configurationreference/hook.md#template-variablesreference/config.md#dev-server-url# 查看所有配置
wt config show
# 创建初始用户配置
wt config create
# LLM 设置指南
wt config --help
加载参考文件以获取详细的配置、钩子规范和故障排除。
使用 grep 查找特定部分:
grep -A 20 "## Setup" reference/llm-commits.md
grep -A 30 "### post-create" reference/hook.md
grep -A 20 "## Warning Messages" reference/shell-integration.md
当用户请求在后台会话中生成一个带有 Claude 的 worktree("为...生成一个 worktree"、"交接给另一个代理")时,请根据其终端复用器使用适当的模式:
tmux(检查 $TMUX 环境变量):
tmux new-session -d -s <branch-name> "wt switch --create <branch-name> -x claude -- '<task description>'"
Zellij(检查 $ZELLIJ 环境变量):
zellij run -- wt switch --create <branch-name> -x claude -- '<task description>'
要求(必须全部满足):
对于正常的 worktree 操作,请勿使用此模式。
示例(tmux):
tmux new-session -d -s fix-auth-bug "wt switch --create fix-auth-bug -x claude -- \
'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'"
示例(Zellij):
zellij run -- wt switch --create fix-auth-bug -x claude -- \
'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'
每周安装数
308
仓库
GitHub 星标数
3.7K
首次出现
2026 年 1 月 20 日
安全审计
安装于
opencode301
github-copilot291
gemini-cli291
codex290
amp287
kimi-cli287
Help users work with Worktrunk, a CLI tool for managing git worktrees.
Reference files are synced from worktrunk.dev documentation:
For command-specific options, run wt <command> --help. For configuration, follow the workflows below.
Worktrunk uses two separate config files with different scopes and behaviors:
~/.config/worktrunk/config.toml)~/.config/worktrunk/config.toml (never checked into git)reference/config.md for detailed guidance.config/wt.toml)<repo>/.config/wt.toml (checked into git)reference/hook.md for detailed guidanceWhen a user asks for configuration help, determine which type based on:
User config indicators :
Project config indicators :
Both configs may be needed : For example, setting up commit message generation requires user config, but automating quality checks requires project config.
Most common request. See reference/llm-commits.md for supported tools and exact command syntax.
Detect available tools
which claude codex llm aichat 2>/dev/null
If none installed, recommend Claude Code (already available in Claude Code sessions)
Propose config change — Get the exact command from reference/llm-commits.md
[commit.generation]
command = "..." # see reference/llm-commits.md for tool-specific commands
Ask: "Should I add this to your config?"
After approval, apply
wt config showwt config createSuggest testing
wt step commit --show-prompt | head # verify prompt builds
wt merge # in a repo with uncommitted changes
Common request for workflow automation. Follow discovery process:
Detect project type
ls package.json Cargo.toml pyproject.toml
Identify available commands
package.json scriptsDesign appropriate hooks (7 hook types available)
post-createpre-commit or pre-mergepost-startpost-switchSeereference/hook.md for complete details.
When users want to add automation to an existing project:
Read existing config : cat .config/wt.toml
Determine hook type - When should this run?
post-createpost-startpost-switchpre-commitpre-mergepost-mergepre-removeSingle command to named table:
# Before
post-create = "npm install"
# After (adding db:migrate)
[post-create]
install = "npm install"
migrate = "npm run db:migrate"
4. Preserve existing structure and comments
Before adding hooks, validate:
# Verify command exists
which npm
which cargo
# For npm, verify script exists
npm run lint --dry-run
# For shell commands, check syntax
bash -n -c "if [ true ]; then echo ok; fi"
Dangerous patterns — Warn users before creating hooks with:
rm -rf, DROP TABLEcurl http://...sudoreference/llm-commits.mdreference/config.md#worktree-path-templatereference/llm-commits.md#templatesreference/config.md#command-settingsreference/config.md#user-hooksreference/hook.mdreference/hook.md#configurationreference/hook.md#template-variablesreference/config.md#dev-server-url# View all configuration
wt config show
# Create initial user config
wt config create
# LLM setup guide
wt config --help
Load reference files for detailed configuration, hook specifications, and troubleshooting.
Find specific sections with grep:
grep -A 20 "## Setup" reference/llm-commits.md
grep -A 30 "### post-create" reference/hook.md
grep -A 20 "## Warning Messages" reference/shell-integration.md
When the user requests spawning a worktree with Claude in a background session ("spawn a worktree for...", "hand off to another agent"), use the appropriate pattern for their terminal multiplexer:
tmux (check $TMUX env var):
tmux new-session -d -s <branch-name> "wt switch --create <branch-name> -x claude -- '<task description>'"
Zellij (check $ZELLIJ env var):
zellij run -- wt switch --create <branch-name> -x claude -- '<task description>'
Requirements (all must be true):
Do not use this pattern for normal worktree operations.
Example (tmux):
tmux new-session -d -s fix-auth-bug "wt switch --create fix-auth-bug -x claude -- \
'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'"
Example (Zellij):
zellij run -- wt switch --create fix-auth-bug -x claude -- \
'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'
Weekly Installs
308
Repository
GitHub Stars
3.7K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode301
github-copilot291
gemini-cli291
codex290
amp287
kimi-cli287
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
138,300 周安装
post-mergepre-removeValidate commands work
npm run lint # verify exists
which cargo # verify tool exists
Create.config/wt.toml
# Install dependencies when creating worktrees
post-create = "npm install"
# Validate code quality before committing
[pre-commit]
lint = "npm run lint"
typecheck = "npm run typecheck"
# Run tests before merging
pre-merge = "npm test"
Add comments explaining choices
Suggest testing
wt switch --create test-hooks
Handle format conversion if needed