Source profileQuality 95/100Review permissions

terrylica/cc-skills/plugins/devops-tools/skills/worktree-manager/SKILL.md

worktree-manager

Create alpha-forge git worktrees with auto branch naming. TRIGGERS - create worktree, new worktree, alpha-forge worktree.

Source repository stars
61
Declared platforms
0
Static risk flags
3
Last source update
2026-08-26
Source checked
2026-08-28

Decision brief

What it does: where it fits

Create and manage git worktrees for the alpha-forge repository with automatic branch naming, consistent conventions, and lifecycle management.

Best for

  • Creating a new worktree for alpha-forge development
  • Setting up a worktree from a remote branch
  • Using an existing local branch in a new worktree

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/terrylica/cc-skills --skill "plugins/devops-tools/skills/worktree-manager"
Safe inspection promptEditorial

Inspect the Agent Skill "worktree-manager" from https://github.com/terrylica/cc-skills/blob/05f53c5b24a445c1895e9b0590212e66cd70f39e/plugins/devops-tools/skills/worktree-manager/SKILL.md at commit 05f53c5b24a445c1895e9b0590212e66cd70f39e. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Step 1: Parse Description and Derive Slug

    Claude derives kebab-case slugs following these rules:

    Each word in slug MUST convey unique meaningRemove filler words: the, a, an, for, with, and, to, from, in, on, of, byAvoid redundancy (e.g., "database" after "ClickHouse")
  2. 02

    Step 2: Verify Main Worktree Status

    CRITICAL: Before proceeding, check that main worktree is on main branch.

    CRITICAL: Before proceeding, check that main worktree is on main branch.Use AskUserQuestion to warn user:If user selects "Switch main to 'main' first":
  3. 03

    Step 3: Fetch Remote and Display Branches

    bash cd /eon/alpha-forge git fetch --all --prune

    bash cd /eon/alpha-forge git fetch --all --prune
  4. 04

    Step 4: Prompt for Branch Type

    Review the “Step 4: Prompt for Branch Type” section in the pinned source before continuing.

    Review and apply the “Step 4: Prompt for Branch Type” source section.
  5. 05

    Step 5: Prompt for Base Branch

    If user needs a different branch, they can select "Other" and provide the branch name.

    If user needs a different branch, they can select "Other" and provide the branch name.

Permission review

Static risk signals and limitations

Runs scripts

medium · line 91

The documentation asks the agent to run terminal commands or scripts.

git checkout main

Network access

medium · line 94

The documentation includes network, browsing, or remote request actions.

### Step 3: Fetch Remote and Display Branches

Runs scripts

medium · line 98

The documentation asks the agent to run terminal commands or scripts.

git fetch --all --prune

Writes files

medium · line 447

The documentation asks the agent to create, modify, or delete local files.

| Shared secrets not found | ~/eon/.env.alpha-forge missing | Create shared secrets file with required vars |

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score95/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars61SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
terrylica/cc-skills
Skill path
plugins/devops-tools/skills/worktree-manager/SKILL.md
Commit
05f53c5b24a445c1895e9b0590212e66cd70f39e
License
MIT
Collected
2026-08-28
Default branch
main
View the original SKILL.md

Alpha-Forge Worktree Manager

Create and manage git worktrees for the alpha-forge repository with automatic branch naming, consistent conventions, and lifecycle management.

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use This Skill

Use this skill when:

  • Creating a new worktree for alpha-forge development
  • Setting up a worktree from a remote branch
  • Using an existing local branch in a new worktree
  • Managing multiple parallel feature branches

Operational Modes

This skill supports three distinct modes based on user input:

ModeUser Input ExampleAction
New Branch"create worktree for sharpe validation"Derive slug, create branch + worktree
Remote Track"create worktree from origin/feat/existing"Track remote branch in new worktree
Local Branch"create worktree for feat/2025-12-15-my-feat"Use existing branch in new worktree

Mode 1: New Branch from Description (Primary)

This is the most common workflow. User provides a natural language description, Claude derives the slug.

Step 1: Parse Description and Derive Slug

Claude derives kebab-case slugs following these rules:

Word Economy Rule:

  • Each word in slug MUST convey unique meaning
  • Remove filler words: the, a, an, for, with, and, to, from, in, on, of, by
  • Avoid redundancy (e.g., "database" after "ClickHouse")
  • Limit to 3-5 words maximum

