whiteboard-programming
Skill0 starsChanged 7 days agoMITView on GitHub
Design before the keyboard - documentation first (describe every feature, close the scope) or proofs first (memory layout and invariants as Lean 4, then C), so risky optimizations become safe. Use when starting a project, designing a data structure, file format or interface, before a hard optimization, or on whiteboard, tablica, dowody najpierw, uklad pamieci, ampl, minmax, optimal layout.
In this repository37 other files it gives its agents.
- skills/model-surgery/references/agents.mdAGENTS.md
- alienspaceSkill
- announce-anythingSkill
- ask-older-brotherSkill
- audit-everythingSkill
- automate-everythingSkill
- bash-everythingSkill
- claudeSkill
- cleandocsSkill
- cli-everythingSkill
- codeSkill
- conventionsSkill
- cppSkill
- day-traderSkill
- decideSkill
- distribute-everythingSkill
- economistSkill
- evolveSkill
- founderSkill
- godotSkill
- hardware-anythingSkill
- karpathySkill
- model-surgerySkill
- nonconformistSkill
- orchestratorSkill
- paying-demandSkill
- publish-anythingSkill
- reaSkill
- rulesSkill
- scrape-everythingSkill
- seedSkill
- ship-anythingSkill
- skill-everythingSkill
- teardownSkill
- uiSkill
- which-licenseSkill
- workflowSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Write docs/DESIGN.md before any code.
- Distinctive: line 26
Interfaces: every call, file format and command with a worked example.
- Very specific: line 36
Before writing a struct, write its memory layout as a table in docs/LAYOUT.md: field, offset, size, alignment, the invariant it carries …
- Distinctive: line 40
The payoff is shared layout: When two record types start with the same header (id, created, flags, same stride, same alignment), generic …
- Distinctive: line 49
If two types look alike but differ in one field, decide on paper: make them equal, or keep two APIs.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
whiteboard-programming
His rule (2026-11-15): first proofs in Lean, only then code; or start from the documentation - a precise description of every feature, decide what is needed and what is not, and close projects that way. The keyboard comes last. Two doors, one order: scope, layout, proof, numbers, code, close.
<!-- digest -->1. Scope (door one: documentation first)
Write docs/DESIGN.md before any code. One page, these parts, nothing more:
- Purpose in two lines, and who runs it (him, a client, an agent).
- Features table: one row per feature - what exactly it does (inputs, outputs, errors, the number that bounds it),
and a verdict
need/maybe/no. Onlyneedrows are built.mayberows get the cheapest check that would promote or kill them.norows stay in the table with the reason, so the question is not asked again. - Interfaces: every call, file format and command with a worked example. If an example cannot be written, the feature is not understood yet.
- Limits: sizes, counts, latency, memory as numbers (a 4 GB VRAM box, 100k rows, one file).
- Done: the list of checks that make the project closed. A project with no
Donelist never ends.
Then close the scope: a feature that is not in the table does not get code. New ideas go to braindump.md
(workflow part braindump), not into the build. Brainstorm options when two designs fit (workflow part brainstorm).
2. Layout (door two begins here)
Before writing a struct, write its memory layout as a table in docs/LAYOUT.md: field, offset, size, alignment,
the invariant it carries (sorted, unique, nonzero, < capacity). Flat records, fixed width, arena or pool owned
(code part languages: data-oriented design).
The payoff is shared layout. When two record types start with the same header (id, created, flags, same stride, same alignment), generic code works on both with no conversion and no copy:
- a database and a tree: the tree API takes a descriptor
(base, stride, key_offset, key_len)and the database hands it the users array or the posts array as it is, the same pages, the same arena,memcpyrows between them; - an index over any table, a sort, a bulk load, a checksum, a snapshot: one routine, many tables;
- moving a row from one structure to another is a pointer move, not serialize and parse.
That only holds if the layouts really are equal, so the equality is a theorem and a build check, not a hope. If two types look alike but differ in one field, decide on paper: make them equal, or keep two APIs.
3. Proof (Lean 4, code part lean4)
lean4/ at the project root. In this order:
- Layout model: a Lean structure for each record (fields with offset, size, align). Theorems: fields do not
overlap, everything is in bounds,
sizeis a multiple ofalign, and for the shared-layout trickprefixEq users posts(same header offsets and stride). - Reference spec: the obviously correct, slow version of each operation (insert, lookup, range, delete) over a list or a map.
- Optimized model: the real algorithm (bit tricks, branchless select, unchecked indexing, reordered integer sums), proved equal to the spec, and the invariants proved preserved (sortedness, no duplicate keys, count <= capacity).
- Numbers out: the sizes and offsets are printed by a Lean program into a generated header
(
layout.h), never typed twice. The C includes it and adds_Static_assert-style checks (C89: the negative-array typedef trick) that the compiler'soffsetof/sizeofequal the Lean numbers.
Prove what unlocks something: a removed bounds check, an unchecked cast, two types sharing one routine, a SIMD
lane split, a lock-free step. Glue, UI and I/O get tests instead. No sorry, no native_decide in the audit. Say
which links of the chain are proved (spec = model) and which are tested (model = C, by the differential test on every
input where the domain is finite, seeded random elsewhere). Time-box a proof; a proof that does not close in a session
is a signal the design is too clever - simplify the layout, not the theorem.
3b. Numbers (AMPL, references/ampl.md)
His decision (2026-11-23): AMPL is a standard here for the maths, logic and optimization only. Where the design asks
"what is the best choice under these limits" (ergokeys layout, arena size classes, field order, chunk and thread
counts, which checks fit a budget), write it as ampl/NAME.mod + measured NAME.dat, solve, and hold the C constant
or heuristic to the optimum. Lean proves code = spec, AMPL shows spec = best, the benchmark shows it is fast. Final
code stays C or Rust (Go, Python, bash where the ecosystem asks); AMPL is a check, never shipped. Install status, licence
and the template are in the reference.
4. Code
C89 from the model, step for step (code). The oracle executable from the same Lean definitions is diffed against the
real C. Benchmark with code part bench; a proof says equal, never faster, so keep the number next to the claim.
5. Close
Closed means: every need row has a test, every claimed optimization has a proof or a differential test and a
benchmark, README and docs/DESIGN.md say what the code does (conventions), Done list ticked, no rows still in
the table. Leftover ideas are in the braindump, not half-built in src/.
Order when time is short
Scope always. Layout always (it is a table, minutes). Proof only where an optimization depends on it. Never code first and document after: the doc is how the code gets small.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

