{"record":{"id":"517944ea8764dc1b","repo":"larksuite/cli","slug":"write-cropped-suite-skill-md-w","errorCode":null,"errorMessage":"write cropped suite SKILL.md: %w","messagePattern":"write cropped suite SKILL\\.md: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/skillscheck/layout.go","lineNumber":116,"sourceCode":"\t\t\tcontinue\n\t\t}\n\t\tif err := vfs.RemoveAll(filepath.Join(referencesPath, name)); err != nil {\n\t\t\treturn fmt.Errorf(\"remove suite child %s: %w\", name, err)\n\t\t}\n\t\tremoved = append(removed, name)\n\t}\n\n\tskillPath := filepath.Join(suitePath, \"SKILL.md\")\n\traw, err := vfs.ReadFile(skillPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read suite SKILL.md: %w\", err)\n\t}\n\trendered, err := cropSuiteRoutes(string(raw), removed, target)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := vfs.WriteFile(skillPath, []byte(rendered), 0o644); err != nil {\n\t\treturn fmt.Errorf(\"write cropped suite SKILL.md: %w\", err)\n\t}\n\n\tkept, err := listDirectSubdirs(referencesPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"verify cropped suite: %w\", err)\n\t}\n\treturn assertSameSkillNames(kept, target, \"cropped suite\")\n}\n\nfunc cropSuiteRoutes(content string, removed, target []string) (string, error) {\n\trouteLine := func(name string) *regexp.Regexp {\n\t\treturn regexp.MustCompile(`(?m)^- ` + regexp.QuoteMeta(name) + `(?:（[^）\\n]*）)?:[^\\n]*(?:\\n|$)`)\n\t}\n\n\tfor _, name := range removed {\n\t\tline := routeLine(name)\n\t\tif len(line.FindAllStringIndex(content, -1)) != 1 {\n\t\t\treturn \"\", fmt.Errorf(\"suite route for %s is missing or duplicated\", name)","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/skillscheck/layout.go#L98-L134","documentation":"Wraps vfs.WriteFile failure after cropping routes from the staged suite's SKILL.md; the modified content could not be persisted back to the staging tree.","triggerScenarios":"Thrown at internal/skillscheck/layout.go:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check staging space and permissions, then retry the sync"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}