Skip to main content

Package a Plugin

Bundle related primitives into a distributable plugin with marketplace metadata, validation, and CI/CD publishing.

Prerequisitesโ€‹

  • Node.js 22+
  • FrootAI repo cloned
  • Existing primitives to bundle

Step 1: Create the Plugin Folderโ€‹

mkdir -p plugins/document-intelligence
plugins/document-intelligence/
โ”œโ”€โ”€ plugin.json # Required โ€” plugin manifest
โ”œโ”€โ”€ README.md # Required โ€” documentation
โ”œโ”€โ”€ CHANGELOG.md # Recommended โ€” version history
โ””โ”€โ”€ assets/ # Optional โ€” icons

Step 2: Create plugin.jsonโ€‹

plugins/document-intelligence/plugin.json
{
"name": "document-intelligence",
"description": "End-to-end document processing with Azure AI Document Intelligence, OCR, and PII detection.",
"version": "1.0.0",
"author": {
"name": "FrootAI Contributors",
"url": "https://frootai.dev"
},
"license": "MIT",
"keywords": ["document-intelligence", "ocr", "extraction", "pii-detection"],
"agents": [
"../../agents/fai-document-processor.agent.md",
"../../agents/fai-extraction-reviewer.agent.md"
],
"instructions": [
"../../instructions/python-waf.instructions.md"
],
"skills": [
"../../skills/fai-document-indexer/"
],
"hooks": [
"../../hooks/fai-pii-redactor/"
],
"plays": ["06", "15"]
}

Step 3: Required Fieldsโ€‹

FieldTypeRules
namestringLowercase-hyphen, 3โ€“64 chars, must match folder
descriptionstring10โ€“500 characters
versionstringSemver: MAJOR.MINOR.PATCH
author.namestringRequired
licensestringSPDX identifier (MIT, Apache-2.0)

Step 4: Write the READMEโ€‹

plugins/document-intelligence/README.md
# Document Intelligence Plugin

End-to-end document processing for enterprise workloads.

## What's Included
| Primitive | Name | Purpose |
|-----------|------|---------|
| Agent | fai-document-processor | Multi-format document ingestion |
| Agent | fai-extraction-reviewer | Validates extracted data |
| Instruction | python-waf | WAF-aligned Python patterns |
| Skill | fai-document-indexer | Index documents into AI Search |
| Hook | fai-pii-redactor | Redact PII before storage |

Step 5: Validateโ€‹

npm run validate:primitives

Fix common errors:

ErrorFix
name must match patternUse only lowercase, numbers, hyphens
description too shortWrite at least 10 characters
author.name is requiredAdd "author": { "name": "..." }
agents[0] path not foundEnsure referenced file exists

Step 6: Regenerate Marketplaceโ€‹

node scripts/generate-marketplace.js

# Verify
node -e "
const m = require('./marketplace.json');
const p = m.plugins.find(p => p.name === 'document-intelligence');
console.log(p ? 'โœ… Found: ' + p.name : 'โŒ Not found');
"

Step 7: Versioningโ€‹

Change TypeBumpExample
Bug fix in agent promptPATCH1.0.0 โ†’ 1.0.1
Add new instructionMINOR1.0.1 โ†’ 1.1.0
Remove agent or rename pathsMAJOR1.1.0 โ†’ 2.0.0

Step 8: Reference in a Playโ€‹

fai-manifest.json
{
"primitives": {
"plugins": ["../../plugins/document-intelligence/"]
}
}

Best Practicesโ€‹

  1. One plugin per domain โ€” bundle related primitives, not everything
  2. Always include a README โ€” the marketplace displays it as the detail page
  3. Reference real primitives โ€” broken paths fail validation
  4. Version on every change โ€” never ship without bumping
  5. Keep CHANGELOG updated โ€” consumers need to know what changed

See Alsoโ€‹