George Hotz–Inspired Coding Skills & Complexity Gates

Executable complexity gates and measurement-first, delete-first review workflows for coding agents — distilled from how George Hotz (geohot) actually runs tinygrad and custom_mec_public, not just his talks.
Works with GitHub Actions, pre-commit, Claude Code, Codex, Cursor, and any Agent Skills–compatible harness.
English | 简体中文
Unofficial. Not affiliated with, authored by, or endorsed by George Hotz, tinygrad, or comma.ai.
Quick Start (5-minute integration, zero local slowdown)
Enforce gates at delivery boundaries (CI and pre-commit) plus on-demand agent workflows — never by blocking every edit or pure Q&A turn.
1. GitHub Actions — 5 lines, ratchets legacy repos cleanly
Add to .github/workflows/complexity.yml (uses action.yml):
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: frankekn/george-hotz-skills@main
with:
root: src
max-lines: "2500" # optional total effective LOC ceiling
wide-args: "5" # on PRs, flags only NEW or WIDENED >=5-arg functions
fail-on-wide: "true" # block PRs adding wide interfaces (exempt via `sz: ignore-wide`)
2. pre-commit — staged code only (~50ms, 0ms on non-code commits)
Add to .pre-commit-config.yaml (uses .pre-commit-hooks.yaml):
- repo: https://github.com/frankekn/george-hotz-skills
rev: main
hooks:
- id: geohot-sz-staged
Checks only git-staged changes (--diff HEAD --staged --wide-args 5 --fail-on-wide). Unstaged drafts in your working tree are ignored, and commits without code files skip the hook completely.
3. Coding Agent Skill (Claude Code / Codex / Cursor)
Install the full skills/geohot-guidelines/ folder so scripts/sz.py and references/ are available alongside SKILL.md:
Why no default Agent Stop hook? Locally, git diff --quiet takes ~5ms and sz.py --diff HEAD takes ~50ms, but an always-on stop hook that blocks mid-refactor triggers an extra LLM turn (+10–30s and thousands of tokens). Delivery gates stay on CI and pre-commit; if a specific repo wants an opt-in advisory stop hook guarded by a sentinel file and 5ms git fast-path, copy the template in references/gates.md.
Isolated A/B Benchmark Results
Measured on isolated codex exec (gpt-6.2-astra, user config / hooks / plugins / global AGENTS.md disabled) across the 3 unprompted fixtures in evals/cases.json:
| Case | Baseline (no skill) | Treatment (with skill) | sz.py runs (B / T) | Key observed difference |
|---|
unprompted_pr_review (Mode B) | 5/5 PASS | 5/5 PASS | 0 / 18 | Both cleaned the PR; treatment cut app.py further (-15 vs -12 effective lines). |
improve_agent_workflow (Mode A) | 4/8 FAIL | 8/8 PASS | 0 / 25 | Baseline expanded AGENTS.md to 19 lines of prose + a separate Makefile; treatment trimmed AGENTS.md to 4 lines and put boundary + size gates into unittest. |
feature_without_bloat (Mode B) | 3/6 FAIL | 6/6 PASS | 0 / 18 | Baseline kept 2 single-caller wrappers + a dead branch (billing.py 26 lines, +9, 3 classes); treatment added send_invoice at -1 net diff (16 lines, 1 class). |
| Total | 12/19 (1/3 PASS) | 19/19 (3/3 PASS) | 0 / 61 | |
Why mechanical gates instead of prose (evidence from tinygrad)
Prompting an agent with "keep code simple" or "avoid over-abstraction" barely moves its behavior. George Hotz tested that himself in tinygrad/AGENTS.md: