SPB Git

Repository Public

README.md 7.2 KB 121 lines markdown

1# SP Boucher Development Standard23The installable implementation of the **SP BOUCHER GLOBAL SOFTWARE ENGINEERING & GIT GOVERNANCE STANDARD** for4Claude Code: one official source header on every SP Boucher-owned source file, and every eligible project versioned5on [SPB Git](https://git.spboucher.ai) with incremental, verified, secret-scanned commits and pushes.67It installs into the Claude Code user directory (`~/.claude`) of a machine and stays active in every session, every8project and every agent: a permanent directive in `CLAUDE.md`, five hooks in `settings.json`, three skills, four9command-line tools and the policy files they read. Python 3.8+ and git are the only requirements; nothing calls an10external API and no credential is stored anywhere.1112## What is installed1314| Path under `~/.claude` | Content |15|---|---|16| `CLAUDE.md` | marked block *SP BOUCHER GLOBAL MANDATORY DEVELOPMENT STANDARD* (existing content untouched) |17| `settings.json` | hooks SessionStart, PreToolUse (Bash), PostToolUse (Write/Edit), SubagentStop, Stop (existing hooks kept) |18| `bin/` | `sp-header`, `sp-git`, `sp-security-scan`, `sp-dev-doctor` (linked into `~/.local/bin` and Homebrew's `bin`) |19| `hooks/sp-source-header`, `hooks/sp-git-governance`, `hooks/sp-security` | hook entry points |20| `skills/sp-source-header`, `skills/sp-git-governance`, `skills/sp-development-standard` | global skills |21| `standards/` | `VERSION`, `identity.json`, `source-header/{TEMPLATE,POLICY}.md`, `languages.json`, `exclusions.json`, `git-governance/{POLICY.md,config.json}`, engine `lib/spstd/` |22| `tests/sp-development-standard/` | the test suite |23| `backups/sp-development-standard/<timestamp>/` | what was there before each install, update or removal |2425## Install, update, verify, remove2627```bash28./install.sh                 # idempotent, non-interactive; backs up CLAUDE.md, settings.json and previous files first29./verify.sh [--quick] [--tests]30./update.sh                  # git pull --ff-only, install, verify31./uninstall.sh               # removes tools, hooks, skills and the CLAUDE.md block; backups are kept32./uninstall.sh restore [--from <timestamp>]     # put CLAUDE.md and settings.json back as they were33sp-dev-doctor [--quick] [--json]                # any time, from anywhere34```3536MacLustr nodes (macOS and Linux, over the existing SSH aliases, in parallel):3738```bash39./deploy-nodes.sh --detect M5M36 M3U96a M4M64a …   # only where Claude Code is present40./deploy-nodes.sh --verify M5M36 M3U96a …          # doctor only41```4243The kit is copied to `~/.sp-development-standard` on the node and installed there. No secret travels. The optional44machine-local file `~/.claude/standards/local/overrides.json` (repositories whose attribution is under review, extra45secret patterns) is not part of this repository; `deploy-nodes.sh` copies the operator's copy when it exists.4647## The tools4849```bash50sp-header inspect|generate <file>      sp-header apply <file>… [--touch] [--new] [--upgrade]51sp-header check|fix|audit|report <dir> sp-header doctor|version5253sp-git init [--name slug] [--description "…" --topics a,b] [--private|--no-remote] [--adopt]54sp-git status | commit -m "type(scope): …" [files…] [--push] | push | verify | sync | audit55sp-git release <MAJOR.MINOR.PATCH> [--test-cmd "…"] | meta | doctor | version5657sp-security-scan [--changes|--staged|--unpushed|--tree|--files f…] [--all] [--strict] [--json]58sp-dev-doctor [--quick] [--json]59```6061- **Header engine.** Detects language, project root, git metadata, license and ownership; renders the canonical62  header in the right comment syntax; keeps shebangs, encoding declarations, `<?php`, doctype, build constraints,63  BOM, line endings, permissions; refuses generated, vendored, third-party, data and secret files; idempotent.64  Rules: [`payload/standards/source-header/POLICY.md`](payload/standards/source-header/POLICY.md), template:65  [`TEMPLATE.md`](payload/standards/source-header/TEMPLATE.md).66- **Ownership gate.** A header is an authorship claim. Automation stamps only on positive evidence (origin on SPB67  Git, or a policy file); third-party clones, repositories whose v1 policy does not assert Simon-Pierre Boucher's68  rights, and repositories under review are left alone.69- **SPB Git.** The forge is a directory of bare repositories on the gateway, public under `srv/git`, SSH-only under70  `srv/git-private`. `sp-git` drives it over SSH with the keys already in place and verifies every push with71  `git ls-remote`. Rules: [`payload/standards/git-governance/POLICY.md`](payload/standards/git-governance/POLICY.md).72- **Secret scanner.** Provider API keys (Anthropic, OpenAI, OpenRouter, GitHub, AWS, Google, Stripe, Slack, Hugging73  Face…), private keys, database URLs and URLs with credentials, JWTs, credential assignments, `.env` and key files.74  Findings are masked. High severity blocks `sp-git commit`, `sp-git push` and, through the hook, raw `git commit`75  and `git push`.7677## The hooks7879| Event | What it does |80|---|---|81| SessionStart | states the policy and the repository context (origin, ownership, uncommitted, unpushed, behind upstream) |82| PreToolUse — Bash | denies force push, remote deletion, history rewriting, origin replacement, destructive reset/clean over uncommitted work, deletion of a forge repository; runs the secret scan before `git commit` and `git push` |83| PostToolUse — Write, Edit | in an owned repository: adds the header to a new eligible file, refreshes `Last Modified` on an edited one; warns about secret files that are not git-ignored; otherwise says why nothing was stamped |84| SubagentStop | repairs headers of the files the session touched; reports secret risks to the subagent |85| Stop | lists edited files left uncommitted, commits left unpushed, repositories without a remote — once, never in a loop |8687Limits, by design: hooks see Write/Edit, not files written by Bash or other processes (the Stop check and88`sp-header fix` cover those); an owner-authorized destructive operation is re-run prefixed with `SP_AUTHORIZED=1`;89the secret scan has no such override.9091## Tests9293```bash94python3 tests/test_standard.py        # 28 tests, temporary repositories, fictitious data, no network95```9697Covered: Swift, TypeScript (byte-exact canonical layout), Python with shebang and encoding line, Rust, Metal, HTML,98SQL, YAML; edit, rename, creation date kept, modification date refreshed; license detection; no duplication;99third-party, generated, JSON, dependency and migration exclusions; CRLF, BOM, non-UTF-8, permissions; v1 variants100and restricted policies; git initialisation, remote creation, duplicate refusal, incremental commits, push and101verification; secret detection and blocked publication; private repositories; conflicts; network failure; releases;102every hook; clean-environment installation, idempotence, fresh-process check, removal and restoration.103104## Version1051061.0.0 — see [`CHANGELOG.md`](CHANGELOG.md).107108## Author109110**Simon-Pierre Boucher** — Professor of Finance, Université du Québec en Outaouais (UQO)111SP Boucher · https://spboucher.ai · https://git.spboucher.ai112113- Contact: contact@spboucher.ai114- Development: dev@spboucher.ai115- Support: support@spboucher.ai116- Security: admin@spboucher.ai117118## License119120None specified (no license file in this repository). All rights reserved where applicable.121
Files main
Menu

Theme