apistyle

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package apistyle provides an omniskill Skill for API style specification linting and evaluation.

This package exposes the core api-style-spec functionality as MCP tools:

  • lint: Lint an OpenAPI spec against style rules
  • evaluate: LLM-based semantic evaluation
  • analyze: Combined lint + evaluate with GO/NO-GO decision
  • list_rules: List all rules from a profile
  • list_profiles: List available style profiles
  • explain_rule: Get detailed explanation of a rule

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterResources added in v0.5.0

func RegisterResources(r ResourceRegistrar)

RegisterResources registers API style MCP resources on the given registrar. This enables MCP clients to access profiles, exemplars, patterns, and rubrics.

Registered resources:

  • profile://{name} - Style profile JSON
  • exemplar://{name} - Exemplar OpenAPI spec
  • pattern://{profile}/{id} - Pattern definition
  • rubric://{profile}/{mode} - Generation rubric (mode: evaluation/generation)

Types

type Option

type Option func(*Skill)

Option configures the Skill.

func WithAnthropicAPIKey

func WithAnthropicAPIKey(key string) Option

WithAnthropicAPIKey sets the Anthropic API key for LLM evaluation.

type ResourceRegistrar added in v0.5.0

type ResourceRegistrar interface {
	AddResource(res *mcp.Resource, h mcp.ResourceHandler)
	AddResourceTemplate(t *mcp.ResourceTemplate, h mcp.ResourceHandler)
}

ResourceRegistrar can register MCP resources.

type Skill

type Skill struct {
	// contains filtered or unexported fields
}

Skill provides API style specification tools.

func New

func New(opts ...Option) *Skill

New creates a new API style skill.

func (*Skill) Close

func (s *Skill) Close() error

Close releases resources (no-op for this skill).

func (*Skill) Description

func (s *Skill) Description() string

Description returns what this skill does.

func (*Skill) Init

func (s *Skill) Init(_ context.Context) error

Init initializes the skill (no-op for this skill).

func (*Skill) MarshalJSON

func (s *Skill) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Skill metadata.

func (*Skill) Name

func (s *Skill) Name() string

Name returns the skill identifier.

func (*Skill) Tools

func (s *Skill) Tools() []skill.Tool

Tools returns all tools provided by this skill.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL