Code Example Synchronization
Use this skill when docs contain code snippets that are likely to drift from the real implementation.
Activation Conditions
- Function signatures changed
- Imports or package names changed
- Request or response contracts changed
- Framework guidance or recommended patterns changed
- A doc snippet compiles conceptually but no longer matches the codebase
Workflow
- Find the canonical implementation first.
- Update every affected snippet in docs, examples, and READMEs.
- Verify syntax, imports, and expected outputs.
- Note any intentional divergence, such as simplified tutorial snippets.
Quality Checklist
- Snippet matches current API shape
- Imports and package names are current
- Async, error handling, and setup steps still make sense
- Output examples match current behavior
- Duplicate snippets across docs were updated together
References & Resources
Documentation
- Code Example Verification - Checks for examples, imports, outputs, and compatibility
Scripts
- Example Sync Check - Audit Markdown files for untyped fences, placeholder text, and obviously stale examples
Related Skills
| Skill | Relationship |
|---|---|
| documentation-verification | Validate code examples before merging docs |
| documentation-authoring | Keep authored docs in sync with code changes |
| breaking-changes-management | Update examples after breaking API changes |