Fission-AI/OpenSpec · error · Error

Schema ' ' not found. Available schemas

Error message

Schema '${schemaName}' not found. Available schemas:
  ${availableSchemas.join('\n  ')}

What it means

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.

Solutions

  1. Use one of the listed schema names
  2. Install or create the schema (openspec schema commands) before referencing it
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/commands/workflow/shared.ts:239 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/f0b1ec7de4b6f123. Report an issue: GitHub.

Appendix: source

Thrown at src/commands/workflow/shared.ts:239

    throw new Error(
      `Change '${changeName}' not found. Available changes:\n  ${available.join('\n  ')}`
    );
  }

  return changeName;
}

/**
 * Validates that a schema exists and returns available schemas if not.
 *
 * @param schemaName - The schema name to validate
 * @param projectRoot - Optional project root for project-local schema resolution
 */
export function validateSchemaExists(schemaName: string, projectRoot?: string): string {
  const schemaDir = getSchemaDir(schemaName, projectRoot);
  if (!schemaDir) {
    const availableSchemas = listSchemas(projectRoot);
    throw new Error(
      `Schema '${schemaName}' not found. Available schemas:\n  ${availableSchemas.join('\n  ')}`
    );
  }
  return schemaName;
}

View on GitHub (pinned to 6926ccb18a)