Prompt
Ensure all code examples and documentation are as clear and complete as possible for developers. This includes adding clarifying inline comments to explain non-obvious behavior, including all necessary import statements, and structuring information for maximum readability.
Key practices:
- Add inline comments to clarify behavior, especially for files or configurations that might be confusing (e.g.,
// ๐๐ผ ignoredfor excluded files) - Include complete import statements in code examples rather than assuming developers know what to import
- Break complex statements into separate, digestible points
- Use proper grammar and standard abbreviations (e.g., โi.e.โ not โieโ)
Example of good clarity:
// Include all imports
import { Link, createLink } from '@tanstack/react-router'
import { Button } from '@mui/material'
// Clear file structure with explanatory comments
routes/
โโโ posts.tsx
โโโ -posts-table.tsx // ๐๐ผ ignored from route generation
โโโ -components/
โ โโโ header.tsx // ๐๐ผ ignored from route generation
โ โโโ footer.tsx // ๐๐ผ ignored from route generation
This approach reduces confusion, speeds up developer onboarding, and prevents common implementation mistakes by making examples self-contained and immediately understandable.