Principle:A5c ai Babysitter Plugin Compilation
| Knowledge Sources | |
|---|---|
| Domains | Plugin_Generation, Compilation |
| Last Updated | 2026-10-23 00:00 GMT |
Overview
A method for compiling a unified plugin source definition into harness-specific plugin packages through a build-then-compile pipeline.
Description
Plugin Compilation is the principle of transforming a single source definition into multiple harness-specific outputs. The pipeline has two stages:
- Compiler build: Build the extensions-adapter compiler package, which contains the transformation logic. Only builds if the compiled CLI is missing.
- Per-target compilation: For each target in the plugin.json targets map (gemini, claude-code, codex, cursor, genty), run the compiler with --target, --source, --output, --verbose, and --verify flags.
The compiler reads the unified source, transforms it for the target harness format (e.g. Claude Code's .claude/commands, Gemini's .gemini/extension), and writes per-target plugin packages.
Usage
Use this principle when supporting multiple AI harnesses from a single plugin source definition, where each harness has a different plugin format.
Theoretical Basis
The compilation is a build-then-fan-out:
// Build stage
if not exists(dist/cli.js):
npm run build --workspace=@a5c-ai/atlas
npm run build --workspace=@a5c-ai/extensions-adapter
// Compile stage
for target in plugin.json.targets:
exec: node dist/cli.js compile --target <target> --source <unified> --output <output>/<target> --verbose --verify
Key property: The --verify flag validates output after compilation, ensuring the generated package is structurally correct before it leaves the pipeline.