Skip to content

Fix the Misleading ssh-add Signing Check in git-commit-conventions #706

Description

@ptr727

What happened

Working in a session on this host, I was about to make the fleet's first agent-authored commit
of the session and followed git-commit-conventions's verification step literally:

git config --get commit.gpgsign && ssh-add -L

commit.gpgsign read true. ssh-add -L failed: Could not open a connection to your authentication agent. I then checked the Windows ssh-agent service and found it Stopped /
Disabled.

Following the skill's rule ("If signing is not configured, do not commit... surface the missing
config and stop at git add"), I concluded signing was broken on this host, stopped short of
committing, and reported the ssh-agent gap to the maintainer as a blocker.

It was not a real blocker. A second agent, in a separate session, tested it directly: created a
scratch commit with git commit -S, then git log --show-signature verified it, "Good git
signature." Signing worked cleanly the whole time. I then reproduced that myself: git commit -S
on real work succeeded and verified clean, with the ssh-agent service still Stopped/Disabled,
unchanged.

Why the verification step is wrong, not just my reading of it

ssh-keygen -Y sign (what git commit -S shells out to under gpg.format = ssh) can sign
directly from a private key file on disk. It does not need a running ssh-agent, and only
reaches for one when the key is not otherwise available. ssh-add -L tests one specific delivery
path (an agent holding the key) that this host's actual setup does not use at all: a plain,
non-agent-backed SSH private key file. ssh-add -L failing here was a true, reproducible fact,
and it said nothing about whether git commit -S would succeed. I treated it as though it did.

I also spent real time chasing a second red herring once the mismatch surfaced: the last several
commits on this branch were signed with a GPG/OpenPGP RSA key, not SSH, which looked like more
evidence something was broken. It wasn't. This host was signing with GPG before switching this
repo's config to SSH at some point in its history, so older commits carry the old key and newer
ones carry the new one. Nothing was inconsistent; I just did not have a way to date the config
change against the commit log without asking.

Suggested fix

In .claude-plugin/fleet-skills/skills/git-commit-conventions/SKILL.md, "Signing, verified not
configured" currently reads:

Verify before the first agent-authored commit, don't assume a prior session left it set:
git config --get commit.gpgsign && ssh-add -L, or the GPG equivalent.

Replace the ssh-add -L check (or supplement it) with a real test that matches what actually
gets exercised, e.g. a scratch-repo git commit -S + git log --show-signature check, or state
explicitly that an unreachable ssh-agent is inconclusive on a host signing straight from a key
file, so an agent doesn't read that one signal as a stop condition. A note that GPG-signed
history predating an SSH switch is expected and not evidence of a broken setup would also have
saved a detour here.

Environment this was observed on

Windows 11, PowerShell 7, Git for Windows, SSH signing via ~/.ssh/id_ed25519, no ssh-agent
service running, commit.gpgsign = true, gpg.format = ssh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions