code-workspace-zhuiyi 0.1.0-beta.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.
Files changed (98) hide show
  1. package/.env.example +3 -0
  2. package/LICENSE +21 -0
  3. package/README.md +168 -0
  4. package/README.zh-CN.md +168 -0
  5. package/artifacts/manifest.json +183 -0
  6. package/artifacts/templates/USER_GUIDE.template.md +1 -0
  7. package/artifacts/templates/agents/WORKSPACE_GUARD.md.template +73 -0
  8. package/artifacts/templates/agents/skills/code-workspace-resolve-branch/SKILL.md +88 -0
  9. package/artifacts/templates/agents/skills/code-workspace-resolve-branch/evals/evals.json +45 -0
  10. package/artifacts/templates/claude/commands/code-workspace/add-projects.md +23 -0
  11. package/artifacts/templates/codex/hooks.json +86 -0
  12. package/artifacts/templates/codex/skills/code-workspace-add-projects/SKILL.md +28 -0
  13. package/artifacts/templates/user-guide/en-US.md +97 -0
  14. package/artifacts/templates/user-guide/zh-CN.md +97 -0
  15. package/assets/i18n-icon.svg +1 -0
  16. package/assets/logo-vector.svg +30 -0
  17. package/assets/request_tip.mp3 +0 -0
  18. package/assets/session_finish.mp3 +0 -0
  19. package/bin/code-workspace.js +11 -0
  20. package/docs/extension-architecture.zh-CN.md +429 -0
  21. package/docs/extensions.md +64 -0
  22. package/docs/extensions.zh-CN.md +64 -0
  23. package/extensions/openspec-workspace/1.0.0/artifacts/claude/SKILL.md +16 -0
  24. package/extensions/openspec-workspace/1.0.0/artifacts/codex/SKILL.md +16 -0
  25. package/extensions/openspec-workspace/1.0.0/init.js +54 -0
  26. package/extensions/openspec-workspace/1.0.0/manifest.json +27 -0
  27. package/extensions/zhuiyi-jira-mcp/0.1.0/artifacts/claude/server.json +14 -0
  28. package/extensions/zhuiyi-jira-mcp/0.1.0/artifacts/codex/config.toml +11 -0
  29. package/extensions/zhuiyi-jira-mcp/0.1.0/init.js +53 -0
  30. package/extensions/zhuiyi-jira-mcp/0.1.0/lib/archive.js +196 -0
  31. package/extensions/zhuiyi-jira-mcp/0.1.0/manifest.json +38 -0
  32. package/extensions/zhuiyi-jira-mcp/0.1.0/release.json +15 -0
  33. package/package.json +58 -0
  34. package/schemas/extension-init-context-v1.json +39 -0
  35. package/schemas/extension-init-result-v1.json +42 -0
  36. package/schemas/extension-manifest-v1.json +55 -0
  37. package/schemas/extension-manifest-v2.json +84 -0
  38. package/schemas/extension-manifest-v3.json +84 -0
  39. package/spec/extension/v1/specification.en-US.md +171 -0
  40. package/spec/extension/v1/specification.zh-CN.md +170 -0
  41. package/src/cli/commands/completion.js +203 -0
  42. package/src/cli/commands/extension.js +193 -0
  43. package/src/cli/commands/help.js +36 -0
  44. package/src/cli/commands/init.js +200 -0
  45. package/src/cli/commands/monitor.js +62 -0
  46. package/src/cli/commands/permissions.js +33 -0
  47. package/src/cli/commands/project-branch-update.js +107 -0
  48. package/src/cli/commands/project-branch.js +433 -0
  49. package/src/cli/commands/project.js +259 -0
  50. package/src/cli/commands/update.js +146 -0
  51. package/src/cli/commands/workspace.js +24 -0
  52. package/src/cli/confirmation.js +22 -0
  53. package/src/cli/parser.js +108 -0
  54. package/src/cli/registry.js +108 -0
  55. package/src/cli/renderer.js +20 -0
  56. package/src/cli/result.js +118 -0
  57. package/src/cli.js +76 -0
  58. package/src/core/assets.js +83 -0
  59. package/src/core/config.js +378 -0
  60. package/src/core/diagnostics.js +20 -0
  61. package/src/core/directory-digest.js +34 -0
  62. package/src/core/doctor.js +115 -0
  63. package/src/core/errors.js +10 -0
  64. package/src/core/extension-artifacts-legacy.js +180 -0
  65. package/src/core/extension-artifacts.js +310 -0
  66. package/src/core/extensions.js +1216 -0
  67. package/src/core/fs.js +32 -0
  68. package/src/core/init-lock-holder.js +30 -0
  69. package/src/core/init-lock.js +159 -0
  70. package/src/core/init.js +160 -0
  71. package/src/core/initializer.js +233 -0
  72. package/src/core/language.js +102 -0
  73. package/src/core/managed-files.js +334 -0
  74. package/src/core/migration.js +68 -0
  75. package/src/core/permissions/claude.js +92 -0
  76. package/src/core/permissions/codex.js +126 -0
  77. package/src/core/permissions/common.js +44 -0
  78. package/src/core/permissions/index.js +163 -0
  79. package/src/core/project-branch-update.js +424 -0
  80. package/src/core/project-configuration.js +55 -0
  81. package/src/core/project.js +674 -0
  82. package/src/core/tools.js +34 -0
  83. package/src/core/transaction.js +132 -0
  84. package/src/core/validation.js +186 -0
  85. package/src/i18n/index.js +11 -0
  86. package/src/i18n/interpolate.js +7 -0
  87. package/src/i18n/locales/en-US.js +10 -0
  88. package/src/i18n/locales/zh-CN.js +11 -0
  89. package/src/i18n/registry.js +42 -0
  90. package/src/index.js +25 -0
  91. package/src/init/plan.js +12 -0
  92. package/src/init/ui.js +61 -0
  93. package/src/init/wizard.js +97 -0
  94. package/src/monitor/i18n/index.js +33 -0
  95. package/src/monitor/i18n/locales/en-US.js +85 -0
  96. package/src/monitor/i18n/locales/zh-CN.js +79 -0
  97. package/src/monitor/index.js +344 -0
  98. package/src/monitor/page.js +118 -0
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: code-workspace-resolve-branch
3
+ description: Resolve `PROJECT_BRANCH_MISMATCH` for one or more already selected Code Workspace projects before project work. Use this Skill whenever targeted verification reports registered/actual branch mismatches; it gathers canonical facts, presents a deterministic structured choice, delegates every automatic direction to the branch CLI, and verifies branch alignment.
4
+ ---
5
+
6
+ # Resolve Workspace Project Branches
7
+
8
+ Resolve only the already selected registered project or projects. This Skill owns branch reconciliation only; Workspace Guard decides whether project work can resume.
9
+
10
+ ## Inspect canonical facts
11
+
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
+
14
+ ```bash
15
+ code-w project branch inspect "<project-a>" "<project-b>" --json
16
+ ```
17
+
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.
19
+
20
+ Keep failed inspections paused and exclude them from the choice, but continue with every project whose canonical facts were returned. If no project was inspected successfully, report the collected diagnostics and stop.
21
+
22
+ If `matches` is already true, omit that project from the choice and proceed to branch-alignment verification. Do not inspect or include projects outside the already selected scope.
23
+
24
+ ## Keep the ASK structure stable
25
+
26
+ Different models may choose different wording, but preserve the following presentation shape so users can scan the same information consistently:
27
+
28
+ ```text
29
+ [mismatch introduction and request for a decision]
30
+
31
+ [multi-project only: A:] [project name]
32
+ [registered-branch label]: [registered branch][optional annotation when the branch is missing locally]
33
+ [actual-branch label]: [actual branch][optional annotation when the worktree is unclean]
34
+
35
+ [multi-project only: B:] [project name]
36
+ [registered-branch label]: [registered branch][optional annotation]
37
+ [actual-branch label]: [actual branch][optional annotation]
38
+
39
+ [continue in inspection order, with one blank line between project blocks]
40
+
41
+ [choice prompt; for one project, state that only available choices are shown]
42
+ 1. [use the registered branch]
43
+ 2. [accept the actual branch]
44
+ 3. [handle manually without an automatic Git operation]
45
+
46
+ [request a decision for each project]
47
+
48
+ [multi-project only: reply-format heading]
49
+ [explain that one number applies to every project, while labelled selections such as A1 B2 C3 apply per project]
50
+ [explain that labels are case-insensitive and commas, spaces, or line breaks are accepted as separators]
51
+
52
+ [multi-project only, and only when a choice is unavailable: important-notes heading]
53
+ [project label]: choice 1 is unavailable — [one canonical reason]
54
+ [one line for each additional project/reason]
55
+
56
+ [multi-project only: explain that an unavailable selection is re-asked only for that project, valid selections are retained, and no state changes occur until every selection is valid and complete]
57
+ ```
58
+
59
+ Ask rules:
60
+
61
+ - Replace the bracketed instructions with user-facing text without exposing them. Keep inspection order, three non-bulleted lines per project, blank lines between projects, and only the two abnormal annotations shown in the template.
62
+ - Choice 1 is available when the worktree is clean and either the registered branch exists locally or exactly one `remoteBranchCandidates` entry is available. When only a remote-tracking candidate is available, explain that choosing 1 will create a local tracking branch; do not fetch implicitly. Choices 2 and 3 remain available. Do not recommend a default or invent another recovery direction.
63
+ - For one project, omit everything marked multi-project only, state that only available choices are shown, and preserve the semantic numbers of those choices.
64
+ - For several projects, keep stable letter labels and all three choices. Include every applicable unavailable reason, with one project and one reason per line.
65
+ - Accept either one bare number for every project or labelled selections, never both. In labelled mode, accept partial replies, but treat unknown labels or options and duplicate or conflicting labels as invalid. Retain other valid selections and re-ask only for missing, unavailable, or invalid projects.
66
+ - Do not mutate state until all choices are valid and complete. If an ASK control cannot preserve the template, use a normal user-facing question.
67
+
68
+ ## Apply valid choices through the CLI
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.
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
+
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.
75
+
76
+ After all choices are valid and complete, run each non-empty automatic direction group once. A batch command can return `ok: false` after still completing other projects, so inspect its ordered results instead of treating the whole group as unprocessed. Continue with the other automatic direction group even when the first group contains failures. Do not fall back to direct Git commands, direct Workspace configuration editing, or an improvised recovery direction.
77
+
78
+ ## Verify branch alignment in one targeted batch
79
+
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
+
82
+ ```bash
83
+ code-w project branch verify "<project-a>" "<project-b>" --json
84
+ ```
85
+
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.
87
+
88
+ Hand successful projects back to Workspace Guard. Later non-branch project issues do not reopen or fail this Skill. If later branch drift is observed, the Guard may invoke this Skill again. Do not inspect any registered project outside the selected scope.
@@ -0,0 +1,45 @@
1
+ {
2
+ "skill_name": "code-workspace-resolve-branch",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "Use the Skill to present the ASK only; do not run a CLI command or resolve the branch. Canonical inspection facts: one project named api, registered branch main, actual branch feature/login, matches false, worktreeClean true, registeredBranchExists true.",
7
+ "expected_output": "A concise single-project ASK with one unlabeled three-line project block and all three available choices.",
8
+ "files": [],
9
+ "expectations": [
10
+ "The project name, registered branch, and actual branch appear on three consecutive non-bulleted lines.",
11
+ "The choice prompt states that the displayed choices are available choices.",
12
+ "Choices 1, 2, and 3 are shown with their stable semantics.",
13
+ "No letter label, reply-format section, or important-notes section is shown.",
14
+ "No CLI command or state change is performed."
15
+ ]
16
+ },
17
+ {
18
+ "id": 2,
19
+ "prompt": "Use the Skill to present the ASK only; do not run a CLI command or resolve the branch. Canonical inspection facts: one project named api, registered branch main, actual branch feature/login, matches false, worktreeClean false, registeredBranchExists false.",
20
+ "expected_output": "A single-project ASK that annotates both abnormal facts and shows only choices 2 and 3 with their original numbers.",
21
+ "files": [],
22
+ "expectations": [
23
+ "The registered-branch line indicates that the branch is missing locally.",
24
+ "The actual-branch line indicates that the worktree is unclean.",
25
+ "Choice 1 is omitted while choices 2 and 3 retain their semantic numbers.",
26
+ "The choice prompt states that only available choices are shown.",
27
+ "No reply-format section or important-notes section is shown.",
28
+ "No CLI command or state change is performed."
29
+ ]
30
+ },
31
+ {
32
+ "id": 3,
33
+ "prompt": "Use the Skill to present and validate a multi-project ASK without running a CLI command. Canonical facts in order: api has registered main, actual feature/api, worktreeClean true, registeredBranchExists true; worker has registered main, actual feature/worker, worktreeClean false, registeredBranchExists false; web has registered main, actual feature/web, worktreeClean true, registeredBranchExists false. After presenting the ASK, process the user reply `1 B2`.",
34
+ "expected_output": "A three-project ASK with stable blocks and complete unavailable reasons, followed by rejection of the mixed global-and-labelled reply without changing state.",
35
+ "files": [],
36
+ "expectations": [
37
+ "Projects A, B, and C appear in inspection order with three non-bulleted lines per project and blank lines between blocks.",
38
+ "All three choices and the multi-project reply-format section are shown.",
39
+ "The important-notes section contains two separate choice-1 reasons for project B and one reason for project C.",
40
+ "The reply `1 B2` is rejected because bare-number and labelled modes cannot be mixed.",
41
+ "No project selection is executed and no CLI command or state change is performed."
42
+ ]
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: When explicitly invoked with one or more project paths, inspect Git worktrees read-only, generate concise project context, register the completed local records, and apply Agent directory authorization.
3
+ argument-hint: "<project path> [additional project paths]"
4
+ ---
5
+
6
+ Run this workflow only when the user explicitly invokes `/code-workspace:add-projects` and provides one or more project paths. Do not infer this invocation from a general request to inspect, update, or add a project. The values in `$ARGUMENTS` are the project paths; preserve quoted paths as single arguments. If no path is provided, ask the user for one or more paths and do not inspect or modify anything.
7
+
8
+ Expected invocation: `/code-workspace:add-projects /absolute/path/to/project-a /absolute/path/to/project-b`
9
+
10
+ Before inspecting projects, run `code-workspace language --json` once. Require the standard envelope fields `schemaVersion`, `ok`, `command`, `data`, and `diagnostics`, then use `data.language` and the labels in `data.projectContext` for every generated project context in this invocation.
11
+
12
+ For each supplied path:
13
+
14
+ 1. Run `code-workspace project inspect "<path>" --json`. Treat only its location, branch, manifest-file list, README-file list, and top-level entry list as CLI-verified facts.
15
+ 2. Inspect the repository read-only. Read only what is needed to understand it, starting with README files, root manifests, and relevant entry points or module directories. Do not modify the project repository.
16
+ 3. Produce a complete project record with `name`, canonical `location`, current `branch`, a concise semantic `type`, and `context`.
17
+ 4. Generate `context` as concise, stable project navigation for an AI that has not read the repository. Use exactly four semantic lines in this order: `responsibility`, `technologyStack`, `codeLocations`, and `projectBoundary`. Prefix each line with the corresponding label returned in `data.projectContext`; do not translate or replace those labels yourself. Write descriptions in the returned workspace `data.language`. Keep project names, paths, branches, technology names, identifiers, and code symbols unchanged. Prefer 150-400 Chinese characters or comparable English length. Do not include exhaustive dependencies, volatile command details, filler, or unsupported guesses.
18
+
19
+ Present all completed records for confirmation. After confirmation, write them to a temporary JSON document with `schemaVersion: 1` and a non-empty `projects` array, then run `code-workspace project add --projects-file <temporary-json-file> --yes --json` followed by `code-workspace project verify --json`.
20
+
21
+ Do not hand-edit `.code-workspace/config.yaml` or permission files. Completion requires successful registration, authorization application, and project verification.
22
+
23
+ $ARGUMENTS
@@ -0,0 +1,86 @@
1
+ {
2
+ "description": "Report Codex Agent lifecycle events to Code Workspace Monitor.",
3
+ "hooks": {
4
+ "UserPromptSubmit": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "code-w monitor report",
10
+ "timeout": 1
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "PermissionRequest": [
16
+ {
17
+ "matcher": "*",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "code-w monitor report",
22
+ "timeout": 1
23
+ }
24
+ ]
25
+ }
26
+ ],
27
+ "PostToolUse": [
28
+ {
29
+ "matcher": "*",
30
+ "hooks": [
31
+ {
32
+ "type": "command",
33
+ "command": "code-w monitor report",
34
+ "timeout": 1
35
+ }
36
+ ]
37
+ }
38
+ ],
39
+ "SubagentStart": [
40
+ {
41
+ "matcher": "*",
42
+ "hooks": [
43
+ {
44
+ "type": "command",
45
+ "command": "code-w monitor report",
46
+ "timeout": 1
47
+ }
48
+ ]
49
+ }
50
+ ],
51
+ "SubagentStop": [
52
+ {
53
+ "matcher": "*",
54
+ "hooks": [
55
+ {
56
+ "type": "command",
57
+ "command": "code-w monitor report",
58
+ "timeout": 1
59
+ }
60
+ ]
61
+ }
62
+ ],
63
+ "Stop": [
64
+ {
65
+ "hooks": [
66
+ {
67
+ "type": "command",
68
+ "command": "code-w monitor report",
69
+ "timeout": 1
70
+ }
71
+ ]
72
+ }
73
+ ],
74
+ "SessionEnd": [
75
+ {
76
+ "hooks": [
77
+ {
78
+ "type": "command",
79
+ "command": "code-w monitor report",
80
+ "timeout": 1
81
+ }
82
+ ]
83
+ }
84
+ ]
85
+ }
86
+ }
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: code-workspace-add-projects
3
+ description: When explicitly invoked with one or more project paths, inspect Git worktrees read-only, generate concise AI project context, register the completed records locally, and apply Agent directory authorization.
4
+ ---
5
+
6
+ # Add local projects
7
+
8
+ Run this workflow only when the user explicitly invokes `$code-workspace-add-projects` and provides one or more project paths. Do not infer this invocation from a general request to inspect, update, or add a project. The arguments after the skill name are the project paths; preserve quoted paths as single arguments. If no path is provided, ask the user for one or more paths and do not inspect or modify anything.
9
+
10
+ Expected invocation: `$code-workspace-add-projects /absolute/path/to/project-a /absolute/path/to/project-b`
11
+
12
+ Before inspecting projects, run `code-workspace language --json` once. Require the standard envelope fields `schemaVersion`, `ok`, `command`, `data`, and `diagnostics`, then use `data.language` and the labels in `data.projectContext` for every generated project context in this invocation.
13
+
14
+ For each supplied path:
15
+
16
+ 1. Run `code-workspace project inspect "<path>" --json`. Treat only its location, branch, manifest-file list, README-file list, and top-level entry list as CLI-verified facts.
17
+ 2. Inspect the repository read-only. Read only what is needed to understand it, starting with README files, root manifests, and relevant entry points or module directories. Do not modify the project repository.
18
+ 3. Produce a complete project record with `name`, canonical `location`, current `branch`, a concise semantic `type`, and `context`.
19
+ 4. Generate `context` as concise, stable project navigation for an AI that has not read the repository. Use exactly four semantic lines in this order: `responsibility`, `technologyStack`, `codeLocations`, and `projectBoundary`. Prefix each line with the corresponding label returned in `data.projectContext`; do not translate or replace those labels yourself. Write descriptions in the returned workspace `data.language`. Keep project names, paths, branches, technology names, identifiers, and code symbols unchanged. Prefer 150-400 Chinese characters or comparable English length. Do not include exhaustive dependencies, volatile command details, filler, or unsupported guesses.
20
+
21
+ Present all completed records for confirmation. After confirmation, write them to a temporary JSON document with `schemaVersion: 1` and a non-empty `projects` array, then run:
22
+
23
+ ```bash
24
+ code-workspace project add --projects-file <temporary-json-file> --yes --json
25
+ code-workspace project verify --json
26
+ ```
27
+
28
+ Do not hand-edit `.code-workspace/config.yaml` or permission files. Completion requires successful registration, authorization application, and project verification.
@@ -0,0 +1,97 @@
1
+ # Code Workspace User Guide
2
+
3
+ A short reminder for using Code Workspace after initialization.
4
+
5
+ ## Add workspace projects
6
+
7
+ Codex:
8
+
9
+ ```text
10
+ $code-workspace-add-projects /absolute/path/to/project-a /absolute/path/to/project-b
11
+ ```
12
+
13
+ Claude Code:
14
+
15
+ ```text
16
+ /code-workspace:add-projects /absolute/path/to/project-a /absolute/path/to/project-b
17
+ ```
18
+
19
+ Review the project records and confirm when prompted. The add-projects skill runs `code-workspace language --json`, uses `data.projectContext` from the standard result envelope, and writes each generated project context in `data.language`.
20
+
21
+ ## Upgrade Code Workspace
22
+
23
+ Upgrade the global package, update the current workspace's managed files, then verify health:
24
+
25
+ ```bash
26
+ npm install -g @icebearx-ai/code-workspace@latest
27
+ code-w update
28
+ code-w doctor
29
+ ```
30
+
31
+ `update` refreshes managed instructions, Workspace skills, hooks, and this guide. It stops if a managed file contains unknown local changes. Review the file first; use `--force` only when replacing those changes is intentional.
32
+
33
+ ## Workspace language
34
+
35
+ Choose the Workspace language during initialization, or pass it explicitly:
36
+
37
+ ```bash
38
+ code-w init --language en-US
39
+ code-w language
40
+ ```
41
+
42
+ The selected preference is stored at `workspace.language` in `.code-workspace/config.yaml`. Change an initialized workspace with:
43
+
44
+ ```bash
45
+ code-w update --language en-US
46
+ ```
47
+
48
+ This also switches this managed guide. Existing project context is not translated.
49
+
50
+ ## Use the Agent monitor
51
+
52
+ Start one global monitor for all workspaces:
53
+
54
+ ```bash
55
+ code-w monitor
56
+ ```
57
+
58
+ Open the printed local URL. The dashboard shows workspaces, execution state, pending approvals, completed turns, and live signals. Monitor language is selected on the page and is independent of `workspace.language`.
59
+
60
+ Use another port when necessary:
61
+
62
+ ```bash
63
+ code-w monitor --port 8080
64
+ ```
65
+
66
+ Each participating workspace must use the same URL in `.code-workspace/config.yaml`. After initialization, review and trust the project hooks with `/hooks` in Codex.
67
+
68
+ ## Practical commands
69
+
70
+ ```bash
71
+ # Check installation and workspace health
72
+ code-w doctor
73
+
74
+ # Update all managed files
75
+ code-w update
76
+
77
+ # Apply Agent project directory authorization
78
+ code-w permissions apply --yes
79
+
80
+ # Validate local projects
81
+ code-w project verify
82
+ code-w project verify <project-name>
83
+ ```
84
+
85
+ Directory access is authorized by the user. Code Workspace shows the requested changes, applies and verifies them, and reports the result. `permissions apply` grants missing registered-project access without revoking additional directories. Ordinary `update` does not change authorization.
86
+
87
+ Add `--json` when a query result is consumed by Codex or a script.
88
+
89
+ ## Workspace skills
90
+
91
+ - `$code-workspace-add-projects` — inspect and register local Git projects with concise AI-generated navigation context.
92
+ - `$code-workspace-resolve-branch` — safely resolve a selected project's branch mismatch and confirm branch alignment.
93
+
94
+ | Purpose | Codex | Claude Code |
95
+ | --- | --- | --- |
96
+ | Add workspace projects | `$code-workspace-add-projects` | `/code-workspace:add-projects` |
97
+ | Resolve a project branch mismatch | `$code-workspace-resolve-branch` | `/code-workspace-resolve-branch` |
@@ -0,0 +1,97 @@
1
+ # Code Workspace 用户指南
2
+
3
+ 这是一份在初始化完成后使用 Code Workspace 的简明指南。
4
+
5
+ ## 添加工作区项目
6
+
7
+ Codex:
8
+
9
+ ```text
10
+ $code-workspace-add-projects /absolute/path/to/project-a /absolute/path/to/project-b
11
+ ```
12
+
13
+ Claude Code:
14
+
15
+ ```text
16
+ /code-workspace:add-projects /absolute/path/to/project-a /absolute/path/to/project-b
17
+ ```
18
+
19
+ 根据提示检查项目记录并确认。add-projects skill 会运行 `code-workspace language --json`,使用标准结果信封中的 `data.projectContext` 标签,并以 `data.language` 生成项目 context。
20
+
21
+ ## 升级 Code Workspace
22
+
23
+ 先升级全局软件包,再更新当前工作区的托管文件,最后检查健康状态:
24
+
25
+ ```bash
26
+ npm install -g @icebearx-ai/code-workspace@latest
27
+ code-w update
28
+ code-w doctor
29
+ ```
30
+
31
+ `update` 会更新托管指令、Workspace 技能、Hook 和本指南。如果托管文件包含未知的本地修改,更新会停止。请先检查文件;只有明确要覆盖这些修改时才使用 `--force`。
32
+
33
+ ## 工作区语言
34
+
35
+ 初始化时可选择 Workspace 语言,也可以显式指定:
36
+
37
+ ```bash
38
+ code-w init --language zh-CN
39
+ code-w language
40
+ ```
41
+
42
+ 所选偏好保存在 `.code-workspace/config.yaml` 的 `workspace.language`。已有工作区可通过以下命令切换语言:
43
+
44
+ ```bash
45
+ code-w update --language zh-CN
46
+ ```
47
+
48
+ 该操作也会切换本托管指南。已有项目 context 不会自动翻译。
49
+
50
+ ## 使用 Agent Monitor
51
+
52
+ 为所有工作区启动一个全局 Monitor:
53
+
54
+ ```bash
55
+ code-w monitor
56
+ ```
57
+
58
+ 打开命令输出的本地地址。面板会显示工作区、执行状态、待授权请求、已完成轮次和实时信号。Monitor 语言在页面中单独选择,与 `workspace.language` 相互独立。
59
+
60
+ 必要时可使用其他端口:
61
+
62
+ ```bash
63
+ code-w monitor --port 8080
64
+ ```
65
+
66
+ 所有参与监控的工作区都必须在 `.code-workspace/config.yaml` 中使用相同 URL。初始化后,请在 Codex 中使用 `/hooks` 检查并信任项目 Hook。
67
+
68
+ ## 实用命令
69
+
70
+ ```bash
71
+ # 检查安装和工作区健康状态
72
+ code-w doctor
73
+
74
+ # 更新所有托管文件
75
+ code-w update
76
+
77
+ # 应用 Agent 项目目录授权
78
+ code-w permissions apply --yes
79
+
80
+ # 校验本地项目
81
+ code-w project verify
82
+ code-w project verify <project-name>
83
+ ```
84
+
85
+ 目录访问由用户授权。Code Workspace 负责展示请求的变更、实施并验证变更,以及报告结果。`permissions apply` 只补齐已注册项目缺失的授权,不撤销额外目录。普通 `update` 不会改变授权。
86
+
87
+ 查询结果需要交给 Codex 或脚本处理时,可添加 `--json`。
88
+
89
+ ## Workspace Skills
90
+
91
+ - `$code-workspace-add-projects` — 检查并注册本地 Git 项目,同时生成供 AI 导航使用的简洁 context。
92
+ - `$code-workspace-resolve-branch` — 安全解决选中项目的分支不一致问题,并确认分支对齐。
93
+
94
+ | 用途 | Codex | Claude Code |
95
+ | --- | --- | --- |
96
+ | 添加工作区项目 | `$code-workspace-add-projects` | `/code-workspace:add-projects` |
97
+ | 解决项目分支不一致 | `$code-workspace-resolve-branch` | `/code-workspace-resolve-branch` |
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24" class="vt-locales-btn-icon" data-v-6229553e=""><path d="M0 0h24v24H0z" fill="none"></path><path d=" M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z " class="css-c4d79v"></path></svg>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg"
3
+ width="1254" height="1254" viewBox="0 0 1254 1254"
4
+ role="img" aria-label="Geometric teal-blue logo">
5
+ <defs>
6
+ <linearGradient id="logoGradient" x1="320" y1="175" x2="860" y2="1080" gradientUnits="userSpaceOnUse">
7
+ <stop offset="0" stop-color="#19AEB8"/>
8
+ <stop offset="0.48" stop-color="#087DA5"/>
9
+ <stop offset="1" stop-color="#07528C"/>
10
+ </linearGradient>
11
+ </defs>
12
+
13
+ <g fill="none"
14
+ stroke="url(#logoGradient)"
15
+ stroke-width="118"
16
+ stroke-linecap="butt"
17
+ stroke-linejoin="round">
18
+ <path d="M 794 289
19
+ L 630 184
20
+ L 291 394
21
+ L 291 786
22
+ L 630 1020
23
+ L 973 786
24
+ L 973 393
25
+ L 914 354"/>
26
+ <path d="M 850 386
27
+ L 617 526
28
+ L 617 850"/>
29
+ </g>
30
+ </svg>
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { main } = require("../src/cli");
4
+ const { renderResult } = require("../src/cli/renderer");
5
+ const { failure } = require("../src/cli/result");
6
+
7
+ const json = process.argv.some((arg) => arg === "--json" || arg.startsWith("--json="));
8
+
9
+ main(process.argv)
10
+ .then((result) => renderResult(result, { json }))
11
+ .catch((error) => renderResult(failure(error), { json }));