{"record":{"id":"8585955570ac1f1d","repo":"paperclipai/paperclip","slug":"refusing-to-materialize-a-skill-into-itself-an-an","errorCode":null,"errorMessage":"Refusing to materialize a skill into itself, an ancestor, or one of its descendants.","messagePattern":"Refusing to materialize a skill into itself, an ancestor, or one of its descendants\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/server-utils.ts","lineNumber":4262,"sourceCode":"    return \"skipped\";\n  }\n\n  await fs.unlink(target);\n  await linkSkill(source, target);\n  return \"repaired\";\n}\n\nasync function hashSkillDirectory(root: string): Promise<string> {\n  const hash = createHash(\"sha256\");\n\n  async function visit(candidate: string, relativePath: string): Promise<void> {\n    const stat = await fs.lstat(candidate);\n    if (stat.isSymbolicLink()) {\n      hash.update(`symlink:${relativePath}\\n`);\n      return;\n    }\n    if (stat.isDirectory()) {\n      hash.update(`dir:${relativePath}\\n`);\n      const entries = await fs.readdir(candidate, { withFileTypes: true });\n      entries.sort((left, right) => left.name.localeCompare(right.name));\n      for (const entry of entries) {\n        const childRelativePath = relativePath\n          ? `${relativePath}/${entry.name}`\n          : entry.name;\n        await visit(path.join(candidate, entry.name), childRelativePath);\n      }\n      return;\n    }\n    if (stat.isFile()) {\n      hash.update(`file:${relativePath}:${stat.mode}\\n`);\n      hash.update(await fs.readFile(candidate));\n      hash.update(\"\\n\");\n      return;\n    }\n    hash.update(`other:${relativePath}:${stat.mode}\\n`);\n  }","sourceCodeStart":4244,"sourceCodeEnd":4280,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/adapter-utils/src/server-utils.ts#L4244-L4280","documentation":"Error \"Refusing to materialize a skill into itself, an ancestor, or one of its descendants.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/adapter-utils/src/server-utils.ts:3156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a materialization target outside the skill's own directory tree."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}