Fission-AI/OpenSpec · error · Error

Missing required argument

Error message

Missing required argument <artifact>. Valid artifacts:
  ${validIds.join('\n  ')}

What it means

Thrown by instructionsCommand when no <artifact> argument was given. The command lists all valid artifact IDs from the change's schema graph in the message so the caller can retry with a correct value.

Solutions

  1. Pass one of the listed artifact IDs to the instructions command
  2. Check the change's schema to see which artifacts it defines
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/commands/workflow/instructions.ts:148 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/825c13b47128b562. Report an issue: GitHub.

Appendix: source

Thrown at src/commands/workflow/instructions.ts:148

    // Validate schema if explicitly provided
    if (options.schema) {
      validateSchemaExists(options.schema, projectRoot);
    }

    const { projectConfig, references } = await loadRootConfigContext(root);

    // loadChangeContext will auto-detect schema from metadata if not provided
    const context = loadChangeContext(projectRoot, changeName, options.schema, {
      changeDir: getChangeDir(planningHome, changeName),
      planningHome,
      projectConfig,
    });

    if (!artifactId) {
      spinner?.stop();
      const validIds = context.graph.getAllArtifacts().map((a) => a.id);
      throw new Error(
        `Missing required argument <artifact>. Valid artifacts:\n  ${validIds.join('\n  ')}`
      );
    }

    const artifact = context.graph.getArtifact(artifactId);

    if (!artifact) {
      spinner?.stop();
      const validIds = context.graph.getAllArtifacts().map((a) => a.id);
      throw new Error(
        `Artifact '${artifactId}' not found in schema '${context.schemaName}'. Valid artifacts:\n  ${validIds.join('\n  ')}`
      );
    }

    const instructions = generateInstructions(context, artifactId, projectRoot, {
      projectConfig,
      references,
    });

View on GitHub (pinned to 6926ccb18a)