mancode 0.4.1 → 0.5.0

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.
package/README.en.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <p align="center">
18
18
  <a href="./LICENSE"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=flat-square" alt="License: AGPL-3.0" /></a>
19
19
  <a href="https://www.npmjs.com/package/mancode"><img src="https://img.shields.io/npm/v/mancode?style=flat-square" alt="npm version" /></a>
20
- <img src="https://img.shields.io/badge/status-Continuity%20v0.4.1-2f855a?style=flat-square" alt="Status: mancode Continuity v0.4.1" />
20
+ <img src="https://img.shields.io/badge/status-Continuity%20v0.5.0-2f855a?style=flat-square" alt="Status: mancode Continuity v0.5.0" />
21
21
  <img src="https://img.shields.io/badge/platforms-Claude%20Code%20%7C%20Cursor%20%7C%20Codex%20%7C%20Copilot%20%7C%20ZCode-5865F2?style=flat-square" alt="Platforms: Claude Code, Cursor, Codex in ChatGPT desktop and CLI, GitHub Copilot, ZCode" />
22
22
  </p>
23
23
 
@@ -137,6 +137,13 @@ the code baseline, then run
137
137
  `MANCODE_GIT_REF_DEFERRED_SYNC_REQUIRED`; cross-clone synchronization is
138
138
  complete only after the push returns a receipt.
139
139
 
140
+ Atomic git-ref mutations that explicitly require `--sync`, such as
141
+ `workflow update`, complete the remote CAS before materializing the local
142
+ projection. If a resumable `in_progress` or `blocked` task leaves tracked
143
+ `.mancode/shared` changes, commit that projection and run the same
144
+ `team sync push` with the unchanged task revision to rebind the remote code
145
+ head. Another clone must not resume until this push returns a receipt.
146
+
140
147
  For a new project, start with one platform you actually use:
141
148
 
142
149
  ```bash
@@ -165,8 +172,9 @@ By default, `mancode init` creates mancode workflow and platform integration fil
165
172
  ├── schema.json
166
173
  ├── shared/config.json
167
174
  ├── shared/context/project.json
175
+ ├── shared/context/design-policy.json # optional; created by design configure
168
176
  ├── shared/team/
169
- └── local/ # sessions, workflows, manps reports
177
+ └── local/ # sessions, workflows, scan reports, style cache
170
178
 
171
179
  .claude/skills/ # Claude Code: bootstrap + original mode skills
172
180
  .cursor/rules/ + commands/ # Cursor: bootstrap + original mode commands
@@ -199,7 +207,7 @@ the original mode entries, never task/session snapshots. `mancode init
199
207
  - **Support team context**: use `/manteam` with confirmed typed entities under
200
208
  `.mancode/shared/`.
201
209
  - **Scan project health**: use `mancode manps` to detect stale TODOs, unused
202
- dependencies, risky packages, and hardcoded design values.
210
+ dependencies, risky packages, mixed icon systems, and hardcoded design values.
203
211
 
204
212
  ## Best Fit
205
213
 
@@ -374,7 +382,7 @@ it should behave, and why previous decisions were made.
374
382
 
375
383
  ## Installation
376
384
 
377
- **Status**: mancode Continuity v0.4.1. Claude Code, Cursor, Codex in the ChatGPT
385
+ **Status**: mancode Continuity v0.5.0. Claude Code, Cursor, Codex in the ChatGPT
378
386
  desktop app and CLI, GitHub Copilot, and ZCode adapters are included.
379
387
 
380
388
  Requires Node.js 20 or newer. macOS, Linux, Windows CMD, PowerShell, and Git Bash
@@ -469,8 +477,12 @@ mancode workflow verify <namespace:ULID> apply --file <verification-ledger.json>
469
477
  mancode workflow reframe <local:ULID> --expected-revision <n> --checkpoint-id <ULID> --session <id>
470
478
  mancode workflow complete <namespace:ULID> --expected-revision <n> --session <id>
471
479
  mancode manps [area]
480
+ mancode design status --json
481
+ mancode design context --json
482
+ mancode design configure --expected-revision <n> [options]
483
+ mancode design disable --expected-revision <n>
472
484
  mancode refresh-project
473
- mancode refresh-style
485
+ mancode refresh-style [--root <relative-path>]
474
486
  mancode version
