Git Factory

# Git Factory — Worktree Isolation for Moths

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Git Factory" with this command: npx skills add spaztazim/git-factory

Git Factory — Worktree Isolation for Moths

Each moth gets its own branch, its own workspace, its own PR. No conflicts. No merge hell.

When to Use

  • Multi-moth coding tasks — parallel feature work on the same repo
  • Open-source PRs — isolated branch per contribution
  • Skill packaging — each skill gets its own worktree for clean commits
  • Any moth that writes code — default to worktree isolation

Quick Reference

Provision a worktree for a moth

# From the repo root
.\skills\git-factory\scripts\new-worktree.ps1 -RepoPath . -TaskSlug "fix-login-bug"
# Returns: C:\Users\spaz\clawd\.worktrees\fix-login-bug

Finish and submit PR

.\skills\git-factory\scripts\finish-worktree.ps1 `
  -WorktreePath ".worktrees\fix-login-bug" `
  -CommitMessage "moth(fix-login-bug): fix auth redirect loop" `
  -CreatePR -PRTitle "Fix login redirect bug" `
  -PRBody "Fixes the auth redirect loop on expired sessions"

List active worktrees

.\skills\git-factory\scripts\list-worktrees.ps1 -RepoPath .

Clean up stale worktrees (>7 days)

.\skills\git-factory\scripts\cleanup-stale.ps1 -RepoPath . -MaxAgeDays 7

Moth Dispatch Integration

When spawning a coding moth, include the worktree in the task prompt:

Your working directory is: C:\Users\spaz\clawd\.worktrees\<task-slug>
You are on branch: moth/<task-slug>
Base branch: master

Work ONLY in this directory. When finished:
1. Stage and commit your changes
2. Push your branch: git push -u origin moth/<task-slug>
3. Report what you built and any issues

Do NOT modify files outside your worktree.

Conventions

ItemConvention
Worktree location<repo>/.worktrees/<task-slug>
Branch namingmoth/<task-slug>
Commit prefixmoth(<task-slug>): <description>
PR modeDraft by default
Stale threshold7 days (configurable)
.worktrees/Added to .gitignore automatically

How It Works

  1. new-worktree.ps1 creates a branch moth/<slug> and a worktree at .worktrees/<slug>
  2. Moth works in the isolated directory — full git repo, own branch, no conflicts
  3. finish-worktree.ps1 commits, pushes, optionally creates a draft PR, then removes the worktree
  4. cleanup-stale.ps1 runs periodically to remove abandoned worktrees

Limitations

  • Worktrees share the same .git directory — large repos may have lock contention on heavy git ops
  • Can't have two worktrees on the same branch
  • Windows file locking can prevent cleanup if processes have files open

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Working Tree Governor

Govern dirty git working trees by classifying runtime noise vs real source changes, defaulting to selective staging, verifying staged scope, and asking the o...

Registry SourceRecently Updated
810Profile unavailable
Automation

Git Workflow

OpenClaw Git 工作流技能。 当用户提及以下任务时使用: - 提交代码或文档 - 推送到远程仓库 - 管理多个 Git 仓库 - 查看 Git 状态 核心能力: - 自动检测文件变更 - 自动生成提交信息 - 自动推送到远程仓库 - 多仓库管理

Registry SourceRecently Updated
1.4K1Profile unavailable
Coding

Coding Agent (Claude Print + PTY Rules)

Delegate coding tasks to Codex, Claude Code, or Pi agents via background process. Use when: (1) building/creating new features or apps, (2) reviewing PRs (sp...

Registry SourceRecently Updated
960Profile unavailable
Coding

Dev Git Guard

Enforce a git-first workflow for repository coding tasks. Use when Codex is working inside a local git repository to inspect, modify, debug, refactor, implem...

Registry SourceRecently Updated
2310Profile unavailable