openprototype 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -19
- package/README.zh-CN.md +30 -19
- package/image/README/core-loop.gif +0 -0
- package/package.json +8 -3
- package/scripts/check/smoke-test.js +10 -2
package/README.md
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h1>OpenPrototype</h1>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p><strong>English</strong> | <a href="README.zh-CN.md">简体中文</a></p>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<h2>Keep PRDs, HTML prototypes, and mock data in sync while AI edits them.</h2>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<p>OpenPrototype is a local workbench for technical PMs and small product teams. It gives the Agent the current page and its PRD, applies only the requirement delta you marked, and checks the result before review.</p>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
<p>
|
|
12
|
+
<img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license">
|
|
13
|
+
<img src="https://img.shields.io/badge/node_core-%3E%3D16-brightgreen" alt="Node.js 16 or later">
|
|
14
|
+
<img src="https://img.shields.io/badge/PRs-welcome-orange" alt="Pull requests welcome">
|
|
15
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey" alt="macOS, Windows and Linux">
|
|
16
|
+
</p>
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="image/README/core-loop.gif" alt="Mark a PRD change, apply only the delta, keep the prototype and mock data aligned, then verify with guardrails" width="100%">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://lightdoodleh.github.io/OpenPrototype/"><strong>Try the read-only demo</strong></a>
|
|
26
|
+
·
|
|
27
|
+
<a href="https://github.com/lightdoodleh/OpenPrototype/issues">Share feedback</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx openprototype create myapp
|
|
32
|
+
cd myapp
|
|
33
|
+
npm install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**The loop:** mark the PRD change → let the Agent update the relevant files → preview the real interaction → run the guardrail checks.
|
|
26
37
|
|
|
27
38
|
|
|
28
39
|
## Why it exists
|
|
@@ -33,13 +44,13 @@ The recurring pain points when a PM builds prototypes:
|
|
|
33
44
|
- **AI can write code, but doesn't know your rules** — hand a prototype to a general-purpose AI and it rewrites whole pages, names things inconsistently, hardcodes status labels, and breaks existing interactions.
|
|
34
45
|
- **Pages are scattered at review time** — dozens of prototype pages with no unified entry point; you find pages and track versions from memory.
|
|
35
46
|
|
|
36
|
-
`openprototype` folds these three things into **one
|
|
47
|
+
`openprototype` folds these three things into **one controlled loop**:
|
|
37
48
|
|
|
38
49
|
1. **PRD (`.md`) and prototype (`.html`) sit side by side in the same directory** — browse in one place, keep them aligned in one place.
|
|
39
50
|
2. **The AI Agent on the right automatically carries "current page + current PRD" context.** Say "change field X to XX" and it edits only the relevant part instead of rewriting the whole page; it can also pick up the **red-marked** incremental changes in the PRD and land them precisely.
|
|
40
51
|
3. **A built-in red-line checker** covers script order, the data layer, status constants, the font stack, and `mode=view` physical hiding. The companion `auto-test` skill tells the Agent to run it after prototype edits.
|
|
41
52
|
|
|
42
|
-
> In one sentence: **
|
|
53
|
+
> In one sentence: **AI can move fast without letting the PRD, prototype, and mock data drift apart.**
|
|
43
54
|
|
|
44
55
|
---
|
|
45
56
|
|
|
@@ -59,7 +70,7 @@ The recurring pain points when a PM builds prototypes:
|
|
|
59
70
|
## 🎯 Who it's for / Use cases
|
|
60
71
|
|
|
61
72
|
**A good fit for**
|
|
62
|
-
- **B2B / back-office product managers**:
|
|
73
|
+
- **Technical B2B / back-office product managers**: already use AI coding tools and need interactive prototypes without letting requirements and pages drift apart.
|
|
63
74
|
- **Small teams / solo developers**: want AI to speed up prototype iteration without letting it rewrite things randomly or drift in style.
|
|
64
75
|
- **Teams that want to codify their standards**: put your own PRD templates and UI guidelines into `rules/` and have the AI produce work to your standard.
|
|
65
76
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h1>OpenPrototype</h1>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p><a href="README.md">English</a> | <strong>简体中文</strong></p>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<h2>AI 改需求时,让 PRD、HTML 原型和 mock 数据始终一致。</h2>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<p>OpenPrototype 是面向技术型产品经理和小型产品团队的本地工作台。它把当前页面和对应 PRD 自动交给 Agent,只执行你标出的需求增量,并在评审前检查结果。</p>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
<p>
|
|
12
|
+
<img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT 许可证">
|
|
13
|
+
<img src="https://img.shields.io/badge/node_core-%3E%3D16-brightgreen" alt="Node.js 16 或更高版本">
|
|
14
|
+
<img src="https://img.shields.io/badge/PRs-welcome-orange" alt="欢迎提交 Pull Request">
|
|
15
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey" alt="macOS、Windows 与 Linux">
|
|
16
|
+
</p>
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="image/README/core-loop.gif" alt="标出 PRD 增量、精准更新相关文件、同步原型与 mock 数据并通过红线检查" width="100%">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://lightdoodleh.github.io/OpenPrototype/"><strong>在线体验只读 Demo</strong></a>
|
|
26
|
+
·
|
|
27
|
+
<a href="https://github.com/lightdoodleh/OpenPrototype/issues">提交反馈</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx openprototype create myapp
|
|
32
|
+
cd myapp
|
|
33
|
+
npm install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**核心闭环:**标出 PRD 增量 → Agent 更新相关文件 → 预览真实交互 → 运行红线检查。
|
|
26
37
|
|
|
27
38
|
|
|
28
39
|
## 为什么要有它
|
|
@@ -33,13 +44,13 @@
|
|
|
33
44
|
- **AI 会写代码,但不懂你的规矩** —— 直接让通用 AI 改原型,它会整页重写、命名混乱、把状态文案写死、破坏既有交互。
|
|
34
45
|
- **评审时页面散落各处** —— 几十个原型页没有统一入口,找页面、对版本靠记忆。
|
|
35
46
|
|
|
36
|
-
`openprototype`
|
|
47
|
+
`openprototype` 把这三件事收进**一个受控闭环**:
|
|
37
48
|
|
|
38
49
|
1. **PRD(`.md`)和原型(`.html`)同目录并排放**,一处浏览、一处对齐。
|
|
39
50
|
2. **右侧 AI Agent 自动携带「当前页面 + 当前 PRD」上下文**,你说"把某字段改成 XX",它只改相关部分、不整页重写;还能识别 PRD 里**标红**的增量改动精准落地。
|
|
40
51
|
3. **内置红线检查器**覆盖脚本顺序、数据层、状态常量化、字体栈与 `mode=view` 物理隐藏;配套 `auto-test` skill 会要求 Agent 在改完原型后执行检查。
|
|
41
52
|
|
|
42
|
-
>
|
|
53
|
+
> 一句话:**让 AI 快速改原型,同时不让 PRD、页面和 mock 数据互相漂移。**
|
|
43
54
|
|
|
44
55
|
---
|
|
45
56
|
|
|
@@ -59,7 +70,7 @@
|
|
|
59
70
|
## 🎯 适合谁 / 使用场景
|
|
60
71
|
|
|
61
72
|
**适合**
|
|
62
|
-
-
|
|
73
|
+
- **会使用 AI 编码工具的 B 端 / 中后台产品经理**:需要快速做可交互原型,又不希望需求、页面和数据越改越散。
|
|
63
74
|
- **小团队 / 独立开发**:想用 AI 加速原型迭代,又不希望 AI 每次乱改、风格漂移。
|
|
64
75
|
- **需要沉淀规范的团队**:把自己的 PRD 模板、UI 规范放进 `rules/`,让 AI 按你的标准产出。
|
|
65
76
|
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openprototype",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "本地原型工作台:左侧树形导航 + 中间原型预览 + 右侧 AI Agent(OpenCode)。PRD 与 HTML/JS 原型协作,含自动化检查。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prototype",
|
|
7
|
+
"ai-prototyping",
|
|
7
8
|
"prd",
|
|
9
|
+
"product-management",
|
|
10
|
+
"html-prototype",
|
|
11
|
+
"local-first",
|
|
8
12
|
"opencode",
|
|
9
13
|
"agent",
|
|
10
14
|
"scaffold",
|
|
@@ -16,7 +20,7 @@
|
|
|
16
20
|
"type": "git",
|
|
17
21
|
"url": "git+https://github.com/lightdoodleh/openprototype.git"
|
|
18
22
|
},
|
|
19
|
-
"homepage": "https://github.
|
|
23
|
+
"homepage": "https://lightdoodleh.github.io/OpenPrototype/",
|
|
20
24
|
"bugs": "https://github.com/lightdoodleh/openprototype/issues",
|
|
21
25
|
"engines": {
|
|
22
26
|
"node": ">=16"
|
|
@@ -48,7 +52,8 @@
|
|
|
48
52
|
"proto-kit.config.json",
|
|
49
53
|
"AGENTS.md",
|
|
50
54
|
"CONVENTIONS.md",
|
|
51
|
-
"README.md"
|
|
55
|
+
"README.md",
|
|
56
|
+
"image/README/core-loop.gif"
|
|
52
57
|
],
|
|
53
58
|
"devDependencies": {
|
|
54
59
|
"playwright": "^1.49.0"
|
|
@@ -35,8 +35,16 @@ let chromium;
|
|
|
35
35
|
try {
|
|
36
36
|
({ chromium } = require('playwright'));
|
|
37
37
|
} catch {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const result = {
|
|
39
|
+
scanned: 0,
|
|
40
|
+
errors: [],
|
|
41
|
+
warns: [{ file: '-', rule: '环境', msg: 'Playwright 未安装,已跳过运行时层;安装:npm i -D playwright && npx playwright install chromium' }]
|
|
42
|
+
};
|
|
43
|
+
if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
|
|
44
|
+
else {
|
|
45
|
+
console.error('\n⚠️ 未安装 Playwright,跳过运行时冒烟测试。');
|
|
46
|
+
console.error(' 安装:npm i -D playwright && npx playwright install chromium\n');
|
|
47
|
+
}
|
|
40
48
|
process.exit(0);
|
|
41
49
|
}
|
|
42
50
|
|