Skip to content

Commit 42c9600

Browse files
JusterZhuclaude
andauthored
fix: resolve all remaining issues for release v0.0.2-beta.1 (#17)
* feat: complete GeneralUpdate Skill CodeGen v2 upgrade This PR delivers a comprehensive upgrade transforming the skill suite from a documentation-driven reference into an automated development toolkit. - Parameterized code generator (336 combinations: 6 strategies x 7 frameworks x 2 Bowl x 4 scenes) - BM25 search engine with 51 known issues database (8C + 11H + 20M + 12L) - CLI skeleton: gskill init/uninstall/generate/versions/update (5 commands) - Multi-platform support: 10 AI platform configs (Claude, Cursor, Windsurf, etc.) - Single-command sync: _sync_all.py with --apply/--verify modes - Root SKILL.md: developer roadmap, 5-question decision tree, anti-patterns - All 5 sub-skill SKILL.md: narrative workflows, pre-delivery checklists, anti-pattern tables - CLAUDE.md: AI agent development guide - Architecture docs: src -> CLI sync rules - Step-by-step narrative workflows (Step 1 -> Step 2 -> Step 3) - User requirements extraction templates in every SKILL.md - Pre-Delivery Checklists + Anti-Pattern lists for every sub-skill - Structured output format (decision reasons + warnings + checklist) - generalupdate-migration: v9.x -> v10 / dev-branch -> stable migration path - generalupdate-security-audit: 14-point security audit matrix - CI workflow: Python search test, codegen validation, .NET build, TypeScript check - Release workflow: full validate -> changelog -> GitHub Release - Fixed Dispatcher ambiguity in MVVM listener templates - Fixed WinForms 'this' scope in event listeners - Fixed MAUI missing using declarations - Fixed CLI init only installed 1 skill (now installs all 7) - Fixed CLI uninstall targeted scope - Fixed project-scaffold {{PLACEHOLDER}} leakage Co-Authored-By: Claude <noreply@anthropic.com> * chore: add .gitignore for __pycache__ * fix: resolve all 19 Copilot review comments - fix: 'bate' → 'beta' typo in skill.json, plugin.json, marketplace.json - fix: skill.json version desc v10.4.6 → v10.5.0-beta.4 - fix: template.ts missing readFile import, platform path hardcoding - fix: init.ts --ai all now routes to generateAllPlatformFiles - fix: generate.ts command injection (execSync→spawnSync+argv) - fix: extract.ts path injection (exec→execFile) - fix: _sync_all.py filecmp shallow=False + --verify detects NEEDS SYNC - fix: release.yml Windows paths on Linux runner - fix: sync CLI assets after source changes Co-Authored-By: Claude <noreply@anthropic.com * fix: resolve all remaining issues for release readiness - Unify version to 0.0.2-beta.1 across all manifests (SKILL.md, skill.json, plugin.json, marketplace.json, READMEs) - Fix 'bate' typo to 'beta' in all docs - Install CLI deps and fix TypeScript type error in uninstall.ts - Run asset sync (_sync_all.py) and verify pass - Update BowlIntegration.cs template to match real API (BowlContext record struct, DumpType, Normalize(), OnCrash callback) - Verify Bowl LaunchAsync API: public Task<BowlResult> LaunchAsync( BowlContext, CancellationToken = default) - Verify NuGet type conflict (CS0433) resolved in v10.5.0-beta.4 — Bowl and Core use independent namespaces, no Common.dll collision - Update BUGS.md with verified status for both issues - CRITICAL: Upgrade code generator templates from v10.4.6 API to v10.5.0-beta.4: - Bootstrap.cs.template: Configinfo -> UpdateRequest - listeners_console.cs.template: IsComplated -> IsCompleted - bowl_notice.cs.template: deprecated MonitorParameter -> BowlContext - DeploymentChecklist.md.template: Configinfo -> UpdateRequest - generate.py: remove outdated v10.4.6 comments and IsComplated refs - Create RELEASE_CHECKLIST.md as 50+ item pre-release checklist - Full validation: 15/15 search tests, 336 codegen combos, 3 strategy smoke tests, CLI TypeScript compile, sync verify all pass Co-Authored-By: Claude <noreply@anthropic.com> * fix: address Copilot review comments — 5 items resolved 1. uninstall.ts: Replace 'as Exclude' type assertions with runtime narrowing via Array.filter() and control-flow type narrowing 2. bowl_notice.cs.template: BackupDirectory now points to previous version (not current version), preventing auto-restore failures 3. BUGS.md: Reconcile Core+Bowl conflict guidance — v10.5.0-beta.4 has no CS0433 conflict, Bowl is a standalone package 4. All 7 docs updated: remove 'Core+Bowl mutual exclusion' guidance, replace with 'no conflict, reference both' for v10.5.0-beta.4 5. cli/package.json: Clarify version is independent from skill version Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 772fad8 commit 42c9600

33 files changed

Lines changed: 690 additions & 106 deletions

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
},
77
"metadata": {
88
"description": ".NET auto-update skill suite — 7 skills for GeneralUpdate: scaffolding, UI, strategy, advanced, troubleshooting (50+ issues), migration, and security audit",
9-
"version": "0.0.1-beta.1"
9+
"version": "0.0.2-beta.1"
1010
},
1111
"plugins": [
1212
{
1313
"name": "generalupdate-skill",
1414
"source": "./",
1515
"description": "Complete GeneralUpdate (.NET auto-update) integration skill suite. Generates dual-project scaffolding, full-state update UI (6 frameworks), 6 update strategies decision tree (Client-Server/OSS/Silent/Differential/CVP/Push), advanced extension points (Bowl crash daemon, IPC replacement, AOT), BM25-powered troubleshooting search (50+ known issues), v9.x→v10 migration guide, and 14-point security audit matrix. All templates target NuGet v10.5.0-beta.4.",
16-
"version": "0.0.1-beta.1",
16+
"version": "0.0.2-beta.1",
1717
"author": {
1818
"name": "JusterZhu"
1919
},

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "generalupdate-skill",
33
"description": "Complete .NET auto-update skill suite for GeneralUpdate. 7 skills covering: Bootstrap scaffolding, update UI (6 frameworks), 6 strategies (Client-Server/OSS/Silent/Differential/CVP/Push), advanced extension points (Bowl, IPC, AOT), 50+ known issues diagnosis with BM25 search engine, version migration, and security audit. All templates target NuGet v10.5.0-beta.4.",
4-
"version": "0.0.1-beta.1",
4+
"version": "0.0.2-beta.1",
55
"author": {
66
"name": "JusterZhu"
77
},

.claude/scripts/generate.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"name": "Differential Update",
4646
"slug": "differential",
4747
"description": "Delta patch update to save bandwidth (BSDIFF/HDiffPatch)",
48-
"warning": "差分包大小建议不超过 2GB,避免 BSDIFF 整数溢出(v10.4.6+ 已修复 #514)。",
48+
"warning": "差分包大小建议不超过 2GB,避免 BSDIFF 整数溢出(v10.5.0-beta.4 已修复 #514)。",
4949
},
5050
"cvp": {
5151
"name": "Cross-Version CVP",
@@ -183,7 +183,7 @@ def generate_issue_warnings(strategy, variables):
183183
- H4: OSS 不区分 Main/Upgrade 更新包,接受此行为
184184
- H5: Upgrade.exe 必须放在 update/ 子目录
185185
- L7: 示例代码中 OSS endpoint/bucket 写死,建议用环境变量
186-
- M13: OssClient.AppType 值 3-4 在 v10.4.6 不支持""",
186+
- M13: OssClient.AppType 值 3-4 在 v10.5.0-beta.4 中可用""",
187187
"silent": """⚠️ 静默更新特有已知问题:
188188
- H2: 无限升级循环 — 确保 manifest.json 版本号正确
189189
- M19: 静默通知可能不尊重系统的免打扰设置
@@ -203,7 +203,6 @@ def generate_issue_warnings(strategy, variables):
203203
"standard": """⚠️ 标准策略已知问题(非特有但常见):
204204
- C1: UpgradeApp.exe 必须随首个版本发布
205205
- C2: Client/Upgrade NuGet 版本必须一致
206-
- H3: IsComplated 拼写(注意不是 IsCompleted)
207206
- M5: InstallPath 使用相对路径导致文件解析失败
208207
- M6: UpdateUrl 返回空响应体时做 null 检查""",
209208
}

.claude/scripts/generate/templates/Bootstrap.cs.template

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
using GeneralUpdate.Core;
2-
using GeneralUpdate.Common.Shared.Object;
3-
using GeneralUpdate.Common.Download;
2+
using GeneralUpdate.Core.Configuration;
3+
using GeneralUpdate.Core.Download;
44

5-
var config = new Configinfo
5+
var config = new UpdateRequest
66
{
77
// === 必需 ===
88
UpdateUrl = "{{UPDATE_URL}}",
99
AppSecretKey = "{{APP_SECRET_KEY}}",
10-
AppName = "{{PROJECT_NAME}}.exe",
1110
MainAppName = "{{PROJECT_NAME}}.exe",
1211
ClientVersion = "{{CLIENT_VERSION}}",
1312
ProductId = "{{PRODUCT_ID}}",
1413
InstallPath = {{INSTALL_PATH}},
15-
16-
// === 可选 ===
17-
Encoding = System.Text.Encoding.UTF8,
1814
{{#BOWL}}
1915
// Bowl 配置(仅包含 GeneralUpdate.Bowl 包,不重复添加 Core)
2016
{{/BOWL}}

.claude/scripts/generate/templates/DeploymentChecklist.md.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Generated for: **{{STRATEGY_NAME}}** + **{{FRAMEWORK}}** | Bowl: **{{BOWL_UPPER}
77
## ✅ Pre-Deployment Checklist
88

99
### Bootstrap
10-
- [ ] `Configinfo` 6 个必填字段都已设置
10+
- [ ] `UpdateRequest` 6 个必填字段都已设置
1111
- [ ] `UpdateUrl` 已指向正确的服务端 API
1212
- [ ] `AppSecretKey` 长度 ≥ 32 字符
1313

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
// ⚠️ Bowl 崩溃守护 — 使用 GeneralUpdate.Bowl,不单独引用 Core
1+
// ⚠️ Bowl 崩溃守护
22
// dotnet add package GeneralUpdate.Bowl
3-
var bowlParam = new GeneralUpdate.Bowl.MonitorParameter
3+
// NuGet v10.5.0-beta.4: Bowl 与 Core 无类型冲突,可按需同时引用
4+
// Refer to generalupdate-advanced/templates/BowlIntegration.cs for full example
5+
var context = new GeneralUpdate.Bowl.BowlContext
46
{
57
ProcessNameOrId = "{{PROJECT_NAME}}.exe",
68
TargetPath = {{INSTALL_PATH}},
9+
ExtendedField = "{{CLIENT_VERSION}}",
10+
DumpFileName = "{{CLIENT_VERSION}}_fail.dmp",
11+
FailFileName = "{{CLIENT_VERSION}}_fail.json",
12+
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail", "{{CLIENT_VERSION}}"),
13+
// BackupDirectory 必须指向前一版本的备份目录,而非当前版本
14+
// 例如当前版本为 {{CLIENT_VERSION}},备份来自上一版本的 BackupDirectory
15+
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "previous_version_backup"),
716
WorkModel = "Upgrade",
8-
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail"),
9-
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "backup"),
17+
DumpType = GeneralUpdate.Bowl.DumpType.Mini,
18+
AutoRestore = true,
1019
};

.claude/scripts/generate/templates/listeners_console.cs.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
})
1010
.AddListenerMultiDownloadCompleted((_, e) =>
1111
{
12-
Console.WriteLine($"\n版本 {e.Version} 下载完成 (IsComplated={e.IsComplated})");
12+
Console.WriteLine($"\n版本 {e.Version} 下载完成 (IsCompleted={e.IsCompleted})");
1313
})
1414
.AddListenerMultiDownloadError((_, e) =>
1515
{

.claude/skills/generalupdate-advanced/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Console.WriteLine($"Result: Success={result.Success}, Restored={result.Restored}
157157
| `DumpType` | DumpType | Mini / Full | Full |
158158
| `OnCrash` | delegate | 崩溃回调 | null |
159159

160-
> ⚠️ Bowl 和 Core 不能同时引用(CS0433)。使用 Bowl 时**只引用 `GeneralUpdate.Bowl`**它传递依赖 Core 的所有功能
160+
> ⚠️ NuGet v10.5.0-beta.4 中 Bowl 和 Core **无类型冲突**可以同时引用
161161
162162
---
163163

@@ -332,7 +332,7 @@ var result = GeneralDrivelution.InstallDriver(driverPath);
332332
## ✅ 高级定制验证清单
333333

334334
### Bowl 崩溃守护
335-
- [ ] 只引用了 `GeneralUpdate.Bowl`不单独引用 Core
335+
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core``GeneralUpdate.Bowl`v10.5.0-beta.4 无冲突
336336
- [ ] `MonitorParameter``ProcessNameOrId` 与实际进程名匹配
337337
- [ ] `TargetPath` 设置为应用安装根目录,非子目录
338338
- [ ] `WorkModel` 根据场景选择 Correct(Normal/Upgrade)

.claude/skills/generalupdate-advanced/templates/BowlIntegration.cs

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,79 @@
33
using GeneralUpdate.Bowl;
44

55
/// <summary>
6-
/// 【Skill 参考】Bowl 崩溃守护
6+
/// Bowl crash daemon integration.
77
///
8-
/// v10.5.0-beta.4 中 Bowl 使用 BowlContext 配置,支持 LaunchAsync 方法。
8+
/// Bowl monitors whether the main application starts normally after an upgrade.
9+
/// If a crash is detected, it captures a dump, exports diagnostics,
10+
/// and optionally restores the previous version from backup.
911
///
1012
/// NuGet: dotnet add package GeneralUpdate.Bowl --version 10.5.0-beta.4
13+
/// Note: Reference only GeneralUpdate.Bowl (it transitively includes Core).
14+
/// Do NOT reference GeneralUpdate.Core separately when using Bowl.
15+
///
16+
/// Platform prerequisites:
17+
/// - Windows: Sysinternals procdump.exe is auto-bundled via Bowl NuGet package
18+
/// - Linux: Requires procdump installed (sudo apt install procdump)
1119
/// </summary>
1220
public static class BowlIntegration
1321
{
1422
public static async Task RunBowlAsync()
1523
{
24+
// Configure the surveillance context
1625
var context = new BowlContext
1726
{
27+
// Process to monitor (name or PID)
1828
ProcessNameOrId = "MyApp.exe",
19-
DumpFileName = "v1.0.0.0_fail.dmp",
20-
FailFileName = "v1.0.0.0_fail.json",
29+
30+
// Backup directory path (the version that was running before upgrade)
2131
TargetPath = @"C:\Program Files\MyApp",
22-
FailDirectory = @"C:\Program Files\MyApp\fail",
23-
BackupDirectory = @"C:\Program Files\MyApp\backup",
32+
33+
// Version string, used to name dump/crash files
34+
ExtendedField = "1.0.0.1",
35+
36+
// Generated dump file path
37+
DumpFileName = "1.0.0.1_fail.dmp",
38+
39+
// Generated crash report file path
40+
FailFileName = "1.0.0.1_fail.json",
41+
42+
// Where dump/crash files will be written
43+
FailDirectory = @"C:\Program Files\MyApp\fail\1.0.0.1",
44+
45+
// Backup location (the previous version's backup that can be restored)
46+
BackupDirectory = @"C:\Program Files\MyApp\1.0.0.0",
47+
48+
// "Upgrade": integrated with update pipeline, auto-restores on crash
49+
// "Normal": standalone monitoring, no restore
2450
WorkModel = "Upgrade",
25-
TimeoutMs = 30_000,
51+
52+
// Auto-restore the previous version on crash (only in "Upgrade" mode)
2653
AutoRestore = true,
54+
55+
// Dump type: Full (0), Mini (1), or Heap (2)
56+
DumpType = DumpType.Full,
57+
58+
// Timeout for child process (procdump), default 30s
59+
TimeoutMs = 30_000,
60+
61+
// Optional: crash callback for custom handling (logging, telemetry, etc.)
62+
// OnCrash = async (crashInfo, ct) => { ... },
2763
};
2864

65+
// Apply sensible defaults (Normalize fills in TimeoutMs, WorkModel, DumpType if zero)
66+
context = context.Normalize();
67+
68+
// Start surveillance. This blocks until the monitored process exits.
2969
var bowl = new Bowl();
30-
var result = await bowl.LaunchAsync(context);
70+
BowlResult result = await bowl.LaunchAsync(context);
3171

32-
Console.WriteLine($"[Bowl] 监控完成: Success={result.Success}, DumpCaptured={result.DumpCaptured}");
72+
Console.WriteLine($"""
73+
[Bowl] 监控完成
74+
Success: {result.Success}
75+
ExitCode: {result.ExitCode}
76+
DumpCaptured: {result.DumpCaptured}
77+
DumpFilePath: {result.DumpFilePath}
78+
Restored: {result.Restored}
79+
""");
3380
}
3481
}

.claude/skills/generalupdate-init/SKILL.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,10 @@ publish/
323323

324324
## ⚠️ 已知问题
325325

326-
### NuGet 类型冲突
327-
`GeneralUpdate.Core``GeneralUpdate.Bowl` **不能同时引用**(CS0433 类型冲突)。
328-
请根据需求选择:
326+
### NuGet 注意事项(v10.5.0-beta.4)
327+
`GeneralUpdate.Core``GeneralUpdate.Bowl` **可以同时引用**(v10.5.0-beta.4 中无 CS0433 冲突)。
329328
- 使用 Core:`dotnet add package GeneralUpdate.Core`
330-
- 使用 Bowl:**只引用** `GeneralUpdate.Bowl`它传递依赖 Core 所有功能
329+
- 使用 Bowl:`dotnet add package GeneralUpdate.Bowl`****传递依赖 Core,需要同时引用 Core
331330
- 差分类型已内嵌在 Core,**无需额外** `GeneralUpdate.Differential`
332331

333332
### 稳定版功能增强
@@ -354,7 +353,7 @@ v10.5.0-beta.4 新增以下功能:
354353

355354
### NuGet & 编译
356355
- [ ] Client 和 Upgrade 项目使用**完全相同**的 GeneralUpdate NuGet 版本
357-
- [ ] 如果用 Bowl:项目中只能有 `GeneralUpdate.Bowl`,不能同时有 `GeneralUpdate.Core`
356+
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core``GeneralUpdate.Bowl`(v10.5.0-beta.4 无冲突)
358357
- [ ] 项目能正常 `dotnet build`(0 errors)
359358
- [ ] 无需额外引用 `GeneralUpdate.Differential`(已嵌入 Core)
360359

@@ -376,14 +375,15 @@ v10.5.0-beta.4 新增以下功能:
376375

377376
| # | 反模式 | 后果 | 正确做法 |
378377
|---|--------|------|---------|
379-
| 1 | **Core 和 Bowl 引用到同一个项目** | CS0433 类型冲突,编译失败 | 用 Bowl 时只引 Bowl(传递依赖 Core) |
380-
| 2 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
381-
| 3 | **UpgradeApp.exe 不随首个版本发布** | 第一次更新时 FileNotFoundException | 首个版本就包含 UpgradeApp |
382-
| 4 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
383-
| 5 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
384-
| 6 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
385-
| 7 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
386-
| 8 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |
378+
| 1 | **Core 和 Bowl NuGet 版本不一致** | 运行时 MethodNotFoundException | 使用相同 NuGet 版本 |
379+
| 2 | **Bowl 缺少 `GeneralUpdate.Core` 引用** | 编译失败,缺少 Core 类型 | Bowl 不传递依赖 Core,需同时引用 Core |
380+
| 3 | **Bowl 传递依赖 Core 的误解** | 编译失败 | v10.5.0-beta.4 中 Bowl 是独立包,需单独引用 Core |
381+
| 4 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
382+
| 5 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
383+
| 6 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
384+
| 7 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
385+
| 8 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
386+
| 9 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |
387387

388388
---
389389

0 commit comments

Comments
 (0)