{"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/1fd704a7dabcbe3ae09d7387b460e6acaba30ec1/packages/create-react-router/index.ts#L324-L360","documentation":"Thrown in copyAgentSkillsToAppDirStep() when the user opted into agent skills (--agent-skills or answered yes) but SKILL.md is missing at the bundled agentSkillPath (<package>/dist/agent-skills/react-router/SKILL.md). This is a packaging/distribution defect in the installed create-react-router package, not a user mistake — the agent skill assets were not shipped into dist.","triggerScenarios":"Installing create-react-router from a dev build that skipped copying agent-skills into dist; a packaged tarball missing the dist/agent-skills tree; running from source without building; a broken npm publish that omitted the assets.","commonSituations":"Using a local/linked build of create-react-router without running the build step that copies agent-skills; an npm publish with an overly narrow 'files' field; an old/cached node_modules entry predating agent-skills.","solutions":["If you don't need the agent skill, disable it: --no-agent-skills.","Reinstall create-react-router from npm to get a complete build: npm i -g create-react-router@latest.","If running from a local checkout, run the package build so dist/agent-skills/react-router/SKILL.md is populated.","Manually copy the skill from github.com/remix-run/react-router/tree/main/.agents/skills/react-router into ./.agents/skills/react-router after scaffolding."],"exampleFix":"// before -- broken local build missing assets\ncreate-react-router my-app --agent-skills\n// after -- skip skill, or use the published package\ncreate-react-router my-app --no-agent-skills\n# or:\nnpx create-react-router@latest my-app --agent-skills","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nimport path from 'node:path';\n// Confirm the bundled skill asset exists before enabling --agent-skills\nconst crrPkg = path.dirname(require.resolve('create-react-router/package.json'));\nconst skillPresent = existsSync(path.join(crrPkg, 'dist/agent-skills/react-router/SKILL.md'));\n// if (!skillPresent) invoke with --no-agent-skills","typeGuard":null,"tryCatchPattern":"try {\n  await createReactRouter([dir, '--agent-skills']);\n} catch (e) {\n  if (/agent skill files were not found/.test(String(e?.message ?? ''))) {\n    await createReactRouter([dir, '--no-agent-skills']);\n  } else throw e;\n}","preventionTips":["Use the published npm build of create-react-router; rebuild local checkouts before linking.","If you don't need the skill, pass --no-agent-skills.","Keep a local copy of the skill in version control to restore manually.","Verify dist/agent-skills is populated after building from source."],"tags":["cli","agent-skills","packaging","create-react-router"],"backgroundTag":null,"analyzedSha":"1fd704a7dabcbe3ae09d7387b460e6acaba30ec1","analyzedAt":"2026-08-12T13:54:57.804Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}