siyuan-note/siyuan · error
skill resource exceeds the
Error message
skill resource exceeds the %d byte limit: %s/%s
What it means
readSkillResource enforces a maximum resource size (maxSkillResourceBytes). If the stat size of the resolved resource exceeds the limit, it refuses to read the file and reports the limit plus the skill and resource names.
Solutions
- Shrink the resource file (split it into multiple smaller resource files under the size limit)
- Move the large data out of the skill directory and reference only summaries or extracts
- Compress or truncate the content and keep only what the skill needs at load time
Example fix
// before skills/my-skill/reference/full-dump.md // 50 MB, exceeds limit // after skills/my-skill/reference/index.md // small curated summary skills/my-skill/reference/part-1.md // split chunks below the limit
Defensive patterns
Strategy: validation
Validate before calling
fi, err := os.Stat(p)
if err == nil && fi.Size() > maxResourceLimit { /* too large — split or summarize first */ } Prevention
- Check file size before adding it as a skill resource
- Keep reference documents small and split large content into chunks
- Move bulk data out of skill directories
When it happens
Trigger: LoadSkill is called for a resource whose on-disk size is larger than maxSkillResourceBytes (checked via os.Stat before opening).
Common situations: Dropping a large dump/log/dataset file into a skill directory and referencing it as a resource; a skill whose reference document grew past the size cap over successive edits.
Understand the failure class
Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.
Related errors
- Agent capability name and description are required
- BASE64_IMAGE_SIZE_LIMIT
- batch
- checksum manifest is too large
- custom emoji file is too large
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/48ac827d09d1ebe7.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/util/skill.go:375
if err != nil {
return "", fmt.Errorf("skill not found: %s", skillName)
}
target := filepath.Join(realRoot, filepath.FromSlash(resource))
realTarget, err := filepath.EvalSymlinks(target)
if err != nil {
return "", fmt.Errorf("skill resource not found: %s/%s", skillName, resource)
}
if realTarget != realRoot && !gulu.File.IsSubPath(realRoot, realTarget) {
return "", fmt.Errorf("skill resource escapes skill directory: %s", resource)
}
info, err := os.Stat(realTarget)
if err != nil || !info.Mode().IsRegular() {
return "", fmt.Errorf("skill resource is not a regular file: %s/%s", skillName, resource)
}
if info.Size() > maxSkillResourceBytes {
return "", fmt.Errorf("skill resource exceeds the %d byte limit: %s/%s", maxSkillResourceBytes, skillName, resource)
}
file, err := os.Open(realTarget)
if err != nil {
return "", fmt.Errorf("skill resource not found: %s/%s", skillName, resource)
}
defer file.Close()
data, err := io.ReadAll(io.LimitReader(file, maxSkillResourceBytes+1))
if err != nil {
return "", fmt.Errorf("skill resource read failed: %s/%s", skillName, resource)
}
if len(data) > maxSkillResourceBytes {
return "", fmt.Errorf("skill resource exceeds the %d byte limit: %s/%s", maxSkillResourceBytes, skillName, resource)
}
if !utf8.Valid(data) {
return "", fmt.Errorf("skill resource is not valid UTF-8: %s/%s", skillName, resource)
}
return string(data), nilView on GitHub (pinned to 9f775e8a12)