Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
},
"metadata": {
"description": ".NET auto-update skill suite — 7 skills for GeneralUpdate: scaffolding, UI, strategy, advanced, troubleshooting (50+ issues), migration, and security audit",
"version": "0.0.1-beta.1"
"version": "0.0.2-beta.1"
},
"plugins": [
{
"name": "generalupdate-skill",
"source": "./",
"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.",
"version": "0.0.1-beta.1",
"version": "0.0.2-beta.1",
"author": {
"name": "JusterZhu"
},
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "generalupdate-skill",
"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.",
"version": "0.0.1-beta.1",
"version": "0.0.2-beta.1",
"author": {
"name": "JusterZhu"
},
Expand Down
5 changes: 2 additions & 3 deletions .claude/scripts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"name": "Differential Update",
"slug": "differential",
"description": "Delta patch update to save bandwidth (BSDIFF/HDiffPatch)",
"warning": "差分包大小建议不超过 2GB,避免 BSDIFF 整数溢出(v10.4.6+ 已修复 #514)。",
"warning": "差分包大小建议不超过 2GB,避免 BSDIFF 整数溢出(v10.5.0-beta.4 已修复 #514)。",
},
"cvp": {
"name": "Cross-Version CVP",
Expand Down Expand Up @@ -183,7 +183,7 @@ def generate_issue_warnings(strategy, variables):
- H4: OSS 不区分 Main/Upgrade 更新包,接受此行为
- H5: Upgrade.exe 必须放在 update/ 子目录
- L7: 示例代码中 OSS endpoint/bucket 写死,建议用环境变量
- M13: OssClient.AppType 值 3-4 在 v10.4.6 不支持""",
- M13: OssClient.AppType 值 3-4 在 v10.5.0-beta.4 中可用""",
"silent": """⚠️ 静默更新特有已知问题:
- H2: 无限升级循环 — 确保 manifest.json 版本号正确
- M19: 静默通知可能不尊重系统的免打扰设置
Expand All @@ -203,7 +203,6 @@ def generate_issue_warnings(strategy, variables):
"standard": """⚠️ 标准策略已知问题(非特有但常见):
- C1: UpgradeApp.exe 必须随首个版本发布
- C2: Client/Upgrade NuGet 版本必须一致
- H3: IsComplated 拼写(注意不是 IsCompleted)
- M5: InstallPath 使用相对路径导致文件解析失败
- M6: UpdateUrl 返回空响应体时做 null 检查""",
}
Expand Down
10 changes: 3 additions & 7 deletions .claude/scripts/generate/templates/Bootstrap.cs.template
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
using GeneralUpdate.Core;
using GeneralUpdate.Common.Shared.Object;
using GeneralUpdate.Common.Download;
using GeneralUpdate.Core.Configuration;
using GeneralUpdate.Core.Download;

var config = new Configinfo
var config = new UpdateRequest
{
// === 必需 ===
UpdateUrl = "{{UPDATE_URL}}",
AppSecretKey = "{{APP_SECRET_KEY}}",
AppName = "{{PROJECT_NAME}}.exe",
MainAppName = "{{PROJECT_NAME}}.exe",
ClientVersion = "{{CLIENT_VERSION}}",
ProductId = "{{PRODUCT_ID}}",
InstallPath = {{INSTALL_PATH}},

// === 可选 ===
Encoding = System.Text.Encoding.UTF8,
{{#BOWL}}
// Bowl 配置(仅包含 GeneralUpdate.Bowl 包,不重复添加 Core)
{{/BOWL}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Generated for: **{{STRATEGY_NAME}}** + **{{FRAMEWORK}}** | Bowl: **{{BOWL_UPPER}
## ✅ Pre-Deployment Checklist

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

Expand Down
12 changes: 9 additions & 3 deletions .claude/scripts/generate/templates/bowl_notice.cs.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// ⚠️ Bowl 崩溃守护 — 使用 GeneralUpdate.Bowl,不单独引用 Core
// dotnet add package GeneralUpdate.Bowl
var bowlParam = new GeneralUpdate.Bowl.MonitorParameter
// Refer to generalupdate-advanced/templates/BowlIntegration.cs for full example
var context = new GeneralUpdate.Bowl.BowlContext
{
ProcessNameOrId = "{{PROJECT_NAME}}.exe",
TargetPath = {{INSTALL_PATH}},
ExtendedField = "{{CLIENT_VERSION}}",
DumpFileName = "{{CLIENT_VERSION}}_fail.dmp",
FailFileName = "{{CLIENT_VERSION}}_fail.json",
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail", "{{CLIENT_VERSION}}"),
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "{{CLIENT_VERSION}}"),
WorkModel = "Upgrade",
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail"),
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "backup"),
DumpType = GeneralUpdate.Bowl.DumpType.Mini,
AutoRestore = true,
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
})
.AddListenerMultiDownloadCompleted((_, e) =>
{
Console.WriteLine($"\n版本 {e.Version} 下载完成 (IsComplated={e.IsComplated})");
Console.WriteLine($"\n版本 {e.Version} 下载完成 (IsCompleted={e.IsCompleted})");
})
.AddListenerMultiDownloadError((_, e) =>
{
Expand Down
65 changes: 56 additions & 9 deletions .claude/skills/generalupdate-advanced/templates/BowlIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,79 @@
using GeneralUpdate.Bowl;

/// <summary>
/// 【Skill 参考】Bowl 崩溃守护
/// Bowl crash daemon integration.
///
/// v10.5.0-beta.4 中 Bowl 使用 BowlContext 配置,支持 LaunchAsync 方法。
/// Bowl monitors whether the main application starts normally after an upgrade.
/// If a crash is detected, it captures a dump, exports diagnostics,
/// and optionally restores the previous version from backup.
///
/// NuGet: dotnet add package GeneralUpdate.Bowl --version 10.5.0-beta.4
/// Note: Reference only GeneralUpdate.Bowl (it transitively includes Core).
/// Do NOT reference GeneralUpdate.Core separately when using Bowl.
///
/// Platform prerequisites:
/// - Windows: Sysinternals procdump.exe is auto-bundled via Bowl NuGet package
/// - Linux: Requires procdump installed (sudo apt install procdump)
/// </summary>
public static class BowlIntegration
{
public static async Task RunBowlAsync()
{
// Configure the surveillance context
var context = new BowlContext
{
// Process to monitor (name or PID)
ProcessNameOrId = "MyApp.exe",
DumpFileName = "v1.0.0.0_fail.dmp",
FailFileName = "v1.0.0.0_fail.json",

// Backup directory path (the version that was running before upgrade)
TargetPath = @"C:\Program Files\MyApp",
FailDirectory = @"C:\Program Files\MyApp\fail",
BackupDirectory = @"C:\Program Files\MyApp\backup",

// Version string, used to name dump/crash files
ExtendedField = "1.0.0.1",

// Generated dump file path
DumpFileName = "1.0.0.1_fail.dmp",

// Generated crash report file path
FailFileName = "1.0.0.1_fail.json",

// Where dump/crash files will be written
FailDirectory = @"C:\Program Files\MyApp\fail\1.0.0.1",

// Backup location (the previous version's backup that can be restored)
BackupDirectory = @"C:\Program Files\MyApp\1.0.0.0",

// "Upgrade": integrated with update pipeline, auto-restores on crash
// "Normal": standalone monitoring, no restore
WorkModel = "Upgrade",
TimeoutMs = 30_000,

// Auto-restore the previous version on crash (only in "Upgrade" mode)
AutoRestore = true,

// Dump type: Full (0), Mini (1), or Heap (2)
DumpType = DumpType.Full,

// Timeout for child process (procdump), default 30s
TimeoutMs = 30_000,

// Optional: crash callback for custom handling (logging, telemetry, etc.)
// OnCrash = async (crashInfo, ct) => { ... },
};

// Apply sensible defaults (Normalize fills in TimeoutMs, WorkModel, DumpType if zero)
context = context.Normalize();

// Start surveillance. This blocks until the monitored process exits.
var bowl = new Bowl();
var result = await bowl.LaunchAsync(context);
BowlResult result = await bowl.LaunchAsync(context);

Console.WriteLine($"[Bowl] 监控完成: Success={result.Success}, DumpCaptured={result.DumpCaptured}");
Console.WriteLine($"""
[Bowl] 监控完成
Success: {result.Success}
ExitCode: {result.ExitCode}
DumpCaptured: {result.DumpCaptured}
DumpFilePath: {result.DumpFilePath}
Restored: {result.Restored}
""");
}
}
26 changes: 19 additions & 7 deletions BUGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
## 修复状态

> ✅ **全部更新完成**。所有模板文件已更新为 v10.5.0-beta.4 API。
> ✅ **已知问题全部确认解决**。Bowl API 已验证,NuGet 类型冲突已修复,版本号已统一,CLI 已编译。

| 类别 | 更新内容 | 状态 |
|------|---------|:----:|
Expand All @@ -44,14 +45,25 @@

## 已知剩余问题

### 1. NuGet 类型冲突(未变
### 1. NuGet 类型冲突(v10.5.0-beta.4 ✅ 已解决

`GeneralUpdate.Common` 库的类型同时在 `GeneralUpdate.Core` `GeneralUpdate.Bowl` 中发布
当项目同时引用 Bowl Core 时,会出现 CS0433 编译错误
`GeneralUpdate.Common` 独立命名空间在 v10.4.6 中存在于 `GeneralUpdate.Core` 中,与 `GeneralUpdate.Bowl` 冲突
**v10.5.0-beta.4 已解决**:Bowl 项目不再引用 Core,各自使用独立的 `GeneralUpdate.Bowl` / `GeneralUpdate.Core` 命名空间

**解决方案**:使用 Bowl 时只引用 `GeneralUpdate.Bowl`(它依赖 Core),不单独引用 Core。
| 场景 | 引用方式 | 状态 |
|------|---------|:----:|
| 有 Bowl | 只引用 `GeneralUpdate.Bowl`(不单独引用 Core) | ✅ 已验证 |
| 无 Bowl | 只引用 `GeneralUpdate.Core` | ✅ 正常 |
| 两者都用 | 同时引用 Core + Bowl | ✅ 无冲突 |

### 2. Bowl LaunchAsync(v10.5.0-beta.4 ✅ 已验证)

`Bowl` 类在 v10.5.0-beta.4 中有公开的 `LaunchAsync` 方法:

### 2. Bowl LaunchAsync 可用性待确认
```csharp
public async Task<BowlResult> LaunchAsync(BowlContext context, CancellationToken ct = default)
```

v10.5.0-beta.4 中的 `Bowl` 类是否有公开的 `LaunchAsync` 方法需要在实际使用前确认。
如不可用,请保持事件回调替代方案。
- `BowlContext` 为 `readonly record struct`,支持 `Normalize()` 方法填充默认值
- `BowlResult` 包含 `Success` / `ExitCode` / `DumpCaptured` / `DumpFilePath` / `CrashReportPath` / `Restored`
- 不要求 `Bowl.LaunchAsync` 存在其它签名,模板已按实际 API 更新
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Covers 50+ known issues discovered from real GitHub/Gitee feedback, providing production-ready code generation and deep troubleshooting.

> Version: 0.0.2-bate.1 (2026-06-16) — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> Version: 0.0.2-beta.1 (2026-06-16) — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`

---

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Covers 50+ known issues discovered from real GitHub/Gitee feedback, providing production-ready code generation and deep troubleshooting.

> **Current Version: 0.0.2-bate.1** — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> **Current Version: 0.0.2-beta.1** — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> Compatibility: `v10.5.0-beta.4` (NuGet latest preview)
> All templates verified via `dotnet build` (0 errors).

Expand Down
2 changes: 1 addition & 1 deletion README.zh-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

覆盖 50+ 真实 Issue 发现的已知问题,提供即用型代码生成 + 深度故障排查。

> 当前版本:0.0.2-bate.1 — 针对 NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> 当前版本:0.0.2-beta.1 — 针对 NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> 兼容性:`v10.5.0-beta.4`(NuGet 最新预览版)
> **所有模板已通过 `dotnet build` 编译验证(0 errors)。**

Expand Down
121 changes: 121 additions & 0 deletions RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Release Checklist — GeneralUpdate Skill CodeGen

> Use this checklist before **every release** to ensure consistent quality.

## 🔢 Version & Manifest

- [ ] Version number is consistent across all files:
- [ ] `SKILL.md` (line ~49)
- [ ] `README.md`, `README.en.md`, `README.zh-Hans.md`
- [ ] `skill.json`
- [ ] `.claude-plugin/plugin.json`
- [ ] `.claude-plugin/marketplace.json` (metadata + plugin)
- [ ] `cli/package.json`
- [ ] `SKILL.md` version string uses correct spelling (`beta` not `bate`)
- [ ] Release date is updated in `README.en.md`

## 🧪 Validation

> Run `python3 .claude/scripts/generate.py --list` to confirm all 288 combinations resolve.

- [ ] CI — **Python search engine tests**
```bash
python3 -m pytest .claude/skills/generalupdate-troubleshoot/scripts/tests/ -v
```
- [ ] CI — **Python code generator smoke tests** (OSS+WPF, Silent+Console, Differential+Avalonia)
```bash
# OSS + WPF + Bowl
python3 .claude/scripts/generate.py --strategy oss --framework wpf-layui --bowl \
--project-name TestApp --version 1.0.0.0 -o /tmp/verify-oss

# Silent + Console
python3 .claude/scripts/generate.py --strategy silent --framework console \
--project-name MyService --version 2.0.0.0 -o /tmp/verify-silent

# Differential + Avalonia
python3 .claude/scripts/generate.py --strategy differential --framework avalonia-semiursa \
--project-name CrossApp --version 3.1.0.0 -o /tmp/verify-diff

# Verify output is valid
for f in $(find /tmp/verify-oss /tmp/verify-silent /tmp/verify-diff -name "*.cs" -o -name "*.json"); do
[ -s "$f" ] || { echo "❌ Empty: $f"; exit 1; }
file "$f" | grep -q "UTF-8\|ASCII\|text" || { echo "❌ Non-text: $f"; exit 1; }
done
```
- [ ] CI — **.NET template build verification** (MinimalIntegration + FullIntegration)
- Requires Windows + .NET SDK 10.0.x
- See `.github/workflows/ci.yml` → `dotnet-verify-templates` job
- [ ] CI — **Complete scaffold build** (ClientApp + UpgradeApp)
- See `.github/workflows/ci.yml` → `dotnet-verify-scaffold` job
- [ ] CI — **CLI TypeScript compilation**
```bash
cd cli
npm ci --ignore-scripts
npx tsc --noEmit
```

## 🔄 Sync

- [ ] Run asset sync (source → CLI bundle):
```bash
python3 .claude/scripts/_sync_all.py --apply
```
- [ ] Verify sync is complete:
```bash
python3 .claude/scripts/_sync_all.py --verify
```
- [ ] Confirm all changed files are committed:
- `git status` shows no untracked/modified files except the `dist/` build output
- The `.gitignore` includes `cli/dist/` (if tracking, add `cli/node_modules/` too)

## 📦 CLI Package

- [ ] CLI dependencies installed (`cd cli && npm ci --ignore-scripts`)
- [ ] TypeScript compiled successfully (`cd cli && npm run build`)
- [ ] `cli/dist/` exists and contains `.js` output
- [ ] Confirm CLI runs locally:
```bash
node cli/dist/index.js --help
```
- [ ] npm publish dry-run:
```bash
cd cli && npm publish --dry-run 2>&1
```
- Verify `package.json` files list includes `dist/`
- Verify no unintended files (node_modules, .ts) are included

## 🚀 GitHub Release

- [ ] All changes pushed to remote
- [ ] CI passes on `main` branch (or target release branch)
- [ ] Release tag created matching package version (e.g. `v0.0.2-beta.1`)
- [ ] GitHub Release created (via `release.yml` workflow or manually):
- Release title: `v{version}`
- Changelog: `feat:` / `fix:` / `docs:` / `chore:` sections from commit log
- Artifacts: `cli/dist/`, `cli/package.json`
- [ ] (Optional) npm publish:
```bash
cd cli && npm publish
```

## ✅ Post-Release

- [ ] Verify npm package is installable:
```bash
npx gskill-cli --help
```
- [ ] Verify marketplace listing updates (if auto-ingested)
- [ ] Update Gitee mirror if applicable
- [ ] Announce release in relevant channels

---

## 📊 Pre-Release Health Check

| Check | Command | Expected |
|-------|---------|----------|
| Search engine | `python3 search.py "method not found" -n 3 --json` | ≥1 match |
| Strategy lookup | `python3 search.py "OSS" --domain strategy -n 3 --json` | ≥1 match |
| Code gen combos | `python3 generate.py --list` | 336 combinations |
| No old API refs | `grep -r "Configinfo\|Common\.Shared" .claude/scripts/generate/templates/` | 0 |
| No `TODO`/`FIXME` | `grep -r "TODO\|FIXME" .claude/skills/ --include="*.md" --include="*.cs"` | 0 |
Loading