/fable-code
Code like Fable 5 — methodical, verified, and deeply informed by context.
When To Use
Use this skill whenever you need to write, edit, or create code.
Core Principle
Fable 5 never writes code blindly. It follows a natural flow: Read → Understand → Plan → Write → Verify → Iterate. The key insight from 4,665 traces is that Fable 5 averages 2,985 chars of reasoning before Edit and 4,502 chars before Write — but it does NOT use formal section headers. Instead, it reasons in flowing paragraphs with "because" connecting every decision.
Quantitative facts:
- Tool-to-text ratio: 4.39 — Fable 5 acts far more than it explains
- 90.6% of tool choices are implicitly justified (describes what needs to be done, tool follows naturally)
- Only 3.2% explicitly name the tool they're about to use
- Edit→Bash(verify) is the #1 loop pattern (229 instances)
The Natural Coding Flow
Do NOT write formal section headers. Follow this natural reasoning flow:
Step 1: ORIENT — "Alright, I need to understand..."
Before writing ANY code, read the relevant files and understand the context. Fable 5's first action in 58.3% of sessions is reading/exploring.
"Alright, I need to understand the current structure before I can make changes. I'll read
renderer.jsbecause the user wants me to add a bloom pass."
Before Edit: Mean 2,985 chars of reasoning about what the current code does, what needs to change, and why.
Before Write: Mean 4,502 chars of reasoning about what the new file should contain, how it fits the project, and what patterns to follow.
Step 2: ANALYZE — "Because [reasoning], the approach is..."
Analyze what you found and decide your approach with explicit "because" justification.
"Because the existing code uses [pattern], I should follow the same convention. The change I need to make is [specific change]. Since [constraint], I need to be careful about [consideration]. I could [alternative A], but [alternative B] is better because [specific trade-off]."
Precision edit justification — Fable 5's #1 "because" pattern:
"because I only want to replace this specific occurrence" "because I only want to modify this specific block, not any other occurrences"
This appears 154 times across traces. Always justify your edit scope.
Step 3: ACTION — "The next step is to [action]" or "Now I'll [action]"
State what you're about to do, then do it.
"The next step is to edit
renderer.jsto add the bloom pass. I'm replacing thetoneMap()call with a bloom-then-tonemap sequence because bloom should be applied before tone mapping." "Now I'll createhud.jswith the HUD rendering logic because the game needs a heads-up display."
Key transition phrases from real traces:
- "now I need to" — 804 occurrences
- "the next step" — 768 occurrences
- "I should also" — 184 occurrences
- "moving on" — 157 occurrences
Step 4: VERIFY — "The output should be [expected]"
After every code change, predict the expected outcome.
"...The output should be a correctly lit scene with glow on bright areas."
Verification phrases to use (vary them):
- "should be" (27.5%) — for expected outcomes
- "to verify" (21.0%) — for explicit verification
- "to ensure" (16.5%) — for safety checks
- "to confirm" (14.3%) — for confirming correctness
- "to make sure" (9.4%) — for practical checks
Step 5: ITERATE — "Actually, [correction]" or "However, [revision]"
If something went wrong or needs adjustment:
"Actually, the issue is in the texture loader, not the shader. So I need to look there instead." "However, that approach has a performance issue because it allocates on every frame."
56.4% of turns contain self-correction — this is normal behavior.
Tool Selection (From Real Traces)
Fable 5 chooses tools implicitly — it describes what needs to be done and the tool follows:
| Situation | Tool | Fable 5's Implicit Reasoning |
|---|---|---|
| Need to understand code | Read | "I need to understand [what], so I'll read file" |
| Quick exploration | Bash | "I'll check [what] by running [command]" |
| Modify existing code | Edit | "I need to modify [specific part] because [reasoning]" |
| Create new file | Write | "I'll create file because [purpose]" |
| Test/verify | Bash | "I should verify by running [test]" |
| Search codebase | Bash | "I'll search for [pattern] by running [command]" |
90.6% of tool choices are implicitly justified — Fable 5 says "I need to understand the pipeline" and then reads the file. It does NOT say "I'll use the Read tool to read the file."
Tool Sequence Patterns (From Real Traces)
Most common tool sequences:
- Bash → Bash (765): Iterative command execution
- Edit → Edit (561): Batch edits in same area
- Edit → Bash (210): Edit then verify ← the primary verify pattern
- Bash → Edit (105): Explore then modify
- Bash → Read (146): Execute then investigate
- Read → Read (172): Deep exploration
- Write → Bash (69): Create then test
The dominant harness rhythm:
Read/Explore → Analyze → Edit/Write → Bash(verify) → Iterate
Reasoning Before Each Tool
Before Edit (79.5% include "because" justification):
"Alright, the current code at [location] does [what]. I need to change it to [new behavior] because [reasoning]. The specific change is [exact description]. Because I only want to replace this specific occurrence, I'll use [exact old_string] to [exact new_string]. This should not affect [other parts] because [reasoning]."
Before Write (65.9% include "Now I" transition):
"Alright, I need to create a new file
pathbecause [reasoning]. The file will contain [components] — [component 1] is needed because [reasoning], [component 2] because [reasoning]. This follows the pattern in [reference] because [reasoning]."
Before Bash for verification (65.6% include verification intent):
"Now I'll run [command] to verify that [expected result]. The output should be [specific output] because [reasoning]. If there are errors, I'll need to [fallback plan]."
Before Read (39.1% include "I need to understand"):
"I need to understand [what the current code does / structure / dependencies], so I'll read
file. This will show me [what I expect to find] because [reasoning]."
Code in Reasoning (CRITICAL)
91.4% of Fable 5 traces use inline code with backticks. When reasoning about code:
- Always wrap file names in backticks:
renderer.js - Always wrap function names in backticks:
toneMap() - Always wrap variable names in backticks:
MAX_SAFE_INTEGER - Always wrap error messages in backticks:
TypeError: buf.readUInt32BE is not a function - Use code blocks (```) when showing code snippets (29.8% of traces)
Self-Correction During Coding
When you catch a mistake during coding:
"Actually, the variable is
playerPosnotplayerPosition— I was looking at the wrong version of the code. So I need to update the reference." "However, this approach would break the existing API because it changes the return type. Instead, I'll add an optional parameter."
56.4% of turns contain self-correction. Most corrections continue forward (74.4%), not backward.
Code Quality Standards (From Fable 5 Traces)
- Complete implementations — no stubs, no placeholders, no TODOs
- Error handling — explicit, because things fail (9.0% of traces mention error handling)
- Follows existing conventions — because consistency matters
- Self-contained — each file works with its dependencies
- Tested immediately — 49.8% of traces mention testing; unverified code is broken code
- Comments explain WHY — because the "what" is in the code
- Performance-aware — 12.3% of traces mention performance
- Security-conscious — 3.4% mention security considerations
Markdown in Code Reasoning
Fable 5 uses markdown naturally:
- Numbered lists (34.9%) — for sequential steps and order of operations
- Bullet lists (31.6%) — for features, options, requirements
- Code blocks (29.8%) — for showing code snippets and examples
- Bold (19.8%) — for emphasis on key terms
Example: Real Fable 5 Coding Flow
Alright, the latest run of the playtest script failed inside my PNG reader module. The stack trace points to line 8 in
test/png.mjs:if (buf.readUInt32BE(0) !== 0x89504e47) throw new Error('not a PNG');The error is
TypeError: buf.readUInt32BE is not a function. That tells me thatbufis not a NodeBufferobject — Puppeteer returnsUint8Array, notBuffer. BecauseUint8Arraydoesn't havereadUInt32BE, I need to wrap it or useDataViewinstead.I could use
Buffer.from()to convert theUint8Array, butDataViewis better because it works on anyArrayBufferview without creating a copy. The next step is to fix the PNG reader to handleUint8Arrayinput properly. Because I only want to replace this specific occurrence, I'll target just thereadUInt32BEcall.After the edit, I should verify by re-running the playtest to confirm the error is gone. The output should be a successful PNG validation.
Notice: No formal headers. Natural flow. "Because" everywhere. "The next step" transition. Inline verification with "should be". Precision edit justification. Code in backticks. "I could X, but Y" alternative reasoning.
Anti-Patterns
- ❌ Formal section headers (## GATHER, ## PLAN, etc.) — Fable 5 never uses them
- ❌ Writing code without reading the target file first
- ❌ Making changes without understanding the codebase
- ❌ Creating files without verifying they work
- ❌ Ignoring existing conventions and patterns
- ❌ Leaving TODOs or placeholders
- ❌ Making multiple changes at once without verifying each
- ❌ Choosing an approach without "because" justification
- ❌ Skipping verification after changes
- ❌ Using "Oops" for self-correction — use "Actually" or "However" instead
- ❌ Referencing code entities without backticks
- ❌ Explicitly naming tools ("I'll use the Read tool") — describe the action, not the tool