Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add alfredoperez/speckit-companion --skill speckit-git-initialize -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/speckit-git-initialize/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/speckit-git-initialize/

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

Similar skills

All skills for Git and GitHub →

From the same set83

The whole set →
speckit.git.remote speckit.git.remote detects the Git remote origin URL, parses repository ownership, and validates github.com hosts for downstream workflows. CX Codex +1 ★ 110repo stars cleanup-reviewer cleanup-reviewer reviews a specified slice of a repository cleanup diff and reports findings only. Use it when the review should stay within named files. CX Codex ★ 110repo stars speckit.git.initialize The speckit.git.initialize command sets up a Git repository in your project and creates an initial commit if one doesn't exist. Use it when starting a new project or preparing a template. CX Codex +1 ★ 110repo stars speckit-git-remote speckit-git-remote detects the Git remote URL and verifies GitHub connectivity for tasks like issue creation in spec-kit workflows. Designed for repositories structured with a .specify/ directory. CX Codex +1 ★ 110repo stars speckit.git.validate speckit.git.validate — a command that checks whether your current Git branch follows project naming conventions for feature branches. Install it if your team uses structured branch prefixes and wants to automate validation. CX Codex +1 ★ 110repo stars cleanup-implementer cleanup-implementer executes a single repository cleanup work packet. It edits assigned files, runs target checks, and never touches git write operations. CX Codex ★ 110repo stars bench-prep bench-prep is a command for Claude Code and Codex that resets three test cells to baseline and assigns them one task size before an agent works through the SpecKit Companion workflow. CX Codex +1 ★ 110repo stars speckit.companion.before-converge speckit.companion.before-converge is a Claude Code command that records the start of converge in .spec-context.json for the Companion GUI. Run it from the repository root before that step. CX Codex +1 ★ 110repo stars

Project sponsors

Companies that keep this analytics open