gleanin
Rules from past failures. Apply every session.
Credentialed Write Gate
Rule:
- Before writing with ambient credentials, verify scope (
<tool> whoami, config view).
- Exact-match created resource name against intent.
- On mismatch, roll back immediately.
- Never mark done when acceptance probe failed.
Check: grep -c "inoffensif\|harmless\|can delete\|not needed" in session transcript — zero for any failed write.
Delegation Preflight
Rule:
- Scan delegation payload against delegate's Known Limitations first.
- Verify with
git diff, not the delegate's [OK] lines.
- On partial landing, name the limitation before hand-editing.
- Structural integrity check every delegate-touched file.
Check: git diff --stat HEAD after delegation — changed file count must match expected.
Device First Check
Rule:
- Search filesystem (
find, grep, ls) before asking the user.
curl -sI before declaring anything "not deployed."
- Syntax check + tail check before committing.
Check: grep -c "AskUserQuestion\|curl.*not.find\|edit.*then.*ask" in session transcript — near zero with this rule.
Reference First Porting
Rule:
- Read the reference before editing any formula or algorithm.
- Cite
file:line per edit.
- Apply supplied values verbatim before re-derivation.
Check: grep -rn "TODO\|FIXME\|guess\|maybe" <target-file> — zero after a port.
Protocol index
Trigger-loaded protocols. When a trigger matches the current task, Read the file before proceeding.
- Exact form first — literal search, decisive git comparison, file-borne payloads — Load this in any session that (a) greps source code, (b) makes claims about → read ~/distillation/artifacts/exact-form-first.md
- Hang-bisect protocol — trace before retry, never escalate timeouts blind — Load this whenever a script or pipeline invocation times out (exit 124), → read ~/distillation/artifacts/hang-bisect-protocol.md
- Reproduce the report first — locate what the user sees before defending what you did — Load this whenever a user disputes visible state: "your changes don't → read ~/distillation/artifacts/reproduce-report-first.md
- Route census before auth policy — classify every endpoint once, edit once — Load this whenever you are about to add or change authentication, API-key → read ~/distillation/artifacts/route-census-before-auth.md
- Single-file batch edit — plan the change-set, then edit once — Load this whenever a task requires 3 or more changes to the same file — → read ~/distillation/artifacts/single-file-batch-edit.md
- boundary-aware handoff — When dividing work between two or more models (or model sessions): → read ~/fable-build/rules/boundary-aware-handoff.md
- content-integrity tests — For data-driven products (games, rule engines, content systems): → read ~/fable-build/rules/content-integrity-tests.md
- contract-first interface — When building a system that runs across multiple targets (offline, online, → read ~/fable-build/rules/contract-first-interface.md
- cost-time-quality accounting — Every build produces a cost accounting artifact: → read ~/fable-build/rules/cost-time-quality-accounting.md
- cross-model relay — When routing build phases across multiple models: → read ~/fable-build/rules/cross-model-relay.md
- deterministic default — Use fixed seeds for all world/level generation: → read ~/fable-build/rules/deterministic-default.md
- effort setting by phase — When configuring a build phase, set effort level explicitly: → read ~/fable-build/rules/effort-setting-by-phase.md
- goal-verification-report loop — Replace step-based phase execution with a goal→report pattern for → read ~/fable-build/rules/goal-verification-report.md
- phase stage verification — When a phase spans significant work, split it into stages (1/2/3): → read ~/fable-build/rules/phase-stage-verification.md
- review findings accounting — Every code review produces a numbered list of findings. → read ~/fable-build/rules/review-findings-accounting.md
- safety overfit testing — For products that use LLM outputs (chatbots, content generators, agents): → read ~/fable-build/rules/safety-overfit-testing.md
- thought-partner interview — Before writing ANY spec, template, or brief, interview the model as a → read ~/fable-build/rules/thought-partner-interview.md
- vision self-correction loop — When the build produces visual output (UI, 3D scenes, renders, screenshots): → read ~/fable-build/rules/vision-self-correction.md
1---2name: gleanin3description: Rules distilled from past session friction (errors, edit loops, corrections), analyzed by a stronger model and applied to guide future work. Regenerated from glean/artifacts/ plus an index of trigger-loaded protocols from GLEAN_PROTOCOL_DIRS by sync.sh — load every session via CLAUDE.md.4license: MIT5---67# gleanin89Rules from past failures. Apply every session.1011<!-- Rules are auto-generated by sync.sh. Do not edit manually. -->1213### Credentialed Write Gate1415**Rule:**161. Before writing with ambient credentials, verify scope (`<tool> whoami`, `config view`).172. Exact-match created resource name against intent.183. On mismatch, roll back immediately.194. Never mark done when acceptance probe failed.2021**Check:** `grep -c "inoffensif\|harmless\|can delete\|not needed"` in session transcript — zero for any failed write.2223### Delegation Preflight2425**Rule:**261. Scan delegation payload against delegate's Known Limitations first.272. Verify with `git diff`, not the delegate's `[OK]` lines.283. On partial landing, name the limitation before hand-editing.294. Structural integrity check every delegate-touched file.3031**Check:** `git diff --stat HEAD` after delegation — changed file count must match expected.3233### Device First Check3435**Rule:**361. Search filesystem (`find`, `grep`, `ls`) before asking the user.372. `curl -sI` before declaring anything "not deployed."383. Syntax check + tail check before committing.3940**Check:** `grep -c "AskUserQuestion\|curl.*not.find\|edit.*then.*ask"` in session transcript — near zero with this rule.4142### Reference First Porting4344**Rule:**451. Read the reference before editing any formula or algorithm.462. Cite `file:line` per edit.473. Apply supplied values verbatim before re-derivation.4849**Check:** `grep -rn "TODO\|FIXME\|guess\|maybe" <target-file>` — zero after a port.5051<!-- end gleanin rules -->5253<!-- Protocol index auto-generated by sync.sh. Do not edit manually. -->5455## Protocol index5657Trigger-loaded protocols. When a trigger matches the current task, Read the file before proceeding.5859- **Exact form first — literal search, decisive git comparison, file-borne payloads** — Load this in any session that (a) greps source code, (b) makes claims about → read ~/distillation/artifacts/exact-form-first.md60- **Hang-bisect protocol — trace before retry, never escalate timeouts blind** — Load this whenever a script or pipeline invocation times out (exit 124), → read ~/distillation/artifacts/hang-bisect-protocol.md61- **Reproduce the report first — locate what the user sees before defending what you did** — Load this whenever a user disputes visible state: "your changes don't → read ~/distillation/artifacts/reproduce-report-first.md62- **Route census before auth policy — classify every endpoint once, edit once** — Load this whenever you are about to add or change authentication, API-key → read ~/distillation/artifacts/route-census-before-auth.md63- **Single-file batch edit — plan the change-set, then edit once** — Load this whenever a task requires **3 or more changes to the same file** — → read ~/distillation/artifacts/single-file-batch-edit.md64- **boundary-aware handoff** — When dividing work between two or more models (or model sessions): → read ~/fable-build/rules/boundary-aware-handoff.md65- **content-integrity tests** — For data-driven products (games, rule engines, content systems): → read ~/fable-build/rules/content-integrity-tests.md66- **contract-first interface** — When building a system that runs across multiple targets (offline, online, → read ~/fable-build/rules/contract-first-interface.md67- **cost-time-quality accounting** — Every build produces a cost accounting artifact: → read ~/fable-build/rules/cost-time-quality-accounting.md68- **cross-model relay** — When routing build phases across multiple models: → read ~/fable-build/rules/cross-model-relay.md69- **deterministic default** — Use fixed seeds for all world/level generation: → read ~/fable-build/rules/deterministic-default.md70- **effort setting by phase** — When configuring a build phase, set effort level explicitly: → read ~/fable-build/rules/effort-setting-by-phase.md71- **goal-verification-report loop** — Replace step-based phase execution with a goal→report pattern for → read ~/fable-build/rules/goal-verification-report.md72- **phase stage verification** — When a phase spans significant work, split it into stages (1/2/3): → read ~/fable-build/rules/phase-stage-verification.md73- **review findings accounting** — Every code review produces a numbered list of findings. → read ~/fable-build/rules/review-findings-accounting.md74- **safety overfit testing** — For products that use LLM outputs (chatbots, content generators, agents): → read ~/fable-build/rules/safety-overfit-testing.md75- **thought-partner interview** — Before writing ANY spec, template, or brief, interview the model as a → read ~/fable-build/rules/thought-partner-interview.md76- **vision self-correction loop** — When the build produces visual output (UI, 3D scenes, renders, screenshots): → read ~/fable-build/rules/vision-self-correction.md7778<!-- end protocol index -->