Skip to content

Commit 22fbf79

Browse files
committed
feat: initial release of OpenPM chrome extension
0 parents  commit 22fbf79

25 files changed

Lines changed: 2624 additions & 0 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
*.log
3+
node_modules/

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
## 0.2.0
4+
5+
- 插件主入口升级为 Chrome Side Panel
6+
- 新增设置页(Provider/模型/API Key)
7+
- 新增多轮流式对话与停止回复
8+
- 新增多会话管理(新建/切换/自动命名)
9+
- 新增消息级操作(复制、编辑重问、代码块复制)
10+
- 新增回复耗时与 Token 统计
11+
- 优化 Markdown 渲染(列表、表格、代码块、引用等)
12+
- 优化 UI 布局与初始化体验
13+
- 下载 PRD 支持自动文件名

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# 贡献指南
2+
3+
感谢你愿意为 OpenPM 贡献代码。
4+
5+
## 如何参与
6+
7+
1. 先提 Issue(Bug/功能建议均可)
8+
2. Fork 仓库并新建分支(建议前缀:`feat/``fix/`
9+
3. 提交 PR,描述变更背景、实现方式和测试结果
10+
11+
## 提交建议
12+
13+
- 提交粒度小、描述清晰
14+
- 不要混入无关格式化改动
15+
- 涉及 UI 的改动建议附截图
16+
17+
## 本地测试建议
18+
19+
-`chrome://extensions` 重新加载插件
20+
- 验证以下关键流程:
21+
- 输入需求生成
22+
- 页面读取生成
23+
- 选中文本生成
24+
- 流式输出与停止回复
25+
- 会话切换与下载命名
26+
27+
## 代码风格
28+
29+
- 尽量保持原有代码结构与命名风格
30+
- 优先可读性与可维护性
31+
32+
再次感谢你的贡献。

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 OpenPM
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# OpenPM
2+
3+
![OpenPM 封面](docs/images/openpm-cover.svg)
4+
5+
> Anywhere -> Generate PRD
6+
> 在任意网页,把需求快速生成为结构化 PRD(Markdown)。
7+
8+
## 为什么值得 Star
9+
10+
- 快:输入或读取网页内容,几秒内开始流式生成 PRD
11+
- 准:固定 PRD 结构,适配研发落地
12+
- 顺:多轮对话、可中断、可编辑重问
13+
- 实用:代码块复制、自动命名下载、多会话管理
14+
15+
## 功能亮点
16+
17+
- 需求来源:用户输入 / 当前页面 / 选中文本 / 右键菜单
18+
- AI 生成:OpenAI + GLM,模型下拉与自定义模型
19+
- 对话体验:流式输出、停止回复、历史会话、自动标题
20+
- 文档处理:Markdown 预览、复制消息、复制代码块、下载 `.md`
21+
- 可观测性:每条回复记录耗时与 token(接口返回或估算)
22+
23+
## 工作流
24+
25+
![OpenPM 工作流](docs/images/openpm-flow.svg)
26+
27+
## 30 秒上手
28+
29+
1. 打开 `chrome://extensions`
30+
2. 开启“开发者模式”
31+
3. 点击“加载已解压的扩展程序”并选择项目目录
32+
4. 打开插件设置页,填入 API Key 与模型
33+
5. 点击扩展图标,在侧边栏输入需求开始生成
34+
35+
## 使用场景
36+
37+
- 从 Notion/Jira/GitHub Issue 快速生成 PRD 初稿
38+
- 基于已写需求做多轮补充(API、数据结构、流程)
39+
- 产品评审前快速产出统一格式文档
40+
41+
## 支持模型(示例)
42+
43+
- OpenAI: `gpt-5.4``gpt-5.3-codex``gpt-5.2-codex`
44+
- GLM: `glm-5``glm-4.7``glm-4.7-flash`
45+
46+
> 注:实际可用模型以账号权限与服务商接口为准。
47+
48+
## 项目结构
49+
50+
```text
51+
openPM/
52+
├── manifest.json
53+
├── background.js
54+
├── sidepanel.html / sidepanel.css / sidepanel.js
55+
├── options.html / options.css / options.js
56+
├── docs/images/
57+
└── README.md
58+
```
59+
60+
## 权限说明
61+
62+
- `activeTab`:读取当前标签页内容
63+
- `scripting`:执行页面文本读取脚本
64+
- `storage`:保存配置与会话数据
65+
- `contextMenus`:右键生成 PRD
66+
- `sidePanel`:打开侧边栏
67+
68+
## 配置示例(`chrome.storage.local`
69+
70+
```json
71+
{
72+
"config": {
73+
"provider": "openai",
74+
"model": "gpt-5.4",
75+
"custom_model": "",
76+
"api_key": ""
77+
}
78+
}
79+
```
80+
81+
## 常见问题
82+
83+
1. 提示未配置 API Key
84+
- 去“设置”页保存后重试。
85+
86+
2. 某些网站读取不到页面内容
87+
- 改用“选中文本”或手动粘贴。
88+
89+
3. 中断后回复不完整
90+
- 属于预期;会保留已生成片段,可继续追问补齐。
91+
92+
## Roadmap
93+
94+
- V2:数据库设计、API 明细、流程图
95+
- V3:PRD -> 技术方案
96+
- V4:PRD -> 代码框架
97+
98+
## 贡献
99+
100+
欢迎提 Issue / PR,详见 [CONTRIBUTING.md](CONTRIBUTING.md)
101+
102+
## 开源协议
103+
104+
[MIT](LICENSE)

assets/icons/icon-128.png

16.2 KB
Loading

assets/icons/icon-16.png

1.31 KB
Loading

assets/icons/icon-32.png

2.63 KB
Loading

assets/icons/icon-48.png

4.16 KB
Loading

assets/icons/icon-512.png

189 KB
Loading

0 commit comments

Comments
 (0)