dev-playbooks-cn 2.2.0 → 2.2.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,219 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.2.1] - 2025-01-20
9
+
10
+ ### 修复
11
+ - 修复 update 命令的 changelog 显示功能
12
+ - 添加完整的版本变更记录
13
+ - 将 CHANGELOG.md 添加到 npm 发布文件列表
14
+ - 优化 update 命令性能
15
+ - 添加版本检查缓存(10 分钟 TTL)
16
+ - 避免重复网络请求导致的卡顿
17
+
18
+ ---
19
+
20
+ ## [2.2.0] - 2025-01-20
21
+
22
+ ### 新增
23
+ - 添加 Every Code (`@just-every/code`) 支持
24
+ - 完整 Skills 系统支持
25
+ - Skills 安装目录:`~/.code/skills/` 或 `.code/skills/`(项目级)
26
+ - 使用 `AGENTS.md` 指令文件
27
+ - 安装脚本新增 `--code-only` 和 `--with-code` 选项
28
+ - 版本检查缓存(10 分钟 TTL)加速重复 `update` 命令
29
+
30
+ ### 变更
31
+ - 更新 README 工具支持表格
32
+
33
+ ---
34
+
35
+ ## [2.1.1] - 2025-01-19
36
+
37
+ ### 修复
38
+ - 规范用语修正
39
+
40
+ ---
41
+
42
+ ## [2.1.0] - 2025-01-19
43
+
44
+ ### Added
45
+
46
+ - **Version Changelog Display**: When running `dev-playbooks-cn update`, the CLI now displays a formatted changelog summary showing all changes between the current version and the latest version
47
+ - ✅ Automatic fetch from GitHub: Retrieves CHANGELOG.md from the repository
48
+ - 📋 Smart parsing: Extracts and displays only relevant version changes
49
+ - 🎨 Colorized output: Highlights different types of changes (features, warnings, etc.)
50
+ - 🔗 Graceful fallback: Shows GitHub release link if network fails
51
+ - 📊 Content limit: Displays first 10 lines per version to avoid information overload
52
+
53
+ ### Improved
54
+
55
+ - **User Experience**: Users can now make informed decisions about updates by reviewing what's new before upgrading
56
+
57
+ ---
58
+
59
+ ## [2.0.0] - 2026-01-19
60
+
61
+ ### Added
62
+
63
+ #### 🎯 Human-Friendly Document Templates
64
+
65
+ - **结论先行(Bottom Line Up Front)**: Every document (proposal, design, tasks, verification) now has a 30-second executive summary at the top
66
+ - ✅ What will result: List changes in plain language
67
+ - ❌ What won't result: Clearly state what won't change
68
+ - 📝 One-sentence summary: Understandable even for non-technical people
69
+
70
+ - **需求对齐(Alignment Check)**: Proposal phase now includes guided questions to uncover hidden requirements
71
+ - 👤 Role identification: Quick Starter / Platform Builder / Rapid Validator
72
+ - 🎯 Core requirements: Explicit + hidden requirements
73
+ - 💡 Multi-perspective recommendations: Different recommendations based on different roles
74
+
75
+ - **默认批准机制(Default Approval Mechanism)**: Reduce decision fatigue with auto-approval
76
+ - ⏰ User silence = agreement: Auto-approve after timeout
77
+ - 🎛️ Configurable timeout: proposal 48h / design 24h / tasks 24h / verification 12h
78
+ - 🔒 Retain control: Users can reject or customize at any time
79
+
80
+ - **项目级文档(Project-Level Documents)**: Knowledge retention and decision tracking
81
+ - 📋 User Profile (project-profile.md): Record role, requirements, constraints, preferences
82
+ - 📝 Decision Log (decision-log.md): Record all important decisions for retrospection
83
+
84
+ #### New Document Templates
85
+
86
+ - `skills/_shared/references/文档模板-proposal.md` (Chinese)
87
+ - `skills/_shared/references/文档模板-design.md` (Chinese)
88
+ - `skills/_shared/references/文档模板-tasks.md` (Chinese)
89
+ - `skills/_shared/references/文档模板-verification.md` (Chinese)
90
+ - `skills/_shared/references/文档模板-project-profile.md` (Chinese)
91
+ - `skills/_shared/references/文档模板-decision-log.md` (Chinese)
92
+ - `skills/_shared/references/批准配置说明.md` (Chinese)
93
+ - `skills/_shared/references/document-template-proposal.md` (English)
94
+ - `skills/_shared/references/document-template-design.md` (English)
95
+ - `skills/_shared/references/document-template-tasks.md` (English)
96
+ - `skills/_shared/references/document-template-verification.md` (English)
97
+ - `skills/_shared/references/document-template-project-profile.md` (English)
98
+ - `skills/_shared/references/document-template-decision-log.md` (English)
99
+ - `skills/_shared/references/approval-configuration-guide.md` (English)
100
+
101
+ #### Documentation
102
+
103
+ - Added `docs/v2.0.0-修改总结.md`: Comprehensive summary of v2.0.0 changes
104
+ - Updated README.md with v2.0.0 features section (both Chinese and English versions)
105
+
106
+ ### Changed
107
+
108
+ - **proposal-author skill**: Updated to use new document templates
109
+ - Now generates documents with "Bottom Line Up Front" section
110
+ - Includes "Alignment Check" to uncover hidden requirements
111
+ - Provides multi-perspective recommendations based on user role
112
+ - References new template files in prompts
113
+
114
+ ### Breaking Changes
115
+
116
+ ⚠️ **Document Structure Changes**
117
+
118
+ - Existing proposal.md files do not conform to the new structure
119
+ - Migration may be required for existing projects
120
+ - Old format is still supported but not recommended
121
+
122
+ **Mitigation**:
123
+ - Migration script will be provided in future releases
124
+ - Backward compatibility maintained for reading old format
125
+ - New projects will use new format by default
126
+
127
+ ⚠️ **Approval Mechanism Changes**
128
+
129
+ - Introduces default approval mechanism which may not fit all team workflows
130
+ - Default strategy is `auto_approve` but can be changed to `require_explicit`
131
+
132
+ **Mitigation**:
133
+ - Configurable approval strategy in `.devbooks/config.yaml`
134
+ - Can disable auto-approval for high-risk projects
135
+ - Timeout values are configurable
136
+
137
+ ### Design Philosophy
138
+
139
+ This release is inspired by:
140
+ - Cognitive Load Theory: Minimize extraneous load, maximize germane load
141
+ - Dual Process Theory: Design for both System 1 (fast) and System 2 (slow) thinking
142
+ - Nudge Theory: Use default options to guide better decisions
143
+ - Inverted Pyramid Structure: Put conclusions first, details later
144
+
145
+ **Core Principles**:
146
+ - 🎯 Assume users are non-technical: Use plain language, avoid jargon
147
+ - 🤔 Uncover hidden requirements: Guide users through questions
148
+ - ⏰ Reduce decision fatigue: Default approval with configurable timeout
149
+ - 📋 Knowledge retention: Project-level documents for long-term reference
150
+
151
+ ### Upgrade Guide
152
+
153
+ #### For Existing Projects
154
+
155
+ 1. Update npm package:
156
+ ```bash
157
+ npm install -g dev-playbooks-cn@2.0.0
158
+ # or
159
+ npm install -g dev-playbooks@2.0.0
160
+ ```
161
+
162
+ 2. (Optional) Migrate existing documents:
163
+ ```bash
164
+ # Migration script will be provided in future releases
165
+ devbooks migrate --from 1.x --to 2.0.0
166
+ ```
167
+
168
+ 3. (Optional) Configure approval mechanism:
169
+ Create `.devbooks/config.yaml`:
170
+ ```yaml
171
+ approval:
172
+ default_strategy: auto_approve
173
+ timeout:
174
+ proposal: 48
175
+ design: 24
176
+ tasks: 24
177
+ verification: 12
178
+ ```
179
+
180
+ 4. (Optional) Create project-level documents:
181
+ ```bash
182
+ devbooks init-profile
183
+ devbooks init-decision-log
184
+ ```
185
+
186
+ #### For New Projects
187
+
188
+ New projects will automatically use the new document templates. No migration needed.
189
+
190
+ ### References
191
+
192
+ - Report: "Protocol 2026: Cognitive Compatibility and Human-Computer Communication Standards in the AI-Native Era"
193
+ - Cognitive Load Theory (CLT)
194
+ - Dual Process Theory
195
+ - Nudge Theory
196
+ - Inverted Pyramid Structure
197
+
198
+ ---
199
+
200
+ ## [1.7.4] - 2026-01-18
201
+
202
+ ### Changed
203
+ - Various bug fixes and improvements
204
+
205
+ ---
206
+
207
+ ## [1.7.0] - 2026-01-15
208
+
209
+ ### Added
210
+ - Initial release with 18 skills
211
+ - Support for Claude Code, Codex CLI, and other AI tools
212
+ - Quality gates and role isolation
213
+ - MCP integration support
214
+
215
+ ---
216
+
217
+ [2.0.0]: https://github.com/Darkbluelr/dev-playbooks-cn/compare/v1.7.4...v2.0.0
218
+ [1.7.4]: https://github.com/Darkbluelr/dev-playbooks-cn/compare/v1.7.0...v1.7.4
219
+ [1.7.0]: https://github.com/Darkbluelr/dev-playbooks-cn/releases/tag/v1.7.0
package/bin/devbooks.js CHANGED
@@ -34,6 +34,10 @@ const __dirname = path.dirname(__filename);
34
34
  const CLI_COMMAND = 'dev-playbooks-cn';
