code-workspace-zhuiyi 0.1.0-beta.1 → 0.1.0-beta.11

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.
Files changed (149) hide show
  1. package/README.md +77 -21
  2. package/README.zh-CN.md +75 -19
  3. package/artifacts/manifest.json +39 -27
  4. package/artifacts/templates/agents/WORKSPACE_GUARD.md.template +9 -10
  5. package/artifacts/templates/agents/skills/code-workspace-resolve-branch/SKILL.md +4 -4
  6. package/artifacts/templates/agents/skills/code-workspace-resolve-branch/agents/openai.yaml +6 -0
  7. package/artifacts/templates/claude/commands/code-workspace/add-projects.md +51 -9
  8. package/artifacts/templates/codex/skills/code-workspace-add-projects/SKILL.md +48 -11
  9. package/artifacts/templates/codex/skills/code-workspace-add-projects/agents/openai.yaml +6 -0
  10. package/artifacts/templates/user-guide/en-US.md +39 -15
  11. package/artifacts/templates/user-guide/zh-CN.md +39 -15
  12. package/bin/code-workspace.js +2 -1
  13. package/docs/extension-architecture.zh-CN.md +33 -15
  14. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/SKILL.md +60 -0
  15. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/codex/openai.yaml +4 -0
  16. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/original-specs/ARCHIVE-MANIFEST.md +14 -0
  17. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/original-specs//345/217/214/345/215/201/347/272/242/347/272/277/350/247/204/350/214/203_GLM-OCR.md +288 -0
  18. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/original-specs//347/240/224/345/217/221/350/277/207/347/250/213/345/205/263/351/224/256/347/216/257/350/212/202/345/205/263/346/263/250/347/202/271_GLM-OCR.md +69 -0
  19. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/references/critical-correctness.md +53 -0
  20. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/references/data-performance.md +57 -0
  21. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/references/process-checkpoints.md +73 -0
  22. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/references/release-and-change.md +41 -0
  23. package/extensions/code-workspace-guangda-coding-spec/1.0.0/assets/references/security.md +107 -0
  24. package/extensions/code-workspace-guangda-coding-spec/1.0.0/init.js +71 -0
  25. package/extensions/code-workspace-guangda-coding-spec/1.0.0/manifest.json +29 -0
  26. package/extensions/code-workspace-issue-fix-summary/1.0.0/assets/SKILL.md +57 -0
  27. package/extensions/code-workspace-issue-fix-summary/1.0.0/assets/codex/openai.yaml +7 -0
  28. package/extensions/code-workspace-issue-fix-summary/1.0.0/init.js +62 -0
  29. package/extensions/code-workspace-issue-fix-summary/1.0.0/manifest.json +36 -0
  30. package/extensions/code-workspace-jira-prd-analysis/1.0.0/assets/SKILL.md +82 -0
  31. package/extensions/code-workspace-jira-prd-analysis/1.0.0/assets/codex/openai.yaml +7 -0
  32. package/extensions/code-workspace-jira-prd-analysis/1.0.0/init.js +62 -0
  33. package/extensions/code-workspace-jira-prd-analysis/1.0.0/manifest.json +36 -0
  34. package/extensions/code-workspace-jira-task-breakdown/1.0.0/assets/SKILL.md +56 -0
  35. package/extensions/code-workspace-jira-task-breakdown/1.0.0/assets/codex/openai.yaml +7 -0
  36. package/extensions/code-workspace-jira-task-breakdown/1.0.0/init.js +62 -0
  37. package/extensions/code-workspace-jira-task-breakdown/1.0.0/manifest.json +36 -0
  38. package/extensions/monitor/1.0.0/assets/i18n-icon.svg +1 -0
  39. package/extensions/monitor/1.0.0/assets/logo-vector.svg +30 -0
  40. package/extensions/monitor/1.0.0/assets/request_tip.mp3 +0 -0
  41. package/extensions/monitor/1.0.0/assets/session_finish.mp3 +0 -0
  42. package/extensions/monitor/1.0.0/init.js +38 -0
  43. package/extensions/monitor/1.0.0/manifest.json +40 -0
  44. package/{src/monitor/index.js → extensions/monitor/1.0.0/monitor.js} +9 -6
  45. package/extensions/monitor/1.0.0/runtime.js +76 -0
  46. package/extensions/monitor/1.1.0/assets/i18n-icon.svg +1 -0
  47. package/extensions/monitor/1.1.0/assets/logo-vector.svg +30 -0
  48. package/extensions/monitor/1.1.0/assets/request_tip.mp3 +0 -0
  49. package/extensions/monitor/1.1.0/assets/session_finish.mp3 +0 -0
  50. package/extensions/monitor/1.1.0/config-yaml.js +69 -0
  51. package/extensions/monitor/1.1.0/i18n/index.js +33 -0
  52. package/extensions/monitor/1.1.0/i18n/locales/en-US.js +85 -0
  53. package/extensions/monitor/1.1.0/i18n/locales/zh-CN.js +79 -0
  54. package/extensions/monitor/1.1.0/init.js +38 -0
  55. package/extensions/monitor/1.1.0/manifest.json +40 -0
  56. package/extensions/monitor/1.1.0/monitor.js +373 -0
  57. package/extensions/monitor/1.1.0/page.js +118 -0
  58. package/extensions/monitor/1.1.0/runtime.js +105 -0
  59. package/extensions/zhuiyi-jira-mcp/0.1.0/artifacts/claude/server.json +3 -1
  60. package/extensions/zhuiyi-jira-mcp/0.1.0/artifacts/codex/config.toml +2 -0
  61. package/extensions/zhuiyi-jira-mcp/0.1.0/artifacts/gitignore +2 -0
  62. package/extensions/zhuiyi-jira-mcp/0.1.0/init.js +3 -0
  63. package/extensions/zhuiyi-jira-mcp/0.1.0/lib/archive.js +9 -5
  64. package/extensions/zhuiyi-jira-mcp/0.1.0/manifest.json +9 -1
  65. package/extensions/zhuiyi-jira-mcp/1.0.0/artifacts/claude/server.json +21 -0
  66. package/extensions/zhuiyi-jira-mcp/1.0.0/artifacts/codex/config.toml +18 -0
  67. package/extensions/zhuiyi-jira-mcp/1.0.0/artifacts/gitignore +2 -0
  68. package/extensions/zhuiyi-jira-mcp/1.0.0/init.js +56 -0
  69. package/extensions/zhuiyi-jira-mcp/1.0.0/lib/archive.js +200 -0
  70. package/extensions/zhuiyi-jira-mcp/1.0.0/manifest.json +46 -0
  71. package/extensions/zhuiyi-jira-mcp/1.0.0/release.json +15 -0
  72. package/extensions/zhuiyi-jira-mcp/1.1.0/artifacts/claude/server.json +21 -0
  73. package/extensions/zhuiyi-jira-mcp/1.1.0/artifacts/codex/config.toml +18 -0
  74. package/extensions/zhuiyi-jira-mcp/1.1.0/artifacts/gitignore +2 -0
  75. package/extensions/zhuiyi-jira-mcp/1.1.0/init.js +54 -0
  76. package/extensions/zhuiyi-jira-mcp/1.1.0/lib/archive.js +200 -0
  77. package/extensions/zhuiyi-jira-mcp/1.1.0/manifest.json +40 -0
  78. package/extensions/zhuiyi-jira-mcp/1.1.0/mcp-launcher.js +69 -0
  79. package/extensions/zhuiyi-jira-mcp/1.1.0/release.json +15 -0
  80. package/extensions/zhuiyi-opensvn-mcp/0.1.0/artifacts/claude/server.json +12 -0
  81. package/extensions/zhuiyi-opensvn-mcp/0.1.0/artifacts/codex/config.toml +9 -0
  82. package/extensions/zhuiyi-opensvn-mcp/0.1.0/artifacts/gitignore +2 -0
  83. package/extensions/zhuiyi-opensvn-mcp/0.1.0/init.js +56 -0
  84. package/extensions/zhuiyi-opensvn-mcp/0.1.0/lib/archive.js +200 -0
  85. package/extensions/zhuiyi-opensvn-mcp/0.1.0/manifest.json +46 -0
  86. package/extensions/zhuiyi-opensvn-mcp/0.1.0/release.json +15 -0
  87. package/extensions/zhuiyi-opensvn-mcp/0.2.0/artifacts/claude/server.json +12 -0
  88. package/extensions/zhuiyi-opensvn-mcp/0.2.0/artifacts/codex/config.toml +9 -0
  89. package/extensions/zhuiyi-opensvn-mcp/0.2.0/artifacts/gitignore +2 -0
  90. package/extensions/zhuiyi-opensvn-mcp/0.2.0/init.js +53 -0
  91. package/extensions/zhuiyi-opensvn-mcp/0.2.0/lib/archive.js +200 -0
  92. package/extensions/zhuiyi-opensvn-mcp/0.2.0/manifest.json +40 -0
  93. package/extensions/zhuiyi-opensvn-mcp/0.2.0/mcp-launcher.js +69 -0
  94. package/extensions/zhuiyi-opensvn-mcp/0.2.0/release.json +15 -0
  95. package/package.json +3 -3
  96. package/schemas/extension-init-context-v1.json +5 -0
  97. package/schemas/extension-manifest-v3.json +81 -3
  98. package/schemas/extension-runtime-context-v1.json +39 -0
  99. package/schemas/extension-runtime-result-v1.json +37 -0
  100. package/spec/extension/v1/specification.en-US.md +62 -2
  101. package/spec/extension/v1/specification.zh-CN.md +58 -2
  102. package/src/cli/commands/completion.js +3 -3
  103. package/src/cli/commands/ext.js +45 -0
  104. package/src/cli/commands/extension.js +16 -5
  105. package/src/cli/commands/help.js +1 -1
  106. package/src/cli/commands/init.js +8 -10
  107. package/src/cli/commands/project-branch.js +2 -2
  108. package/src/cli/commands/project.js +68 -16
  109. package/src/cli/commands/update.js +9 -10
  110. package/src/cli/commands/workspace.js +0 -1
  111. package/src/cli/parser.js +51 -1
  112. package/src/cli/registry.js +4 -5
  113. package/src/cli.js +3 -7
  114. package/src/core/config.js +197 -56
  115. package/src/core/doctor.js +4 -10
  116. package/src/core/extension-artifacts.js +20 -3
  117. package/src/core/extension-runtime-contract.js +159 -0
  118. package/src/core/extension-runtime.js +474 -0
  119. package/src/core/extension-store.js +327 -0
  120. package/src/core/extensions.js +273 -45
  121. package/src/core/hooks.js +253 -0
  122. package/src/core/init.js +1 -1
  123. package/src/core/initializer.js +9 -20
  124. package/src/core/language.js +1 -1
  125. package/src/core/managed-files.js +13 -12
  126. package/src/core/permissions/claude.js +2 -2
  127. package/src/core/permissions/codex.js +2 -2
  128. package/src/core/project-configuration.js +4 -3
  129. package/src/hooks/adapters/claude.js +47 -0
  130. package/src/hooks/adapters/codex.js +47 -0
  131. package/src/hooks/adapters/common.js +49 -0
  132. package/src/hooks/adapters/index.js +18 -0
  133. package/src/hooks/index.js +5 -0
  134. package/src/index.js +8 -4
  135. package/src/init/plan.js +1 -2
  136. package/src/init/ui.js +9 -1
  137. package/src/init/wizard.js +5 -12
  138. package/artifacts/templates/codex/hooks.json +0 -86
  139. package/docs/extensions.md +0 -64
  140. package/docs/extensions.zh-CN.md +0 -64
  141. package/extensions/openspec-workspace/1.0.0/artifacts/claude/SKILL.md +0 -16
  142. package/extensions/openspec-workspace/1.0.0/artifacts/codex/SKILL.md +0 -16
  143. package/extensions/openspec-workspace/1.0.0/init.js +0 -54
  144. package/extensions/openspec-workspace/1.0.0/manifest.json +0 -27
  145. package/src/cli/commands/monitor.js +0 -62
  146. /package/{src/monitor → extensions/monitor/1.0.0}/i18n/index.js +0 -0
  147. /package/{src/monitor → extensions/monitor/1.0.0}/i18n/locales/en-US.js +0 -0
  148. /package/{src/monitor → extensions/monitor/1.0.0}/i18n/locales/zh-CN.js +0 -0
  149. /package/{src/monitor → extensions/monitor/1.0.0}/page.js +0 -0
package/README.md CHANGED
@@ -13,7 +13,7 @@ Code Workspace is a local multi-project registry and safety layer for Claude Cod
13
13
  npm install -g @icebearx-ai/code-workspace
14
14
  ```
15
15
 
16
- The package provides `code-workspace` and the shorter alias `code-w`.
16
+ The package provides the `code-workspace` command and the shorter `codew` alias. The legacy `code-w` alias remains available for compatibility.
17
17
 
18
18
  ## Initialize
19
19
 
@@ -33,43 +33,63 @@ code-workspace init . \
33
33
  --yes
34
34
  ```
35
35
 
36
- Use `--tools claude`, `--tools codex`, or `--tools none` to override the default tool selection. Codex monitoring is enabled by default when Codex is selected; use `--no-monitor` to disable it.
36
+ Use `--tools claude`, `--tools codex`, or `--tools none` to override the default tool selection. Monitoring is not enabled implicitly; install the `monitor` extension with `--extensions monitor` or through the interactive extension picker.
37
37
 
38
38
  Initialization writes only Workspace-owned state and integrations:
39
39
 
40
- - `.code-workspace/config.yaml` and `.code-workspace/state.json`
40
+ - `.code-workspace/config.yaml`, its referenced project configuration file (default: `.code-workspace/config-projects.yaml`), and `.code-workspace/state.json`
41
41
  - `USER_GUIDE.md`
42
42
  - `CLAUDE.md` and/or `AGENTS.md`
43
43
  - Workspace-specific commands and skills whose names start with `code-workspace-` or use the `/code-workspace` namespace
44
- - `.codex/hooks.json` when monitoring is enabled
44
+ - `.codex/hooks.json` is written by the `monitor` extension when that extension is installed
45
45
 
46
46
  It does not create `openspec/`, install native `/opsx` commands, or install native `openspec-*` skills.
47
47
 
48
48
  ### Experimental built-in extensions
49
49
 
50
- `init` can install integrations from the versioned `extensions/` repository shipped inside this npm package. Select extension names interactively, or pass a comma-separated name list non-interactively. The dedicated install command accepts one or more names; without names it opens the built-in extension multiselect, where ESC exits without changes:
50
+ `init` can install integrations from the versioned `extensions/` repository shipped inside this npm package. Select extension names interactively, or pass a comma-separated name list non-interactively. The dedicated install command accepts one or more names; without names it opens the built-in extension multiselect with no extensions selected, where each choice shows its name and a short description. ESC exits without changes:
51
51
 
52
52
  ```bash
53
- code-w init . --extensions openspec-workspace --yes
54
- code-w init . --extensions none --yes
55
- code-w extension install
56
- code-w extension install openspec-workspace --yes
57
- code-w extension uninstall openspec-workspace --yes
53
+ codew init . --extensions zhuiyi-jira-mcp --yes
54
+ codew init . --extensions zhuiyi-opensvn-mcp --yes
55
+ codew init . --extensions none --yes
56
+ codew extension install
57
+ codew extension install zhuiyi-jira-mcp --yes
58
+ codew extension install zhuiyi-opensvn-mcp --yes
59
+ codew extension install code-workspace-jira-prd-analysis --yes
60
+ codew extension install code-workspace-jira-task-breakdown --yes
61
+ codew extension install code-workspace-issue-fix-summary --yes
62
+ codew extension install code-workspace-guangda-coding-spec --yes
63
+ codew extension uninstall zhuiyi-jira-mcp --yes
64
+ codew extension uninstall code-workspace-jira-prd-analysis --yes
58
65
  ```
59
66
 
60
67
  The Workspace operation lock shared by init, extension install, and extension uninstall is configured in the Code Workspace project's `.env` (not in the target Workspace). `CODE_WORKSPACE_INIT_LOCK_UPDATE_MS` defaults to `5000`, and `CODE_WORKSPACE_INIT_LOCK_STALE_MS` defaults to `30000`; process environment variables take precedence. See `.env.example` for the project configuration names.
61
68
 
62
- Users select names, not versions; `openspec-workspace@1.0.0` is intentionally rejected. Code Workspace resolves the highest extension SemVer implemented against a Host-supported Extension Spec before confirmation. A new non-interactive Workspace installs no extensions unless `--extensions` is provided. Re-initializing an existing Workspace defaults to its installed extensions and upgrades them when a newer supported built-in version exists. `none` skips extension work and does not uninstall existing artifacts.
69
+ Users select names, not versions; `zhuiyi-jira-mcp@0.1.0` is intentionally rejected. Code Workspace resolves the highest extension SemVer implemented against a Host-supported Extension Spec before confirmation. A new non-interactive Workspace installs no extensions unless `--extensions` is provided. Re-initializing an existing Workspace defaults to its installed extensions and upgrades them when a newer supported built-in version exists. `none` skips extension work and does not uninstall existing artifacts.
63
70
 
64
71
  `extension install` does not rerun core Workspace initialization. In JSON, non-TTY, or `--yes` mode, at least one extension name is required. Multiple names are installed in order with one confirmation boundary and independent transactions; any failure makes the install command fail while later extensions still run.
65
72
 
66
- The bundled `openspec-workspace` extension installs a namespaced `code-workspace-openspec-propose` skill for the selected Agent tools. It does not create an `openspec/` directory or install native OpenSpec commands.
73
+ The bundled `zhuiyi-jira-mcp` and `zhuiyi-opensvn-mcp` extensions configure the Jira and OpenSVN MCP services for the selected Agent tools. They do not create an `openspec/` directory or install native OpenSpec commands.
74
+
75
+ The bundled `code-workspace-jira-prd-analysis`, `code-workspace-jira-task-breakdown`, and `code-workspace-issue-fix-summary` extensions install optional Codex and Claude Code skill files. They are independent extensions, are not installed by core `init` or `update`, and can be uninstalled separately. Install `zhuiyi-jira-mcp` separately when they need Jira access.
76
+
77
+ The bundled `code-workspace-guangda-coding-spec` extension installs a Codex and Claude Code skill that applies the China Everbright Bank research, security, testing, and release rules to Guangda customer projects. It is independent of core `init` and `update`, can be uninstalled separately, and requires no MCP service.
78
+
79
+ The MCP runtime packages are not copied into the Workspace. Only their configuration is stored there; a launcher prepares and caches each package on demand in the user-level Extension Store.
80
+
81
+ `zhuiyi-opensvn-mcp` accesses OpenSVN static resources through `opssvn.in.wezhuiyi.com`. Its bundled configuration sets `SVN_OUTPUT_DIR` to `.mcp-cache-opensvn`, requires `SVN_AUTHORIZATION`, and defaults `SVN_MAX_RESOURCES` to `200`; credentials are not stored in the extension package and should be supplied through local configuration or the runtime environment.
67
82
 
68
83
  Extension entries run in separate Node processes and generate files in temporary staging directories. The host rejects undeclared, missing, symbolic-link, non-file, path-escaping, conflicting, and checksum-mismatched artifacts before transactionally installing them. Per-Workspace state is stored in `.code-workspace/ext-manifest.json`. A failed extension is reported as a warning and does not roll back successful core initialization or stop later extensions; a failed upgrade restores and retains the previous installed version.
69
84
 
70
- Extensions may own complete files or contribute Host-managed Codex TOML blocks and Hook fragments. Shared targets are composed and verified by Code Workspace; extensions never patch the real Workspace directly. Uninstall uses recorded installed state and does not execute extension code. Unknown changes to extension-owned files or contributions stop the operation instead of being overwritten.
85
+ Extensions may own complete files or declare Host-managed abstract Hooks. Codex and Claude
86
+ adaptors render those declarations into each provider's native configuration and dynamically plug
87
+ or unplug them during extension install, upgrade, and uninstall. Shared targets are composed and
88
+ verified by Code Workspace; extensions never patch the real Workspace directly. Uninstall uses
89
+ recorded installed state and does not execute extension code. Unknown changes to extension-owned
90
+ files or contributions stop the operation instead of being overwritten.
71
91
 
72
- This is fault isolation, not a malicious-code security sandbox. The experimental release trusts only extension code shipped with Code Workspace; network sources, external extension directories, dependencies, arbitrary patches, force uninstall, disable commands, and automatic extension updates through `code-w update` are not supported. The developer contract is in `docs/extensions.md`.
92
+ This is fault isolation, not a malicious-code security sandbox. The experimental release trusts only extension code shipped with Code Workspace; network sources, external extension directories, dependencies, arbitrary patches, force uninstall, disable commands, and automatic extension updates through `codew update` are not supported. The developer contract is in `docs/extensions.md`.
73
93
 
74
94
  ## Register projects
75
95
 
@@ -85,14 +105,42 @@ Claude Code users can invoke:
85
105
  /code-workspace:add-projects /absolute/path/to/project-a /absolute/path/to/project-b
