{"record":{"id":"55e113b04ad728b3","repo":"Tencent/WeKnora","slug":"failed-to-read-skill-file-w","errorCode":null,"errorMessage":"failed to read skill file: %w","messagePattern":"failed to read skill file: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/skills/loader.go","lineNumber":180,"sourceCode":"\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif skill.Name == skillName {\n\t\t\tskill.BasePath = skillPath\n\t\t\tskill.FilePath = skillFile\n\t\t\treturn skill, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"skill not found in %s: %s\", dir, skillName)\n}\n\n// loadSkillFile reads and parses a SKILL.md file\nfunc (l *Loader) loadSkillFile(basePath, filePath string) (*Skill, error) {\n\tcontent, err := os.ReadFile(filePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read skill file: %w\", err)\n\t}\n\n\tskill, err := ParseSkillFile(string(content))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tskill.BasePath = basePath\n\tskill.FilePath = filePath\n\n\treturn skill, nil\n}\n\n// LoadSkillFile loads an additional file from a skill directory (Level 3)\n// The filePath should be relative to the skill's base directory\nfunc (l *Loader) LoadSkillFile(skillName, relativePath string) (*SkillFile, error) {\n\t// Get the skill first\n\tskill, ok := l.discoveredSkills[skillName]","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/skills/loader.go#L162-L198","documentation":"I/O wrapper in loadSkillFile: os.ReadFile failed on the candidate SKILL.md path. Read errors on candidate files are actually skipped by the caller (continue), so when this error does propagate it means the resolved SKILL.md could not be read — usually permissions or the file disappearing between listing and read.","triggerScenarios":"Thrown at internal/agent/skills/loader.go:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore read permissions on the SKILL.md file","Re-run discovery to refresh paths if the skill directory changed","Check for race conditions where the skill directory is being modified while loading"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}