Conversion Steps:

  1. Parse description from user input
  2. Convert to lowercase
  3. Apply word economy (remove filler words)
  4. Replace spaces with hyphens

Examples:

User DescriptionDerived Slug
"sharpe statistical validation"sharpe-statistical-validation
"fix the memory leak in metrics"memory-leak-metrics
"implement user authentication for API"user-authentication-api
"add BigQuery data source support"bigquery-data-source

Step 2: Verify Main Worktree Status

CRITICAL: Before proceeding, check that main worktree is on main branch.

/usr/bin/env bash << 'GIT_EOF'
cd ~/eon/alpha-forge
CURRENT=$(git branch --show-current)
GIT_EOF

If NOT on main/master:

Use AskUserQuestion to warn user:

question: "Main worktree is on '$CURRENT', not main. Best practice is to keep main worktree clean. Continue anyway?"
header: "Warning"
options:
  - label: "Continue anyway"
    description: "Proceed with worktree creation"
  - label: "Switch main to 'main' first"
    description: "I'll switch the main worktree to main branch before creating"
multiSelect: false

If user selects "Switch main to 'main' first":

cd ~/eon/alpha-forge
git checkout main

Step 3: Fetch Remote and Display Branches

cd ~/eon/alpha-forge
git fetch --all --prune

# Display available branches for user reference
echo "Available remote branches:"
git branch -r | grep -v HEAD | head -20

Step 4: Prompt for Branch Type

Use AskUserQuestion:

question: "What type of branch is this?"
header: "Branch type"
options:
  - label: "feat"
    description: "New feature or capability"
  - label: "fix"
    description: "Bug fix or correction"
  - label: "refactor"
    description: "Code restructuring (no behavior change)"
  - label: "chore"
    description: "Maintenance, tooling, dependencies"
multiSelect: false

Step 5: Prompt for Base Branch

Use AskUserQuestion:

question: "Which branch should this be based on?"
header: "Base branch"
options:
  - label: "main (Recommended)"
    description: "Base from main branch"
  - label: "develop"
    description: "Base from develop branch"
multiSelect: false

If user needs a different branch, they can select "Other" and provide the branch name.

Step 6: Construct Branch Name

/usr/bin/env bash << 'SKILL_SCRIPT_EOF'
TYPE="feat"           # From Step 4
DATE=$(date +%Y-%m-%d)
SLUG="sharpe-statistical-validation"  # From Step 1
BASE="main"           # From Step 5

BRANCH="${TYPE}/${DATE}-${SLUG}"
# Result: feat/2025-12-15-sharpe-statistical-validation
SKILL_SCRIPT_EOF

Step 7: Create Worktree (Atomic)

/usr/bin/env bash << 'GIT_EOF_2'
cd ~/eon/alpha-forge

WORKTREE_PATH="$HOME/eon/alpha-forge.worktree-${DATE}-${SLUG}"

# Atomic branch + worktree creation
git worktree add -b "${BRANCH}" "${WORKTREE_PATH}" "origin/${BASE}"
GIT_EOF_2

Step 8: Generate Tab Name and Report

/usr/bin/env bash << 'SKILL_SCRIPT_EOF_2'
# Generate acronym from slug
ACRONYM=$(echo "$SLUG" | tr '-' '\n' | cut -c1 | tr -d '\n')
TAB_NAME="AF-${ACRONYM}"
SKILL_SCRIPT_EOF_2

Report success:

✓ Worktree created successfully

  Path:    ~/eon/alpha-forge.worktree-2025-12-15-sharpe-statistical-validation
  Branch:  feat/2025-12-15-sharpe-statistical-validation
  Tab:     AF-ssv
  Env:     .envrc created (loads shared secrets)

  iTerm2: Restart iTerm2 to see the new tab

Mode 2: Remote Branch Tracking

When user specifies origin/branch-name, create a local tracking branch.

Detection: User input contains origin/ prefix.

Example: "create worktree from origin/feat/2025-12-10-existing-feature"

Workflow

/usr/bin/env bash << 'GIT_EOF_3'
cd ~/eon/alpha-forge
git fetch --all --prune

