Git Factory for Openclaw

Git Factory provides automated worktree isolation for AI coding agents to ensure conflict-free parallel development.

spaztazim
v1.0.0
Mar 30, 2026
0
641
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install git-factory

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install git-factory using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Git Factory?

Git Factory is a specialized toolset designed to solve the complexities of multi-agent coding tasks. By leveraging git worktrees, it allows each AI moth or agent to operate in its own dedicated workspace and branch, completely isolated from other ongoing tasks. This architecture is a core part of the Openclaw Skills ecosystem, ensuring that parallel feature development can occur on the same repository without the risk of merge conflicts or dirty working directories.

This skill automates the entire lifecycle of a development task, from provisioning isolated environments to the final submission of pull requests. It provides a structured, predictable environment that is essential for scaling AI-driven software development, allowing developers to orchestrate multiple coding agents simultaneously while maintaining a clean and manageable git history.

Git Factory Use Cases

  • Parallel feature development involving multiple AI agents on a single repository.
  • Automating open-source contributions by providing an isolated branch per pull request.
  • Skill packaging workflows where each individual skill requires its own clean worktree for commits.
  • Standardizing development environments for any AI agent that writes code to prevent workspace pollution.

How Git Factory Works

  1. The provision script creates a new dedicated branch using the moth/<slug> naming convention.
  2. A physical worktree is established in a sub-directory, typically located at .worktrees/<slug>.
  3. The AI agent performs its tasks exclusively within this isolated directory, utilizing a full git environment.
  4. Upon completion, the finish script stages changes, commits them with a standardized prefix, and pushes the branch.
  5. Optionally, a draft pull request is created before the worktree is safely removed from the local environment.
  6. Automated cleanup scripts monitor and remove stale worktrees that exceed the defined age threshold.

Git Factory Setup

To integrate this component of Openclaw Skills into your workflow, ensure you have PowerShell available and navigate to your repository root:

# Navigate to your git repository
cd your-project-repo

# Provision a new isolated worktree for a task
.\skills\git-factory\scripts\new-worktree.ps1 -RepoPath . -TaskSlug "feature-name"

Ensure that your .gitignore includes .worktrees/ to prevent temporary agent environments from being tracked in the main branch.

Git Factory Data Schema & Taxonomy

Git Factory follows a strict organizational taxonomy to ensure compatibility across different Openclaw Skills implementations:

Item Convention Description
Worktree Path <repo>/.worktrees/<task-slug> The isolated filesystem location for the agent.
Branch Name moth/<task-slug> Standardized branch naming for easy tracking.
Commit Message moth(<task-slug>): <message> Scoped commit messages for clear history logs.
PR Status Draft Pull requests are initialized as drafts to allow for human review.
Expiry 7 Days Default retention period for abandoned or stale worktrees.

Git Factory Advanced Features

  • Automated Pull Request Creation: Seamlessly transition from agent code completion to GitHub/GitLab PRs.
  • Stale Worktree Management: Configurable cleanup logic to prevent local disk bloat from abandoned agent tasks.
  • Moth Dispatch Integration: Built-in support for passing worktree context directly into AI agent system prompts.
  • Windows File Lock Handling: Specialized scripts to manage common OS-level locking issues during agent cleanup.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*