SPB Git

Repository Public

SKILL.md 3.0 KB


# name: sp-source-header description: SP Boucher official source header — generate, validate, fix and audit the mandatory header of SP Boucher-owned source files (Swift, TypeScript, Python, Rust, Go, C/C++, Metal, SQL, HTML, shell, YAML and more) with the local sp-header engine. Use when creating or modifying source files, renaming files, auditing a repository's header compliance, or deciding whether a file may carry the header (ownership, third-party code, generated files).

# SP Boucher source header

The header is written by the engine, never by hand: ~/.claude/bin/sp-header (also on PATH). Canonical template: ~/.claude/standards/source-header/TEMPLATE.md; rules: ~/.claude/standards/source-header/POLICY.md.

# What happens automatically

The PostToolUse hook runs after every Write/Edit: in a repository with established SP Boucher ownership it adds the header to a new eligible file and refreshes Last Modified on an edited one. When it reports "header added", the file changed on disk — re-read before the next edit and never add a second header. Files written through Bash or other tools are not seen by the hook: run sp-header fix <dir> or sp-header apply <file> yourself.

# Decide ownership before stamping

A header asserts that Simon-Pierre Boucher is the author. Stamp only SP Boucher-owned code.

  • sp-header inspect <file> shows ownership (owned / unknown / foreign / restricted) and why.
  • unknown (new project, no remote yet): if it is his project, sp-git init then headers apply; otherwise add none.
  • foreign / restricted (third-party origin, co-authored paper, student or client work, repository under review, "headers": false): do not stamp. --force-owner exists only for a human-verified case.
  • Never fabricate author, license, dates, website or repository. Unknown values stay Not specified / Unknown.

# Commands

bash
sp-header inspect <file>            sp-header generate <file>
sp-header apply <file>… [--touch] [--new] [--upgrade]
sp-header check <dir>               sp-header fix <dir> [--dry-run]
sp-header audit <dir>               sp-header report <dir> [--out report.md]
  • New file created outside Write/Edit: sp-header apply --new <file>.
  • Substantive edit made outside Write/Edit: sp-header apply --touch <file>.
  • Renamed or moved file, new remote, new LICENSE: sp-header fix <dir> refreshes File / Repository / License and keeps Created.
  • Earlier SP Boucher variants (v1 spb-header) are valid and kept; convert one only on request with --upgrade.
  • Before a commit: sp-header check . must exit 0 in an owned repository (sp-git commit does it for staged files).

# Never stamped

JSON, lock files, generated or minified files, dependencies, build output, data, models, media, keys, .env, migrations and fixtures, anonymous-submission folders, files with a third-party notice; LaTeX/BibTeX only by an explicit sp-header apply. Per-repository exclusions: .sp-standard.json → "exclude": ["glob"].

Files main
Menu

Theme