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
- Re-run the skill generation command and complete the prompts.
- If you don't want to overwrite, choose a different skill name or location when prompted instead of cancelling.
- For non-interactive use, pass the skill output path explicitly (with --force as needed) so no prompts appear.
- 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
- Pass the output path explicitly to skip interactive prompts.
- Don't pipe/redirect the CLI when prompts are expected; run it on a TTY.
- Decide beforehand whether to overwrite an existing skill to avoid cancelling mid-flow.
- Treat OperationCancelledError as normal user flow in wrappers.
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
- Reviewing the remote repository's config (${configName}) nee
- Remote config not trusted
- Skill output path exists but is not a directory: ${skillDir}
- Skill directory already exists: ${skillDir}. Use --force to
- --skill-output can only be used with --skill-generate
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/327f369092177bd7.
Report an issue: GitHub.