upstash/context7 · warning

Expertise description is required

Error message

Expertise description is required

What it means

In generateCommand's expertise-description prompt (clack/prompts input), an empty or whitespace-only answer triggers log.warn('Expertise description is required') and the command returns without generating. The CLI requires a non-empty motivation string to search sources and build the expertise.

Solutions

  1. Re-run the command and type a meaningful description of the expertise you want generated
  2. Provide at least one non-whitespace character; the input is trimmed before use
  3. Cancel with Ctrl+C if you do not wish to proceed (clean exit instead of warn)

Example fix

// before
? Describe the expertise: (empty, Enter)
// after
? Describe the expertise: Setting up typed HTTP clients with retries in TypeScript
Defensive patterns

Strategy: validation

Validate before calling

const answer = await input({ message: 'Describe the expertise:' });
if (!answer.trim()) { throw new Error('Expertise description is required'); }

Type guard

function hasMeaningfulText(s: string): boolean { return s.trim().length > 0; }

Prevention

When it happens

Trigger: Pressing Enter at the 'Describe the expertise:' prompt without typing anything (motivation.trim() is empty).

Common situations: Accidentally accepting the default empty prompt; expecting an interactive picker instead of free text; piping input that yields empty stdin.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of upstash/context7@4416fb855b (2026-09-16). Data as JSON: /api/errors/b468495c32aaea5b. Report an issue: GitHub.

Appendix: source

Thrown at packages/cli/src/commands/generate.ts:133

    console.log(pc.red('  ✕ "Deploy a Next.js app to Vercel"'));
    console.log(pc.green('  ✓ "Best practices and constraints for deploying Next.js apps to Vercel"'));
    log.blank();
    console.log(pc.red('  ✕ "Use Tailwind for responsive design"'));
    console.log(pc.green('  ✓ "Responsive layout decision-making with Tailwind CSS"'));
    log.blank();
    console.log(pc.red('  ✕ "Build OAuth with NextAuth"'));
    console.log(pc.green('  ✓ "OAuth authentication patterns and pitfalls with NextAuth.js"'));
  }
  log.blank();

  let motivation: string;
  try {
    motivation = await input({
      message: "Describe the expertise:",
    });

    if (!motivation.trim()) {
      log.warn("Expertise description is required");
      return;
    }
    motivation = motivation.trim();
  } catch {
    log.warn("Generation cancelled");
    return;
  }

  log.blank();
  console.log(
    pc.dim(
      "To generate this skill, we will read relevant documentation and examples\nfrom Context7.\n"
    )
  );
  console.log(
    pc.dim(
      "These sources are used to:\n• extract best practices and constraints\n• compare patterns across official docs and examples\n• avoid outdated or incorrect guidance\n"
    )

View on GitHub (pinned to 4416fb855b)