{"record":{"id":"f0b1ec7de4b6f123","repo":"Fission-AI/OpenSpec","slug":"schema-schemaname-not-found-available-schema","errorCode":null,"errorMessage":"Schema '${schemaName}' not found. Available schemas:\n  ${availableSchemas.join('\\n  ')}","messagePattern":"Schema '(.+?)' not found\\. Available schemas:\n  (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/workflow/shared.ts","lineNumber":239,"sourceCode":"    throw new Error(\n      `Change '${changeName}' not found. Available changes:\\n  ${available.join('\\n  ')}`\n    );\n  }\n\n  return changeName;\n}\n\n/**\n * Validates that a schema exists and returns available schemas if not.\n *\n * @param schemaName - The schema name to validate\n * @param projectRoot - Optional project root for project-local schema resolution\n */\nexport function validateSchemaExists(schemaName: string, projectRoot?: string): string {\n  const schemaDir = getSchemaDir(schemaName, projectRoot);\n  if (!schemaDir) {\n    const availableSchemas = listSchemas(projectRoot);\n    throw new Error(\n      `Schema '${schemaName}' not found. Available schemas:\\n  ${availableSchemas.join('\\n  ')}`\n    );\n  }\n  return schemaName;\n}\n","sourceCodeStart":221,"sourceCodeEnd":245,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/commands/workflow/shared.ts#L221-L245","documentation":"Guard in validateSchemaExists: getSchemaDir found no directory for the schema name (project-local, user, or package resolution all failed), so the error lists the schemas that do exist. A validation helper used by many workflow commands before schema-dependent work starts.","triggerScenarios":"Thrown at src/commands/workflow/shared.ts:239 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the listed schema names","Install or create the schema (openspec schema commands) before referencing it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}