WebSocket.org is the canonical resource for WebSocket protocol implementation. This is an Astro-based static site with strict quality standards.
These commands MUST ALL pass with ZERO errors before ANY task is complete:
# Run in this EXACT order:
npm run lint:fix # 1. Auto-fix linting issues
npm run lint # 2. Verify linting passes (MUST show zero errors)
npm run format # 3. Format all code with Prettier (MUST complete without errors)
npm run lint # 4. Run lint again to ensure formatting didn't break anythingnpm run lintshows ANY errorsnpm run formatshows ANY errors- The pre-commit hook would fail
- You haven't run ALL the above commands
-
Linting Errors (MD013, MD009, MD047)
- Lines over 120 characters
- Trailing spaces
- Missing newline at end of file
-
Formatting Issues
- Prettier formatting not applied
- Inconsistent indentation
- Improper line breaks
# This sequence MUST succeed completely:
npm run lint:fix && npm run format && npm run lint
# If ANY command fails, fix the issues and run the entire sequence againWhen creating or modifying infrastructure guides:
- Run prettier on all files:
npx prettier --write "src/content/docs/guides/infrastructure/**/*.md" - Run markdownlint:
npx markdownlint src/content/docs/guides/infrastructure/**/*.md --fix - Verify navigation: Check astro.config.mjs includes new guides in sidebar
- Test in dev server: Ensure all pages load correctly and navigation works
- Check code blocks: Verify all code examples have proper language specifiers
- Issue: Alignment problems in sequence diagrams
- Solution: Count exact character positions. Vertical lines must align precisely at consistent column positions
- Testing: View raw markdown to verify alignment, not just rendered output
- Issue: Fenced code blocks need language specifiers
- Solution: Always use
```textfor ASCII art,```javascriptfor code - Issue: Bold text interpreted as headings
- Solution: Use proper heading levels (####) instead of bold for section titles
- Always verify: RFC numbers (use RFC 9220 for HTTP/3, not drafts)
- Always include: Author attribution to Matthew O'Riordan where appropriate
- Always test: Code examples with actual WebSocket connections
src/
├── content/docs/ # Main documentation (Markdown/MDX)
│ ├── guides/ # How-to guides and tutorials
│ ├── reference/ # API and protocol references
│ └── tools/ # Interactive tools documentation
├── assets/ # Images and static files
└── components/ # Astro components
- Read existing code/content first
- Make minimal, focused changes
- Run linting and formatting
- Verify changes work as intended
- Check rendered output matches expectations
- Commit with clear, concise message
- Use
wss://echo.websocket.orgfor examples (working echo server) - Reference RFC 6455 (base), RFC 8441 (HTTP/2), RFC 9220 (HTTP/3)
- Include error handling and reconnection patterns in examples
- Document browser compatibility accurately
-
IMPORTANT: Never add a top-level heading (
# Title) in content pages -
The page title is automatically generated from the frontmatter
titlefield -
Start content directly after frontmatter or with
## H2sections -
Example:
--- title: Your Page Title description: Page description --- Start content here without # heading. ## First Section Content...
- Practical, production-focused (beyond MDN's API docs)
- Include infrastructure configs (Nginx, AWS ALB, etc.)
- Provide language-specific implementations
- Focus on real-world deployment challenges
Before marking complete:
- Linting passes
- Formatting applied
- Links verified
- Code examples tested
- ASCII diagrams aligned
- SEO metadata present
- Don't assume auto-fix will handle all linting issues
- Don't trust visual rendering for ASCII alignment
- Don't use outdated draft specifications
- Don't skip the pre-commit checklist
- Don't create new files unless absolutely necessary
/src/content/docs/- All public documentation/src/content/docs/guides/- Implementation guides/src/content/docs/reference/- API and protocol references
/docs/content-style-guide.md- Writing standards and style guidelines/docs/development-setup.md- Development environment setup/docs/redirect-management.md- URL redirect configurationpackage.json- Available npm scripts
Remember: This site aims to be the #1 canonical WebSocket resource. Quality over speed.