{"record":{"id":"3b07a2b22119ace7","repo":"remix-run/react-router","slug":"react-router-agent-skill-files-were-not-found","errorCode":null,"errorMessage":"React Router agent skill files were not found","messagePattern":"React Router agent skill files were not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/create-react-router/index.ts","lineNumber":342,"sourceCode":"async function copyAgentSkillsToAppDirStep(ctx: Context) {\n  if (!ctx.agentSkills) {\n    await sleep(100);\n    info(\"Skipping agent skill.\", [\n      \"You can add it later from \",\n      color.reset(\n        \"https://github.com/remix-run/react-router/tree/main/.agents/skills/react-router\",\n      ),\n      \".\",\n    ]);\n    return;\n  }\n\n  if (!existsSync(path.join(agentSkillPath, \"SKILL.md\"))) {\n    error(\n      \"Oh no!\",\n      \"React Router agent skill files were not found in this package.\",\n    );\n    throw new Error(\"React Router agent skill files were not found\");\n  }\n\n  let destPath = path.join(ctx.cwd, \".agents\", \"skills\", \"react-router\");\n\n  if (existsSync(destPath)) {\n    info(\"Agent skill:\", \"React Router agent skill already included\");\n    return;\n  }\n\n  await ensureDirectory(path.dirname(destPath));\n  await cp(agentSkillPath, destPath, {\n    errorOnExist: true,\n    force: false,\n    recursive: true,\n  });\n  info(\"Agent skill:\", \"Included React Router agent skill\");\n}\n","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/remix-run/react-router/blob/6beaca39526d5716c3c112ebb0782765baa5a9ce/packages/create-react-router/index.ts#L324-L360","documentation":"When agent-skills are enabled, the CLI copies the skill bundled inside the installed create-react-router package from <package>/dist/agent-skills/react-router, and requires SKILL.md there. If that file is missing, the installed package is incomplete or corrupted (partial install, stale cache), or the running version does not bundle the skill files.","triggerScenarios":"An interrupted package install leaving partial package contents; a corrupted package-manager store (pnpm store, npm cache); running from a modified or partial checkout of the repo; an old create-react-router version that predates bundled agent skills.","commonSituations":"CI caches with partially extracted packages; local patched or linked versions of create-react-router; Windows installs where files were locked during extraction.","solutions":["Reinstall in a clean state: remove node_modules, clear the cache (npm cache clean --force or pnpm store prune), reinstall","Pin or upgrade to the latest create-react-router so the bundled skill files are present","Or skip the step entirely with --no-agent-skills","If a fresh install still lacks the files, report it to the react-router repo"],"exampleFix":"# before\nnpx create-react-router my-app\n\n# after: clean reinstall, or opt out\nnpm cache clean --force && rm -rf node_modules && npm install\nnpx create-react-router my-app\n# or simply:\nnpx create-react-router my-app --no-agent-skills","handlingStrategy":"validation","validationCode":"import { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createRequire } from \"node:module\";\n\nconst require = createRequire(import.meta.url);\n\nfunction agentSkillFilesInstalled(): boolean {\n  try {\n    const pkgRoot = path.dirname(require.resolve(\"create-react-router/package.json\"));\n    return existsSync(path.join(pkgRoot, \"dist\", \"agent-skills\", \"react-router\", \"SKILL.md\"));\n  } catch {\n    return false; // package not resolvable at all\n  }\n}\n\nconst args = agentSkillFilesInstalled() ? allArgs : [...allArgs, \"--no-agent-skills\"];","typeGuard":null,"tryCatchPattern":"try {\n  await createReactRouter(args);\n} catch (e) {\n  if ((e as Error).message === \"React Router agent skill files were not found\") {\n    console.error(\"create-react-router install incomplete — clear cache and reinstall, or use --no-agent-skills\");\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Pin a known-good create-react-router version in CI instead of floating latest","Clear package-manager caches (pnpm store prune, npm cache clean) after interrupted installs","Pass --no-agent-skills in environments where the skill is not needed"],"tags":["cli","installation","agent-skills"],"backgroundTag":"corrupted-package-install","analyzedSha":"6beaca39526d5716c3c112ebb0782765baa5a9ce","analyzedAt":"2026-08-18T18:04:14.938Z","contentChangedAt":"2026-08-18T18:04:14.938Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}