upstash/context7 · warning

Expertise description is required

Error message

Expertise description is required

What it means

In `context7 skill generate`, the interactive prompt asks 'Describe the expertise:'. If the submitted string is empty after trim(), generation stops immediately with this warning — the motivation text is required because it drives the library search and later generation steps. Nothing has been created or sent yet.

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 5284672feb)

Solutions

  1. Re-run and describe the expertise in one specific sentence, e.g. 'OAuth authentication patterns and pitfalls with NextAuth.js' (the CLI shows this exact example)
  2. Avoid task-style phrases like 'Build OAuth' — name the patterns, technology, and scope instead
  3. If scripting, pre-validate that the description is non-empty before launching the command

Example fix

# before — prompt input
"Build OAuth"          # too vague, or empty Enter

# after
"OAuth authentication patterns and pitfalls with NextAuth.js"
Defensive patterns

Strategy: validation

Validate before calling

const answer = await input({ message: "Describe the expertise:" });
if (!answer || !answer.trim()) {
  console.error("Describe the expertise in one sentence, e.g. 'OAuth patterns and pitfalls with NextAuth.js'");
  process.exitCode = 1;
}

Type guard

const isNonEmpty = (s: string | undefined): s is string => !!s && s.trim().length > 0;

Prevention

When it happens

Trigger: Pressing Enter on an empty prompt; submitting whitespace-only input; automation piping empty stdin into the interactive prompt.

Common situations: Users exploring the command without a topic prepared; scripts invoking the interactive wizard with no input ready.

Related errors


AI-assisted analysis of upstash/context7@5284672feb (2026-08-18). Data as JSON: /api/errors/b468495c32aaea5b. Report an issue: GitHub.