Skip to content

Commit bd8c159

Browse files
ruibin3claude
andcommitted
feat(v0.0.7): add import/export, pin notes, about modal, more menu
Features: - Add import/export functionality (JSON backup/restore) - Add pin/notes feature with orange theme - Add about modal with product info - Add footer more menu (export, import, feedback, github, about) - Add release automation system (release-it + scripts + skills) Fixes: - Fix navigation buttons to respect pinned note order Infrastructure: - Add .claude/skills/ for Claude Code skills - Add .github/workflows/release.yml for CI verification - Add scripts: sync-manifest, pre-release-check, generate-changelog, archive-package - Add docs/planning/release-automation/PLAN.md - Add docs/WHITEPAPER.md (project whitepaper) - Update WORKFLOW.md v2.0 with release automation Move right-click save feature to v0.0.8 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4708114 commit bd8c159

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+15520
-894
lines changed

.claude/skills/README.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Skills - 技能说明
2+
3+
本目录包含 SlideNote 项目的各种技能脚本,用于自动化常见的开发和发布任务。
4+
5+
## 可用技能
6+
7+
### 📦 Release - 发布技能
8+
9+
完整的发布和版本管理流程。
10+
11+
**技能文件:** `release.md`
12+
13+
**功能:**
14+
- 交互式版本升级(使用 release-it)
15+
- 自动构建和打包扩展
16+
- 生成更新日志(Changelog)
17+
- 维护版本历史
18+
- 创建 git tag 和 commit
19+
- 归档发布包
20+
21+
**使用方法:**
22+
23+
告诉 Claude "帮我发布新版本" 或 "执行 release 技能"
24+
25+
Claude 会自动执行以下步骤:
26+
1. 运行预发布检查 (`npm run release:check`)
27+
2. 使用 release-it 交互式升级版本
28+
3. 同步版本号到 manifest 文件
29+
4. 构建生产版本并打包
30+
5. 生成 CHANGELOG
31+
6. 创建 git commit 和 tag
32+
7. 归档发布包
33+
34+
**手动使用命令:**
35+
36+
```bash
37+
# 发布前检查
38+
npm run release:check
39+
40+
# 完整发布流程(交互式)
41+
npx release-it
42+
43+
# 同步版本号
44+
npm run version:sync
45+
46+
# 生成 CHANGELOG
47+
npm run changelog
48+
49+
# 归档发布包
50+
npm run archive
51+
```
52+
53+
### 🔢 Bump Version - 版本升级技能
54+
55+
智能分析代码变更,推荐并执行版本号升级。
56+
57+
**技能文件:** `bump-version.md`
58+
59+
**功能:**
60+
- 分析自上次发布以来的变更
61+
- 根据变更类型推荐版本升级(major/minor/patch)
62+
- 自动升级版本号
63+
- 同步到 manifest 文件
64+
65+
**使用方法:**
66+
67+
告诉 Claude "升级版本号"、"bump version" 或 "应该升级到什么版本"
68+
69+
**版本号规则:**
70+
71+
| 变更类型 | 版本升级 | 示例 |
72+
|---------|---------|------|
73+
| Breaking Changes | major | 0.0.7 → 1.0.0 |
74+
| 新功能 | minor | 0.0.7 → 0.1.0 |
75+
| Bug 修复 | patch | 0.0.7 → 0.0.8 |
76+
77+
### ✍️ Generate Post - 推广文案生成技能
78+
79+
根据版本更新内容自动生成多平台推广文案。
80+
81+
**技能文件:** `generate-post.md`
82+
83+
**功能:**
84+
- 生成 GitHub Release Notes
85+
- 生成公众号文章
86+
- 生成微博/推文文案
87+
- 生成 V2EX 社区帖子
88+
89+
**使用方法:**
90+
91+
告诉 Claude "生成推广文案"、"generate post" 或 "准备发布内容"
92+
93+
**输出内容:**
94+
95+
1. **GitHub Release Notes** - 结构化 Markdown 格式
96+
2. **公众号文章** - 中文博客格式,包含痛点引入和新功能介绍
97+
3. **微博/推文** - 简短有力的社媒文案
98+
4. **V2EX 帖子** - 技术社区风格
99+
100+
## 发布检查清单
101+
102+
使用 release 技能前,请确认:
103+
104+
- [ ] 所有更改已提交
105+
- [ ] 版本文档已准备(`docs/versions/v{version}/README.md`
106+
- [ ] 功能测试通过
107+
- [ ] Git 工作区干净
108+
109+
## Chrome Web Store 发布步骤
110+
111+
1. 访问 [Chrome Web Store Developer Dashboard](https://chrome.google.com/webstore/devconsole)
112+
113+
2. 选择 SlideNote 扩展
114+
115+
3. 上传 zip 包:
116+
```
117+
SlideNote-v{version}.zip
118+
```
119+
120+
4. 填写更新说明(使用 CHANGELOG.md 中的内容)
121+
122+
5. 提交审核
123+
124+
## 版本号规则
125+
126+
遵循语义化版本 (Semantic Versioning):
127+
128+
```
129+
MAJOR.MINOR.PATCH
130+
131+
例:0.0.7
132+
├─ MAJOR (0): 不兼容的 API 变更
133+
├─ MINOR (0): 向后兼容的功能新增
134+
└─ PATCH (7): 向后兼容的问题修复
135+
```
136+
137+
## 添加新技能
138+
139+
在本目录创建新的 `.md` 文件,描述技能的用途和使用方法。
140+
141+
文件格式:
142+
```markdown
143+
---
144+
name: skill-name
145+
description: Skill description here. Usage: say "skill trigger" to use.
146+
---
147+
148+
# Skill Title
149+
150+
Skill content...
151+
```
152+
153+
## 相关文件
154+
155+
| 文件 | 说明 |
156+
|------|------|
157+
| `CHANGELOG.md` | 版本更新日志 |
158+
| `manifest.json` | 生产版本配置 |
159+
| `manifest.dev.json` | 开发版本配置 |
160+
| `.releaserc.json` | release-it 配置 |
161+
| `scripts/sync-manifest.mjs` | 版本号同步脚本 |
162+
| `scripts/pre-release-check.mjs` | 发布前检查 |
163+
| `scripts/generate-changelog.mjs` | CHANGELOG 生成 |
164+
| `scripts/archive-package.mjs` | 归档脚本 |
165+
| `package.json` | npm 脚本配置 |

.claude/skills/bump-version.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
name: bump-version
3+
description: Intelligent version bumping for SlideNote. Analyzes changes since last release and recommends appropriate version increment (major/minor/patch). Usage: say "bump version" or "升级版本号" to analyze and update.
4+
---
5+
6+
# Bump Version Skill - 执行指令
7+
8+
## 触发条件
9+
用户说以下内容时触发此技能:
10+
- "升级版本号"
11+
- "bump version"
12+
- "应该升到什么版本"
13+
- "版本号分析"
14+
- "下一个版本是什么"
15+
16+
## 执行步骤
17+
18+
### Step 1: Get Current Version
19+
读取当前版本号:
20+
```bash
21+
grep '"version"' package.json
22+
```
23+
24+
### Step 2: Analyze Changes
25+
26+
#### 2.1 Get Last Tag
27+
```bash
28+
git describe --tags --abbrev=0 HEAD^..HEAD
29+
```
30+
31+
#### 2.2 Get Commits Since Last Tag
32+
```bash
33+
git log $(git describe --tags --abbrev=0 HEAD^..HEAD)..HEAD --oneline
34+
```
35+
36+
#### 2.3 Read Version Documentation (if exists)
37+
检查是否存在下一版本的文档目录:
38+
- `docs/versions/v{current_major}.{current_minor}.{current_patch + 1}/`
39+
- 扫描 `features/``bugs/``optimizations/` 子目录
40+
41+
### Step 3: Classify Changes
42+
43+
根据 commit message 和文件变更分类:
44+
45+
| 类型 | 说明 | 版本升级 |
46+
|------|------|----------|
47+
| Breaking | 破坏性变更、API 移除 | major |
48+
| Feat | 新功能、新特性 | minor |
49+
| Fix | Bug 修复 | patch |
50+
| Perf | 性能优化 | patch |
51+
| Refactor | 重构(无功能变更) | patch |
52+
| Docs | 文档更新 | - (可跳过) |
53+
| Style | 代码格式 | - (可跳过) |
54+
| Chore | 构建、配置 | - (可跳过) |
55+
56+
### Step 4: Determine Version Increment
57+
58+
基于分类结果:
59+
60+
```
61+
IF 有 breaking changes THEN
62+
推荐升级 major
63+
ELSE IF 有新功能 (feat) THEN
64+
推荐升级 minor
65+
ELSE IF 有 bug 修复 (fix) 或优化 (perf/refactor) THEN
66+
推荐升级 patch
67+
ELSE
68+
提示:无实质性变更,是否需要发布?
69+
END IF
70+
```
71+
72+
### Step 5: Present Analysis
73+
74+
展示分析结果:
75+
76+
```
77+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
78+
版本号分析报告
79+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
80+
81+
当前版本: {current_version}
82+
上次发布: {last_tag}
83+
84+
变更统计:
85+
📦 新功能 (feat): {feat_count} 项
86+
🐛 Bug 修复 (fix): {fix_count} 项
87+
⚡ 性能优化 (perf): {perf_count} 项
88+
🔧 重构 (refactor): {refactor_count} 项
89+
📝 文档更新 (docs): {docs_count} 项
90+
💥 破坏性变更: {breaking_count} 项
91+
92+
推荐版本: {recommended_version}
93+
推荐理由: {reason}
94+
95+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
96+
```
97+
98+
### Step 6: Confirm and Execute
99+
100+
询问用户:
101+
1. 是否接受推荐版本?
102+
2. 或输入自定义版本号?
103+
104+
用户确认后执行:
105+
```bash
106+
npm version {version_type} --no-git-tag-version
107+
npm run version:sync
108+
```
109+
110+
显示执行结果:
111+
```
112+
✓ package.json 已更新: {old_version} → {new_version}
113+
✓ manifest.json 已同步
114+
✓ manifest.dev.json 已同步
115+
```
116+
117+
### Step 7: Next Steps
118+
119+
提醒用户:
120+
- 版本号已更新,但尚未创建 commit 和 tag
121+
- 可以继续开发,或执行 `/release` 完成发布
122+
123+
## 错误处理
124+
125+
| 场景 | 处理方式 |
126+
|------|---------|
127+
| 无 git tags | 假设为首次发布,分析所有 commits |
128+
| 无实质性变更 | 询问是否仍需发布 |
129+
| 版本格式错误 | 报告并等待手动修复 |
130+
131+
## Conventional Commits 规范
132+
133+
建议的 commit message 格式(用于分析):
134+
135+
```
136+
<type>(<scope>): <subject>
137+
138+
<body>
139+
140+
<footer>
141+
```
142+
143+
类型 (type):
144+
- `feat`: 新功能
145+
- `fix`: Bug 修复
146+
- `docs`: 文档
147+
- `style`: 格式
148+
- `refactor`: 重构
149+
- `perf`: 性能
150+
- `test`: 测试
151+
- `chore`: 构建/工具
152+
- `BREAKING CHANGE`: 破坏性变更
153+
154+
## 相关文件
155+
156+
| 文件 | 用途 |
157+
|------|------|
158+
| `package.json` | 主版本号 |
159+
| `manifest.json` | 生产 manifest 版本 |
160+
| `manifest.dev.json` | 开发 manifest 版本 |
161+
| `scripts/sync-manifest.mjs` | 版本号同步脚本 |
162+
163+
## 可用的 npm scripts
164+
165+
```bash
166+
# 手动版本升级
167+
npm version major # 1.0.0
168+
npm version minor # 0.1.0
169+
npm version patch # 0.0.8
170+
171+
# 自定义版本号
172+
npm version 0.2.0 --no-git-tag-version
173+
174+
# 同步到 manifest
175+
npm run version:sync
176+
```

0 commit comments

Comments
 (0)