Contributing to TONL
November 16, 2025 ยท View on GitHub
Thank you for your interest in contributing to TONL (Token-Optimized Notation Language)! We're excited to have you join our mission to build the best LLM-optimized data serialization format.
๐ New to TONL? Check out the README and How It Works first!
๐ Table of Contents
- Getting Started
- How to Contribute
- Development Workflow
- Testing
- Code Style
- Documentation
- Code Review Process
- Areas for Contribution
- Learning Resources
- Getting Help
- Code of Conduct
๐ Getting Started
Prerequisites
- Node.js 18.0.0 or higher
- TypeScript 5.0 or higher
- Git and a GitHub account
- Familiarity with JSON and data serialization concepts
- (Optional) Experience with LLMs and tokenization
Development Setup
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/tonl.git - Navigate to the project:
cd tonl - Install dependencies:
npm install - Build the project:
npm run build - Run tests:
npm test - Install locally for CLI testing:
npm run link
๐ How to Contribute
Reporting Issues
- Use the GitHub Issues page
- Search existing issues before creating a new one
- Use the provided issue templates
- Provide clear, reproducible bug reports
- Include environment details (OS, Node.js version, etc.)
Submitting Pull Requests
- Create a new branch:
git checkout -b feature/your-feature-name - Make your changes following the code style guidelines
- Add tests for new functionality
- Ensure all tests pass:
npm test - Update documentation if needed
- Commit your changes with clear messages
- Push to your fork:
git push origin feature/your-feature-name - Open a pull request to the main repository
Code Style Guidelines
- Use TypeScript for all new code
- Follow the existing code style and patterns
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
- Write tests for all new functionality
๐ Project Structure
tonl/
โโโ src/ # Source code
โ โโโ index.ts # Main entry point
โ โโโ encode.ts # Encoding logic
โ โโโ decode.ts # Decoding logic
โ โโโ parser.ts # Parsing utilities
โ โโโ infer.ts # Type inference
โ โโโ cli.ts # CLI implementation
โ โโโ utils/ # Utility functions
โโโ test/ # Test files
โโโ bench/ # Benchmark scripts
โโโ docs/ # Documentation
โโโ examples/ # Usage examples
๐งช Testing
Running Tests
# Run all tests
npm test
# Run tests in watch mode
npm run dev
# Run specific test file
node --test test/parser.test.ts
Writing Tests
- โ Use Node.js built-in test runner
- โ Test both happy path and error cases
- โ Include edge cases and boundary conditions
- โ Test performance-critical code paths
- โ Add golden tests for format stability
- โ Include security tests for any new features
Test Coverage
- ๐ฏ Aim for 100% test coverage on core functionality
- ๐ Focus on parser, encoder, and decoder
- ๐ฅ๏ธ Test CLI commands and options
- ๐ Include integration tests
- ๐ก๏ธ Add security tests for any user-input processing
๐ Bug Reports
When reporting bugs, please include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment information
- Sample data if applicable
Use the bug report template on GitHub Issues.
๐ก Feature Requests
For new features:
- Check the roadmap first to see if it's planned
- Open an issue with the feature request template
- Provide clear use cases and requirements
- Consider potential implementation approaches
- Discuss the feature in issues before implementation
๐ Documentation
Types of Documentation
- API Documentation: Code comments and JSDoc
- User Guides: Tutorials and how-to guides
- Examples: Practical usage examples
- Reference: Format specification and CLI reference
Updating Documentation
- Keep documentation in sync with code changes
- Use clear, concise language
- Include code examples
- Update README.md for user-facing changes
- Update CHANGELOG.md for version changes
๐๏ธ Development Workflow
Before You Start
- Check existing issues and pull requests
- Discuss large changes in an issue first
- Create a feature branch from
main - Ensure your local environment is up to date
During Development
- Write tests as you develop
- Commit frequently with clear messages
- Keep PRs focused and reasonably sized
- Update documentation as needed
Before Submitting
- Ensure all tests pass
- Run benchmarks if performance-related
- Check code style and formatting
- Update documentation
- Review your own changes
๐ค Code Review Process
Reviewers Focus On
- Correctness and functionality
- Performance implications
- Code style and readability
- Test coverage and quality
- Documentation completeness
- Breaking changes and compatibility
Author Responsibilities
- Address reviewer feedback promptly
- Explain complex design decisions
- Update tests and documentation
- Consider alternative approaches
๐ Release Process
Version Bumping
- Patch (0.0.x): Bug fixes, documentation
- Minor (0.x.0): New features, breaking changes in APIs
- Major (x.0.0): Major architectural changes
Release Checklist
- All tests passing
- Documentation updated
- CHANGELOG.md updated
- Version bumped in package.json
- Tags created and pushed
- GitHub release created
- npm package published
๐ฏ Areas for Contribution
๐ก Looking for your first contribution? Check issues labeled
good first issueorhelp wanted
๐ด Critical Priority
We need help with:
-
Type Safety Improvements ๐ก๏ธ
- Eliminating
anytypes from codebase - Adding comprehensive type guards
- Improving TypeScript strict mode compliance
- Impact: Foundation for all future development
- Skills: TypeScript, type systems
- Eliminating
-
Schema Validation System ๐ FLAGSHIP
- Designing TONL Schema Language (TSL)
- Implementing schema parser
- Building validation engine
- TypeScript type generation
- Impact: Critical for enterprise adoption
- Skills: Parser design, validation logic, code generation
-
Parser Refactoring ๐ง
- Splitting large files into modules
- Reducing cyclomatic complexity
- Improving maintainability
- Impact: Code health and extensibility
- Skills: Refactoring, architecture, testing
-
Enhanced Error Reporting ๐
- Line/column tracking
- Rich error messages with suggestions
- Error recovery strategies
- Impact: Developer experience
- Skills: Parser implementation, UX design
๐ก High Priority (v0.5.0-0.6.0 - 3-9 Months)
-
Streaming API Implementation
- Node.js streams support
- Async iterators
- Web Streams API
- Impact: Large file support
- Skills: Node.js streams, async programming
-
Python Binding ๐
- Pure Python implementation
- PyPI package
- Pandas/Jupyter integration
- Impact: ML/AI community access
- Skills: Python, packaging, data science
-
Browser Support
- Multi-format bundling (ESM, UMD, IIFE)
- CDN distribution
- Web Worker support
- Impact: Platform expansion
- Skills: Build tools, browser APIs
-
VS Code Extension
- Syntax highlighting
- IntelliSense
- Schema validation
- Impact: Developer experience
- Skills: VS Code API, Language Server Protocol
๐ข Medium Priority (v0.7.0+ - 9+ Months)
-
Binary Format Specification
- Binary encoding design
- Performance optimization
- Skills: Binary protocols, compression
-
Additional Language Bindings
- Go implementation
- Rust implementation
- Skills: Go, Rust, FFI
-
Framework Integrations
- Express/Fastify middleware
- Database adapters
- Skills: Framework knowledge, API design
๐ฌ Research & Experimental
- Advanced Algorithms
- Delta encoding
- Dictionary compression
- AI-powered adaptive encoding
- Skills: Algorithms, compression, ML
๐ Contribution Ideas by Skill Level
Beginner-Friendly
- ๐ Fix typos in documentation
- ๐งช Add test cases for edge scenarios
- ๐ Write usage examples
- ๐ Report bugs with detailed reproduction steps
- ๐ฌ Answer questions in Discussions
Intermediate
- ๐ง Fix reported bugs
- โจ Implement CLI enhancements
- ๐ Write tutorials and guides
- ๐งช Improve test coverage
- ๐จ Improve error messages
Advanced
- ๐๏ธ Design and implement schema system
- โก Performance optimizations
- ๐ฌ Parser improvements
- ๐ Language bindings
- ๐ Streaming API
๐ Learning Resources
Understanding TONL
- README.md - Project overview
- SPECIFICATION.md - Format specification
- API.md - API reference
- STRATEGIC_PLAN.md - Vision and roadmap
Technical Background
- Parsing: Crafting Interpreters
- Tokenization: OpenAI Tokenizer
- TypeScript: TypeScript Handbook
- Testing: Node.js Test Runner
Similar Projects (for inspiration)
- CSV/TSV - Tabular simplicity
- JSON - Developer ergonomics
- Protocol Buffers - Schema systems
- MessagePack - Binary efficiency
๐ Getting Help
Communication Channels
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and ideas
- Discord: Real-time chat (coming soon)
Resources
๐ Code of Conduct
Our Pledge
We are committed to providing a welcoming and inclusive environment for everyone.
Expected Behavior
- Be respectful and considerate
- Use welcoming and inclusive language
- Focus on constructive feedback
- Help others learn and grow
- Accept feedback gracefully
Unacceptable Behavior
- Harassment or discrimination
- Personal attacks or insults
- Spam or off-topic content
- Disruptive behavior
- Publishing private information
Reporting
If you experience or witness unacceptable behavior, please contact the maintainers directly.
๐ Recognition
Contributors are recognized in:
- README.md contributors section
- Release notes for significant contributions
- Special thanks in major releases
- Community highlights and showcases
๐ Questions?
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Repository: github.com/tonl-dev/tonl
Thank you for contributing to TONL! ๐