encode-lessons-in-structure
Apply when you write the same instruction a second time, get corrected for a repeat mistake, or see a recurring failure. Encode the lesson in the strongest mechanism that can hold it, not in more text.
- License 许可
- MIT
- 最近更新
- 2026-11-04
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- encode-lessons-in-structure
- metadata
- { "layer": "L2", "source": "poteto/brainmaxxing@ec4d8e4:brain/principles/encode-lessons-in-structure.md", "license": "MIT" }
- description
- Apply when you write the same instruction a second time, get corrected for a repeat mistake, or see a recurring failure. Encode the lesson in the strongest mechanism that can hold it, not in more text.
03 SKILL.md 正文
Encode Lessons in Structure
Turn a recurring fix into a mechanism that enforces it, not another line of instructions. Every correction, failed check and surprise is a signal: capture it, put it where it gets enforced, and close the loop.
Why: Written instructions get skipped. They depend on the reader noticing, remembering and complying. A type, a rule or a check enforces itself every time, for every agent and every person.
Pattern: put the lesson on the highest step that can hold it.
- Type or architecture. Make the wrong code impossible to write: a type that can't hold the bad value, a module that hides the dangerous call, a single entry point.
- Boundary rule. An import rule saying one layer never depends on another.
- Lint or structural rule. A pattern check run by the repo's linter or structural search tool.
- Diff check. A check every change must pass before verify logs it, for what only shows up in a diff. A failing check prints why, so the refusal itself teaches.
- A line in a skill. One sentence, with an example of the failure, in the skill that does that work. For lessons that need judgment.
- A pointer in the repo map. Only when the agent needs to know a tool or file exists.
A check counts only once it fails on the original mistake and passes on the fix. Run it against the bad version before you trust it.
Corollary: If the fix is structural, use only the structural fix and delete the instruction it replaces. The instruction was the symptom.
Promotion rule. The single threshold every learning skill uses:
- A mistake class seen in 2 independent sessions or PRs is promoted to a check, at the highest step above that can state it. Several comments on one PR, or repeats inside one session, count once.
- A pack skill or playbook needs 3 real instances of the same cause or task shape. Fewer than 3 stays a solution entry or a watch item.
- Corrections are counted from the decisions log first (
ven-decisions list --step correction); transcripts are the fallback.
Close the loop:
- One-off: note it and move on. Recurring: encode it on the highest step that holds it. Systemic: raise it as a principle.
- Apply the fix now, or leave a concrete task naming the step and the file.
Stop:
- "I'll keep that in mind" persists nothing.
- A note saying a rule should exist is waste until the rule exists.
- Fixing one instance while the pattern stays open is fixing without generalizing.
04 同仓库更多 Skills
yeet
Take every local change green through the repo's own checks, slice it into conventional commits, push, and with --pr open a pull request on the code host. Use only when the user explicitly asks to yeet, or to commit and push everything; never on your own initiative.
write-docs
Write or update documentation from the code: gather facts, pick the shape for the reader, write it plain, and prove every command and path in it. Use when asked to document a repo, module or feature, or to bring stale docs up to date.
why
Find why code is shaped the way it is (design rationale, trade-offs, regressions, odd thresholds) from history, tickets, docs and chat, citing every claim and stating its confidence. Use for 'why does X work this way', 'why did we pick Y', or before changing code whose purpose is unclear.
verify
Prove a change works with the check that matches its type, do the read-back, and log the pass against the exact tree. Use when a change is ready to call done, before review, commit or stopping, and whenever ven-decisions end refuses an unverified tree.
unslop
Cut AI writing tells (filler, model vocabulary, metaphor nouns, hedging, formatting tics) from text while keeping every fact. Use when editing or checking any prose before it ships: docs, PR bodies, reports, skill text.
type-discipline
Apply when designing types or data shapes, reviewing a signature, or handling outside data, in any language. Make wrong states fail early: in the compiler for typed languages, in validated runtime contracts for untyped ones.