Documentation often outlasts code. Write accordingly.
NOT marketing copy. NOT AI-generated filler. A service manual for each crate that a new engineer can pick up on day one and understand:
- What this thing IS — concrete, specific, no buzzwords
- Why it exists — what problem drove someone to write it
- How to use it — working code, not hand-waving
- What can go wrong — edge cases, limitations, known issues
- How it works internally — enough to debug and extend
- How it fits the ecosystem — what depends on it, what it depends on
- ❌ "A powerful library for..." — every library claims to be powerful
- ❌ "Leverages cutting-edge..." — no it doesn't, and even if it did, say what it DOES
- ❌ Listing features without explaining when you'd use each one
- ❌ Code examples that don't compile because they reference types not shown
- ❌ "See the documentation for more details" when YOU ARE the documentation
- ❌ Copy-paste between READMEs with just the name changed
- ❌ Omitting edge cases or failure modes
- ❌ Using jargon without defining it on first use
Plain English. "ternary-kalman: Kalman filter for {-1, 0, +1} state spaces"
2-3 sentences. What problem? Why ternary? What couldn't you do before?
Define EVERY term a newcomer wouldn't know. "Balanced ternary" → explain it. "Kalman filter" → one sentence about what it predicts. "GF(3)" → "the finite field with 3 elements, where -1 + 1 = 0"
# Cargo.toml
[dependencies]
crate-name = "0.1"// 10-20 lines that actually compile and do something useful
// Include all imports, all type definitions shown
// Prefer showing ONE complete example over three partial onesTable of main types with ONE-LINE descriptions. Not marketing. What each type IS.
2-3 paragraphs. Enough to debug. Mention the algorithm by name. Explain design decisions — why THIS approach over alternatives?
What doesn't work. What's untested. What degrades at scale. Honesty builds trust. Every crate has limitations.
3+ real scenarios. Not "AI" or "ML" — specific. "Robot arm controller choosing between three motor states" "Spam filter classifying email as spam/unsure/ham" "Trading signal: buy/hold/sell"
Which other ternary crates does this relate to? Is it a dependency of others? Where does it sit in the architecture?
MIT
Before submitting a README, verify:
- Every code example compiles (mentally trace it)
- Every technical term is defined on first use
- No marketing language ("powerful", "cutting-edge", "leverages")
- At least one limitation is honestly stated
- A new engineer with NO context about our project could understand it
- The "Why This Exists" section answers a real question, not a straw man