86
106
  ```
87
107
 
88
- Codex users can invoke `$code-workspace-add-projects` with the same explicit paths. For low-level automation, prepare a complete project record and run:
108
+ Codex users can invoke `$code-workspace-add-projects` with the same explicit paths. For low-level automation, pass complete project records through stdin:
89
109
 
90
110
  ```bash
91
- code-workspace project add --projects-file projects.json --yes --json
111
+ cat projects.json | code-workspace project add --stdin --yes --json
92
112
  ```
93
113
 
114
+ `--stdin` accepts `{ "schemaVersion": 1, "projects": [...] }` JSON with the same semantics as `--projects-file`, requires `--yes`, and fails before writing when input is empty, invalid, or larger than 1 MiB. `--stdin`, `--project-file`, `--projects-file`, and a positional path are mutually exclusive.
115
+
94
116
  The registry stores each project's name, real location, registered branch, type, and context. The registered branch is the Code Workspace expected state; the actual branch is observed from the selected Git worktree. Workspace never guesses a path from a conversation or automatically decides which branch is authoritative.
95
117
 
118
+ Project registration is always stored in a separate file in the `.code-workspace` directory. Initialization uses `config-projects.yaml` by default, while `projects.ref` may name any safe regular filename in that directory:
119
+
120
+ ```yaml
121
+ # .code-workspace/config.yaml
122
+ projects:
123
+ ref: config-projects.yaml
124
+ ```
125
+
126
+ The referenced file uses this format:
127
+
128
+ ```yaml
129
+ # .code-workspace/config-projects.yaml
130
+ schemaVersion: 1
131
+ projects:
132
+ - name: payments
133
+ location: /absolute/path/to/payments
134
+ branch: main
135
+ type: backend
136
+ context: |-
137
+ Service ownership and navigation context.
138
+ ```
139
+
140
+ `projects.ref` is resolved relative to `config.yaml`. It must be one safe regular filename in the same `.code-workspace` directory; URLs, globs, absolute paths, path traversal, and inline `projects` arrays are not supported. Existing project command arguments and behavior remain compatible, `project add` additionally supports `--stdin`, and project data is still read from and written to the referenced file. The `.code-workspace/` directory is ignored by default, so Git history for this local registry requires an explicit repository policy.
141
+
142
+ For example, `ref: team-projects.yaml` makes the project registry `.code-workspace/team-projects.yaml`; the default remains `config-projects.yaml`.
143
+
96
144
  ## Daily commands
97
145
 
98
146
  ```bash
@@ -117,11 +165,18 @@ The two reconciliation directions are deliberately separate:
117
165
 
118
166
  Both commands detect plan drift and verify postconditions. `project branch update-latest` is the separate, opt-in path for projects with `updateLatest: true`; it only fetches the configured upstream and fast-forwards a clean matching branch. Code Workspace never creates or downloads a branch and never performs stash, reset, rebase, non-fast-forward merge, production-code edits, or conflict resolution.
119
167
 
120
- Users may manually set the optional project policy in `.code-workspace/config.yaml`:
168
+ Users may manually set the optional project policy in the file named by `projects.ref` (default: `.code-workspace/config-projects.yaml`):
121
169
 
122
170
  ```yaml
171
+ # .code-workspace/config-projects.yaml
172
+ schemaVersion: 1
123
173
  projects:
124
174
  - name: payments
175
+ location: /absolute/path/to/payments
176
+ branch: main
177
+ type: backend
178
+ context: |-
179
+ Service ownership and navigation context.
125
180
  updateLatest: true
126
181
  ```
127
182
 
@@ -141,13 +196,14 @@ code-workspace language --json
141
196
 
142
197
  ## Monitor
143
198
 
199
+ Monitor ships as the built-in `monitor` extension. Install it into a workspace and run its dashboard through the generic extension runtime:
200
+
144
201
  ```bash
145
- code-workspace monitor --port 3211
202
+ code-workspace extension install monitor --yes
203
+ code-workspace ext monitor serve --port 3211
146
204
  ```
147
205
 
148
- The monitor binds to loopback, combines events from multiple initialized workspaces, and keeps hook reporting failure-open. Review and trust project hooks in Codex before relying on reports.
149
-
150
- ## Completion
206
+ The monitor binds to loopback, combines events from multiple initialized workspaces, and keeps hook reporting (`codew ext monitor report`) failure-open. Review and trust project hooks in Codex before relying on reports.
151
207
 
152
208
  ```bash
153
209
  code-workspace completion --shell zsh
package/README.zh-CN.md CHANGED
@@ -13,7 +13,7 @@ Code Workspace 是面向 Claude Code 与 Codex 的本地多项目注册表和安
13
13
  npm install -g @icebearx-ai/code-workspace
14
14
  ```
15
15
 
16
- 软件包提供 `code-workspace` 命令及短别名 `code-w`。
16
+ 软件包提供 `code-workspace` 命令及短别名 `codew`。为保持兼容,旧别名 `code-w` 仍然可用。
17
17
 
18
18
  ## 初始化
19
19
 
@@ -33,43 +33,61 @@ code-workspace init . \
33
33
  --yes
34
34
  ```
35
35
 
36
- 可用 `--tools claude`、`--tools codex` 或 `--tools none` 覆盖默认工具选择。选择 Codex 时默认启用监控;可传 `--no-monitor` 关闭。
36
+ 可用 `--tools claude`、`--tools codex` 或 `--tools none` 覆盖默认工具选择。监控不会隐式启用;请通过 `--extensions monitor` 或交互式扩展选择安装 `monitor` 扩展。
37
37
 
38
38
  初始化只写入 Workspace 自有状态和集成:
39
39
 
40
- - `.code-workspace/config.yaml` 与 `.code-workspace/state.json`
40
+ - `.code-workspace/config.yaml`、其引用的项目配置文件(默认:`.code-workspace/config-projects.yaml`)与 `.code-workspace/state.json`
41
41
  - `USER_GUIDE.md`
42
42
  - `CLAUDE.md` 和/或 `AGENTS.md`
43
43
  - 名称以 `code-workspace-` 开头或使用 `/code-workspace` 命名空间的 Workspace 专用命令与 Skill
44
- - 启用监控时的 `.codex/hooks.json`
44
+ - 安装 `monitor` 扩展时由扩展写入的 `.codex/hooks.json`
45
45
 
46
46
  它不会创建 `openspec/`,不会安装原生 `/opsx` 命令,也不会安装原生 `openspec-*` Skill。
47
47
 
48
48
  ### 试验性内置扩展
49
49
 
50
- `init` 可以从 npm 包内随附的版本化 `extensions/` 仓库安装集成。交互模式按扩展名多选;非交互模式传入逗号分隔的扩展名。独立安装命令接受一个或多个扩展名;不传名称时打开内置扩展多选,按 ESC 可无修改退出:
50
+ `init` 可以从 npm 包内随附的版本化 `extensions/` 仓库安装集成。交互模式按扩展名多选;非交互模式传入逗号分隔的扩展名。独立安装命令接受一个或多个扩展名;不传名称时打开内置扩展多选,每个选项显示名称和简短描述,且默认不勾选任何扩展,按 ESC 可无修改退出:
51
51
 
52
52
  ```bash