35
35
  const XDG_CONFIG_HOME = process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config');
36
36
 
37
+ // 版本检查缓存配置
38
+ const VERSION_CACHE_FILE = path.join(os.tmpdir(), `${CLI_COMMAND}-version-cache.json`);
39
+ const VERSION_CACHE_TTL = 10 * 60 * 1000; // 10 分钟缓存
40
+
37
41
  // ============================================================================
38
42
  // Skills 支持级别定义
39
43
  // ============================================================================
@@ -330,11 +334,32 @@ function getCliVersion() {
330
334
  }
331
335
 
332
336
  /**
333
- * 检查 npm 上是否有新版本
337
+ * 检查 npm 上是否有新版本(带缓存)
334
338
  * @returns {Promise<{hasUpdate: boolean, latestVersion: string|null, currentVersion: string}>}
335
339
  */
336
340
  async function checkNpmUpdate() {
337
341
  const currentVersion = getCliVersion();
342
+
343
+ // 检查缓存
344
+ try {
345
+ if (fs.existsSync(VERSION_CACHE_FILE)) {
346
+ const cache = JSON.parse(fs.readFileSync(VERSION_CACHE_FILE, 'utf-8'));
347
+ const cacheAge = Date.now() - cache.timestamp;
348
+
349
+ // 如果缓存未过期且当前版本匹配缓存的最新版本,跳过网络请求
350
+ if (cacheAge < VERSION_CACHE_TTL && cache.currentVersion === currentVersion) {
351
+ // 如果缓存显示已是最新版本,直接返回
352
+ if (!cache.hasUpdate) {
353
+ return { hasUpdate: false, latestVersion: cache.latestVersion, currentVersion };
354
+ }
355
+ // 如果缓存显示有更新,仍返回缓存结果
356
+ return { hasUpdate: cache.hasUpdate, latestVersion: cache.latestVersion, currentVersion };
357
+ }
358
+ }
359
+ } catch {
360
+ // 缓存读取失败,继续网络请求
361
+ }
362
+
338
363
  try {
339
364
  const { execSync } = await import('child_process');
340
365
  const latestVersion = execSync(`npm view ${CLI_COMMAND} version`, {
@@ -343,16 +368,29 @@ async function checkNpmUpdate() {
343
368
  stdio: ['pipe', 'pipe', 'pipe']
344
369
  }).trim();
345
370
 
371
+ let hasUpdate = false;
346
372
  if (latestVersion && latestVersion !== currentVersion) {
347
373
  // 简单版本比较(假设语义化版本)
348
374
  const current = currentVersion.split('.').map(Number);
349
375
  const latest = latestVersion.split('.').map(Number);
350
- const hasUpdate = latest[0] > current[0] ||
376
+ hasUpdate = latest[0] > current[0] ||
351
377
  (latest[0] === current[0] && latest[1] > current[1]) ||
352
378
  (latest[0] === current[0] && latest[1] === current[1] && latest[2] > current[2]);
353
- return { hasUpdate, latestVersion, currentVersion };
354
379
  }
355
- return { hasUpdate: false, latestVersion, currentVersion };
380
+
381
+ // 保存缓存
382
+ try {
383
+ fs.writeFileSync(VERSION_CACHE_FILE, JSON.stringify({
384
+ timestamp: Date.now(),
385
+ currentVersion,
386
+ latestVersion,
387
+ hasUpdate
388
+ }));
389
+ } catch {
390
+ // 缓存写入失败,忽略
391
+ }
392
+
393
+ return { hasUpdate, latestVersion, currentVersion };
356
394
  } catch {
357
395
  // 网络错误或超时,静默忽略
358
396
  return { hasUpdate: false, latestVersion: null, currentVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-playbooks-cn",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "AI-driven spec-based development workflow",
5
5
  "keywords": [
6
6
  "devbooks",
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "files": [
29
29
  "LICENSE",
30
+ "CHANGELOG.md",
30
31
  "bin/",
31
32
  "templates/",
32
33
  "skills/",