plugins/claude-code-dev-hermit/skills/dev-branch/SKILL.md
Create a feature branch from a clean tree before delegating to the implementer or starting direct edits. Validates working state, picks the right base from protected_branches, and refuses on collisions.
npx skillsauth add gtapps/claude-code-hermit dev-branchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a feature branch with the same gating discipline the rest of the plugin enforces. Run before delegating to the implementer or starting direct edits on a fresh task.
.claude-code-hermit/sessions/ exists (core + dev hermit initialized)/claude-code-hermit:hatch and /claude-code-dev-hermit:hatch first, then exitAccepts two forms:
feature/PROJ-123-add-auth, fix/login-redirect — used as-is (no further transformation).PROJ-123 add auth flow, add auth flow — ask the operator once which prefix to use (feature / fix / chore / hotfix), then slugify the rest.If the operator skips the prefix question, default to feature.
Slugification rules — applied to the description portion only (never the prefix):
-[a-z0-9-]- to a single --/ is preserved only as the prefix separator. If the input contains / mid-description (feature/foo/bar), only the first / is kept as prefix-boundary; subsequent / is replaced with - (feature/foo-bar).
Read claude-code-dev-hermit.protected_branches from .claude-code-hermit/config.json and run git rev-parse --abbrev-ref HEAD in parallel. Cache the config for Gate 3. If the current branch is NOT in the resolved protected-branches set, short-circuit. Glob matching: treat * as zero-or-more chars within a branch segment — release/* matches release/v1 but not release; * alone matches anything.
already on feature/PROJ-123-add-auth — nothing to do
Do NOT append to SHELL.md (no work happened).
Run git status --porcelain. If non-empty, stop and surface the diff summary:
working tree is dirty — /commit or stash before creating a branch
Run git fetch origin (or the configured default remote). Soft-fail on network error — warn fetch failed (offline?) — proceeding with local refs and continue. Record the offline state for Gate 5.
Try each option in order, silently falling through on failure. Do NOT warn at each step — only surface the final result. Reuse the config.json already read in Gate 0.
claude-code-dev-hermit.protected_branches from config that does NOT contain * or ? (skip glob entries like release/*).git symbolic-ref refs/remotes/origin/HEAD — returns a literal ref like refs/remotes/origin/develop; strip the refs/remotes/origin/ prefix to get the branch name. Exits 128 when origin/HEAD is unset (fresh clones, mirror clones, CI flows); treat as a normal fall-through.main exists. When online (Gate 2 succeeded): git ls-remote --exit-code --heads origin main. When offline: git rev-parse --verify refs/remotes/origin/main (local cache only).master — git ls-remote when online, local git rev-parse --verify refs/remotes/origin/master when offline.cannot resolve base branch — configure claude-code-dev-hermit.protected_branches.Surface the resolved base in the output. Emit no intermediate "fell back" lines.
Run git worktree prune, then git worktree list --porcelain | grep -F "branch refs/heads/<name>". If matched:
worktree exists at <path> — finish or remove it before recreating the branch
recovery: git worktree remove --force <path>
Do not call --force from this skill. Surface the path and let the operator decide.
Check for existing branches:
git rev-parse --verify <name> — FAIL if branch existsgit ls-remote --exit-code --heads origin <name> — FAIL if branch exists; soft-fail this check if Gate 2 went offlineOn collision:
branch <name> already exists (local / remote) — choose a different name
git checkout -b <name> origin/<base>
Use the remote-tracking ref so the new branch is not stale relative to origin.
Append a one-line entry to .claude-code-hermit/sessions/SHELL.md Progress Log in the existing format (e.g., [HH:MM] created branch <name> from <base>). Only on actual creation — never on Gate 0 short-circuit or any earlier abort.
dev-branch
base: main (from claude-code-dev-hermit.protected_branches[0])
name: feature/PROJ-123-add-auth
status: created
When Gate 0 short-circuits, emit only:
already on feature/PROJ-123-add-auth — nothing to do
git fetch and git ls-remote. No push, no remote branch creation, no remote deletion.claude-code-dev-hermit:implementer agent creates its own branch inside its worktree independently — that is a separate code path and does not interact with /dev-branch. Operators may still invoke the implementer directly without running /dev-branch first.data-ai
Initializes or resumes a work session. Loads context from OPERATOR.md and SHELL.md, orients the agent, and establishes what to work on. Use at the beginning of every work session.
tools
Evolves hermit configuration and templates after a plugin update. Detects version gaps, presents new features, walks through new settings. Run after updating the plugin.
testing
Initializes the autonomous agent in the current project. Creates the state directory, templates, OPERATOR.md, and config.json. Appends session discipline to CLAUDE.md. Detects installed hermits. Run once per project, like git init.
tools
Generates Docker scaffolding and walks the operator through the full deployment — token setup, build, start, MCP plugin configuration, workspace trust, and verification. Offers to back up and overwrite existing Docker files. Run after /hatch.