diff --git a/.agent/workflows/plugin-development.md b/.agent/workflows/plugin-development.md new file mode 100644 index 0000000..1855905 --- /dev/null +++ b/.agent/workflows/plugin-development.md @@ -0,0 +1,93 @@ +--- +description: OpenWebUI Plugin Development & Release Workflow +--- + +# OpenWebUI Plugin Development Workflow + +This workflow outlines the standard process for developing, documenting, and releasing plugins for OpenWebUI, ensuring compliance with project standards and CI/CD requirements. + +## 1. Development Standards + +Reference: `.github/copilot-instructions.md` + +### Bilingual Requirement +Every plugin **MUST** have bilingual versions for both code and documentation: + +- **Code**: + - English: `plugins/{type}/{name}/{name}.py` + - Chinese: `plugins/{type}/{name}/{name_cn}.py` (or `中文名.py`) +- **README**: + - English: `plugins/{type}/{name}/README.md` + - Chinese: `plugins/{type}/{name}/README_CN.md` + +### Code Structure +- **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. + +### Commit Messages +- **Language**: **English ONLY**. Do not use Chinese in commit messages. +- **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 +- `README.md`: Update version, description, and usage. +- `README_CN.md`: Update version, description, and usage. + +### Global Documentation (`docs/`) +- **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 +- `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 +- **Rule**: Any change to plugin logic **MUST** be accompanied by a version bump in the docstring. +- **Format**: Semantic Versioning (e.g., `1.0.0` -> `1.0.1`). +- **Consistency**: Update version in **ALL** locations: + 1. English Code (`.py`) + 2. Chinese Code (`.py`) + 3. English README (`README.md`) + 4. Chinese README (`README_CN.md`) + 5. Docs Index (`docs/.../index.md`) + 6. Docs Index CN (`docs/.../index.zh.md`) + 7. Docs Detail (`docs/.../{name}.md`) + 8. Docs Detail CN (`docs/.../{name}.zh.md`) + +### Automated Release Process +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**: + - 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. + +### Pull Request Check +- 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: + +- [ ] Code is bilingual and functional? +- [ ] Docstrings have updated version? +- [ ] READMEs are updated and bilingual? +- [ ] `docs/` index and detail pages are updated? +- [ ] Root `README.md` is updated? +- [ ] All version numbers match exactly? diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 98f949d..f23d151 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -953,3 +953,32 @@ GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui) ## License MIT License + +--- + +## 📝 Commit Message Guidelines + +**Commit messages MUST be in English.** Do not use Chinese. + +### Format +Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: + +- `feat`: New feature +- `fix`: Bug fix +- `docs`: Documentation only changes +- `style`: Changes that do not affect the meaning of the code (white-space, formatting, etc) +- `refactor`: A code change that neither fixes a bug nor adds a feature +- `perf`: A code change that improves performance +- `test`: Adding missing tests or correcting existing tests +- `chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation + +### Examples + +✅ **Good:** +- `feat: add new export to pdf plugin` +- `fix: resolve icon rendering issue in documentation` +- `docs: update README with installation steps` + +❌ **Bad:** +- `新增导出PDF插件` (Chinese is not allowed) +- `update code` (Too vague) diff --git a/docs/plugins/actions/index.md b/docs/plugins/actions/index.md index 31ed4e4..d934d7d 100644 --- a/docs/plugins/actions/index.md +++ b/docs/plugins/actions/index.md @@ -33,7 +33,7 @@ Actions are interactive plugins that: Transform text into professional infographics using AntV visualization engine with various templates. - **Version:** 1.0.0 + **Version:** 1.3.0 [:octicons-arrow-right-24: Documentation](smart-infographic.md) @@ -43,7 +43,7 @@ Actions are interactive plugins that: Quickly generates beautiful learning memory cards, perfect for studying and memorization. - **Version:** 0.2.0 + **Version:** 0.2.2 [:octicons-arrow-right-24: Documentation](knowledge-card.md) @@ -53,7 +53,7 @@ Actions are interactive plugins that: Export chat conversations to Excel spreadsheet format for analysis and archiving. - **Version:** 1.0.0 + **Version:** 0.3.3 [:octicons-arrow-right-24: Documentation](export-to-excel.md) @@ -73,7 +73,7 @@ Actions are interactive plugins that: Generate concise summaries of long text content with key points extraction. - **Version:** 1.0.0 + **Version:** 0.1.0 [:octicons-arrow-right-24: Documentation](summary.md) diff --git a/docs/plugins/actions/index.zh.md b/docs/plugins/actions/index.zh.md index 969d575..1faaaf3 100644 --- a/docs/plugins/actions/index.zh.md +++ b/docs/plugins/actions/index.zh.md @@ -33,7 +33,7 @@ Actions 是交互式插件,能够: 使用 AntV 可视化引擎,将文本转成专业的信息图。 - **版本:** 1.0.0 + **版本:** 1.3.0 [:octicons-arrow-right-24: 查看文档](smart-infographic.md) @@ -43,7 +43,7 @@ Actions 是交互式插件,能够: 快速生成精美的学习记忆卡片,适合学习与记忆。 - **版本:** 0.2.0 + **版本:** 0.2.2 [:octicons-arrow-right-24: 查看文档](knowledge-card.md) @@ -53,7 +53,7 @@ Actions 是交互式插件,能够: 将聊天记录导出为 Excel 电子表格,方便分析或归档。 - **版本:** 1.0.0 + **版本:** 0.3.3 [:octicons-arrow-right-24: 查看文档](export-to-excel.md) @@ -73,7 +73,7 @@ Actions 是交互式插件,能够: 对长文本进行精简总结,提取要点。 - **版本:** 1.0.0 + **版本:** 0.1.0 [:octicons-arrow-right-24: 查看文档](summary.md) diff --git a/docs/plugins/filters/context-enhancement.md b/docs/plugins/filters/context-enhancement.md index e5dcdee..3da34d3 100644 --- a/docs/plugins/filters/context-enhancement.md +++ b/docs/plugins/filters/context-enhancement.md @@ -1,7 +1,7 @@ # Context Enhancement Filter -v1.0.0 +v0.2 Enhances chat context with additional information for improved LLM responses. diff --git a/docs/plugins/filters/context-enhancement.zh.md b/docs/plugins/filters/context-enhancement.zh.md index 4ee62c9..0832bae 100644 --- a/docs/plugins/filters/context-enhancement.zh.md +++ b/docs/plugins/filters/context-enhancement.zh.md @@ -1,7 +1,7 @@ # Context Enhancement(上下文增强) Filter -v1.0.0 +v0.2 为聊天自动补充上下文信息,让 LLM 回复更相关、更准确。 diff --git a/docs/plugins/filters/gemini-manifold-companion.md b/docs/plugins/filters/gemini-manifold-companion.md index baaa750..387901c 100644 --- a/docs/plugins/filters/gemini-manifold-companion.md +++ b/docs/plugins/filters/gemini-manifold-companion.md @@ -1,7 +1,7 @@ # Gemini Manifold Companion Filter -v1.0.0 +v0.3.2 Companion filter for the Gemini Manifold pipe plugin, providing enhanced functionality. diff --git a/docs/plugins/filters/gemini-manifold-companion.zh.md b/docs/plugins/filters/gemini-manifold-companion.zh.md index cc10a6e..11c1dba 100644 --- a/docs/plugins/filters/gemini-manifold-companion.zh.md +++ b/docs/plugins/filters/gemini-manifold-companion.zh.md @@ -1,7 +1,7 @@ # Gemini Manifold Companion Filter -v1.0.0 +v0.3.2 Gemini Manifold Pipe 的伴随过滤器,用于增强 Gemini 集成的处理效果。 diff --git a/docs/plugins/filters/index.md b/docs/plugins/filters/index.md index 45c4239..5b5c98c 100644 --- a/docs/plugins/filters/index.md +++ b/docs/plugins/filters/index.md @@ -32,7 +32,7 @@ Filters act as middleware in the message pipeline: Enhances chat context with additional information for better responses. - **Version:** 1.0.0 + **Version:** 0.2 [:octicons-arrow-right-24: Documentation](context-enhancement.md) @@ -42,7 +42,7 @@ Filters act as middleware in the message pipeline: Companion filter for the Gemini Manifold pipe plugin. - **Version:** 1.0.0 + **Version:** 0.3.2 [:octicons-arrow-right-24: Documentation](gemini-manifold-companion.md) diff --git a/docs/plugins/filters/index.zh.md b/docs/plugins/filters/index.zh.md index 03373be..c68db29 100644 --- a/docs/plugins/filters/index.zh.md +++ b/docs/plugins/filters/index.zh.md @@ -32,7 +32,7 @@ Filter 充当消息管线中的中间件: 为聊天增加额外信息,提升回复质量。 - **版本:** 1.0.0 + **版本:** 0.2 [:octicons-arrow-right-24: 查看文档](context-enhancement.md) @@ -42,7 +42,7 @@ Filter 充当消息管线中的中间件: Gemini Manifold Pipe 插件的伴随过滤器。 - **版本:** 1.0.0 + **版本:** 0.3.2 [:octicons-arrow-right-24: 查看文档](gemini-manifold-companion.md)