|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +This file provides guidance to AI coding agents working with the helm.sh website repository. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +This is the official Helm project website (helm.sh) - a Docusaurus static site serving Helm documentation, blog, and community resources. The site supports multiple languages and versions, and is automatically deployed to Netlify. |
| 8 | + |
| 9 | +### Technology Stack |
| 10 | +- Docusaurus (static site generator) |
| 11 | +- React (component framework) |
| 12 | +- Node.js/Yarn (package management) |
| 13 | +- Netlify (hosting and deployment) |
| 14 | + |
| 15 | +## Quick Start |
| 16 | + |
| 17 | +```bash |
| 18 | +# Install dependencies |
| 19 | +yarn install |
| 20 | + |
| 21 | +# Start development server |
| 22 | +yarn start |
| 23 | + |
| 24 | +# Build for production |
| 25 | +yarn build |
| 26 | + |
| 27 | +# Serve production build locally |
| 28 | +yarn serve |
| 29 | +``` |
| 30 | + |
| 31 | +## Repository Structure |
| 32 | + |
| 33 | +### Content Organization |
| 34 | +- `docs/` - Current version documentation (unversioned) |
| 35 | +- `versioned_docs/version-N/` - Versioned documentation snapshots |
| 36 | +- `blog/` - Blog posts and announcements |
| 37 | +- `i18n/{lang}/` - Internationalized content for supported languages |
| 38 | +- `src/` - React components and custom pages |
| 39 | +- `static/` - Static assets (images, files) |
| 40 | + |
| 41 | +### Configuration |
| 42 | +- `docusaurus.config.js` - Main Docusaurus configuration |
| 43 | +- `sidebars.js` - Documentation sidebar structure |
| 44 | +- `versions.json` - Available documentation versions |
| 45 | +- `netlify.toml` - Netlify deployment configuration |
| 46 | + |
| 47 | +### Languages |
| 48 | +Supported: English (en), German (de), Spanish (es), French (fr), Japanese (ja), Korean (ko), Portuguese (pt), Russian (ru), Ukrainian (uk), Chinese (zh) |
| 49 | + |
| 50 | +## Build and Test Commands |
| 51 | + |
| 52 | +### Development |
| 53 | +```bash |
| 54 | +# Start dev server (usually port 3000) |
| 55 | +yarn start |
| 56 | + |
| 57 | +# Start with specific locale |
| 58 | +yarn start --locale ko |
| 59 | + |
| 60 | +# Clear cache if needed |
| 61 | +yarn clear |
| 62 | +``` |
| 63 | + |
| 64 | +### Production Build |
| 65 | +```bash |
| 66 | +# Build all locales |
| 67 | +yarn build |
| 68 | + |
| 69 | +# Build specific locale |
| 70 | +yarn build --locale en |
| 71 | + |
| 72 | +# Build without minification (faster for testing) |
| 73 | +yarn build --no-minify |
| 74 | +``` |
| 75 | + |
| 76 | +### Quality Checks |
| 77 | +```bash |
| 78 | +# Type checking (if TypeScript is added) |
| 79 | +yarn typecheck |
| 80 | + |
| 81 | +# Link checking |
| 82 | +make check-links-ci |
| 83 | + |
| 84 | +# Spell checking |
| 85 | +typos |
| 86 | +``` |
| 87 | + |
| 88 | +## Architectural Documentation |
| 89 | + |
| 90 | +This codebase includes an `ARCHITECTURAL_DECISIONS.md` document that explains key architectural decisions made during the Docusaurus implementation. When implementing new features or making significant changes: |
| 91 | + |
| 92 | +1. **Document architectural decisions** in `ARCHITECTURAL_DECISIONS.md` with clear reasoning |
| 93 | +2. **Include requirements** that drove the decision |
| 94 | +3. **Link to relevant Docusaurus documentation** when applicable |
| 95 | +4. **Keep explanations concise** but comprehensive enough for future contributors |
| 96 | + |
| 97 | +This helps maintain consistency and guides future development decisions. |
| 98 | + |
| 99 | +### Writing Guidelines for ARCHITECTURAL_DECISIONS.md |
| 100 | + |
| 101 | +When updating architectural decisions: |
| 102 | +- **Describe current state** - Document what exists now, not proposals or ideas |
| 103 | +- **Keep it concise** - One paragraph per topic, link to external docs instead of repeating them |
| 104 | +- **Focus on the "why"** - Explain decisions that aren't obvious from the code |
| 105 | +- **Help contributors** - Write for developers who need to understand the codebase quickly |
| 106 | +- **Avoid duplication** - Link to Docusaurus docs rather than explaining Docusaurus features |
| 107 | + |
| 108 | +Example: Don't explain what CSS modules are, but DO explain why we chose them over other styling approaches for this specific project. |
| 109 | + |
| 110 | +## Content Management |
| 111 | + |
| 112 | +### Documentation |
| 113 | + |
| 114 | +#### Adding/Editing Docs |
| 115 | +1. Edit files in `docs/` for current version |
| 116 | +2. For versioned docs, edit in `versioned_docs/version-N/` |
| 117 | +3. Frontmatter format: |
| 118 | +```yaml |
| 119 | +--- |
| 120 | +title: "Page Title" |
| 121 | +sidebar_label: "Short Label" |
| 122 | +sidebar_position: 1 |
| 123 | +--- |
| 124 | +``` |
| 125 | + |
| 126 | +#### Creating New Versions |
| 127 | +```bash |
| 128 | +# Create new version snapshot |
| 129 | +yarn docusaurus docs:version 3.18.0 |
| 130 | +``` |
| 131 | +This creates: |
| 132 | +- `versioned_docs/version-3.18.0/` - Snapshot of current docs |
| 133 | +- `versioned_sidebars/version-3.18.0-sidebars.json` - Sidebar config |
| 134 | +- Updates `versions.json` |
| 135 | + |
| 136 | +#### CLI Reference Documentation |
| 137 | +Located in `docs/helm/` (and versioned equivalents). To update: |
| 138 | +1. Uninstall all helm plugins: `helm plugin uninstall` |
| 139 | +2. Navigate to appropriate docs directory |
| 140 | +3. Run: `HOME='~' helm docs --type markdown --generate-headers` |
| 141 | +4. Commit changes |
| 142 | + |
| 143 | +### Blog Posts |
| 144 | + |
| 145 | +Create in `blog/` directory with naming: `YYYY-MM-DD-slug/index.md` |
| 146 | + |
| 147 | +Frontmatter format: |
| 148 | +```yaml |
| 149 | +--- |
| 150 | +title: "Post Title" |
| 151 | +authors: |
| 152 | + - name: Author Name |
| 153 | + url: https://author.link |
| 154 | +tags: [tag1, tag2] |
| 155 | +--- |
| 156 | + |
| 157 | +Post summary appears here. |
| 158 | + |
| 159 | +<!--truncate--> |
| 160 | + |
| 161 | +Full post content here. |
| 162 | +``` |
| 163 | + |
| 164 | +Images go in the same directory as the blog post or in `blog/assets/`. |
| 165 | + |
| 166 | +### Internationalization |
| 167 | + |
| 168 | +#### Adding Translations |
| 169 | +1. Extract strings: `yarn write-translations --locale ko` |
| 170 | +2. Translate files in `i18n/{locale}/` |
| 171 | +3. Content structure: |
| 172 | + - `i18n/{locale}/docusaurus-plugin-content-docs/` - Docs translations |
| 173 | + - `i18n/{locale}/docusaurus-plugin-content-blog/` - Blog translations |
| 174 | + - `i18n/{locale}/code.json` - UI strings |
| 175 | + |
| 176 | +#### Translation Guidelines |
| 177 | +- Maintain consistent terminology across versions |
| 178 | +- Test with `yarn start --locale {locale}` |
| 179 | +- Ensure all navigation and UI elements are translated |
| 180 | + |
| 181 | +## Code Style and Conventions |
| 182 | + |
| 183 | +### Markdown |
| 184 | +- Use semantic line breaks (one sentence per line preferred for diffs) |
| 185 | +- Code blocks should specify language: ```yaml, ```bash, ```go |
| 186 | +- Use relative links for internal pages: `[text](../path/to/page.md)` |
| 187 | +- Images: `` or from static: `` |
| 188 | + |
| 189 | +### Frontmatter Standards |
| 190 | +- Required: `title` |
| 191 | +- Recommended: `sidebar_label`, `sidebar_position`, `description` |
| 192 | +- Blog posts: Use `authors` array, not `author` string |
| 193 | + |
| 194 | +### Component Usage |
| 195 | +- Use Docusaurus components when available: `<Tabs>`, `<TabItem>`, `<Admonition>` |
| 196 | +- Custom components in `src/components/` |
| 197 | +- Import at top of MDX files: `import ComponentName from '@site/src/components/ComponentName'` |
| 198 | + |
| 199 | +### File Naming |
| 200 | +- Docs: Use descriptive names, lowercase with hyphens: `getting-started.md` |
| 201 | +- Blog: Date prefix required: `YYYY-MM-DD-title/index.md` |
| 202 | +- Assets: Descriptive names, avoid spaces |
| 203 | + |
| 204 | +## Deployment |
| 205 | + |
| 206 | +### Netlify Configuration |
| 207 | +- **Build command**: `yarn install && make build` |
| 208 | +- **Publish directory**: `build` |
| 209 | +- **Node version**: Specified in `netlify.toml` |
| 210 | +- **Auto-deploys**: From `main` branch |
| 211 | +- **Preview deploys**: Automatic for PRs |
| 212 | + |
| 213 | +### Build Process |
| 214 | +1. Netlify clones repository |
| 215 | +2. Installs dependencies with yarn |
| 216 | +3. Runs `make build` which executes `yarn build` |
| 217 | +4. Deploys `build/` directory contents |
| 218 | +5. Runs post-build plugins (link checking, etc.) |
| 219 | + |
| 220 | +### Environment Considerations |
| 221 | +- Build timeout: 15 minutes |
| 222 | +- Memory: Standard Netlify build environment |
| 223 | +- Cache: `node_modules/` and `.docusaurus/` cached between builds |
| 224 | + |
| 225 | +## Contributing Guidelines |
| 226 | + |
| 227 | +### Requirements |
| 228 | +- **Signed commits**: All commits must include DCO sign-off (`git commit -s`) |
| 229 | +- **PR approval**: Requires maintainer review |
| 230 | +- **Testing**: Build locally before submitting PR |
| 231 | + |
| 232 | +### Workflow |
| 233 | +1. Fork repository and create feature branch from `main` |
| 234 | +2. Make changes following existing patterns |
| 235 | +3. Test locally: `yarn build && yarn serve` |
| 236 | +4. Commit with sign-off: `git commit -s -m "description"` |
| 237 | +5. Submit PR with clear description |
| 238 | +6. Address review feedback |
| 239 | + |
| 240 | +### Commit Messages |
| 241 | +- Use conventional commits format when possible |
| 242 | +- Be descriptive but concise |
| 243 | +- Reference issues: `fixes #123` or `relates to #456` |
| 244 | +- Sign all commits with `-s` flag |
| 245 | + |
| 246 | +### Content Approval Process |
| 247 | +- **Documentation**: Any maintainer can approve |
| 248 | +- **Blog posts**: Require core maintainer approval |
| 249 | +- **Configuration changes**: Require thorough review and testing |
| 250 | + |
| 251 | +## Common Tasks |
| 252 | + |
| 253 | +### Updating Helm Version References |
| 254 | +1. Update `docusaurus.config.js` - Search for version strings |
| 255 | +2. Update relevant documentation pages |
| 256 | +3. Consider creating new version snapshot if major release |
| 257 | +4. Update `versions.json` if needed |
| 258 | + |
| 259 | +### Adding New Documentation Section |
| 260 | +1. Create directory in `docs/` |
| 261 | +2. Add index page: `docs/new-section/index.md` |
| 262 | +3. Update `sidebars.js` to include new section |
| 263 | +4. Add translations to `i18n/{locale}/` directories |
| 264 | + |
| 265 | +### Fixing Broken Links |
| 266 | +1. Run link checker: `make check-links-ci` |
| 267 | +2. Review output for broken links |
| 268 | +3. Fix links in source files |
| 269 | +4. Verify in both current and versioned docs if applicable |
| 270 | + |
| 271 | +### Migration from Hugo |
| 272 | +If encountering Hugo-specific syntax or structure: |
| 273 | +- Hugo shortcodes -> Docusaurus components or MDX |
| 274 | +- Hugo frontmatter -> Docusaurus frontmatter (mostly compatible) |
| 275 | +- Hugo content organization -> Docusaurus docs structure |
| 276 | +- See `HELM2-TO-DOCUSAURUS.md` and `HELM3-TO-DOCUSAURUS.md` for migration details |
| 277 | + |
| 278 | +## Security Considerations |
| 279 | + |
| 280 | +### Content Security |
| 281 | +- Never commit secrets or credentials |
| 282 | +- Be cautious with external links and embeds |
| 283 | +- Validate all user-contributed content |
| 284 | +- Use HTTPS for all external resources |
| 285 | + |
| 286 | +### Build Security |
| 287 | +- Dependencies audited via Dependabot |
| 288 | +- Use exact versions in `package.json` where security-critical |
| 289 | +- Review dependency updates before merging |
| 290 | + |
| 291 | +### Deployment Security |
| 292 | +- Netlify handles HTTPS/SSL certificates |
| 293 | +- No server-side code execution (static site) |
| 294 | +- Environment variables kept in Netlify dashboard, not in repo |
| 295 | + |
| 296 | +## Troubleshooting |
| 297 | + |
| 298 | +### Common Issues |
| 299 | + |
| 300 | +**Build fails with "Cannot find module"** |
| 301 | +- Solution: `rm -rf node_modules .docusaurus && yarn install` |
| 302 | + |
| 303 | +**Changes not reflecting in dev server** |
| 304 | +- Solution: `yarn clear && yarn start` |
| 305 | + |
| 306 | +**Version mismatch errors** |
| 307 | +- Solution: Ensure Node.js version matches `.nvmrc` or `netlify.toml` |
| 308 | + |
| 309 | +**Broken links after content move** |
| 310 | +- Solution: Search for old path, update all references, run link checker |
| 311 | + |
| 312 | +**Translation missing strings** |
| 313 | +- Solution: `yarn write-translations --locale {locale}` to regenerate |
| 314 | + |
| 315 | +### Getting Help |
| 316 | +- GitHub Issues: https://github.com/helm/helm-www |
| 317 | +- Kubernetes Slack: #helm-users and #helm-dev channels |
| 318 | +- Documentation: https://docusaurus.io/docs |
| 319 | + |
| 320 | +## Special Notes for AI Agents |
| 321 | + |
| 322 | +### When Making Changes |
| 323 | +1. Always build and test locally before considering work complete |
| 324 | +2. Check both English and at least one translated version if touching i18n |
| 325 | +3. Verify changes in both current docs and latest versioned docs if applicable |
| 326 | +4. Run link checker before finalizing PR |
| 327 | +5. Ensure all commits are properly formatted and signed |
| 328 | + |
| 329 | +### File Generation |
| 330 | +- CLI reference docs are auto-generated - note this in commits |
| 331 | +- Don't manually edit generated files without noting the generation source |
| 332 | +- If regenerating docs, ensure clean helm environment (no plugins) |
| 333 | + |
| 334 | +### Be Aware Of |
| 335 | +- This is a versioned documentation site - changes may need to apply to multiple versions |
| 336 | +- Blog posts are part of permanent site history - be extra careful with edits |
| 337 | +- Some content may be in multiple languages - coordinate changes across translations when needed |
| 338 | +- External links should be checked periodically as they can break over time |
0 commit comments