yamadashy/repomix · info · OperationCancelledError

Skill generation cancelled

Error message

Skill generation cancelled

What it means

Thrown as OperationCancelledError when the user cancels any @clack/prompts interaction during skill generation. onCancelOperation first calls the clack cancel() to render 'Skill generation cancelled.' on the terminal, then throws so the CLI exits with a cancellation status instead of proceeding. It is triggered from promptSkillLocation when the location select or the overwrite confirm is cancelled or answered negatively.

Source

Thrown at src/cli/prompts/skillPrompts.ts:17

import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import pc from 'picocolors';
import { OperationCancelledError, RepomixError } from '../../shared/errorHandle.js';
import { getDisplayPath } from '../cliReport.js';

export type SkillLocation = 'personal' | 'project';

export interface SkillPromptResult {
  location: SkillLocation;
  skillDir: string;
}

const onCancelOperation = (cancelFn: (message?: string) => void): never => {
  cancelFn('Skill generation cancelled.');
  throw new OperationCancelledError('Skill generation cancelled');
};

/**
 * Get the base directory for skills based on location type.
 */
export const getSkillBaseDir = (cwd: string, location: SkillLocation): string => {
  if (location === 'personal') {
    return path.join(os.homedir(), '.claude', 'skills');
  }
  return path.join(cwd, '.claude', 'skills');
};

/**
 * Prompt user for skill location and handle overwrite confirmation.
 */
// Lazy-load @clack/prompts (~16ms) to build default deps.
// Only called in production; tests always pass deps directly.
const createPromptDeps = async () => {

View on GitHub (pinned to f465ad9093)

Solutions

  1. Re-run the skill generation command and complete the prompts.
  2. If you don't want to overwrite, choose a different skill name or location when prompted instead of cancelling.
  3. For non-interactive use, pass the skill output path explicitly (with --force as needed) so no prompts appear.
  4. Ensure scripts that drive the CLI don't send stray keystrokes/EOF to stdin during prompts.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await promptSkillLocation(skillName, cwd);
} catch (e) {
  if (e instanceof OperationCancelledError && e.message === 'Skill generation cancelled') {
    console.error('Skill generation aborted by user.');
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Running repomix's skill generation interactive flow: pressing Ctrl-C/Esc at the 'Where would you like to save the skill?' select, or cancelling (or answering 'no' to) the 'Skill directory already exists. Do you want to overwrite it?' confirm.

Common situations: User changes their mind about overwriting an existing skill; accidental Ctrl-C; automated runs that feed EOF/keystrokes into the prompt causing clack to report cancel.

Related errors


AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29). Data as JSON: /api/errors/327f369092177bd7. Report an issue: GitHub.