475
487
  ```
476
488
 
@@ -481,7 +493,7 @@ mancode version
481
493
  Simplified output:
482
494
 
483
495
  ```text
484
- mancode v0.4.1
496
+ mancode v0.5.0
485
497
 
486
498
  Project: my-app
487
499
  Runtime: ready
@@ -571,6 +583,53 @@ Outputs:
571
583
  .mancode/local/preseason-reports/<timestamp>-<area>.md
572
584
  ```
573
585
 
586
+ ### `mancode design`
587
+
588
+ Project design policy is opt-in. `mancode init` does not create a policy. When
589
+ the policy is missing, disabled, or corrupt, `design context` safely resolves to
590
+ `preserve`; ordinary coding and workflow recovery continue normally.
591
+ Legacy projects can read this safe context, but only current Continuity projects
592
+ can configure the shared policy.
593
+
594
+ - `preserve` retains the existing hierarchy, layout, component system, and
595
+ interaction patterns while making only task-required UI changes.
596
+ - `refine` improves hierarchy, typography, spacing, states, and responsive
597
+ behavior without changing the product structure.
598
+ - `experimental` permits one coherent, product-appropriate visual direction
599
+ and more advanced composition or motion, but requires
600
+ `--confirm-experimental`. It never authorizes new product behavior,
601
+ information-architecture changes, or broader task scope.
602
+
603
+ For a new UI surface or aesthetic redesign, if the user has not selected a
604
+ visual direction, the agent first presents 2-3 distinct,
605
+ product-appropriate directions with concise tradeoffs and a recommendation,
606
+ then waits for the user to choose. Scoped UI fixes, changes within an existing
607
+ design system, and tasks with an already selected direction continue directly.
608
+ For brand, campaign, editorial, portfolio, and launch surfaces, `experimental`
609
+ emphasizes a memorable first viewport and a visual motif carried through the
610
+ full page; task-oriented products still prioritize workflow clarity.
611
+
612
+ The policy stores only strict enums for preset, icons, emoji, motion, and browser
613
+ validation, never free-form prompt text. Agents read code-generated guidance,
614
+ quality gates, and a sanitized style summary through `mancode design context
615
+ --json`. `--icons lucide` does not install Lucide; dependency changes still need
616
+ explicit task approval.
617
+
618
+ ```bash
619
+ mancode design status --json
620
+ mancode design configure --expected-revision 0 --preset refine --icons lucide --emoji forbid-as-interface-icon --motion purposeful --browser-validation when-available
621
+ mancode design context --json
622
+ mancode design disable --expected-revision 1
623
+
624
+ # experimental always needs an extra confirmation
625
+ mancode design configure --expected-revision 0 --preset experimental --confirm-experimental
626
+ ```
627
+
628
+ The policy lives at `.mancode/shared/context/design-policy.json` and should be
629
+ reviewed and committed like other repository configuration. `configure` and
630
+ `disable` update only the current checkout; they do not publish a git-ref remote
631
+ sync receipt.
632
+
574
633
  ### `mancode refresh-style`
575
634
 
576
635
  Refreshes the project profile and, when UI assets are detected, rescans design
@@ -581,6 +640,11 @@ tokens. It updates:
581
640
  .mancode/shared/context/project.json
582
641
  ```
583
642
 
643
+ For a monorepo, select one repository-relative UI root explicitly, for example
644
+ `mancode refresh-style --root apps/web`. Absolute paths, traversal, and symlinks
645
+ that escape the repository are rejected. Omitting `--root` preserves the
646
+ whole-repository scan behavior.
647
+
584
648
  Platform adapters are static bootstraps that embed no task or style snapshot, so
585
649
  refreshing project facts does not require reinstalling them.
586
650
 
@@ -628,14 +692,16 @@ mancode/
628
692
  - Complete real-host session acceptance for Claude Code, Codex, Cursor,
629
693
  GitHub Copilot, and ZCode on one release candidate; verified host sessions
630
694
  and isolated explicit sessions are both valid evidence paths.
631
- - Run `npm run release:check -- --candidate <full-commit-sha>` for the clean
632
- checkout, automated two-clone/legacy checks, tarball SHA-256, and install
633
- smoke; complete cross-host recovery separately.
695
+ - Merge the final candidate into `main`, then run
696
+ `npm run release:check -- --candidate <full-commit-sha>` from that same
697
+ `origin/main` commit for the clean checkout, automated two-clone/legacy
698
+ checks, tarball SHA-256, and install smoke; complete cross-host recovery
699
+ separately.
634
700
  - Confirm ZCode project-skill discovery and workspace-command paths; keep the
