skillpolicy

package
v1.0.88 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package skillpolicy composes the CLI's effective embedded skill tree from a base skill FS and at most one plugin-supplied SkillsOverlay. It is the skill-side analogue of internal/cmdpolicy: plugins contribute a delta over a base, and one resolver produces the single tree consumed by `skills list`/`read` and framework-generated --help skill pointers.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidHostBase = errors.New("host embedded skill content is invalid")

ErrInvalidHostBase reports that the wrapper-provided base skill tree is malformed. It is distinct from a plugin's replacement Base so diagnostics can direct the integrator to the correct owner.

View Source
var ErrMultipleSkillsOverlays = errors.New("multiple plugins customized skills; only one plugin may own skill content")

ErrMultipleSkillsOverlays reports that more than one plugin tried to customize skill content. Mirrors cmdpolicy.ErrMultipleRestricts: only one owner is allowed so independent plugins cannot silently overwrite each other's skill tree.

View Source
var ErrNoBaseSkillContent = errors.New("build embeds no base skill content")

ErrNoBaseSkillContent reports that Allow or Remove was requested against an empty base tree. This most often means an external wrapper main omitted cmd.SetEmbeddedSkillContent; exposing a sentinel lets the command layer give the integrator that specific recovery action instead of blaming a skill-name typo.

View Source
var ErrUnsatisfiedSkillDependency = errors.New("composed skill tree has an unsatisfied required skill")

ErrUnsatisfiedSkillDependency reports that a skill retained by the final composed manifest declares another skill that the manifest does not retain. The resolver never widens Allow or overrides Remove to repair this: an incomplete distribution is a build-integrity error.

Functions

This section is empty.

Types

type PluginSkill

type PluginSkill struct {
	PluginName    string
	SkillsOverlay *platform.SkillsOverlay
}

PluginSkill pairs a plugin name with the SkillsOverlay it contributed, so a conflict can be attributed to specific owners. Mirrors cmdpolicy.PluginRule.

type Resolution

type Resolution struct {
	Content    fs.FS
	References *skillref.Resolver
}

Resolution is the build-local result of composing embedded skill assets. Content serves `skills list`/`read`; References projects canonical CLI-authored pointers onto that same tree.

func ResolveWithReferences

func ResolveWithReferences(base fs.FS, specs []PluginSkill) (Resolution, error)

ResolveWithReferences composes the effective skill tree and its canonical reference projection. base is the CLI's embedded skill FS (nil when the build embeds none). With no spec, content is unchanged and references resolve by identity when the target exists. With exactly one spec it applies, in fixed order, Base override -> Allow -> Remove -> Overlay, then validates and snapshots ReferenceRemaps against the composed tree. Two or more distinct owners is a configuration error.

Jump to

Keyboard shortcuts

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