pbakaus/impeccable · error

concept-seed: --scope must be direction or surface

Error message

concept-seed: --scope must be direction or surface

What it means

Thrown by the concept-seed main entry when --scope is neither 'surface' nor 'direction'. These are the only two scopes the seeder supports: 'direction' seeds whole-product creative directions; 'surface' seeds structures for a screen/region.

Source

Thrown at plugin/skills/impeccable/scripts/concept-seed.mjs:307

  };
}

const SEED_MODES = new Set(['persuade', 'operate', 'read', 'experience']);

export function renderConceptSeed({
  scope = 'surface',
  key = process.env.IMPECCABLE_CONCEPT_SEED || crypto.randomBytes(4).toString('hex'),
  reroll = 0,
  register = null,
  mode = null,
  grain = null,
  platform = null,
  candidateCount = 7,
  catalogDir = CATALOG_DIR,
  _resolvedData = undefined,
} = {}) {
  if (scope !== 'surface' && scope !== 'direction') {
    throw new Error('concept-seed: --scope must be direction or surface');
  }
  if (!Number.isInteger(reroll) || reroll < 0) {
    throw new Error('concept-seed: --reroll must be a non-negative integer');
  }
  if (register !== null && register !== 'safer' && register !== 'bolder') {
    throw new Error('concept-seed: --register must be safer or bolder');
  }
  if (register !== null && reroll < 1) {
    throw new Error('concept-seed: --register steers a re-roll round; pass --reroll <n> with it');
  }
  if (register !== null && scope !== 'direction') {
    throw new Error('concept-seed: --register applies to direction rounds only');
  }
  if (mode !== null && !SEED_MODES.has(mode)) {
    throw new Error('concept-seed: --mode must be persuade, operate, read, or experience');
  }
  // Grain needs no mode: how much of the product is in play is independent of
  // which register of work it is.

View on GitHub (pinned to d14711ae3d)

Solutions

  1. Pass --scope surface or --scope direction.
  2. If calling the exported function, set the scope parameter to one of those two exact strings.

Example fix

# before
$ node concept-seed.mjs --scope page ...

# after
$ node concept-seed.mjs --scope surface ...
Defensive patterns

Strategy: validation

Validate before calling

const SCOPES = new Set(['surface', 'direction']);
if (!SCOPES.has(scope)) {
  throw new Error(`--scope must be one of: ${[...SCOPES].join(', ')}`);
}

Type guard

function isValidScope(value) {
  return value === 'surface' || value === 'direction';
}

Try / catch

try {
  await seedConcepts({ scope });
} catch (err) {
  if (/--scope must be/.test(err.message)) {
    console.error('Use --scope surface or --scope direction.');
  } else throw err;
}

Prevention

When it happens

Trigger: Calling concept-seed.mjs (or its exported function) with scope set to anything other than 'surface' or 'direction' — e.g. a typo like 'surfaces', 'dir', or an unsupported value like 'page'.

Common situations: CLI typo; a wrapper script passing a free-text scope; an outdated caller using a scope name from a previous API version.

Related errors


AI-assisted analysis of pbakaus/impeccable@d14711ae3d (2026-08-13). Data as JSON: /api/errors/69611350a625eed2. Report an issue: GitHub.