{"record":{"id":"05a89a3a5b9cdc7a","repo":"cli/cli","slug":"could-not-list-skill-files-w","errorCode":null,"errorMessage":"could not list skill files: %w","messagePattern":"could not list skill files: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/skills/installer/installer.go","lineNumber":260,"sourceCode":"\t\t\t\treturn fmt.Errorf(\"could not inject metadata: %w\", injectErr)\n\t\t\t}\n\t\t\tcontent = []byte(injected)\n\t\t}\n\n\t\treturn os.WriteFile(destPath, content, 0o644)\n\t})\n}\n\nfunc installSkill(opts *Options, skill discovery.Skill, baseDir string) error {\n\t// Use skill.Name (not InstallName) for a flat directory layout.\n\tskillDir := filepath.Join(baseDir, skill.Name)\n\tif err := os.MkdirAll(skillDir, 0o755); err != nil {\n\t\treturn fmt.Errorf(\"could not create directory %s: %w\", skillDir, err)\n\t}\n\n\tfiles, err := discovery.DiscoverSkillFiles(opts.Client, opts.Host, opts.Owner, opts.Repo, skill.TreeSHA, skill.Path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not list skill files: %w\", err)\n\t}\n\n\tsafeSkillDir, err := safepaths.ParseAbsolute(skillDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not resolve skill directory path: %w\", err)\n\t}\n\n\tfor _, file := range files {\n\t\tfetchedContent, err := discovery.FetchBlob(opts.Client, opts.Host, opts.Owner, opts.Repo, file.SHA)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not fetch %s: %w\", file.Path, err)\n\t\t}\n\n\t\t// Install path: the blob is written to disk verbatim, so the raw bytes\n\t\t// must be preserved.\n\t\tcontent := fetchedContent.Raw()\n\n\t\trelPath := strings.TrimPrefix(file.Path, skill.Path+\"/\")","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/internal/skills/installer/installer.go#L242-L278","documentation":"Error \"could not list skill files: %w\" thrown in cli/cli.","triggerScenarios":"Thrown at internal/skills/installer/installer.go:260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the skill directory exists and is readable, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}