{"record":{"id":"6ec7fd7752e611b0","repo":"EveryInc/compound-engineering-plugin","slug":"plugin-directory-not-found-pluginpath","errorCode":null,"errorMessage":"Plugin directory not found: ${pluginPath}","messagePattern":"Plugin directory not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/plugin-path.ts","lineNumber":49,"sourceCode":"      .replace(/\\//g, \"~\")\n      .replace(/[^a-zA-Z0-9._~-]/g, (ch) => `%${ch.charCodeAt(0).toString(16).padStart(2, \"0\")}`)\n    const dirName = `${pluginName}-${sanitized}`\n    const cacheRoot = path.join(os.homedir(), \".cache\", \"compound-engineering\", \"branches\")\n    await fs.mkdir(cacheRoot, { recursive: true })\n    const targetDir = path.join(cacheRoot, dirName)\n    const source = resolveGitHubSource()\n\n    if (await dirExists(targetDir)) {\n      console.error(`Updating existing checkout at ${targetDir}`)\n      await fetchAndCheckout(targetDir, branch)\n    } else {\n      console.error(`Cloning ${branch} to ${targetDir}`)\n      await cloneBranch(source, targetDir, branch)\n    }\n\n    const pluginPath = await resolvePluginRoot(targetDir, pluginName)\n    if (!(await dirExists(pluginPath))) {\n      throw new Error(`Plugin directory not found: ${pluginPath}`)\n    }\n\n    // Plugin path goes to stdout (for scripting); usage hint goes to stderr\n    console.error(`\\nReady. Use with:\\n  claude --plugin-dir ${pluginPath}\\n`)\n    console.log(pluginPath)\n  },\n})\n\nasync function dirExists(p: string): Promise<boolean> {\n  try {\n    const stat = await fs.stat(p)\n    return stat.isDirectory()\n  } catch {\n    return false\n  }\n}\n\nasync function resolvePluginRoot(repoDir: string, pluginName: string): Promise<string> {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/commands/plugin-path.ts#L31-L67","documentation":"The `plugin-path` command resolves (cloning if needed) the plugin repository, then uses `resolvePluginRoot` to find the plugin directory inside it and verifies it with `dirExists`. This error means the clone succeeded but no directory for the requested plugin name exists at the expected location, so there is no path to print.","triggerScenarios":"Running `plugin-path <plugin-name>` where the source repo does not contain a directory matching the plugin name — misspelled name, plugin renamed upstream, or the cloned ref (branch) predates the plugin's addition.","commonSituations":"Requesting a plugin from an older branch that doesn't have it yet; typo in the plugin name; source override (COMPOUND_PLUGIN_GITHUB_SOURCE) pointing at a repo without the plugin.","solutions":["Check the plugin directory name in the source repo (see `.claude-plugin/marketplace.json`).","If using --branch, switch to a branch that contains the plugin (e.g. main).","Correct the plugin name spelling and re-run.","If COMPOUND_PLUGIN_GITHUB_SOURCE is set, verify it points at the right repository."],"exampleFix":"// before\nplugin-path compund-engineering\n// after\nplugin-path compound-engineering","handlingStrategy":"validation","validationCode":"// Confirm the plugin name matches a directory in the source repo before calling\nconst res = await fetch(`https://api.github.com/repos/<owner>/<repo>/contents/plugins`)\nconst dirs = (await res.json()).map((e: any) => e.name)\nif (!dirs.includes(pluginName)) throw new Error(`No plugin dir named ${pluginName}`)","typeGuard":null,"tryCatchPattern":"try {\n  const p = await pluginPath(pluginName)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith(\"Plugin directory not found\")) {\n    console.error(`Wrong plugin name or branch; check the repo layout`) \n  } else throw e\n}","preventionTips":["Match plugin names to directory names in the source repo exactly.","When using --branch, confirm the branch contains the plugin.","Verify COMPOUND_PLUGIN_GITHUB_SOURCE points at the intended repo."],"tags":["cli","filesystem","not-found"],"backgroundTag":"plugin-directory-not-found","analyzedSha":"c9c10f8c75412c7232cb2bd663e5fd1cea98d84e","analyzedAt":"2026-08-31T15:18:07.959Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}