# git-submodule

A skill that first asks whether a submodule is the right boundary, then walks you through one safe workflow. Useful when your project pulls in outside code through .gitmodules.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 360 installs · ★ 50
- Author: akillness
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/akillness/jeo-skills/tree/HEAD/.agent-skills/git-submodule/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/git-submodule

## What it does

Each run picks a single mode: pinning an external repo at a commit, bootstrapping nested repos on a fresh clone, restoring a submodule to the commit the superproject records, moving it along a tracked branch, editing inside it, taking it out, or wiring checkout in CI. Before any command appears, the skill sorts the request into fields — goal, submodule state, CI and auth context — and states its safest assumption when something is missing.

Reference files back this up: a decision matrix, a separate note on updates and detached `HEAD`, guidance for CI and automation, and command packets per mode with hosted-platform limits. The toolset is `Bash`, `Read`, `Write`, `Edit`, `Glob`, `Grep`, so it inspects the repo and answers with concrete steps instead of a general Git lecture.

Rebases, conflict recovery and history repair belong to `git-workflow`; shipping a dependency as a registry package is another skill. A submodule points at a commit, never at a branch, so `git submodule update` can drop you into detached `HEAD` — the skill flags that before you commit anything.

## Requirements
- Works with: GitHub

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill git-submodule -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/git-submodule/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/git-submodule/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill git-submodule -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/git-submodule/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill git-submodule -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/git-submodule/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install akillness/jeo-skills git-submodule
```

2. **Manually: put the files in place**
- File: `.github/skills/git-submodule/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill git-submodule -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/akillness/jeo-skills --path .agent-skills/git-submodule
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/git-submodule/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill git-submodule -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/akillness/jeo-skills/tree/HEAD/.agent-skills/git-submodule/SKILL.md

## When to use it
- judge whether an external dependency belongs in a submodule or a subtree
- attach someone else's repo and pin it to a commit
- clone a project whose submodules are still empty
- restore a submodule to the commit recorded upstream
- fetch submodules during CI, private ones included

## Example prompts
- Add this external repo as a submodule and pin the current commit
- I cloned the project and the submodules are empty — initialize them recursively
- The submodule is in detached HEAD, put it back on the recorded commit

## Similar
- [triage](https://affpapa.org/en/nevibecode/skills/triage.md) — skill · 990453 installs
- [code-review](https://affpapa.org/en/nevibecode/skills/code-review.md) — skill · 789521 installs
- [implement](https://affpapa.org/en/nevibecode/skills/implement.md) — skill · 774700 installs
- [git-guardrails-claude-code](https://affpapa.org/en/nevibecode/skills/git-guardrails-claude-code.md) — skill · 499069 installs
- [setup-pre-commit](https://affpapa.org/en/nevibecode/skills/setup-pre-commit.md) — skill · 489289 installs
- [scaffold-exercises](https://affpapa.org/en/nevibecode/skills/scaffold-exercises.md) — skill · 480196 installs

From the same set: [akillness/jeo-skills](https://affpapa.org/en/nevibecode/by/akillness/jeo-skills.md) — 29 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
