Agent Skillsgmickel/flow-next › flow-next-worktree-kit

flow-next-worktree-kit

GitHub

管理Git工作树及复制环境变量,支持并行开发、隔离审查和清理。提供创建、切换、列出、清理工作树及同步.env文件的功能,确保工作区整洁与安全。

plugins/flow-next/codex/skills/flow-next-worktree-kit/SKILL.md gmickel/flow-next

触发场景

用户提到 worktree 或工作树 需要并行进行特性开发 需要隔离环境进行代码审查 需要清理工作树以恢复干净工作区

安装

npx skills add gmickel/flow-next --skill flow-next-worktree-kit -g -y
更多选项

非标准路径

npx skills add https://github.com/gmickel/flow-next/tree/main/plugins/flow-next/codex/skills/flow-next-worktree-kit -g -y

不安装直接使用

npx skills use gmickel/flow-next@flow-next-worktree-kit

指定 Agent (Claude Code)

npx skills add gmickel/flow-next --skill flow-next-worktree-kit -a claude-code -g -y

安装 repo 全部 skill

npx skills add gmickel/flow-next --all -g -y

预览 repo 内 skill

npx skills add gmickel/flow-next --list

SKILL.md

Frontmatter
{
    "name": "flow-next-worktree-kit",
    "description": "Manage git worktrees (create\/list\/switch\/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees."
}

Worktree kit

Use the manager script for all worktree actions.

bash "${CODEX_HOME:-$HOME/.codex}/scripts/worktree.sh" <command> [args]

Commands:

  • create <name> [base]
  • list
  • switch <name> (prints the worktree path; it cannot change your shell's directory - use cd "$(... switch <name>)")
  • cleanup [<name>...] [--yes] (no args = interactive; names skip the prompt; --yes skips the confirmation, required off a terminal)
  • copy-env <name>

Safety notes:

  • create does not change the current branch
  • create sets no upstream on the new branch (--no-track) - under the upstream-based push modes (simple, upstream, current) a bare git push cannot aim at the base branch; under the default push.default=simple (without push.autoSetupRemote) the first push needs git push -u origin <name> (legacy push.default=matching pushes all name-matched branches regardless of upstream)
  • cleanup does not force-remove worktrees and does not delete branches
  • cleanup deletes the worktree directory (including ignored files); removal fails if the worktree is not clean
  • .env* is copied with no overwrite (symlinks skipped)
  • refuses to operate if .worktrees/ or any worktree path component is a symlink
  • copy-env only targets registered worktrees
  • origin fetch is optional; local base refs are allowed
  • fetch from origin only when base looks like a branch
  • Worktrees live under .worktrees/
  • create initializes .worktrees/.gitignore (* plus !.gitignore) when absent, so git add -A cannot stage nested worktrees as gitlinks; existing custom ignore files are preserved

Shared claim state. Parallel agents in sibling worktrees driving flowctl on the same repo share claim state via .git/flow-state. Set FLOW_STATE_DIR per agent (outside the tree) when running flow pipelines concurrently.

版本历史

  • cd9ddf8 当前 2026-08-28 18:47

    更新文档,补充关于跨工作树共享.flow-state状态及FLOW_STATE_DIR环境变量的说明。

  • 8baa538 2026-08-20 07:59

同 Skill 集合

optimization/audit/baseline/SKILL.md
optimization/interview/baseline/SKILL.md
optimization/make-pr/baseline/SKILL.md
optimization/plan/baseline/SKILL.md
optimization/prospect/baseline/SKILL.md
plugins/flow-next/codex/skills/flow-next-audit/SKILL.md
plugins/flow-next/codex/skills/flow-next-capture/SKILL.md
plugins/flow-next/codex/skills/flow-next-chart/SKILL.md
plugins/flow-next/codex/skills/flow-next-deps/SKILL.md
plugins/flow-next/codex/skills/flow-next-export-context/SKILL.md
plugins/flow-next/codex/skills/flow-next-features/SKILL.md
plugins/flow-next/codex/skills/flow-next-guide/SKILL.md
plugins/flow-next/codex/skills/flow-next-impl-review/SKILL.md
plugins/flow-next/codex/skills/flow-next-interview/SKILL.md
plugins/flow-next/codex/skills/flow-next-land/SKILL.md
plugins/flow-next/codex/skills/flow-next-make-pr/SKILL.md
plugins/flow-next/codex/skills/flow-next-map/SKILL.md
plugins/flow-next/codex/skills/flow-next-memory-migrate/SKILL.md
plugins/flow-next/codex/skills/flow-next-pilot/SKILL.md
plugins/flow-next/codex/skills/flow-next-plan-review/SKILL.md
plugins/flow-next/codex/skills/flow-next-plan/SKILL.md
plugins/flow-next/codex/skills/flow-next-prime/SKILL.md
plugins/flow-next/codex/skills/flow-next-prose/SKILL.md
plugins/flow-next/codex/skills/flow-next-prospect/SKILL.md
plugins/flow-next/codex/skills/flow-next-qa/SKILL.md
plugins/flow-next/codex/skills/flow-next-ralph-init/SKILL.md
plugins/flow-next/codex/skills/flow-next-resolve-pr/SKILL.md
plugins/flow-next/codex/skills/flow-next-setup/SKILL.md
plugins/flow-next/codex/skills/flow-next-spec-completion-review/SKILL.md
plugins/flow-next/codex/skills/flow-next-strategy/SKILL.md
plugins/flow-next/codex/skills/flow-next-sync/SKILL.md
plugins/flow-next/codex/skills/flow-next-tracker-sync/SKILL.md
plugins/flow-next/codex/skills/flow-next-visual/SKILL.md
plugins/flow-next/codex/skills/flow-next-work-rolling/SKILL.md
plugins/flow-next/codex/skills/flow-next-work/SKILL.md
plugins/flow-next/codex/skills/flow-next/SKILL.md
plugins/flow-next/skills/flow-next-chart/SKILL.md
plugins/flow-next/skills/flow-next-deps/SKILL.md
plugins/flow-next/skills/flow-next-export-context/SKILL.md
plugins/flow-next/skills/flow-next-features/SKILL.md
plugins/flow-next/skills/flow-next-guide/SKILL.md
plugins/flow-next/skills/flow-next-impl-review/SKILL.md
plugins/flow-next/skills/flow-next-interview/SKILL.md
plugins/flow-next/skills/flow-next-make-pr/SKILL.md
plugins/flow-next/skills/flow-next-map/SKILL.md
plugins/flow-next/skills/flow-next-plan-review/SKILL.md
plugins/flow-next/skills/flow-next-plan/SKILL.md
plugins/flow-next/skills/flow-next-prime/SKILL.md
plugins/flow-next/skills/flow-next-prose/SKILL.md

元信息

文件数
0
版本
c9f7a79
Hash
683827af
收录时间
2026-08-20 07:59

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-09 18:28
浙ICP备14020137号-1 $访客地图$