Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计异常

sc-worktreeSC 工作树

Agent Skill

sc-worktree 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

635

周安装

27

GitHub Stars

17

下载量

222
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sc-worktree(SC 工作树)
来源仓库:https://github.com/tony363/superclaude
仓库路径:skills/sc-worktree
安装命令:
npx skills add https://github.com/tony363/superclaude --skill sc-worktree
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tony363/superclaude --skill sc-worktree

简介

sc-worktree 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中筛选信息的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件操作。
  • 可结合原始 README 进一步核验具体功能和使用方法。

SKILL.md

Worktree Management Skill

Git worktree isolation for parallel agent development with simple, safe workflows.

Quick Start

# Create isolated worktree for a task
/sc:worktree create feature-auth

# List all active worktrees
/sc:worktree list

# Propose changes for human review
/sc:worktree propose feature-auth

# Clean up stale worktrees
/sc:worktree cleanup

Behavioral Flow

  1. Create - Initialize isolated worktree with unique naming
  2. Validate - Preflight checks (clean repo, no conflicts)
  3. Assign - Spawn subagent with CWD set to worktree
  4. Work - Agent operates in isolation, commits to branch
  5. Propose - Push branch and create PR for human review
  6. Cleanup - Remove merged/stale worktrees

Commands

CommandPurposeGit Operations
create <task-id>Create isolated worktreegit worktree add -b wt/<task>
listShow all active worktreesgit worktree list
status <task-id>Check worktree stategit status, git log
cleanup [--all]Remove stale worktreesgit worktree remove, prune
propose <task-id>Create PR for human reviewgit push, gh pr create

Flags

FlagTypeDefaultDescription
--commitsbooltrueAgent commits directly to branch
--patchesboolfalseAgent produces patch files only
--run-testsboolfalseRun tests before proposing
--forceboolfalseOverride existing worktree/branch
--basestringmainBase branch for worktree

Evidence Requirements

This skill does NOT require hard evidence. Worktree operations are self-documenting through:

  • Git worktree list output
  • Branch history
  • PR creation confirmation

Naming Convention

Worktrees use deterministic naming to prevent collisions:

Path:   .worktrees/<task-id>/
Branch: wt/<task-id>

Example:

Path:   .worktrees/feature-auth/
Branch: wt/feature-auth

Operations

Create Worktree

/sc:worktree create feature-auth

# Executes:
# 1. mkdir -p .worktrees
# 2. git worktree add -b wt/feature-auth .worktrees/feature-auth
# 3. Returns worktree path for subagent CWD

List Worktrees

/sc:worktree list

# Shows:
# - Active worktrees
# - Associated branches
# - Last commit info

Check Status

/sc:worktree status feature-auth

# Shows:
# - Uncommitted changes
# - Commits ahead of base branch
# - Conflict warnings

Propose Changes

/sc:worktree propose feature-auth

# Executes:
# 1. git push -u origin wt/feature-auth
# 2. gh pr create --title "feat: feature-auth" --body "..."
# 3. Returns PR URL for human review

Cleanup Worktrees

/sc:worktree cleanup          # Remove merged worktrees
/sc:worktree cleanup --all    # Remove ALL worktrees
/sc:worktree cleanup feature-auth  # Remove specific worktree

# Executes:
# 1. git worktree remove .worktrees/<task-id>
# 2. git branch -d wt/<task-id>
# 3. git worktree prune

Subagent Integration

When spawning a subagent to work in a worktree:

# 1. Create worktree
/sc:worktree create feature-auth

# 2. Spawn subagent with CWD
Task(
    prompt="Implement JWT authentication",
    subagent_type="general-purpose",
    # CWD implicitly set to .worktrees/feature-auth/
)

# 3. Agent works in isolation
# - All file operations scoped to worktree
# - Commits go to wt/feature-auth branch

# 4. Propose for review
/sc:worktree propose feature-auth

Preflight Checks

Before creating a worktree, the skill validates:

  1. Repository State

- Repo is clean OR --force flag provided - Main branch is up to date

  1. Branch Availability

- wt/<task-id> branch doesn't exist OR explicit reuse - No conflicting remote branch

  1. Path Availability

- .worktrees/<task-id> doesn't exist OR --force flag

Conflict Detection

Before proposing, the skill checks for conflicts:

# Fetch latest changes
git fetch origin main

