From git-worktree-safety
Recovers a failed SSH-signed Git commit without altering trust or content. Use when a commit fails before ref advancement due to signer/agent/socket/key issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-worktree-safety:git-commit-signing-recoveryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Recover a failed signed commit without silently changing trust or committed
Recover a failed signed commit without silently changing trust or committed
content. Resolve $PLUGIN_ROOT from the host's plugin-root variable when
defined; otherwise use the absolute path of this skill folder's ../...
Read
$PLUGIN_ROOT/skills/git-commit-signing-recovery/references/recovery-contract.md
before authorizing a retry, changing signer execution, or considering an
unsigned fallback.
COMMIT_EDITMSG bytes are the intended
stored message. Editor, template, scissors, comment cleanup, or other
message-transforming modes require a separate recovery contract.HEAD. Initial or root commits need a
separate parent-transition contract.-a, --include, --only, pathspec,
--pathspec-from-file, interactive/patch mode, hook bypass, author/committer
override, or command-scoped Git configuration/environment override. The only
eligible retry override is one gpg.ssh.program command override already
proven to reach the same trusted key.required, optional, or unknown.
Required and unknown policy fail closed. Optional policy still does not
authorize an unsigned commit without explicit user approval.git and ssh-keygen executables. Missing evidence is a stop condition.Read repository policy. Record whether signed commits are required, optional, or still unknown.
Inspect only a bounded failure tail. Accept this workflow only when the
evidence names the signing layer and HEAD still identifies the pre-commit
commit, and when the message contract is byte-stable and non-interactive.
In a private owner-controlled directory, choose absent receipt and authorization paths. Record the baseline immediately after failure:
python3 "$PLUGIN_ROOT/scripts/git_commit_signing_guard.py" audit \
--repo /path/to/checkout \
--policy required \
--receipt /private/path/signing-receipt.json \
--authorization /private/path/signing-authorization.json
The helper also claims the exact state in its namespaced Git common-directory journal. Repeating the snapshot under new filenames cannot mint another authorization for the same state.
Diagnose the signer without mutating Git state. Obtain a bounded, independently verified probe of the configured identity or restored agent path. Do not include raw key, socket, executable, or configuration values in a handoff.
Request the single-use authorization immediately before retry. State that the independent signer probe was verified:
python3 "$PLUGIN_ROOT/scripts/git_commit_signing_guard.py" authorize \
--repo /path/to/checkout \
--receipt /private/path/signing-receipt.json \
--authorization /private/path/signing-authorization.json \
--signer-probe verified \
--commit-shape verified-plain-index
Proceed only when the helper reports signed_retry_allowed: true; that call
atomically consumes the only helper-issued retry token. Repeat the same
plain-index signed commit once. Do not add -a, a pathspec, metadata or
configuration overrides, --no-gpg-sign, bypass hooks, alter the message,
or change the staged set as part of recovery. The one verified same-key
signer-program override is the sole exception. The helper always reports
unsigned_fallback_allowed: false.
Verify the successful result against the private baseline receipt:
python3 "$PLUGIN_ROOT/scripts/git_commit_signing_guard.py" verify \
--repo /path/to/checkout \
--receipt /private/path/signing-receipt.json \
--authorization /private/path/signing-authorization.json
Report the old and new commit IDs, signature verdict, committed-diff equality, residual-state verdict, retry count, and any remaining delivery gate. Keep the receipt private when even hashed repository or configuration identifiers are inappropriate for the destination.
Exit 0 means private baseline state was created, the single-use token was
consumed, or the post-commit receipt verified. Exit 2 is a safety refusal or
failed postcondition. Exit 1 means malformed input or unavailable evidence.
An unsigned commit is never an automatic recovery path. If repository policy is explicitly optional and the user separately authorizes unsigned output, treat that as a new commit decision outside this helper and record the policy exception in the delivery receipt.
Guides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.
npx claudepluginhub xopoko/plug-n-skills --plugin git-worktree-safety