53
- code-w init . --extensions openspec-workspace --yes
54
- code-w init . --extensions none --yes
55
- code-w extension install
56
- code-w extension install openspec-workspace --yes
57
- code-w extension uninstall openspec-workspace --yes
53
+ codew init . --extensions zhuiyi-jira-mcp --yes
54
+ codew init . --extensions zhuiyi-opensvn-mcp --yes
55
+ codew init . --extensions none --yes
56
+ codew extension install
57
+ codew extension install zhuiyi-jira-mcp --yes
58
+ codew extension install zhuiyi-opensvn-mcp --yes
59
+ codew extension install code-workspace-jira-prd-analysis --yes
60
+ codew extension install code-workspace-jira-task-breakdown --yes
61
+ codew extension install code-workspace-issue-fix-summary --yes
62
+ codew extension install code-workspace-guangda-coding-spec --yes
63
+ codew extension uninstall zhuiyi-jira-mcp --yes
64
+ codew extension uninstall code-workspace-jira-prd-analysis --yes
58
65
  ```
59
66
 
60
67
  `init`、扩展安装和扩展卸载共享的 Workspace 操作锁配置在 Code Workspace 项目自身的 `.env` 中(不在目标 Workspace 中)。`CODE_WORKSPACE_INIT_LOCK_UPDATE_MS` 默认值为 `5000`,`CODE_WORKSPACE_INIT_LOCK_STALE_MS` 默认值为 `30000`;进程环境变量优先于 `.env`。配置项名称见 `.env.example`。
61
68
 
62
- 用户只选择扩展名,不能选择版本;`openspec-workspace@1.0.0` 会被明确拒绝。Code Workspace 在确认前,从 Host 明确支持的 Extension Spec 实现中解析最高扩展 SemVer。新 Workspace 非交互初始化时,未传 `--extensions` 就不安装扩展;已有 Workspace 重新初始化时,默认选择已安装扩展,并在存在更高受支持内置版本时升级。`none` 只跳过本次扩展初始化,不会卸载已有制品。
69
+ 用户只选择扩展名,不能选择版本;`zhuiyi-jira-mcp@0.1.0` 会被明确拒绝。Code Workspace 在确认前,从 Host 明确支持的 Extension Spec 实现中解析最高扩展 SemVer。新 Workspace 非交互初始化时,未传 `--extensions` 就不安装扩展;已有 Workspace 重新初始化时,默认选择已安装扩展,并在存在更高受支持内置版本时升级。`none` 只跳过本次扩展初始化,不会卸载已有制品。
63
70
 
64
71
  `extension install` 不会重新执行 Workspace 核心初始化。在 JSON、非 TTY 或 `--yes` 模式下,必须至少提供一个扩展名。多个名称按顺序安装,只确认一次且各自使用独立事务;任一扩展失败会使安装命令失败,但后续扩展仍会继续执行。
65
72
 
66
- 内置 `openspec-workspace` 扩展会为选中的 Agent 工具安装命名空间为 `code-workspace-openspec-propose` 的 Skill;它不会创建 `openspec/` 目录,也不会安装 OpenSpec 原生命令。
73
+ 当前随包提供的内置扩展包括 `zhuiyi-jira-mcp` 和 `zhuiyi-opensvn-mcp`,分别用于为选中的 Agent 工具配置 Jira MCP 与 OpenSVN MCP 服务;它们不会创建 `openspec/` 目录,也不会安装 OpenSpec 原生命令。
74
+
75
+ 随包还提供 `code-workspace-jira-prd-analysis`、`code-workspace-jira-task-breakdown` 和 `code-workspace-issue-fix-summary` 三个 Skill 扩展,用于安装可选的 Codex 与 Claude Code Skill 文件。它们不随核心 `init` 或 `update` 安装,可以独立安装和卸载;需要 Jira 访问时另行安装 `zhuiyi-jira-mcp`。
76
+
77
+ 随包还提供 `code-workspace-guangda-coding-spec` Skill 扩展,用于在光大客户项目按风险域落实研发、安全、测试与投产规范。它同样不随核心 `init` 或 `update` 安装,可以独立安装和卸载,且不依赖任何 MCP 服务。
78
+
79
+ 两个 MCP 的运行包不会复制到 Workspace;Workspace 只保存 MCP 配置,运行包由用户级 Extension Store 中的 launcher 按需缓存。
80
+
81
+ `zhuiyi-opensvn-mcp` 使用 `opssvn.in.wezhuiyi.com` 访问 OpenSVN 静态资源。内置配置将 `SVN_OUTPUT_DIR` 设为 `.mcp-cache-opensvn`,运行时必须提供 `SVN_AUTHORIZATION`,`SVN_MAX_RESOURCES` 默认为 `200`;认证信息不会写入扩展包,应通过本地配置或运行环境注入。
67
82
 
68
83
  扩展入口在独立 Node 进程中运行,只向临时 staging 目录生成文件。Host 会在事务安装前拒绝未声明、缺失、符号链接、非文件、路径逃逸、目标冲突和 hash 不匹配的制品。Workspace 状态存放在 `.code-workspace/ext-manifest.json`。扩展失败以 warning 报告,不回滚已成功的核心初始化,也不阻止后续扩展;升级失败会恢复并保留旧的已安装版本。
69
84
 
70
- 扩展可以独占完整文件,也可以贡献由 Host 管理的 Codex TOML 配置块和 Hook 片段。共享目标由 Code Workspace 合成和验证;扩展不会直接 patch 真实 Workspace。卸载只使用已安装状态,不执行扩展代码;扩展所有的文件或贡献存在未知修改时会拒绝覆盖或删除。
85
+ 扩展可以独占完整文件,也可以声明由 Host 管理的抽象 Hook。Host 通过 Codex/Claude adaptor
86
+ 把声明转换为各自的原生配置,并在扩展安装、升级和卸载时动态插拔;共享目标由 Code
87
+ Workspace 合成和验证,扩展不会直接 patch 真实 Workspace。卸载只使用已安装状态,不执行
88
+ 扩展代码;扩展所有的文件或贡献存在未知修改时会拒绝覆盖或删除。
71
89
 
72
- 这是故障隔离,不是恶意代码安全沙箱。试验版本只信任随 Code Workspace 发布的扩展代码;暂不支持网络源、外部扩展目录、扩展依赖、任意 patch、强制卸载、禁用命令,也不会通过 `code-w update` 自动更新扩展。开发契约见 `docs/extensions.zh-CN.md`。
90
+ 这是故障隔离,不是恶意代码安全沙箱。试验版本只信任随 Code Workspace 发布的扩展代码;暂不支持网络源、外部扩展目录、扩展依赖、任意 patch、强制卸载、禁用命令,也不会通过 `codew update` 自动更新扩展。开发契约见 `docs/extensions.zh-CN.md`。
73
91
 
74
92
  ## 注册项目
75
93
 
@@ -85,14 +103,42 @@ Claude Code 用户可显式调用:
85
103
  /code-workspace:add-projects /absolute/path/to/project-a /absolute/path/to/project-b
86
104
  ```
87
105
 
88
- Codex 用户可对相同的显式路径调用 `$code-workspace-add-projects`。底层自动化可准备完整项目记录,然后运行:
106
+ Codex 用户可对相同的显式路径调用 `$code-workspace-add-projects`。底层自动化可通过 stdin 一次传入完整项目记录:
89
107
 
90
108
  ```bash
91
- code-workspace project add --projects-file projects.json --yes --json
109
+ cat projects.json | code-workspace project add --stdin --yes --json
92
110
  ```
93
111
 
112
+ `--stdin` 接受 `{ "schemaVersion": 1, "projects": [...] }` 形式且与 `--projects-file` 相同语义的 JSON,必须与 `--yes` 一起使用,并在输入为空、无效或超过 1 MiB 时于写入前失败。`--stdin`、`--project-file`、`--projects-file` 与位置路径只能选择一个。
113
+
94
114
  注册表保存项目名称、真实路径、注册分支、类型和上下文。注册分支是 Code Workspace 的期望状态,实际分支是从选中 Git worktree 观测到的状态。Workspace 不会根据对话猜测路径,也不会自动判断哪一侧分支更权威。
95
115
 
116
+ 项目注册配置始终独立保存于 `.code-workspace` 目录下的单独文件。初始化默认使用 `config-projects.yaml`,但 `projects.ref` 可以引用该目录下任意安全的普通文件名:
117
+
118
+ ```yaml
119
+ # .code-workspace/config.yaml
120
+ projects:
121
+ ref: config-projects.yaml
122
+ ```
123
+
124
+ 引用文件使用以下格式:
125
+
126
+ ```yaml
127
+ # .code-workspace/config-projects.yaml
128
+ schemaVersion: 1
129
+ projects:
130
+ - name: payments
131
+ location: /absolute/path/to/payments
132
+ branch: main
133
+ type: backend
134
+ context: |-
135
+ 服务职责和代码导航上下文。
136
+ ```
137
+
138
+ `projects.ref` 相对于 `config.yaml` 解析,必须是同一 `.code-workspace` 目录下的安全普通文件名。不支持 URL、glob、绝对路径、路径逃逸或内联 `projects` 数组。项目命令的现有参数和行为保持兼容,`project add` 额外支持 `--stdin`;项目数据仍只读取和写入引用文件。`.code-workspace/` 默认被忽略;如需 Git 历史,需要显式制定仓库策略。
139
+
140
+ 例如,`ref: team-projects.yaml` 会将项目注册表放在 `.code-workspace/team-projects.yaml`;默认名称仍为 `config-projects.yaml`。
141
+
96
142
  ## 日常命令
97
143
 
98
144
  ```bash
@@ -117,11 +163,18 @@ code-workspace doctor --json
117
163
 
118
164
  两条命令都会检查计划漂移并验证后置条件。`project branch update-latest` 是独立的显式配置路径:仅当项目 `updateLatest: true` 时,才对干净且分支一致的 worktree fetch upstream 并 fast-forward。Code Workspace 不会创建或下载分支,也不会执行 stash、reset、rebase、非 fast-forward merge、生产代码编辑或冲突处理。
119
165
 
120
- 用户可以手动在 `.code-workspace/config.yaml` 中设置项目策略:
166
+ 用户可以手动在 `projects.ref` 指定的文件(默认:`.code-workspace/config-projects.yaml`)中设置项目策略:
121
167
 
122
168
  ```yaml
169
+ # .code-workspace/config-projects.yaml
170
+ schemaVersion: 1
123
171
  projects:
124
172
  - name: payments
173
+ location: /absolute/path/to/payments
174
+ branch: main
175
+ type: backend
176
+ context: |-
177
+ 服务职责和代码导航上下文。
125
178
  updateLatest: true
126
179
  ```
127
180
 
@@ -141,11 +194,14 @@ code-workspace language --json
141
194
 
142
195
  ## 监控
143
196
 
197
+ 监控以内置 `monitor` 扩展的形式提供。先在 Workspace 中安装扩展,再通过通用扩展运行时启动面板:
198
+
144
199
  ```bash
145
- code-workspace monitor --port 3211
200
+ code-workspace extension install monitor --yes
201
+ code-workspace ext monitor serve --port 3211
146
202
  ```
147
203
 
148
- 监控服务仅绑定 loopback,可汇总多个已初始化工作区的事件;hook 上报失败不会阻断 Agent。依赖监控前,请在 Codex 中检查并信任项目 hook。
204
+ 监控服务仅绑定 loopback,可汇总多个已初始化工作区的事件;hook 上报(`codew ext monitor report`)失败不会阻断 Agent。依赖监控前,请在 Codex 中检查并信任项目 hook。
149
205
 
150
206
  ## 命令补全
151
207
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "releaseVersion": "0.1.0-beta.1",
3
+ "releaseVersion": "0.1.0-beta.11",
4
4
  "requirements": {
5
5
  "node": ">=20.19.0"
6
6
  },
@@ -13,13 +13,13 @@
13
13
  "id": "workspace-user-guide-en-US",
14
14
  "kind": "asset",
15
15
  "path": "templates/user-guide/en-US.md",
16
- "sha256": "d6e3f59fc86262c4e71d2320fb2fba21394d7b4f099ef465fdec765d0b6c7754"
16
+ "sha256": "29101b634cfe38dbb31d47754984a07b472d2bef83b295f609a390ad01eb7ee6"
17
17
  },
18
18
  {
19
19
  "id": "workspace-user-guide-zh-CN",
20
20
  "kind": "asset",
21
21
  "path": "templates/user-guide/zh-CN.md",
22
- "sha256": "4dc207305a3975ab7272addedf3bc2930054e860c2b0b2b6e0e102f4457f5cc0"
22
+ "sha256": "105730f83450f8be44bdf69b6c25b782fd218215695e34b0dd204aa3fb6f61a5"
23
23
  }
24
24
  ],
25
25
  "managedFiles": [
@@ -49,7 +49,7 @@
49
49
  "allowMissing": true,
50
50
  "desired": {
51
51
  "source": "templates/agents/WORKSPACE_GUARD.md.template",
52
- "sha256": "6510cce83138fad46330d2c175506e56e9c98d5086195a699eafc7cc74163bf3"
52
+ "sha256": "bddb8e2ee25b7a63614b4297453e5803d2740fc475d97f5d8489dbaf17380c2c"
53
53
  },
54
54
  "render": {
55
55
  "variables": [
@@ -72,7 +72,7 @@
72
72
  "allowMissing": true,
73
73
  "desired": {
74
74
  "source": "templates/agents/WORKSPACE_GUARD.md.template",
75
- "sha256": "6510cce83138fad46330d2c175506e56e9c98d5086195a699eafc7cc74163bf3"
75
+ "sha256": "bddb8e2ee25b7a63614b4297453e5803d2740fc475d97f5d8489dbaf17380c2c"
76
76
  },
77
77
  "render": {
78
78
  "variables": [
@@ -87,63 +87,60 @@
87
87
  }
88
88
  },
89
89
  {
90
- "id": "workspace-codex-monitor-hooks",
91
- "target": ".codex/hooks.json",
90
+ "id": "workspace-claude-add-projects-command",
91
+ "target": ".claude/commands/code-workspace/add-projects.md",
92
92
  "tools": [
93
- "codex"
94
- ],
95
- "capabilities": [
96
- "monitor"
93
+ "claude"
97
94
  ],
98
95
  "allowMissing": true,
99
96
  "desired": {
100
- "source": "templates/codex/hooks.json",
101
- "sha256": "64d68809a2681b11d4b50bee3ca711fa8f5ea0a297c2281e5c7f8937e968e22e"
97
+ "source": "templates/claude/commands/code-workspace/add-projects.md",
98
+ "sha256": "177fbebf35383e1499c274007a2c577a7cd2f727407bcd0a0ca0511f4666dd6e"
102
99
  },
103
100
  "provenance": {
104
101
  "kind": "template"
105
102
  }
106
103
  },
107
104
  {
108
- "id": "workspace-claude-add-projects-command",
109
- "target": ".claude/commands/code-workspace/add-projects.md",
105
+ "id": "workspace-claude-add-projects-skill",
106
+ "target": ".claude/skills/code-workspace-add-projects/SKILL.md",
110
107
  "tools": [
111
108
  "claude"
112
109
  ],
113
110
  "allowMissing": true,
114
111
  "desired": {
115
- "source": "templates/claude/commands/code-workspace/add-projects.md",
116
- "sha256": "7cd5a47c88185d276c0c4c38e18577e009e5e6d4ed99062554ff116b7e8d1812"
112
+ "source": "templates/codex/skills/code-workspace-add-projects/SKILL.md",
113
+ "sha256": "1b3a10870bd748244d85945b9a2562b7b30a8792bcd6163d8d53ed73cd9ef619"
117
114
  },
118
115
  "provenance": {
119
116
  "kind": "template"
120
117
  }
121
118
  },
122
119
  {
123
- "id": "workspace-claude-add-projects-skill",
124
- "target": ".claude/skills/code-workspace-add-projects/SKILL.md",
120
+ "id": "workspace-codex-add-projects-skill",
121
+ "target": ".codex/skills/code-workspace-add-projects/SKILL.md",
125
122
  "tools": [
126
- "claude"
123
+ "codex"
127
124
  ],
128
125
  "allowMissing": true,
129
126
  "desired": {
130
127
  "source": "templates/codex/skills/code-workspace-add-projects/SKILL.md",
131
- "sha256": "f95847b00c93c2dd287247e226fecd6953286064dfde99b8ede830d181ef276f"
128
+ "sha256": "1b3a10870bd748244d85945b9a2562b7b30a8792bcd6163d8d53ed73cd9ef619"
132
129
  },
133
130
  "provenance": {
134
131
  "kind": "template"
135
132
  }
136
133
  },
137
134
  {
138
- "id": "workspace-codex-add-projects-skill",
139
- "target": ".codex/skills/code-workspace-add-projects/SKILL.md",
135
+ "id": "workspace-codex-add-projects-openai",
136
+ "target": ".codex/skills/code-workspace-add-projects/agents/openai.yaml",
140
137
  "tools": [
141
138
  "codex"
142
139
  ],
143
140
  "allowMissing": true,
144
141
  "desired": {
145
- "source": "templates/codex/skills/code-workspace-add-projects/SKILL.md",
146
- "sha256": "f95847b00c93c2dd287247e226fecd6953286064dfde99b8ede830d181ef276f"
142
+ "source": "templates/codex/skills/code-workspace-add-projects/agents/openai.yaml",
143
+ "sha256": "5aab2f33feb64c6d9d2da4125afebbd484cbd2cbb522d4faf47821ec2ef4d85a"
147
144
  },
148
145
  "provenance": {
149
146
  "kind": "template"
@@ -158,7 +155,7 @@
158
155
  "allowMissing": true,
159
156
  "desired": {
160
157
  "source": "templates/agents/skills/code-workspace-resolve-branch/SKILL.md",
161
- "sha256": "d09b0e1847f5b39e6409ba3ac43f26fa5829a15690a3e216576e51535fb6b161"
158
+ "sha256": "df8c65fbadf917b7247bbd1f40144da8c904a95f2b3ee905a4d2d6176e0a5f1b"
162
159
  },
163
160
  "provenance": {
164
161
  "kind": "template"
@@ -173,7 +170,22 @@
173
170
  "allowMissing": true,
174
171
  "desired": {
175
172
  "source": "templates/agents/skills/code-workspace-resolve-branch/SKILL.md",
176
- "sha256": "d09b0e1847f5b39e6409ba3ac43f26fa5829a15690a3e216576e51535fb6b161"
173
+ "sha256": "df8c65fbadf917b7247bbd1f40144da8c904a95f2b3ee905a4d2d6176e0a5f1b"
174
+ },
175
+ "provenance": {
176
+ "kind": "template"
177
+ }
178
+ },
179
+ {
180
+ "id": "workspace-codex-resolve-branch-openai",
181
+ "target": ".codex/skills/code-workspace-resolve-branch/agents/openai.yaml",
182
+ "tools": [
183
+ "codex"
184
+ ],
185
+ "allowMissing": true,
186
+ "desired": {
187
+ "source": "templates/agents/skills/code-workspace-resolve-branch/agents/openai.yaml",
188
+ "sha256": "66d111bbc40ac800cec568479ddd608eea9899ce53d1e660c30ef3c619c7c5a4"
177
189
  },
178
190
  "provenance": {
179
191
  "kind": "template"
@@ -9,13 +9,13 @@ The registry is authoritative for project identity, ownership, location, and the
9
9
  If the user explicitly names a registered project, resolve it directly:
10
10
 
11
11
  ```bash
12
- code-w project show "<project.name>" --json
12
+ codew project show "<project.name>" --json
13
13
  ```
14
14
 
15
15
  Only when project ownership cannot be determined, list registry metadata:
16
16
 
17
17
  ```bash
18
- code-w project list --json
18
+ codew project list --json
19
19
  ```
20
20
 
21
21
  Use `name`, `type`, and `context` only to identify relevant candidates and ask the user to choose. Do not inspect candidate repositories while selecting.
@@ -33,27 +33,26 @@ Meta, help, or workspace-tool maintenance tasks that do not depend on registered
33
33
  Before reading or modifying selected project code, run:
34
34
 
35
35
  ```bash
36
- code-w project verify "<project.name>" --json
36
+ codew project verify "<project.name>" --json
37
37
  ```
38
38
 
39
39
  For several explicitly selected projects, use:
40
40
 
41
41
  ```bash
42
- code-w project verify "<project-a>" "<project-b>" --json
42
+ codew project verify "<project-a>" "<project-b>" --json
43
43
  ```
44
44
 
45
45
  - For one project, continue only when the targeted result has `ok: true`. For a multi-project result, evaluate every ordered project result independently: continue passed projects and keep failed projects paused even when the top-level `ok` is false.
46
46
  - On `PROJECT_BRANCH_MISMATCH`, pause affected project work and invoke the installed `code-workspace-resolve-branch` Skill. The Skill may combine mismatches from the explicitly selected scope into one concise question; do not choose a branch direction yourself.
47
- - For any other failure, report the targeted diagnostics and wait for user direction for the affected project; a failure in one batch result does not block unrelated successful selected projects. Do not escalate to full-workspace validation.
48
- - The branch Skill completes after `project branch verify` confirms alignment; it does not own overall project readiness. After its handoff, discard branch-dependent context and rerun targeted `project verify` for the successfully reconciled projects before resuming work.
49
- - If that overall verification fails for a non-branch reason, keep the affected project paused and handle the project-level diagnostic here without treating the branch Skill as failed. If a new `PROJECT_BRANCH_MISMATCH` appears because the branch drifted again, re-enter the Skill. Do not list or verify unrelated projects.
47
+ - For any other failure, report the targeted diagnostics and wait for user direction for the affected project; a failure in one batch result does not block unrelated successful selected projects. Do not escalate to full-workspace validation. Do not list or verify unrelated projects.
48
+ - The branch Skill completes after `project branch verify` confirms alignment; it does not own overall project readiness. After its handoff, proceed directly to `project branch update-latest` without rerunning targeted `project verify`. If update-latest reports a new `PROJECT_BRANCH_MISMATCH`, re-enter the Skill using the new CLI observation.
50
49
  - After branch verification succeeds—including projects whose branches were already aligned—run `project branch update-latest` for the selected projects:
51
50
 
52
51
  ```bash
53
- code-w project branch update-latest "<project-a>" "<project-b>" --json
52
+ codew project branch update-latest "<project-a>" "<project-b>" --json
54
53
  ```
55
54
 
56
- Pass each selected project name as a separate argument; for a single project, pass only that project name. Evaluate each project result independently, including when the batch-level `ok` is `false`: continue only for projects whose individual result has `ok: true`, and treat `disabled` and `already-latest` as successful skips. If an update fails, keep that project paused and do not run ad-hoc `fetch`, `pull`, `reset`, `stash`, or `rebase` commands. For each successful or skipped project, discard pre-update context and rerun targeted `project verify` before starting project work.
55
+ Pass each selected project name as a separate argument; for a single project, pass only that project name. Evaluate each project result independently, including when the batch-level `ok` is `false`: continue only for projects whose individual result has `ok: true`, and treat `disabled` and `already-latest` as successful skips. If an update fails, keep that project paused and do not run ad-hoc `fetch`, `pull`, `reset`, `stash`, or `rebase` commands. Do not rerun targeted `project verify` after update-latest. For each `fastForwarded: true` result, discard pre-update context and re-read the project files and instructions before starting project work; `disabled` and `already-latest` results may continue with the existing context.
57
56
 
58
57
  ## Workspace Write Boundary
59
58
 
@@ -63,7 +62,7 @@ The AI/Agent MUST NOT directly create, edit, move, or delete Workspace-owned fil
63
62
  - `.codex/config.toml`
64
63
  - `CLAUDE.md`, `AGENTS.md`, or other managed workspace files
65
64
 
66
- AI/Agent registry changes must use an approved `code-w` command. Users may manually edit `.code-workspace/config.yaml` and are responsible for the resulting configuration; AI/Agent must not imitate that edit with a script or direct file write. The CLI owns confirmation, concurrency checks, persistence or safe external effects, postconditions, rollback/compensation, and structured output. This boundary does not prevent user-requested production-code changes inside the selected external `project.location`.
65
+ AI/Agent registry changes must use an approved `codew` command. Users may manually edit `.code-workspace/config.yaml` and are responsible for the resulting configuration; AI/Agent must not imitate that edit with a script or direct file write. The CLI owns confirmation, concurrency checks, persistence or safe external effects, postconditions, rollback/compensation, and structured output. This boundary does not prevent user-requested production-code changes inside the selected external `project.location`.
67
66
 
68
67
  ## Responsibilities
69
68
 
@@ -12,7 +12,7 @@ Resolve only the already selected registered project or projects. This Skill own
12
12
  Run one command from the Workspace for all selected projects whose targeted verification reported `PROJECT_BRANCH_MISMATCH`. Pass each project name as a separate argument; do not join names with commas:
13
13
 
14
14
  ```bash
15
- code-w project branch inspect "<project-a>" "<project-b>" --json
15
+ codew project branch inspect "<project-a>" "<project-b>" --json
16
16
  ```
17
17
 
18
18
  For one project, require the existing standard envelope whose `data` contains all of: `project.name`, `project.location`, `registeredBranch`, `actualBranch`, `matches`, `worktreeClean`, `registeredBranchExists`, and `remoteBranchCandidates`. For several projects, read the ordered `data.results`; each successful result contains those facts in its `data`, while failed results are explained by the top-level diagnostics. Do not infer or independently inspect missing values.
@@ -67,8 +67,8 @@ Ask rules:
67
67
 
68
68
  ## Apply valid choices through the CLI
69
69
 
70
- - Group every project that selected choice 1 into one `code-w project branch use-registered "<project-a>" "<project-b>" --allow-remote --yes --json` invocation. Include only projects for which choice 1 is available. `--allow-remote` is harmless for projects whose local registered branch already exists and permits creation only from an existing unique remote-tracking branch.
71
- - Group every project that selected choice 2 into one `code-w project branch accept-actual "<project-a>" "<project-b>" --yes --json` invocation.
70
+ - Group every project that selected choice 1 into one `codew project branch use-registered "<project-a>" "<project-b>" --allow-remote --yes --json` invocation. Include only projects for which choice 1 is available. `--allow-remote` is harmless for projects whose local registered branch already exists and permits creation only from an existing unique remote-tracking branch.
71
+ - Group every project that selected choice 2 into one `codew project branch accept-actual "<project-a>" "<project-b>" --yes --json` invocation.
72
72
  - For choice 3, keep that project paused until the user confirms manual resolution is complete. Do not reuse any pre-resolution branch facts.
73
73
 
74
74
  If the registered branch is absent both locally and from remote-tracking refs, do not add `--remote` automatically. Tell the user that an explicit direct CLI invocation such as `project branch use-registered <name> --remote origin --yes --json` is required to authorize network fetch.
@@ -80,7 +80,7 @@ After all choices are valid and complete, run each non-empty automatic direction
80
80
  After both automatic direction groups finish, collect projects whose operations succeeded or skipped together with projects that were already matching during inspection, discard their cached branch-dependent context, and run one branch-only verification. After the user confirms one or more manual resolutions, verify those confirmed projects the same way:
81
81
 
82
82
  ```bash
83
- code-w project branch verify "<project-a>" "<project-b>" --json
83
+ codew project branch verify "<project-a>" "<project-b>" --json
84
84
  ```
85
85
 
86
86
  Use each result independently. A successful result means branch reconciliation is complete and branch alignment has been verified for that project; a failed result remains unresolved. Complete all independent automatic operations and branch verification before giving one consolidated report of inspected failures, successful changes, skips, branch-verification failures, and projects awaiting manual handling.
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "Code Workspace Resolve Branches"
3
+ short_description: "解决分支不匹配问题(被动触发)"
4
+ default_prompt: "Use $code-workspace-resolve-branch to reconcile the selected projects' branch mismatch."
5
+ policy:
6
+ allow_implicit_invocation: false