{"record":{"id":"29e1ae09d700a079","repo":"santifer/career-ops","slug":"repo-must-be-named-career-ops-plugin-name-got","errorCode":null,"errorMessage":"repo must be named \"career-ops-plugin-<name>\" (got \"${repoName}\")","messagePattern":"repo must be named \"career-ops-plugin-<name>\" \\(got \"(.+?)\"\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugin-install.mjs","lineNumber":34,"sourceCode":"import path from 'node:path';\nimport { validateManifest } from './plugins/_engine.mjs';\nimport { hashPluginTree } from './plugins/_lock.mjs';\nimport { auditPlugin } from './plugin-audit.mjs';\n\nconst GITHUB_URL_RE = /^https:\\/\\/github\\.com\\/[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+?(?:\\.git)?$/;\nconst NAME_RE = /^career-ops-plugin-([a-z0-9][a-z0-9-]*)$/;\nconst SHA_RE = /^[0-9a-f]{40}$/;\nconst MIN_FILES = ['manifest.json', 'index.mjs', 'README.md', 'LICENSE'];\n\n/** Normalize `owner/repo` | full URL into a validated github URL + the plugin id. */\nexport function parseRepoArg(arg) {\n  let url = arg;\n  if (/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$/.test(arg)) url = `https://github.com/${arg}`;\n  url = url.replace(/\\.git$/, '');\n  if (!GITHUB_URL_RE.test(url)) throw new Error(`refusing non-GitHub/unsafe repo URL: ${arg} (expected https://github.com/<owner>/<repo>)`);\n  const repoName = url.split('/').pop() || '';\n  const m = NAME_RE.exec(repoName);\n  if (!m) throw new Error(`repo must be named \"career-ops-plugin-<name>\" (got \"${repoName}\")`);\n  return { url, id: m[1] };\n}\n\n/** Clone the EXACT pinned SHA into a fresh temp dir. Returns the temp dir path. */\nexport function safeClone(url, sha) {\n  if (!SHA_RE.test(sha || '')) throw new Error(`a 40-hex commit --sha is required (got ${JSON.stringify(sha)})`);\n  const dir = mkdtempSync(path.join(tmpdir(), 'co-plugin-'));\n  const git = (...args) => execFileSync('git', ['-c', 'protocol.ext.allow=never', '-c', 'protocol.file.allow=never', ...args], { stdio: ['ignore', 'ignore', 'pipe'], timeout: 120_000 });\n  try {\n    git('-C', dir, 'init', '-q');\n    git('-C', dir, 'remote', 'add', 'origin', '--', url);\n    git('-C', dir, 'fetch', '--depth', '1', '--no-tags', '-q', 'origin', sha);\n    git('-C', dir, 'checkout', '-q', 'FETCH_HEAD');\n    rmSync(path.join(dir, '.git'), { recursive: true, force: true }); // drop VCS metadata (and any hooks)\n    return dir;\n  } catch (err) {\n    rmSync(dir, { recursive: true, force: true });\n    throw new Error(`clone of ${url}@${sha.slice(0, 10)} failed — ${err.stderr ? String(err.stderr).slice(0, 200) : err.message}`);","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/plugin-install.mjs#L16-L52","documentation":"Thrown by parseRepoArg() when the GitHub repo's name does not match the required career-ops-plugin-<name> convention (NAME_RE: ^career-ops-plugin-([a-z0-9][a-z0-9-]*)$). The naming convention is the first trust signal that a repo is an official/community career-ops plugin before it is cloned.","triggerScenarios":"Installing a repo named my-plugin, plugin-x, or Career-Ops-Plugin-X (uppercase); a repo missing the required prefix; a name with underscores or disallowed characters.","commonSituations":"Trying to install a generic GitHub repo that is not a career-ops plugin; the plugin author did not follow the naming convention; case sensitivity (the regex is lowercase-only).","solutions":["Install only repos named exactly career-ops-plugin-<name> (lowercase, hyphens, alphanumeric).","If you own the plugin, rename the GitHub repo to match the convention.","Re-check the repo name on GitHub for typos or case.","Use `node plugins.mjs scaffold <name>` to create a properly named local plugin instead."],"exampleFix":"// before\nparseRepoArg('acme/my-cool-plugin');\n// after\nparseRepoArg('acme/career-ops-plugin-my-cool');","handlingStrategy":"validation","validationCode":"const NAME_RE = /^career-ops-plugin-([a-z0-9][a-z0-9-]*)$/;\nfunction isPluginRepoName(repoSlug) {\n  return NAME_RE.test(repoSlug);\n}","typeGuard":"/** Confirms a repo slug follows the career-ops-plugin-<name> convention. */\nfunction isPluginRepoName(repoSlug) {\n  return typeof repoSlug === 'string' &&\n    /^career-ops-plugin-([a-z0-9][a-z0-9-]*)$/.test(repoSlug);\n}","tryCatchPattern":null,"preventionTips":["Check the repo name on GitHub before attempting install.","Use `node plugins.mjs scaffold` to create convention-compliant plugins.","Remember the convention is lowercase only."],"tags":["plugins","naming-convention","validation","supply-chain"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}