{"record":{"id":"afebb6c8d7cee877","repo":"flipped-aurora/gin-vue-admin","slug":"error-afebb6","errorCode":null,"errorMessage":"技能目录异常","messagePattern":"技能目录异常","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/service/system/sys_skills.go","lineNumber":185,"sourceCode":"\tif strings.TrimSpace(req.Tool) == \"\" {\n\t\treturn errors.New(\"工具类型不能为空\")\n\t}\n\tif !isSafeName(req.Skill) {\n\t\treturn errors.New(\"技能名称不合法\")\n\t}\n\tskillDir, err := s.skillDir(req.Tool, req.Skill)\n\tif err != nil {\n\t\treturn err\n\t}\n\tinfo, err := os.Stat(skillDir)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn errors.New(\"技能不存在\")\n\t\t}\n\t\treturn err\n\t}\n\tif !info.IsDir() {\n\t\treturn errors.New(\"技能目录异常\")\n\t}\n\treturn os.RemoveAll(skillDir)\n}\n\nfunc (s *SkillsService) Package(_ context.Context, req request.SkillPackageRequest) (string, []byte, error) {\n\tif strings.TrimSpace(req.Tool) == \"\" {\n\t\treturn \"\", nil, errors.New(\"工具类型不能为空\")\n\t}\n\tif !isSafeName(req.Skill) {\n\t\treturn \"\", nil, errors.New(\"技能名称不合法\")\n\t}\n\n\tskillDir, err := s.skillDir(req.Tool, req.Skill)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tinfo, err := os.Stat(skillDir)\n\tif err != nil {","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/flipped-aurora/gin-vue-admin/blob/3136500ef380842b0eb6c4daa87c3f8a47fcf9e0/server/service/system/sys_skills.go#L167-L203","documentation":"SkillsService.Delete stats the resolved skill path and requires it to be a directory. If the path exists but is a regular file (or other non-directory), it refuses RemoveAll with this error to avoid deleting an unexpected file via the skills API.","triggerScenarios":"A file (not a directory) exists at the path where the skill directory is expected under the tool's skills root, and Delete is invoked for that skill name.","commonSituations":"Someone replaced the skill directory with a symlink/file; packaging or copy operations left a stray file with the skill's name; corrupted partial extraction of a skill package.","solutions":["Inspect the path under the tool's skills root and remove/replace the stray file manually.","Restore the skill as a proper directory (re-create or re-import it).","Fix whatever created the file (script, sync tool) and re-run the deletion."],"exampleFix":"// before: deleting a path that is a plain file -> 技能目录异常\n// after: verify on disk first\n// ls ~/.claude/skills/my-skill  -> must be a directory\n// if it's a file: rm the file or restore the directory, then retry Delete","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await api.deleteSkill(req)\n} catch (e) {\n  if (e.response?.data?.msg === \"技能目录异常\") {\n    notify(\"目标路径不是技能目录，请检查磁盘上的文件状态\")\n  }\n}","preventionTips":["Do not place files with skill-like names directly in the skills root.","Use the Package/Save APIs instead of manual file copies to create skills.","Audit the skills directory after manual syncs or restores."],"tags":["filesystem","unexpected-file-type","integrity-check"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"3136500ef380842b0eb6c4daa87c3f8a47fcf9e0","analyzedAt":"2026-08-31T13:50:02.721Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}