Fission-AI/OpenSpec · error · Error

OpenSpec config path exists but is not a file.

Error message

OpenSpec config path exists but is not a file.

What it means

Structural guard in ensureDefaultConfig: neither config.yaml nor config.yml is a readable file, and at least one of the paths exists as something other than a file (e.g. a directory named config.yaml), so the default config cannot be written.

Solutions

  1. Remove or rename the non-file entry blocking the config path
  2. Ensure openspec/config.yaml (or config.yml) is a regular file or absent
  3. Retry the root scaffolding operation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/openspec-root.ts:260 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/ecd68f1521588eea. Report an issue: GitHub.

Appendix: source

Thrown at src/core/openspec-root.ts:260

  ledger.push({
    relativePath: relativeArtifact(relativePath, 'directory'),
    absolutePath,
    kind: 'directory',
  });
}

async function ensureDefaultConfig(
  storeRoot: string,
  ledger: CreatedPathLedgerEntry[]
): Promise<void> {
  const configYamlPath = path.join(storeRoot, OPENSPEC_CONFIG_YAML);
  const configYmlPath = path.join(storeRoot, OPENSPEC_CONFIG_YML);
  const yamlKind = await pathKind(configYamlPath);
  const ymlKind = await pathKind(configYmlPath);

  if (yamlKind === 'file' || ymlKind === 'file') return;
  if (yamlKind !== 'missing' || ymlKind !== 'missing') {
    throw new Error('OpenSpec config path exists but is not a file.');
  }

  await FileSystemUtils.writeFile(
    configYamlPath,
    serializeConfig({ schema: DEFAULT_OPENSPEC_SCHEMA })
  );
  ledger.push({
    relativePath: relativeArtifact(OPENSPEC_CONFIG_YAML, 'file'),
    absolutePath: configYamlPath,
    kind: 'file',
  });
}

async function ensureDirectoryAnchor(
  storeRoot: string,
  relativeDir: string,
  ledger: CreatedPathLedgerEntry[]
): Promise<void> {

View on GitHub (pinned to 6926ccb18a)