The plugin factory has been shut down and this repository is now archived.
We decided to stop the factory in favour of the external integrations built directly into Gladys Assistant, which give a better and more sustainable experience than AI-generated Matterbridge plugins.
What this means:
- The factory is no longer running: new issues are not processed, and existing requests will not be generated, fixed or published.
- Plugins that were already generated remain available in the repository branches and releases, as-is and unsupported.
- The code and documentation below are kept for reference / historical purposes only.
π If you want to connect a device or service to Gladys, use the built-in external integrations in Gladys instead.
This factory automates the creation of Matterbridge plugins that bring Matter compatibility to non-Matter smart home devices. Users submit plugin requests via GitHub Issues, and an AI agent (powered by Claude) analyzes existing integrations and generates working plugins.
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User creates ββββββΆβ VPS polls or ββββββΆβ Claude Code β
β GitHub Issue β β receives β β generates β
β with template β β webhook β β plugin code β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User tests & βββββββ Artifact ready βββββββ Build & pack β
β provides β β comment posted β β plugin β
β feedback β ββββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β AI revises if β
β needed β
βββββββββββββββββββ
β Not applicable anymore β the factory is stopped, plugin requests are no longer accepted or processed. The steps below are kept for reference.
- Go to Issues β New Issue β π Plugin Request
- Fill out the template with:
- Device/service name
- Links to existing integrations (Home Assistant, Node-RED, etc.) - REQUIRED
- Device capabilities you want
- API documentation links
- Submit and wait for the AI to process your request
- Download the generated plugin artifact and test it
- Provide feedback in the issue
- Clone to your Ubuntu VPS
- Run the setup script:
./scripts/setup-vps.sh
- Configure
.envwith your GitHub token - Authenticate Claude Code CLI with your Pro plan:
claude login
- Start the service (webhook) or enable cron (polling)
- Existing integrations provided - Links to Home Assistant, Node-RED, OpenHAB, or npm packages
- Clear API documentation - Official docs or well-documented community resources
- Specific capabilities - List exactly what features you need
- Standard protocols - HTTP/REST, WebSocket, MQTT, etc.
- Proprietary/undocumented protocols
- Devices requiring physical hardware modifications
- Services without existing open-source integrations
- Requests without reference implementations
| Label | Description |
|---|---|
plugin-request |
Initial request tag |
pending-review |
Waiting for AI processing |
in-progress |
AI is generating the plugin |
ready-for-testing |
Plugin artifact available |
needs-revision |
User reported issues |
needs-info |
Missing required information |
completed |
Successfully tested |
error |
Processing failed |
matterbridge-ai-plugin-factory/
βββ .github/
β βββ ISSUE_TEMPLATE/
β β βββ plugin-request.yml # Issue template
β β βββ config.yml # Template config
β βββ labels.yml # Label definitions
βββ prompts/
β βββ AGENT_SYSTEM_PROMPT.md # AI system instructions
β βββ ISSUE_PROCESSING_PROMPT.md # Issue parsing prompt
βββ scripts/
β βββ setup-labels.sh # Label setup script
β βββ setup-vps.sh # VPS setup script
βββ src/
β βββ index.js # Main entry point
β βββ process-issue.js # Issue processing
β βββ webhook-server.js # Webhook handler
βββ plugins/ # Generated plugins (gitignored)
βββ package.json
βββ .env.example
βββ README.md
| Variable | Description | Required |
|---|---|---|
GITHUB_TOKEN |
GitHub PAT with repo access | Yes |
GITHUB_REPO_OWNER |
Repository owner | Yes |
GITHUB_REPO_NAME |
Repository name | Yes |
PLUGINS_OUTPUT_DIR |
Directory for generated plugins | No |
ARTIFACTS_DIR |
Directory for build artifacts | No |
CLAUDE_MODEL |
Claude model to use (e.g. claude-opus-4-7) |
No |
WEBHOOK_SECRET |
GitHub webhook secret | For webhook mode |
WEBHOOK_PORT |
Webhook server port | For webhook mode |
TELEGRAM_BOT_TOKEN |
Telegram bot token (from @BotFather) | For notifications |
TELEGRAM_CHAT_ID |
Telegram chat ID to send messages to | For notifications |
Authenticate with your Claude Pro plan:
claude loginWhen an issue with plugin-request + pending-review labels is created:
- Validates required fields (existing integrations, capabilities)
- Posts acknowledgment comment
- Runs Claude Code CLI with system prompt
- Builds and packages the plugin
- Uploads artifact and posts download link
When users comment on ready-for-testing issues:
- Positive feedback β Labels as
completed - Negative feedback β Labels as
needs-revision, triggers revision workflow
Maintainers can comment /publish on completed issues to:
- Create a PR with the plugin code
- Add to the plugins collection
# Install dependencies
npm install
# Run webhook server
FACTORY_MODE=webhook node src/index.jsThe main entry point for manual operations is src/process-issue.js:
node src/process-issue.js [issue-number] [flags]| Flag | Description |
|---|---|
| (none) | Process all pending issues (no issue number) or fully generate the given issue |
--fix |
Read latest feedback comment on the issue, regenerate fix, rebuild and re-publish |
--resume |
Resume an interrupted Claude Code session for the issue (continue where left off) |
--publish-only |
Skip AI generation; rebuild & publish the existing local plugin for the issue |
--model <name> |
Override the Claude model (also supports --model=<name> and CLAUDE_MODEL env) |
# Process all new issues
node src/process-issue.js
# Fully generate plugin for issue #5
node src/process-issue.js 5
# Fix plugin for issue #5 based on latest feedback comment
node src/process-issue.js 5 --fix
# Resume interrupted Claude Code session for issue #5
node src/process-issue.js 5 --resume
# Rebuild & re-publish existing plugin for issue #5 (no AI)
node src/process-issue.js 5 --publish-only
# Use a specific Claude model
node src/process-issue.js 5 --model claude-opus-4-7
node src/process-issue.js 5 --fix --model=claude-opus-4-7
CLAUDE_MODEL=claude-opus-4-7 node src/process-issue.js 5src/process-batch.js is the smart orchestrator for processing many plugin requests within Claude's 5-hour usage window. Run it hourly via cron; each invocation:
- Processes as many issues as possible (fixes first, then new generations)
- Stops cleanly when the time budget is nearly exhausted
- Detects Claude credit/quota exhaustion and pauses the factory (issues are re-queued, not left stuck in
in-progress) - Resumes automatically when the pause expires or on the next cron tick
node src/process-batch.js
node src/process-batch.js --model claude-opus-4-7
node src/process-batch.js --dry-run # show next job without running
node src/process-batch.js --status # show pause state
node src/process-batch.js --clear-pauseTune via environment variables (see .env.example):
| Variable | Default | Purpose |
|---|---|---|
FACTORY_MAX_RUNTIME_MS |
4.5h | Max batch duration |
FACTORY_MIN_JOB_MS |
45min | Min time left to start another plugin |
FACTORY_MAX_PLUGINS |
6 | Max plugins per run |
FACTORY_PAUSE_DURATION_MS |
5h | Pause after credits exhausted |
Example crontab (see also scripts/crontab.example):
# Matterbridge AI Plugin Factory β batch schedule
# Log files: /home/matterbridge/logs/<job>-YYYY-MM-DD.log
0 * * * * cd /opt/matterbridge-factory && /usr/bin/node src/process-batch.js --model claude-opus-4-8 >> /home/matterbridge/logs/process-batch-$(date +\%Y-\%m-\%d).log 2>&1
This single job replaces separate process-next-issue.js (daily generation) and process-next-fix.js (hourly fixes) cron entries.
src/process-next-issue.js fetches the oldest open issue with labels plugin-request + pending-review and generates a single plugin, then exits. Perfect for a daily cron:
node src/process-next-issue.js
node src/process-next-issue.js --model claude-opus-4-7Example crontab (runs every day at 6:00 AM):
0 6 * * * cd /opt/matterbridge-factory && /usr/bin/node src/process-next-issue.js >> /var/log/matterbridge-factory.log 2>&1
src/process-next-fix.js finds the oldest issue labeled ready-for-testing whose latest comment is from a human (i.e. the user left feedback after the last bot reply) and runs --fix on it, then exits.
node src/process-next-fix.js
node src/process-next-fix.js --model claude-opus-4-7Example crontab (runs every day at 7:00 AM, one hour after new-issue generation):
0 7 * * * cd /opt/matterbridge-factory && /usr/bin/node src/process-next-fix.js >> /var/log/matterbridge-factory.log 2>&1
- Source code (
plugins/issue-N/<plugin-name>/withoutdist/,node_modules/,*.tgz) is committed to a branchplugin/issue-N-<plugin-name>, making it reviewable and mergeable. - Build artifact (
.tgz) is uploaded to a GitHub Release taggedplugin-issue-N. Re-running--fixor--publish-onlyreplaces the existing asset.
Update prompts/AGENT_SYSTEM_PROMPT.md with:
- New Matter device type mappings
- Cluster configurations
- Example implementations
- Matterbridge Documentation
- Matterbridge Plugin Template
- Matter.js
- Claude Code CLI
- Home Assistant Integrations
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE for details.
This is an experimental AI-powered tool. Generated plugins:
- May require manual adjustments
- Should be thoroughly tested before production use
- Are provided as-is without warranty
The AI adapts existing open-source integrations - always respect original licenses.