toolhive-core

June 18, 2026 · View on GitHub

Release Build Status Coverage Status License: Apache 2.0 Star on GitHub

The ToolHive Platform common libraries and specifications.

toolhive-core provides stable, well-tested Go utilities with explicit API guarantees for the ToolHive ecosystem. Projects like toolhive, dockyard, toolhive-registry, and toolhive-registry-server depend on this library for shared functionality.

Why toolhive-core?

The ToolHive ecosystem spans multiple Go repositories, and several of these projects need to share common utilities. Rather than having projects import internal packages from toolhive (which have no stability guarantees), toolhive-core provides:

  • Stability guarantees: Packages follow semantic versioning with explicit API commitments
  • Clear maturity levels: Each package is marked as Stable, Beta, or Alpha
  • Tested and documented: All packages meet minimum quality standards before inclusion
  • Independent versioning: Evolves on its own release cadence, decoupled from toolhive releases

Available Packages

PackageStabilityDescription
celAlphaGeneric CEL expression compilation and evaluation
envStableEnvironment variable abstraction with Reader interface
httperrStableWrap errors with HTTP status codes
loggingAlphaPre-configured *slog.Logger factory with consistent ToolHive defaults
oci/skillsAlphaOCI artifact types, media types, and registry operations for skills
oci/pluginsAlphaOCI artifact types, media types, and registry operations for plugins
postgresAlphaPostgreSQL connection pool with optional AWS RDS IAM dynamic auth
recoveryBetaHTTP panic recovery middleware
validation/httpStableRFC 7230/8707 compliant HTTP header and URI validation
validation/groupStableGroup name validation

Package Stability Levels

Each package is marked with a stability level:

LevelMeaningAPI Guarantees
StableProduction-ready, fully supportedNo breaking changes without major version bump
BetaFeature-complete, may have minor changesBreaking changes possible with deprecation notice
AlphaExperimental, subject to significant changesNo stability guarantees

Graduation Criteria

Packages in toolhive-core must meet formal criteria before inclusion. This ensures that shared packages are genuinely reusable, well-tested, and not tied to the internal workings of any specific project.

Guiding Principle

Packages must provide genuinely reusable value and be designed as reusable from the start. A package that requires knowledge of toolhive internals to use correctly is not a good candidate for graduation.

Fast Track (Simple Packages)

For small, focused packages with minimal dependencies (e.g., env, errors, validation):

CriterionRequirement
Production usageDeployed in production for ≥1 month
No internal dependenciesCannot depend on non-graduated internal packages
No global stateNo singletons, global variables for state, or init() side effects
Test coverage≥70% line coverage
DocumentationPackage-level godoc
ApprovalGitHub issue approved by one maintainer

Standard Track (Complex Packages)

For packages with external dependencies, multiple types, or broader API surface:

CriterionRequirement
Production usageDeployed in production for ≥2 months without breaking changes
API stabilityNo breaking changes in the last 2 minor releases
Interface designUses Go interfaces for dependency injection and testability
Error handlingReturns typed errors; no panics except for programming bugs
No global stateNo singletons, global variables for state, or init() side effects
Test coverage≥70% line coverage with meaningful assertions
DocumentationPackage-level godoc with usage examples
LintingPasses golangci-lint with project configuration
Minimal dependenciesOnly essential external dependencies
No circular importsMust not create import cycles when extracted
No internal dependenciesCannot depend on non-graduated internal packages
Stable external depsExternal dependencies must be v1.0+ or widely adopted
SponsorshipAt least one maintainer sponsors the graduation
ApprovalRFC or detailed GitHub issue reviewed and approved

Graduation Process

  1. Proposal: Open a GitHub issue identifying the graduation candidate and proposed track (fast/standard)
  2. Track determination: Maintainers confirm which track applies based on package complexity
  3. Evaluation: Assess against the relevant track's criteria
  4. Approval: Fast track requires one maintainer approval; standard track requires RFC or detailed issue review
  5. Extraction: Move package to toolhive-core with necessary adaptations
  6. Release: Tag a new semver release of toolhive-core
  7. Migration: Update consuming projects to import from toolhive-core

Versioning

toolhive-core follows Semantic Versioning 2.0.0:

  • Major (vX.0.0): Breaking API changes
  • Minor (v0.X.0): New features, backward-compatible
  • Patch (v0.0.X): Bug fixes, backward-compatible

License

Apache-2.0 - See LICENSE for details.