REMOTE_BRANCH="origin/feat/2025-12-10-existing-feature"
LOCAL_BRANCH="feat/2025-12-10-existing-feature"

# Extract date and slug for worktree naming
# Pattern: type/YYYY-MM-DD-slug
if [[ "$LOCAL_BRANCH" =~ ^(feat|fix|refactor|chore)/([0-9]{4}-[0-9]{2}-[0-9]{2})-(.+)$ ]]; then
    DATE="${BASH_REMATCH[2]}"
    SLUG="${BASH_REMATCH[3]}"
else
    DATE=$(date +%Y-%m-%d)
    SLUG="${LOCAL_BRANCH##*/}"
fi

WORKTREE_PATH="$HOME/eon/alpha-forge.worktree-${DATE}-${SLUG}"

# Create tracking branch + worktree
git worktree add -b "${LOCAL_BRANCH}" "${WORKTREE_PATH}" "${REMOTE_BRANCH}"
GIT_EOF_3

Mode 3: Existing Local Branch

When user specifies a local branch name (without origin/), use it directly.

Detection: User input is a valid branch name format (e.g., feat/2025-12-15-slug).

Example: "create worktree for feat/2025-12-15-my-feature"

Workflow

/usr/bin/env bash << 'VALIDATE_EOF'
cd ~/eon/alpha-forge

BRANCH="feat/2025-12-15-my-feature"

# Verify branch exists
if ! git show-ref --verify "refs/heads/${BRANCH}" 2>/dev/null; then
    echo "ERROR: Local branch '${BRANCH}' not found"
    echo "Available local branches:"
    git branch | head -20
    exit 1
fi

# Extract date and slug
if [[ "$BRANCH" =~ ^(feat|fix|refactor|chore)/([0-9]{4}-[0-9]{2}-[0-9]{2})-(.+)$ ]]; then
    DATE="${BASH_REMATCH[2]}"
    SLUG="${BASH_REMATCH[3]}"
else
    DATE=$(date +%Y-%m-%d)
    SLUG="${BRANCH##*/}"
fi

WORKTREE_PATH="$HOME/eon/alpha-forge.worktree-${DATE}-${SLUG}"

# Create worktree for existing branch (no -b flag)
git worktree add "${WORKTREE_PATH}" "${BRANCH}"
VALIDATE_EOF

Naming Conventions

Worktree Folder Naming (ADR-Style)

Format: alpha-forge.worktree-YYYY-MM-DD-slug

Location: ~/eon/

BranchWorktree Folder
feat/2025-12-14-sharpe-statistical-validationalpha-forge.worktree-2025-12-14-sharpe-statistical-validation
feat/2025-12-13-feature-genesis-skillsalpha-forge.worktree-2025-12-13-feature-genesis-skills
fix/quick-patchalpha-forge.worktree-{TODAY}-quick-patch

iTerm2 Tab Naming (Acronym-Based)

Format: AF-{acronym} where acronym = first character of each word in slug

Worktree SlugTab Name
sharpe-statistical-validationAF-ssv
feature-genesis-skillsAF-fgs
eth-block-metrics-data-pluginAF-ebmdp

Stale Worktree Detection

Check for worktrees whose branches are already merged to main:

/usr/bin/env bash << 'PREFLIGHT_EOF'
cd ~/eon/alpha-forge

# Get branches merged to main
MERGED=$(git branch --merged main | grep -v '^\*' | grep -v 'main' | tr -d ' ')

# Check each worktree
git worktree list --porcelain | grep '^branch' | cut -d' ' -f2 | while read branch; do
    branch_name="${branch##refs/heads/}"
    if echo "$MERGED" | grep -q "^${branch_name}$"; then
        path=$(git worktree list | grep "\[${branch_name}\]" | awk '{print $1}')
        echo "STALE: $branch_name at $path"
    fi
done
PREFLIGHT_EOF

If stale worktrees found, prompt user to cleanup using AskUserQuestion.


Cleanup Workflow

Remove Stale Worktree

# Remove worktree (keeps branch)
git worktree remove ~/eon/alpha-forge.worktree-{DATE}-{SLUG}

# Optionally delete merged branch
git branch -d {BRANCH}

Prune Orphaned Entries

git worktree prune

Error Handling

