{"record":{"id":"95822bb2c400e960","repo":"different-ai/openwork","slug":"projectdir-and-sourcedir-are-required","errorCode":null,"errorMessage":"projectDir and sourceDir are required","messagePattern":"projectDir and sourceDir are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/main.mjs","lineNumber":2054,"sourceCode":"      });\n      if (result.canceled) return null;\n      return options.multiple ? result.filePaths : (result.filePaths[0] ?? null);\n  },\n  \"saveFile\": async (event, ...args) => {\n      const options = args[0] ?? {};\n      const result = await dialog.showSaveDialog(activeWindowFromEvent(event), {\n        title: options.title,\n        defaultPath: options.defaultPath,\n        filters: options.filters,\n      });\n      return result.canceled ? null : (result.filePath ?? null);\n  },\n  \"importSkill\": async (event, ...args) => {\n      const projectDir = String(args[0] ?? \"\").trim();\n      const sourceDir = String(args[1] ?? \"\").trim();\n      const overwrite = args[2]?.overwrite === true;\n      if (!projectDir || !sourceDir) {\n        throw new Error(\"projectDir and sourceDir are required\");\n      }\n      const skillRoot = await ensureProjectSkillRoot(projectDir);\n      const name = validateSkillName(path.basename(sourceDir));\n      const destination = path.join(skillRoot, name);\n      if (await pathExists(destination)) {\n        if (!overwrite) {\n          return execResult(false, \"\", `Skill already exists at ${destination}`);\n        }\n        await rm(destination, { recursive: true, force: true });\n      }\n      await cp(sourceDir, destination, { recursive: true });\n      return execResult(true, `Imported skill to ${destination}`);\n  },\n  \"installSkillTemplate\": async (event, ...args) => {\n      const projectDir = String(args[0] ?? \"\").trim();\n      const name = validateSkillName(args[1]);\n      const content = String(args[2] ?? \"\");\n      const overwrite = args[3]?.overwrite === true;","sourceCodeStart":2036,"sourceCodeEnd":2072,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/desktop/electron/main.mjs#L2036-L2072","documentation":"Error \"projectDir and sourceDir are required\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at apps/desktop/electron/main.mjs:2054 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}