Agent SkillsTerry-Mao/AICodingFlow › git-worktree

git-worktree

GitHub

用于创建隔离的Git工作树以支持并行开发,自动处理分支命名、基础版本选择及路径校验,确保不干扰当前工作区且不复制未提交更改。

.agents/skills/git-worktree/SKILL.md Terry-Mao/AICodingFlow

触发场景

需要并行开发但不想干扰当前工作区 创建新的Git工作树进行独立分支开发

安装

npx skills add Terry-Mao/AICodingFlow --skill git-worktree -g -y
更多选项

非标准路径

npx skills add https://github.com/Terry-Mao/AICodingFlow/tree/main/.agents/skills/git-worktree -g -y

不安装直接使用

npx skills use Terry-Mao/AICodingFlow@git-worktree

指定 Agent (Claude Code)

npx skills add Terry-Mao/AICodingFlow --skill git-worktree -a claude-code -g -y

安装 repo 全部 skill

npx skills add Terry-Mao/AICodingFlow --all -g -y

预览 repo 内 skill

npx skills add Terry-Mao/AICodingFlow --list

SKILL.md

Frontmatter
{
    "name": "git-worktree",
    "description": "Create an isolated Git worktree for parallel development with minimal safety checks."
}

git-worktree

Use this when work should not disturb the current worktree. The new worktree does not copy uncommitted changes, and it does not change the user's shell directory.

Naming and base

Use the git-branch naming rules: issue work is <type>/<short-desc>-<issueID>, other work uses a user-provided name, and no issue ID is invented. When an issue ID is provided, use one gh issue view call for naming context and continue from the request if it fails. Store the worktree at .worktrees/<branch-name> so branch path segments are preserved. The repository should ignore .worktrees/.

Default the base to main; same-repository work prefers origin/<base>, then local <base>, and uses upstream only for fork workflows or explicit guidance. Fetch/check freshness only when it affects the result. If the local base is stale, confirm before using it or create from a fetched remote base and report that the local base was unchanged.

Create

Before creating, check current status, existing worktrees/branches, and the target path. Stop if any target already exists or dirty-work intent is unclear. Validate the branch with git check-ref-format --branch <branch-name>, create parent directories as needed, then run the equivalent of:

git worktree add --no-track -b <branch-name> .worktrees/<branch-name> <base-ref>

Verify the new worktree's branch, status, and pwd. Report its path, base, whether dirty changes were excluded, and the user's next step: cd .worktrees/<branch-name>.

Do not remove, prune, overwrite, reset, stash, push, or force anything unless explicitly asked. Do not create protected/shared base branches as targets. Subsequent agent work uses the new worktree unless the user says otherwise.

版本历史

  • d3fef11 当前 2026-09-03 03:51

    重构精简本地开发与 spec 工作流指引,优化基础分支策略及远程检查逻辑。

  • e53c5ac 2026-07-24 11:35

同 Skill 集合

.agents/skills/bootstrap-issue-config/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/create-pr/SKILL.md
.agents/skills/diagnose-ci-failures/SKILL.md
.agents/skills/git-branch/SKILL.md
.agents/skills/git-commit/SKILL.md
.agents/skills/git-push/SKILL.md
.agents/skills/pr-walkthrough/SKILL.md
.agents/skills/resolve-merge-conflicts/SKILL.md
.agents/skills/review-pr-local/SKILL.md
.agents/skills/review-spec-local/SKILL.md
.agents/skills/spec-driven-implementation/SKILL.md
.agents/skills/write-product-spec/SKILL.md
.agents/skills/write-tech-spec/SKILL.md
.github/skills/check-impl-against-spec/SKILL.md
.github/skills/create-product-spec/SKILL.md
.github/skills/create-tech-spec/SKILL.md
.github/skills/dedupe-issue-repo/SKILL.md
.github/skills/dedupe-issue/SKILL.md
.github/skills/implement-issue/SKILL.md
.github/skills/implement-specs/SKILL.md
.github/skills/product-change-report/SKILL.md
.github/skills/product-docs-sync/SKILL.md
.github/skills/product-wiki/SKILL.md
.github/skills/review-pr-repo/SKILL.md
.github/skills/review-pr/SKILL.md
.github/skills/review-spec-repo/SKILL.md
.github/skills/review-spec/SKILL.md
.github/skills/security-review-pr/SKILL.md
.github/skills/security-review-spec/SKILL.md
.github/skills/triage-issue-repo/SKILL.md
.github/skills/triage-issue/SKILL.md
.github/skills/update-dedupe/SKILL.md
.github/skills/update-pr-review/SKILL.md
.github/skills/update-triage/SKILL.md

元信息

文件数
0
版本
d3fef11
Hash
9844b1ba
收录时间
2026-07-24 11:35

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