ScenarioAction
Branch already existsSuggest using Mode 3 (existing branch) or rename
Remote branch not foundList available remote branches
Main worktree on featureWarn via AskUserQuestion, offer to switch
Empty descriptionShow usage examples
Network error on fetchAllow offline mode with local branches only
Worktree path existsSuggest cleanup or different slug

Branch Not Found

✗ Branch 'feat/nonexistent' not found

  Available branches:
  - feat/2025-12-14-sharpe-statistical-validation
  - main

  To create from remote:
  Specify: "create worktree from origin/branch-name"

Worktree Already Exists

✗ Worktree already exists for this branch

  Existing path: ~/eon/alpha-forge.worktree-2025-12-14-sharpe-statistical-validation

  To use existing worktree:
  cd ~/eon/alpha-forge.worktree-2025-12-14-sharpe-statistical-validation

Integration

direnv Environment Setup

Worktrees automatically get a .envrc file that loads shared credentials from ~/eon/.env.alpha-forge.

What happens on worktree creation:

  1. Script checks if ~/eon/.env.alpha-forge exists
  2. Creates .envrc in the new worktree with dotenv directive
  3. Runs direnv allow to approve the new .envrc

Shared secrets file (~/eon/.env.alpha-forge):

# ClickHouse credentials, API keys, etc.
CLICKHOUSE_HOST_READONLY="..."
CLICKHOUSE_USER_READONLY="..."
CLICKHOUSE_PASSWORD_READONLY="..."

Generated .envrc (in each worktree):

# alpha-forge worktree direnv config
# Auto-generated by create-worktree.sh

# Load shared alpha-forge secrets
dotenv $HOME/eon/.env.alpha-forge

# Worktree-specific overrides can be added below

Prerequisites:

  • direnv installed via mise (mise use -g direnv@latest)
  • Shell hook configured (eval "$(direnv hook zsh)" in ~/.zshrc)
  • Shared secrets file at ~/eon/.env.alpha-forge

iTerm2 Dynamic Detection

The default-layout.py script auto-discovers worktrees:

  1. Globs ~/eon/alpha-forge.worktree-*
  2. Validates each against git worktree list
  3. Generates AF-{acronym} tab names
  4. Inserts tabs after main AF tab

References


Troubleshooting

IssueCauseSolution
Branch already existsLocal branch with same nameUse Mode 3 (existing branch) or rename slug
Remote branch not foundTypo or not pushed yetRun git fetch --all --prune and list branches
Worktree path existsPrevious worktree not cleanedRemove old worktree or use different slug
direnv not loadingShell hook not configuredAdd eval "$(direnv hook zsh)" to ~/.zshrc
Shared secrets not found~/eon/.env.alpha-forge missingCreate shared secrets file with required vars
iTerm2 tab not appearingDynamic layout not refreshedRestart iTerm2 to trigger layout regeneration
Main worktree not on mainPrevious work not switchedRun git checkout main in main worktree first
Stale worktree detectedBranch merged but not cleanedRun git worktree remove <path> to cleanup

Post-Execution Reflection

After this skill completes, reflect before closing the task:

  1. Locate yourself. — Find this SKILL.md's canonical path before editing.
  2. What failed? — Fix the instruction that caused it.
  3. What worked better than expected? — Promote to recommended practice.
  4. What drifted? — Fix any script, reference, or dependency that no longer matches reality.
  5. Log it. — Evolution-log entry with trigger, fix, and evidence.

Do NOT defer. The next invocation inherits whatever you leave behind.

Frequently asked questions

What to verify before installation and use

What does the worktree-manager source document cover?

Create and manage git worktrees for the alpha-forge repository with automatic branch naming, consistent conventions, and lifecycle management.

How do I install worktree-manager?

The source record exposes this install command: npx skills add https://github.com/terrylica/cc-skills --skill "plugins/devops-tools/skills/worktree-manager". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged exec-script, network, write-files in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing

Computed 10025,136

alirezarezvani/claude-skills

app-store-optimization

App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist

Computed 9967

brucesongs/kali-claw

insecure-design

Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.

Computed 9916

NintendaDev/unikit-ai

unikit-docs

Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th

Computed 9836,049

K-Dense-AI/scientific-agent-skills

dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.