635
701
  adapter provisional until then.
636
702
  - Evaluate Windsurf, Cline, and Roo Code adapters based on real demand.
637
703
 
638
- See [0.4.1 Continuity Release Acceptance](./docs/release-acceptance.md) for the complete gate.
704
+ See [0.4.2 Continuity Release Acceptance](./docs/release-acceptance.md) for the complete gate.
639
705
 
640
706
  ## Troubleshooting
641
707
 
@@ -660,7 +726,9 @@ hook architecture still uses `mancode init --legacy --force`.
660
726
  This means the platform's target files are missing or their digest is stale.
661
727
  Preview `mancode adapter upgrade --platform <platform> --dry-run`, inspect the
662
728
  staged result, then run it with the returned `--operation-id`, an active session,
663
- and `--confirm`. For managed-block
729
+ and `--confirm`. A successful confirmation removes that operation's staging
730
+ preview so internal temporary files cannot make a later Git sync report a dirty
731
+ worktree. For managed-block
664
732
  platforms (Codex, ZCode, Copilot), the managed block in `AGENTS.md` or
665
733
  `.github/copilot-instructions.md` may have been manually edited or deleted.
666
734
 
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <p align="center">
18
18
  <a href="./LICENSE"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=flat-square" alt="许可证:AGPL-3.0" /></a>
19
19
  <a href="https://www.npmjs.com/package/mancode"><img src="https://img.shields.io/npm/v/mancode?style=flat-square" alt="npm 版本" /></a>
20
- <img src="https://img.shields.io/badge/status-Continuity%20v0.4.1-2f855a?style=flat-square" alt="状态:mancode Continuity v0.4.1" />
20
+ <img src="https://img.shields.io/badge/status-Continuity%20v0.5.0-2f855a?style=flat-square" alt="状态:mancode Continuity v0.5.0" />
21
21
  <img src="https://img.shields.io/badge/platforms-Claude%20Code%20%7C%20Cursor%20%7C%20Codex%20%7C%20Copilot%20%7C%20ZCode-5865F2?style=flat-square" alt="平台:Claude Code、Cursor、ChatGPT 桌面端 Codex、Codex CLI、GitHub Copilot、ZCode" />
22
22
  </p>
23
23
 
@@ -116,6 +116,12 @@ git-ref 下的 workflow create、requirements、plan、review 和 verification
116
116
  `--sync` 会返回 `MANCODE_GIT_REF_DEFERRED_SYNC_REQUIRED`;只有拿到 push receipt
117
117
  才表示跨 clone 同步完成。
118
118
 
119
+ `workflow update` 等明确要求 `--sync` 的原子 git-ref mutation 会先完成远端 CAS,
120
+ 再 materialize 本地投影。如果仍需 resume 的 `in_progress` 或 `blocked` 任务因此产生
121
+ tracked `.mancode/shared` 变更,应先提交这些投影,再用不变的 task revision 执行同一条
122
+ `team sync push`,把远端 code head 重绑到新提交;另一个 clone 只能在这次 push 返回
123
+ receipt 后 resume。
124
+
119
125
  在全新项目中,从一个实际使用的平台开始:
120
126
 
