К основному содержанию
скилл CX Codex

git-setup — скилл для Claude Code: проверка и настройка Git

Скилл git-setup проверяет конфигурацию Git одной командой, находит пробелы и предлагает безопасные исправления для identity, редактора, diff и merge-инструментов.

MIT ★ 1 627 обновлён 2026-10-25

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add microsoft/hve-core --skill git-setup -a claude-code
Открыть на GitHub

Что делает git-setup

Скилл запускает git config --list --show-origin, парсит текущие значения user.name, user.email, core.editor, diff.tool и merge.tool, и показывает таблицу со статусом каждого параметра. Если что-то не задано, предлагает команды для установки — группами, каждую группу применяет только после явного подтверждения. Помощь с подписью коммитов (GPG или SSH) и safe.directory включается, только если об этом попросить или Git вернёт ошибку владения репозитория.

Внутри шаблоны команд для разных сценариев: настройка identity, включение SSH-подписи с существующим ключом, генерация нового GPG- или SSH-ключа, привязка VS Code как редактора и инструмента для diff и merge. Без Git 2.34 или новее SSH-подпись не заработает. После применения скилл показывает таблицу «до и после» и итоговый статус.

Какие задачи решает

  • проверить, заданы ли user.name и user.email во всех scope
  • найти отсутствующий core.editor или diff.tool и предложить VS Code
  • включить подпись коммитов SSH-ключом или GPG
  • добавить путь репозитория в safe.directory после ошибки unsafe-repository
  • показать текущую конфигурацию Git одной командой без лишних вызовов

Примеры запросов агенту

  • Проверь мою конфигурацию Git и покажи, чего не хватает
  • Настрой user.name и user.email для глобального scope
  • Включи подпись коммитов SSH-ключом ~/.ssh/id_ed25519.pub

Как установить git-setup

1Через Skills CLI (Vercel)

npx skills add microsoft/hve-core --skill git-setup -a claude-code

2Вручную: положить файлы

~/.claude/skills/git-setup/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/git-setup/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о git-setup

Как установить git-setup в Claude Code?

Запусти npx skills add microsoft/hve-core --skill git-setup -a claude-code. Скилл появится в ~/.claude/skills/git-setup/SKILL.md.

Что делает git-setup?

Проверяет конфигурацию Git командой git config --list --show-origin, находит пробелы в identity, редакторе и инструментах для diff и merge, предлагает исправления и применяет их только после подтверждения.

Нужна ли определённая версия Git для SSH-подписи?

Да, SSH-подпись коммитов работает с Git 2.34 или новее. Для более старых версий скилл предложит GPG.

Исходный текст

SKILL.md · MIT
---
name: git-setup
description: 'Audit Git configuration with one read-only baseline command, then propose confirmed, non-destructive fixes for identity, editor, and diff and merge tooling, with signing and safe.directory help only on request. Use when setting up or checking Git on a workstation.'
license: MIT
user-invocable: true
disable-model-invocation: true
---

# Git Setup

## Goal

Help the user configure Git consistently for everyday work (`add`, `commit`, `fetch`, `pull`, `push`) without overwriting preferred settings. Verify current values before suggesting changes, and never modify configuration without explicit confirmation.

Scope:

* Identity: `user.name` and `user.email` are set.
* Editing, diff, and merge tooling is configured when currently unset.
* Commit signing (GPG or SSH) help happens only when the user asks for it or reports a signing error.
* A `safe.directory` entry is proposed only when the user reports a Git ownership or unsafe-repository error.
* Existing customizations stay intact; never downgrade or remove settings.

## Flow

1. Audit the current configuration with exactly one command: `git config --list --show-origin`. It captures values and their source files. Run no other lookup, `gpg`, or `ssh-keygen` command during the audit.
2. Report gaps and desirable improvements from that output.
3. Propose minimal remediation commands, grouped logically.
4. Ask for confirmation per group before applying it, and apply only confirmed groups.
5. Verify applied settings with single `git config --get <key>` reads and show a before and after summary.
6. Summarize applied changes and remaining optional improvements.

## Detection

Classify each area from the baseline output only, in this order:

1. Identity: parse `user.name` and `user.email` and note each scope from its origin path. Mark a value missing when no scope sets it.
2. Commit signing (passive scan): parse `commit.gpgSign`, `gpg.format`, and `user.signingkey`, and classify the result for display only:
   * Disabled: `commit.gpgSign` is false or unset.
   * Configured candidate: signing is true and both `gpg.format` and `user.signingkey` are present.
   * Incomplete: signing is true but `gpg.format` or `user.signingkey` is missing.
   * Not configured: all three are unset.
