plugin-system.mdx

July 15, 2026 ยท View on GitHub

Every plugin receives:

SoftwareGraph

Nothing else is required. A plugin should not need to search files or parse source to perform its job.

import type { OntolyPlugin } from "@0xsarwagya/ontoly-core";

export const plugin: OntolyPlugin = {
  name: "example",
  version: "1.0.0",
  run: ({ graph }) => ({
    artifacts: [
      {
        path: "graph.json",
        mediaType: "application/json",
        contents: JSON.stringify(graph, null, 2),
      },
    ],
  }),
};

This keeps the compiler narrow and makes everything else replaceable.