@@ -32,15 +32,21 @@ For tone, capitalization, jargon, and prose patterns, invoke `/docs-voice`.
3232** Do:**
3333- Start with single-line description: "` useState ` is a React Hook that lets you..."
3434- Include Parameters, Returns, Caveats sections for every API
35- - Document all corner cases and edge behaviors
35+ - Document edge cases most developers will encounter
3636- Use section dividers between major sections
3737- Include "See more examples below" links
38+ - Be assertive, not hedging - "This is designed for..." not "This helps avoid issues with..."
39+ - State facts, not benefits - "The callback always accesses the latest values" not "This helps avoid stale closures"
40+ - Use minimal but meaningful names - ` onEvent ` or ` onTick ` over ` onSomething `
3841
3942** Don't:**
4043- Skip the InlineToc component
4144- Omit error cases or caveats
4245- Use conversational language
4346- Mix teaching with reference (that's Learn's job)
47+ - Document past bugs or fixed issues
48+ - Include niche edge cases (e.g., ` this ` binding, rare class patterns)
49+ - Add phrases explaining "why you'd want this" - the Usage section examples do that
4450- Exception: Pitfall and DeepDive asides can use slightly conversational phrasing
4551
4652---
@@ -644,6 +650,48 @@ For Sandpack-specific patterns and code style, invoke `/docs-sandpack`.
644650
645651---
646652
653+ ## Content Principles
654+
655+ ### Intro Section
656+ - ** One sentence, ~ 15 words max** - State what the Hook does, not how it works
657+ - ✅ "` useEffectEvent ` is a React Hook that lets you separate events from Effects."
658+ - ❌ "` useEffectEvent ` is a React Hook that lets you extract non-reactive logic from your Effects into a reusable function called an Effect Event."
659+
660+ ### Reference Code Example
661+ - Show just the API call (5-10 lines), not a full component
662+ - Move full component examples to Usage section
663+
664+ ### Usage Section Structure
665+ 1 . ** First example: Core mental model** - Show the canonical use case with simplest concrete example
666+ 2 . ** Subsequent examples: Canonical use cases** - Name the * why* (e.g., "Avoid reconnecting to external systems"), show a concrete * how*
667+ - Prefer broad canonical use cases over multiple narrow concrete examples
668+ - The section title IS the teaching - "When would I use this?" should be answered by the heading
669+
670+ ### What to Include vs. Exclude
671+ - ** Never** document past bugs or fixed issues
672+ - ** Include** edge cases most developers will encounter
673+ - ** Exclude** niche edge cases (e.g., ` this ` binding, rare class patterns)
674+
675+ ### Caveats Section
676+ - Include rules the linter enforces or that cause immediate errors
677+ - Include fundamental usage restrictions
678+ - Exclude implementation details unless they affect usage
679+ - Exclude repetition of things explained elsewhere
680+ - Keep each caveat to one sentence when possible
681+
682+ ### Troubleshooting Section
683+ - Error headings only: "I'm getting an error: '[ message] '" format
684+ - Never document past bugs - if it's fixed, it doesn't belong here
685+ - Focus on errors developers will actually encounter today
686+
687+ ### DeepDive Content
688+ - ** Goldilocks principle** - Deep enough for curious developers, short enough to not overwhelm
689+ - Answer "why is it designed this way?" - not exhaustive technical details
690+ - Readers who skip it should miss nothing essential for using the API
691+ - If the explanation is getting long, you're probably explaining too much
692+
693+ ---
694+
647695## Domain-Specific Guidance
648696
649697### Hooks
0 commit comments