3. Editor and tools: parse `core.editor`, `diff.tool`, and `merge.tool`, and mark each missing value as a gap.
4. Safe directory: note whether any `safe.directory` entry includes the current repository path.
5. Line endings: parse `core.autocrlf` and `core.eol`, and flag them only when both are unset and the user mentions cross-platform needs.

## Proposals

* Build a remediation group for each identity or editor and tooling gap, with the rationale, exact commands, and expected effect.
* Build a signing group only when the user asks about signing, wants to enable or disable it, or reports a signing verification error.
* Build a safe-directory group only when the user reports an unsafe-repository error from Git.
* Offer line-ending settings only when the user mentions cross-platform concerns.
* Write each command on its own line, directly runnable and human-auditable, with no chaining through `&&`, `;`, pipes, or subshells. Idempotent commands are acceptable when the user confirms them.
* When one specific value needs clarification later, propose a single follow-up `git config --get <key>` after user confirmation rather than a batch.
* Propose, but do not run, `gpg --list-secret-keys` only when signing is enabled or the user wants to enable signing and is unsure which keys exist.
* Propose key generation only when the user opts into signing and the configuration shows no usable key.
* Never push, fetch, pull, or alter remotes, and never show secrets or private key content. Redact the email only when the user asks for privacy.

## Command Templates

Adapt these after the user confirms the group; do not emit a template that no current gap or request needs.

Identity:

```bash
git config --global user.name "<user-name>"
git config --global user.email "<user-email>"
```

Disable misconfigured signing for now:

```bash
git config --global commit.gpgSign false
```

Trust a repository path after an unsafe-repository error:

```bash
git config --global --add safe.directory "<repo-path>"
```

Enable SSH signing with an existing key (Git 2.34 or later):

```bash
git config --global gpg.format ssh
git config --global user.signingkey "~/.ssh/id_ed25519.pub"
git config --global commit.gpgSign true
```

Generate and configure a GPG signing key:

```bash
gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long
gpg --armor --export <KEY_ID> > public-gpg-key.asc
git config --global gpg.format openpgp
git config --global user.signingkey <KEY_ID>
git config --global commit.gpgSign true
```

Generate and configure an SSH signing key:

```bash
# Linux and macOS
ssh-keygen -t ed25519 -C "<user-email>" -f ~/.ssh/id_ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

# Windows PowerShell with the built-in OpenSSH agent
ssh-keygen -t ed25519 -C "<user-email>" -f $HOME/.ssh/id_ed25519
Start-SSHAgent
ssh-add $HOME/.ssh/id_ed25519

# Both platforms
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgSign true
```

Use VS Code as the editor, diff tool, and merge tool when those values are unset:

```bash
git config --global core.editor "code --wait --new-window"
git config --global diff.tool code
git config --global difftool.code.cmd 'code -n --wait --diff "$LOCAL" "$REMOTE"'
git config --global merge.tool code
git config --global mergetool.code.cmd 'code -n --wait --merge "$REMOTE" "$LOCAL" "$BASE" "$MERGED"'
git config --global mergetool.code.trustexitcode true
git config --global mergetool.keepbackup false
```

## Interaction

* Show the audit table before any proposal.
* After the audit, ask only about identity, editor, and tooling gaps. Raise signing or safe-directory topics only when the user mentioned them or an error makes them relevant.
* Ask one confirmation per group, for example `Apply identity fixes? (yes/no)`. Treat only an explicit yes, in any letter case, as approval; any other answer declines the group.
* When an email does not match a corporate domain pattern the user supplied, warn without changing it.
* When every setting is already correct, state `No changes needed` and skip proposals except for topics the user asked about.

## Output Format

1. An audit section with a summary table that has at least the columns Setting, Value, Scope, and Status, using ✅ for satisfactory values and ❌ for missing or inconsistent values. A Notes column is optional.
2. Short notes below the table for ❌ rows only.
3. For each proposed group, an explanation, a fenced `bash` block, and a confirmation question.
4. After changes, a summary of successes and remaining warnings with a before and after table.
5. A final status line: `Git setup complete.` or `Git setup partial; user declined some changes.`

Example audit table:

```markdown
| Setting        | Value                    | Scope  | Status | Notes                            |
|----------------|--------------------------|--------|--------|----------------------------------|
| user.name      | Jane Doe                 | global | ✅      |                                  |
| user.email     | (missing)                | -      | ❌      | required for commits             |
| core.editor    | code --wait --new-window | global | ✅      |                                  |
| diff.tool      | (unset)                  | -      | ❌      | optional convenience             |
| merge.tool     | (unset)                  | -      | ❌      | improves merges                  |
| commit.gpgSign | true                     | global | ✅      | signing active                   |
| safe.directory | (not listed)             | -      | ✅      | not required (no unsafe warning) |
```

## Success Criteria

* Every critical gap (identity and the chosen editor and tooling) is fixed, or the user declined it with clear notice.
* No existing unrelated setting was unset or deleted, and no remote was touched.
* The summary gives clear guidance for remaining optional improvements: line endings, safe directory, and deferred signing.

© microsoft · MIT · microsoft/hve-core

Похожие скиллы

Все скиллы по теме «Git и GitHub» →
re0-git LilMGenius Скилл re0-git для Claude Code приводит сообщения коммитов к стилю репозитория. Его запускают вручную после решения о коммите, чтобы упорядочить историю или убрать отклонённый коммит. CX Codex +1 1 500установок GitHub SSH Setup for Students (Existing Repository, Clone & Push Ready) senoldak GitHub SSH Setup for Students (Existing Repository, Clone & Push Ready) — промпт для ChatGPT, Claude.ai и Claude Code: пошагово настраивает SSH-доступ к GitHub и клонирует существующий проект без токенов и паролей. GP ChatGPT ★ 178 201звёзд репо glab-gpg-key vince-winkintel Скилл glab-gpg-key для Claude Code, управляющий GPG-ключами в GitLab. Автоматизирует добавление, просмотр и удаление ключей при настройке подписи коммитов в репозиториях. CX Codex +1 118установок clawdbot-backup sundial-org Скилл clawdbot-backup для Claude Code, Codex, Cursor, Copilot и Gemini CLI, который берёт под контроль резервное копирование и восстановление настроек ClawdBot. CX Codex +1 231установок ce-setup EveryInc Скилл ce-setup для Claude Code проверяет инструменты и конфигурацию Compound Engineering в репозитории, создаёт пакеты и обновляет документацию по коду. Запускается при настройке окружения или в CI. CX Codex +1 3 600установок vscode-workspace-setup patricio0312rev Скилл vscode-workspace-setup для Claude Code создаёт в проекте папку .vscode с едиными настройками редактора, рекомендациями расширений, задачами сборки и отладкой. Унифицирует форматирование и линт в команде. CX Codex +1 313установок

Из того же набора148

Весь набор →
Backlog Grooming Субагент Backlog Grooming проверяет открытые GitHub issues, сопоставляет их с кодом и историей репозитория и выдаёт отчёт для поддержки бэклога. CX Codex +1 ★ 1 627звёзд репо git-commit Скилл git-commit для Claude Code пошагово уточняет пути для коммита, стейджит только их и создаёт один локальный коммит в формате Conventional Commits или готовит текст сообщения без коммита. CX Codex +1 ★ 1 627звёзд репо ux-coaching Скилл ux-coaching ведёт UX-специалиста через формулирование проблемы, дизайн-критику или защиту решений перед стейкхолдерами через наводящие вопросы. CX Codex +1 ★ 1 627звёзд репо RAI Reviewer Субагент RAI Reviewer координирует оценку кодовой базы по выбранным стандартам ответственного ИИ и собирает отчёт. Запускайте его для аудита, анализа изменений или проверки плана. CX Codex +1 ★ 1 627звёзд репо feasibility Скилл feasibility формирует и проверяет отчёты о технической осуществимости ML- и дата-проектов в Markdown со строгим блоком YAML. CX Codex +1 ★ 1 627звёзд репо GitHub Backlog Executor GitHub Backlog Executor — субагент для Claude Code, который создаёт, обновляет, комментирует и закрывает GitHub issues в подтверждённом репозитории. Обрабатывает бэклог. CX Codex +1 ★ 1 627звёзд репо backlog-plan Скилл backlog-plan планирует задачи в Azure DevOps, GitHub и Jira без изменения данных в трекере. Разбирает очереди, готовит спринты и формирует локальные файлы планов. CX Codex +1 ★ 1 627звёзд репо review-artifacts Правило review-artifacts для Claude Code сохраняет результаты код-ревью в согласованной структуре. Оно применяется к файлам в .copilot-tracking/reviews/code-reviews/. CX Codex +1 ★ 1 627звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой