From 9a8876003b61df1d35a2ff19572df25fb5b119b2 Mon Sep 17 00:00:00 2001 From: kingxiaozhe <46178858+kingxiaozhe@users.noreply.github.com> Date: Thu, 23 Jul 2026 18:35:03 +0800 Subject: [PATCH] fix: migrate Claude v0.9 command layout --- .codex-plugin/plugin.json | 2 +- VERSION | 2 +- docs/codebase-context/.scan-meta.json | 2 +- docs/codebase-context/01-overview.md | 4 ++-- docs/codebase-context/09-changelog.md | 1 + docs/installation.md | 2 ++ install.ps1 | 29 +++++++++++++++++++++++++++ install.sh | 23 +++++++++++++++++++++ 8 files changed, 60 insertions(+), 5 deletions(-) diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 8c70914..5d94599 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "zero-workflow", - "version": "1.0.0", + "version": "1.0.1", "description": "Evidence-first research workflow for Codex and Claude Code: collect mixed sources, cross-check claims, write cited reports, and verify every handoff.", "author": { "name": "Zero Workflow maintainers", diff --git a/VERSION b/VERSION index 3eefcb9..7dea76e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.0.1 diff --git a/docs/codebase-context/.scan-meta.json b/docs/codebase-context/.scan-meta.json index 0991f6b..80eef47 100644 --- a/docs/codebase-context/.scan-meta.json +++ b/docs/codebase-context/.scan-meta.json @@ -1 +1 @@ -{"lastScanTime":"2026-07-23T10:21:00Z","scanType":"full","projectRoot":"."} +{"lastScanTime":"2026-07-23T10:34:00Z","scanType":"full","projectRoot":"."} diff --git a/docs/codebase-context/01-overview.md b/docs/codebase-context/01-overview.md index 4020402..54c3ea5 100644 --- a/docs/codebase-context/01-overview.md +++ b/docs/codebase-context/01-overview.md @@ -10,8 +10,8 @@ Zero Workflow 是 Codex 原生、Claude Code 兼容的证据优先研究工作 | 层 | 技术 | 版本 | | ---- | ---- | ---- | -| 流程语言 | Markdown Skills + runtime contracts | 仓库 v1.0.0 | -| 插件 | Codex plugin manifest | v1.0.0 | +| 流程语言 | Markdown Skills + runtime contracts | 仓库 v1.0.1 | +| 插件 | Codex plugin manifest | v1.0.1 | | 安装器 | Bash、PowerShell | macOS/Linux/Windows | | 校验 | Python 3、Bash、Gitleaks | 无项目级包依赖 | | 主运行时 | Codex | Skills 原生发现 | diff --git a/docs/codebase-context/09-changelog.md b/docs/codebase-context/09-changelog.md index b930fa9..9d956ab 100644 --- a/docs/codebase-context/09-changelog.md +++ b/docs/codebase-context/09-changelog.md @@ -4,3 +4,4 @@ | ---- | ---- | ---- | ---- | | 2026-07-23T10:07Z | full | 首次非 npm 全量扫描;31 文件、约 1,560 行 | 全部 10 份 | | 2026-07-23T10:21Z | refactor | 更新为 Codex 原生 v1.0.0 双运行时结构、安装器与 CI | 全部 10 份 | +| 2026-07-23T10:34Z | patch | v1.0.1 清理 v0.9.x 旧命令入口,避免 Claude 重复发现 | 01、09、installation | diff --git a/docs/installation.md b/docs/installation.md index fbb1aa3..2304d6c 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -25,6 +25,8 @@ Set `CLAUDE_HOME` to test an isolated destination. Use `--yes` to replace conflicting files without prompts. The installer copies Skills, runtime contracts, the optional agent, scripts, and templates. It also generates `/zw:report` and `/zw:check` aliases from portable wrapper filenames. +When upgrading from v0.9.x, it removes only the old managed `commands/zw.md` +and R1–R8 node files; unrelated files in `commands/` are preserved. ## Claude Code on Windows diff --git a/install.ps1 b/install.ps1 index 832b1bb..3bb4c32 100644 --- a/install.ps1 +++ b/install.ps1 @@ -28,6 +28,35 @@ function Copy-TreeSafely { Write-Host "Zero Workflow Claude compatibility install v$Version" Write-Host "Target: $Dest" + +$legacyCommands = @( + "commands\zw.md", + "commands\zw-report-nodes\R1-init.md", + "commands\zw-report-nodes\R2-collect.md", + "commands\zw-report-nodes\R3-read.md", + "commands\zw-report-nodes\R4-crosscheck.md", + "commands\zw-report-nodes\R5-analyze.md", + "commands\zw-report-nodes\R6-write.md", + "commands\zw-report-nodes\R7-verify.md", + "commands\zw-report-nodes\R8-deliver.md" +) +$removedLegacy = 0 +foreach ($relative in $legacyCommands) { + $legacyPath = Join-Path $Dest $relative + if (Test-Path $legacyPath -PathType Leaf) { + Remove-Item $legacyPath -Force + $removedLegacy += 1 + } +} +$legacyNodeDirectory = Join-Path $Dest "commands\zw-report-nodes" +if ((Test-Path $legacyNodeDirectory) -and + -not (Get-ChildItem $legacyNodeDirectory -Force | Select-Object -First 1)) { + Remove-Item $legacyNodeDirectory -Force +} +if ($removedLegacy -gt 0) { + Write-Host "Removed $removedLegacy legacy managed command files" +} + foreach ($part in "skills", "agents", "runtime", "scripts", "compat") { Copy-TreeSafely (Join-Path $Src $part) (Join-Path $Dest $part) $part } diff --git a/install.sh b/install.sh index b0c2504..7b9d1c8 100755 --- a/install.sh +++ b/install.sh @@ -54,10 +54,33 @@ copy_file() { echo "Installed $label" } +migrate_legacy_commands() { + removed=0 + for relative in \ + commands/zw.md \ + commands/zw-report-nodes/R1-init.md \ + commands/zw-report-nodes/R2-collect.md \ + commands/zw-report-nodes/R3-read.md \ + commands/zw-report-nodes/R4-crosscheck.md \ + commands/zw-report-nodes/R5-analyze.md \ + commands/zw-report-nodes/R6-write.md \ + commands/zw-report-nodes/R7-verify.md \ + commands/zw-report-nodes/R8-deliver.md; do + if [ -f "$DEST/$relative" ]; then + rm -f "$DEST/$relative" + removed=$((removed + 1)) + fi + done + rmdir "$DEST/commands/zw-report-nodes" 2>/dev/null || true + [ "$removed" -eq 0 ] || echo "Removed $removed legacy managed command files" +} + echo "Zero Workflow Claude compatibility install v$VERSION" echo "Source: $SRC_DIR" echo "Target: $DEST" +migrate_legacy_commands + for part in skills agents runtime scripts compat; do copy_tree "$SRC_DIR/$part" "$DEST/$part" "$part" done