MCPInstall

safehouse-worktrees

Use when starting feature work that needs isolation from the current workspace — sets up a secure safehouse with git worktrees for clean operational bases

Installs
42
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/kucherenko/gangsta --skill safehouse-worktrees
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads safehouse-worktrees automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

The Safehouse: Git Worktrees

Overview

Git worktrees create isolated operational bases sharing the same repository. Work on multiple branches simultaneously without compromising the main workspace.

Core principle: Systematic directory selection + safety verification = reliable isolation.

Announce at start: "Setting up a safehouse for isolated operations."

Directory Selection Process

Follow this priority order:

1. Check Existing Safehouses

# Check in priority order
ls -d .worktrees 2>/dev/null     # Preferred (hidden)
ls -d worktrees 2>/dev/null      # Alternative

If found: Use that directory. If both exist, .worktrees/ wins.

2. Check Project Config

grep -i "worktree.*director" AGENTS.md 2>/dev/null

If preference specified: Use it without asking.

3. Ask the Don

If no directory exists and no config preference:

No safehouse directory found. Where should I set up?

1. .worktrees/ (project-local, hidden)
2. ~/.config/gangsta/worktrees/<project-name>/ (global location)

Which would you prefer?

Safety Verification

For Project-Local Directories (.worktrees or worktrees)

MUST verify directory is gitignored before creating safehouse:

# Check if directory is ignored (respects local, global, and system gitignore)
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored:

  1. Add appropriate line to .gitignore
  2. Commit the change immediately
  3. Proceed with safehouse creation

Why critical: Prevents accidentally committing safehouse contents to repository.

For Global Directory (~/.config/gangsta/worktrees)

No .gitignore verification needed — outside project entirely.

Creation Steps

1. Detect Project Name

project=$(basename "$(git rev-parse --show-toplevel)")

2. Create Safehouse

# Determine full path
case $LOCATION in
  .worktrees|worktrees)
    path="$LOCATION/$BRANCH_NAME"
    ;;
  ~/.config/gangsta/worktrees/*)
    path="~/.config/gangsta/worktrees/$project/$BRANCH_NAME"
    ;;
esac

# Create worktree with new branch
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"

3. Run Project Setup

Supply chain note: Package manager installs fetch untrusted third-party code. Where a lockfile exists, prefer lockfile-bound installs (npm ci over npm install, pip install with hash checking, etc.) to reduce supply chain risk.

Auto-detect and run appropriate setup:

# Node.js
if [ -f package.json ]; then npm install; fi

# Rust
if [ -f Cargo.toml ]; then cargo build; fi

# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi

# Go
if [ -f go.mod ]; then go mod download; fi

4. Verify Clean Baseline

Run tests to ensure safehouse starts clean:

# Use project-appropriate command
npm test / cargo test / pytest / go test ./...

If tests fail: Report failures, ask the Don whether to proceed or investigate.

If tests pass: Report ready.

5. Report Location

Safehouse ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready for operations.

Quick Reference

SituationAction
.worktrees/ existsUse it (verify ignored)
worktrees/ existsUse it (verify ignored)
Both existUse .worktrees/
Neither existsCheck AGENTS.md → Ask the Don
Directory not ignoredAdd to .gitignore + commit
Tests fail during baselineReport failures + ask the Don
No package.json/Cargo.tomlSkip dependency install

Common Mistakes

Skipping ignore verification

  • Problem: Safehouse contents get tracked, pollute git status
  • Fix: Always use git check-ignore before creating project-local safehouse

Assuming directory location

  • Problem: Creates inconsistency, violates project conventions
  • Fix: Follow priority: existing > config > ask

Proceeding with failing tests

  • Problem: Can't distinguish new bugs from pre-existing issues
  • Fix: Report failures, get explicit permission from the Don

Hardcoding setup commands

  • Problem: Breaks on projects using different tools
  • Fix: Auto-detect from project files

Red Flags

Never:

  • Create safehouse without verifying it's ignored (project-local)
  • Skip baseline test verification
  • Proceed with failing tests without asking the Don
  • Assume directory location when ambiguous

Always:

  • Follow directory priority: existing > config > ask
  • Verify directory is ignored for project-local
  • Auto-detect and run project setup
  • Verify clean test baseline

Integration

Called by:

  • Resource Development — When isolation is needed for implementation
  • Any skill needing an isolated workspace

Pairs with:

  • gangsta:exit-strategy — Cleans up the safehouse when the operation is complete

Omerta Compliance

  • Rule of Availability: Safehouse location reported and checkpointed
  • Rule of Truth: Baseline test results are actual output, not claims

FAQ

What does the safehouse-worktrees skill do?

Use when starting feature work that needs isolation from the current workspace — sets up a secure safehouse with git worktrees for clean operational bases

How do I install safehouse-worktrees?

Run npx skills add https://github.com/kucherenko/gangsta --skill safehouse-worktrees in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/safehouse-worktrees/ (personal) or .claude/skills/safehouse-worktrees/ (project).

Which AI agents can use safehouse-worktrees?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is safehouse-worktrees safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains safehouse-worktrees?

It is published by kucherenko in kucherenko/gangsta. It has 42 recorded installs.

More from kucherenko/gangsta

View all →

audit-review

kucherenko/gangsta

Use when completing tasks, implementing major features, or before merging — dispatches the-inspector to audit the books before the job is closed

Security51 installs

the-grilling

kucherenko/gangsta

Use when adversarial brainstorming is needed after reconnaissance — the Proposer, Devils-Advocate, and Synthesizer each run ONE pass (no rounds); the Don is grilled on the IDEA first, one question at a time, then the proposal is attacked

50 installs

reconnaissance

kucherenko/gangsta

Use when beginning a new heist — deploys associates to survey the target codebase, existing tests, dependencies, documentation, and the ledger to produce a reconnaissance dossier for the don's review

laundering

kucherenko/gangsta

Open the skill to read its SKILL.md instructions.

47 installs

using-gangsta

kucherenko/gangsta

Use when starting any conversation — establishes how to find and use Gangsta skills, enforces the 1% invocation rule, maps platform tools, and routes the Don's intent through the Gangsta Agents Family hierarchy

46 installs

drill-tdd

kucherenko/gangsta

Open the skill to read its SKILL.md instructions.

Testing & QA44 installs

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.