larksuite/cli · error

build embeds no base skill content

Error message

build embeds no base skill content

What it means

ErrNoBaseSkillContent reports that Allow or Remove skill operations were requested against an empty base skill tree — most often because an external wrapper main never called cmd.SetEmbeddedSkillContent. It is a public sentinel so the command layer (cmd/platform_guards.go) can attach a specific recovery hint telling the integrator to embed base content instead of blaming a skill-name typo.

Source

Thrown at internal/skillpolicy/resolver.go:39

// conflict can be attributed to specific owners. Mirrors
// cmdpolicy.PluginRule.
type PluginSkill struct {
	PluginName    string
	SkillsOverlay *platform.SkillsOverlay
}

// 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.
var ErrMultipleSkillsOverlays = errors.New("multiple plugins customized skills; only one plugin may own 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.
var ErrNoBaseSkillContent = errors.New("build embeds no base skill content")

// 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.
var ErrInvalidHostBase = errors.New("host embedded skill content is invalid")

// 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.
var ErrUnsatisfiedSkillDependency = errors.New("composed skill tree has an unsatisfied required skill")

// 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.
type Resolution struct {
	Content    fs.FS
	References *skillref.Resolver

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Call cmd.SetEmbeddedSkillContent with the embedded skill FS in your wrapper main before Execute.
  2. Ensure EmbeddedSkills.Base is non-empty if you supply content explicitly.
  3. If no skill filtering is intended, remove the Allow/Remove entries from the plugin spec.

Example fix

// before: wrapper main
func main() { cmd.Execute() }
// after
func main() {
    cmd.SetEmbeddedSkillContent(skillsFS)
    cmd.Execute()
}
Defensive patterns

Strategy: try-catch

Validate before calling

// before registering plugin Allow/Remove specs:
if embeddedSkillFS == nil {
    return errors.New("call cmd.SetEmbeddedSkillContent before Execute")
}

Type guard

if errors.Is(err, skillpolicy.ErrNoBaseSkillContent) {
    // integrator-level problem: embed content, not a skill-name typo
}

Try / catch

if err := execute(); err != nil {
    if errors.Is(err, skillpolicy.ErrNoBaseSkillContent) {
        // follow the hint: call cmd.SetEmbeddedSkillContent before Execute
    }
}

Prevention

When it happens

Trigger: A plugin spec with non-empty Allow or Remove lists is resolved while the embedded base skill tree is empty (len(lower.skills) == 0) because cmd.SetEmbeddedSkillContent was not called before Execute.

Common situations: Third-party wrapper mains that assemble the CLI without the standard embedded assets; builds where the embed directive was removed or the assets directory is empty; tests constructing the command with plugin skill filters but no base content.

Related errors


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/4083afb157ea6feb. Report an issue: GitHub.