Skip to content

feat: add anti-pattern sections to for-llms.md#307

Merged
magnus-madsen merged 2 commits intomasterfrom
for-llms/anti-patterns
Mar 15, 2026
Merged

feat: add anti-pattern sections to for-llms.md#307
magnus-madsen merged 2 commits intomasterfrom
for-llms/anti-patterns

Conversation

@magnus-madsen
Copy link
Member

@magnus-madsen magnus-madsen commented Mar 15, 2026

Summary

  • Add "Don't Nest run Blocks" section: warns against nesting run { run { ... } with handler A } with handler B and shows the correct single run with chained handlers
  • Add "Don't Write CPS" section: warns against simulating effects with CPS-style nested callbacks and shows the idiomatic run/with handler approach using a real Sleep.withJitter/Sleep.withLogging example

Test plan

  • Review rendered markdown formatting matches surrounding sections (❌/✅ pattern, code fence language tags)
  • Verify examples are consistent with existing Ask/Say and Sleep examples in the book

🤖 Generated with Claude Code

magnus-madsen and others added 2 commits March 15, 2026 10:58
Add two new sections warning LLMs against common mistakes:
- "Don't Nest `run` Blocks" — use a single `run` with chained handlers
- "Don't Write CPS" — use effects and handlers instead of callbacks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the Ask/Say greeting example with the Sleep.withJitter/withLogging
example for consistency with the CPS section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@magnus-madsen magnus-madsen merged commit 6171144 into master Mar 15, 2026
1 check passed
@magnus-madsen magnus-madsen deleted the for-llms/anti-patterns branch March 15, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant