Extensions & Presets

Extend the Prodara compiler with custom capabilities and share configuration across projects with presets. Extensions are npm packages discovered from a local registry or the Prodara marketplace.

Extension Manifest

Every extension is an npm package with a prodara-extension key in package.json that describes its capabilities.

package.json
{
  "name": "@my-org/prodara-ext-react-gen",
  "version": "1.0.0",
  "prodara-extension": {
    "capabilities": [
      { "kind": "generator", "target": "react" },
      { "kind": "reviewer", "id": "react-best-practices" }
    ]
  }
}

Capability Kinds

Extensions declare one or more capabilities that hook into different parts of the compiler pipeline.

KindDescription
reviewerAdds a custom reviewer agent to the review pipeline.
generatorAdds a code generator that produces artifacts from the Product Graph.
validatorAdds custom validation rules executed during the graph validation phase.
phaseAdds a new compiler phase to the pipeline.
templateProvides custom prompt templates for agent integrations.

Extension Registry

The ExtensionRegistry manages loaded extensions at runtime. Use loadExtensions() to discover and activate all installed extensions:

import {
  ExtensionRegistry,
  loadExtensions,
  installExtension,
  removeExtension,
  listInstalledExtensions,
} from '@prodara/compiler';

// Install from npm
await installExtension('@my-org/prodara-ext-react-gen');

// Load all installed extensions
const extensions = await loadExtensions();
const registry = new ExtensionRegistry();

for (const ext of extensions) {
  registry.register(ext);
}

// List installed
const installed = await listInstalledExtensions();

Marketplace

The Prodara marketplace provides a curated list of community extensions. Search, install, and remove extensions using the CLI or the programmatic API.

import { searchMarketplace } from '@prodara/compiler';

// Search the marketplace
const results = await searchMarketplace('react generator');

// Install via npm
// npmInstall / npmRemove wrap child_process for safety
ℹ️
Use the /prodara prompt to manage extensions from within your AI agent. See AI Prompt File.

CLI Commands

# Install an extension
prodara extensions install @my-org/prodara-ext-react-gen

# List installed extensions
prodara extensions list

# Remove an extension
prodara extensions remove @my-org/prodara-ext-react-gen

# Search the marketplace
prodara extensions search "react generator"

Presets

Presets are shareable configuration bundles that set compiler options, enable or disable reviewers, and configure governance rules. They're useful for enforcing organizational standards across multiple projects.

prodara.config.json
{
  "extends": ["@prodara/preset-strict", "@my-org/preset-hipaa"],
  "reviewers": {
    "security": { "enabled": true },
    "adversarial": { "enabled": true }
  },
  "constitution": {
    "policies": ["All PII fields must be encrypted at rest"]
  }
}

Presets are resolved from the registry during the Registry Resolution compiler phase. Multiple presets can be composed — later presets override earlier ones.

Next Steps

Learn how to create your own extension in the Create an Extension tutorial, or read about reviewer customization.