# Check if worktree is behind
git merge-base --is-ancestor origin/main HEAD

# Warn but don't block if behind
# Human reviewer handles merge strategy

Examples

Single Agent Workflow

# Create worktree
/sc:worktree create add-logging

# Work in worktree (agent operates here)
# ... agent makes changes, commits ...

# Propose changes
/sc:worktree propose add-logging

# Human reviews PR, merges

# Cleanup
/sc:worktree cleanup add-logging

Parallel Multi-Agent Workflow

# Orchestrator creates multiple worktrees
/sc:worktree create feature-auth
/sc:worktree create feature-logging
/sc:worktree create feature-metrics

# Spawn agents in parallel (each with own worktree)
# Agent A -> .worktrees/feature-auth/
# Agent B -> .worktrees/feature-logging/
# Agent C -> .worktrees/feature-metrics/

# Propose all changes
/sc:worktree propose feature-auth
/sc:worktree propose feature-logging
/sc:worktree propose feature-metrics

# Human reviews 3 PRs, merges sequentially

# Cleanup all
/sc:worktree cleanup --all

Patch Mode (No Direct Commits)

/sc:worktree create refactor-api --patches

# Agent produces .patch files instead of commits
# Orchestrator reviews patches before applying

/sc:worktree propose refactor-api  # Creates PR from patches

MCP Integration

PAL MCP (Validation & Review)

ToolWhen to UsePurpose
mcp__pal__precommitBefore proposeValidate changes in worktree
mcp__pal__codereviewBefore proposeReview worktree changes
mcp__pal__consensusConflict resolutionMulti-model merge strategy

PAL Usage Patterns

# Validate worktree changes before proposing
mcp__pal__precommit(
    path=".worktrees/feature-auth",
    step="Validating worktree changes",
    findings="Security, test coverage, completeness",
    compare_to="main"
)

# Review worktree branch
mcp__pal__codereview(
    review_type="full",
    step="Reviewing feature-auth worktree",
    relevant_files=[".worktrees/feature-auth/src/auth.py"]
)

Rube MCP (Automation & Notifications)

ToolWhen to UsePurpose
mcp__rube__RUBE_SEARCH_TOOLSGitHub integrationFind PR tools
mcp__rube__RUBE_MULTI_EXECUTE_TOOLPropose commandCreate PR, notify team

Rube Usage Patterns

# Create PR and notify team
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
    {"tool_slug": "GITHUB_CREATE_PULL_REQUEST", "arguments": {
        "repo": "myapp",
        "title": "feat: feature-auth from worktree",
        "body": "## Worktree: feature-auth\nCreated via /sc:worktree",
        "base": "main",
        "head": "wt/feature-auth"
    }},
    {"tool_slug": "SLACK_SEND_MESSAGE", "arguments": {
        "channel": "#pull-requests",
        "text": "New PR from worktree: wt/feature-auth"
    }}
])

Flags (Extended)

FlagTypeDefaultDescription
--pal-reviewboolfalseUse PAL codereview before propose
--create-prbooltrueCreate GitHub PR via Rube
--notifystring-Notify via Rube (slack, teams)
--draftboolfalseCreate draft PR

Tool Coordination

  • Bash - Git worktree commands, directory operations
  • Read - Check worktree status and logs
  • Task - Spawn subagents with worktree CWD
  • PAL MCP - Pre-propose validation, code review
  • Rube MCP - PR creation, team notifications

Safety Guarantees

  1. Isolation - Each worktree has separate working directory
  2. No Auto-Merge - Human review required for all merges
  3. Unique Naming - Deterministic paths prevent collisions
  4. Crash-Safe - cleanup --all removes stale worktrees
  5. Warning-Only Conflicts - Conflicts warn but don't block

Limitations

  • No automatic quality scoring (use CI/tests)
  • No lease tracking (periodic cleanup instead)
  • No sophisticated conflict resolution (human review)
  • No auto-merge to main (PR-based workflow)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

25.22%
按下载量换算56

Claude Code

22.72%
按下载量换算50

windsurf

18.08%
按下载量换算40

trae

11.67%
按下载量换算26

OpenCode

8.4%
按下载量换算19

Cursor

3.18%
按下载量换算7

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/tony363/superclaude --skill sc-worktree;npx skills add tony363/superclaude --skill "sc-worktree" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills