speckit-git-initialize — Claude Code skill: Git setup
speckit-git-initialize creates a Git repository in the current project and makes its first commit. It fits spec-kit projects that need Git initialized.
MIT ★ 110 updated 2026-10-19
npx skills add alfredoperez/speckit-companion --skill speckit-git-initialize -a claude-codeWhat speckit-git-initialize does
This skill checks the current project and initializes Git when no repository is present. It then runs git init, stages the project with git add ., and creates an initial commit. The main path uses the Bash or PowerShell scripts under .specify/extensions/git/scripts/.
When those extension scripts cannot be found, the skill falls back to direct Git commands. It skips projects that are already inside a repository and warns when Git is unavailable. The project must have the spec-kit .specify/ structure. A failure in git init, git add ., or git commit stops the operation instead of leaving a partial setup.
What it helps with
- initialize Git in the current project
- create the repository’s first commit
- stage spec-kit project files for Git
- avoid reinitializing an existing repository
Example prompts for the agent
- Initialize Git in this project and create the initial commit.
- Check this spec-kit project and set up its Git repository.
- Run the Git initialization and stop if any Git command fails.
How to install speckit-git-initialize
1Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-initialize -a claude-code2Manually: put the files in place
~/.claude/skills/speckit-git-initialize/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/speckit-git-initialize/
1Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-initialize -a codex2Manually: put the files in place
.agents/skills/speckit-git-initialize/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-initialize -a cursor2Manually: put the files in place
.cursor/skills/speckit-git-initialize/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install alfredoperez/speckit-companion .claude/skills/speckit-git-initialize2Manually: put the files in place
.github/skills/speckit-git-initialize/SKILL.md1Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-initialize -a gemini-cli2Platform CLI
gemini skills install https://github.com/alfredoperez/speckit-companion --path .claude/skills/speckit-git-initializeManually: put the files in place
.devin/skills/speckit-git-initialize/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about speckit-git-initialize
How do I install speckit-git-initialize in Claude Code?
Run npx skills add alfredoperez/speckit-companion --skill speckit-git-initialize -a claude-code, then verify ~/.claude/skills/speckit-git-initialize/SKILL.md.
What does speckit-git-initialize do?
It creates a Git repository when needed, stages the project files, and makes an initial commit. Existing repositories are skipped.
What happens when Git is missing or a Git command fails?
If Git is unavailable, the skill warns the user and skips repository setup. A failure in git init, git add ., or git commit stops the skill.
Source text
SKILL.md · MIT
--- name: speckit-git-initialize description: Initialize a Git repository with an initial commit compatibility: Requires spec-kit project structure with .specify/ directory metadata: author: spec-kit-core source: extension:git user-invocable: true disable-model-invocation: false --- # Git Initialize Skill # Initialize Git Repository Initialize a Git repository in the current project directory if one does not already exist. ## Execution Run the appropriate script from the project root: - **Bash**: `.specify/extensions/git/scripts/bash/initialize-repo.sh` - **PowerShell**: `.specify/extensions/git/scripts/powershell/initialize-repo.ps1` If the extension scripts are not found, fall back to: - **Bash**: `git init && git add . && git commit -m "Initial commit from Specify template"` - **PowerShell**: `git init; git add .; git commit -m "Initial commit from Specify template"` The script handles all checks internally: - Skips if Git is not available - Skips if already inside a Git repository - Runs `git init`, `git add .`, and `git commit` with an initial commit message ## Customization Replace the script to add project-specific Git initialization steps: - Custom `.gitignore` templates - Default branch naming (`git config init.defaultBranch`) - Git LFS setup - Git hooks installation - Commit signing configuration - Git Flow initialization ## Output On success: - `[OK] Git repository initialized` ## Graceful Degradation If Git is not installed: - Warn the user - Skip repository initialization - The project continues to function without Git (specs can still be created under `specs/`) If Git is installed but `git init`, `git add .`, or `git commit` fails: - Surface the error to the user - Stop this command rather than continuing with a partially initialized repository
© spec-kit-core · MIT · alfredoperez/speckit-companion