{"record":{"id":"22ca922c6e4cfc0d","repo":"Fission-AI/OpenSpec","slug":"no-changes-found-create-one-with-newchangehint","errorCode":null,"errorMessage":"No changes found. Create one with: ${newChangeHint}","messagePattern":"No changes found\\. Create one with: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/workflow/shared.ts","lineNumber":197,"sourceCode":"\n/**\n * Validates that a change exists and returns available changes if not.\n * Checks directory existence directly to support scaffolded changes (without proposal.md).\n */\nexport async function validateChangeExists(\n  changeName: string | undefined,\n  projectRoot: string,\n  changesDir = path.join(projectRoot, 'openspec', 'changes'),\n  hints: { newChangeHint?: string } = {}\n): Promise<string> {\n  // Hints must stay pasteable: callers with a selected store pass a\n  // store-carrying hint so following it lands in the same root.\n  const newChangeHint = hints.newChangeHint ?? 'openspec new change <name>';\n\n  if (!changeName) {\n    const available = await getAvailableChanges(projectRoot, changesDir);\n    if (available.length === 0) {\n      throw new Error(`No changes found. Create one with: ${newChangeHint}`);\n    }\n    throw new Error(\n      `Missing required option --change. Available changes:\\n  ${available.join('\\n  ')}`\n    );\n  }\n\n  // Validate change name format to prevent path traversal\n  const lookupError = validateChangeLookupName(changeName);\n  if (lookupError) {\n    throw new Error(`Invalid change name '${changeName}': ${lookupError}`);\n  }\n\n  // Check directory existence directly\n  const changePath = path.join(changesDir, changeName);\n  const exists = fs.existsSync(changePath) && fs.statSync(changePath).isDirectory();\n\n  if (!exists) {\n    const available = await getAvailableChanges(projectRoot, changesDir);","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/commands/workflow/shared.ts#L179-L215","documentation":"Generic guard thrown by validateChangeExists when no openspec/changes directory entries are found, so there is no change to operate on. The named input at fault is the change name (or its absence); the error is a sentinel telling the user to create a change first, including a pasteable hint command.","triggerScenarios":"Thrown at src/commands/workflow/shared.ts:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the newChangeHint command shown in the error (e.g. 'openspec new change') to create a change","Verify you are in the correct project root — the changes directory looked up is openspec/changes relative to it","Check for typos in the change name if you passed one"],"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"}