larksuite/cli · error
verify cropped suite: %w
Error message
verify cropped suite: %w
What it means
Wraps a failure when re-listing the cropped suite's references subdirectories to verify the post-crop layout matches the target skill set.
Source
Thrown at internal/skillscheck/layout.go:121
removed = append(removed, name)
}
skillPath := filepath.Join(suitePath, "SKILL.md")
raw, err := vfs.ReadFile(skillPath)
if err != nil {
return fmt.Errorf("read suite SKILL.md: %w", err)
}
rendered, err := cropSuiteRoutes(string(raw), removed, target)
if err != nil {
return err
}
if err := vfs.WriteFile(skillPath, []byte(rendered), 0o644); err != nil {
return fmt.Errorf("write cropped suite SKILL.md: %w", err)
}
kept, err := listDirectSubdirs(referencesPath)
if err != nil {
return fmt.Errorf("verify cropped suite: %w", err)
}
return assertSameSkillNames(kept, target, "cropped suite")
}
func cropSuiteRoutes(content string, removed, target []string) (string, error) {
routeLine := func(name string) *regexp.Regexp {
return regexp.MustCompile(`(?m)^- ` + regexp.QuoteMeta(name) + `(?:([^)\n]*))?:[^\n]*(?:\n|$)`)
}
for _, name := range removed {
line := routeLine(name)
if len(line.FindAllStringIndex(content, -1)) != 1 {
return "", fmt.Errorf("suite route for %s is missing or duplicated", name)
}
content = line.ReplaceAllString(content, "")
}
for _, name := range target {View on GitHub (pinned to 7fd6ef3c07)
Solutions
- Re-stage the suite archive and retry the sync
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/skillscheck/layout.go:121 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/2fb98d2a07b0cdcd.
Report an issue: GitHub.