paperclipai/paperclip · error · Error

Refusing to materialize a skill into itself, an ancestor…

Error message

Refusing to materialize a skill into itself, an ancestor, or one of its descendants.

What it means

Error "Refusing to materialize a skill into itself, an ancestor, or one of its descendants." thrown in paperclipai/paperclip.

Solutions

  1. Choose a materialization target outside the skill's own directory tree.

When it happens

Trigger: Thrown at packages/adapter-utils/src/server-utils.ts:3156 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-08-18). Data as JSON: /api/errors/8585955570ac1f1d. Report an issue: GitHub.

Appendix: source

Thrown at packages/adapter-utils/src/server-utils.ts:4262

    return "skipped";
  }

  await fs.unlink(target);
  await linkSkill(source, target);
  return "repaired";
}

async function hashSkillDirectory(root: string): Promise<string> {
  const hash = createHash("sha256");

  async function visit(candidate: string, relativePath: string): Promise<void> {
    const stat = await fs.lstat(candidate);
    if (stat.isSymbolicLink()) {
      hash.update(`symlink:${relativePath}\n`);
      return;
    }
    if (stat.isDirectory()) {
      hash.update(`dir:${relativePath}\n`);
      const entries = await fs.readdir(candidate, { withFileTypes: true });
      entries.sort((left, right) => left.name.localeCompare(right.name));
      for (const entry of entries) {
        const childRelativePath = relativePath
          ? `${relativePath}/${entry.name}`
          : entry.name;
        await visit(path.join(candidate, entry.name), childRelativePath);
      }
      return;
    }
    if (stat.isFile()) {
      hash.update(`file:${relativePath}:${stat.mode}\n`);
      hash.update(await fs.readFile(candidate));
      hash.update("\n");
      return;
    }
    hash.update(`other:${relativePath}:${stat.mode}\n`);
  }

View on GitHub (pinned to 3f1d897a7c)