The Blueprint plugin system allows extending document generation with custom formatters, validators, processors, integrations, and lifecycle hooks.
| Type | Purpose | Example |
|---|---|---|
| Formatter | Transform output format | Markdown, HTML, PDF |
| Validator | Quality checks on content | Completeness, style, tone |
| Processor | Pre/post-process content | Variable injection, templating |
| Integration | External service export | Slack, email, webhooks |
| Hook | Lifecycle events | Before/after generation |
import { BlueprintPlugin } from '@intentsolutions/blueprint-core';
const myPlugin: BlueprintPlugin = {
name: 'my-custom-plugin',
version: '1.0.0',
type: 'formatter',
// Called during document generation
async process(content: string, options: PluginOptions): Promise<PluginResult> {
const transformed = transformContent(content);
return { content: transformed, format: 'custom' };
}
};
export default myPlugin;import { createPluginManager } from '@intentsolutions/blueprint-core';
const manager = createPluginManager();
manager.register(myPlugin);Default formatter. Outputs clean, standardized Markdown.
Converts Markdown output to styled HTML with a professional theme.
Checks generated documents for:
- Required sections present
- Minimum content length per section
- Placeholder replacement completeness
- Cross-reference validity
Document Generation Pipeline:
[Input] → Hook:beforeGenerate
│
▼
[Template Engine]
│
▼
Processor:preProcess
│
▼
[Content Generation]
│
▼
Processor:postProcess
│
▼
Validator:validate
│
▼
Formatter:format
│
▼
Integration:export
│
▼
Hook:afterGenerate → [Output]
interface PluginOptions {
projectName: string;
scope: 'mvp' | 'standard' | 'comprehensive';
audience: 'business' | 'technical' | 'mixed';
outputDir: string;
metadata: Record<string, unknown>;
}interface PluginResult {
content: string;
format: string;
metadata?: Record<string, unknown>;
warnings?: string[];
}Community plugins can be published to npm with the naming convention:
blueprint-plugin-{name}
Example: blueprint-plugin-pdf-export