This guide explains how to create, test, and publish tools to the BB Tool Library. It covers the entire process from development to distribution.
- Overview
- Prerequisites
- Development Process
- Tool Requirements
- Publishing Process
- Maintenance
- Best Practices
The BB Tool Library is a central repository for sharing custom tools with the BB community. Publishing a tool involves:
- Developing using the @beyondbetter/tools package
- Testing thoroughly
- Documenting features and usage
- Submitting for review
- Publishing to the library
Before publishing a tool, ensure you have:
- BB development environment set up
- Deno installed
- @beyondbetter/tools package installed
- Understanding of BB's tool architecture
- GitHub account for publishing
Create a new tool project:
bb tool create my-toolThis creates a directory structure:
my-tool.tool/
│ tool.ts # Main implementation
│ formatter.browser.tsx # Browser formatting
│ formatter.console.ts # Console formatting
├── tests/
│ └── tool.test.ts # Test suite
├── docs/
│ └── README.md # Tool documentation
├── info.json # Tool metadata
└── deno.json # Package configuration
Follow the Creating a New Tool guide for detailed implementation instructions.
Key components:
- Extend
LLMToolbase class - Implement required methods
- Add proper error handling
- Include comprehensive tests
- Create clear documentation
Tools must include:
- Unit tests (>80% coverage)
- Integration tests
- Browser/console formatter tests
- Error handling tests
- Performance benchmarks
- Built with @beyondbetter/tools package
- TypeScript/JavaScript implementation
- Proper error handling
- Resource cleanup
- Performance considerations
- Security best practices
Each tool must include:
- Clear description
- Installation instructions
- Usage examples
- Parameter documentation
- Error handling guide
- Security considerations
- Changelog
{
"name": "my-tool",
"version": "1.0.0",
"description": "Tool description",
"author": "Your Name",
"license": "MIT",
"category": "File Operations",
"tags": ["files", "utility"],
"bb": {
"minVersion": "1.0.0",
"permissions": ["files", "network"],
"resourceIntensive": false
},
"repository": "https://github.com/username/my-tool"
}-
Run quality checks:
bb tool check my-tool
-
Update documentation:
- Verify all sections complete
- Include usage examples
- Update changelog
-
Version your tool:
bb tool version my-tool 1.0.0
-
Submit for review:
bb tool publish my-tool --submit
-
Review Process:
- Security review
- Code quality check
- Documentation review
- Performance testing
- User experience evaluation
-
Address Feedback:
- Make requested changes
- Update documentation
- Re-run tests
- Resubmit if needed
Once approved:
bb tool publish my-tool --release- Make changes in development
- Update version number
- Update changelog
- Run tests
- Submit update:
bb tool publish my-tool --update
Provide support through:
- GitHub issues
- Documentation updates
- Version compatibility
- Security patches
- Follow BB coding conventions
- Use TypeScript for type safety
- Write comprehensive tests
- Document thoroughly
- Handle errors gracefully
- Keep README.md updated
- Include clear examples
- Document all parameters
- Explain error messages
- Provide troubleshooting guide
- Follow security best practices
- Limit permissions appropriately
- Validate all inputs
- Handle sensitive data properly
- Document security considerations
- Optimize resource usage
- Handle large datasets efficiently
- Include performance tests
- Document resource requirements
- Consider rate limiting
- Provide clear error messages
- Include progress indicators
- Format output consistently
- Support both browser and console
- Consider accessibility
When publishing, choose the appropriate category:
-
File Operations
- File manipulation
- Search and replace
- File organization
-
Code Analysis
- Static analysis
- Code quality
- Dependencies
-
Documentation
- Doc generation
- Format conversion
- Documentation analysis
-
Project Management
- Task tracking
- Progress monitoring
- Resource management
-
Integration Tools
- External services
- APIs
- Data import/export
-
Utility Tools
- Helper functions
- Data processing
- Format conversion