signing-preflight — скилл для Claude Code: проверка подписи коммитов
Проверяет до первого коммита, что ключ подписи загружен и разблокирован, и просит разблокировать его заранее.
npx skills add avelikiy/great_cto --skill signing-preflight -a claude-codeЧто делает signing-preflight
Скилл запускается в начале работы над задачей в репозитории, где коммиты подписываются. Он читает commit.gpgsign, gpg.format и user.signingkey, а затем делает пробную подпись: для SSH — через ssh-keygen -Y sign, для OpenPGP — через gpg --batch --pinentry-mode error --clearsign. Обе пробы ограничены таймаутом в 5 секунд.
Таймаут тут не для красоты. Вызов подписи на запертом ключе ждёт парольную фразу, которую никто не введёт, и сессия просто зависает. Если проба не проходит, скилл задаёт оператору один вопрос: разблокировать ключ (ssh-add или gpg-agent) либо разрешить коммитить без подписи в этой сессии. Дальше он ждёт ответа и молча работает, когда всё подписывается.
Сам он подпись не отключает: ни --no-gpg-sign, ни -c commit.gpgsign=false без указания. Историю не переподписывает, потому что rebase --exec меняет все хеши после первого затронутого коммита, а на отправленной ветке это force-push. Если коммиты всё-таки ушли без подписи, скилл покажет их списком через git log --format='%h %G? %s'.
Какие задачи решает
- узнать до первого коммита, что ключ подписи заперт
- разблокировать ключ один раз в начале сессии, а не после сотни коммитов
- не дать сессии зависнуть на запросе парольной фразы
- найти уже сделанные коммиты без подписи
- не переписать историю переподписью без спроса
Примеры запросов агенту
- Проверь подпись коммитов перед началом работы
gpg failed to sign— разберись, почему коммит не подписывается- Покажи коммиты без подписи в текущей ветке
Как установить signing-preflight
1Через Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill signing-preflight -a claude-code2Вручную: положить файлы
~/.claude/skills/signing-preflight/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/signing-preflight/
1Через Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill signing-preflight -a codex2Вручную: положить файлы
.agents/skills/signing-preflight/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill signing-preflight -a cursor2Вручную: положить файлы
.cursor/skills/signing-preflight/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install avelikiy/great_cto signing-preflight2Вручную: положить файлы
.github/skills/signing-preflight/SKILL.md1Через Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill signing-preflight -a gemini-cli2Командой платформы
gemini skills install https://github.com/avelikiy/great_cto --path skills/signing-preflightВручную: положить файлы
.devin/skills/signing-preflight/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill signing-preflight -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о signing-preflight
Как установить signing-preflight в Claude Code?
Выполните npx skills add avelikiy/great_cto --skill signing-preflight -a claude-code. Скилл встанет в ~/.claude/skills/signing-preflight/SKILL.md.
Что делает signing-preflight?
До первого коммита проверяет, что подпись коммитов настроена и ключ разблокирован, и просит оператора разблокировать его заранее. Если подпись не проходит, сообщает об этом вместо тихой работы без подписи.
Что будет, если ключ заперт?
Скилл задаёт один вопрос: разблокировать ключ через ssh-add или gpg-agent либо разрешить коммиты без подписи в этой сессии. Он не отключает подпись и не переподписывает историю сам.
Исходный текст
SKILL.md · MIT
---
name: signing-preflight
description: Before the first commit of a session, check that commit signing will work — the key is loaded and unlocked — and ask the operator to unlock it once, up front, instead of discovering it after a hundred unsigned commits. Never disables signing silently, never re-signs history without asking. Use at the start of implementation work in a repo that signs commits ("коммиты не подписаны", "ssh-keygen висит", "gpg failed to sign"). Loaded by senior-dev, devops.
when_to_use: |
Apply when:
- you are about to make the first commit of a session in a repository
- `git commit` hangs, or fails with "gpg failed to sign the data" / "error: signing failed"
- the operator reports commits arriving unsigned
Do NOT apply to:
- repositories where commit.gpgsign is off and no branch protection requires signatures
effort: low
allowed-tools: Read, Bash
---
# signing-preflight — find the locked key before the first commit, not after the hundredth
On real projects: an agent committed unsigned without asking to unlock the key; a
signing call on a locked SSH key hung the session; 121 commits had to be re-signed after
the fact — and the key turned out to have no passphrase at all. Each was a two-second
question at the start of the session.
## Check (read-only, bounded)
```bash
git config --get commit.gpgsign # true → signing is expected
git config --get gpg.format # ssh | openpgp (empty = openpgp)
git config --get user.signingkey
```
**SSH signing** — does a test signature finish? (`user.signingkey` may be a key file or a
literal `key::ssh-…`; the test signature is the check that works for both.)
```bash
K="$(git config --get user.signingkey)"; case "$K" in key::*) printf '%s\n' "${K#key::}" > /tmp/sigpre.pub; K=/tmp/sigpre.pub ;; esac
echo preflight | perl -e 'alarm 5; exec @ARGV' ssh-keygen -Y sign -n git -f "$K" >/dev/null 2>&1 && echo signs || echo CANNOT-SIGN
```
**OpenPGP** — a batch signature that refuses to prompt:
```bash
echo preflight | perl -e 'alarm 5; exec @ARGV' gpg --batch --pinentry-mode error --clearsign -u "$(git config --get user.signingkey)" >/dev/null 2>&1 && echo signs || echo CANNOT-SIGN
```
Always bound the test with a timeout: an unbounded signing call on a locked key waits
for a passphrase nobody will type, and the session stalls.
## Then
- **signs** → proceed; nothing to say.
- **CANNOT-SIGN** → one question to the operator, before any work:
"Commit signing is on and the key is locked / not loaded. Unlock it (`ssh-add` /
gpg-agent) and I will continue — or tell me to commit unsigned for this session."
Wait for the answer. This is the one question worth stopping for at the start.
## Never, without being told
- `git -c commit.gpgsign=false commit …` or `--no-gpg-sign` — an unsigned commit on a
branch that requires signatures is a push that will be refused, or worse, accepted.
- Re-signing history (`rebase --exec 'git commit --amend -S'`) — it rewrites every hash
after the first commit it touches; on a pushed branch that is a force-push.
## Report unsigned work
If commits were made unsigned anyway, say so with the list:
```bash
git log --format='%h %G? %s' @{upstream}..HEAD | awk '$2!="G"'
```
© avelikiy · MIT · avelikiy/great_cto