Tencent/WeKnora · error

failed to read skill file: %w

Error message

failed to read skill file: %w

What it means

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.

Source

Thrown at internal/agent/skills/loader.go:180

		if err != nil {
			continue
		}

		if skill.Name == skillName {
			skill.BasePath = skillPath
			skill.FilePath = skillFile
			return skill, nil
		}
	}

	return nil, fmt.Errorf("skill not found in %s: %s", dir, skillName)
}

// loadSkillFile reads and parses a SKILL.md file
func (l *Loader) loadSkillFile(basePath, filePath string) (*Skill, error) {
	content, err := os.ReadFile(filePath)
	if err != nil {
		return nil, fmt.Errorf("failed to read skill file: %w", err)
	}

	skill, err := ParseSkillFile(string(content))
	if err != nil {
		return nil, err
	}

	skill.BasePath = basePath
	skill.FilePath = filePath

	return skill, nil
}

// LoadSkillFile loads an additional file from a skill directory (Level 3)
// The filePath should be relative to the skill's base directory
func (l *Loader) LoadSkillFile(skillName, relativePath string) (*SkillFile, error) {
	// Get the skill first
	skill, ok := l.discoveredSkills[skillName]

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Restore read permissions on the SKILL.md file
  2. Re-run discovery to refresh paths if the skill directory changed
  3. Check for race conditions where the skill directory is being modified while loading
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/agent/skills/loader.go:180 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/55e113b04ad728b3. Report an issue: GitHub.