|
| 1 | +# AI rules for Windmill documentation |
| 2 | + |
| 3 | +These guidelines ensure consistency and quality when writing or modifying Windmill documentation. |
| 4 | + |
| 5 | +## Content |
| 6 | + |
| 7 | +- The doc should focus on the user experience, not on the engineering behind it, unless it's important (e.g. feature related to performance) |
| 8 | +- **Before writing documentation, review @writing_style_guide.md for guidance about how to write good documentation** |
| 9 | + |
| 10 | +## File structure and naming |
| 11 | + |
| 12 | +- Use `.mdx` extension for documentation files |
| 13 | +- Main section pages should be named `index.mdx` |
| 14 | +- Folders should follow numeric prefixing for ordering (e.g., `0_scripts_quickstart`, `1_typescript_quickstart`) |
| 15 | +- Use underscores to separate words in file and folder names |
| 16 | + |
| 17 | +## Markdown formatting |
| 18 | + |
| 19 | +- Use proper heading hierarchy (# for main title, ## for sections, etc.) |
| 20 | +- Include relevant imports at the top of the file |
| 21 | +- Use code blocks with appropriate language specification (`ts, `python, etc.) |
| 22 | +- Avoid bold font, unless already used in the document |
| 23 | +- Titles, subtiles and docs in general follow sentence case ('Like this') |
| 24 | +- On docs, nothing shouldfollow title case ('Like This') |
| 25 | + |
| 26 | +## Component usage |
| 27 | + |
| 28 | +- Import and use DocCard components for navigation links |
| 29 | +- Follow the grid layout pattern for card navigation (typically 2 columns) |
| 30 | +- Use video elements with proper className for tutorials |
| 31 | +- Import and use Tabs and TabItem components for tabs (for example to show code examples in different languages) |
| 32 | + |
| 33 | +## Media and assets |
| 34 | + |
| 35 | +- Store images in the same directory as the related MDX file |
| 36 | +- Include both PNG and optimized WebP versions of images |
| 37 | +- Use meaningful names for image files that describe their content |
| 38 | +- Apply proper className to media elements for consistent styling |
| 39 | +- If a file / illustration / video would be useful but you don't have it, add a placeholder in comment to the file |
| 40 | + |
| 41 | +## Content organization |
| 42 | + |
| 43 | +- Each major feature has its own directory |
| 44 | +- Content progresses from basic to advanced concepts |
| 45 | +- Quickstart guides should be concise and focused on immediate results |
| 46 | +- Link to related documentation using relative paths |
| 47 | +- If a new page is added, make sure it appears in sidebars.js and check if its worth adding to core_concepts/index.mdx |
| 48 | +- New features shall have a dedicated changelog page and directory, like [this](./changelog/2025-08-19-kubernetes-native-autoscaling/index.md) |
| 49 | +- Changelogs should have tags (in Sentence case). In particular follow the color titles referenced in @src/theme/BlogPostItem/Container/index.js: (like 'App editor', 'Flow editor', 'Enterprise') |
| 50 | +- Major features shall be referenced in the [features list](./src/components/pricing/FeatureList.js), in particular if they are Enterprise features |
| 51 | + |
| 52 | +## Cross-referencing and backlinks |
| 53 | + |
| 54 | +- Use relative paths for internal links (e.g., `../../8_triggers/index.mdx`) when a concept is mentioned for the first time in the document and has not been backlinked yet in the document |
| 55 | +- Use absolute paths for external links (e.g., `https://www.docker.com/`) when linking to external websites and there is no dedicated page in the documentation |
| 56 | +- Using backlinks is very important to help users navigate the documentation and for SEO |
| 57 | +- Use backlinks in particular in the introduction of a document or section to reference the main related pages |
| 58 | +- When a page or section is deleted or renamed, update all backlinks to the new page or section |
| 59 | +- When a feature is Enterprise, Cloud or Pro only, mention it in the introduction of the document or section |
| 60 | +- Reference to main related pages using DocCard components |
| 61 | +- Reference to same-page sections using `#` anchors |
| 62 | +- Maintain consistent linking patterns throughout documentation |
| 63 | +- Also when adding a feature, reference its dedicated page from related pages, using backinks and relative paths |
| 64 | + |
| 65 | +## Code examples |
| 66 | + |
| 67 | +- Include complete, working code examples that can be copied directly |
| 68 | +- Add explanatory comments to complex code sections |
| 69 | +- Use consistent indentation and formatting in code blocks |
| 70 | +- Show both input and expected output where appropriate |
| 71 | + |
| 72 | +## Metadata and SEO |
| 73 | + |
| 74 | +- URLs are derived from the file or folder name (e.g. `windmilldocs/docs/core_concepts/20_jobs/index.mdx` will become `https://www.windmill.dev/docs/core_concepts/jobs`) |
| 75 | +- Use descriptive titles that include keywords |
| 76 | +- If a new page is to be created, keep URLs clean and descriptive |
0 commit comments