Install
openclaw skills install programming-as-theory-buildingUse when writing, generating, modifying, debugging, reviewing, or refactoring code. Treat code work as rebuilding and preserving the program theory: how real-world affairs map into program behavior, why the current shape exists, which existing facility the new demand resembles, and what observable behavior proves the change belongs.
openclaw skills install programming-as-theory-buildingKarpathy-style operating rules for Peter Naur's "Programming as Theory Building". Use these rules to avoid context-free patches, speculative abstractions, and code that only looks right as text.
Tradeoff: This skill slows down trivial edits. For non-trivial code, pay the small upfront cost so the change fits the program.
Programming is not text production. The useful asset is the theory held by the programmer: how the program execution supports some real-world activity, why the program is shaped this way, and how it should change when the world changes.
Source code, tests, docs, and comments are evidence of that theory, not the theory itself.
Answer these briefly before a non-trivial edit:
If you cannot answer the first three, inspect more before patching.
Naur's key modification question is not "where can I add this?" but "what existing world-facing capability is this most like?"
Future flexibility is not free. Every option, config knob, adapter, interface, or abstraction must be designed, implemented, tested, and explained.
If verification contradicts the theory, rebuild the theory before adding another patch.
Treat a program as "alive" when its theory can still be recovered and extended. Treat it as high-risk or "dead" when only text remains.
Stop and gather more context if:
If the existing text is too far from any recoverable theory, say so. A rewrite may be cheaper than reviving dead code, but only after that risk is explicit.
When reviewing code, look for:
For non-trivial work, summarize briefly:
Theory: [world rule -> program location]
Changed: [what changed]
Verified: [checks run]
Risk: [meaningful residual risk, if any]
For review-only work, lead with findings and file references. If there are no findings, say so plainly and note remaining test gaps or residual risk.