121
127
  ```bash
@@ -153,8 +159,9 @@ legacy `state.json` 与当前工作流权威数据。
153
159
  ├── schema.json
154
160
  ├── shared/config.json
155
161
  ├── shared/context/project.json
162
+ ├── shared/context/design-policy.json # 可选:design configure 后创建
156
163
  ├── shared/team/
157
- └── local/ # session、workflow、manps 报告
164
+ └── local/ # session、workflow、扫描报告和样式缓存
158
165
 
159
166
  .claude/skills/ # Claude Code:bootstrap + 原 mode skills
160
167
  .cursor/rules/ + commands/ # Cursor:bootstrap + 原 mode commands
@@ -176,7 +183,7 @@ AGENTS.md # Codex(ChatGPT 桌面端/CLI):托管 ins
176
183
  - **自由选择执行强度**:计划确认后,可只保留计划、交给默认 `solo` 轻量开发,或继续完整 `/man` 的验证与有界风险审查。
177
184
  - **保留工作流产物**:调研、计划、审查报告和总结会保存到 `.mancode/<namespace>/workflows/<ULID>/`。
178
185
  - **支持团队上下文**:`/manteam` 通过 `.mancode/shared/` 的类型化实体共享已确认信息。
179
- - **扫描项目健康度**:`mancode manps` 检测陈旧 TODO、未使用依赖、风险依赖和硬编码设计值。
186
+ - **扫描项目健康度**:`mancode manps` 检测陈旧 TODO、未使用依赖、风险依赖、混用图标系统和硬编码设计值。
180
187
 
181
188
  ## 适合什么项目?
182
189
 
@@ -329,7 +336,7 @@ src/components/
329
336
 
330
337
  ## 安装
331
338
 
332
- **状态**:mancode Continuity v0.4.1。Claude Code、Cursor、ChatGPT 桌面端中的
339
+ **状态**:mancode Continuity v0.5.0。Claude Code、Cursor、ChatGPT 桌面端中的
333
340
  Codex、Codex CLI、GitHub Copilot 和 ZCode adapter 均已接入。
334
341
 
335
342
  需要 Node.js 20 或更高版本。原生支持 macOS、Linux、Windows CMD、
@@ -422,8 +429,12 @@ mancode workflow verify <namespace:ULID> apply --file <verification-ledger.json>
422
429
  mancode workflow reframe <local:ULID> --expected-revision <n> --checkpoint-id <ULID> --session <id>
423
430
  mancode workflow complete <namespace:ULID> --expected-revision <n> --session <id>
424
431
  mancode manps [area]
432
+ mancode design status --json
433
+ mancode design context --json
434
+ mancode design configure --expected-revision <n> [options]
435
+ mancode design disable --expected-revision <n>
425
436
  mancode refresh-project
426
- mancode refresh-style
437
+ mancode refresh-style [--root <relative-path>]
427
438
  mancode version
428
439
  ```
429
440
 
@@ -434,7 +445,7 @@ mancode version
434
445
  以下是简化输出示例:
435
446
 
436
447
  ```text
437
- mancode v0.4.1
448
+ mancode v0.5.0
438
449
 
439
450
  Project: my-app
440
451
  Runtime: ready
@@ -521,6 +532,35 @@ mancode manps config
521
532
  .mancode/local/preseason-reports/<timestamp>-<area>.md
522
533
  ```
523
534
 
535
+ ### `mancode design`
536
+
537
+ 项目设计策略是显式启用功能。`mancode init` 不会创建策略;策略缺失、禁用或损坏时,
538
+ `design context` 会安全降级为 `preserve`,普通编码和工作流恢复不受影响。
539
+ Legacy 项目也可读取这个安全上下文,但只有当前 Continuity 项目能配置共享策略。
540
+
541
+ - `preserve`:保持现有层级、布局、组件系统和交互模式,只完成任务要求的 UI 改动。
542
+ - `refine`:在不改变产品结构的前提下改善层级、排版、间距、状态和响应式行为。
543
+ - `experimental`:允许一个符合产品语境的统一视觉方向和更高级的构图/动效,但必须显式传入 `--confirm-experimental`;它不授权新增产品功能、改变信息架构或扩大任务范围。
544
+
545
+ 新建 UI 或视觉重做时,如果用户尚未选定视觉方向,Agent 会先给出 2–3 个差异明确、符合产品语境的方向,简述取舍并推荐一个,等待用户选择后再实现。局部 UI 修复、既有设计系统内的改动,以及用户已经选定方向的任务不会被这一步打断。`experimental` 对品牌、活动、编辑、作品集和发布型页面强调首屏记忆点与贯穿全页的视觉母题;对任务型产品仍优先保证工作流清晰度。
546
+
547
+ 策略只保存 preset、图标、表情、动效和浏览器验证的严格枚举,不保存自由文本提示词。
548
+ Agent 通过 `mancode design context --json` 获取代码生成的固定指导、质量门槛和经过清洗的
549
+ 样式摘要。`--icons lucide` 不会自动安装 Lucide;依赖变更仍需任务明确授权。
550
+
551
+ ```bash
552
+ mancode design status --json
553
+ mancode design configure --expected-revision 0 --preset refine --icons lucide --emoji forbid-as-interface-icon --motion purposeful --browser-validation when-available
554
+ mancode design context --json
555
+ mancode design disable --expected-revision 1
556
+
557
+ # experimental 必须额外确认
558
+ mancode design configure --expected-revision 0 --preset experimental --confirm-experimental
559
+ ```
560
+
561
+ 策略保存在 `.mancode/shared/context/design-policy.json`,应像其他仓库配置一样审查并提交。
562
+ `configure`/`disable` 只更新当前 checkout,不会发布 git-ref 远端同步回执。
563
+
524
564
  ### `mancode refresh-style`
