Pragmatic writing

From robertguss/claude-code-toolkit · View interactive version

Pragmatic writing is an AI agent skill from the GitHub repository robertguss/claude-code-toolkit. This skill should be used when writing technical content in the style of Hunt/Thomas (The Pragmatic Programmer) and Joel Spolsky (Joel on Software). It applies when creating technical essays, documentation, tutorials, or explanatory content that needs to be clear, engaging, and actionable.

How to use this skill

Skill file

Pragmatic Writing Skill

Writing style modeled on the masters of technical communication: Andy Hunt, Dave Thomas (The Pragmatic Programmer), and Joel Spolsky (Joel on Software). This skill transforms technical content into engaging, memorable prose.

When to Use This Skill

This skill applies when:

Core Philosophy

"The difference between 'almost right' and 'right' is the difference between the lightning bug and the lightning." — Mark Twain (quoted by Pragmatic Programmers)

Technical writing doesn't have to be dry. The best technical writers make complex ideas feel obvious, use concrete examples before abstract theory, and treat the reader as a smart colleague.

The 10 Core Techniques

Reference the complete technique guide at techniques.md.

1. Concrete Before Abstract

Always start with a concrete example, then extract the principle.

❌ "Dependency injection is a design pattern where dependencies are passed
    to objects rather than created by them."

✅ "Imagine your class needs a database connection. You could create it
    yourself:

    def initialize
      @db = Database.new("localhost:5432")
    end

    But now your class is stuck with that exact database. What if you
    want to test with a fake one? What if production uses a different host?

    Instead, accept it as a parameter:

    def initialize(db)
      @db = db
    end

    That's dependency injection. Simple."

2. Physical Analogies

Map abstract concepts to physical experiences readers already understand.

See examples.md for analogy patterns:

3. Conversational Register

Write like you're explaining to a smart colleague at a whiteboard.

Markers of conversational register:

4. Humor as Architecture

Use humor strategically, not decoratively:

5. The "Aha!" Structure

Build to moments of realization:

  1. Present a familiar problem
  2. Show the common (flawed) approach
  3. Reveal why it fails
  4. Present the insight
  5. Show the better way
  6. Connect back to the principle

6. Short Paragraphs, Varied Length

Like this.

7. Code as Evidence

Code examples should:

8. The Principle Box

After a concrete exploration, box the principle:

Tip 23: Always Design for Concurrency

Allow for concurrency, and you will design cleaner interfaces with fewer assumptions.

9. Friendly Warnings

When discussing pitfalls:

See anti-patterns.md for common technical writing mistakes.

10. The Callback

End by connecting back to the opening example or question. Close the loop.

Voice Characteristics

Sentence Patterns

Vocabulary

Use: specific, concrete, everyday words

Avoid: jargon without explanation, buzzwords, corporate-speak

Tone

Applying the Skill

For Blog Posts

  1. Open with a problem or scenario
  2. Explore the messy middle
  3. Reveal the insight
  4. Show the solution
  5. Extract the principle
  6. Callback to opening

For Documentation

  1. Start with what the reader wants to do
  2. Show the simplest working example
  3. Expand with options and edge cases
  4. Explain the "why" after the "how"

For Tutorials

  1. State the goal clearly
  2. Show the end result first
  3. Build up in small, testable steps
  4. Explain mistakes, not just successes

Quality Checklist

Before publishing, verify:

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.