Writing SDK Docs and Samples
Quick start
Collect or infer:
- •SDK name and target language/platform
- •Authentication method and credentials pattern
- •Core operations to document (CRUD, streaming, batch)
- •Error handling expectations
- •Target developer persona (beginner, experienced, enterprise)
Then produce output using TEMPLATES.md. Validate with RUBRIC.md.
Workflow
- •Identify SDK scope: single service vs. multi-service, sync vs. async, platform constraints.
- •Map core operations to documentation sections: install, configure, authenticate, execute, handle errors.
- •Write installation section with package manager commands and version constraints.
- •Document authentication with code samples showing credential instantiation.
- •Create operation samples showing happy path, then error handling, then advanced usage.
- •Add inline comments explaining non-obvious parameters and return values.
- •Write troubleshooting section for common SDK errors.
- •Run the rubric check. Revise until it passes.
Degrees of freedom
Medium freedom
- •Default: follow templates for structure and section ordering
- •Allowed variation: sample complexity and language idioms may adapt to target audience; additional sections permitted if SDK has unusual patterns (e.g., streaming, pagination, retries)
State awareness
Consider SDK documentation across states:
- •Not installed: Installation instructions, prerequisites
- •Installed but not configured: Configuration and authentication
- •Configured but first use: Quickstart samples
- •Active use: Advanced patterns, batch operations
- •Upgrade path: Migration guides, breaking changes
References
- •Templates: TEMPLATES.md
- •Rubric: RUBRIC.md
- •Examples: EXAMPLES.md
- •SDK structure patterns: reference/sdk-doc-structure.md
- •Sample code conventions: reference/code-sample-conventions.md