525
565
 
526
566
  刷新项目 profile;检测到 UI 资产时,还会重新扫描设计 token。它会更新:
@@ -530,6 +570,9 @@ mancode manps config
530
570
  .mancode/shared/context/project.json
531
571
  ```
532
572
 
573
+ Monorepo 可显式选择一个仓库内 UI 根目录,例如 `mancode refresh-style --root apps/web`。
574
+ 绝对路径、路径穿越和逃逸仓库的符号链接会被拒绝;不传 `--root` 时保持整仓扫描行为。
575
+
533
576
  平台 adapter 是不嵌入 task/style 快照的静态 bootstrap,因此刷新项目事实后不需要重装。
534
577
 
535
578
  ## 项目文件
@@ -570,11 +613,11 @@ mancode/
570
613
  ## 仍在推进
571
614
 
572
615
  - 在同一发布候选上完成 Claude Code、Codex、Cursor、GitHub Copilot 和 ZCode 的真实宿主 session 验收;宿主自动 session 和显式双 session 都是合法证据路径。
573
- - 使用 `npm run release:check -- --candidate <完整提交 SHA>` 完成干净 checkout、自动双 clone/legacy、tarball SHA-256 和安装 smoke;另完成跨真实宿主恢复。
616
+ - 将最终候选合并到 `main`,并使用 `npm run release:check -- --candidate <完整提交 SHA>` 从同一个 `origin/main` 提交完成干净 checkout、自动双 clone/legacy、tarball SHA-256 和安装 smoke;另完成跨真实宿主恢复。
574
617
  - 确认 ZCode 项目级 skill 发现和 workspace command 路径;完成前继续标记为 provisional。
575
618
  - 根据真实需求评估 Windsurf、Cline 和 Roo Code adapter。
576
619
 
577
- 完整发布条件见 [0.4.1 Continuity 发布验收](./docs/release-acceptance.md)。
620
+ 完整发布条件见 [0.4.2 Continuity 发布验收](./docs/release-acceptance.md)。
578
621
 
579
622
  ## 故障排查
580
623
 
@@ -596,7 +639,8 @@ mancode/
596
639
 
597
640
  该平台的目标文件缺失或 digest 不匹配。先运行
598
641
  `mancode adapter upgrade --platform <platform> --dry-run`,确认 staging 结果后再用
599
- 该预览返回的 `--operation-id` 和 active session 执行 `--confirm`。
642
+ 该预览返回的 `--operation-id` 和 active session 执行 `--confirm`。确认成功后会删除
643
+ 该 operation 的 staging 预览,避免内部临时文件让后续 Git 同步误判工作区不干净。
600
644
  对于 Codex、ZCode 和 Copilot,`AGENTS.md` 或 `.github/copilot-instructions.md`
601
645
  中的受控区可能被手动编辑或删除了。
602
646
 
@@ -3632,10 +3632,6 @@ var WorkflowPolicyVersionUnsupportedError = class extends Error {
3632
3632
  this.requiredWriter = requiredWriter;
3633
3633
  this.name = "WorkflowPolicyVersionUnsupportedError";
3634
3634
  }
3635
- component;
3636
- observedVersion;
3637
- supportedVersions;
3638
- requiredWriter;
3639
3635
  code = "MANCODE_POLICY_VERSION_UNSUPPORTED";
3640
3636
  };
3641
3637
  var TRANSITION_STATES = /* @__PURE__ */ new Set([
@@ -7275,4 +7271,4 @@ export {
7275
7271
  V3ContextStore,
7276
7272
  storedTaskAggregateDigest
7277
7273
  };
7278
- //# sourceMappingURL=chunk-S3BAOJPP.js.map
7274
+ //# sourceMappingURL=chunk-3FOBYCF4.js.map