Documentation
¶
Overview ¶
Package orchestrate provides the core validation and analysis orchestration for skill directories. It coordinates calls to structure, content, contamination, and link checking packages, returning unified reports.
This package is intended for library consumers who want to run skill validation without the CLI layer.
Index ¶
- func AllGroups() map[CheckGroup]bool
- func RunAllChecks(ctx context.Context, dir string, opts Options) *types.Report
- func RunContaminationAnalysis(dir string) *types.Report
- func RunContentAnalysis(dir string) *types.Report
- func RunLinkChecks(ctx context.Context, dir string) *types.Report
- type CheckGroup
- type Options
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllGroups ¶
func AllGroups() map[CheckGroup]bool
AllGroups returns a map with all check groups enabled.
func RunAllChecks ¶
RunAllChecks runs all enabled check groups against a single skill directory and returns a unified report. The context is used for cancellation of network operations (e.g. link checking).
Example ¶
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"github.com/agent-ecosystem/skill-validator/orchestrate"
"github.com/agent-ecosystem/skill-validator/report"
"github.com/agent-ecosystem/skill-validator/structure"
)
func main() {
dir, _ := filepath.Abs(filepath.Join("..", "testdata", "valid-skill"))
opts := orchestrate.Options{
Enabled: orchestrate.AllGroups(),
StructOpts: structure.Options{},
}
rpt := orchestrate.RunAllChecks(context.Background(), dir, opts)
// Print human-readable output
report.Print(os.Stdout, rpt, false)
if rpt.Errors > 0 {
fmt.Fprintf(os.Stderr, "%d error(s) found\n", rpt.Errors)
}
}
Output:
Example (MultiSkill) ¶
package main
import (
"context"
"os"
"path/filepath"
"github.com/agent-ecosystem/skill-validator/orchestrate"
"github.com/agent-ecosystem/skill-validator/report"
"github.com/agent-ecosystem/skill-validator/skillcheck"
"github.com/agent-ecosystem/skill-validator/structure"
"github.com/agent-ecosystem/skill-validator/types"
)
func main() {
dir, _ := filepath.Abs(filepath.Join("..", "testdata", "multi-skill"))
mode, dirs := skillcheck.DetectSkills(dir)
if mode != types.MultiSkill {
return
}
opts := orchestrate.Options{
Enabled: orchestrate.AllGroups(),
StructOpts: structure.Options{},
}
for _, d := range dirs {
rpt := orchestrate.RunAllChecks(context.Background(), d, opts)
report.Print(os.Stdout, rpt, false)
}
}
Output:
Example (StructureOnly) ¶
package main
import (
"context"
"fmt"
"path/filepath"
"github.com/agent-ecosystem/skill-validator/orchestrate"
"github.com/agent-ecosystem/skill-validator/structure"
"github.com/agent-ecosystem/skill-validator/types"
)
func main() {
dir, _ := filepath.Abs(filepath.Join("..", "testdata", "valid-skill"))
opts := orchestrate.Options{
Enabled: map[orchestrate.CheckGroup]bool{
orchestrate.GroupStructure: true,
},
StructOpts: structure.Options{
SkipOrphans: true,
},
}
rpt := orchestrate.RunAllChecks(context.Background(), dir, opts)
for _, r := range rpt.Results {
if r.Level == types.Error {
fmt.Printf("ERROR: %s\n", r.Message)
}
}
}
Output:
func RunContaminationAnalysis ¶
RunContaminationAnalysis runs cross-language contamination analysis on a single skill directory.
func RunContentAnalysis ¶
RunContentAnalysis runs content quality analysis on a single skill directory.
Example ¶
package main
import (
"fmt"
"path/filepath"
"github.com/agent-ecosystem/skill-validator/orchestrate"
)
func main() {
dir, _ := filepath.Abs(filepath.Join("..", "testdata", "valid-skill"))
rpt := orchestrate.RunContentAnalysis(dir)
if rpt.ContentReport != nil {
fmt.Printf("Word count: %d\n", rpt.ContentReport.WordCount)
fmt.Printf("Imperative ratio: %.2f\n", rpt.ContentReport.ImperativeRatio)
}
}
Output:
Types ¶
type CheckGroup ¶
type CheckGroup string
CheckGroup identifies a category of checks that can be enabled or disabled.
const ( // GroupStructure enables directory layout, frontmatter, and token checks. GroupStructure CheckGroup = "structure" // GroupLinks enables external HTTP/HTTPS link validation. GroupLinks CheckGroup = "links" // GroupContent enables content quality analysis. GroupContent CheckGroup = "content" // GroupContamination enables cross-language contamination analysis. GroupContamination CheckGroup = "contamination" )