name: sp-git-governance description: SPB Git governance for SP Boucher projects — create and publish repositories on https://git.spboucher.ai (public by default), make incremental Conventional Commits, push and verify each validated step, scan for secrets before publication, cut SemVer releases, and handle push failures without destructive operations. Use when starting a project, committing, pushing, releasing, or when a repository has no remote, unpushed commits or uncommitted finished work.
SPB Git governance
Tool: ~/.claude/bin/sp-git (on PATH). Policy: ~/.claude/standards/git-governance/POLICY.md.
SPB Git is the owner's own forge (bare repositories over SSH alias gitsrv), not GitHub/GitLab/Gitea.
New project
sp-git init --description "One or two sentences (150–300 characters)." --topics swift,macos,ai [--website https://…]Initialises git (main), writes .gitignore and a README skeleton if absent, creates the public repository
https://git.spboucher.ai/<kebab-slug>, applies headers, scans, commits, pushes and verifies. Then write the real
README (name, description, features, architecture, install, usage, tests, deployment, security, author, license,
links) — never invented features, metrics or screenshots.
Do not publish, and say why: explicit request, confidential or personal data, protected/unpublished research,
co-authors' or students' work, non-redistributable third-party code, uncertain rights → sp-git init --no-remote
(local) or --private (SSH-only). Never make an existing private repository public, never replace an origin,
never create a duplicate (--adopt attaches to an existing repository of the same name).
Every finished step
git status && git diff # review; foreign changes from another session are committed apart
<run the relevant tests / build>
sp-git commit -m "feat(auth): implement biometric authentication" path/one path/two
sp-git push # scan unpushed commits → push → ls-remote verification- Conventional Commits in English: feat, fix, perf, refactor, security, docs, test, style, build, ci, chore, release.
- Atomic: only the files of the step (
--allonly when everything belongs to it). sp-git commit --pushdoes both. Rawgit commit/git pushstay allowed: the PreToolUse hook scans them.- A push is successful only when
sp-git verify(or the push output) saysverified: origin/<branch> = <sha>. - On remote nodes (remote-first rule) run the same commands on the node that owns the working tree.
Failures and safety
- Push rejected:
sp-git sync(fetch, rebase local commits when clean, push). Conflict → resolve by hand; never force. Forge unreachable: work stays local; report the blocker; retry later. - Secret scan blocked: remove the secret, git-ignore the file, rotate the credential if it was ever committed.
Reviewed false positive →
.sp-security-alloworsp-allow-secreton the line. Never bypass to make a push pass. - Force push, history rewrite, repository/branch deletion, destructive reset/clean, remote replacement and visibility
changes need the owner's explicit authorization; then re-run prefixed with
SP_AUTHORIZED=1. - Several agents on one repository: one writer per branch; otherwise separate branches or worktrees (
sp-gittakes a per-repository lock for commit and push).
Releases
sp-git release 1.2.0 --test-cmd "swift test" # CHANGELOG section required; VERSION/package.json bumped; tag v1.2.0Never declare a stable version when build, tests, headers or scan fail.
Diagnose
sp-git status, sp-git audit, sp-git doctor, sp-security-scan --all.