larksuite/cli · error

cropped suite route for %s is missing or duplicated

Error message

cropped suite route for %s is missing or duplicated

What it means

Invariant check in cropSuiteRoutes: after removing a skill from the suite, its route line in SKILL.md must exist exactly once; zero or multiple matches mean the staged SKILL.md deviates from the expected format.

Source

Thrown at internal/skillscheck/layout.go:141

	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 {
		if len(routeLine(name).FindAllStringIndex(content, -1)) != 1 {
			return "", fmt.Errorf("cropped suite route for %s is missing or duplicated", name)
		}
	}

	keywords := suiteKeywords(content)
	start := strings.Index(content, suiteDescriptionPrefix)
	if start < 0 {
		return "", fmt.Errorf("suite description prefix is missing")
	}
	valueStart := start + len(suiteDescriptionPrefix)
	valueEndOffset := strings.Index(content[valueStart:], suiteDescriptionSuffix)
	if valueEndOffset < 0 {
		return "", fmt.Errorf("suite description keyword suffix is missing")
	}
	valueEnd := valueStart + valueEndOffset
	content = content[:valueStart] + strings.Join(keywords, "、") + content[valueEnd:]
	return content, nil
}

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Align the SKILL.md route list with the reference directories (one bullet per skill)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/skillscheck/layout.go:141 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/3ea856a156b0a4f6. Report an issue: GitHub.