diff --git a/.scd/plans/20261123-141205-thinloop-quality-slim/decisions.md b/.scd/plans/20261123-141205-thinloop-quality-slim/decisions.md new file mode 100644 index 0000000..33ef45d --- /dev/null +++ b/.scd/plans/20261123-141205-thinloop-quality-slim/decisions.md @@ -0,0 +1,39 @@ +--- +status: approved +version: 2 +created_at: 2026-11-23T14:12:05+08:00 +updated_at: 2026-11-23T14:17:30+08:00 +recorded_timezone: Asia/Shanghai +--- + +# 决策与事件 + +- 事件ID:DEC-1 +- 类型:第 1 轮上游方向确认(计划草案拟定) +- 文件及文档版本:plan.md v1、requirements.md v1、implementation.md v1、decisions.md v1(本目录) +- 目标Git SHA:`fa09cb7bcbc10be37b1a0cb362ed51e018a4c90d` +- 用户实际依据:用户对第 1 轮 6 项上游决策回复“1A 2A 3A 4A 5A 6A”,明确选定:① 移除未接入的 `data/vendor/` 与 10 个非 Web stacks 并修复 `search.mjs` 中英检索;② `planning-contract.md` 引入 L0/L1/L2 分级并兼容 Squash Merge;③ `scd-test` 全套 6 项升级含受控 `WAIVED` 与 L0 无行为改动免强制子 Agent;④ `scd-uiux` 与 `page-acceptance` 分轨品味 + Brownfield 令牌提取 + 状态切换条 HTML 原型规范 + 零依赖 `dom-audit.mjs`;⑤ 项 6 拆为指令瘦身、Antigravity 一等支持与最终三臂评测 3 个独立节点;⑥ 按 `scd-project` 标准流建立 Initiative + Delivery Issue DAG。 +- 任务或Issue范围:Thinloop 质量与轻量化演进(D1–D8 规划草案) +- occurred_at:null(会话内用户回复无独立秒级消息时间) +- recorded_at:2026-11-23T14:12:05+08:00 +- 未决选择:无 + +- 事件ID:DEC-2 +- 类型:方案批准 +- 文件及文档版本:plan.md v1、requirements.md v1、implementation.md v1、decisions.md v1(均取自目标 Git SHA) +- 目标Git SHA:`fa09cb7bcbc10be37b1a0cb362ed51e018a4c90d` +- 用户实际依据:用户对明确展示 `fa09cb7bcbc10be37b1a0cb362ed51e018a4c90d`、四份 v1 计划文件、8 节点 DAG 与两项授权范围的确认摘要回复“确认 授权你直接做”。 +- 任务或Issue范围:Initiative《Thinloop 质量强化与轻量化演进(v0.23.0)》及 D1–D8 全部切片契约与依赖图 Revision 1 +- occurred_at:null(会话内用户回复无独立秒级消息时间) +- recorded_at:2026-11-23T14:17:30+08:00 +- 未决选择:无 + +- 事件ID:DEC-3 +- 类型:开工授权 +- 文件及文档版本:同 DEC-2;批准与开工事件记录于 decisions.md v2 +- 目标Git SHA:`fa09cb7bcbc10be37b1a0cb362ed51e018a4c90d` +- 用户实际依据:同上,用户回复“确认 授权你直接做”,明确授权先按 `scd-project` 在 GitHub 创建 1 个中文 Initiative + 8 个中文 Delivery Issues 并回填规范 DAG,随即按 `scd-execute` / `scd-quickdev` 分波次隔离开发、独立验收、串行合并、清理与发布验证。 +- 任务或Issue范围:本 Initiative 下的 D1–D8 全部安全 READY 波次交付与普通任务本地宿主刷新验证 +- occurred_at:null(会话内用户回复无独立秒级消息时间) +- recorded_at:2026-11-23T14:17:30+08:00 +- 未决选择:无 diff --git a/.scd/plans/20261123-141205-thinloop-quality-slim/implementation.md b/.scd/plans/20261123-141205-thinloop-quality-slim/implementation.md new file mode 100644 index 0000000..1952e94 --- /dev/null +++ b/.scd/plans/20261123-141205-thinloop-quality-slim/implementation.md @@ -0,0 +1,127 @@ +--- +status: approved +version: 1 +created_at: 2026-11-23T14:12:05+08:00 +updated_at: 2026-11-23T14:17:30+08:00 +recorded_timezone: Asia/Shanghai +--- + +# 项目交付拓扑与执行规划(DAG Revision 1) + +## 规范依赖图(经 `validate-project-graph.mjs` 确定性验证) + +因果前置关系(只对真实硬依赖建边;共享文件冲突记入下方协调说明,不伪造依赖边): + +- Wave 1(初始可 READY,5 个节点): + - `uiux-corpus-slim`(D1) + - `planning-tiers-squash`(D2) + - `uiux-method-dom-audit`(D4) + - `project-cross-readiness`(D5) + - `antigravity-first-class`(D6) +- Wave 2(解锁,1 个节点): + - `test-acceptance-upgrade`(D3)← 依赖 `planning-tiers-squash`(消费 D2 定义的 L0 分级与 `release-contract.md` 门禁规则) +- Wave 3(解锁,1 个节点): + - `skill-instruction-slimming`(D7)← 依赖 `uiux-corpus-slim`、`planning-tiers-squash`、`test-acceptance-upgrade`、`uiux-method-dom-audit`、`project-cross-readiness`(需待全部技能契约改动定型后再统一瘦身去重) +- Wave 4(集成与发布门,1 个节点): + - `eval-integration-release`(D8)← 依赖 `skill-instruction-slimming`、`antigravity-first-class` + +```json +{ + "schemaVersion": 1, + "revision": 1, + "nodes": [ + { + "id": "uiux-corpus-slim", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": [], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + }, + { + "id": "planning-tiers-squash", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": [], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + }, + { + "id": "test-acceptance-upgrade", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": ["planning-tiers-squash"], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + }, + { + "id": "uiux-method-dom-audit", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": [], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + }, + { + "id": "project-cross-readiness", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": [], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + }, + { + "id": "antigravity-first-class", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": [], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + }, + { + "id": "skill-instruction-slimming", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": [ + "uiux-corpus-slim", + "planning-tiers-squash", + "test-acceptance-upgrade", + "uiux-method-dom-audit", + "project-cross-readiness" + ], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + }, + { + "id": "eval-integration-release", + "issue": null, + "contract": "planned", + "delivery": "open", + "humanGate": "clear", + "dependsOn": [ + "skill-instruction-slimming", + "antigravity-first-class" + ], + "blockers": ["等待项目方案确认并实例化 Delivery Issue"] + } + ] +} +``` + +## 执行期协调说明(非硬依赖边) + +- `uiux-corpus-slim`(D1)与 `uiux-method-dom-audit`(D4)均会修改 `skills/scd-uiux/SKILL.md`;在 `scd-execute` 调度 Wave 1 时建议先合并其一再变基另一方,或串行化这两个节点以减少合并冲突。 +- 其余 Wave 1 节点(D2、D5、D6 与 D1/D4 之一)文件所有权完全隔离,可安全并行开发、逐个串行合并。 +- D8 运行真实模型三臂评测涉及付费模型配额与本机运行时(Codex CLI 认证及浏览器证据),进入 D8 执行前先核对可用凭据与运行预算。 + +## 权限与交付边界 + +- 确认本计划与项目拓扑后,由 `scd-project` 在 GitHub 创建 1 个中文 Initiative + 8 个中文 Delivery Issues 并回填规范依赖图,然后停止(Project 不运行实现循环)。 +- 只有用户明确授权开始执行(或按 `scd-execute` / 选中单个 READY Issue 交给 `scd-quickdev`)后,才进入编码、独立验收、PR 合并与清理。 diff --git a/.scd/plans/20261123-141205-thinloop-quality-slim/plan.md b/.scd/plans/20261123-141205-thinloop-quality-slim/plan.md new file mode 100644 index 0000000..2f3ae38 --- /dev/null +++ b/.scd/plans/20261123-141205-thinloop-quality-slim/plan.md @@ -0,0 +1,14 @@ +--- +status: approved +version: 1 +created_at: 2026-11-23T14:12:05+08:00 +updated_at: 2026-11-23T14:17:30+08:00 +recorded_timezone: Asia/Shanghai +--- + +# 任务索引:Thinloop 质量与轻量化演进(v0.23.0 Initiative) + +- 任务与 Issue:1 个中文 Initiative Issue + 8 个中文 Delivery Issues(D1–D8 依赖 DAG;与既有开放 Issue #122、#104 无关且不改动它们) +- 所需文档及版本:[requirements.md](requirements.md) v1、[implementation.md](implementation.md) v1、[decisions.md](decisions.md) v2 +- 基线来源:`main` @ `b05148512fa7c2ec303ad2b1edf26ccc6ff8cb12`(Thinloop `v0.22.1`) +- 批准与开工事件:[decisions.md](decisions.md) `DEC-2`(方案批准,目标 SHA `fa09cb7bcbc10be37b1a0cb362ed51e018a4c90d`)、`DEC-3`(开工授权) diff --git a/.scd/plans/20261123-141205-thinloop-quality-slim/requirements.md b/.scd/plans/20261123-141205-thinloop-quality-slim/requirements.md new file mode 100644 index 0000000..dbc12f7 --- /dev/null +++ b/.scd/plans/20261123-141205-thinloop-quality-slim/requirements.md @@ -0,0 +1,36 @@ +--- +status: approved +version: 1 +created_at: 2026-11-23T14:12:05+08:00 +updated_at: 2026-11-23T14:17:30+08:00 +recorded_timezone: Asia/Shanghai +--- + +# 需求与项目验收(Initiative v1) + +## 项目目标与边界 + +对 Thinloop v0.22.1 实施系统性质量强化与轻量化演进,解决实测中暴露的 33 MB 未接入语料膨胀、小任务流程过重及 Squash Merge 阻断、测试验收防锚定与反模式盲区、UI/UX B 端误伤与量化核验缺失、跨产物一致性核对缺口、Antigravity 一等平台支持及指令 Token 税问题,并最终形成 `v0.23.0` 集成发布与三臂评测证据。 + +- **范围内**:D1–D8 八个可独立验证切片(UIUX 语料瘦身与检索修复、计划契约 L0/L1/L2 分级与 Squash Merge 兼容、`scd-test` 与独立验收升级、`scd-uiux` 与页面验收升级、`scd-project` 跨产物交叉就绪核对、Antigravity 一等支持、15 个 `SKILL.md` 指令瘦身去重、v0.23.0 集成发布与三臂评测)。 +- **范围外**:不修改既有开放 Issue #122 和 #104;不引入 BMAD 拟人角色剧场或本地 Story 文件库;不新增第 16 个 Skill;不提交/清理仓库中既有无关未跟踪文件;不自动打 Git Release Tag 或强制安装缺失宿主。 + +## 项目级集成验收(P1–P4) + +- **P1**:全部 D1–D7 Delivery Issues 通过独立验收、合并至 `main` 并完成清理关闭;依赖图经 `validate-project-graph.mjs` 确定性验证全绿。 +- **P2**:`skills/scd-uiux` 体积从 35 MB 降至 2 MB 以内且全量 `node --test tests/*.test.mjs` 与 `scripts/check-version.mjs`、`scripts/sync-routing-kernel.mjs --check` 全部通过。 +- **P3**:已安装宿主(ZCode、Claude Code、Codex、Antigravity)刷新并核验 `v0.23.0` 完整载荷与各自支持的 Hook(缺失环境或凭据的项诚实保持 `UNVERIFIED` / `BLOCKED`)。 +- **P4**:在改造合并后的基线上执行 `evals/thinloop/` 其余 6 类任务三臂评测并更新 `EVALUATION.md`(若真实模型凭据或浏览器证据路径不可用,按评测契约诚实记为 `BLOCKED`,不伪造结论)。 + +## 八个 Delivery 切片与可观察验收 + +| 节点 | 切片范围 | 核心可观察验收 | +|---|---|---| +| D1 `uiux-corpus-slim` | 移除 `skills/scd-uiux/data/vendor/`(33 MB)与 10 个非 Web `stacks/` CSV(`avalonia/flutter/javafx/jetpack-compose/react-native/swiftui/uno/uwp/winui/wpf`);更新 `THIRD-PARTY-NOTICES.md`;升级 `scripts/search.mjs` 中英关键词映射与 `SKILL.md` 英文检索指引。 | A1:`data/vendor/` 与 10 个非 Web CSV 已移除,保留 12 个 Web CSV,`skills/scd-uiux` ≤ 2 MB;A2:中文关键词(如“后台 暗色 表格”)与英文关键词运行 `search.mjs` 均能命中有效条目且不命中已删非 Web 栈;A3:相关单测与 `visual-quality-contract.test.mjs` 通过。 | +| D2 `planning-tiers-squash` | 修订 `planning-contract.md`、`release-contract.md`、`issue-delivery-contract.md`、`scd-quickdev/SKILL.md` 与对应契约测试:引入 L0/L1/L2 分级(L0 免建 6 模板 `.scd/plans/` 与双次计划提交,仍需先确认具体方案),并兼容仅允许 Squash Merge 的消费者仓库(以合并后 `main` 上的计划文件、批准记录与 PR 合并提交通过持久可达性检查)。 | A1:契约清晰定义 L0/L1/L2 适用边界且明确保留逐项技术确认底线;A2:Squash Merge 仓库具备明确、可执行的持久可达性放行路径而非一律 `BLOCKED`,普通 Merge 仓库保留历史 SHA 核对;A3:`planning-contract.test.mjs` 与 `quickdev-contract.test.mjs` 更新并通过。 | +| D3 `test-acceptance-upgrade` | 升级 `skills/scd-test/`(`SKILL.md`、`test-design.md`、`acceptance-audit.md`)与 `release-contract.md`、`evidence-contract.md`:Blind-First 先盲验后对账、`test-review` 5 条测试反模式审计、P0/P1/P2 风险分层、P0/缺陷先红后绿 ATDD、5 行条件触发式 NFR、非 P0/非高风险显式 `WAIVED` 出口、L0 纯文档/文案无行为改动免强制独立子 Agent(行为与页面改动仍强制)。 | A1:独立验收流程强制拆为 Blind-First 盲验 + 对账两步,并列出 5 条测试反模式门禁;A2:测试设计明确 P0/P1/P2、P0/缺陷先红后绿与 5 项触发式 NFR;A3:`WAIVED` 严格限定非 P0/非高风险且需用户明示批准记录,行为/页面改动保持强制独立子 Agent;A4:契约测试更新并通过。 | +| D4 `uiux-method-dom-audit` | 升级 `scd-uiux`(`SKILL.md`、`design-taste.md`、`visual-quality.md`、`visual-evidence.md`、`design-tokens.md`)、`scd-ui-polish/SKILL.md`、`page-acceptance.md`:分轨品味标准(展示/营销型 Web vs 高密度工具/工作台型 Web App)、Brownfield 存量令牌提取、带状态切换条的令牌驱动 HTML 原型默认配方,以及零依赖浏览器 DOM 量化探测脚本 `skills/scd-uiux/scripts/dom-audit.mjs` 及单测。 | A1:品味黑名单与八维阈值区分展示站与工作台两轨,解除对 B 端指标卡/标题比/桌面工具的误伤;A2:契约明确 Brownfield 令牌提取与带 `loading/empty/error/success/dark/mobile` 切换条的令牌驱动 HTML 原型规范;A3:`dom-audit.mjs` 无第三方依赖,能检出溢出、`<12px` 字号、`<44px` 触控区、标题跳级/多 `h1`、缺 `alt`/可访问名、断链图与对比度预警,并有针对正反例的自动单测通过。 | +| D5 `project-cross-readiness` | 在 `skills/scd-project/SKILL.md` 与 `references/project-contract.md` 增加跨产物交叉就绪核对(当项目存在 PRD、UX 或 Architecture/共享接口契约时,拆解和标 `READY` 前逐项核对 `FR-*` ↔ `UI-*` ↔ 共享接口操作/字段/错误态一致性,缺口回流责任技能)。 | A1:`scd-project` 与 `project-contract.md` 明确跨产物三方交叉核对清单与缺口回流规则;A2:`project-contract.test.mjs` 增补回归断言并通过。 | +| D6 `antigravity-first-class` | 将 Antigravity 2.0 正式纳入 Thinloop 支持平台:`hooks/check-state.mjs` 适配 Antigravity `Stop` 协议(camelCase `hookEventName` / `continuationActive` / `terminationReason`、`{"decision":"continue","reason":...}`);更新 `config/platform-capabilities.json`、`scripts/verify-install.mjs`、`scripts/refresh-install.mjs`、`docs/installation.md` 与单测(含检测 `skills.json` 与全局插件防重复暴露)。 | A1:`check-state.mjs` 在 Antigravity `Stop` 协议下对 `NO_TOOL_CALL` + 不可恢复状态输出 `{"decision":"continue","reason":...}`,对 `USER_CANCELED`/`ERROR` 或 `continuationActive:true` 放行防循环,并有单测覆盖;A2:`platform-capabilities.json`、`verify-install.mjs`、`refresh-install.mjs` 与 `docs/installation.md` 完整覆盖 Antigravity 插件结构(`plugin.json`/`hooks.json`/仅路由内核的 `rules/AGENTS.md`/`skills` 软链)与单测。 | +| D7 `skill-instruction-slimming` | 在 D1–D5 全部合并后,对 15 个 `SKILL.md` 执行指令瘦身与跨文件重复规则去重,降低常驻入口字节数与 Token 税,同时保留所有契约红线与精确引用指针。 | A1:15 个 `SKILL.md` 总字节数较合并前可观测下降,且单文件超长主入口明显收敛;A2:全套仓库测试与 `sync-routing-kernel.mjs --check` 零退化通过;A3:记录瘦身前后逐文件字节数对照证据。 | +| D8 `eval-integration-release` | 集成与发布门:在 D1–D7 全量合并后提升版本至 `v0.23.0`(同步 11 个版本面 + 新增 `docs/releases/v0.23.0.md` + `docs/installation.md` 升级条目),验证全套测试与已安装宿主刷新,并在可用凭据下运行 `evals/thinloop/` 其余 6 类任务三臂评测并更新 `EVALUATION.md`。 | A1:`check-version.mjs` 与全量仓库测试全绿;A2:已安装 ZCode/Claude Code/Codex/Antigravity 按实测环境完成刷新核验(缺失项记 `UNVERIFIED`);A3:`evals/thinloop/` 其余 6 类任务运行并写入脱敏观测或按实测边界诚实记 `BLOCKED`。 | diff --git a/skills/scd-uiux/SKILL.md b/skills/scd-uiux/SKILL.md index 44b20d3..3a94a64 100644 --- a/skills/scd-uiux/SKILL.md +++ b/skills/scd-uiux/SKILL.md @@ -66,7 +66,7 @@ description: "在生产实施前设计或完善 Web 产品的用户体验和界 ## 形成可实施的视觉交付 -视觉方向、字体搭配、配色、图标、图表或动效需要具体参照时,检索内置设计知识库:`node /scripts/search.mjs <2-5 个关键词> [--domain <域>]`,域见 `--list-domains`(styles/typography/products/reasoning/ux/icons/charts/motion/landing/stacks)。一次查询围绕单一意图;结果为空或离题时收窄或换域重试一次,仍无命中则如实报告无验证匹配,不得把一般性建议当作检索结果,也不保留未验证输出。检索所得具体值进入方向块或 UX 契约时注明来源域与条目。 +视觉方向、字体搭配、配色、图标、图表或动效需要具体参照时,检索内置 Web 设计知识库:`node /scripts/search.mjs <2-5 个英文设计关键词> [--domain <域>]`,域见 `--list-domains`(styles/typography/products/reasoning/ux/icons/charts/motion/landing/stacks)。底层 CSV 为英文语料,优先传入英文设计关键词(如 `dark dashboard table`);脚本内置高频中文设计词同义映射作兼容兜底。一次查询围绕单一意图;结果为空或离题时收窄或换域重试一次,仍无命中则如实报告无验证匹配,不得把一般性建议当作检索结果,也不保留未验证输出。检索所得具体值进入方向块或 UX 契约时注明来源域与条目。 创建或验证线框图、视觉稿或原型前,阅读 `references/visual-evidence.md`。生成任何视觉产物前,先按[设计品味](references/design-taste.md)写出五项方向块并逐条排查反模式黑名单;命名不出方向时不得开始生成。 视觉设计自动使用共用的[页面视觉质量](references/visual-quality.md):统一方向、八维检查、实际渲染的有限轮次自审与可核对对比。已有页面只需视觉打磨时可独立使用 [scd-ui-polish](../scd-ui-polish/SKILL.md);生产实施仍交给 QuickDev,清晰局部变更不增加设计阶段。 diff --git a/skills/scd-uiux/data/THIRD-PARTY-NOTICES.md b/skills/scd-uiux/data/THIRD-PARTY-NOTICES.md index 0dfbf71..d996638 100644 --- a/skills/scd-uiux/data/THIRD-PARTY-NOTICES.md +++ b/skills/scd-uiux/data/THIRD-PARTY-NOTICES.md @@ -7,20 +7,14 @@ - 来源:(main 分支,按文件原样收录) - 许可:MIT License,版权归属上游作者 - 收录范围:`tokens/`(14 个 DTCG 令牌 JSON)、`components/`(11 份组件规范 Markdown) -- 改动:无(原样搬运);后续如有改动在各节记录 +- 改动:移除未接入检索的 `vendor/design-systems/`(31 MB 离线语料,见 Issue #138),仅保留实际使用的 DTCG 令牌与组件规范 ## nextlevelbuilder/ui-ux-pro-max-skill(MIT License) -- 来源:(main 分支,按文件原样收录) +- 来源:(main 分支) - 许可:MIT License,版权归属上游作者 -- 收录范围:`knowledge/`(styles/typography/products/ui-reasoning/ux-guidelines/icons/charts/motion/landing 共 9 张 CSV + catalog-summary.json + data-provenance.json)、`stacks/`(22 张框架 CSV) -- 改动:无(原样搬运);检索脚本 `scripts/search.mjs` 为本项目自研(node 零依赖),非上游代码 - -## 大体量参考语料(vendor/) - -- `vendor/design-systems/`:来自 plugin87/ux-ui-agent-skills(MIT License,,main 分支)design-systems/ 目录全量原样收录(2148 文件,约 31MB;设计系统实物参照语料) -- `vendor/google-fonts.csv`、`vendor/google-font-licenses.json`、`vendor/phosphor-icons-upstream.json`:来自 nextlevelbuilder/ui-ux-pro-max-skill(MIT License,,main 分支)data/ 目录原样收录;Google Fonts 元数据及其许可声明、Phosphor Icons 上游数据随文件内附 -- 改动:无(原样搬运) +- 收录范围:`knowledge/`(styles/typography/products/ui-reasoning/ux-guidelines/icons/charts/motion/landing 共 9 张 CSV + catalog-summary.json + data-provenance.json)、`stacks/`(12 张 Web 技术栈 CSV:`angular`、`astro`、`html-tailwind`、`laravel`、`nextjs`、`nuxt-ui`、`nuxtjs`、`react`、`shadcn`、`svelte`、`threejs`、`vue`) +- 改动:按 `scd-uiux` 的 Web 适用边界移除 10 张原生移动/桌面栈 CSV(`avalonia`、`flutter`、`javafx`、`jetpack-compose`、`react-native`、`swiftui`、`uno`、`uwp`、`winui`、`wpf`)及未接入检索的 `vendor/`(`google-fonts.csv`、`google-font-licenses.json`、`phosphor-icons-upstream.json`),见 Issue #138;检索脚本 `scripts/search.mjs` 为本项目自研(node 零依赖,含中英设计词同义映射),非上游代码 ## 方法论与规则改写来源 diff --git a/skills/scd-uiux/data/stacks/avalonia.csv b/skills/scd-uiux/data/stacks/avalonia.csv deleted file mode 100644 index c67f411..0000000 --- a/skills/scd-uiux/data/stacks/avalonia.csv +++ /dev/null @@ -1,57 +0,0 @@ -No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL,Applies To,Status,Verified At -1,XAML,Use Avalonia XAML namespace,Avalonia has its own XAML namespace not WPF,xmlns= for Avalonia-specific namespace,WPF xmlns or UWP xmlns,"","",High,https://docs.avaloniaui.net/docs/fundamentals/avalonia-xaml,avalonia 12,active,2026-08-13 -2,XAML,Use compiled bindings with x:DataType,Enable compile-time binding validation,x:DataType on root or DataTemplate for compiled bindings,Reflection-based bindings in production,""," without x:DataType",High,https://docs.avaloniaui.net/docs/data-binding/compiled-bindings,avalonia 12,active,2026-08-13 -3,XAML,Enable compiled bindings globally,Avalonia 12 enables AvaloniaUseCompiledBindingsByDefault by default so every binding requires x:DataType and remains trim-safe for Native AOT,Keep the Avalonia 12 default or set AvaloniaUseCompiledBindingsByDefault explicitly when documenting the project contract,Disable compiled bindings or rely on runtime binding resolution,true,false,High,https://docs.avaloniaui.net/docs/data-binding/compiled-bindings,avalonia 12,active,2026-08-13 -4,XAML,Use #name shorthand for element-to-element bindings,Compiled bindings cannot resolve {Binding ElementName=...} - use the #name shorthand which relies on NameScope lookup,#name shorthand referencing x:Name controls in the same NameScope,ElementName binding inside a compiled-binding scope,""," under compiled bindings",Medium,https://docs.avaloniaui.net/docs/data-binding/compiled-bindings,avalonia 12,active,2026-08-13 -5,Styling,Use CSS-like selectors,Avalonia uses selectors not implicit styles,Selectors targeting control types classes and pseudoclasses,WPF-style implicit Style with TargetType,"","", for hover effects,Medium,https://docs.avaloniaui.net/docs/styling/pseudoclasses,avalonia 12,active,2026-08-13 -7,Styling,Use nesting selectors,Child and descendant combinators for scoped styles,> for direct child and space for descendant,Flat selectors that match too broadly,"","","CornerRadius=""4"" on every Button in the page",Medium,https://learn.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/xaml-styles,uwp legacy,deprecated,2026-08-13 -16,Styling,Use VisualStateManager for visual states,Define visual states with Setters that change properties when triggered,VisualStateGroup containing VisualStates with Setter targets,Toggling Visibility from code-behind on SizeChanged,"",SizeChanged handler that flips Orientation in code-behind,High,https://learn.microsoft.com/en-us/windows/uwp/design/layout/layouts-with-xaml,uwp legacy,deprecated,2026-08-13 -17,Navigation,Use Frame for page navigation,Windows.UI.Xaml.Controls.Frame for UWP page navigation,Frame.Navigate with typed parameters,Swapping UserControls manually,"rootFrame.Navigate(typeof(DetailPage), itemId);",contentArea.Content = new DetailPage();,Medium,https://learn.microsoft.com/en-us/windows/uwp/design/basics/navigate-between-two-pages,uwp legacy,deprecated,2026-08-13 -18,Navigation,Handle back button correctly,Provide an in-app Back button styled with NavigationBackButtonNormalStyle and handle SystemNavigationManager.BackRequested for hardware back gamepad B and Tablet-Mode back; also handle CoreDispatcher.AcceleratorKeyActivated for Alt+Left,In-app NavigationBackButtonNormalStyle button plus SystemNavigationManager.BackRequested handler,Relying on the deprecated title-bar back button (AppViewBackButtonVisibility) or ignoring system back signals,SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;,No back button support on phone or tablet,High,https://learn.microsoft.com/en-us/windows/uwp/ui-input/back-navigation,uwp legacy,deprecated,2026-08-13 -19,Navigation,Support deep linking with protocol activation,Respond to URI activation and toast taps,OnActivated handler with proper page routing,Ignoring activation arguments,protected override void OnActivated(IActivatedEventArgs args) { if (args.Kind == ActivationKind.Protocol) { ... } },Empty OnActivated ignoring URI parameters,Medium,https://learn.microsoft.com/en-us/windows/uwp/launch-resume/handle-uri-activation,uwp legacy,deprecated,2026-08-13 -20,Navigation,Use ConnectedAnimations for continuity,Smooth transitions between pages,ConnectedAnimationService for shared element transitions,Abrupt page transitions with no visual continuity,"ConnectedAnimationService.GetForCurrentView().PrepareToAnimate(""image"", sourceImage);",No transition animation between list and detail,Low,https://learn.microsoft.com/en-us/windows/uwp/design/motion/connected-animation,uwp legacy,deprecated,2026-08-13 -21,Data Binding,Implement INotifyPropertyChanged,Enable UI updates on property changes,INotifyPropertyChanged on all ViewModels,Auto-properties without notification,public string Title { get => _title; set { _title = value; OnPropertyChanged(); } },public string Title { get; set; } expecting UI updates,High,https://learn.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth,uwp legacy,deprecated,2026-08-13 -22,Data Binding,Use ObservableCollection for lists,Collection change notifications for ItemsSources,ObservableCollection for bound lists,List for data-bound collections,ObservableCollection Items { get; } = new();,List Items { get; set; } = new();,High,https://learn.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth,uwp legacy,deprecated,2026-08-13 -23,Data Binding,Use function bindings with x:Bind,Call static methods directly in markup,x:Bind to static converter methods,IValueConverter for trivial transforms,"",Full IValueConverter class for bool to Visibility,Medium,https://learn.microsoft.com/en-us/windows/uwp/data-binding/function-bindings,uwp legacy,deprecated,2026-08-13 -24,Data Binding,Specify Mode on x:Bind,x:Bind defaults to OneTime not OneWay,Mode=OneWay or TwoWay when live updates needed,Omitting Mode and getting stale UI,"Text=""{x:Bind Title, Mode=OneWay}""","Text=""{x:Bind Title}"" expecting live updates",High,https://learn.microsoft.com/en-us/windows/uwp/xaml-platform/x-bind-markup-extension,uwp legacy,deprecated,2026-08-13 -25,Data Binding,Use CollectionViewSource for grouping,Group and sort collections declaratively,CollectionViewSource for grouped ListView and GridView,Manual grouping logic in code-behind,"",Manual loop building grouped StackPanels,Medium,https://learn.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth,uwp legacy,deprecated,2026-08-13 -26,Performance,Use ListView and GridView virtualization,Only creates containers for visible items,Default virtualization in ListView and GridView,Setting ItemsPanel to non-virtualizing panel," (virtualizes by default)",,High,https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/optimize-gridview-and-listview,uwp legacy,deprecated,2026-08-13 -27,Performance,Use ISupportIncrementalLoading,Load data on demand as user scrolls,ISupportIncrementalLoading for large datasets,Loading entire collection upfront,"class IncrementalSource : ObservableCollection, ISupportIncrementalLoading",await LoadAll() loading 50K items at startup,Medium,https://learn.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth,uwp legacy,deprecated,2026-08-13 -28,Performance,Reduce XAML visual tree depth,Simpler trees layout and render faster,Flat templates with minimal nesting,Deeply nested panels in DataTemplates, in item template,... 8 levels in item template,Medium,https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/optimize-xaml-loading,uwp legacy,deprecated,2026-08-13 -29,Performance,Use compiled bindings in DataTemplates,x:Bind in templates requires x:DataType,x:DataType on DataTemplate for compiled bindings,{Binding} in item templates for large lists,"","",High,https://learn.microsoft.com/en-us/windows/uwp/xaml-platform/x-bind-markup-extension,uwp legacy,deprecated,2026-08-13 -30,Performance,Profile with Visual Studio diagnostics,Measure before optimizing,Application Timeline and Memory Usage tools,Guessing at performance problems,VS Diagnostic Tools > Application Timeline,Optimizing without profiling data,Medium,https://learn.microsoft.com/en-us/visualstudio/profiling/application-timeline,uwp legacy,deprecated,2026-08-13 -31,Threading,Use async/await for all IO,Keep UI thread responsive,async/await for file network and database operations,Synchronous IO blocking the UI thread,var file = await StorageFile.GetFileFromPathAsync(path);,StorageFile.GetFileFromPathAsync(path).AsTask().Result;,High,https://learn.microsoft.com/en-us/windows/uwp/threading-async/asynchronous-programming-universal-windows-platform-apps,uwp legacy,deprecated,2026-08-13 -32,Threading,Use CoreDispatcher for UI thread access,Post work back to the UI thread from background,Dispatcher.RunAsync from background threads,Touching UI elements from background threads,"await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => Status = ""Done"");","textBlock.Text = ""Done"" from Task.Run",High,https://learn.microsoft.com/en-us/uwp/api/windows.ui.core.coredispatcher,uwp legacy,deprecated,2026-08-13 -33,Threading,Offload CPU work with Task.Run,Keep compute-heavy work off UI thread,Task.Run for CPU-bound operations,Heavy computation blocking UI,var result = await Task.Run(() => ProcessData(items));,var result = ProcessData(items); freezing UI,High,https://learn.microsoft.com/en-us/windows/uwp/threading-async/asynchronous-programming-universal-windows-platform-apps,uwp legacy,deprecated,2026-08-13 -34,Threading,Use IProgress for status updates,Report progress from background operations,IProgress for progress reporting to UI,Polling shared variables for progress,var progress = new Progress(p => ProgressBar.Value = p); await Task.Run(() => Process(progress));,while (!done) { await Task.Delay(100); check shared field; },Medium,https://learn.microsoft.com/en-us/dotnet/api/system.progress-1,uwp legacy,deprecated,2026-08-13 -35,Adaptive,Use AdaptiveTrigger for responsive layouts,MinWindowWidth and MinWindowHeight triggers fire at standard breakpoints (640 small / 1008 medium),AdaptiveTrigger inside VisualState.StateTriggers with the 640 and 1008 breakpoints,Fixed layouts for a single screen size,"",Single-column layout at all widths,High,https://learn.microsoft.com/en-us/windows/uwp/design/layout/layouts-with-xaml,uwp legacy,deprecated,2026-08-13 -36,Adaptive,Design for multiple device families,Phone tablet desktop Xbox and HoloLens,DeviceFamily-specific views and resources,Desktop-only design ignoring other form factors,DeviceFamily-Mobile/MainPage.xaml for phone-specific layout,Fixed 1920x1080 layout,Medium,https://learn.microsoft.com/en-us/windows/uwp/design/layout/screen-sizes-and-breakpoints-for-responsive-design,uwp legacy,deprecated,2026-08-13 -37,Adaptive,Use RelativePanel for adaptive positioning,Controls position relative to each other,RelativePanel for layouts that reflow at breakpoints,Absolute positioning or fixed margins,"",Full ControlTemplate copy to change background color,High,https://learn.microsoft.com/en-us/windows/apps/develop/platform/xaml/xaml-styles#lightweight-styling,winui current windows app sdk,active,2026-08-13 -11,Styling,Use WinUI theme resources,Consistent Fluent Design colors and brushes,WinUI theme resource keys for colors,Hardcoded hex color values,"Background=""{ThemeResource CardBackgroundFillColorDefaultBrush}""","Background=""#FF2D2D30""",High,https://learn.microsoft.com/en-us/windows/apps/design/signature-experiences/color,winui current windows app sdk,active,2026-08-13 -12,Styling,Support light and dark themes,Respect user and system theme preference,ThemeResource for theme-adaptive values,Hardcoded colors that break in dark mode,"Foreground=""{ThemeResource TextFillColorPrimaryBrush}""","Foreground=""Black""",High,https://learn.microsoft.com/en-us/windows/apps/develop/platform/xaml/xaml-theme-resources,winui current windows app sdk,active,2026-08-13 -13,Styling,Use Fluent Design system,Acrylic Mica Reveal and rounded corners,Built-in Fluent materials and effects,Custom blur and shadow implementations,"",Custom CompositionBrush recreating acrylic,Medium,https://learn.microsoft.com/en-us/windows/apps/design/signature-experiences/materials,winui current windows app sdk,active,2026-08-13 -14,Navigation,Use Frame for page navigation,Microsoft.UI.Xaml.Controls.Frame for WinUI 3 page navigation,Frame.Navigate with page types and parameters,Swapping UserControls in a ContentControl,"rootFrame.Navigate(typeof(SettingsPage), parameter);",contentArea.Content = new SettingsControl();,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/ui/navigation/navigate-between-two-pages,winui current windows app sdk,active,2026-08-13 -15,Navigation,Pass typed navigation parameters,Type-safe data passing between pages,Typed parameter in OnNavigatedTo,Dictionary or string parsing for parameters,protected override void OnNavigatedTo(NavigationEventArgs e) { var item = (Item)e.Parameter; },var id = int.Parse(e.Parameter.ToString());,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/ui/navigation/navigate-between-two-pages,winui current windows app sdk,active,2026-08-13 -16,Navigation,Handle back navigation,WinUI 3 uses NavigationView.BackRequested instead of UWP SystemNavigationManager,Register NavigationView.BackRequested handler and manage back stack,Ignoring back navigation,navigationView.BackRequested += OnBackRequested;,No back button support,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/ui/navigation/navigation-history-and-backwards-navigation,winui current windows app sdk,active,2026-08-13 -17,Navigation,Use deep linking,Handle protocol activation so URIs route to the right page,Register protocol then check ExtendedActivationKind.Protocol on activation,Single entry point ignoring activation context,AppInstance.GetCurrent().GetActivatedEventArgs() with ExtendedActivationKind.Protocol,Ignoring activation arguments,Medium,https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/applifecycle/applifecycle-rich-activation,winui current windows app sdk,active,2026-08-13 -18,Data Binding,Use ObservableCollection for lists,Notifies UI of collection changes,ObservableCollection for bound ItemsSources,List for bound collections,ObservableCollection Items { get; } = new();,List Items { get; set; } = new();,High,https://learn.microsoft.com/en-us/windows/apps/develop/data-binding/data-binding-in-depth,winui current windows app sdk,active,2026-08-13 -19,Data Binding,Use INotifyPropertyChanged,Enable property change notification for UI updates,INotifyPropertyChanged on ViewModels,Properties without notification,"public string Name { get => _name; set => SetProperty(ref _name, value); }",public string Name { get; set; } without notification,High,https://learn.microsoft.com/en-us/windows/apps/develop/data-binding/data-binding-in-depth,winui current windows app sdk,active,2026-08-13 -20,Data Binding,Use function binding with x:Bind,Call methods directly in bindings,x:Bind with method references for transforms,IValueConverter for simple logic,"",IValueConverter class for bool to visibility,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/data-binding/function-bindings,winui current windows app sdk,active,2026-08-13 -21,Data Binding,Specify Mode explicitly on x:Bind,x:Bind defaults to OneTime not OneWay,Mode=OneWay or Mode=TwoWay when updates needed,Forgetting Mode and getting stale UI,"Text=""{x:Bind Title, Mode=OneWay}""","Text=""{x:Bind Title}"" expecting live updates",High,https://learn.microsoft.com/en-us/windows/apps/develop/platform/xaml/x-bind-markup-extension,winui current windows app sdk,active,2026-08-13 -22,Performance,Use ItemsRepeater for custom lists,Virtualizing layout with full control,ItemsRepeater for custom list layouts,ListView for highly customized item layouts,"",ListView with heavily modified template and removed chrome,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/ui/controls/items-repeater,winui current windows app sdk,active,2026-08-13 -23,Performance,Use incremental loading,Load data on demand as user scrolls,ISupportIncrementalLoading for large data sets,Loading entire dataset upfront,"class IncrementalItemSource : ObservableCollection, ISupportIncrementalLoading",await LoadAllItems() on page load for 10K items,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/data-binding/data-binding-in-depth,winui current windows app sdk,active,2026-08-13 -24,Performance,Reduce visual tree complexity,Simpler trees render faster,Minimal nesting in DataTemplates,Deeply nested panels in item templates,,... 8 levels deep,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/performance/optimize-xaml-loading,winui current windows app sdk,active,2026-08-13 -25,Performance,Use compiled bindings over reflection,x:Bind generates code at compile time,x:Bind for hot paths and list items,{Binding} in DataTemplates and frequently updated UI,"","",High,https://learn.microsoft.com/en-us/windows/apps/develop/platform/xaml/x-bind-markup-extension,winui current windows app sdk,active,2026-08-13 -26,Threading,Use DispatcherQueue not Dispatcher,WinUI 3 uses Microsoft.UI.Dispatching.DispatcherQueue instead of UWP CoreDispatcher,DispatcherQueue.TryEnqueue for UI thread access,Dispatcher.RunAsync (UWP pattern),"_dispatcherQueue.TryEnqueue(() => Status = ""Done"");","Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => ...);",High,https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.dispatching.dispatcherqueue,winui current windows app sdk,active,2026-08-13 -27,Threading,Use async/await for IO operations,Keep UI responsive during file and network access,async/await for IO so the UI thread keeps rendering,Synchronous IO on UI thread,var data = await httpClient.GetStringAsync(url);,var data = httpClient.GetStringAsync(url).Result;,High,https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/,winui current windows app sdk,active,2026-08-13 -28,Threading,Use Task.Run for CPU-bound work,Offload compute to thread pool,Task.Run for heavy computation,Long-running CPU work on UI thread,var result = await Task.Run(() => ProcessLargeDataSet());,var result = ProcessLargeDataSet(); blocking UI,High,https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/task-based-asynchronous-programming,winui current windows app sdk,active,2026-08-13 -29,Packaging,Use WinAppSDK correctly,Windows App SDK provides the runtime,WinAppSDK NuGet package and WindowsAppSDK bootstrapper,Mixing UWP and WinUI 3 APIs,"",Using Windows.UI.Xaml instead of Microsoft.UI.Xaml,High,https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/,winui current windows app sdk,active,2026-08-13 -30,Packaging,Use unpackaged or packaged appropriately,Choose deployment model for your scenario,Packaged (MSIX) for Store distribution,Unpackaged without considering API limitations,None for unpackaged,Assuming all APIs work in unpackaged mode,Medium,https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/deploy-packaged-apps,winui current windows app sdk,active,2026-08-13 -31,Packaging,Use single-project MSIX,Simplified packaging for single app,Single-project MSIX packaging,Separate WAP project when not needed,true in csproj,Separate Windows Application Packaging project for simple apps,Low,https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/single-project-msix,winui current windows app sdk,active,2026-08-13 -32,Accessibility,Set AutomationProperties,Enable Narrator and screen reader support,AutomationProperties.Name on all interactive controls,Controls without accessible names,""," without name",High,https://learn.microsoft.com/en-us/windows/apps/design/accessibility/basic-accessibility-information,winui current windows app sdk,active,2026-08-13 -33,Accessibility,Support keyboard navigation,Full keyboard accessibility,Tab navigation and access keys for all controls,Mouse-only interactions,"","Window.PreviewKeyDown=""OnKeyDown"" with switch over args.Key",High,https://learn.microsoft.com/en-us/windows/apps/develop/input/keyboard-accelerators,winui current windows app sdk,active,2026-08-13 -57,Styling,Organize resources with merged dictionaries,Share styles and brushes via App.xaml MergedDictionaries instead of duplicating per page,MergedDictionaries in App.xaml for shared styles brushes and colors,Duplicating SolidColorBrush definitions on every page,"",SolidColorBrush Color hardcoded inline on every page,Medium,https://learn.microsoft.com/en-us/windows/apps/develop/platform/xaml/xaml-resource-dictionary,winui current windows app sdk,active,2026-08-13 -58,Architecture,Use AsyncRelayCommand for async commands,AsyncRelayCommand exposes IsRunning and supports cancellation for IO bound work,[RelayCommand] on async Task method or AsyncRelayCommand for IO work,async void event handlers or fire-and-forget Task.Run from button click,[RelayCommand] private async Task LoadAsync(CancellationToken ct) { Items = await _service.FetchAsync(ct); },"private async void Button_Click(object s, RoutedEventArgs e) { await LoadAsync(); }",Medium,https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/asyncrelaycommand,winui current windows app sdk,active,2026-08-13 -59,Architecture,Use ILogger for structured logging,Microsoft.Extensions.Logging ILogger with DI for structured leveled logs,ILogger injected via constructor for diagnostic logging,Debug.WriteLine or Console.WriteLine for app diagnostics,"public MainViewModel(ILogger logger) { _logger = logger; } _logger.LogInformation(""Loaded {Count} items"", count);","Debug.WriteLine($""Loaded {count} items"");",Medium,https://learn.microsoft.com/en-us/dotnet/core/extensions/logging/overview,winui current windows app sdk,active,2026-08-13 diff --git a/skills/scd-uiux/data/stacks/wpf.csv b/skills/scd-uiux/data/stacks/wpf.csv deleted file mode 100644 index 4e88d67..0000000 --- a/skills/scd-uiux/data/stacks/wpf.csv +++ /dev/null @@ -1,57 +0,0 @@ -No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL,Applies To,Status,Verified At -1,XAML,Use XAML for declarative UI,Define layout and visuals in XAML not code-behind,XAML for structure and styling,Build UI trees in C# code-behind,"