{"record":{"id":"2b7272c2f48b4dbb","repo":"sipeed/picoclaw","slug":"failed-to-install-skill-registry-archive-for-q","errorCode":null,"errorMessage":"✗ failed to install skill: registry archive for %q is not a valid skill","messagePattern":"✗ failed to install skill: registry archive for %q is not a valid skill","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/picoclaw/internal/skills/helpers.go","lineNumber":109,"sourceCode":"\t\treturn fmt.Errorf(\"✗ failed to install skill: %w\", err)\n\t}\n\n\tif result.IsMalwareBlocked {\n\t\trmErr := os.RemoveAll(targetDir)\n\t\tif rmErr != nil {\n\t\t\tfmt.Printf(\"\\u2717 Failed to remove partial install: %v\\n\", rmErr)\n\t\t}\n\n\t\treturn fmt.Errorf(\"\\u2717 Skill '%s' is flagged as malicious and cannot be installed.\\n\", target)\n\t}\n\n\tif result.IsSuspicious {\n\t\tfmt.Printf(\"\\u26a0\\ufe0f  Warning: skill '%s' is flagged as suspicious.\\n\", target)\n\t}\n\n\tif !workspaceHasValidSkillDirectory(workspace, dirName) {\n\t\t_ = os.RemoveAll(targetDir)\n\t\treturn fmt.Errorf(\"✗ failed to install skill: registry archive for %q is not a valid skill\", target)\n\t}\n\n\tnormalizedSlug, registryURL := skills.BuildInstallMetadataForRegistryInstance(registry, target, result.Version)\n\tinstalledAt := time.Now().UnixMilli()\n\tif err := writeInstalledSkillOriginMeta(targetDir, installedSkillOriginMeta{\n\t\tVersion:          1,\n\t\tOriginKind:       \"third_party\",\n\t\tRegistry:         registry.Name(),\n\t\tSlug:             normalizedSlug,\n\t\tRegistryURL:      registryURL,\n\t\tInstalledVersion: result.Version,\n\t\tInstalledAt:      installedAt,\n\t}); err != nil {\n\t\t_ = os.RemoveAll(targetDir)\n\t\treturn fmt.Errorf(\"✗ failed to persist skill metadata: %w\", err)\n\t}\n\n\tfmt.Printf(\"\\u2713 Skill '%s' v%s installed successfully!\\n\", dirName, result.Version)","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/skills/helpers.go#L91-L127","documentation":"The download and extraction succeeded, but post-install validation failed: workspaceHasValidSkillDirectory re-scans the workspace with the skills loader and found no workspace-sourced skill whose directory base name matches dirName. That means the archive's layout does not produce a discoverable, correctly named skill directory; the partial install is deleted.","triggerScenarios":"An archive that extracts into an unexpected layout — everything nested under an extra top-level folder, a root directory name that does not match dirName, or missing the files the SkillsLoader needs to recognize a skill — fails the check at helpers.go:109 (see workspaceHasValidSkillDirectory, helpers.go:143).","commonSituations":"Registry packaging bug, a zip built with a different root folder name, or a repo published as a skill without the manifest/layout picoclaw's loader expects.","solutions":["Inspect the skill's published archive layout on the registry and compare it with an installable skill.","Report the packaging problem to the skill author or registry.","Try a different version — packaging regressions are common between releases.","If you own the skill, package it so its files sit in a single root directory the loader can discover (matching dirName)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":"func archiveLooksLikeSkill(extractDir, dirName string) bool {\n    loader := skills.NewSkillsLoader(filepath.Dir(extractDir), \"\", \"\")\n    for _, s := range loader.ListSkills() {\n        if s.Source == \"workspace\" && filepath.Base(filepath.Dir(s.Path)) == dirName {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"not a valid skill\") {\n    // archive layout mismatch — report to the registry; do not retry the same version\n    return reportPackagingIssue(target, result.Version)\n}","preventionTips":["Publish skills from a template matching the loader's expected layout.","Run test installs in CI for skills you publish.","Pin versions whose packaging is known to install cleanly."],"tags":["install","registry","packaging","validation","go"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}