quality

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJudgePrompt

func BuildJudgePrompt(skillContent string, rubric []Dimension) string

BuildJudgePrompt constructs the system prompt for the LLM judge.

func FormatJSON

func FormatJSON(resp *JudgeResponse) (string, error)

FormatJSON renders the judge response as indented JSON.

func FormatTable

func FormatTable(resp *JudgeResponse) string

FormatTable renders the judge response as a CLI-friendly table.

func ValidateDimensionResult

func ValidateDimensionResult(result DimensionResult, rubric []Dimension) bool

ValidateDimensionResult checks that a DimensionResult matches the rubric.

func ValidateJudgeResponse

func ValidateJudgeResponse(resp *JudgeResponse, rubric []Dimension) []string

ValidateJudgeResponse checks that the response has all expected dimensions with valid scores.

Types

type Dimension

type Dimension struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	MinScore    int    `json:"min_score"`
	MaxScore    int    `json:"max_score"`
}

Dimension represents a single quality dimension in the rubric.

func DefaultRubric

func DefaultRubric() []Dimension

DefaultRubric returns the built-in quality dimensions.

type DimensionResult

type DimensionResult struct {
	Name     string `json:"name"`
	Score    int    `json:"score"`
	Feedback string `json:"feedback"`
}

DimensionResult holds a judge's score and feedback for one dimension.

type JudgeOptions

type JudgeOptions struct {
	SkillPath  string
	TimeoutSec int
	Rubric     []Dimension // nil means use DefaultRubric()
}

JudgeOptions configures the quality judge.

type JudgeResponse

type JudgeResponse struct {
	Dimensions   []DimensionResult `json:"dimensions"`
	OverallScore float64           `json:"overall_score"`
	Summary      string            `json:"summary"`
}

JudgeResponse is the structured response expected from the LLM judge.

func Judge

Judge runs an LLM-based quality assessment against a SKILL.md file.

func ParseJudgeResponse

func ParseJudgeResponse(raw string) (*JudgeResponse, error)

ParseJudgeResponse extracts a JudgeResponse from LLM output.

Jump to

Keyboard shortcuts

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