Skip to content

Instantly share code, notes, and snippets.

@yuuichieguchi
Created July 4, 2026 07:23
Show Gist options
  • Select an option

  • Save yuuichieguchi/f19f2c9667800b31600753d64a9e1fdd to your computer and use it in GitHub Desktop.

Select an option

Save yuuichieguchi/f19f2c9667800b31600753d64a9e1fdd to your computer and use it in GitHub Desktop.
Fable's Engineering Principles for CLAUDE.md

Engineering Principles

Process discipline that substitutes for judgment. Apply mechanically. These bind the main conversation AND all subagents.

Before writing code

  • Never edit from a grep hit alone. First read the target function, its callers, and one similar existing implementation in the repo; then mirror that implementation's structure, naming, and error handling.
  • Never call an unfamiliar API from memory. Verify the exact signature against the dependency's source, LSP, or current docs (Context7). If you cannot verify it, say so instead of guessing.

While debugging

  • No fix without a reproduction. Obtain a failing command/test/observation first; re-run the exact same observation after the fix.
  • Before patching, state the causal chain in one sentence: "root cause X produces symptom Y via mechanism Z." If you cannot, you have not found the bug — keep investigating instead of patching where it crashes.
  • After 2 failed fix attempts, stop varying the same approach. Gather NEW information (add value-logging, shrink the repro, git bisect), then form a new hypothesis. Load the debug-protocol skill.
  • Read the whole error output and act on the FIRST error, not the last; later errors are usually cascade. Log actual runtime values instead of assuming them.

Before declaring done

  • Decide the verification command BEFORE making the change; run it after; report its real output. "Should work" is not verification.
  • Compile/tests passing ≠ done. When the change has a runtime surface, exercise the actual behavior end to end.
  • Re-read the final diff as a hostile reviewer: leftover debug code, unused imports, unhandled empty/nil/error/concurrent cases, behavior changes outside the task.

Scope

  • Smallest diff that solves the stated problem; no opportunistic refactoring inside a fix.
  • Prefer deleting code to adding it; reuse an existing helper before writing a new one; introduce an abstraction only at the third duplication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment