mj-agent-git-branch

Creates Git branches and worktrees for mj-agent's bare-repo five-branch-type workflow.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/MJ-AgentLab/mj-agent --skill mj-agent-git-branch-mj-agentlab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mj-agent-git-branch
Source: https://github.com/MJ-AgentLab/mj-agent/tree/main/.claude/skills/mj-agent-git-branch
Command: npx skills add https://github.com/MJ-AgentLab/mj-agent --skill mj-agent-git-branch-mj-agentlab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers on the mj-agent project must follow a strict bare-repo plus worktree-per-branch convention with five branch types, and manually constructing the correct worktree-add commands and choosing the right branch type is error-prone. ## Core Features & Use Cases - Branch Type Decision: Maps task nature (new feature, bug fix, docs-only, infrastructure maintenance, production hotfix) to the correct branch type among feature, bugfix, documentation, maintain, and hotfix. - Worktree Command Generation: Produces ready-to-run git worktree add commands targeting the correct base branch (develop for most types, main for hotfix) in the bare-repo layout. - Health Check & Recovery: Diagnoses broken worktrees via git rev-parse and repairs config.worktree drift with a PowerShell fix. - Use Case: A developer says "start a feature for the flow intake skill" and receives the exact command git worktree add ../feature/63-add-flow-intake-skill -b feature/63-add-flow-intake-skill develop executed from the develop worktree. ## Quick Start Ask the assistant to create a new branch for your mj-agent task, describing whether it is a feature, bugfix, documentation, maintenance, or hotfix, and it will output the exact worktree-add command to run.

Frequently Asked Questions about mj-agent-git-branch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Git worktree for a new feature branch?▼

Run git worktree add from inside the develop worktree with the -b flag to create the branch, for example git worktree add ../feature/my-desc -b feature/my-desc develop. This keeps the bare-repo plus worktree-per-branch model intact.

Which branch type should I use for my change?▼

Use feature for new functionality, bugfix for defects on develop, documentation for docs-only changes, maintain for CI/CD, Docker, dependencies, or config, and hotfix for production emergencies based on main. The mj-agent project does not support an optimization branch type.

What is the naming convention for Git branches in this workflow?▼

Branches follow the format type/issue-id-description or type/description, using lowercase letters, digits, and hyphens only. Valid types are feature, bugfix, documentation, maintain, and hotfix; the issue id is optional.

Why does git rev-parse --is-inside-work-tree return false in my worktree?▼

This indicates config.worktree drift in the bare repo. Fix it by writing a config.worktree file under .bare/worktrees/<name> with core.bare set to false and core.worktree pointing to the worktree's absolute path.

Can I use git checkout to switch branches in a bare repository?▼

No, git checkout fails at the bare repo root because it has no working tree. Always cd into the target worktree directory instead, and never commit directly on the protected main or develop branches.