{"record":{"id":"d96e1ac01b970ed5","repo":"yamadashy/repomix","slug":"watch-cannot-be-used-with-skill-generate-watc","errorCode":null,"errorMessage":"--watch cannot be used with --skill-generate. Watch mode does not support skill generation.","messagePattern":"--watch cannot be used with --skill-generate\\. Watch mode does not support skill generation\\.","errorType":"exception","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/cli/actions/watchAction.ts","lineNumber":93,"sourceCode":"  const config = await buildMergedConfig(cwd, cliOptions);\n\n  // Watch-specific incompatibilities. Each of these is independently incompatible with\n  // --watch and can also be set via the config file (which validateWatchOptions in cliRun,\n  // CLI-flags-only, does not see), so re-check them on the merged config here. They are\n  // checked individually rather than via the shared validateConflictingOptions so the error\n  // always names --watch instead of a (potentially confusing) pairwise conflict.\n  if (config.output.splitOutput !== undefined) {\n    // Split output would create numbered files that the watcher then picks up, looping.\n    throw new RepomixError(\n      '--watch cannot be used with split output. Watch mode does not yet support split output files.',\n    );\n  }\n  // `output: \"-\"` resolves to stdout mode via filePath === '-', the same as --stdout.\n  if (config.output.stdout || config.output.filePath === '-') {\n    throw new RepomixError('--watch cannot be used with stdout output. Watch mode writes to a file.');\n  }\n  if (config.skillGenerate !== undefined) {\n    throw new RepomixError(\n      '--watch cannot be used with --skill-generate. Watch mode does not support skill generation.',\n    );\n  }\n  if (config.output.copyToClipboard) {\n    throw new RepomixError(\n      '--watch cannot be used with --copy. Watch mode re-packs on every change, which would repeatedly overwrite the clipboard.',\n    );\n  }\n\n  const targetPaths = directories.map((directory) => path.resolve(cwd, directory));\n\n  // Run initial pack\n  const packResult = await runPack(targetPaths, config, cliOptions);\n  reportResults(cwd, packResult, config, cliOptions);\n  logger.log(pc.dim(`\\nWatching ${packResult.safeFilePaths.length} files for changes... (Ctrl+C to stop)\\n`));\n\n  // Watch target directories instead of individual files so new files are detected.\n  // The ignore predicate mirrors the packer so chokidar stays out of node_modules/.git","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/cli/actions/watchAction.ts#L75-L111","documentation":"Skill generation (`--skill-generate`) is a one-shot output artifact not supported while watching. `runWatchAction` rejects `--watch` combined with `config.skillGenerate` being set.","triggerScenarios":"Running `repomix --watch --skill-generate <name>`, or `--watch` with `skillGenerate` set in the config file.","commonSituations":"A user generating an AI skill file from a repo then tries to keep it updated automatically with watch mode.","solutions":["Run `--skill-generate` without `--watch`","Re-run the skill generation command manually when the repo changes","Use a script/cron to periodically run skill generation instead of watch mode"],"exampleFix":"// before\nrepomix --watch --skill-generate my-skill\n// after\nrepomix --skill-generate my-skill   # one-shot, no --watch","handlingStrategy":"validation","validationCode":"if (watch && (argv.includes('--skill-generate') || cfg.skillGenerate != null)) {\n  throw new Error('Run --skill-generate as a one-shot command without --watch');\n}","typeGuard":"null","tryCatchPattern":"try {\n  await runRepomix({ watch: true });\n} catch (e) {\n  if (e instanceof RepomixError && e.message.includes('--skill-generate')) {\n    console.error('Run skill generation separately, without --watch.');\n  }\n  throw e;\n}","preventionTips":["Treat --skill-generate as one-shot only","Automate regeneration via scripts/cron instead of watch mode"],"tags":["cli","watch-mode","conflicting-options"],"backgroundTag":"incompatible-cli-options","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}