Skip to content

Latest commit

 

History

History
269 lines (207 loc) · 5.59 KB

File metadata and controls

269 lines (207 loc) · 5.59 KB

Publishing Tools to the BB Tool Library

This guide explains how to create, test, and publish tools to the BB Tool Library. It covers the entire process from development to distribution.

Table of Contents

  1. Overview
  2. Prerequisites
  3. Development Process
  4. Tool Requirements
  5. Publishing Process
  6. Maintenance
  7. Best Practices

Overview

The BB Tool Library is a central repository for sharing custom tools with the BB community. Publishing a tool involves:

  1. Developing using the @beyondbetter/tools package
  2. Testing thoroughly
  3. Documenting features and usage
  4. Submitting for review
  5. Publishing to the library

Prerequisites

Before publishing a tool, ensure you have:

  1. BB development environment set up
  2. Deno installed
  3. @beyondbetter/tools package installed
  4. Understanding of BB's tool architecture
  5. GitHub account for publishing

Development Process

1. Tool Structure

Create a new tool project:

bb tool create my-tool

This 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

2. Implementation

Follow the Creating a New Tool guide for detailed implementation instructions.

Key components:

  • Extend LLMTool base class
  • Implement required methods
  • Add proper error handling
  • Include comprehensive tests
  • Create clear documentation

3. Testing Requirements

Tools must include:

  • Unit tests (>80% coverage)
  • Integration tests
  • Browser/console formatter tests
  • Error handling tests
  • Performance benchmarks

Tool Requirements

1. Technical Requirements

  • Built with @beyondbetter/tools package
  • TypeScript/JavaScript implementation
  • Proper error handling
  • Resource cleanup
  • Performance considerations
  • Security best practices

2. Documentation Requirements

Each tool must include:

  • Clear description
  • Installation instructions
  • Usage examples
  • Parameter documentation
  • Error handling guide
  • Security considerations
  • Changelog

3. Metadata (info.json)

{
  "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"
}

Publishing Process

1. Preparation

  1. Run quality checks:

    bb tool check my-tool
  2. Update documentation:

    • Verify all sections complete
    • Include usage examples
    • Update changelog
  3. Version your tool:

    bb tool version my-tool 1.0.0

2. Submission

  1. Submit for review:

    bb tool publish my-tool --submit
  2. Review Process:

    • Security review
    • Code quality check
    • Documentation review
    • Performance testing
    • User experience evaluation
  3. Address Feedback:

    • Make requested changes
    • Update documentation
    • Re-run tests
    • Resubmit if needed

3. Publication

Once approved:

bb tool publish my-tool --release

Maintenance

Version Updates

  1. Make changes in development
  2. Update version number
  3. Update changelog
  4. Run tests
  5. Submit update:
    bb tool publish my-tool --update

Support

Provide support through:

  1. GitHub issues
  2. Documentation updates
  3. Version compatibility
  4. Security patches

Best Practices

1. Development

  • Follow BB coding conventions
  • Use TypeScript for type safety
  • Write comprehensive tests
  • Document thoroughly
  • Handle errors gracefully

2. Documentation

  • Keep README.md updated
  • Include clear examples
  • Document all parameters
  • Explain error messages
  • Provide troubleshooting guide

3. Security

  • Follow security best practices
  • Limit permissions appropriately
  • Validate all inputs
  • Handle sensitive data properly
  • Document security considerations

4. Performance

  • Optimize resource usage
  • Handle large datasets efficiently
  • Include performance tests
  • Document resource requirements
  • Consider rate limiting

5. User Experience

  • Provide clear error messages
  • Include progress indicators
  • Format output consistently
  • Support both browser and console
  • Consider accessibility

Tool Categories

When publishing, choose the appropriate category:

  1. File Operations

    • File manipulation
    • Search and replace
    • File organization
  2. Code Analysis

    • Static analysis
    • Code quality
    • Dependencies
  3. Documentation

    • Doc generation
    • Format conversion
    • Documentation analysis
  4. Project Management

    • Task tracking
    • Progress monitoring
    • Resource management
  5. Integration Tools

    • External services
    • APIs
    • Data import/export
  6. Utility Tools

    • Helper functions
    • Data processing
    • Format conversion

Support and Resources