2026-01-03 12:22:14 +08:00
---
description: OpenWebUI Plugin Development & Release Workflow
---
# OpenWebUI Plugin Development Workflow
2026-02-10 14:55:16 +08:00
This workflow outlines the standard process for developing, documenting, and releasing plugins for OpenWebUI. **Crucially, the default goal of this workflow is "Preparation" (updating all relevant files) rather than automatic "Submission" (git commit/push), unless a release is explicitly requested. **
2026-01-03 12:22:14 +08:00
## 1. Development Standards
Reference: `.github/copilot-instructions.md`
### Bilingual Requirement
2026-02-07 12:38:46 +08:00
2026-02-21 17:50:44 +08:00
Every plugin **MUST ** have a single internationalized code file and bilingual documentation:
2026-01-03 12:22:14 +08:00
2026-02-21 17:50:44 +08:00
- **Code (i18n)**:
- `plugins/{type}/{name}/{name}.py`
- The single `.py` file must implement internal i18n (e.g., using `navigator.language` or backend headers) to support multiple languages natively, rather than splitting into separate files.
2026-01-03 12:22:14 +08:00
- **README**:
- English: `plugins/{type}/{name}/README.md`
- Chinese: `plugins/{type}/{name}/README_CN.md`
### Code Structure
2026-02-07 12:38:46 +08:00
2026-01-03 12:22:14 +08:00
- **Docstring**: Must include `title` , `author` , `version` , `description` , etc.
- **Valves**: Use `pydantic` for configuration.
- **Database**: Re-use `open_webui.internal.db` shared connection.
- **User Context**: Use `_get_user_context` helper method.
2026-01-13 23:17:49 +08:00
- **Chat Context**: Use `_get_chat_context` helper method for `chat_id` and `message_id` .
- **Debugging**: Use `_emit_debug_log` for frontend console logging (requires `SHOW_DEBUG_LOG` valve).
2026-01-06 21:35:27 +08:00
- **Chat API**: For message updates, follow the "OpenWebUI Chat API 更新规范" in `.github/copilot-instructions.md` .
- Use Event API for immediate UI updates
- Use Chat Persistence API for database storage
- Always update both `messages[]` and `history.messages`
2026-01-03 12:22:14 +08:00
2026-02-07 12:38:46 +08:00
### Commit Messages & Release Notes
- **Language**: **English ONLY ** . Do not use Chinese in commit messages or release notes.
2026-01-03 12:22:14 +08:00
- **Format**: Conventional Commits (e.g., `feat:` , `fix:` , `docs:` ).
## 2. Documentation Updates
When adding or updating a plugin, you **MUST ** update the following documentation files to maintain consistency:
### Plugin Directory
2026-02-07 12:38:46 +08:00
2026-02-09 19:45:23 +08:00
- `README.md` : Update version, description, and usage.
2026-02-10 16:20:47 +08:00
- **Key Capabilities**: **MUST ** include ALL core functionalities and features. This is a cumulative section. Every release **MUST ** verify that basic core descriptions are NOT lost or overwritten by new feature lists.
2026-02-09 19:45:23 +08:00
- **What's New**: Explicitly describe only the latest changes/updates in a prominent position at the beginning. This section is dynamic and changes with versions.
- `README_CN.md` : Update version, description, and usage.
2026-02-10 16:20:47 +08:00
- **核心功能 (Key Capabilities)**: **必须**包含所有核心功能和特性。这是一个累积性的部分,每次版本更新**必须**确认基础核心功能的描述没有丢失或被新功能列表覆盖。
2026-02-09 19:45:23 +08:00
- **最新更新 (What's New)**: 在开头显眼位置明确描述最新的更改/更新。此部分是动态的,随版本变化。
2026-01-03 12:22:14 +08:00
### Global Documentation (`docs/`)
2026-02-07 12:38:46 +08:00
2026-01-03 12:22:14 +08:00
- **Index Pages**:
- `docs/plugins/{type}/index.md` : Add/Update list item with **correct version ** .
- `docs/plugins/{type}/index.zh.md` : Add/Update list item with **correct version ** .
- **Detail Pages**:
- `docs/plugins/{type}/{name}.md` : Ensure content matches README.
- `docs/plugins/{type}/{name}.zh.md` : Ensure content matches README_CN.
### Root README
2026-02-07 12:38:46 +08:00
2026-01-03 12:22:14 +08:00
- `README.md` : Add to "Featured Plugins" if applicable.
- `README_CN.md` : Add to "Featured Plugins" if applicable.
## 3. Version Control & Release
Reference: `.github/workflows/release.yml`
### Version Bumping
2026-02-07 12:38:46 +08:00
2026-01-03 17:57:27 +08:00
- **Rule**: Version bump is required **ONLY when the user explicitly requests a release ** . Regular code changes do NOT require version bumps.
2026-01-03 12:22:14 +08:00
- **Format**: Semantic Versioning (e.g., `1.0.0` -> `1.0.1` ).
2026-01-03 17:57:27 +08:00
- **When to Bump**: Only update the version when:
- User says "发布" / "release" / "bump version"
- User explicitly asks to prepare for release
2026-02-10 14:55:16 +08:00
- **Agent Initiative**: After completing significant changes (new features, bug fixes, or multiple code modifications), the agent **SHOULD proactively ask ** the user if they want to **prepare a new version ** for release.
- **Release Information Compliance**: When a release is requested, the agent must generate a standard release summary (English commit title + bilingual bullet points) as defined in Section 3 & 5.
- **Default Action (Prepare Only)**: When performing a version bump or update, the agent should update all files locally but **STOP ** before committing. Present the changes and the **proposed Release/Commit Message ** to the user and wait for explicit confirmation to commit/push.
2026-01-03 17:57:27 +08:00
- **Consistency**: When bumping, update version in **ALL ** locations:
2026-02-21 17:50:44 +08:00
1. Code (`.py` )
2. English README (`README.md` )
3. Chinese README (`README_CN.md` )
4. Docs Index (`docs/.../index.md` )
5. Docs Index CN (`docs/.../index.zh.md` )
6. Docs Detail (`docs/.../{name}.md` )
7. Docs Detail CN (`docs/.../{name}.zh.md` )
2026-01-03 12:22:14 +08:00
### Automated Release Process
2026-02-07 12:38:46 +08:00
1. **Trigger ** : Push to `main` branch with changes in `plugins/**/*.py` .
2. **Detection ** : `scripts/extract_plugin_versions.py` detects changed plugins and compares versions.
3. **Release ** :
2026-01-03 12:22:14 +08:00
- Generates release notes based on changes.
- Creates a GitHub Release tag (e.g., `v2024.01.01-1` ).
- Uploads individual `.py` files of **changed plugins only ** as assets.
2026-02-07 12:38:46 +08:00
4. **Market Publishing ** :
2026-01-08 00:13:23 +08:00
- Workflow: `.github/workflows/publish_plugin.yml`
- Trigger: Release published.
- Action: Automatically updates the plugin code and metadata on OpenWebUI.com using `scripts/publish_plugin.py` .
2026-01-13 23:17:49 +08:00
- **Auto-Sync**: If a local plugin has no ID but matches an existing published plugin by **Title ** , the script will automatically fetch the ID, update the local file, and proceed with the update.
2026-01-08 00:13:23 +08:00
- Requirement: `OPENWEBUI_API_KEY` secret must be set.
2026-01-20 20:35:06 +08:00
- **README Link**: When announcing a release, always include the GitHub README URL for the plugin:
2026-02-13 11:10:48 +08:00
- Format: `https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/{type}/{name}/README.md`
- Example: `https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/filters/folder-memory/README.md`
2026-01-03 12:22:14 +08:00
2026-02-10 14:55:16 +08:00
### Release Content Standard
When the user confirms a release, the agent **MUST ** follow these content standards:
1. **Commit Message ** :
- **Language**: English ONLY.
- **Format**: `type(scope): description` (e.g., `feat(pipes): add streaming support for Copilot SDK` ).
- **Body**: List 1-3 key changes in bullet points.
2. **Release Summary (for user review) ** :
- Before committing, present a "Release Draft" containing:
- **Title**: e.g., `Release v0.1.1: [Plugin Name] - [Brief Summary]`
2026-02-10 16:20:47 +08:00
- **Changelog**: English-only list of commits since the last release, including hashes (e.g., `896de02 docs(config): reorder antigravity model alias example` ).
2026-02-21 17:50:44 +08:00
- **Verification Status**: Confirm all 7+ files have been updated and synced.
2026-02-10 14:55:16 +08:00
3. **Internal Documentation ** : Ensure "What's New" sections in READMEs and `docs/` match exactly the changes being released.
2026-01-03 12:22:14 +08:00
### Pull Request Check
2026-02-07 12:38:46 +08:00
2026-01-03 12:22:14 +08:00
- Workflow: `.github/workflows/plugin-version-check.yml`
- Checks if plugin files are modified.
- **Fails** if version number is not updated.
- **Fails** if PR description is too short (< 20 chars).
## 4. Verification Checklist
Before committing:
2026-02-21 17:50:44 +08:00
- [ ] Code is internal i18n supported (`.py` ) and fully functional?
2026-01-03 12:22:14 +08:00
- [ ] Docstrings have updated version?
- [ ] READMEs are updated and bilingual?
2026-02-10 16:20:47 +08:00
- [ ] **Key Capabilities ** in READMEs still cover all legacy core features + new features?
2026-01-03 12:22:14 +08:00
- [ ] `docs/` index and detail pages are updated?
- [ ] Root `README.md` is updated?
- [ ] All version numbers match exactly?
2026-03-07 04:30:15 +08:00
- [ ] Any non-obvious findings saved to `.agent/learnings/{topic}.md` ?
2026-01-03 13:21:31 +08:00
## 5. Git Operations (Agent Rules)
2026-02-10 14:55:16 +08:00
1. **Prepare-on-Demand ** : Focus on file modifications and local verification first.
2. **No Auto-Commit ** : Never `git commit` , `git push` , or `create_pull_request` automatically after file updates unless the user explicitly says "commit this" or "release now".
3. **Draft Mode ** : If available, use PRs as drafts first.
4. **Reference ** : Strictly follow the rules defined in `.github/copilot-instructions.md` → **Git Operations (Agent Rules) ** section.
2026-03-07 04:30:15 +08:00
## 6. Knowledge Capture (Mandatory)
Whenever you discover a non-obvious behaviour, internal API contract, or workaround
during plugin development, **document it in `.agent/learnings/{topic}.md` ** before
ending the session.
- Browse `.agent/learnings/` **first ** at the start of a session to reuse existing knowledge.
- Format: see `.agent/learnings/README.md` .