{"record":{"id":"6dbe68b2e635bcaf","repo":"multica-ai/multica","slug":"inspect-plugin-directory-w","errorCode":null,"errorMessage":"inspect plugin directory: %w","messagePattern":"inspect plugin directory: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_plugin.go","lineNumber":85,"sourceCode":"\tpluginValidateCmd.Flags().String(\"output\", \"json\", \"Output format: table or json\")\n\tpluginPackCmd.Flags().String(\"output\", \"\", \"Output ZIP path (required)\")\n\tpluginPackCmd.Flags().String(\"format\", \"table\", \"Result format: table or json\")\n\tpluginInstallCmd.Flags().String(\"workspace\", \"\", \"Workspace ID, slug, or ID prefix\")\n\tpluginInstallCmd.Flags().String(\"output\", \"json\", \"Output format: table or json\")\n\tpluginListCmd.Flags().String(\"workspace\", \"\", \"Workspace ID, slug, or ID prefix\")\n\tpluginListCmd.Flags().String(\"output\", \"table\", \"Output format: table or json\")\n\tpluginStatusCmd.Flags().String(\"workspace\", \"\", \"Workspace ID, slug, or ID prefix\")\n\tpluginStatusCmd.Flags().String(\"output\", \"json\", \"Output format: table or json\")\n}\n\nfunc runPluginInit(cmd *cobra.Command, args []string) error {\n\tdir := filepath.Clean(args[0])\n\tentries, err := os.ReadDir(dir)\n\tif err == nil && len(entries) > 0 {\n\t\treturn fmt.Errorf(\"plugin directory %q is not empty\", dir)\n\t}\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"inspect plugin directory: %w\", err)\n\t}\n\tkey, _ := cmd.Flags().GetString(\"key\")\n\tname, _ := cmd.Flags().GetString(\"name\")\n\tpublisher, _ := cmd.Flags().GetString(\"publisher\")\n\tmanifest := plugincontract.Manifest{\n\t\tAPIVersion: plugincontract.APIVersionV1,\n\t\tKind:       plugincontract.KindPlugin,\n\t\tMetadata: plugincontract.Metadata{\n\t\t\tKey: key, Name: name, Description: \"A workspace-private declarative Skill Plugin.\", Version: \"0.1.0\", Publisher: publisher,\n\t\t},\n\t\tCompatibility: plugincontract.Compatibility{\n\t\t\tHostAPI: \">=1.0.0 <2.0.0\",\n\t\t\tRequiredDaemonFeatures: []string{\n\t\t\t\tplugincontract.DaemonFeatureExecutionManifestV1,\n\t\t\t\tplugincontract.DaemonFeatureAgentSkillV1,\n\t\t\t},\n\t\t},\n\t\tRequestedCapabilities: []string{plugincontract.CapabilityAgentSkillContribute},","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_plugin.go#L67-L103","documentation":"Returned by `multica plugin init` when os.ReadDir on the target directory fails with an error other than NotExist (cmd_plugin.go:85). A missing directory is fine — init will create it — but any other stat/read failure (permission denied, path component is a file, I/O error) aborts scaffolding.","triggerScenarios":"Target path traverses a file (e.g. ./notes.txt/sub); directory lacks read/execute permission for the current user; NFS/FUSE mount hiccup; path too long (ENAMETOOLONG).","commonSituations":"Typo'd path whose parent is a regular file; restrictive directory permissions in shared/managed environments; scaffolding onto an unmounted network share.","solutions":["Check the path: `ls -la <dir>` and verify each parent component is a directory you can read.","Fix permissions: `chmod +rx <parent-dir>` or run with appropriate privileges.","Remount or wait out the unavailable network filesystem, then retry init."],"exampleFix":"// before\nmultica plugin init ./README.md/plugin   // parent is a file -> inspect plugin directory: not a directory\n\n// after\nmkdir -p ./plugins/my-plugin\nmultica plugin init ./plugins/my-plugin","handlingStrategy":"validation","validationCode":"info, err := os.Stat(dir)\nif err != nil && !os.IsNotExist(err) { return err }\nif err == nil && !info.IsDir() { return fmt.Errorf(\"%s is a file, not a directory\", dir) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create the parent path explicitly with mkdir -p before init.","Avoid scaffolding onto network mounts you have not verified.","Use absolute paths in scripts to eliminate cwd-dependent stat failures."],"tags":["cli","filesystem","permissions","plugin","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}