Back to directory
assafkip avatar
assafkip / fable-discipline

fable-discipline

Make Claude Opus code like Fable 5: Fable's coding habits as a Claude Code plugin, with one habit (tests never touch live data) enforced by a hook.

5

Stars

2

Forks

0

Watchers

MIT

License

fable-discipline

Fable's engineering discipline for any Claude session, with one habit actually enforced by a hook instead of left to the model's good intentions.

Most "make the model more disciplined" skills are prompts: vague instructions the model is trusted to follow and check itself against. That is the fair criticism of the whole genre. fable-discipline teaches the judgment parts the same way, but the one habit that can be checked mechanically is enforced by a hook that blocks, every time, whether the model feels like it or not.

Where it came from

I spent a while reading thousands of code edits by one capable model, next to another, then had an independent review grade the work. The habits that survived both the review and the shipped codebase are what is in here. It comes in two layers: how to run a task, and how to write the code.

Install

/plugin marketplace add assafkip/fable-discipline
/plugin install fable-discipline@fable-discipline

Restart Claude Code. Nothing to call. The skill triggers on coding and multi-step tasks; the hook runs on every test-file edit.

What it does

Layer 1, running the task: stage the work before acting, put a check that can fail at each stage, write done-criteria instead of trusting a feeling, and confirm a perceived error is real before diagnosing it.

Layer 2, writing the code: read the real code before editing it, verify against a copy with a deliberately-failing negative test, route mutations of a shared resource through one guarded function, and write comments that say why.

The enforced slice: a PostToolUse hook blocks a test from connecting to or opening a real data path. Temp copy or in-memory only. It catches the path whether it is written directly, stored in a variable, or nested in an f-string, and stays quiet on fixtures, golden files, and assertions. Verified at zero false positives across a real 221-test suite.

sqlite3.connect("app/data/prod.db")   # blocked
sqlite3.connect(":memory:")           # fine

Bypass a specific file with # fable-discipline-lint-skip.

Honest scope

This does not raise the model's reasoning ceiling. It shapes how the model works a problem, and it hard-stops one specific foot-gun. The hook is deterministic (a script reading the file, not the model grading itself), so it has no self-report blind spot. The judgment layers are nudges, not guarantees; that is why the checkable habit is a hook and the rest is a skill.

How this differs from staged-workflow approaches

If you set effort to Ultracode, Claude already runs a dynamic workflow that stages and parallelizes a task. That is orchestration of the task. fable-discipline is different in one way that matters: it enforces at the edit. A workflow will not stop a test from writing to your production database; the hook will. They compose.

Related: mrtooher/fable-mode captures the task-execution discipline as a skill. fable-discipline overlaps that ground and adds the code-craft layer plus the enforced hook.

Run the self-test

python3 skills/fable-discipline/scripts/test_fable_discipline_lint.py

Eleven cases, covering what should block and what should pass.

License

MIT.


Built by Assaf

I spent 12 years in threat intelligence watching teams find the same failure and fix it four times. The learning never stuck. I build tools that make it stick.

This is the free version. The paid kits live at claudedaddy.io.

Want this wired into your team's repo, or a heavier spec-and-review pipeline? That's the consulting. Book a call.