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

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

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/YOUR_USERNAME/tonl.git
  3. Navigate to the project: cd tonl
  4. Install dependencies: npm install
  5. Build the project: npm run build
  6. Run tests: npm test
  7. 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

  1. Create a new branch: git checkout -b feature/your-feature-name
  2. Make your changes following the code style guidelines
  3. Add tests for new functionality
  4. Ensure all tests pass: npm test
  5. Update documentation if needed
  6. Commit your changes with clear messages
  7. Push to your fork: git push origin feature/your-feature-name
  8. 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 issue or help wanted

๐Ÿ”ด Critical Priority

We need help with:

  1. Type Safety Improvements ๐Ÿ›ก๏ธ

    • Eliminating any types from codebase
    • Adding comprehensive type guards
    • Improving TypeScript strict mode compliance
    • Impact: Foundation for all future development
    • Skills: TypeScript, type systems
  2. 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
  3. Parser Refactoring ๐Ÿ”ง

    • Splitting large files into modules
    • Reducing cyclomatic complexity
    • Improving maintainability
    • Impact: Code health and extensibility
    • Skills: Refactoring, architecture, testing
  4. 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)

  1. Streaming API Implementation

    • Node.js streams support
    • Async iterators
    • Web Streams API
    • Impact: Large file support
    • Skills: Node.js streams, async programming
  2. Python Binding ๐ŸŒŸ

    • Pure Python implementation
    • PyPI package
    • Pandas/Jupyter integration
    • Impact: ML/AI community access
    • Skills: Python, packaging, data science
  3. Browser Support

    • Multi-format bundling (ESM, UMD, IIFE)
    • CDN distribution
    • Web Worker support
    • Impact: Platform expansion
    • Skills: Build tools, browser APIs
  4. 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)

  1. Binary Format Specification

    • Binary encoding design
    • Performance optimization
    • Skills: Binary protocols, compression
  2. Additional Language Bindings

    • Go implementation
    • Rust implementation
    • Skills: Go, Rust, FFI
  3. Framework Integrations

    • Express/Fastify middleware
    • Database adapters
    • Skills: Framework knowledge, API design

๐Ÿ”ฌ Research & Experimental

  1. 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

Technical Background

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?

Thank you for contributing to TONL! ๐Ÿš€