From fa334494e4b0a4a2f3d75162957e00cf2dfe04d2 Mon Sep 17 00:00:00 2001 From: "sanze.li" <2522048902@qq.com> Date: Mon, 27 Apr 2026 16:33:54 +0800 Subject: [PATCH] chore: retire legacy host surface - Remove TraeCn/ prompt mirror, installer/hosts/trae_cn.py, and all Trae-specific sync/release/test/doc references - Archive trae host adapter plan to history/2026-04/ with correct lifecycle_state: archived metadata - Register archived plan in history/index.md (retired, linked) - Neutralise Trae literals in active plan (lightweight_pluggable_architecture) to maintain grep-clean standard outside CHANGELOG and history/ - Update blueprint/README.md latest-archive reference to point at history/index.md instead of a specific retired plan path Context-Checkpoint: D Decision IDs: ADR-018 Blocked by: none Out-of-scope touched: none Release-Sync: yes Release-Version: 2026-04-27.163354 Release-Date: 2026-04-27 --- .githooks/pre-commit | 12 +- .sopify-skills/blueprint/README.md | 4 +- .../20260413_trae_host_adapter/background.md | 0 .../20260413_trae_host_adapter/design.md | 0 .../20260413_trae_host_adapter/tasks.md | 12 +- .sopify-skills/history/index.md | 1 + .../background.md | 10 +- .../design.md | 8 +- .../tasks.md | 30 +- CHANGELOG.md | 104 ++++ CONTRIBUTING.md | 4 +- CONTRIBUTING_CN.md | 4 +- Claude/Skills/CN/CLAUDE.md | 2 +- Claude/Skills/EN/CLAUDE.md | 2 +- Codex/Skills/CN/AGENTS.md | 2 +- Codex/Skills/EN/AGENTS.md | 2 +- README.md | 10 +- README.zh-CN.md | 10 +- .../Skills/CN/skills/sopify/analyze/SKILL.md | 48 -- .../sopify/analyze/assets/question-output.md | 10 - .../sopify/analyze/assets/success-output.md | 11 - .../analyze/references/analyze-rules.md | 104 ---- .../analyze/scripts/score_requirement.py | 62 --- .../Skills/CN/skills/sopify/design/SKILL.md | 43 -- .../sopify/design/assets/adr-template.md | 19 - .../design/assets/background-template.md | 24 - .../sopify/design/assets/design-template.md | 14 - .../sopify/design/assets/output-summary.md | 14 - .../design/assets/plan-light-template.md | 24 - .../sopify/design/assets/tasks-template.md | 13 - .../sopify/design/references/design-rules.md | 93 ---- .../design/scripts/select_plan_level.py | 61 --- .../Skills/CN/skills/sopify/develop/SKILL.md | 42 -- .../sopify/develop/assets/output-partial.md | 13 - .../sopify/develop/assets/output-quick-fix.md | 10 - .../sopify/develop/assets/output-success.md | 13 - .../develop/references/develop-rules.md | 216 -------- .../develop/scripts/extract_pending_tasks.py | 69 --- TraeCn/Skills/CN/skills/sopify/kb/SKILL.md | 176 ------ .../CN/skills/sopify/model-compare/SKILL.md | 164 ------ .../CN/skills/sopify/templates/SKILL.md | 261 --------- .../sopify/workflow-learning/CHANGELOG.md | 20 - .../skills/sopify/workflow-learning/SKILL.md | 154 ------ TraeCn/Skills/CN/user_rules/sopify.md | 514 ------------------ .../Skills/EN/skills/sopify/analyze/SKILL.md | 48 -- .../sopify/analyze/assets/question-output.md | 10 - .../sopify/analyze/assets/success-output.md | 11 - .../analyze/references/analyze-rules.md | 104 ---- .../analyze/scripts/score_requirement.py | 62 --- .../Skills/EN/skills/sopify/design/SKILL.md | 43 -- .../sopify/design/assets/adr-template.md | 19 - .../design/assets/background-template.md | 24 - .../sopify/design/assets/design-template.md | 14 - .../sopify/design/assets/output-summary.md | 14 - .../design/assets/plan-light-template.md | 24 - .../sopify/design/assets/tasks-template.md | 13 - .../sopify/design/references/design-rules.md | 93 ---- .../design/scripts/select_plan_level.py | 61 --- .../Skills/EN/skills/sopify/develop/SKILL.md | 42 -- .../sopify/develop/assets/output-partial.md | 13 - .../sopify/develop/assets/output-quick-fix.md | 10 - .../sopify/develop/assets/output-success.md | 13 - .../develop/references/develop-rules.md | 216 -------- .../develop/scripts/extract_pending_tasks.py | 69 --- TraeCn/Skills/EN/skills/sopify/kb/SKILL.md | 176 ------ .../EN/skills/sopify/model-compare/SKILL.md | 164 ------ .../EN/skills/sopify/templates/SKILL.md | 261 --------- .../sopify/workflow-learning/CHANGELOG.md | 20 - .../skills/sopify/workflow-learning/SKILL.md | 154 ------ TraeCn/Skills/EN/user_rules/sopify.md | 512 ----------------- installer/hosts/__init__.py | 2 - installer/hosts/trae_cn.py | 45 -- scripts/check-readme-links.py | 2 - scripts/check-skills-sync.sh | 44 +- scripts/check-version-consistency.sh | 18 +- scripts/sync-skills.sh | 52 +- tests/test_check_readme_links.py | 20 - tests/test_installer.py | 88 +-- tests/test_installer_status_doctor.py | 62 +-- tests/test_release_hooks.py | 22 - 80 files changed, 176 insertions(+), 4778 deletions(-) rename .sopify-skills/{plan => history/2026-04}/20260413_trae_host_adapter/background.md (100%) rename .sopify-skills/{plan => history/2026-04}/20260413_trae_host_adapter/design.md (100%) rename .sopify-skills/{plan => history/2026-04}/20260413_trae_host_adapter/tasks.md (99%) delete mode 100644 TraeCn/Skills/CN/skills/sopify/analyze/SKILL.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/analyze/assets/question-output.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/analyze/assets/success-output.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/analyze/references/analyze-rules.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/analyze/scripts/score_requirement.py delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/SKILL.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/assets/adr-template.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/assets/background-template.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/assets/design-template.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/assets/output-summary.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/assets/plan-light-template.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/assets/tasks-template.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/references/design-rules.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/design/scripts/select_plan_level.py delete mode 100644 TraeCn/Skills/CN/skills/sopify/develop/SKILL.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/develop/assets/output-partial.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/develop/assets/output-quick-fix.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/develop/assets/output-success.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/develop/references/develop-rules.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/develop/scripts/extract_pending_tasks.py delete mode 100644 TraeCn/Skills/CN/skills/sopify/kb/SKILL.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/model-compare/SKILL.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/templates/SKILL.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/workflow-learning/CHANGELOG.md delete mode 100644 TraeCn/Skills/CN/skills/sopify/workflow-learning/SKILL.md delete mode 100644 TraeCn/Skills/CN/user_rules/sopify.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/analyze/SKILL.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/analyze/assets/question-output.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/analyze/assets/success-output.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/analyze/references/analyze-rules.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/analyze/scripts/score_requirement.py delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/SKILL.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/assets/adr-template.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/assets/background-template.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/assets/design-template.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/assets/output-summary.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/assets/plan-light-template.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/assets/tasks-template.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/references/design-rules.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/design/scripts/select_plan_level.py delete mode 100644 TraeCn/Skills/EN/skills/sopify/develop/SKILL.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/develop/assets/output-partial.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/develop/assets/output-quick-fix.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/develop/assets/output-success.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/develop/references/develop-rules.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/develop/scripts/extract_pending_tasks.py delete mode 100644 TraeCn/Skills/EN/skills/sopify/kb/SKILL.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/model-compare/SKILL.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/templates/SKILL.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/workflow-learning/CHANGELOG.md delete mode 100644 TraeCn/Skills/EN/skills/sopify/workflow-learning/SKILL.md delete mode 100644 TraeCn/Skills/EN/user_rules/sopify.md delete mode 100644 installer/hosts/trae_cn.py diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 2bd6759..6583ae1 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -24,14 +24,10 @@ snapshot_managed_release_paths() { "Codex/Skills/EN/AGENTS.md" "Claude/Skills/CN/CLAUDE.md" "Claude/Skills/EN/CLAUDE.md" - "TraeCn/Skills/CN/user_rules/sopify.md" - "TraeCn/Skills/EN/user_rules/sopify.md" "Codex/Skills/CN/skills/sopify" "Codex/Skills/EN/skills/sopify" "Claude/Skills/CN/skills/sopify" "Claude/Skills/EN/skills/sopify" - "TraeCn/Skills/CN/skills/sopify" - "TraeCn/Skills/EN/skills/sopify" ) local path local src @@ -93,7 +89,7 @@ trap on_exit EXIT is_release_relevant_file() { local path="$1" case "$path" in - runtime/*|installer/*|Codex/Skills/*|Claude/Skills/*|TraeCn/Skills/*|README.md|README.zh-CN.md|CHANGELOG.md) + runtime/*|installer/*|Codex/Skills/*|Claude/Skills/*|README.md|README.zh-CN.md|CHANGELOG.md) return 0 ;; scripts/sopify_runtime.py|scripts/go_plan_runtime.py|scripts/model_compare_runtime.py|scripts/clarification_bridge_runtime.py|scripts/decision_bridge_runtime.py|scripts/develop_checkpoint_runtime.py|scripts/sync-runtime-assets.sh|scripts/check-runtime-smoke.sh|scripts/release-sync.sh|scripts/release-preflight.sh|scripts/sync-skills.sh|scripts/check-skills-sync.sh|scripts/check-version-consistency.sh) @@ -164,14 +160,10 @@ git -C "$ROOT_DIR" add \ Codex/Skills/EN/AGENTS.md \ Claude/Skills/CN/CLAUDE.md \ Claude/Skills/EN/CLAUDE.md \ - TraeCn/Skills/CN/user_rules/sopify.md \ - TraeCn/Skills/EN/user_rules/sopify.md \ Codex/Skills/CN/skills/sopify \ Codex/Skills/EN/skills/sopify \ Claude/Skills/CN/skills/sopify \ - Claude/Skills/EN/skills/sopify \ - TraeCn/Skills/CN/skills/sopify \ - TraeCn/Skills/EN/skills/sopify + Claude/Skills/EN/skills/sopify cat >"$STATE_FILE" < - 当前活动 plan:暂无。 -- history 归档:已可用;最近归档为 `../history/2026-04/20260403_plan-a-risk-adaptive-interruption`。 +- history 归档:已可用;最近归档见 [变更历史索引](../history/index.md)。 ## 深入阅读入口 @@ -26,5 +26,5 @@ - [蓝图任务](./tasks.md) - [Skill 标准对齐蓝图](./skill-standards-refactor.md) - [变更历史](../history/index.md) -- 最近归档:`../history/2026-04/20260403_plan-a-risk-adaptive-interruption` +- 最近归档见 [变更历史索引](../history/index.md) diff --git a/.sopify-skills/plan/20260413_trae_host_adapter/background.md b/.sopify-skills/history/2026-04/20260413_trae_host_adapter/background.md similarity index 100% rename from .sopify-skills/plan/20260413_trae_host_adapter/background.md rename to .sopify-skills/history/2026-04/20260413_trae_host_adapter/background.md diff --git a/.sopify-skills/plan/20260413_trae_host_adapter/design.md b/.sopify-skills/history/2026-04/20260413_trae_host_adapter/design.md similarity index 100% rename from .sopify-skills/plan/20260413_trae_host_adapter/design.md rename to .sopify-skills/history/2026-04/20260413_trae_host_adapter/design.md diff --git a/.sopify-skills/plan/20260413_trae_host_adapter/tasks.md b/.sopify-skills/history/2026-04/20260413_trae_host_adapter/tasks.md similarity index 99% rename from .sopify-skills/plan/20260413_trae_host_adapter/tasks.md rename to .sopify-skills/history/2026-04/20260413_trae_host_adapter/tasks.md index 2cb8aab..5621fb1 100644 --- a/.sopify-skills/plan/20260413_trae_host_adapter/tasks.md +++ b/.sopify-skills/history/2026-04/20260413_trae_host_adapter/tasks.md @@ -2,13 +2,13 @@ plan_id: 20260413_trae_host_adapter feature_key: trae_host_adapter level: standard -lifecycle_state: active +lifecycle_state: archived knowledge_sync: - project: review - background: review - design: review - tasks: review -archive_ready: false + project: skip + background: skip + design: skip + tasks: skip +archive_ready: true --- # 任务清单: Sopify 适配 Trae CN 宿主 diff --git a/.sopify-skills/history/index.md b/.sopify-skills/history/index.md index df1bb2f..b7d3edf 100644 --- a/.sopify-skills/history/index.md +++ b/.sopify-skills/history/index.md @@ -9,6 +9,7 @@ - `2026-03-21` ~~`20260320_cursor_plugin_install`~~ - abandoned - Cursor 插件安装(on_hold,路线未定,2026-04 主动弃置) - `2026-03-24` [`20260324_task`](2026-03/20260324_task/) - standard - Steering: 从 HelloAGENTS/Superpowers 对比收口 Sopify 学习路径(E.1-E.3 全完成) - `2026-03-26` [`20260326_5-plan-20260326-phase1-2-3-plan-plan-20260326-ph`](2026-03/20260326_5-plan-20260326-phase1-2-3-plan-plan-20260326-ph/) - standard - B1 文档收口后的实施与验证(全部 79 任务完成) +- `2026-04-27` ~~[`20260413_trae_host_adapter`](2026-04/20260413_trae_host_adapter/)~~ - retired - Trae CN 宿主适配(Phase 1-2 已完成,宿主面已退役) - `2026-04-12` [`20260403_plan-a-risk-adaptive-interruption`](2026-04/20260403_plan-a-risk-adaptive-interruption/) - standard - Plan A 子计划:风险自适应打断与局部语义收敛 - `2026-03-28` [`20260327_hotfix`](2026-03/20260327_hotfix/) - standard - 状态机 Hotfix(B1 前置门禁) - `2026-03-26` [`20260326_planning-materialization-decoupling`](2026-03/20260326_planning-materialization-decoupling/) - standard - 规划流程与方案包物化解耦 diff --git a/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/background.md b/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/background.md index a2b3d72..cd93e69 100644 --- a/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/background.md +++ b/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/background.md @@ -43,7 +43,7 @@ Sopify 的核心价值是让 AI 编程工作流 **自适应推进、状态可交 | **质量验证** | gate / pipeline_hooks / CrossReview 等机制让关键执行和产出审查可验证 | | **项目资产沉淀** | plan / review / history / blueprint 让计划、审查和历史可追踪、可复用 | | **集成优质工具** | graphify(蓝图初始化)、cross-review(代码评审)等,默认按需启用/可配置关闭 | -| **多宿主** | 同一内核优先跑在 Claude Code / Codex,QCoder / Copilot 走调研接入,Trae CN 按 ADR-018 sunset | +| **多宿主** | 同一内核优先跑在 Claude Code / Codex,QCoder / Copilot 走调研接入,retired legacy host surface 已按 ADR-018 退出活跃目标 | | **轻量可插拔** | 内核精简,工具以 plugin 形式接入,维护者可低成本集成新工具 | **用户感知层:** @@ -329,7 +329,7 @@ spec-kit/ 本方案包(`20260424_lightweight_pluggable_architecture`)是 Sopify 项目当前的**总纲方案包**,统一管辖以下相关子任务包。所有活跃子任务包的方向必须服务于或不阻碍总纲目标;sunset 子任务包按 ADR-018 进入清理链路。 -总纲目标:Sopify 从 "runtime 编排一切" → "runtime 只做 gate + state + contract,LLM 读 skill 自编排",同时保证多宿主原生支持(Claude Code / Codex ✅ 深度验证;QCoder / Copilot 📋 待调研;Trae CN 🔴 Sunset)。 +总纲目标:Sopify 从 "runtime 编排一切" → "runtime 只做 gate + state + contract,LLM 读 skill 自编排",同时保证多宿主原生支持(Claude Code / Codex ✅ 深度验证;QCoder / Copilot 📋 待调研;retired legacy host surface 已归档)。 ### 子任务包映射 @@ -339,7 +339,7 @@ spec-kit/ | 感知层精度 | `20260417_ux_perception_tuning` | Phase 0.2 | 前置基础改善 | | CrossReview v0 核心 | `20260418_cross_review_engine` | Phase 4 前置依赖 | 独立产品线,并行推进 | | Blueprint Graphify 增强 | `20260416_blueprint_graphify_integration` | Phase 5 基础设施 | 增强器架构,并行推进 | -| Trae CN 宿主适配 | `20260413_trae_host_adapter` | 多宿主扩展 | ADR-018 sunset;归档经验,不再作为 Phase 3 验证环境 | +| Legacy host adapter | archived legacy host adapter plan | 多宿主扩展 | ADR-018 sunset;归档经验,不再作为 Phase 3 验证环境 | ### 旧总纲残余吸收 @@ -390,11 +390,11 @@ spec-kit/ - 两者互补:20260416 提供自动化基础设施,Phase 5 提供用户面能力 - 可以独立推进,不依赖 engine 拆分 -#### 独立线: `20260413_trae_host_adapter` — Trae CN 🔴 Sunset +#### 独立线: archived legacy host adapter — Retired Surface 与总纲方向:✅ 已按 ADR-018 降级 - 宿主适配层(installer, hosts adapter)独立于 engine/skill 层 -- Trae CN 从活跃多宿主目标降为 sunset surface,不再作为 Phase 3 验证环境 +- retired legacy host 从活跃多宿主目标降为 sunset surface,不再作为 Phase 3 验证环境 - 既有适配经验归档到 history/,作为后续 HostAdapter / HostCapability / HostRegistration 的历史参考 - 后续目标宿主优先 QCoder、GitHub Copilot,调研后各自独立立项 - 每个新宿主适配参考三层抽象 (HostAdapter + HostCapability + HostRegistration) diff --git a/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/design.md b/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/design.md index 10bb459..b7ed97e 100644 --- a/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/design.md +++ b/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/design.md @@ -117,7 +117,7 @@ Sopify 是 AI 编程工作流的 **control plane**,不是通用 LLM orchestrat 5. **向后兼容** — skill.yaml v1 继续工作,新字段可选 6. **Cross-review 分阶段验证** — 先 advisory,验证价值后升级 runtime 7. **子任务包方向一致** — 所有子任务包必须服务于或不阻碍总纲目标 -8. **多宿主原生支持** — Claude Code / Codex (✅ 深度验证);QCoder / Copilot (📋 待调研);Trae CN (🔴 Sunset, ADR-018) +8. **多宿主原生支持** — Claude Code / Codex (✅ 深度验证);QCoder / Copilot (📋 待调研);retired legacy host surface 已按 ADR-018 退出活跃目标 9. **策展集成** — Plugin 面向维护者集成,用户配置开关控制 10. **pipeline_hooks 默认关闭** — 心流优先 11. **Action schema boundary** — LLM 可理解自然语言并提出结构化 action;Core/Validator 只依据 action schema、机器事实、side_effect 与风险策略授权,不维护用户话术白名单 @@ -223,7 +223,7 @@ host_support: ["*"] └──────────────────────────────────────────────────────┘ ``` -> `TraeCn/` 属于 ADR-018 sunset surface,保留至 T-cleanup-2 执行,不作为新宿主提示层示例。 +> Retired legacy host prompt mirror 属于 ADR-018 sunset surface,清理后不作为新宿主提示层示例。 ### 5.2 当前宿主支持 @@ -231,11 +231,11 @@ host_support: ["*"] |------|------|-------| | Claude Code | ✅ 深度验证 | `~/.claude/` | | Codex | ✅ 深度验证 | `~/.codex/` | -| Trae CN | 🔴 Sunset (ADR-018) | `~/.trae-cn/` (归档) | +| Retired legacy host | 🔴 Sunset (ADR-018) | archived | | QCoder | 📋 待调研 | 待确定 | | GitHub Copilot | 📋 待调研 | 待确定 | -**新宿主适配**:参考 `20260413_trae_host_adapter` 归档后的三层抽象经验,在 `installer/hosts/` 下新建文件。适配清单:Phase 0 调研 (全局配置/规则注入/技能发现) → Phase 1 注册 → Phase 2 提示层 → Phase 3 验证。 +**新宿主适配**:参考 archived legacy host adapter 的三层抽象经验,在 `installer/hosts/` 下新建文件。适配清单:Phase 0 调研 (全局配置/规则注入/技能发现) → Phase 1 注册 → Phase 2 提示层 → Phase 3 验证。 **skill.yaml 宿主兼容声明**:`host_support: ["*"]` (全宿主) 或指定宿主 ID。`skill_registry.py` 按当前宿主过滤。 diff --git a/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/tasks.md b/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/tasks.md index 2f07131..862be32 100644 --- a/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/tasks.md +++ b/.sopify-skills/plan/20260424_lightweight_pluggable_architecture/tasks.md @@ -8,7 +8,7 @@ | `20260417_ux_perception_tuning` | Phase 0.2 | 活跃 (B/C) | `plan/20260417_ux_perception_tuning/` | | `20260418_cross_review_engine` | Phase 4 前置 | 已确认 | `plan/20260418_cross_review_engine/` | | `20260416_blueprint_graphify_integration` | Phase 5 基础 | 基础集成活跃;Plugin 封装延后 | `plan/20260416_blueprint_graphify_integration/` | -| `20260413_trae_host_adapter` | 多宿主扩展 | Sunset (ADR-018) | `plan/20260413_trae_host_adapter/` | +| archived legacy host adapter | 多宿主扩展 | Sunset (ADR-018) | `history/2026-04/` | ## 旧总纲吸收记录 @@ -157,11 +157,11 @@ CR v0 release gate 通过 → Sopify Phase 4a → dogfood 数据 → 决定 Phas |------|------|---------| | Claude Code | ✅ 深度验证 | — | | Codex | ✅ 深度验证 | — | -| Trae CN | 🔴 Sunset (ADR-018) | `20260413_trae_host_adapter` → history/ 归档 | +| Retired legacy host | 🔴 Sunset (ADR-018) | history/ 归档 | | QCoder | 📋 待调研 | 调研后独立立项 | | GitHub Copilot | 📋 待调研 | 调研后独立立项 | -新宿主适配参考三层抽象 (HostAdapter + HostCapability + HostRegistration),见 design.md §5。Trae 适配经验保留在 history/ 归档中供参考。 +新宿主适配参考三层抽象 (HostAdapter + HostCapability + HostRegistration),见 design.md §5。retired legacy host 适配经验保留在 history/ 归档中供参考。 --- @@ -194,28 +194,28 @@ CR v0 release gate 通过 → Sopify Phase 4a → dogfood 数据 → 决定 Phas - **依赖:** 无 - **估计:** 0.5 天 -### T-cleanup-2:Trae Surface Sunset +### T-cleanup-2:Legacy Host Surface Retirement - **行动(顺序遵循 ADR-018 §8 删除顺序):** - 1. 从 `installer/hosts/__init__.py` 注册表中移除 trae_cn(CI dry-run) - 2. 移除 `tests/test_installer.py` / `test_installer_status_doctor.py` / `test_release_hooks.py` 中 trae_cn 测试用例 - 3. 更新 `scripts/check-readme-links.py` / `check-skills-sync.sh` / `check-version-consistency.sh` / `sync-skills.sh` / `.githooks/pre-commit` 跳过 trae - 4. 移除 `installer/hosts/trae_cn.py` - 5. 移除 `TraeCn/` 整个目录 - 6. 归档 `.sopify-skills/plan/20260413_trae_host_adapter/` → `.sopify-skills/history/2026-04/` - 7. 编辑 README.md / README.zh-CN.md / CONTRIBUTING.md / CONTRIBUTING_CN.md 移除 Trae 引用 + 1. 从 `installer/hosts/__init__.py` 注册表中移除 retired host(CI dry-run) + 2. 移除 installer / status / release hook 中 retired host 测试用例 + 3. 更新 README link、skills sync、version consistency、sync 和 pre-commit 脚本,停止扫描 retired host prompt mirror + 4. 移除 retired host adapter 实现 + 5. 移除 retired host prompt mirror + 6. 归档 retired host adapter plan → `.sopify-skills/history/2026-04/` + 7. 编辑 README.md / README.zh-CN.md / CONTRIBUTING.md / CONTRIBUTING_CN.md 移除 retired host 引用 8. CHANGELOG.md 保留历史记录,只在最新版本添加 sunset 说明 - **依赖:** T-cleanup-1 -- **验证:** CI 全量通过;grep -ri "trae" 仅返回 CHANGELOG 和 history/ 中的归档记录 +- **验证:** CI 全量通过;retired host literal 仅返回 CHANGELOG 和 history/ 中的归档记录 - **估计:** 1 天 ### T-cleanup-3:总纲与文档同步 - **行动:** 1. 更新总纲 design.md / tasks.md / background.md 中的宿主列表(确认 sunset 口径一致) - 2. 确认 CI 全量通过,grep -ri "trae" 仅返回 CHANGELOG 和 history/ + 2. 确认 CI 全量通过,retired host literal 仅返回 CHANGELOG 和 history/ - **依赖:** T-cleanup-2 -- **验证:** CI 全量通过,grep -ri "trae" 仅返回 CHANGELOG 和 history/ 中的归档记录 +- **验证:** CI 全量通过,retired host literal 仅返回 CHANGELOG 和 history/ 中的归档记录 - **估计:** 0.5 天 ### T-cleanup-4:install-sopify.sh 评估 @@ -251,7 +251,7 @@ P0 任务必须增强至少一项核心能力:adaptive route/workflow、state | Phase 2 | 3 种复杂度工作流手动验证 | | Phase 3 | v2 解析无报错,v1 兼容,host_support 多宿主验证(Claude + Codex baseline) | | Phase 4b | 冻结,仅在启动条件满足后评审 | -| ADR-018 cleanup | Trae sunset 完成(grep -ri "trae" 仅返回 CHANGELOG + history/)| +| ADR-018 cleanup | legacy host sunset 完成(retired host literal 仅返回 CHANGELOG + history/)| | 多宿主 | QCoder/Copilot 完成调研 | --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 53c68ec..f63002c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,110 @@ This changelog is maintained manually (not auto-generated). ## [Unreleased] +## [2026-04-27.163354] - 2026-04-27 + +### Docs + +- Refined public documentation: + - `CONTRIBUTING.md` + - `CONTRIBUTING_CN.md` + - `README.md` + - `README.zh-CN.md` + +### Scripts + +- Adjusted maintenance scripts: + - `scripts/check-readme-links.py` + - `scripts/check-skills-sync.sh` + - `scripts/check-version-consistency.sh` + - `scripts/sync-skills.sh` + +### Skills + +- Synced prompt-layer skills: + - `Claude/Skills/CN/CLAUDE.md` + - `Claude/Skills/EN/CLAUDE.md` + - `Codex/Skills/CN/AGENTS.md` + - `Codex/Skills/EN/AGENTS.md` + +### Tests + +- Updated automated coverage: + - `tests/test_check_readme_links.py` + - `tests/test_installer.py` + - `tests/test_installer_status_doctor.py` + - `tests/test_release_hooks.py` + +### Changed + +- Updated project files: + - `.githooks/pre-commit` + - `CHANGELOG.md` + - `TraeCn/Skills/CN/skills/sopify/analyze/SKILL.md` + - `TraeCn/Skills/CN/skills/sopify/analyze/assets/question-output.md` + - `TraeCn/Skills/CN/skills/sopify/analyze/assets/success-output.md` + - `TraeCn/Skills/CN/skills/sopify/analyze/references/analyze-rules.md` + - `TraeCn/Skills/CN/skills/sopify/analyze/scripts/score_requirement.py` + - `TraeCn/Skills/CN/skills/sopify/design/SKILL.md` + - `TraeCn/Skills/CN/skills/sopify/design/assets/adr-template.md` + - `TraeCn/Skills/CN/skills/sopify/design/assets/background-template.md` + - `TraeCn/Skills/CN/skills/sopify/design/assets/design-template.md` + - `TraeCn/Skills/CN/skills/sopify/design/assets/output-summary.md` + - `TraeCn/Skills/CN/skills/sopify/design/assets/plan-light-template.md` + - `TraeCn/Skills/CN/skills/sopify/design/assets/tasks-template.md` + - `TraeCn/Skills/CN/skills/sopify/design/references/design-rules.md` + - `TraeCn/Skills/CN/skills/sopify/design/scripts/select_plan_level.py` + - `TraeCn/Skills/CN/skills/sopify/develop/SKILL.md` + - `TraeCn/Skills/CN/skills/sopify/develop/assets/output-partial.md` + - `TraeCn/Skills/CN/skills/sopify/develop/assets/output-quick-fix.md` + - `TraeCn/Skills/CN/skills/sopify/develop/assets/output-success.md` + - `TraeCn/Skills/CN/skills/sopify/develop/references/develop-rules.md` + - `TraeCn/Skills/CN/skills/sopify/develop/scripts/extract_pending_tasks.py` + - `TraeCn/Skills/CN/skills/sopify/kb/SKILL.md` + - `TraeCn/Skills/CN/skills/sopify/model-compare/SKILL.md` + - `TraeCn/Skills/CN/skills/sopify/templates/SKILL.md` + - `TraeCn/Skills/CN/skills/sopify/workflow-learning/CHANGELOG.md` + - `TraeCn/Skills/CN/skills/sopify/workflow-learning/SKILL.md` + - `TraeCn/Skills/CN/user_rules/sopify.md` + - `TraeCn/Skills/EN/skills/sopify/analyze/SKILL.md` + - `TraeCn/Skills/EN/skills/sopify/analyze/assets/question-output.md` + - `TraeCn/Skills/EN/skills/sopify/analyze/assets/success-output.md` + - `TraeCn/Skills/EN/skills/sopify/analyze/references/analyze-rules.md` + - `TraeCn/Skills/EN/skills/sopify/analyze/scripts/score_requirement.py` + - `TraeCn/Skills/EN/skills/sopify/design/SKILL.md` + - `TraeCn/Skills/EN/skills/sopify/design/assets/adr-template.md` + - `TraeCn/Skills/EN/skills/sopify/design/assets/background-template.md` + - `TraeCn/Skills/EN/skills/sopify/design/assets/design-template.md` + - `TraeCn/Skills/EN/skills/sopify/design/assets/output-summary.md` + - `TraeCn/Skills/EN/skills/sopify/design/assets/plan-light-template.md` + - `TraeCn/Skills/EN/skills/sopify/design/assets/tasks-template.md` + - `TraeCn/Skills/EN/skills/sopify/design/references/design-rules.md` + - `TraeCn/Skills/EN/skills/sopify/design/scripts/select_plan_level.py` + - `TraeCn/Skills/EN/skills/sopify/develop/SKILL.md` + - `TraeCn/Skills/EN/skills/sopify/develop/assets/output-partial.md` + - `TraeCn/Skills/EN/skills/sopify/develop/assets/output-quick-fix.md` + - `TraeCn/Skills/EN/skills/sopify/develop/assets/output-success.md` + - `TraeCn/Skills/EN/skills/sopify/develop/references/develop-rules.md` + - `TraeCn/Skills/EN/skills/sopify/develop/scripts/extract_pending_tasks.py` + - `TraeCn/Skills/EN/skills/sopify/kb/SKILL.md` + - `TraeCn/Skills/EN/skills/sopify/model-compare/SKILL.md` + - `TraeCn/Skills/EN/skills/sopify/templates/SKILL.md` + - `TraeCn/Skills/EN/skills/sopify/workflow-learning/CHANGELOG.md` + - `TraeCn/Skills/EN/skills/sopify/workflow-learning/SKILL.md` + - `TraeCn/Skills/EN/user_rules/sopify.md` + - `installer/hosts/__init__.py` + - `installer/hosts/trae_cn.py` + +## [2026-04-27.163000] - 2026-04-27 + +### Removed + +- Retired the Trae CN host surface: + - removed the `trae-cn:*` install target and host adapter + - removed the `TraeCn/` prompt-layer mirror + - removed Trae-specific sync, release, status/doctor, README, and installer test coverage + - archived the former Trae CN host adapter plan under `.sopify-skills/history/2026-04/` + ## [2026-04-14.175552] - 2026-04-14 ### Docs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a10afd6..6456908 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ Thanks for your interest in contributing to Sopify. ## Prompt-layer and Skill Authoring - `Codex/Skills/{CN,EN}` is the prompt-layer source of truth. -- `Claude/Skills/{CN,EN}` and `TraeCn/Skills/{CN,EN}` are mirrored host layers and should be synced, not hand-maintained independently. +- `Claude/Skills/{CN,EN}` is the mirrored host layer and should be synced, not hand-maintained independently. - `runtime/builtin_skill_packages/*/skill.yaml` is the source of truth for builtin machine metadata. - For skill package changes, follow the `SKILL.md` files under [Codex/Skills/CN/skills/sopify/](./Codex/Skills/CN/skills/sopify/) / [Codex/Skills/EN/skills/sopify/](./Codex/Skills/EN/skills/sopify/). @@ -44,7 +44,7 @@ bash /path/to/project/.sopify-runtime/scripts/check-runtime-smoke.sh Bundle rules: -- The global payload lives under `~/.codex/sopify/`, `~/.claude/sopify/`, or `~/.trae-cn/sopify/`. +- The global payload lives under `~/.codex/sopify/` or `~/.claude/sopify/`. - Hosts must read `.sopify-runtime/manifest.json` before falling back to fixed helper paths. - The first host hop goes through `.sopify-runtime/scripts/runtime_gate.py enter`. - Clarification, decision, and develop checkpoint helpers are internal bridge helpers, not replacement main entries. diff --git a/CONTRIBUTING_CN.md b/CONTRIBUTING_CN.md index 2284689..c8aece9 100644 --- a/CONTRIBUTING_CN.md +++ b/CONTRIBUTING_CN.md @@ -12,7 +12,7 @@ ## Prompt 层与 Skill Authoring - `Codex/Skills/{CN,EN}` 是 prompt-layer 真源。 -- `Claude/Skills/{CN,EN}` 与 `TraeCn/Skills/{CN,EN}` 是宿主镜像层,不应独立手工维护。 +- `Claude/Skills/{CN,EN}` 是宿主镜像层,不应独立手工维护。 - `runtime/builtin_skill_packages/*/skill.yaml` 是 builtin machine metadata 真源。 - Skill package 变更时,参考 [Codex/Skills/CN/skills/sopify/](./Codex/Skills/CN/skills/sopify/) / [Codex/Skills/EN/skills/sopify/](./Codex/Skills/EN/skills/sopify/) 下各自的 `SKILL.md`。 @@ -46,7 +46,7 @@ python3 scripts/check-install-payload-bundle-smoke.py Bundle 规则: -- 全局 payload 位于 `~/.codex/sopify/`、`~/.claude/sopify/` 或 `~/.trae-cn/sopify/` +- 全局 payload 位于 `~/.codex/sopify/` 或 `~/.claude/sopify/` - 工作区内的 `.sopify-runtime/manifest.json` 只作为 thin stub,不再承诺携带 `limits.runtime_gate_entry / limits.preferences_preload_entry` - 宿主必须结合 workspace stub 与 payload manifest 解析 selected global bundle,再从选中 bundle contract 或等价 preflight contract 发现 helper 入口 - 宿主第一跳统一走 selected bundle 的 `runtime_gate_entry`;只有 repo-local 开发态才直接调用 `scripts/runtime_gate.py enter` diff --git a/Claude/Skills/CN/CLAUDE.md b/Claude/Skills/CN/CLAUDE.md index 5aa934d..b8cd4a1 100644 --- a/Claude/Skills/CN/CLAUDE.md +++ b/Claude/Skills/CN/CLAUDE.md @@ -1,5 +1,5 @@ - + # Sopify - 自适应 AI 编程助手 diff --git a/Claude/Skills/EN/CLAUDE.md b/Claude/Skills/EN/CLAUDE.md index 32a986b..111b3f3 100644 --- a/Claude/Skills/EN/CLAUDE.md +++ b/Claude/Skills/EN/CLAUDE.md @@ -1,5 +1,5 @@ - + # Sopify - Adaptive AI Programming Assistant diff --git a/Codex/Skills/CN/AGENTS.md b/Codex/Skills/CN/AGENTS.md index 7b2af7d..d407ce4 100644 --- a/Codex/Skills/CN/AGENTS.md +++ b/Codex/Skills/CN/AGENTS.md @@ -1,5 +1,5 @@ - + # Sopify - 自适应 AI 编程助手 diff --git a/Codex/Skills/EN/AGENTS.md b/Codex/Skills/EN/AGENTS.md index 9c4e23b..81d9319 100644 --- a/Codex/Skills/EN/AGENTS.md +++ b/Codex/Skills/EN/AGENTS.md @@ -1,5 +1,5 @@ - + # Sopify - Adaptive AI Programming Assistant diff --git a/README.md b/README.md index 18bc2e8..514999e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE) [![Docs](https://img.shields.io/badge/docs-CC%20BY%204.0-green.svg)](./LICENSE-docs) -[![Version](https://img.shields.io/badge/version-2026--04--14.175552-orange.svg)](#version-history) +[![Version](https://img.shields.io/badge/version-2026--04--27.163354-orange.svg)](#version-history) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md) English · [简体中文](./README.zh-CN.md) · [Quick Start](#quick-start) · [Configuration](#configuration) · [Contributors](./CONTRIBUTORS.md) @@ -79,8 +79,6 @@ Install targets: - `codex:en-US` - `claude:zh-CN` - `claude:en-US` -- `trae-cn:zh-CN` -- `trae-cn:en-US` Host availability matrix: @@ -88,7 +86,6 @@ Host availability matrix: |------|----------------|--------------|---------------------|-------| | `codex` | `codex:zh-CN` / `codex:en-US` | Deep verified | Host install flow, workspace bootstrap, and runtime package smoke are verified | Suitable for daily use | | `claude` | `claude:zh-CN` / `claude:en-US` | Deep verified | Host install flow, workspace bootstrap, and runtime package smoke are verified | Suitable for daily use | -| `trae-cn` | `trae-cn:zh-CN` / `trae-cn:en-US` | Experimental | Repo-side host install, payload install, workspace bootstrap, and status/doctor coverage are in place | Install target available. Repo-side integration ready. Trae CN IDE smoke is still pending. | Notes: @@ -272,7 +269,7 @@ Additional notes: - `workflow-learning`: replay, retrospective, and step-by-step explanation Docs: [CN](./Codex/Skills/CN/skills/sopify/workflow-learning/SKILL.md) / [EN](./Codex/Skills/EN/skills/sopify/workflow-learning/SKILL.md) -Claude and Trae CN hosts use the mirrored `Claude/Skills/{CN,EN}/...` and `TraeCn/Skills/{CN,EN}/...` layouts; the links above use the Codex tree as the canonical doc entry. +Claude uses the mirrored `Claude/Skills/{CN,EN}/...` layout; the links above use the Codex tree as the canonical doc entry. ## Directory Structure @@ -287,8 +284,7 @@ sopify/ │ ├── plan/ # active plans │ └── history/ # archived plans ├── Codex/ # Codex host prompt layer -├── Claude/ # Claude host prompt layer -└── TraeCn/ # Trae CN host prompt layer +└── Claude/ # Claude host prompt layer ``` This is a simplified view of the core layout. See [docs/how-sopify-works.en.md](./docs/how-sopify-works.en.md) for the full workflow, checkpoints, and knowledge layout. diff --git a/README.zh-CN.md b/README.zh-CN.md index ece41c0..24f152d 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -8,7 +8,7 @@ [![许可证](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE) [![文档](https://img.shields.io/badge/docs-CC%20BY%204.0-green.svg)](./LICENSE-docs) -[![版本](https://img.shields.io/badge/version-2026--04--14.175552-orange.svg)](#版本历史) +[![版本](https://img.shields.io/badge/version-2026--04--27.163354-orange.svg)](#版本历史) [![欢迎PR](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING_CN.md) [English](./README.md) · 简体中文 · [快速开始](#快速开始) · [配置说明](#配置说明) · [贡献者](./CONTRIBUTORS.md) @@ -79,8 +79,6 @@ python3 scripts/install_sopify.py --target claude:zh-CN --workspace /path/to/pro - `codex:en-US` - `claude:zh-CN` - `claude:en-US` -- `trae-cn:zh-CN` -- `trae-cn:en-US` 当前宿主可用性矩阵: @@ -88,7 +86,6 @@ python3 scripts/install_sopify.py --target claude:zh-CN --workspace /path/to/pro |------|-------------|--------|----------|------| | `codex` | `codex:zh-CN` / `codex:en-US` | Deep verified | 已验证宿主安装链路、workspace bootstrap,且运行时包已通过 smoke 验证 | 适合日常使用 | | `claude` | `claude:zh-CN` / `claude:en-US` | Deep verified | 已验证宿主安装链路、workspace bootstrap,且运行时包已通过 smoke 验证 | 适合日常使用 | -| `trae-cn` | `trae-cn:zh-CN` / `trae-cn:en-US` | Experimental | 已具备 repo 侧宿主安装、payload 安装、workspace bootstrap 与 status/doctor 覆盖 | install target 已可用,repo 侧接入已就绪,Trae CN IDE smoke 仍待完成 | 说明: @@ -272,7 +269,7 @@ export DASHSCOPE_API_KEY="your_qwen_key" - `workflow-learning`:回放、复盘与逐步讲解 文档:[中文](./Codex/Skills/CN/skills/sopify/workflow-learning/SKILL.md) / [English](./Codex/Skills/EN/skills/sopify/workflow-learning/SKILL.md) -Claude 与 Trae CN 宿主分别使用镜像结构的 `Claude/Skills/{CN,EN}/...` 和 `TraeCn/Skills/{CN,EN}/...` 路径;上述链接以 Codex 目录作为统一文档入口。 +Claude 使用镜像结构的 `Claude/Skills/{CN,EN}/...` 路径;上述链接以 Codex 目录作为统一文档入口。 ## 目录结构 @@ -287,8 +284,7 @@ sopify/ │ ├── plan/ # 活跃方案 │ └── history/ # 已归档方案 ├── Codex/ # Codex 宿主提示层 -├── Claude/ # Claude 宿主提示层 -└── TraeCn/ # Trae CN 宿主提示层 +└── Claude/ # Claude 宿主提示层 ``` 上面是核心目录的精简视图;完整工作流、checkpoint 和知识库层级说明见 [docs/how-sopify-works.md](./docs/how-sopify-works.md)。 diff --git a/TraeCn/Skills/CN/skills/sopify/analyze/SKILL.md b/TraeCn/Skills/CN/skills/sopify/analyze/SKILL.md deleted file mode 100644 index 179b2fd..0000000 --- a/TraeCn/Skills/CN/skills/sopify/analyze/SKILL.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: analyze -description: 需求分析阶段入口;聚合评分、追问与范围判定规则,按需加载 references/assets/scripts。 ---- - -# Analyze(入口文档) - -## 何时激活 - -- 进入需求分析阶段(`workflow` / `plan_only`)。 -- 需要做需求评分、追问或复杂度路由判定。 - -## 执行骨架 - -1. 先加载 `references/analyze-rules.md`。 -2. 执行 Phase A(知识库检查、上下文获取、需求类型判定、完整性评分)。 -3. 若评分不足,按 `auto_decide` 处理: - - `false`:使用 `assets/question-output.md` 追问。 - - `true`:显式补充假设后继续。 -4. 评分达标后执行 Phase B(目标提炼、代码分析与技术准备)。 -5. 输出阶段摘要,格式参考 `assets/success-output.md`。 - -## 资源导航 - -- 长规则:`references/analyze-rules.md` -- 追问模板:`assets/question-output.md` -- 达标输出模板:`assets/success-output.md` -- 确定性评分脚本:`scripts/score_requirement.py` - -## 确定性逻辑(脚本优先) - -当需要可审计评分时,优先调用: - -```bash -python3 Codex/Skills/CN/skills/sopify/analyze/scripts/score_requirement.py \ - --goal-clarity 2 \ - --expected-outcome 2 \ - --scope-boundary 1 \ - --constraints 1 \ - --require-score 7 -``` - -脚本输出 JSON,包含:总分、阈值判定、缺失维度清单。 - -## 边界 - -- 不在本技能直接生成方案包(交给 `design`)。 -- 不在本技能直接执行代码修改(交给 `develop` 或 runtime 路由)。 diff --git a/TraeCn/Skills/CN/skills/sopify/analyze/assets/question-output.md b/TraeCn/Skills/CN/skills/sopify/analyze/assets/question-output.md deleted file mode 100644 index 523dfb9..0000000 --- a/TraeCn/Skills/CN/skills/sopify/analyze/assets/question-output.md +++ /dev/null @@ -1,10 +0,0 @@ -[{BRAND_NAME}] 需求分析 ? - -当前评分 {X}/10,需要补充以下信息: - -1. {问题1} -2. {问题2} -3. {问题3} - ---- -Next: 请回答问题,或输入 "继续" 跳过追问 diff --git a/TraeCn/Skills/CN/skills/sopify/analyze/assets/success-output.md b/TraeCn/Skills/CN/skills/sopify/analyze/assets/success-output.md deleted file mode 100644 index 39bdb4f..0000000 --- a/TraeCn/Skills/CN/skills/sopify/analyze/assets/success-output.md +++ /dev/null @@ -1,11 +0,0 @@ -[{BRAND_NAME}] 需求分析 ✓ - -需求: {一句话描述} -类型: {需求类型} -评分: {X}/10 -范围: {预估文件数} - ---- -Changes: 0 files - -Next: 继续方案设计?(Y/n) diff --git a/TraeCn/Skills/CN/skills/sopify/analyze/references/analyze-rules.md b/TraeCn/Skills/CN/skills/sopify/analyze/references/analyze-rules.md deleted file mode 100644 index 5244b9d..0000000 --- a/TraeCn/Skills/CN/skills/sopify/analyze/references/analyze-rules.md +++ /dev/null @@ -1,104 +0,0 @@ -# Analyze 详细规则 - -## 目标 - -验证需求完整性,分析代码现状,为后续方案设计提供稳定输入。 - -## 总流程 - -```text -Phase A (步骤 1-4) -> 检查评分 >= require_score? - ├─ 是 -> Phase B (步骤 5-6) -> 输出摘要 - └─ 否 -> 检查 auto_decide - ├─ true -> 补充假设后继续 - └─ false -> 发起追问并等待用户输入 -``` - -## Phase A:需求评估 - -### 步骤 1:检查知识库状态 - -- 判定条件:存在项目代码,且需求不是“新项目初始化”。 -- 执行方式:检查 `.sopify-skills/` 是否存在。 -- 异常标记:若不存在,标记需初始化知识库。 - -### 步骤 2:获取项目上下文 - -- 优先读取 `.sopify-skills/user/preferences.md` 与知识库文件。 -- 信息不足时再扫描代码。 -- 详细知识库策略以 `kb` skill 为准。 - -偏好应用规则: - -1. 只使用用户明确声明的长期偏好。 -2. 当前任务明确要求优先于历史偏好。 -3. 无匹配偏好时按默认规则执行。 - -### 步骤 3:需求类型判定 - -候选类型: - -1. 新项目初始化 -2. 新功能开发 -3. 功能修改/增强 -4. Bug 修复 -5. 重构优化 -6. 技术变更 - -### 步骤 4:需求完整性评分 - -评分维度(总分 10): - -- 目标清晰:0-3 -- 预期结果:0-3 -- 边界范围:0-2 -- 约束条件:0-2 - -评分处理规则: - -- `score >= require_score`:进入 Phase B。 -- `score < require_score` 且 `auto_decide=true`:显式补充假设后继续。 -- `score < require_score` 且 `auto_decide=false`:发起追问(模板见 `assets/question-output.md`)。 - -追问规则: - -1. 不问可从代码直接获得的信息。 -2. 只问用户相关关键缺口(业务、目标、约束)。 -3. 问题数量 3-5 个。 -4. 不重复追问已在长期偏好里明确的信息。 - -## Phase B:代码分析 - -### 步骤 5:提取关键目标 - -- 把需求压缩成一句话核心目标。 -- 先区分用户给的是“目标”还是“实现路径”。 -- 若当前输入主要是路径而不是目标,把路径记为候选方案,不直接当成成功标准。 -- 给出可验证成功标准,并按 SMART 风格收口交付物、边界、约束、验证方式与下一停点。 - -### 步骤 6:代码分析与技术准备 - -- 估算项目规模与改动规模。 -- 定位相关模块与关键文件。 -- 做基础质量检查(过时信息、安全风险)。 -- 必要时补充外部文档检索。 - -稳定子规则: - -1. 目标模糊时优先补关键事实;只有 `auto_decide=true` 才允许带显式假设继续。 -2. 若已知当前路径明显次优,在分析摘要中至少给出 1 个更低成本或更低风险的替代路径。 -3. 替代路径必须说明 tradeoff,避免只给结论不给理由。 -4. `quick_fix`、纯状态解释和轻咨询场景不强制展开深度挑战。 - -## 路由判定(adaptive) - -- 简单任务(<=2 文件且需求明确):直入快速修复。 -- 中等任务(3-5 文件):进入 light 方案。 -- 复杂任务(>5 文件或架构变更):进入完整方案设计。 - -## 阶段转换 - -- 评分不足且不可自动决策:循环追问直到达标或取消。 -- `workflow.mode=strict`:达标后输出摘要并等待确认。 -- `workflow.mode=adaptive`:达标后按复杂度自动推进。 -- 用户输入“取消”:按取消模板结束流程。 diff --git a/TraeCn/Skills/CN/skills/sopify/analyze/scripts/score_requirement.py b/TraeCn/Skills/CN/skills/sopify/analyze/scripts/score_requirement.py deleted file mode 100644 index 3392485..0000000 --- a/TraeCn/Skills/CN/skills/sopify/analyze/scripts/score_requirement.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 -"""Deterministic requirement score calculator for analyze skill.""" - -from __future__ import annotations - -import argparse -import json -from typing import Dict - -MAX_BY_DIMENSION: Dict[str, int] = { - "goal_clarity": 3, - "expected_outcome": 3, - "scope_boundary": 2, - "constraints": 2, -} - - -def _bounded_int(name: str, value: int) -> int: - max_score = MAX_BY_DIMENSION[name] - if value < 0 or value > max_score: - raise ValueError(f"{name} must be in [0, {max_score}], got {value}") - return value - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description="Compute requirement completeness score in a deterministic way." - ) - parser.add_argument("--goal-clarity", type=int, required=True) - parser.add_argument("--expected-outcome", type=int, required=True) - parser.add_argument("--scope-boundary", type=int, required=True) - parser.add_argument("--constraints", type=int, required=True) - parser.add_argument("--require-score", type=int, default=7) - return parser.parse_args() - - -def main() -> int: - args = parse_args() - scores = { - "goal_clarity": _bounded_int("goal_clarity", args.goal_clarity), - "expected_outcome": _bounded_int("expected_outcome", args.expected_outcome), - "scope_boundary": _bounded_int("scope_boundary", args.scope_boundary), - "constraints": _bounded_int("constraints", args.constraints), - } - - total = sum(scores.values()) - missing_dimensions = [name for name, score in scores.items() if score == 0] - - result = { - "scores": scores, - "total": total, - "max_total": sum(MAX_BY_DIMENSION.values()), - "require_score": args.require_score, - "pass": total >= args.require_score, - "missing_dimensions": missing_dimensions, - } - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/TraeCn/Skills/CN/skills/sopify/design/SKILL.md b/TraeCn/Skills/CN/skills/sopify/design/SKILL.md deleted file mode 100644 index 9e50b6d..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/SKILL.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: design -description: 方案设计阶段入口;聚合方案分级、任务拆分与方案包输出规则,按需加载 references/assets/scripts。 ---- - -# Design(入口文档) - -## 何时激活 - -- 进入方案设计阶段(`workflow` / `plan_only` / `light_iterate`)。 -- 需要把需求转换为可执行方案包与任务清单。 - -## 执行骨架 - -1. 加载 `references/design-rules.md`。 -2. 基于变更信号判定 `light/standard/full`。 -3. 按级别选取 `assets/` 中对应模板生成方案文件。 -4. 产出任务清单并做粒度检查(每项可验证、依赖明确)。 -5. 在正式 plan 包中补齐评分区块,并输出带评分的方案摘要,格式参考 `assets/output-summary.md`。 - -## 资源导航 - -- 长规则:`references/design-rules.md` -- 模板:`assets/*.md` -- 确定性分级脚本:`scripts/select_plan_level.py` - -## 确定性逻辑(脚本优先) - -当 `plan.level=auto` 时,优先调用: - -```bash -python3 Codex/Skills/CN/skills/sopify/design/scripts/select_plan_level.py \ - --file-count 6 \ - --new-feature \ - --cross-module -``` - -脚本输出 JSON,包含:建议级别与触发原因。 - -## 边界 - -- 不直接执行代码任务(交给 `develop`)。 -- 不替代 runtime 的路由决策,仅提供方案结构与任务拆分契约。 diff --git a/TraeCn/Skills/CN/skills/sopify/design/assets/adr-template.md b/TraeCn/Skills/CN/skills/sopify/design/assets/adr-template.md deleted file mode 100644 index 20f3377..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/assets/adr-template.md +++ /dev/null @@ -1,19 +0,0 @@ -# ADR-001: {决策标题} - -## 状态 -已采纳 | 待定 | 已废弃 - -## 上下文 -{背景和问题} - -## 决策 -{核心决策} - -## 理由 -{原因} - -## 替代方案 -- {方案A}: 拒绝原因 - {原因} - -## 影响 -{后果与风险} diff --git a/TraeCn/Skills/CN/skills/sopify/design/assets/background-template.md b/TraeCn/Skills/CN/skills/sopify/design/assets/background-template.md deleted file mode 100644 index 1df45ee..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/assets/background-template.md +++ /dev/null @@ -1,24 +0,0 @@ -# 变更提案: {功能名称} - -## 需求背景 -{描述现状、痛点及变更驱动因素} - -评分: -- 方案质量: {X}/10 -- 落地就绪: {Y}/10 - -评分理由: -- 优点: {1 行} -- 扣分: {1 行} - -## 变更内容 -1. {变更点1} -2. {变更点2} - -## 影响范围 -- 模块: {列表} -- 文件: {列表} - -## 风险评估 -- 风险: {描述} -- 缓解: {措施} diff --git a/TraeCn/Skills/CN/skills/sopify/design/assets/design-template.md b/TraeCn/Skills/CN/skills/sopify/design/assets/design-template.md deleted file mode 100644 index 90dcb27..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/assets/design-template.md +++ /dev/null @@ -1,14 +0,0 @@ -# 技术设计: {功能名称} - -## 技术方案 -- 核心技术: {语言/框架/库} -- 实现要点: - - {要点1} - - {要点2} - -## 架构设计 -{如有变更,包含 mermaid 图} - -## 安全与性能 -- 安全: {措施} -- 性能: {优化} diff --git a/TraeCn/Skills/CN/skills/sopify/design/assets/output-summary.md b/TraeCn/Skills/CN/skills/sopify/design/assets/output-summary.md deleted file mode 100644 index 7c56c91..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/assets/output-summary.md +++ /dev/null @@ -1,14 +0,0 @@ -[{BRAND_NAME}] 方案设计 ✓ - -方案: .sopify-skills/plan/{YYYYMMDD}_{feature}/ -概要: {一句话技术方案} -任务: {N} 项 -方案质量: {X}/10 -落地就绪: {Y}/10 -评分理由: {1 行} - ---- -Changes: {N} files - - .sopify-skills/plan/... - -Next: 在宿主会话中继续评审或执行方案,或直接回复修改意见 diff --git a/TraeCn/Skills/CN/skills/sopify/design/assets/plan-light-template.md b/TraeCn/Skills/CN/skills/sopify/design/assets/plan-light-template.md deleted file mode 100644 index 285640f..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/assets/plan-light-template.md +++ /dev/null @@ -1,24 +0,0 @@ -# {功能名称} - -## 背景 -{1-2 句话描述需求背景} - -评分: -- 方案质量: {X}/10 -- 落地就绪: {Y}/10 - -评分理由: -- 优点: {1 行} -- 扣分: {1 行} - -## 方案 -{技术方案要点,列表形式} - -## 任务 -- [ ] {任务1} -- [ ] {任务2} -- [ ] {任务3} - -## 变更文件 -- {file1} -- {file2} diff --git a/TraeCn/Skills/CN/skills/sopify/design/assets/tasks-template.md b/TraeCn/Skills/CN/skills/sopify/design/assets/tasks-template.md deleted file mode 100644 index 4be5031..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/assets/tasks-template.md +++ /dev/null @@ -1,13 +0,0 @@ -# 任务清单: {功能名称} - -目录: `.sopify-skills/plan/YYYYMMDD_{feature}/` - -## 1. {模块名称} -- [ ] 1.1 在 `{文件路径}` 中实现 {功能} -- [ ] 1.2 在 `{文件路径}` 中实现 {功能} - -## 2. 测试 -- [ ] 2.1 {测试任务} - -## 3. 文档更新 -- [ ] 3.1 更新 `project.md / blueprint/background.md / blueprint/design.md / blueprint/tasks.md` diff --git a/TraeCn/Skills/CN/skills/sopify/design/references/design-rules.md b/TraeCn/Skills/CN/skills/sopify/design/references/design-rules.md deleted file mode 100644 index 4d20b34..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/references/design-rules.md +++ /dev/null @@ -1,93 +0,0 @@ -# Design 详细规则 - -## 目标 - -设计技术方案,拆分可执行任务,生成可回放的方案包。 - -## 总流程 - -1. 判定方案包级别(`light/standard/full`)。 -2. 生成方案文件骨架。 -3. 拆分任务并标注验证标准。 -4. 输出摘要并等待宿主后续动作。 - -## 步骤 1:方案包级别判定 - -自动判定规则(`plan.level=auto`): - -- `light`:文件数 3-5,且无架构级变更,修改范围明确。 -- `standard`:文件数 >5,或新功能开发,或跨模块改动。 -- `full`:架构级变更、重大重构、新系统设计。 - -## 步骤 2:生成方案文件 - -- `light`:生成 `plan.md`。 -- `standard`:生成 `background.md + design.md + tasks.md`。 -- `full`:在 standard 基础上补 `adr/` 与 `diagrams/`。 -- 正式 plan 包默认带评分区块: - - `light`:写入 `plan.md` - - `standard/full`:写入 `background.md` -- 方案摘要也必须显式输出: - - `方案质量` - - `落地就绪` - - `评分理由` - -模板来源统一使用 `assets/` 目录: - -1. `assets/plan-light-template.md` -2. `assets/background-template.md` -3. `assets/design-template.md` -4. `assets/tasks-template.md` -5. `assets/adr-template.md` - -## 步骤 3:任务拆分 - -任务约束: - -1. 每项建议 30 分钟内可完成。 -2. 每项需具备可验证完成标准。 -3. 依赖关系清晰,避免隐藏前置条件。 - -任务分类建议: - -1. 核心功能实现 -2. 辅助功能 -3. 安全检查 -4. 测试 -5. 文档更新(`project.md / blueprint/*`) - -任务状态符号: - -- `[ ]` 待执行 -- `[x]` 已完成 -- `[-]` 已跳过 -- `[!]` 阻塞中 - -## 阶段转换 - -- `workflow.mode=strict`:输出方案摘要后等待确认。 -- `workflow.mode=adaptive`: - - `~go` 触发:进入执行前确认或后续宿主链路。 - - `~go plan` 触发:只输出方案摘要并停止。 -- 用户反馈修改意见:留在本阶段,更新文件后再次输出摘要。 - -## runtime helper 边界 - -当仓库存在 `scripts/sopify_runtime.py` 且输入为原始请求时: - -1. 优先交给默认 runtime 入口,不手工强制改写为 `~go plan`。 -2. 明确是 `~go plan` 路径时,优先调用 `scripts/go_plan_runtime.py`。 -3. `go_plan_runtime.py` 仅用于 plan-only slice。 -4. `~compare` 仍依赖宿主侧专用桥接。 - -入口缺失时,才按本技能模板手工生成方案文件。 - -## 命名规则 - -方案目录格式:`YYYYMMDD_feature_name` - -示例: - -- `20260115_user_auth` -- `20260115_fix_login_bug` -- `20260115_refactor_api` diff --git a/TraeCn/Skills/CN/skills/sopify/design/scripts/select_plan_level.py b/TraeCn/Skills/CN/skills/sopify/design/scripts/select_plan_level.py deleted file mode 100644 index 0c4f663..0000000 --- a/TraeCn/Skills/CN/skills/sopify/design/scripts/select_plan_level.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 -"""Deterministic plan-level selector for design skill.""" - -from __future__ import annotations - -import argparse -import json -from typing import List - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description="Select plan level based on explicit change signals." - ) - parser.add_argument("--file-count", type=int, required=True) - parser.add_argument("--architecture-change", action="store_true") - parser.add_argument("--major-refactor", action="store_true") - parser.add_argument("--new-system", action="store_true") - parser.add_argument("--new-feature", action="store_true") - parser.add_argument("--cross-module", action="store_true") - return parser.parse_args() - - -def main() -> int: - args = parse_args() - reasons: List[str] = [] - - if args.architecture_change or args.major_refactor or args.new_system: - level = "full" - if args.architecture_change: - reasons.append("architecture_change") - if args.major_refactor: - reasons.append("major_refactor") - if args.new_system: - reasons.append("new_system") - elif args.file_count > 5 or args.new_feature or args.cross_module: - level = "standard" - if args.file_count > 5: - reasons.append("file_count_gt_5") - if args.new_feature: - reasons.append("new_feature") - if args.cross_module: - reasons.append("cross_module") - elif 3 <= args.file_count <= 5: - level = "light" - reasons.append("file_count_between_3_and_5") - else: - level = "light" - reasons.append("default_light_for_small_scope") - - result = { - "plan_level": level, - "file_count": args.file_count, - "reasons": reasons, - } - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/TraeCn/Skills/CN/skills/sopify/develop/SKILL.md b/TraeCn/Skills/CN/skills/sopify/develop/SKILL.md deleted file mode 100644 index 0b49320..0000000 --- a/TraeCn/Skills/CN/skills/sopify/develop/SKILL.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -name: develop -description: 开发实施阶段入口;聚合任务执行、状态更新、知识库同步与收尾迁移规则,按需加载 references/assets/scripts。 ---- - -# Develop(入口文档) - -## 何时激活 - -- 进入开发实施阶段(`workflow` / `light_iterate` / `quick_fix` / `exec_plan`)。 -- 需要执行任务清单、更新状态并收敛交付结果。 - -## 执行骨架 - -1. 读取活动方案任务(`tasks.md` 或 light 的 `plan.md`)。 -2. 提取待执行任务并按编号顺序执行。 -3. 每完成一步更新任务状态(`[ ] -> [x] / [-] / [!]`)。 -4. 同步知识库与偏好/反馈(保守写入)。 -5. 方案完成后迁移到 `history/` 并更新索引。 -6. 按结果输出成功/部分成功/快速修复摘要。 - -## 资源导航 - -- 长规则:`references/develop-rules.md` -- 输出模板:`assets/*.md` -- 任务提取脚本:`scripts/extract_pending_tasks.py` - -## 确定性逻辑(脚本优先) - -当需要可审计地提取任务状态时,优先调用: - -```bash -python3 Codex/Skills/CN/skills/sopify/develop/scripts/extract_pending_tasks.py \ - --tasks-file .sopify-skills/plan//tasks.md -``` - -脚本输出 JSON,包含:待执行任务、状态统计与执行顺序。 - -## 边界 - -- 本技能负责执行与收尾,不负责重新定义方案结构(交给 `design`)。 -- 回滚属于显式用户动作,必须保留可追溯记录。 diff --git a/TraeCn/Skills/CN/skills/sopify/develop/assets/output-partial.md b/TraeCn/Skills/CN/skills/sopify/develop/assets/output-partial.md deleted file mode 100644 index 46ffd5c..0000000 --- a/TraeCn/Skills/CN/skills/sopify/develop/assets/output-partial.md +++ /dev/null @@ -1,13 +0,0 @@ -[{BRAND_NAME}] 开发实施 ! - -完成: {M}/{N} 任务 -阻塞: {K} 项 - -阻塞任务: - - [!] 2.3 {任务描述} - {阻塞原因} - ---- -Changes: {N} files - - ... - -Next: 解决阻塞后在宿主会话中继续恢复当前流程 diff --git a/TraeCn/Skills/CN/skills/sopify/develop/assets/output-quick-fix.md b/TraeCn/Skills/CN/skills/sopify/develop/assets/output-quick-fix.md deleted file mode 100644 index 61334a9..0000000 --- a/TraeCn/Skills/CN/skills/sopify/develop/assets/output-quick-fix.md +++ /dev/null @@ -1,10 +0,0 @@ -[{BRAND_NAME}] 快速修复 ✓ - -修复: {一句话描述} - ---- -Changes: {N} files - - {file1} - - {file2} - -Next: 请验证修复 diff --git a/TraeCn/Skills/CN/skills/sopify/develop/assets/output-success.md b/TraeCn/Skills/CN/skills/sopify/develop/assets/output-success.md deleted file mode 100644 index 97572ad..0000000 --- a/TraeCn/Skills/CN/skills/sopify/develop/assets/output-success.md +++ /dev/null @@ -1,13 +0,0 @@ -[{BRAND_NAME}] 开发实施 ✓ - -完成: {N}/{N} 任务 -测试: 通过 - ---- -Changes: {N} files - - src/xxx.vue - - src/xxx.ts - - .sopify-skills/blueprint/design.md - - .sopify-skills/history/... - -Next: 请验证功能 diff --git a/TraeCn/Skills/CN/skills/sopify/develop/references/develop-rules.md b/TraeCn/Skills/CN/skills/sopify/develop/references/develop-rules.md deleted file mode 100644 index f8907ae..0000000 --- a/TraeCn/Skills/CN/skills/sopify/develop/references/develop-rules.md +++ /dev/null @@ -1,216 +0,0 @@ -# Develop 详细规则 - -## 目标 - -按任务清单实施开发,维护任务状态,按 `knowledge_sync` 同步 V2 长期知识,并通过 task-level 质量循环确保“有验证证据才算完成”。 - -## 总流程 - -1. 读取任务清单。 -2. 对每个任务按固定质量循环执行:实现修改 -> 发现验证 -> 执行验证 -> 必要时一次重试 -> 两阶段复审。 -3. 仅在质量结果满足最小 contract 后更新状态。 -4. 按 `knowledge_sync` 同步知识库与偏好信息。 -5. 迁移方案包到 `history/`。 -6. 输出执行结果摘要。 - -## 步骤 1:读取任务清单 - -来源: - -- `.sopify-skills/plan/{current_plan}/tasks.md` -- `.sopify-skills/plan/{current_plan}/plan.md`(light) - -处理规则: - -1. 提取 `[ ]` 待执行任务。 -2. 按任务编号顺序执行。 -3. 先检查显式依赖再执行。 - -## 步骤 2:执行任务 - -### 2.1 任务级质量循环 - -每个任务按以下顺序执行: - -1. 定位目标文件。 -2. 理解当前实现。 -3. 实施修改。 -4. 发现验证命令。 -5. 执行验证。 -6. 首次失败时允许带失败上下文自动重试一次。 -7. 对失败收口做结构化根因分类。 -8. 执行两阶段复审:`spec_compliance` -> `code_quality`。 -9. 只有质量结果满足最小 contract 后才更新状态。 - -硬性约束: - -- 没有验证证据,不算完成。 -- `overbuild`、`underbuild`、`应该没问题` 这类主观判断不能替代验证或复审结果。 -- 不允许静默跳过验证,也不允许无限重试。 - -### 2.2 最小 verify contract - -develop 阶段统一使用以下字段名,不再混用 `discovery_source`、`status`、`configured`、`discovered` 等别名: - -1. `verification_source` - - 只表达验证来源,允许值固定为: - - `project_contract` - - `project_native` - - `not_configured` -2. `command` - - 记录本次尝试执行的验证命令。 - - 若没有稳定命令,允许为空,但必须补 `reason_code`,不能伪装为已验证。 -3. `scope` - - 记录验证覆盖的任务、文件或模块范围。 -4. `result` - - 固定使用: - - `passed` - - `retried` - - `failed` - - `skipped` - - `replan_required` -5. `reason_code` - - 当无法执行、显式降级、跳过或回退 plan review 时必须存在。 -6. `retry_count` - - v1 只允许 `0` 或 `1`。 -7. `root_cause` - - 失败收口或重试路径上必须存在。 -8. `review_result` - - 必须至少包含 `spec_compliance` 与 `code_quality` 两阶段结论。 - -补充说明: - -- `.sopify-skills/project.md` 的 `verify` 约定是后续长期落点;当它已存在时,作为最高优先级来源,但不是当前 v1 落地前提。 -- `verification_source` 只表示来源,不复用为结果态;“是否跳过/为何降级”统一通过 `result + reason_code` 表达。 - -### 2.3 验证发现顺序 - -固定优先级: - -1. `project_contract` - - 即 `.sopify-skills/project.md` 中已显式定义的 `verify` 约定。 -2. `project_native` - - 项目原生脚本或配置,例如 `package.json`、`pyproject.toml`、`Makefile`、`justfile` 中稳定的验证入口。 -3. `not_configured` - - 当仓库没有稳定命令时,必须可见降级,并写明 `reason_code`;不能把“没有找到命令”视为默认通过。 - -### 2.4 失败处理与根因分类 - -失败处理口径: - -1. 第一次验证失败后,允许自动重试一次。 -2. 第二次仍失败时,必须停止自动重试。 -3. 第二次失败或显式放弃重试时,必须写入 `root_cause`。 - -`root_cause` 允许值固定为: - -- `logic_regression` -- `environment_or_dependency` -- `missing_test_infra` -- `scope_or_design_mismatch` - -分流约束: - -- `logic_regression`:允许继续 develop,但必须带失败上下文修复。 -- `environment_or_dependency`:可见标记环境无法证明通过,不把任务伪装为已验证完成。 -- `missing_test_infra`:允许保留任务未验证完成,并显式写出补测要求。 -- `scope_or_design_mismatch`:不得继续盲修,应优先回到 plan review、decision checkpoint 或其他宿主确认链路。 - -### 2.5 两阶段复审 - -Stage A `spec_compliance` 至少检查: - -1. 是否满足当前任务目标与边界。 -2. 是否存在明显 `overbuild` 或 `underbuild`。 -3. 是否引入新的范围变化或需要用户拍板的分叉。 - -Stage B `code_quality` 至少检查: - -1. 是否与现有代码风格一致。 -2. 是否存在明显安全性、稳定性或可维护性回退。 -3. 修改面、注释、测试与知识同步是否达到当前任务最低标准。 - -状态迁移: - -- 成功:只有当 `verification_source / result / review_result` 满足最小 contract 时,才允许 `[ ] -> [x]` -- 跳过:`[ ] -> [-]` -- 阻塞:`[ ] -> [!]` - -安全底线: - -- 不引入常见漏洞(XSS / SQL 注入等)。 -- 不破坏既有功能。 -- 保持项目代码风格一致。 - -## 步骤 3:知识库同步 - -同步时机: - -1. 每完成一个模块任务后。 -2. 阶段收尾时做统一复核。 - -同步目标: - -- `project.md` -- `blueprint/background.md` -- `blueprint/design.md` -- `blueprint/tasks.md` -- `user/preferences.md`(仅长期偏好) -- `user/feedback.jsonl` - -正式判断口径: - -- `knowledge_sync.skip`:本轮不要求同步。 -- `knowledge_sync.review`:finalize 前至少复核。 -- `knowledge_sync.required`:未更新则 finalize 阻断。 - -偏好写入(保守策略): - -允许写入: - -- 用户明确表达长期偏好(如“以后默认...”)。 - -禁止写入: - -- 一次性指令。 -- 上下文不完整的猜测。 -- 与任务无关的泛化结论。 - -## 步骤 4:方案迁移 - -迁移路径: - -```text -.sopify-skills/plan/YYYYMMDD_feature/ - -> .sopify-skills/history/YYYY-MM/YYYYMMDD_feature/ -``` - -索引更新:在首次显式 finalize 时按需创建并更新 `.sopify-skills/history/index.md`。 - -## 输出模板 - -按结果类型选择 `assets/`: - -1. `assets/output-success.md` -2. `assets/output-partial.md` -3. `assets/output-quick-fix.md` - -## 特殊情况 - -执行中断: - -1. 已完成任务标记 `[x]`。 -2. 当前任务保持 `[ ]`。 -3. 输出中断摘要,等待宿主恢复。 - -任务失败: - -1. 标记 `[!]` 并注明原因。 -2. 若存在失败收口,必须补 `reason_code`,并在需要时补 `root_cause` 与 `review_result`。 -3. 仅继续不受阻塞的独立任务。 - -回滚请求: - -1. 使用 git 回滚(仅在用户明确要求时)。 -2. 保留方案包在 `plan/`,不迁移。 -3. 输出回滚确认。 diff --git a/TraeCn/Skills/CN/skills/sopify/develop/scripts/extract_pending_tasks.py b/TraeCn/Skills/CN/skills/sopify/develop/scripts/extract_pending_tasks.py deleted file mode 100644 index 812d5e2..0000000 --- a/TraeCn/Skills/CN/skills/sopify/develop/scripts/extract_pending_tasks.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python3 -"""Extract deterministic task status summary from a plan markdown file.""" - -from __future__ import annotations - -import argparse -import json -import re -from pathlib import Path -from typing import Dict, List - -TASK_PATTERN = re.compile(r"^\s*-\s*\[(?P[ x!\-])\]\s*(?P.+?)\s*$") - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description="Extract pending/completed/blocked/skipped tasks from markdown." - ) - parser.add_argument("--tasks-file", required=True, help="Path to tasks.md or plan.md") - return parser.parse_args() - - -def classify_status(raw: str) -> str: - if raw == " ": - return "pending" - if raw == "x": - return "completed" - if raw == "!": - return "blocked" - if raw == "-": - return "skipped" - return "unknown" - - -def main() -> int: - args = parse_args() - path = Path(args.tasks_file) - lines = path.read_text(encoding="utf-8").splitlines() - - tasks: List[Dict[str, str]] = [] - counts: Dict[str, int] = { - "pending": 0, - "completed": 0, - "blocked": 0, - "skipped": 0, - } - - for idx, line in enumerate(lines, start=1): - match = TASK_PATTERN.match(line) - if not match: - continue - status_key = classify_status(match.group("status")) - text = match.group("text") - tasks.append({"line": idx, "status": status_key, "text": text}) - if status_key in counts: - counts[status_key] += 1 - - result = { - "tasks_file": str(path), - "counts": counts, - "pending_tasks": [task for task in tasks if task["status"] == "pending"], - "all_tasks": tasks, - } - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/TraeCn/Skills/CN/skills/sopify/kb/SKILL.md b/TraeCn/Skills/CN/skills/sopify/kb/SKILL.md deleted file mode 100644 index 4e26de0..0000000 --- a/TraeCn/Skills/CN/skills/sopify/kb/SKILL.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -name: kb -description: 知识库管理技能;知识库操作时读取;包含初始化、更新、同步策略 ---- - -# 知识库管理 - V2 规则 - -**目标:** 管理 `.sopify-skills/` 的 V2 分层知识,保持长期知识、活动方案与归档层职责清晰。 - -## 知识库结构 - -```text -.sopify-skills/ -├── blueprint/ -│ ├── README.md # 纯索引页,只保留索引必需区块 -│ ├── background.md # 长期目标、范围、非目标 -│ ├── design.md # 模块/宿主/目录/消费契约 -│ └── tasks.md # 未完成长期项与明确延后项 -├── project.md # 项目技术约定 -├── user/ -│ ├── preferences.md # 用户长期偏好 -│ └── feedback.jsonl # 原始反馈事件 -├── plan/ -│ └── YYYYMMDD_feature/ # 当前活动方案 -├── history/ -│ ├── index.md # 归档索引 -│ └── YYYY-MM/ -└── state/ # runtime machine truth -``` - -## 初始化策略 - -### Full 模式 (`kb_init: full`) - -首次 bootstrap 直接创建: - -```yaml -创建文件: - - .sopify-skills/project.md - - .sopify-skills/user/preferences.md - - .sopify-skills/user/feedback.jsonl - - .sopify-skills/blueprint/README.md - - .sopify-skills/blueprint/background.md - - .sopify-skills/blueprint/design.md - - .sopify-skills/blueprint/tasks.md -``` - -注意: - -- 不预建 `plan/` 正文。 -- 不预建 `history/index.md` 或任何 archive。 - -### Progressive 模式 (`kb_init: progressive`) [默认] - -按生命周期创建: - -```yaml -首次真实项目触发: - - .sopify-skills/project.md - - .sopify-skills/user/preferences.md - - .sopify-skills/blueprint/README.md - -首次进入 plan 生命周期: - - .sopify-skills/blueprint/background.md - - .sopify-skills/blueprint/design.md - - .sopify-skills/blueprint/tasks.md - - .sopify-skills/plan/YYYYMMDD_feature/ - -首次显式 ~go finalize: - - .sopify-skills/history/index.md - - .sopify-skills/history/YYYY-MM/YYYYMMDD_feature/ - -首次出现明确长期偏好: - - .sopify-skills/user/feedback.jsonl -``` - -## 上下文读取顺序 - -1. `project.md` -2. `user/preferences.md` -3. `blueprint/README.md` -4. `blueprint/background.md` -5. `blueprint/design.md` -6. `blueprint/tasks.md` -7. `active_plan = current_plan.path + current_plan.files` - -读取规则: - -- 咨询/澄清优先消费 `L0/L1`,不强制要求 deep blueprint。 -- planning / develop 才进入 `L2 active plan`。 -- `history/` 不是默认长期上下文,只在 finalize 后查询或人工追溯时读取。 - -## 更新规则 - -### L0 索引约束 - -- `blueprint/README.md` 只保留 `状态 / 维护方式 / 当前目标 / 当前焦点 / 深入阅读入口`。 -- 不把绝对工作目录、架构正文、正式契约正文写进 `blueprint/README.md`。 -- 若 `blueprint/` 根层存在额外长期专题文档,必须在 `blueprint/README.md` 显式列出入口。 - -### `blueprint/tasks.md` 边界 - -- 只保留未完成长期项与明确延后项。 -- `[x]` 已完成项不应继续保留在 `blueprint/tasks.md`。 - -### 必须更新 - -- `project.md`:跨任务可复用的技术约定变化。 -- `blueprint/background.md`:长期目标、范围、非目标变化。 -- `blueprint/design.md`:模块/宿主/目录/消费契约变化。 -- `blueprint/tasks.md`:长期未完成项或明确延后项变化。 -- `user/preferences.md`:用户明确声明长期偏好。 - -### 不应写入长期知识 - -- 一次性实现细节。 -- 当前 plan 的短期拆解。 -- 仅属于本轮任务的临时取舍。 -- 已完成任务清单继续滞留在 `blueprint/tasks.md`。 -- history 正文回灌到 blueprint。 - -## `knowledge_sync` 同步契约 - -```yaml -knowledge_sync: - project: skip|review|required - background: skip|review|required - design: skip|review|required - tasks: skip|review|required -``` - -执行要求: - -- `skip`:本轮不要求同步。 -- `review`:finalize 前至少复核。 -- `required`:未更新则 finalize 阻断。 - -## 冲突处理 - -- 代码与文档冲突:以代码现状为准,文档随后修正。 -- 当前任务与长期偏好冲突:当前任务明确要求 > `user/preferences.md` > 默认规则。 - -## 输出格式 - -**初始化完成:** - -```text -[{BRAND_NAME}] 知识库初始化 ✓ - -创建: {N} 文件 -策略: {full/progressive} - ---- -Changes: {N} files - - .sopify-skills/project.md - - .sopify-skills/blueprint/README.md - - ... - -Next: 知识库已就绪 -``` - -**同步完成:** - -```text -[{BRAND_NAME}] 知识库同步 ✓ - -更新: {N} 文件 - ---- -Changes: {N} files - - .sopify-skills/project.md - - .sopify-skills/blueprint/design.md - - ... - -Next: 文档已更新 -``` diff --git a/TraeCn/Skills/CN/skills/sopify/model-compare/SKILL.md b/TraeCn/Skills/CN/skills/sopify/model-compare/SKILL.md deleted file mode 100644 index c8ddf23..0000000 --- a/TraeCn/Skills/CN/skills/sopify/model-compare/SKILL.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -name: model-compare -description: 多模型对比子技能;仅在 `~compare <问题>` 或 `对比分析:<问题>` 触发;按配置并发调用多个模型并提供人工选择。 ---- - -# 模型对比(MVP)- 运行时收口规则 - -**目标:** 对同一输入并发调用多个已配置模型,统一展示结果,交给用户人工选择。 - ---- - -## 触发条件(仅两种) - -```yaml -1) 命令前缀: ~compare <问题> -2) 自然语言前缀: 对比分析:<问题> -``` - -其他输入(如 `~go`、普通问答)不触发本技能。 - ---- - -## 入口接线(~compare / 对比分析:) - -- 触发后必须调用 `scripts/model_compare_runtime.py` 的 `run_model_compare_runtime(...)` -- 运行时链路固定为:抽取 -> 脱敏 -> 截断 -> 统一请求 -> 并发调用 -> 结果归一化 -- `context_bridge` 未配置按 `true` 处理;`false` 必走旁路(仅问题文本) -- 若上下文包为空(`facts=0` 且 `snippets=0`),必须按 `context_pack empty` 降级 -- 输出必须带元信息:`bridge/files/snippets/redactions/truncated` - -> 文档收口:执行层细节以 `scripts/model_compare_runtime.py` 为单一事实来源(SSOT),本文件只保留入口契约与展示契约。 - ---- - -## 配置读取 - -从 `sopify.config.yaml` 读取: - -```yaml -multi_model: - enabled: true|false - trigger: manual - timeout_sec: 25 - max_parallel: 3 - include_default_model: true|false # 可选,默认 true - context_bridge: true|false # 可选,默认 true;单旁路开关 - candidates: - - id: glm - enabled: true - provider: openai_compatible - base_url: https://... - model: glm-4.7 - api_key_env: GLM_API_KEY -``` - -**开关语义(保留双层):** -- `multi_model.enabled`:功能总开关;`false` 时不进入多模型并发 -- `multi_model.candidates[*].enabled`:候选参与开关;仅控制该候选是否参与 -- `multi_model.include_default_model`:是否将“当前会话默认模型”加入候选;未配置时默认 `true`(无需额外配置) -- `multi_model.context_bridge`:上下文桥接旁路开关;未配置时默认 `true`。`true` 使用运行时桥接链路,`false` 仅发送问题文本(应急旁路) - -**MVP 约束:** -- 仅支持 `provider: openai_compatible` -- API Key 只从环境变量读取(`api_key_env`) -- 不允许在配置或输出中暴露明文 key - ---- - -## 执行流程(入口侧) - -``` -1. 解析问题文本(去掉 "~compare " 或 "对比分析:" 前缀) -2. 读取 multi_model 配置,并补齐默认值:include_default_model=true, context_bridge=true -3. 构造运行时参数: - - `question`(清洗后的问题) - - `multi_model_config`(原始配置) - - `default_candidate`(当前会话默认模型候选) - - `model_caller`(模型调用回调) -4. 调用 `run_model_compare_runtime(...)` 获取统一结果 -5. 若返回 `mode=fanout`:输出 A/B/C... 并等待人工选择;若 `mode=single`:直接输出单模型结果与“降级原因明细” -6. 输出行必须包含上下文元信息:`bridge/files/snippets/redactions/truncated` -``` - ---- - -## 运行时收口(以代码为准) - -- 实现文件:`scripts/model_compare_runtime.py` -- 主入口:`run_model_compare_runtime(...)` -- 配置默认值:`include_default_model=true`、`context_bridge=true` -- 固定预算:`max_files=6`、`max_snippets=10`、`max_lines_per_snippet=160`、`max_chars_total=12000` -- 固定契约:空包降级原因 `context_pack empty`、统一元信息 `bridge/files/snippets/redactions/truncated` - ---- - -## 结果与失败策略 - -**先返回处理:** -- 某模型先返回时,仅标记为 `done` -- 继续等待其他模型,直到全部完成或超时 -- 不提前结束整轮对比 - -**失败隔离:** -- 单模型失败/超时不影响其他模型输出 -- 至少 1 个模型成功时,仍可进入人工选择 -- 全部失败时,返回错误摘要并提示检查配置/环境变量 - -**无配置降级:** -- 若 `multi_model` 未配置、`enabled=false`、`candidates` 为空或 key 全缺失 -- 不报错,自动回退到单模型回答 -- 在输出中明确提示:本次未进入多模型并发,已按单模型执行 - -**降级原因明细(~compare 输出必须包含):** -- 输出“降级原因”列表,至少包含 1 条明确原因 -- 口径统一:优先输出 **reason code**(可选追加中文说明),推荐 code: - - `FEATURE_DISABLED: multi_model.enabled=false` - - `NO_ENABLED_CANDIDATES: candidates[*].enabled=true count=0` - - `UNSUPPORTED_PROVIDER: id={candidate_id}, provider={provider}` - - `MISSING_API_KEY: candidate_id={candidate_id}` - - `DEFAULT_MODEL_UNAVAILABLE: include_default_model=true` - - `CONTEXT_BRIDGE_BYPASSED: context_bridge=false` - - `CONTEXT_PACK_EMPTY: facts=0 snippets=0` - - `INSUFFICIENT_USABLE_MODELS: {available_count}<2` - ---- - -## 安全与日志 - -- 日志中脱敏:`api_key`、`token`、`cookie`、密码、私密连接串 -- 输出中不打印环境变量实际值 -- 仅记录必要元信息:模型 id、耗时、状态、错误摘要(可选) - ---- - -## 输出格式 - -``` -[{BRAND_NAME}] 咨询问答 ✓ - -模型对比完成: {success_count}/{total_count} -上下文桥接: {开启|关闭(旁路)} -上下文包: files={N}, snippets={N}, redactions={N}, truncated={true|false} -可选结果: A({model_id}) / B({model_id}) / C({model_id}) -提示: 回复“选A”或“选B”继续 - ---- -Changes: 0 files -Next: 请输入你的选择(如:选A) -``` - -**单模型降级输出示例:** - -``` -[{BRAND_NAME}] 咨询问答 ! - -未进入多模型并发,已按单模型执行。 -降级原因: -- INSUFFICIENT_USABLE_MODELS: 1<2 -结果: {single_model_result} - ---- -Changes: 0 files -Next: 可调整 multi_model.enabled / candidates[*].enabled / include_default_model / context_bridge 或补齐环境变量 -``` diff --git a/TraeCn/Skills/CN/skills/sopify/templates/SKILL.md b/TraeCn/Skills/CN/skills/sopify/templates/SKILL.md deleted file mode 100644 index 4a14094..0000000 --- a/TraeCn/Skills/CN/skills/sopify/templates/SKILL.md +++ /dev/null @@ -1,261 +0,0 @@ ---- -name: templates -description: 文档模板集合;创建文档时读取;包含所有知识库模板和方案文件模板 ---- - -# 文档模板集合 - -**模板使用说明:** -1. 将 `{...}` 内容替换为实际内容。 -2. 正式 plan 包默认带评分区块。 -3. `blueprint/README.md` 只保留轻量入口索引。 -4. 若 `blueprint/` 根层存在额外长期专题文档,必须在 `blueprint/README.md` 里显式列入口。 -5. `blueprint/tasks.md` 只保留未完成长期项与明确延后项;已完成项不继续保留在该文件。 - -## A1 | 知识库文档模板 - -### project.md - -```markdown -# 项目技术约定 - -## 技术栈 -- 核心: {语言版本} / {框架版本} -- 构建: {构建工具} -- 测试: {测试框架} - -## 使用约定 -- 这里只沉淀可复用的长期技术约定。 -- 一次性实现细节不默认写入本文件。 - -## 文档边界 -- `project.md`: 可复用技术约定 -- `blueprint/background.md`: 长期目标、范围、非目标 -- `blueprint/design.md`: 模块/宿主/目录/消费契约 -- `blueprint/tasks.md`: 未完成长期项与明确延后项 -``` - -### blueprint/README.md - -```markdown -# 项目蓝图索引 - -状态: {当前状态} -维护方式: 仅保留状态、当前目标、当前焦点与阅读入口;长说明进入其他 blueprint 文件 - -## 当前目标 -- 项目:`{项目名}` -- 长期目标与范围进入 `./background.md` - -## 当前焦点 -- 当前活动 plan:{有/无} -- history 归档:{状态} - -## 深入阅读入口 -- [项目技术约定](../project.md) -- [蓝图背景](./background.md) -- [蓝图设计](./design.md) -- [蓝图任务](./tasks.md) -- [长期专题蓝图](./{extra_blueprint_doc}.md) # 如存在额外长期专题文档,则逐项列出 -- [变更历史](../history/index.md) -``` - -### blueprint/background.md - -```markdown -# 蓝图背景 - -## 长期目标 -- {目标1} -- {目标2} - -## 范围 -- 范围内: {内容} -- 范围外: {内容} - -## 非目标 -- {内容} -``` - -### blueprint/design.md - -```markdown -# 蓝图设计 - -## 正式契约 -- `knowledge_sync` 是唯一正式同步契约。 -- `active_plan = current_plan.path + current_plan.files`。 - -## 消费契约 - -| Context Profile | Reads | Fail-open Rule | Notes | -|-----|------|------|------| -| `consult` | `project.md`, `preferences.md`, `blueprint/README.md` | 缺 deep blueprint 不报错 | 不强制物化 plan | -| `plan` | `L1` + `active_plan` | 缺 deep blueprint 时按生命周期补齐 | history 不是默认上下文 | -| `finalize` | `active_plan`, `knowledge_sync`, `blueprint/*`, `history/index.md` | 缺 `history/index.md` 时现场创建 | `required` 未满足则阻断 | -``` - -### blueprint/tasks.md - -```markdown -# 蓝图任务 - -状态: 只保留未完成长期项与明确延后项;已完成项不继续留在本文件。 - -## 未完成长期项 -- [ ] {长期项} - -## 明确延后项 -- [-] {延后项} -``` - -### history/index.md - -```markdown -# 变更历史索引 - -| 时间戳 | 功能名称 | 状态 | 方案包 | -|--------|----------|------|--------| -| {YYYYMMDD} | {功能} | ✓ | [链接](YYYY-MM/...) | -``` - -### user/preferences.md - -```markdown -# 用户长期偏好 - -> 仅记录用户明确声明的长期偏好;一次性指令不入库。 - -当前暂无已确认的长期偏好。 -``` - -### user/feedback.jsonl - -```json -{"timestamp":"2026-01-15T10:30:00Z","source":"chat","message":"以后默认先给最小改动清单","scope":"planning","promote_to_preference":true,"preference_id":"pref-002"} -{"timestamp":"2026-01-15T11:10:00Z","source":"chat","message":"这次把输出写详细点","scope":"current_task","promote_to_preference":false} -``` - -## A2 | 方案文件模板 - -### Light 级别 - plan.md - -```markdown -# {功能名称} - -## 背景 -{1-2 句话描述需求背景} - -评分: -- 方案质量: {X}/10 -- 落地就绪: {Y}/10 - -评分理由: -- 优点: {1 行} -- 扣分: {1 行} - -## 方案 -- {技术方案要点1} -- {技术方案要点2} - -## 任务 -- [ ] {任务1} -- [ ] {任务2} - -## 变更文件 -- {file1} -- {file2} -``` - -### Standard 级别 - background.md - -```markdown -# 变更提案: {功能名称} - -## 需求背景 -{描述现状、痛点及变更驱动因素} - -评分: -- 方案质量: {X}/10 -- 落地就绪: {Y}/10 - -评分理由: -- 优点: {1 行} -- 扣分: {1 行} - -## 变更内容 -1. {变更点1} -2. {变更点2} - -## 影响范围 -- 模块: {列表} -- 文件: {列表} - -## 风险评估 -- 风险: {描述} -- 缓解: {措施} -``` - -### Standard 级别 - design.md - -```markdown -# 技术设计: {功能名称} - -## 技术方案 -- 核心技术: {语言/框架/库} -- 实现要点: - - {要点1} - - {要点2} - -## 架构设计 -{如有架构变更} - -## 安全与性能 -- 安全: {措施} -- 性能: {优化} -``` - -### Standard 级别 - tasks.md - -```markdown -# 任务清单: {功能名称} - -目录: `.sopify-skills/plan/{YYYYMMDD}_{feature}/` - -## 1. {模块名称} -- [ ] 1.1 在 `{文件路径}` 中实现 {功能} -- [ ] 1.2 在 `{文件路径}` 中实现 {功能} - -## 2. 测试 -- [ ] 2.1 {测试任务} - -## 3. 文档更新 -- [ ] 3.1 更新 `project.md / blueprint/background.md / blueprint/design.md / blueprint/tasks.md` -``` - -### Full 级别 - adr/{NNN}-{title}.md - -```markdown -# ADR-{NNN}: {决策标题} - -## 状态 -已采纳 | 待定 | 已废弃 - -## 日期 -{YYYY-MM-DD} - -## 上下文 -{背景和问题描述} - -## 决策 -{核心决策内容} -``` - -## A3 | 任务状态符号 - -| 符号 | 含义 | -|-----|------| -| `[ ]` | 待执行 | -| `[x]` | 已完成 | -| `[-]` | 已跳过 | -| `[!]` | 阻塞中 | diff --git a/TraeCn/Skills/CN/skills/sopify/workflow-learning/CHANGELOG.md b/TraeCn/Skills/CN/skills/sopify/workflow-learning/CHANGELOG.md deleted file mode 100644 index 3aab47e..0000000 --- a/TraeCn/Skills/CN/skills/sopify/workflow-learning/CHANGELOG.md +++ /dev/null @@ -1,20 +0,0 @@ -# workflow-learning Changelog (CN) - -## [Unreleased] - -### Added - -- 初始版本:`workflow-learning` 子技能。 -- 支持 `capture / replay / breakdown` 三种模式。 -- 定义本地记录目录: - - `.sopify-skills/replay/sessions/{session_id}/session.md` - - `.sopify-skills/replay/sessions/{session_id}/events.jsonl` - - `.sopify-skills/replay/sessions/{session_id}/breakdown.md` -- 增加“回放最近一次 / 按 session_id 回放”的调用约定。 -- 增加敏感信息脱敏与边界规则。 - -### Changed - -- 新增 `workflow.learning.auto_capture` 策略说明:`always | by_requirement | manual | off`。 -- 明确策略边界:意图识别始终开启,`auto_capture` 仅控制主动记录。 -- 明确 `by_requirement` 粒度:`simple=off`、`medium=summary`、`complex=full`。 diff --git a/TraeCn/Skills/CN/skills/sopify/workflow-learning/SKILL.md b/TraeCn/Skills/CN/skills/sopify/workflow-learning/SKILL.md deleted file mode 100644 index 2907de5..0000000 --- a/TraeCn/Skills/CN/skills/sopify/workflow-learning/SKILL.md +++ /dev/null @@ -1,154 +0,0 @@ ---- -name: workflow-learning -description: 工作流学习子技能;用于完整记录任务执行链路并支持回放/复盘/为什么这么做的逐步讲解。用户提出回放、复盘、解释决策依据或学习实现思路时使用。 ---- - -# Workflow Learning - 复盘学习与讲解 - -## 目标 - -- 记录任务实现的关键链路(输入、操作、结果、决策依据)。 -- 支持“回放最近一次”或“按 session_id 回放”。 -- 生成可教学的逐步讲解,帮助用户学习实现思路。 - ---- - -## 触发条件 - -本技能有两类触发来源: - -1. **意图触发(始终开启)**:当用户表达以下意图时调用本技能 -2. **主动记录触发(受配置控制)**:由 `workflow.learning.auto_capture` 决定是否在开发流程中自动记录 - -意图触发关键词示例: - -- 回放:`回放`、`回看`、`重放`、`看过程` -- 复盘:`复盘`、`总结这次实现` -- 原因解释:`为什么这么做`、`这步怎么想的`、`为什么选这个方案` - -默认在“需求已实现完成后”使用;如用户中途要求,也可对当前已发生步骤进行部分回放。 - ---- - -## 主动记录策略(auto_capture) - -配置位置: - -```yaml -workflow: - learning: - auto_capture: by_requirement # always | by_requirement | manual | off -``` - -策略说明: - -| 值 | 行为 | -|----|------| -| `always` | 所有开发任务主动记录,按 full 粒度持续写入事件 | -| `by_requirement` | 按复杂度主动记录:simple=off,medium=summary,complex=full | -| `manual` | 仅在用户明确要求“开始记录这次任务”后记录 | -| `off` | 不新建记录;但意图触发仍可回放已有 session | - -`by_requirement` 粒度约定: - -- simple: 不主动记录 -- medium: 任务结束时写入 summary(最小事件集) -- complex: 全阶段 full 记录(analysis/design/develop/qa) - -注意:`auto_capture` 只影响“是否主动记录”,不影响“回放/复盘/为什么这么做”意图识别能力。 - ---- - -## 执行模式 - -### Mode A: capture(记录) - -在本地创建/更新会话记录目录: - -``` -.sopify-skills/replay/ -└── sessions/ - └── {session_id}/ - ├── session.md - ├── events.jsonl - └── breakdown.md -``` - -`session_id` 建议格式:`YYYYMMDD_HHMMSS_{topic}`(topic 使用短英文短语)。 - -`events.jsonl` 每条事件字段建议: - -```json -{ - "ts": "2026-02-13T16:30:00Z", - "phase": "analysis|design|develop|qa", - "intent": "本步目标", - "action": "命令/工具/编辑动作", - "key_output": "关键结果摘要", - "decision_reason": "选择该动作的依据", - "alternatives": ["备选方案A", "备选方案B"], - "result": "success|warning|failed", - "risk": "主要风险或空字符串", - "artifacts": ["path/to/file"] -} -``` - -### Mode B: replay(回放) - -输出结构: - -1. 任务目标与范围 -2. 关键步骤时间线 -3. 关键决策点(做了什么、为什么、结果如何) -4. 最终交付与验证状态 - -### Mode C: breakdown(逐步讲解) - -按步骤解释: - -1. 这一步要解决什么问题 -2. 为什么选当前方案 -3. 有哪些替代方案 -4. 风险与边界 -5. 对下一步的影响 - ---- - -## 安全与边界 - -- 仅记录可观察执行链路,不输出不可见内部思维链原文。 -- 写入日志前对敏感内容脱敏(token、api key、cookie、密码、私密连接串)。 -- 不记录与任务无关的个人隐私信息。 - ---- - -## 常用调用示例 - -- `回放最近一次实现` -- `按 session_id 回放 20260213_163000_auth-refactor` -- `复盘这次实现,重点讲为什么这么做` -- `把这次需求实现过程逐步讲给我` - ---- - -## 输出约定(简版) - -``` -[${BRAND_NAME}] 咨询问答 ✓ - -已生成回放记录: .sopify-skills/replay/sessions/{session_id}/session.md -已生成事件流水: .sopify-skills/replay/sessions/{session_id}/events.jsonl -已生成逐步讲解: .sopify-skills/replay/sessions/{session_id}/breakdown.md - ---- -Changes: 3 files -Next: 输入“回放最近一次”或“按 session_id 回放 ...” -``` - ---- - -## 变更记录 - -本子技能使用独立 changelog: - -- `CHANGELOG.md`(与仓库根 `CHANGELOG.md` 分离维护) diff --git a/TraeCn/Skills/CN/user_rules/sopify.md b/TraeCn/Skills/CN/user_rules/sopify.md deleted file mode 100644 index 64eeeba..0000000 --- a/TraeCn/Skills/CN/user_rules/sopify.md +++ /dev/null @@ -1,514 +0,0 @@ ---- -alwaysApply: true ---- - - - - - -# Sopify - 自适应 AI 编程助手 - -## 角色定义 - -**你是 Sopify** - 一个自适应的 AI 编程伙伴。根据任务复杂度自动选择最优工作流,追求高效与质量的平衡。 - -**核心理念:** -- **自适应工作流**:简单任务直接执行,复杂任务完整规划 -- **一屏可见**:输出精简,详情在文件里 -- **配置驱动**:通过 `sopify.config.yaml` 定制行为 - ---- - -## Core Rules (核心规则) - -### C1 | 配置加载与品牌 - -**启动时执行:** -```yaml -1. 配置加载优先级: 项目根 (./sopify.config.yaml) > 全局 (~/.trae-cn/sopify.config.yaml) > 内置默认值 -2. 默认不自动创建配置文件;如需自定义,请在项目根创建 sopify.config.yaml(可从 examples/sopify.config.yaml 复制) -3. 合并默认配置并设置运行时变量 -``` - -**品牌名获取 (当 brand: auto,默认由项目名生成):** -``` -项目名优先级: git remote 仓库名 > package.json name > 目录名 > "project" -品牌格式: {project_name}-ai -示例: my-app (项目名) → my-app-ai (品牌名) -``` - -**默认配置:** -```yaml -brand: auto -language: zh-CN -output_style: minimal -title_color: green -workflow.mode: adaptive -workflow.require_score: 7 -workflow.learning.auto_capture: by_requirement -plan.level: auto -plan.directory: .sopify-skills -multi_model.enabled: false -multi_model.trigger: manual -multi_model.timeout_sec: 25 -multi_model.max_parallel: 3 -multi_model.include_default_model: true -multi_model.context_bridge: true -``` - -说明:修改 `plan.directory` 只影响后续新生成的知识库/方案文件目录,默认不会自动迁移旧目录内容。 -说明:`title_color` 仅作用于输出标题行的轻量着色;若终端不支持颜色则自动回退为纯文本。 -说明:`workflow.learning.auto_capture` 仅控制是否主动记录;“回放/复盘/为什么这么做”意图识别始终开启。 -说明:`multi_model.enabled` 是功能总开关,`multi_model.candidates[*].enabled` 是候选参与开关;两者语义不同且同时生效。 -说明:`multi_model.include_default_model` 默认为 `true`(未配置也生效),会把当前会话默认模型加入候选。 -说明:`multi_model.context_bridge` 默认为 `true`;设为 `false` 可应急旁路(仅发送问题文本)。执行层细节与预算统一以 `scripts/model_compare_runtime.py` 为准。 -说明:进入并发对比需至少 2 个可用模型;不足时会降级单模型并输出统一 reason code。 - -### C2 | 输出格式 - -**统一输出模板:** -``` -[{BRAND_NAME}] {阶段名} {状态符} - -{核心信息, 最多3行} - ---- -Changes: {N} files - - {file1} - - {file2} - -Next: {下一步提示} -``` - -**Footer 契约:** -- footer 固定跟在 `Changes` 区块之后 -- `Next:` 必须作为 footer 最后一行。 -- footer 不展示生成时间;若需要机器可审计时间戳,内部摘要 / replay 文件可继续使用 ISO 8601(可带时区)。 - -**状态符:** -| 符号 | 含义 | -|-----|------| -| `✓` | 成功完成 | -| `?` | 等待输入 | -| `!` | 警告/需确认 | -| `×` | 取消/错误 | - -**阶段名:** -- 需求分析、方案设计、开发实施 -- 快速修复、轻量迭代 -- 模型对比 -- 命令完成(仅用于命令前缀流程,如 `~go/~go plan/~go exec/~compare`) -- 咨询问答(无命令前缀的问答/澄清场景) - -**输出原则:** -- 核心信息一屏可见 -- 详细内容写入文件 -- 避免冗余描述 -- 标题行可根据 `title_color` 轻量着色(仅标题行),不支持颜色时自动回退纯文本 - -### C3 | 工作流模式 - -**模式定义:** - -| 模式 | 行为 | -|-----|------| -| `strict` | 强制 3 阶段:需求分析 → 方案设计 → 开发实施 | -| `adaptive` | 根据复杂度自动选择 (默认) | -| `minimal` | 跳过规划,直接执行 | - -**adaptive 模式判定:** -```yaml -简单任务 (直接执行): - - 文件数 ≤ 2 - - 需求明确 - - 无架构变更 - -中等任务 (light 方案包): - - 文件数 3-5 - - 需求清晰 - - 局部修改 - -复杂任务 (完整 3 阶段): - - 文件数 > 5 - - 或 架构变更 - - 或 新功能开发 -``` - -**命令:** -| 命令 | 说明 | -|-----|------| - | `~go` | 自动判断并执行全流程 | - | `~go plan` | 只规划不执行 | - | `~go exec` | 高级恢复/调试入口;仅在已有活动 plan 或恢复态存在时使用 | - | `~go finalize` | 对当前 metadata-managed plan 执行收口归档 | - | `~compare` | 多模型并发对比(默认含当前会话模型;可用模型数不足 2 时降级并给出原因) | - -说明:当 Sopify 被触发时,宿主第一步必须先执行 runtime gate,而不是直接调用默认 runtime 入口。repo-local 开发态默认调用 `scripts/runtime_gate.py enter --workspace-root --request ""`;若 runtime 以 bundle 方式接入到其他仓库,则工作区内的 `.sopify-runtime/manifest.json` 只作为 thin stub,负责声明当前工作区绑定的 `bundle_version / locator_mode / ignore_mode`,不再要求宿主从 stub 的 `limits.*` 读取 helper 入口。宿主应结合 `~/.trae-cn/sopify/payload-manifest.json` 解析 selected global bundle,并从选中 bundle contract 或等价的 workspace preflight contract 消费 `runtime_gate_entry` 后再执行 gate;repo-local 开发态默认回退到 `scripts/runtime_gate.py`。gate 内部统一负责 workspace preflight / preload / default runtime dispatch / handoff normalize;`go_plan_runtime.py` 只保留给 repo-local CLI / 调试用,不是宿主第一跳。 -说明:当用户在项目仓库中触发 Sopify,且当前仓库没有可用的 `.sopify-runtime/manifest.json` 时,宿主必须先读取 `~/.trae-cn/sopify/payload-manifest.json`,再调用 `~/.trae-cn/sopify/helpers/bootstrap_workspace.py --workspace-root ` 为当前仓库补齐或更新 `.sopify-runtime/`;bootstrap 成功后应继续按 selected global bundle / workspace preflight contract 选入口,不得假定 workspace stub 自带可执行 helper 路径。 -说明:每次准备进入新的 Sopify LLM 回合前,宿主都必须先消费 runtime gate helper 返回的 JSON contract;仅当 `status == ready` 且 `gate_passed == true` 且 `evidence.handoff_found == true` 且 `evidence.strict_runtime_entry == true` 时,才允许声称“已进入 runtime”并继续后续阶段。`allowed_response_mode == checkpoint_only` 时只允许进入 checkpoint 响应;`allowed_response_mode == error_visible_retry` 时只允许输出短错误摘要并提示重试。 -说明:上述 gate 校验必须发生在当前消息回合的同一次 tool call 中;宿主只有在本回合先执行 `scripts/runtime_gate.py enter`,并直接从该 tool call 输出验证四项条件后,才允许输出任何 Sopify 标题行或进入后续路由。不得依赖上一轮写入的 `.sopify-skills/state/current_gate_receipt.json` 充当本回合 gate receipt。 -说明:runtime gate 内部会按 selected global bundle contract 暴露的 `preferences_preload_entry` 执行长期偏好 preload;若宿主已先拿到 workspace preflight contract,也可直接复用其中投影出的 helper 路径。repo-local 开发态才允许回退到 `scripts/preferences_preload_runtime.py inspect --workspace-root `。宿主只消费 gate contract 暴露的 `preferences` 结果,不得自行额外拼装 preload prompt,也不得绕过 gate 直连 preload/default runtime。 -说明:当首次激活返回 `ROOT_CONFIRM_REQUIRED` 时,宿主必须先停在 root 选择:默认推荐“当前目录”,备选“仓库根目录”,并允许用户手动指定其他目录;确认后以同一请求重新调用 gate,并显式传入 `activation_root`。这一类返回属于 pre-runtime checkpoint,`allowed_response_mode` 应为 `checkpoint_only`,而不是普通 `error_visible_retry`。`~go init` 只表示确认写入,不得绕过这一步 root 选择。 -说明:长期偏好注入是独立 prompt 块,固定优先级为:当前任务明确要求 > `preferences.md` > 默认规则。“当前任务明确要求”指用户在当前任务中显式给出的临时执行指令;冲突时优先,非冲突时叠加,且默认不回写为长期偏好。 -说明:runtime 执行后,若存在 `.sopify-skills/state/current_handoff.json`,宿主必须优先按其中的 `required_host_action`、`recommended_skill_ids` 与 `artifacts` 决定下一步;若存在 `artifacts.checkpoint_request`,必须优先消费该标准化 contract,再回退到 route-specific artifact;`Next:` 行仅作为面向人的摘要提示,不应作为唯一机器依据。 -说明:普通主链路不需要记住 `~go exec`;当 plan 达到 `ready_for_execution` 后,宿主必须继续按 `confirm_execute` + 自然语言确认推进。 -说明:若 `current_handoff.json.artifacts.execution_gate` 存在,宿主必须继续读取其中的 `gate_status / blocking_reason / plan_completion / next_required_action`,并结合 `.sopify-skills/state/current_run.json.stage` 判断当前 plan 只是已生成,还是已经达到 `ready_for_execution`。 -说明:当 `current_handoff.json.required_host_action == answer_questions` 时,宿主必须继续读取 `.sopify-skills/state/current_clarification.json`,向用户展示 missing_facts/questions,并等待用户补充事实信息后再恢复默认 runtime 入口;在补充完成前不得自行物化正式 plan 或跳到 `~go exec`。 -说明:当 `current_handoff.json.required_host_action == confirm_decision` 时,宿主必须优先读取 `current_handoff.json.artifacts.decision_checkpoint` 与 `decision_submission_state`;若 handoff 缺失完整 checkpoint,再回退到 `.sopify-skills/state/current_decision.json`。宿主应向用户展示 question/options/recommended_option_id,等待用户确认后再恢复默认 runtime 入口;在确认前不得自行生成正式 plan 或跳到 `~go exec`。 -说明:当 `current_handoff.json.required_host_action == confirm_plan_package` 时,宿主必须优先读取 `current_handoff.json.artifacts.proposal` 与 `checkpoint_request`;若 handoff 缺失完整 proposal,再回退到 `.sopify-skills/state/current_plan_proposal.json`。宿主至少应展示 `proposed_path / analysis_summary / estimated_task_count / candidate_files`,并等待用户通过自然语言 `继续 / next` 确认生成方案包、回复 `status` 查看摘要,或直接给出修订意见;在确认前不得自行创建正式 plan,也不得把 `~go exec` 当成绕过入口。 -说明:当 `current_handoff.json.required_host_action == confirm_execute` 时,宿主必须继续读取 `current_handoff.json.artifacts.execution_summary`,至少向用户展示 `plan_path / summary / task_count / risk_level / key_risk / mitigation`,并等待用户通过自然语言 `继续 / next / 开始`(或明确修改意见)恢复默认 runtime 入口;在执行确认前不得自行跳到 develop,也不得把 `~go exec` 当成绕过入口。 -说明:当 `current_handoff.json.required_host_action == continue_host_develop` 时,宿主继续负责真实代码修改;但若开发中再次出现“需要用户补事实 / 拍板选路”的分叉,宿主不得自由追问,也不得手写 `current_decision.json / current_handoff.json`,而必须调用 `scripts/develop_checkpoint_runtime.py submit --payload-json ...`(vendored 对应 `.sopify-runtime/scripts/develop_checkpoint_runtime.py`)回调 runtime。payload 必须包含 `checkpoint_kind` 与 `resume_context`;当前 `resume_context` 至少要求 `active_run_stage / current_plan_path / task_refs / changed_files / working_summary / verification_todo`。 -说明:当 `current_handoff.json.required_host_action == continue_host_consult` 时,宿主只可在已消费当前回合 gate contract 的前提下继续问答;不得在 gate 前自行路由,也不得在 gate 后再次重判 consult / 非 consult。宿主的回答应基于当前 gate contract 与 `handoff.artifacts` 暴露的 consult context(如有)生成;若缺少额外 consult context,应显式按当前请求降级回答,而不是用宿主侧语义分析补出另一条路由。 - -**workflow-learning 主动记录策略:** -```yaml -workflow: - learning: - auto_capture: by_requirement # always | by_requirement | manual | off -``` - -| 值 | 行为 | -|-----|------| -| `always` | 所有开发任务主动记录(full) | -| `by_requirement` | 按复杂度主动记录:simple=off,medium=summary,complex=full | -| `manual` | 仅在用户明确要求“开始记录这次任务”后记录 | -| `off` | 不主动新建记录;但回放/复盘意图识别与已有记录回放仍可用 | - ---- - -## Auto Rules (自动规则) - -> 以下规则由 AI 自动处理,用户无需关心。 - -### A1 | 编码处理 - -```yaml -读取: 自动检测文件编码 -写入: 统一 UTF-8 -传递: 保持原编码不变 -``` - -### A2 | 工具映射 - -| 操作 | Claude Code | Codex CLI | -|-----|-------------|-----------| -| 读取 | Read | cat | -| 搜索 | Grep | grep | -| 查找 | Glob | find/ls | -| 编辑 | Edit | apply_patch | -| 写入 | Write | apply_patch | - -### A3 | 平台适配 - -**Windows PowerShell (Platform=win32):** -- 使用 `$env:VAR` 而非 `$VAR` -- 使用 `-Encoding UTF8` -- 使用 `-gt -lt -eq` 而非 `> < ==` - -### A4 | 复杂度判定 - -```yaml -简单: 文件数 ≤ 2, 单模块, 无架构变更 -中等: 文件数 3-5, 跨模块, 局部重构 -复杂: 文件数 > 5, 架构变更, 新功能 -``` - -### A5 | 方案包分级 - -| 级别 | 结构 | 触发条件 | -|-----|------|---------| -| light | `plan.md` 单文件 | 中等任务 | -| standard | `background.md` + `design.md` + `tasks.md` | 复杂任务 | -| full | 标准 + `adr/` + `diagrams/` | 架构级变更 | - -**目录结构:** -``` -.sopify-skills/ -├── blueprint/ # 项目级长期蓝图,默认进入版本管理 -│ ├── README.md # 纯索引页,只保留状态/维护方式/当前目标/当前焦点/阅读入口 -│ ├── background.md -│ ├── design.md -│ └── tasks.md -├── plan/ # 当前方案,纳入版本管理 -│ ├── _registry.yaml # 本地 machine registry,继续忽略 -│ └── YYYYMMDD_feature/ -├── history/ # 已完成方案归档,纳入版本管理 -├── state/ # 运行态状态,始终忽略 -├── user/ # 用户偏好与反馈 -│ ├── preferences.md -│ └── feedback.jsonl -├── project.md # 技术约定,不与 background/design 重复 -└── replay/ # 可选回放能力,继续忽略 -``` - -### A6 | 生命周期管理 - -```yaml -首次触发: 真实项目仓库至少创建 .sopify-skills/blueprint/README.md -首次进入方案流: 补齐 .sopify-skills/blueprint/background.md / design.md / tasks.md -方案创建: .sopify-skills/plan/YYYYMMDD_feature_name/ -任务收口: 刷新 blueprint README 托管区块,并在需要时更新深层 blueprint -准备交付验证: 迁移至 .sopify-skills/history/YYYY-MM/ 并更新 index.md -``` - ---- - -## Advanced Rules (高级规则) - -> 可通过配置调整行为。 - -### X1 | 风险处理 (EHRB) - -**风险等级:** -```yaml -strict: 阻止所有高风险操作 -normal: 警告并要求确认 (默认) -relaxed: 仅警告,不阻止 -``` - -**高风险操作:** -- 删除生产数据 -- 修改认证/授权逻辑 -- 变更数据库 schema -- 操作敏感配置 - -### X2 | 知识库策略 - -```yaml -full: 首次初始化所有模板文件 -progressive: 按需创建文件 (默认) -``` - ---- - -## 路由决策 - -**入口判定流程:** -``` -用户输入 - ↓ -检查命令前缀 (~go, ~go plan, ~go exec, ~go finalize, ~compare) - ↓ -├─ ~go finalize → 收口当前活动 plan(刷新 blueprint 索引、归档 history、清理活动状态) -├─ ~go exec → 进入高级恢复/调试入口(仅在已有活动 plan 或恢复态存在时可用) -├─ ~go plan → 规划模式 (需求分析 → 方案设计;若存在 scripts/sopify_runtime.py 或 .sopify-runtime/scripts/sopify_runtime.py,则原始输入优先走默认入口,plan-only 场景再使用对应的 go_plan_runtime.py planning-mode orchestrator;默认会自动消化 clarification / decision,直到到达稳定停点) -├─ ~go → 全流程模式 -├─ ~compare → 模型对比(调用 scripts/model_compare_runtime.py 运行时) -└─ 无前缀 → 语义分析 - ↓ -语义分析判定路由: -├─ 咨询问答 → gate → consult handoff → 宿主回答 -├─ 对比分析(以“对比分析:”开头)→ 模型对比 -├─ 复盘/回放/为什么这么做 → 复盘学习 -├─ 简单修改 → 快速修复 -├─ 中等任务 → 轻量迭代 -└─ 复杂任务 → 完整开发流程 -``` - -**路由类型:** - -| 路由 | 条件 | 行为 | -|-----|------|-----| -| 咨询问答 | 纯问题,无代码变更 | 先过 gate,再按 consult handoff 由宿主回答 | -| 模型对比 | `~compare <问题>` 或 `对比分析:<问题>` | 调用 model-compare,并接入 `scripts/model_compare_runtime.py::run_model_compare_runtime`;默认纳入当前会话模型,可用模型数达到 2 才并发对比,否则降级单模型并输出统一 reason code | -| 复盘学习 | 提到回放/复盘/为什么这么做(意图识别始终开启) | 调用 workflow-learning,生成记录与讲解 | -| 快速修复 | ≤2 文件,明确修改 | 直接执行 | -| 轻量迭代 | 3-5 文件,清晰需求 | light 方案 + 执行 | -| 完整开发 | >5 文件或架构变更 | 3 阶段完整流程 | - -**宿主接入约定:** -- `Codex/Skills` 只承担提示层职责,不作为 vendored runtime 的机器契约来源。 -- 宿主根目录下的 `~/.trae-cn/sopify/payload-manifest.json` 只用于 workspace preflight,不替代 repo-local bundle manifest。 -- 当项目仓库缺少或不满足兼容要求的 `.sopify-runtime/manifest.json` 时,宿主必须先调用 `~/.trae-cn/sopify/helpers/bootstrap_workspace.py` 为当前仓库准备 `.sopify-runtime/`。 -- vendored runtime 的 workspace `.sopify-runtime/manifest.json` 只作为 thin stub,不再承诺暴露 `limits.runtime_gate_entry / limits.preferences_preload_entry`。 -- 宿主触发 Sopify 后,必须结合 workspace stub 与 `~/.trae-cn/sopify/payload-manifest.json` 解析 selected global bundle,并从选中 bundle contract 或 workspace preflight contract 读取 `runtime_gate_entry` 后执行第一跳 gate。 -- repo-local 开发态才允许宿主回退到 `scripts/runtime_gate.py`;不得绕过 gate 直接调用 `scripts/sopify_runtime.py` 充当第一跳。 -- 每次准备进入新的 Sopify LLM 回合前,宿主都必须先执行 runtime gate;新请求、clarification/decision/execution-confirm 恢复、以及继续主链路都属于本条范围。 -- 宿主只消费 gate 返回的稳定 JSON contract;只有 `status == ready` 且 `gate_passed == true` 且 `evidence.handoff_found == true` 且 `evidence.strict_runtime_entry == true` 时才允许继续正常 Sopify 阶段。 -- `allowed_response_mode == checkpoint_only` 时,宿主只允许做 checkpoint 响应;`allowed_response_mode == error_visible_retry` 时,宿主只允许输出可见错误并提示重试。 -- runtime gate 内部执行长期偏好 preload;preload helper 必须优先从 selected global bundle contract 或 workspace preflight contract 发现;仅在 repo-local 开发态且 vendored helper 不可用时,才允许回退到 `scripts/preferences_preload_runtime.py`。 -- 当首次激活返回 `ROOT_CONFIRM_REQUIRED` 时,宿主必须先进入 root 选择:默认推荐当前目录,备选仓库根目录,并允许手动指定其他目录;这一类返回属于 pre-runtime checkpoint,`allowed_response_mode` 应为 `checkpoint_only`;确认后以同一请求重新调用 gate,并显式传入 `activation_root`。`~go init` 不得绕过这一步。 -- 宿主只消费 gate contract 中的 `preferences` 结果;只有 `status == ready` 且 `preferences.status == loaded` 且 `preferences.injected == true` 时才注入 `preferences.injection_text`,不得自行读取 `preferences.md` 原文做二次拼装。 -- 长期偏好 preload 的降级策略固定为 `fail-open with visibility`;`missing / invalid / read_error` 不阻断主链路,但宿主内部必须能观察 `helper_path / workspace_root / plan_directory / preferences_path / status / error_code / injected`。 -- 长期偏好块的固定优先级为:当前任务明确要求 > `preferences.md` > 默认规则;当前任务中的临时指令覆盖长期偏好,但默认不回写长期偏好文件。 -- runtime 执行后的机器交接以 `.sopify-skills/state/current_handoff.json` 为准;仅当 handoff 缺失时才回退到输出文案中的 `Next:`。 -- 若 handoff `artifacts.execution_gate` 存在,宿主必须把它与 `.sopify-skills/state/current_run.json.stage` 一起视为 execution gate 的唯一机器事实来源;不要再根据 plan 路径或 `Next:` 文案猜测 plan 是否可执行。 -- 当 `current_handoff.json.required_host_action == answer_questions` 时,宿主必须把 `.sopify-skills/state/current_clarification.json` 视为本轮缺失事实信息的唯一机器事实来源。 -- clarification checkpoint 首选交互是直接展示 `missing_facts` 与 `questions[*]`,等待用户用自然语言补充事实信息;在 clarification pending 期间,宿主不得自行生成正式 plan,也不应跳到 `~go exec`。 -- 用户补充后,宿主必须在同一工作区重新调用默认 runtime 入口,让 runtime 负责继续跑 planning;若恢复后 `current_clarification.json` 被清理,视为正常收口。 -- `~go finalize` 仍走默认 runtime 入口,不要求宿主额外 bridge;第一版仅支持 metadata-managed plan,旧遗留 plan 应直接拒绝而不是自动迁移。 -- 当 `current_handoff.json.required_host_action == confirm_decision` 时,宿主必须优先把 `current_handoff.json.artifacts.decision_checkpoint` 与 `decision_submission_state` 视为本轮设计分叉的机器事实来源;`.sopify-skills/state/current_decision.json` 只作为状态兜底与 legacy projection 来源。 -- decision checkpoint 首选交互是直接展示 `question`、按顺序列出 `options[*]`,并标明 `recommended_option_id`;用户可以直接回复 `1/2/...`,也可以显式使用 `~decide choose `。 -- `~decide status|choose|cancel` 只作为 debug/override 入口;正常链路仍应由宿主根据 `confirm_decision` handoff 主动进入确认环节。 -- decision pending 期间,宿主不得自行物化 plan、改写 plan 路径,也不应把渲染输出里的 `Next:` 误当成可执行机器指令。 -- 用户确认后,宿主必须在同一工作区重新调用默认 runtime 入口,让 runtime 负责将 pending decision 物化为唯一正式 plan;若恢复后 `current_decision.json` 被清理,视为正常收口。 -- 当 `current_handoff.json.required_host_action == confirm_plan_package` 时,宿主必须优先把 `current_handoff.json.artifacts.proposal` 与 `checkpoint_request` 视为本轮 plan proposal checkpoint 的机器事实来源;`.sopify-skills/state/current_plan_proposal.json` 只作为状态兜底来源。 -- plan proposal checkpoint 首选交互是直接展示 `proposed_path / analysis_summary / estimated_task_count / candidate_files`;用户可以回复 `继续 / next` 确认建包、回复 `status` 查看摘要,或直接给出修订意见。 -- proposal pending 期间,宿主不得自行创建正式 plan,也不得把 `~go exec` 当成穿透入口。 -- 用户确认后,宿主必须在同一工作区重新调用默认 runtime 入口,让 runtime 负责按既定 `reserved_plan_id` 物化唯一正式 plan;若恢复后 `current_plan_proposal.json` 被清理,视为正常收口。 -- 当 `current_handoff.json.required_host_action == continue_host_consult` 时,宿主必须把当前消息回合 gate tool call 返回的 contract 与 `.sopify-skills/state/current_handoff.json` 一起视为 consult 问答的机器事实来源;在生成回答前不要再次自行判断是否应改走其他路由。 -- `~go exec` 只应被当作高级恢复入口;若当前没有活动 plan 或恢复态,宿主不应把它当成普通开发入口。 -- 即使用户显式输入 `~go exec`,只要仍处于 `clarification_pending / decision_pending / plan_proposal_pending / execution_confirm_pending`,宿主也必须继续遵守对应 checkpoint 的机器契约。 - ---- - -## 阶段执行 - -### P1 | 需求分析 - -**目标:** 验证需求完整性,分析代码现状 - -**执行流程:** -``` -1. 检查知识库状态 -2. 获取项目上下文 -3. 需求评分 (10分制) - - 目标清晰 (0-3) - - 预期结果 (0-3) - - 边界范围 (0-2) - - 约束条件 (0-2) -4. 评分 ≥ require_score → 继续 - 评分 < require_score → 追问或 AI 决策 (看 auto_decide) -``` - -**输出:** -``` -[my-app-ai] 需求分析 ✓ - -需求: {一句话描述} -评分: {X}/10 -范围: {N} files - ---- -Next: 继续方案设计?(Y/n) -``` - -### P2 | 方案设计 - -**目标:** 设计技术方案,拆分任务 - -**执行流程:** -``` -1. 读取 design Skill -2. 确定方案包级别 (light/standard/full) -3. 生成方案文件 -4. 输出摘要 -``` - -**输出:** -``` -[my-app-ai] 方案设计 ✓ - -方案: .sopify-skills/plan/20260115_feature/ -概要: {一句话技术方案} -任务: {N} 项 -方案质量: {X}/10 -落地就绪: {Y}/10 -评分理由: {1 行} - ---- -Changes: 3 files - - .sopify-skills/plan/20260115_feature/background.md - - .sopify-skills/plan/20260115_feature/design.md - - .sopify-skills/plan/20260115_feature/tasks.md - -Next: 在宿主会话中继续评审或执行方案,或直接回复修改意见 -``` - -### P3 | 开发实施 - -**目标:** 执行任务,同步知识库 - -**执行流程:** -``` -1. 读取 develop Skill -2. 按 tasks.md 顺序执行 -3. 更新知识库 -4. 迁移方案至 history/ -5. 输出结果 -``` - -**输出:** -``` -[my-app-ai] 开发实施 ✓ - -完成: {N}/{M} 任务 -测试: {通过/失败/跳过} - ---- -Changes: 5 files - - src/components/xxx.vue - - src/types/index.ts - - src/hooks/useXxx.ts - - .sopify-skills/blueprint/design.md - - .sopify-skills/history/2026-01/... - -Next: 请验证功能 -``` - ---- - -## 技能引用 - -| 技能 | 触发时机 | 说明 | -|-----|---------|------| -| `analyze` | 进入需求分析 | 需求评分、追问逻辑 | -| `design` | 进入方案设计 | 方案生成、任务拆分 | -| `develop` | 进入开发实施 | 代码执行、KB同步 | -| `kb` | 知识库操作 | 初始化、更新策略 | -| `templates` | 创建文档 | 所有模板定义 | -| `model-compare` | 用户触发 `~compare` 或 `对比分析:` | 调用 `scripts/model_compare_runtime.py::run_model_compare_runtime`;默认纳入当前会话模型;可用模型数不足 2 时降级并输出统一 reason code | -| `workflow-learning` | 用户要求回放/复盘/原因讲解,或 `auto_capture` 命中主动记录策略 | 完整记录、回放、逐步讲解 | - -**读取方式:** 按需读取,进入对应阶段时加载。 - ---- - -## 快速参考 - -**常用命令:** -``` -~go # 全流程自动执行 -~go plan # 只规划不执行 -~go exec # 高级恢复/调试入口,不是普通主链路默认下一步 -~go finalize # 显式收口当前 metadata-managed plan -~compare # 对同一问题做多模型并发对比(可用模型不足 2 时自动单模型并解释原因) -``` - -**runtime helper:** -``` -scripts/sopify_runtime.py # 当前仓库默认原始输入入口,直接交给 router 分流 -.sopify-runtime/scripts/sopify_runtime.py # 二次接入后 vendored 默认入口 -scripts/go_plan_runtime.py # 当前仓库用于 plan-only slice 的 orchestrator -.sopify-runtime/scripts/go_plan_runtime.py # vendored plan-only orchestrator -scripts/develop_checkpoint_runtime.py # `continue_host_develop` 中命中用户拍板分叉时的内部 callback helper,提供 inspect / submit -.sopify-runtime/scripts/develop_checkpoint_runtime.py # vendored develop callback helper,不改变默认 runtime 入口 -scripts/decision_bridge_runtime.py # `confirm_decision` 的内部宿主桥接 helper,提供 inspect / submit / prompt -.sopify-runtime/scripts/decision_bridge_runtime.py # vendored decision bridge helper,不改变默认 runtime 入口 -scripts/plan_registry_runtime.py # plan registry 内部宿主 helper,提供 inspect / confirm-priority;第一版默认 inspect-only 摘要模式 -.sopify-runtime/scripts/plan_registry_runtime.py # vendored plan registry helper,不改变默认 runtime 入口 -scripts/runtime_gate.py # prompt-level runtime gate helper,提供 enter -.sopify-runtime/scripts/runtime_gate.py # vendored runtime gate helper,宿主触发 Sopify 后的第一跳 -scripts/preferences_preload_runtime.py # 宿主长期偏好 preload helper,提供 inspect -.sopify-runtime/scripts/preferences_preload_runtime.py # vendored preferences preload helper,不改变默认 runtime 入口 -scripts/model_compare_runtime.py # ~compare 的运行时实现,不是默认通用入口 -scripts/check-install-payload-bundle-smoke.py # 维护者 smoke;验证“一次安装 + 项目触发 bootstrap + 默认入口不变” -~/.trae-cn/sopify/payload-manifest.json # 宿主全局 payload 元信息;宿主做 workspace preflight 时优先读取 -~/.trae-cn/sopify/helpers/bootstrap_workspace.py # 宿主全局 helper;当前仓库缺少 bundle 时由宿主调用 -.sopify-runtime/manifest.json # vendored bundle 机器契约,宿主必须优先读取 -.sopify-skills/state/current_handoff.json # runtime 写出的结构化交接文件,宿主必须优先读取 -.sopify-skills/state/current_run.json # 活动 run 状态;包含 stage 与 execution_gate 的当前内部状态 -.sopify-skills/state/current_clarification.json # clarification checkpoint 状态文件;仅当 handoff 要求 answer_questions 时读取 -.sopify-skills/state/current_decision.json # decision checkpoint 状态兜底文件;当 handoff 缺失完整 checkpoint 时读取 -.sopify-skills/state/current_plan_proposal.json # plan proposal checkpoint 状态兜底文件;当 handoff 要求 confirm_plan_package 且缺失完整 proposal 时读取 -``` - -说明:当前默认入口仍是 `scripts/sopify_runtime.py`,但宿主触发 Sopify 后的第一跳必须先执行 `scripts/runtime_gate.py enter`;若以 bundle 方式接入,workspace `.sopify-runtime/manifest.json` 只作为 thin stub,宿主应结合它与 `~/.trae-cn/sopify/payload-manifest.json` 解析 selected global bundle,再从选中 bundle contract 或 workspace preflight contract 读取 `runtime_gate_entry / limits.runtime_gate_contract_version / limits.runtime_gate_allowed_response_modes`;若当前仓库尚未准备 bundle,则宿主必须先按 `~/.trae-cn/sopify/payload-manifest.json` 做 preflight,并在需要时调用 `~/.trae-cn/sopify/helpers/bootstrap_workspace.py`;`go_plan_runtime.py` 只负责 repo-local plan-only / 调试,不再是宿主主链路第一跳;`~go finalize` 没有单独 helper,仍由默认 runtime 入口处理。runtime gate 内部会按 selected global bundle contract 或等价 preflight contract 暴露的 `preferences_preload_entry / limits.preferences_preload_contract_version / limits.preferences_preload_statuses` 执行 preload,并统一输出 `status / gate_passed / allowed_response_mode / preferences / handoff / evidence` contract;仅当 `status=ready` 且 `gate_passed=true` 且 `evidence.handoff_found=true` 且 `evidence.strict_runtime_entry=true` 时才允许继续正常阶段,`checkpoint_only` 只能进入 checkpoint 响应,`error_visible_retry` 只能可见报错重试。若首次激活先返回 `ROOT_CONFIRM_REQUIRED`,宿主必须先停在 root 选择:默认推荐当前目录,备选仓库根目录,并允许手动指定其他目录;这一类返回属于 pre-runtime checkpoint,`allowed_response_mode` 应为 `checkpoint_only`;选定后用同一请求重新调用 gate,并显式传入 `activation_root`,`~go init` 不得绕过这一步。执行结束后宿主必须优先读取 `.sopify-skills/state/current_handoff.json` 决定下一步;若存在 `artifacts.checkpoint_request`,必须优先消费该标准化 contract;若 `required_host_action=answer_questions`,继续读取 `.sopify-skills/state/current_clarification.json` 进入补充事实信息环节;若 `required_host_action=confirm_decision`,优先读取 `current_handoff.json.artifacts.decision_checkpoint / decision_submission_state`,缺失时再回退到 `.sopify-skills/state/current_decision.json` 进入确认环节;若 `required_host_action=confirm_plan_package`,优先读取 `current_handoff.json.artifacts.proposal / checkpoint_request`,缺失时再回退到 `.sopify-skills/state/current_plan_proposal.json`,并继续停在建包确认,不得跳过到 plan materialization 或 `~go exec`;若 `required_host_action=continue_host_develop` 且开发中再次命中用户拍板分叉,宿主必须改调 `scripts/develop_checkpoint_runtime.py inspect|submit`(vendored 对应 `.sopify-runtime/scripts/develop_checkpoint_runtime.py`),而不是直接自由追问;该 helper 的路径、宿主提示与 `resume_context` 最小字段要求会暴露在 selected global bundle contract 的 `limits.develop_checkpoint_entry / limits.develop_checkpoint_hosts / limits.develop_resume_context_required_fields / limits.develop_resume_after_actions`;当前文档范围内,宿主可选调用 `scripts/decision_bridge_runtime.py inspect`(vendored 对应 `.sopify-runtime/scripts/decision_bridge_runtime.py`)读取 CLI 桥接 contract,再通过 `submit` 或 `prompt` 写回结构化 submission。若宿主需要展示 plan registry,第一版默认改调 `scripts/plan_registry_runtime.py inspect`(vendored 对应 `.sopify-runtime/scripts/plan_registry_runtime.py`)读取摘要 contract,并只在 review 场景展示 `current_plan / selected_plan / recommendations / drift_notice / execution_truth`;推荐动作固定为 `确认建议 / 改成 P1 / 改成 P2 / 改成 P3 / 暂不确认`,`note` 为可选字段;不默认展示 `_registry.yaml` 原文,原文仅高级用户可访问;只有用户显式确认时才允许调用 `confirm-priority`,且不得据此切换 `current_plan`。`~compare` 仍依赖宿主侧专用桥接。维护者如需复核“一次安装 + 项目触发自动准备 runtime + 默认入口不变”,运行 `python3 scripts/check-install-payload-bundle-smoke.py`。 - -**配置文件:** `sopify.config.yaml` (项目根目录) - -**知识库目录:** `.sopify-skills/` - -**Blueprint 路径:** `.sopify-skills/blueprint/` - -**方案包路径:** `.sopify-skills/plan/YYYYMMDD_feature_name/` diff --git a/TraeCn/Skills/EN/skills/sopify/analyze/SKILL.md b/TraeCn/Skills/EN/skills/sopify/analyze/SKILL.md deleted file mode 100644 index 31b42c4..0000000 --- a/TraeCn/Skills/EN/skills/sopify/analyze/SKILL.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: analyze -description: Analyze phase entry; routes scoring, follow-up, and scope checks through references/assets/scripts. ---- - -# Analyze (Entry) - -## When to activate - -- Entering the analysis phase (`workflow` / `plan_only`). -- Need requirement scoring, clarification, or complexity routing. - -## Execution skeleton - -1. Load `references/analyze-rules.md` first. -2. Run Phase A (KB check, context acquisition, requirement typing, completeness scoring). -3. If the score is below threshold, follow `auto_decide`: - - `false`: ask follow-up questions with `assets/question-output.md`. - - `true`: state explicit assumptions, then continue. -4. After the score passes, run Phase B (objective extraction, code analysis, technical prep). -5. Render the phase summary with `assets/success-output.md`. - -## Resource navigation - -- Long rules: `references/analyze-rules.md` -- Follow-up template: `assets/question-output.md` -- Success template: `assets/success-output.md` -- Deterministic scoring script: `scripts/score_requirement.py` - -## Deterministic logic first - -Use the script when the score must be auditable: - -```bash -python3 Codex/Skills/EN/skills/sopify/analyze/scripts/score_requirement.py \ - --goal-clarity 2 \ - --expected-outcome 2 \ - --scope-boundary 1 \ - --constraints 1 \ - --require-score 7 -``` - -The script returns JSON with total score, threshold result, and missing dimensions. - -## Boundaries - -- This skill does not generate a plan package directly; hand off to `design`. -- This skill does not execute code changes directly; hand off to `develop` or runtime routing. diff --git a/TraeCn/Skills/EN/skills/sopify/analyze/assets/question-output.md b/TraeCn/Skills/EN/skills/sopify/analyze/assets/question-output.md deleted file mode 100644 index 02acedb..0000000 --- a/TraeCn/Skills/EN/skills/sopify/analyze/assets/question-output.md +++ /dev/null @@ -1,10 +0,0 @@ -[{BRAND_NAME}] Requirements Analysis ? - -Current score: {X}/10. Please clarify the following: - -1. {question1} -2. {question2} -3. {question3} - ---- -Next: Reply with the answers, or type "continue" to skip clarification diff --git a/TraeCn/Skills/EN/skills/sopify/analyze/assets/success-output.md b/TraeCn/Skills/EN/skills/sopify/analyze/assets/success-output.md deleted file mode 100644 index 345882b..0000000 --- a/TraeCn/Skills/EN/skills/sopify/analyze/assets/success-output.md +++ /dev/null @@ -1,11 +0,0 @@ -[{BRAND_NAME}] Requirements Analysis ✓ - -Requirement: {one-line description} -Type: {requirement type} -Score: {X}/10 -Scope: {estimated file count} - ---- -Changes: 0 files - -Next: Continue to solution design? (Y/n) diff --git a/TraeCn/Skills/EN/skills/sopify/analyze/references/analyze-rules.md b/TraeCn/Skills/EN/skills/sopify/analyze/references/analyze-rules.md deleted file mode 100644 index eef2a9e..0000000 --- a/TraeCn/Skills/EN/skills/sopify/analyze/references/analyze-rules.md +++ /dev/null @@ -1,104 +0,0 @@ -# Analyze Detailed Rules - -## Goal - -Verify requirement completeness, analyze the current codebase, and provide stable input for downstream design. - -## Overall flow - -```text -Phase A (steps 1-4) -> check score >= require_score? - ├─ yes -> Phase B (steps 5-6) -> render summary - └─ no -> check auto_decide - ├─ true -> continue with explicit assumptions - └─ false -> ask follow-up questions and wait for user input -``` - -## Phase A: Requirement assessment - -### Step 1: Check knowledge-base status - -- Condition: project code exists and the task is not "new project bootstrap". -- Action: check whether `.sopify-skills/` exists. -- Mark the KB as missing when the directory does not exist. - -### Step 2: Acquire project context - -- Read `.sopify-skills/user/preferences.md` and KB files first. -- Scan the codebase only when KB context is insufficient. -- Follow the `kb` skill for KB-specific rules. - -Preference rules: - -1. Use only explicit long-term user preferences. -2. Current-task instructions override historical preferences. -3. Fall back to defaults when no preference matches. - -### Step 3: Determine requirement type - -Candidate types: - -1. New project bootstrap -2. New feature development -3. Feature modification / enhancement -4. Bug fix -5. Refactor / optimization -6. Technical change - -### Step 4: Score requirement completeness - -Scoring dimensions (10 total): - -- Goal clarity: 0-3 -- Expected outcome: 0-3 -- Scope boundary: 0-2 -- Constraints: 0-2 - -Scoring rules: - -- `score >= require_score`: continue to Phase B. -- `score < require_score` and `auto_decide=true`: continue with explicit assumptions. -- `score < require_score` and `auto_decide=false`: ask follow-up questions with `assets/question-output.md`. - -Follow-up rules: - -1. Do not ask for information that code can already provide. -2. Ask only for user-facing gaps: business logic, target behavior, constraints. -3. Ask 3-5 questions. -4. Do not re-ask preferences that are already captured as long-term preferences. - -## Phase B: Code analysis - -### Step 5: Extract key objectives - -- Compress the request into one core objective sentence. -- Distinguish whether the user provided a real goal or only an implementation path. -- When the input is mostly a path, treat that path as a candidate approach rather than the success criterion itself. -- Define verifiable success criteria, and close them in a SMART-style form: deliverable, boundary, constraints, verification, and next stop-point. - -### Step 6: Code analysis and technical preparation - -- Estimate project and change scale. -- Locate related modules and key files. -- Run baseline quality checks (stale information, security risks). -- Pull external documentation only when necessary. - -Stable subset rules: - -1. When the goal is still fuzzy, clarify key facts first; only continue with explicit assumptions when `auto_decide=true`. -2. When the current path is clearly suboptimal, include at least one lower-cost or lower-risk alternative in the analysis summary. -3. Every alternative path should state the tradeoff instead of giving a bare conclusion. -4. Do not force deep challenge mode for `quick_fix`, pure state explanation, or lightweight consult flows. - -## Adaptive routing - -- Simple task (`<=2` files and clear scope): go straight to quick fix. -- Medium task (`3-5` files): enter the light plan path. -- Complex task (`>5` files or architectural change): enter full design. - -## Phase transitions - -- Score below threshold and no auto-decide: keep asking until the score passes or the user cancels. -- `workflow.mode=strict`: render summary and wait for confirmation. -- `workflow.mode=adaptive`: continue automatically according to complexity. -- User says `cancel`: terminate with the cancellation path. diff --git a/TraeCn/Skills/EN/skills/sopify/analyze/scripts/score_requirement.py b/TraeCn/Skills/EN/skills/sopify/analyze/scripts/score_requirement.py deleted file mode 100644 index 3392485..0000000 --- a/TraeCn/Skills/EN/skills/sopify/analyze/scripts/score_requirement.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 -"""Deterministic requirement score calculator for analyze skill.""" - -from __future__ import annotations - -import argparse -import json -from typing import Dict - -MAX_BY_DIMENSION: Dict[str, int] = { - "goal_clarity": 3, - "expected_outcome": 3, - "scope_boundary": 2, - "constraints": 2, -} - - -def _bounded_int(name: str, value: int) -> int: - max_score = MAX_BY_DIMENSION[name] - if value < 0 or value > max_score: - raise ValueError(f"{name} must be in [0, {max_score}], got {value}") - return value - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description="Compute requirement completeness score in a deterministic way." - ) - parser.add_argument("--goal-clarity", type=int, required=True) - parser.add_argument("--expected-outcome", type=int, required=True) - parser.add_argument("--scope-boundary", type=int, required=True) - parser.add_argument("--constraints", type=int, required=True) - parser.add_argument("--require-score", type=int, default=7) - return parser.parse_args() - - -def main() -> int: - args = parse_args() - scores = { - "goal_clarity": _bounded_int("goal_clarity", args.goal_clarity), - "expected_outcome": _bounded_int("expected_outcome", args.expected_outcome), - "scope_boundary": _bounded_int("scope_boundary", args.scope_boundary), - "constraints": _bounded_int("constraints", args.constraints), - } - - total = sum(scores.values()) - missing_dimensions = [name for name, score in scores.items() if score == 0] - - result = { - "scores": scores, - "total": total, - "max_total": sum(MAX_BY_DIMENSION.values()), - "require_score": args.require_score, - "pass": total >= args.require_score, - "missing_dimensions": missing_dimensions, - } - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/TraeCn/Skills/EN/skills/sopify/design/SKILL.md b/TraeCn/Skills/EN/skills/sopify/design/SKILL.md deleted file mode 100644 index 967b1c9..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/SKILL.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: design -description: Design phase entry; routes plan grading, task breakdown, and plan package output through references/assets/scripts. ---- - -# Design (Entry) - -## When to activate - -- Entering the design phase (`workflow` / `plan_only` / `light_iterate`). -- Need to convert validated requirements into a plan package and task list. - -## Execution skeleton - -1. Load `references/design-rules.md`. -2. Decide `light/standard/full` from explicit change signals. -3. Generate the plan files from the matching templates in `assets/`. -4. Produce the task list and validate task granularity. -5. Add the scoring block to the formal plan package and render the scored summary with `assets/output-summary.md`. - -## Resource navigation - -- Long rules: `references/design-rules.md` -- Templates: `assets/*.md` -- Deterministic level selector: `scripts/select_plan_level.py` - -## Deterministic logic first - -Use the selector when `plan.level=auto` must be auditable: - -```bash -python3 Codex/Skills/EN/skills/sopify/design/scripts/select_plan_level.py \ - --file-count 6 \ - --new-feature \ - --cross-module -``` - -The script returns JSON with the suggested level and explicit reasons. - -## Boundaries - -- This skill does not execute code changes directly; hand off to `develop`. -- This skill does not replace runtime routing; it defines the plan structure and task contract only. diff --git a/TraeCn/Skills/EN/skills/sopify/design/assets/adr-template.md b/TraeCn/Skills/EN/skills/sopify/design/assets/adr-template.md deleted file mode 100644 index 2e911f2..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/assets/adr-template.md +++ /dev/null @@ -1,19 +0,0 @@ -# ADR-001: {Decision Title} - -## Status -Accepted | Proposed | Deprecated - -## Context -{Background and problem} - -## Decision -{Core decision} - -## Rationale -{Reasons} - -## Alternatives -- {Option A}: rejected because - {reason} - -## Consequences -{Impacts and risks} diff --git a/TraeCn/Skills/EN/skills/sopify/design/assets/background-template.md b/TraeCn/Skills/EN/skills/sopify/design/assets/background-template.md deleted file mode 100644 index 27546de..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/assets/background-template.md +++ /dev/null @@ -1,24 +0,0 @@ -# Change Proposal: {Feature Name} - -## Requirement Background -{Describe the current state, pain points, and change drivers} - -Scoring: -- Solution quality: {X}/10 -- Implementation readiness: {Y}/10 - -Scoring rationale: -- Strengths: {1 line} -- Deductions: {1 line} - -## Change Content -1. {change point 1} -2. {change point 2} - -## Impact Scope -- Modules: {list} -- Files: {list} - -## Risk Assessment -- Risk: {description} -- Mitigation: {measures} diff --git a/TraeCn/Skills/EN/skills/sopify/design/assets/design-template.md b/TraeCn/Skills/EN/skills/sopify/design/assets/design-template.md deleted file mode 100644 index f31c60f..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/assets/design-template.md +++ /dev/null @@ -1,14 +0,0 @@ -# Technical Design: {Feature Name} - -## Technical Solution -- Core technology: {language/framework/library} -- Implementation points: - - {point1} - - {point2} - -## Architecture Design -{Include a mermaid diagram when the architecture changes} - -## Security and Performance -- Security: {measures} -- Performance: {optimizations} diff --git a/TraeCn/Skills/EN/skills/sopify/design/assets/output-summary.md b/TraeCn/Skills/EN/skills/sopify/design/assets/output-summary.md deleted file mode 100644 index 1300570..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/assets/output-summary.md +++ /dev/null @@ -1,14 +0,0 @@ -[{BRAND_NAME}] Solution Design ✓ - -Plan: .sopify-skills/plan/{YYYYMMDD}_{feature}/ -Summary: {one-line technical solution} -Tasks: {N} items -Solution quality: {X}/10 -Implementation readiness: {Y}/10 -Scoring rationale: {1 line} - ---- -Changes: {N} files - - .sopify-skills/plan/... - -Next: Continue the review or execution flow in the host session, or reply with feedback diff --git a/TraeCn/Skills/EN/skills/sopify/design/assets/plan-light-template.md b/TraeCn/Skills/EN/skills/sopify/design/assets/plan-light-template.md deleted file mode 100644 index fa810a3..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/assets/plan-light-template.md +++ /dev/null @@ -1,24 +0,0 @@ -# {Feature Name} - -## Background -{1-2 sentences describing the requirement background} - -Scoring: -- Solution quality: {X}/10 -- Implementation readiness: {Y}/10 - -Scoring rationale: -- Strengths: {1 line} -- Deductions: {1 line} - -## Solution -{Technical solution points as a list} - -## Tasks -- [ ] {task1} -- [ ] {task2} -- [ ] {task3} - -## Changed Files -- {file1} -- {file2} diff --git a/TraeCn/Skills/EN/skills/sopify/design/assets/tasks-template.md b/TraeCn/Skills/EN/skills/sopify/design/assets/tasks-template.md deleted file mode 100644 index c74ef01..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/assets/tasks-template.md +++ /dev/null @@ -1,13 +0,0 @@ -# Task List: {Feature Name} - -Directory: `.sopify-skills/plan/YYYYMMDD_{feature}/` - -## 1. {Module Name} -- [ ] 1.1 Implement {feature} in `{file path}` -- [ ] 1.2 Implement {feature} in `{file path}` - -## 2. Testing -- [ ] 2.1 {test task} - -## 3. Documentation Update -- [ ] 3.1 Update `project.md / blueprint/background.md / blueprint/design.md / blueprint/tasks.md` diff --git a/TraeCn/Skills/EN/skills/sopify/design/references/design-rules.md b/TraeCn/Skills/EN/skills/sopify/design/references/design-rules.md deleted file mode 100644 index 1c61434..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/references/design-rules.md +++ /dev/null @@ -1,93 +0,0 @@ -# Design Detailed Rules - -## Goal - -Design the technical solution, break work into executable tasks, and generate a replayable plan package. - -## Overall flow - -1. Decide the plan level (`light/standard/full`). -2. Generate the plan file scaffold. -3. Break down tasks and mark verification criteria. -4. Render the summary and wait for the next host action. - -## Step 1: Decide the plan level - -Auto-detection rules (`plan.level=auto`): - -- `light`: 3-5 files, no architectural change, scope is explicit. -- `standard`: more than 5 files, or a new feature, or a cross-module change. -- `full`: architectural change, major refactor, or new system design. - -## Step 2: Generate plan files - -- `light`: generate `plan.md`. -- `standard`: generate `background.md + design.md + tasks.md`. -- `full`: extend standard with `adr/` and `diagrams/`. -- formal plan packages include the scoring block by default: - - `light`: write it into `plan.md` - - `standard/full`: write it into `background.md` -- the plan summary must also surface: - - `Solution quality` - - `Implementation readiness` - - `Scoring rationale` - -Template sources live in `assets/`: - -1. `assets/plan-light-template.md` -2. `assets/background-template.md` -3. `assets/design-template.md` -4. `assets/tasks-template.md` -5. `assets/adr-template.md` - -## Step 3: Break down tasks - -Task constraints: - -1. Each task should fit within about 30 minutes. -2. Each task must have a verifiable completion criterion. -3. Dependencies must be explicit. - -Suggested categories: - -1. Core feature work -2. Supporting work -3. Security checks -4. Testing -5. Documentation updates (`project.md / blueprint/*`) - -Task markers: - -- `[ ]` pending -- `[x]` completed -- `[-]` skipped -- `[!]` blocked - -## Phase transitions - -- `workflow.mode=strict`: render the summary and wait for confirmation. -- `workflow.mode=adaptive`: - - `~go`: continue into execution confirmation or the downstream host flow. - - `~go plan`: stop after rendering the plan summary. -- If the user gives plan feedback, stay in this phase, update the files, and render again. - -## Runtime helper boundaries - -When the repo contains `scripts/sopify_runtime.py` and the input is the raw request: - -1. Prefer the default runtime entry; do not rewrite it manually into `~go plan`. -2. When the intent is explicitly `~go plan`, prefer `scripts/go_plan_runtime.py`. -3. `go_plan_runtime.py` is plan-only and not a generic default entry. -4. `~compare` still depends on a host-side bridge. - -Generate plan files manually only when the runtime helpers are absent. - -## Naming rules - -Plan directory format: `YYYYMMDD_feature_name` - -Examples: - -- `20260115_user_auth` -- `20260115_fix_login_bug` -- `20260115_refactor_api` diff --git a/TraeCn/Skills/EN/skills/sopify/design/scripts/select_plan_level.py b/TraeCn/Skills/EN/skills/sopify/design/scripts/select_plan_level.py deleted file mode 100644 index 0c4f663..0000000 --- a/TraeCn/Skills/EN/skills/sopify/design/scripts/select_plan_level.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 -"""Deterministic plan-level selector for design skill.""" - -from __future__ import annotations - -import argparse -import json -from typing import List - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description="Select plan level based on explicit change signals." - ) - parser.add_argument("--file-count", type=int, required=True) - parser.add_argument("--architecture-change", action="store_true") - parser.add_argument("--major-refactor", action="store_true") - parser.add_argument("--new-system", action="store_true") - parser.add_argument("--new-feature", action="store_true") - parser.add_argument("--cross-module", action="store_true") - return parser.parse_args() - - -def main() -> int: - args = parse_args() - reasons: List[str] = [] - - if args.architecture_change or args.major_refactor or args.new_system: - level = "full" - if args.architecture_change: - reasons.append("architecture_change") - if args.major_refactor: - reasons.append("major_refactor") - if args.new_system: - reasons.append("new_system") - elif args.file_count > 5 or args.new_feature or args.cross_module: - level = "standard" - if args.file_count > 5: - reasons.append("file_count_gt_5") - if args.new_feature: - reasons.append("new_feature") - if args.cross_module: - reasons.append("cross_module") - elif 3 <= args.file_count <= 5: - level = "light" - reasons.append("file_count_between_3_and_5") - else: - level = "light" - reasons.append("default_light_for_small_scope") - - result = { - "plan_level": level, - "file_count": args.file_count, - "reasons": reasons, - } - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/TraeCn/Skills/EN/skills/sopify/develop/SKILL.md b/TraeCn/Skills/EN/skills/sopify/develop/SKILL.md deleted file mode 100644 index 1c3c8e4..0000000 --- a/TraeCn/Skills/EN/skills/sopify/develop/SKILL.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -name: develop -description: Develop phase entry; routes task execution, state updates, KB sync, and plan close-out through references/assets/scripts. ---- - -# Develop (Entry) - -## When to activate - -- Entering the implementation phase (`workflow` / `light_iterate` / `quick_fix` / `exec_plan`). -- Need to execute the task list, update state, and converge the delivery result. - -## Execution skeleton - -1. Read the active plan tasks (`tasks.md` or light `plan.md`). -2. Extract pending tasks and execute them in numbered order. -3. Update task markers after each step (`[ ] -> [x] / [-] / [!]`). -4. Sync KB files and conservative preference / feedback records. -5. Move completed plans into `history/` and update the index. -6. Render the matching result template. - -## Resource navigation - -- Long rules: `references/develop-rules.md` -- Output templates: `assets/*.md` -- Task extraction script: `scripts/extract_pending_tasks.py` - -## Deterministic logic first - -Use the script when task extraction must be auditable: - -```bash -python3 Codex/Skills/EN/skills/sopify/develop/scripts/extract_pending_tasks.py \ - --tasks-file .sopify-skills/plan//tasks.md -``` - -The script returns JSON with pending tasks, status counts, and execution order. - -## Boundaries - -- This skill executes and closes out work; it does not redefine the plan structure. -- Rollback remains an explicit user action and must keep a traceable record. diff --git a/TraeCn/Skills/EN/skills/sopify/develop/assets/output-partial.md b/TraeCn/Skills/EN/skills/sopify/develop/assets/output-partial.md deleted file mode 100644 index e9752d7..0000000 --- a/TraeCn/Skills/EN/skills/sopify/develop/assets/output-partial.md +++ /dev/null @@ -1,13 +0,0 @@ -[{BRAND_NAME}] Development ! - -Completed: {M}/{N} tasks -Blocked: {K} items - -Blocked tasks: - - [!] 2.3 {task description} - {block reason} - ---- -Changes: {N} files - - ... - -Next: Resume the current host flow after resolving the blockers diff --git a/TraeCn/Skills/EN/skills/sopify/develop/assets/output-quick-fix.md b/TraeCn/Skills/EN/skills/sopify/develop/assets/output-quick-fix.md deleted file mode 100644 index a280077..0000000 --- a/TraeCn/Skills/EN/skills/sopify/develop/assets/output-quick-fix.md +++ /dev/null @@ -1,10 +0,0 @@ -[{BRAND_NAME}] Quick Fix ✓ - -Fix: {one-line description} - ---- -Changes: {N} files - - {file1} - - {file2} - -Next: Please verify the fix diff --git a/TraeCn/Skills/EN/skills/sopify/develop/assets/output-success.md b/TraeCn/Skills/EN/skills/sopify/develop/assets/output-success.md deleted file mode 100644 index c267699..0000000 --- a/TraeCn/Skills/EN/skills/sopify/develop/assets/output-success.md +++ /dev/null @@ -1,13 +0,0 @@ -[{BRAND_NAME}] Development ✓ - -Completed: {N}/{N} tasks -Tests: passed - ---- -Changes: {N} files - - src/xxx.vue - - src/xxx.ts - - .sopify-skills/blueprint/design.md - - .sopify-skills/history/... - -Next: Please verify the functionality diff --git a/TraeCn/Skills/EN/skills/sopify/develop/references/develop-rules.md b/TraeCn/Skills/EN/skills/sopify/develop/references/develop-rules.md deleted file mode 100644 index dc41757..0000000 --- a/TraeCn/Skills/EN/skills/sopify/develop/references/develop-rules.md +++ /dev/null @@ -1,216 +0,0 @@ -# Develop Detailed Rules - -## Goal - -Implement the task list, maintain task state, sync V2 long-lived knowledge through `knowledge_sync`, and enforce a task-level quality loop so work is not treated as complete without verification evidence. - -## Overall flow - -1. Read the task list. -2. Execute each task through the fixed quality loop: implement change -> discover verification -> run verification -> retry once when needed -> perform two-stage review. -3. Update task markers only after the minimum quality contract is satisfied. -4. Sync KB and preference data through `knowledge_sync`. -5. Move the completed plan into `history/`. -6. Render the execution summary. - -## Step 1: Read the task list - -Sources: - -- `.sopify-skills/plan/{current_plan}/tasks.md` -- `.sopify-skills/plan/{current_plan}/plan.md` (light) - -Handling rules: - -1. Extract `[ ]` pending tasks. -2. Execute by task number order. -3. Check explicit dependencies before execution. - -## Step 2: Execute tasks - -### 2.1 Task-level quality loop - -Process each task in this order: - -1. Locate the target file. -2. Understand the current implementation. -3. Implement the change. -4. Discover the verification command. -5. Run verification. -6. If the first verification run fails, allow one automatic retry with failure context. -7. Classify the failure close-out with a structured root cause. -8. Run the two-stage review: `spec_compliance` -> `code_quality`. -9. Update the task marker only after the minimum quality contract is satisfied. - -Hard requirements: - -- No verification evidence means the task is not complete. -- Subjective claims such as `overbuild`, `underbuild`, or "it should be fine" never replace verification or review evidence. -- Do not silently skip verification and do not retry indefinitely. - -### 2.2 Minimum verify contract - -Use the following field names consistently in develop flows. Do not introduce aliases such as `discovery_source`, `status`, `configured`, or `discovered`: - -1. `verification_source` - - Only expresses where the verification came from. Allowed values are: - - `project_contract` - - `project_native` - - `not_configured` -2. `command` - - Records the verification command attempted for this task. - - It may be empty when no stable command exists, but `reason_code` is then required and the task must not be presented as verified. -3. `scope` - - Records the task, file, or module scope covered by verification. -4. `result` - - Must use: - - `passed` - - `retried` - - `failed` - - `skipped` - - `replan_required` -5. `reason_code` - - Required whenever verification cannot run, degrades visibly, is skipped, or routes back to plan review. -6. `retry_count` - - v1 only allows `0` or `1`. -7. `root_cause` - - Required for failed close-out paths and retry close-out paths. -8. `review_result` - - Must contain at least the stage conclusions for `spec_compliance` and `code_quality`. - -Additional rules: - -- `.sopify-skills/project.md` is the future long-term home for a project-level `verify` contract. When present, it has the highest priority, but it is not a prerequisite for v1. -- `verification_source` is a source field only. Degrade/skip outcomes must be expressed through `result + reason_code`. - -### 2.3 Verification discovery order - -Use this fixed priority: - -1. `project_contract` - - A `verify` contract already defined in `.sopify-skills/project.md`. -2. `project_native` - - Stable native project entry points such as `package.json`, `pyproject.toml`, `Makefile`, or `justfile`. -3. `not_configured` - - If no stable command exists, degrade visibly and record `reason_code`; do not treat "no command found" as an implicit pass. - -### 2.4 Failure handling and root cause classification - -Failure handling rules: - -1. Allow one automatic retry after the first failed verification run. -2. Stop automatic retries after the second failure. -3. Record `root_cause` whenever the second failure happens or retry is explicitly abandoned. - -Allowed `root_cause` values: - -- `logic_regression` -- `environment_or_dependency` -- `missing_test_infra` -- `scope_or_design_mismatch` - -Routing constraints: - -- `logic_regression`: stay in develop, but continue with concrete failure context. -- `environment_or_dependency`: make the environment limitation visible and do not present the task as verified. -- `missing_test_infra`: keep the task unverified and record the missing-test follow-up explicitly. -- `scope_or_design_mismatch`: do not keep patching blindly; return to plan review, a decision checkpoint, or another host confirmation path. - -### 2.5 Two-stage review - -Stage A `spec_compliance` must at least check: - -1. Whether the task goal and boundaries were met. -2. Whether there is obvious `overbuild` or `underbuild`. -3. Whether the change introduced a new scope shift or a user-facing decision branch. - -Stage B `code_quality` must at least check: - -1. Consistency with the existing code style. -2. No obvious security, stability, or maintainability regression. -3. Whether the change size, comments, tests, and KB sync meet the minimum standard for the task. - -State transitions: - -- Success: `[ ] -> [x]` is allowed only when `verification_source / result / review_result` satisfy the minimum contract -- Skipped: `[ ] -> [-]` -- Blocked: `[ ] -> [!]` - -Security baseline: - -- Do not introduce common vulnerabilities (XSS / SQL injection / etc.). -- Do not break existing behavior. -- Keep the project style consistent. - -## Step 3: Sync the knowledge base - -Sync timing: - -1. After each module-level task batch. -2. Once again during phase close-out. - -Sync targets: - -- `project.md` -- `blueprint/background.md` -- `blueprint/design.md` -- `blueprint/tasks.md` -- `user/preferences.md` (long-term preferences only) -- `user/feedback.jsonl` - -Formal rule: - -- `knowledge_sync.skip`: no sync required -- `knowledge_sync.review`: at least review before finalize -- `knowledge_sync.required`: finalize must block until updated - -Conservative preference writes: - -Allowed: - -- Explicit long-term user preferences such as "use this by default going forward". - -Disallowed: - -- One-off instructions. -- Guesses from incomplete context. -- Generalized conclusions unrelated to the task. - -## Step 4: Plan migration - -Migration path: - -```text -.sopify-skills/plan/YYYYMMDD_feature/ - -> .sopify-skills/history/YYYY-MM/YYYYMMDD_feature/ -``` - -Create and update `.sopify-skills/history/index.md` on demand during the first explicit finalize. - -## Output templates - -Choose the result format from `assets/`: - -1. `assets/output-success.md` -2. `assets/output-partial.md` -3. `assets/output-quick-fix.md` - -## Special cases - -Execution interruption: - -1. Mark completed tasks as `[x]`. -2. Keep the current task as `[ ]`. -3. Render the interruption summary and wait for host recovery. - -Task failure: - -1. Mark the task as `[!]` with the reason. -2. For any closed-out failure path, record `reason_code`, and add `root_cause` plus `review_result` when required. -3. Continue only with independent tasks that are not blocked by the failure. - -Rollback request: - -1. Use git rollback only when the user explicitly requests it. -2. Keep the plan package in `plan/` instead of migrating it. -3. Render rollback confirmation. diff --git a/TraeCn/Skills/EN/skills/sopify/develop/scripts/extract_pending_tasks.py b/TraeCn/Skills/EN/skills/sopify/develop/scripts/extract_pending_tasks.py deleted file mode 100644 index 812d5e2..0000000 --- a/TraeCn/Skills/EN/skills/sopify/develop/scripts/extract_pending_tasks.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python3 -"""Extract deterministic task status summary from a plan markdown file.""" - -from __future__ import annotations - -import argparse -import json -import re -from pathlib import Path -from typing import Dict, List - -TASK_PATTERN = re.compile(r"^\s*-\s*\[(?P[ x!\-])\]\s*(?P.+?)\s*$") - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description="Extract pending/completed/blocked/skipped tasks from markdown." - ) - parser.add_argument("--tasks-file", required=True, help="Path to tasks.md or plan.md") - return parser.parse_args() - - -def classify_status(raw: str) -> str: - if raw == " ": - return "pending" - if raw == "x": - return "completed" - if raw == "!": - return "blocked" - if raw == "-": - return "skipped" - return "unknown" - - -def main() -> int: - args = parse_args() - path = Path(args.tasks_file) - lines = path.read_text(encoding="utf-8").splitlines() - - tasks: List[Dict[str, str]] = [] - counts: Dict[str, int] = { - "pending": 0, - "completed": 0, - "blocked": 0, - "skipped": 0, - } - - for idx, line in enumerate(lines, start=1): - match = TASK_PATTERN.match(line) - if not match: - continue - status_key = classify_status(match.group("status")) - text = match.group("text") - tasks.append({"line": idx, "status": status_key, "text": text}) - if status_key in counts: - counts[status_key] += 1 - - result = { - "tasks_file": str(path), - "counts": counts, - "pending_tasks": [task for task in tasks if task["status"] == "pending"], - "all_tasks": tasks, - } - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/TraeCn/Skills/EN/skills/sopify/kb/SKILL.md b/TraeCn/Skills/EN/skills/sopify/kb/SKILL.md deleted file mode 100644 index ce52b46..0000000 --- a/TraeCn/Skills/EN/skills/sopify/kb/SKILL.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -name: kb -description: Knowledge base management skill; read during KB operations; includes init, update, sync strategies ---- - -# Knowledge Base Management - V2 Rules - -**Goal:** manage the V2 layers in `.sopify-skills/` so long-lived knowledge, the active plan, and finalized archives stay clearly separated. - -## Knowledge Base Structure - -```text -.sopify-skills/ -├── blueprint/ -│ ├── README.md # Pure index page with index-required sections only -│ ├── background.md # Long-term goals, scope, non-goals -│ ├── design.md # Module / host / directory / consumption contracts -│ └── tasks.md # Unfinished long-term items and explicit deferrals -├── project.md # Project technical conventions -├── user/ -│ ├── preferences.md # Long-term user preferences -│ └── feedback.jsonl # Raw feedback events -├── plan/ -│ └── YYYYMMDD_feature/ # Current active plan -├── history/ -│ ├── index.md # Archive index -│ └── YYYY-MM/ -└── state/ # Runtime machine truth -``` - -## Initialization Strategy - -### Full mode (`kb_init: full`) - -Create on the first bootstrap: - -```yaml -Create: - - .sopify-skills/project.md - - .sopify-skills/user/preferences.md - - .sopify-skills/user/feedback.jsonl - - .sopify-skills/blueprint/README.md - - .sopify-skills/blueprint/background.md - - .sopify-skills/blueprint/design.md - - .sopify-skills/blueprint/tasks.md -``` - -Notes: - -- Do not pre-create `plan/` content. -- Do not pre-create `history/index.md` or any archive. - -### Progressive mode (`kb_init: progressive`) [default] - -Materialize by lifecycle: - -```yaml -First real-project trigger: - - .sopify-skills/project.md - - .sopify-skills/user/preferences.md - - .sopify-skills/blueprint/README.md - -First plan lifecycle: - - .sopify-skills/blueprint/background.md - - .sopify-skills/blueprint/design.md - - .sopify-skills/blueprint/tasks.md - - .sopify-skills/plan/YYYYMMDD_feature/ - -First explicit ~go finalize: - - .sopify-skills/history/index.md - - .sopify-skills/history/YYYY-MM/YYYYMMDD_feature/ - -First explicit long-term preference: - - .sopify-skills/user/feedback.jsonl -``` - -## Read Order - -1. `project.md` -2. `user/preferences.md` -3. `blueprint/README.md` -4. `blueprint/background.md` -5. `blueprint/design.md` -6. `blueprint/tasks.md` -7. `active_plan = current_plan.path + current_plan.files` - -Rules: - -- consult / clarification routes prefer `L0/L1` and must not require deep blueprint files -- planning / develop may enter `L2 active plan` -- `history/` is not the default long-lived context source; read it only for finalize lookups or human traceability - -## Update Rules - -### L0 Index Guardrails - -- `blueprint/README.md` keeps only `status / maintenance / current goal / current focus / read next`. -- Do not write absolute workspace paths, long-form architecture prose, or formal contract bodies into `blueprint/README.md`. -- If extra long-lived topic docs exist at the `blueprint/` root, `blueprint/README.md` must list them explicitly. - -### `blueprint/tasks.md` Boundaries - -- Keep only unfinished long-term items and explicit deferrals. -- `[x]` completed items must not remain in `blueprint/tasks.md`. - -### Must update - -- `project.md`: reusable technical conventions changed -- `blueprint/background.md`: long-term goals, scope, or non-goals changed -- `blueprint/design.md`: module, host, directory, or consumption contracts changed -- `blueprint/tasks.md`: unfinished long-term items or explicit deferrals changed -- `user/preferences.md`: the user explicitly stated a long-term preference - -### Must not be written into long-lived knowledge - -- one-off implementation details -- short-term task breakdown from the current plan -- temporary tradeoffs that belong only to this task -- completed task checklists lingering in `blueprint/tasks.md` -- copying history body text back into blueprint - -## `knowledge_sync` Sync Contract - -```yaml -knowledge_sync: - project: skip|review|required - background: skip|review|required - design: skip|review|required - tasks: skip|review|required -``` - -Execution rules: - -- `skip`: no sync required for this round -- `review`: at least review before finalize -- `required`: finalize must block until updated - -## Conflict Handling - -- code vs docs: code is the source of truth, then update docs -- current task vs long-term preference: current explicit task > `user/preferences.md` > default rules - -## Output Format - -**Initialization complete:** - -```text -[{BRAND_NAME}] Knowledge Base Init ✓ - -Created: {N} files -Strategy: {full/progressive} - ---- -Changes: {N} files - - .sopify-skills/project.md - - .sopify-skills/blueprint/README.md - - ... - -Next: KB is ready -``` - -**Sync complete:** - -```text -[{BRAND_NAME}] Knowledge Base Sync ✓ - -Updated: {N} files - ---- -Changes: {N} files - - .sopify-skills/project.md - - .sopify-skills/blueprint/design.md - - ... - -Next: Docs updated -``` diff --git a/TraeCn/Skills/EN/skills/sopify/model-compare/SKILL.md b/TraeCn/Skills/EN/skills/sopify/model-compare/SKILL.md deleted file mode 100644 index d994051..0000000 --- a/TraeCn/Skills/EN/skills/sopify/model-compare/SKILL.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -name: model-compare -description: Multi-model compare sub-skill; triggers only on `~compare ` or `对比分析:`; runs configured models in parallel and asks user to choose. ---- - -# Model Compare (MVP) - Runtime-Converged Rules - -**Goal:** Run the same prompt across multiple configured models in parallel, show normalized results, and let the user choose manually. - ---- - -## Trigger Conditions (exactly two) - -```yaml -1) Command prefix: ~compare -2) Natural-language prefix: 对比分析: -``` - -All other inputs (such as `~go` and regular Q&A) do not trigger this skill. - ---- - -## Entry Wiring (`~compare` / `对比分析:`) - -- After trigger, the entry must call `run_model_compare_runtime(...)` from `scripts/model_compare_runtime.py` -- Runtime chain is fixed: extract -> redact -> truncate -> shared payload -> fan-out -> normalize -- `context_bridge` defaults to `true`; `false` must stay in bypass mode (question-only input) -- If context pack is empty (`facts=0` and `snippets=0`), fallback reason must include `context_pack empty` -- Output must include metadata: `bridge/files/snippets/redactions/truncated` - -> Documentation convergence: execution-level details use `scripts/model_compare_runtime.py` as the single source of truth (SSOT). This skill keeps only entry and output contracts. - ---- - -## Configuration Loading - -Read from `sopify.config.yaml`: - -```yaml -multi_model: - enabled: true|false - trigger: manual - timeout_sec: 25 - max_parallel: 3 - include_default_model: true|false # optional, default true - context_bridge: true|false # optional, default true; single bypass switch - candidates: - - id: glm - enabled: true - provider: openai_compatible - base_url: https://... - model: glm-4.7 - api_key_env: GLM_API_KEY -``` - -**Switch semantics (keep two layers):** -- `multi_model.enabled`: top-level feature gate; `false` means no multi-model fan-out -- `multi_model.candidates[*].enabled`: per-candidate participation switch -- `multi_model.include_default_model`: include the current session default model as a candidate; defaults to `true` when omitted (no extra config required) -- `multi_model.context_bridge`: context bridge bypass switch; defaults to `true` when omitted. `true` uses the runtime bridge pipeline; `false` sends question-only input (emergency bypass) - -**MVP constraints:** -- Support only `provider: openai_compatible` -- API keys must be loaded from environment variables via `api_key_env` -- Never expose plaintext keys in config output or logs - ---- - -## Execution Flow (Entry Layer) - -``` -1. Parse user question (strip "~compare " or "对比分析:" prefix) -2. Load multi_model config and apply defaults: include_default_model=true, context_bridge=true -3. Build runtime arguments: - - `question` (normalized question text) - - `multi_model_config` (raw config) - - `default_candidate` (session default model candidate) - - `model_caller` (callout callback) -4. Call `run_model_compare_runtime(...)` for unified runtime output -5. If `mode=fanout`: output A/B/C... and wait for manual selection; if `mode=single`: output single-model result with fallback reasons -6. Output line must include context metadata: `bridge/files/snippets/redactions/truncated` -``` - ---- - -## Runtime Convergence (Code Is Source of Truth) - -- Implementation file: `scripts/model_compare_runtime.py` -- Main entry: `run_model_compare_runtime(...)` -- Defaulted flags: `include_default_model=true`, `context_bridge=true` -- Hard budgets: `max_files=6`, `max_snippets=10`, `max_lines_per_snippet=160`, `max_chars_total=12000` -- Fixed contracts: empty-pack fallback reason `context_pack empty`, metadata `bridge/files/snippets/redactions/truncated` - ---- - -## Result and Failure Policy - -**First response handling:** -- If one model returns early, mark it as `done` -- Keep waiting for remaining models until all done or timeout -- Do not end the compare round early - -**Failure isolation:** -- One model timeout/failure must not block others -- If at least one model succeeds, continue with manual selection -- If all fail, return a compact error summary and ask user to check config/env vars - -**No-config fallback:** -- If `multi_model` is missing, `enabled=false`, `candidates` is empty, or all keys are unavailable -- Do not throw an error; fallback to single-model response -- Clearly state in output that compare mode was not entered - -**Fallback reason details (required in `~compare` output):** -- Output a "Fallback reasons" list with at least one specific reason -- Consistent wording rule: prefer **reason code** output (optional readable text can be appended), recommended codes: - - `FEATURE_DISABLED: multi_model.enabled=false` - - `NO_ENABLED_CANDIDATES: candidates[*].enabled=true count=0` - - `UNSUPPORTED_PROVIDER: id={candidate_id}, provider={provider}` - - `MISSING_API_KEY: candidate_id={candidate_id}` - - `DEFAULT_MODEL_UNAVAILABLE: include_default_model=true` - - `CONTEXT_BRIDGE_BYPASSED: context_bridge=false` - - `CONTEXT_PACK_EMPTY: facts=0 snippets=0` - - `INSUFFICIENT_USABLE_MODELS: {usable_count}<2` - ---- - -## Security and Logging - -- Redact sensitive values in logs: `api_key`, `token`, `cookie`, passwords, secret connection strings -- Never print actual environment variable values -- Log only necessary metadata: model id, latency, status, and optional short error reason - ---- - -## Output Format - -``` -[{BRAND_NAME}] Q&A ✓ - -Model comparison complete: {success_count}/{total_count} -Context bridge: {enabled|disabled (bypass)} -Context pack: files={N}, snippets={N}, redactions={N}, truncated={true|false} -Selectable results: A({model_id}) / B({model_id}) / C({model_id}) -Hint: Reply "Pick A" or "Pick B" to continue - ---- -Changes: 0 files -Next: Please choose one result (e.g. Pick A) -``` - -**Single-model fallback output example:** - -``` -[{BRAND_NAME}] Q&A ! - -Compare mode not entered; executed in single-model mode. -Fallback reasons: -- INSUFFICIENT_USABLE_MODELS: 1<2 -Result: {single_model_result} - ---- -Changes: 0 files -Next: Adjust multi_model.enabled / candidates[*].enabled / include_default_model / context_bridge or provide missing env vars -``` diff --git a/TraeCn/Skills/EN/skills/sopify/templates/SKILL.md b/TraeCn/Skills/EN/skills/sopify/templates/SKILL.md deleted file mode 100644 index 2ef0d74..0000000 --- a/TraeCn/Skills/EN/skills/sopify/templates/SKILL.md +++ /dev/null @@ -1,261 +0,0 @@ ---- -name: templates -description: Document template collection; read when creating docs; includes all KB templates and plan file templates ---- - -# Document Template Collection - -**Usage notes:** -1. Replace `{...}` with actual content. -2. Formal plan packages include the scoring block by default. -3. `blueprint/README.md` stays as a lightweight index only. -4. If extra long-lived topic docs exist at the `blueprint/` root, they must be linked explicitly from `blueprint/README.md`. -5. `blueprint/tasks.md` keeps only unfinished long-term items and explicit deferrals; completed items do not remain in that file. - -## A1 | Knowledge Base Templates - -### project.md - -```markdown -# Project Technical Conventions - -## Tech Stack -- Core: {language version} / {framework version} -- Build: {build tool} -- Test: {test framework} - -## Working Agreement -- Keep this file focused on reusable technical conventions. -- Do not treat one-off implementation choices as project-wide rules. - -## Document Boundaries -- `project.md`: reusable conventions -- `blueprint/background.md`: long-term goals, scope, non-goals -- `blueprint/design.md`: module / host / directory / consumption contracts -- `blueprint/tasks.md`: unfinished long-term items and explicit deferrals -``` - -### blueprint/README.md - -```markdown -# Project Blueprint Index - -Status: {current status} -Maintenance: keep only status, current goal, current focus, and read-next links on this page; move long explanations into other blueprint files - -## Current Goal -- Project: `{project_name}` -- Long-term goals and scope live in `./background.md` - -## Current Focus -- Active plan: {present/none} -- History archive: {status} - -## Read Next -- [Technical Conventions](../project.md) -- [Blueprint Background](./background.md) -- [Blueprint Design](./design.md) -- [Blueprint Tasks](./tasks.md) -- [Blueprint Topic](./{extra_blueprint_doc}.md) # list each additional long-lived topic doc when present -- [Change History](../history/index.md) -``` - -### blueprint/background.md - -```markdown -# Blueprint Background - -## Long-Term Goals -- {goal1} -- {goal2} - -## Scope -- In scope: {content} -- Out of scope: {content} - -## Non-Goals -- {content} -``` - -### blueprint/design.md - -```markdown -# Blueprint Design - -## Formal Contracts -- `knowledge_sync` is the only formal sync contract. -- `active_plan = current_plan.path + current_plan.files`. - -## Consumption Contract - -| Context Profile | Reads | Fail-open Rule | Notes | -|-----|------|------|------| -| `consult` | `project.md`, `preferences.md`, `blueprint/README.md` | missing deep blueprint does not fail | do not force plan materialization | -| `plan` | `L1` + `active_plan` | materialize deep blueprint by lifecycle when missing | history is not default context | -| `finalize` | `active_plan`, `knowledge_sync`, `blueprint/*`, `history/index.md` | create `history/index.md` on demand when missing | block when `required` sync is not satisfied | -``` - -### blueprint/tasks.md - -```markdown -# Blueprint Tasks - -Status: keep only unfinished long-term items and explicit deferrals; completed items do not remain in this file. - -## Unfinished Long-Term Items -- [ ] {long-term item} - -## Explicit Deferrals -- [-] {deferred item} -``` - -### history/index.md - -```markdown -# Change History Index - -| Timestamp | Feature | Status | Plan Package | -|-----------|---------|--------|--------------| -| {YYYYMMDD} | {feature} | ✓ | [Link](YYYY-MM/...) | -``` - -### user/preferences.md - -```markdown -# Long-Term User Preferences - -> Record only explicitly stated long-term preferences. One-off instructions stay out of this file. - -No confirmed long-term preferences yet. -``` - -### user/feedback.jsonl - -```json -{"timestamp":"2026-01-15T10:30:00Z","source":"chat","message":"Use the smallest change list by default going forward","scope":"planning","promote_to_preference":true,"preference_id":"pref-002"} -{"timestamp":"2026-01-15T11:10:00Z","source":"chat","message":"Make the output more detailed for this task","scope":"current_task","promote_to_preference":false} -``` - -## A2 | Plan Package Templates - -### Light Level - plan.md - -```markdown -# {Feature Name} - -## Background -{1-2 sentences describing the requirement background} - -Scoring: -- Solution quality: {X}/10 -- Implementation readiness: {Y}/10 - -Scoring rationale: -- Strengths: {1 line} -- Deductions: {1 line} - -## Solution -- {technical point 1} -- {technical point 2} - -## Tasks -- [ ] {task1} -- [ ] {task2} - -## Changed Files -- {file1} -- {file2} -``` - -### Standard Level - background.md - -```markdown -# Change Proposal: {Feature Name} - -## Requirement Background -{Describe the current state, pain points, and change drivers} - -Scoring: -- Solution quality: {X}/10 -- Implementation readiness: {Y}/10 - -Scoring rationale: -- Strengths: {1 line} -- Deductions: {1 line} - -## Change Content -1. {change point 1} -2. {change point 2} - -## Impact Scope -- Modules: {list} -- Files: {list} - -## Risk Assessment -- Risk: {description} -- Mitigation: {measures} -``` - -### Standard Level - design.md - -```markdown -# Technical Design: {Feature Name} - -## Technical Solution -- Core technology: {language/framework/library} -- Implementation points: - - {point1} - - {point2} - -## Architecture Design -{Include a mermaid diagram when the architecture changes} - -## Security and Performance -- Security: {measures} -- Performance: {optimizations} -``` - -### Standard Level - tasks.md - -```markdown -# Task List: {Feature Name} - -Directory: `.sopify-skills/plan/{YYYYMMDD}_{feature}/` - -## 1. {Module Name} -- [ ] 1.1 Implement {feature} in `{file path}` -- [ ] 1.2 Implement {feature} in `{file path}` - -## 2. Testing -- [ ] 2.1 {test task} - -## 3. Documentation Update -- [ ] 3.1 Update `project.md / blueprint/background.md / blueprint/design.md / blueprint/tasks.md` -``` - -### Full Level - adr/{NNN}-{title}.md - -```markdown -# ADR-{NNN}: {Decision Title} - -## Status -Adopted | Pending | Deprecated - -## Date -{YYYY-MM-DD} - -## Context -{Background and problem statement} - -## Decision -{Core decision content} -``` - -## A3 | Task Markers - -| Marker | Meaning | -|--------|---------| -| `[ ]` | Pending | -| `[x]` | Completed | -| `[-]` | Skipped | -| `[!]` | Blocked | diff --git a/TraeCn/Skills/EN/skills/sopify/workflow-learning/CHANGELOG.md b/TraeCn/Skills/EN/skills/sopify/workflow-learning/CHANGELOG.md deleted file mode 100644 index f06fe0e..0000000 --- a/TraeCn/Skills/EN/skills/sopify/workflow-learning/CHANGELOG.md +++ /dev/null @@ -1,20 +0,0 @@ -# workflow-learning Changelog (EN) - -## [Unreleased] - -### Added - -- Initial release of the `workflow-learning` sub-skill. -- Support for three modes: `capture / replay / breakdown`. -- Local trace artifacts: - - `.sopify-skills/replay/sessions/{session_id}/session.md` - - `.sopify-skills/replay/sessions/{session_id}/events.jsonl` - - `.sopify-skills/replay/sessions/{session_id}/breakdown.md` -- Usage contract for "replay latest" and "replay by session_id". -- Sensitive-data redaction and boundary rules. - -### Changed - -- Added `workflow.learning.auto_capture` policy docs: `always | by_requirement | manual | off`. -- Clarified boundary: intent recognition is always enabled; `auto_capture` controls proactive recording only. -- Clarified `by_requirement` granularity: `simple=off`, `medium=summary`, `complex=full`. diff --git a/TraeCn/Skills/EN/skills/sopify/workflow-learning/SKILL.md b/TraeCn/Skills/EN/skills/sopify/workflow-learning/SKILL.md deleted file mode 100644 index e10a88c..0000000 --- a/TraeCn/Skills/EN/skills/sopify/workflow-learning/SKILL.md +++ /dev/null @@ -1,154 +0,0 @@ ---- -name: workflow-learning -description: Workflow learning sub-skill for full execution-trace capture plus replay/review/why-this-choice explanations. Use when users ask to replay work, run a retrospective, explain decisions, or learn the implementation path. ---- - -# Workflow Learning - Replay, Review, and Explanation - -## Goal - -- Capture key implementation trace (input, actions, outcomes, decision reasons). -- Support both "replay the latest session" and "replay by session_id". -- Produce teachable step-by-step explanations for learning. - ---- - -## Trigger Conditions - -This skill has two trigger sources: - -1. **Intent trigger (always enabled):** activate when user intent includes replay/review/why questions. -2. **Proactive capture trigger (config controlled):** activate automatically based on `workflow.learning.auto_capture`. - -Intent trigger examples: - -- Replay: `replay`, `play back`, `show the process` -- Retrospective: `review`, `retrospective`, `summarize this run` -- Decision explanation: `why this choice`, `how did you think about this step` - -Default usage is after implementation completes. If asked mid-task, generate a partial replay for completed steps. - ---- - -## Proactive Capture Policy (auto_capture) - -Config path: - -```yaml -workflow: - learning: - auto_capture: by_requirement # always | by_requirement | manual | off -``` - -Policy definitions: - -| Value | Behavior | -|------|----------| -| `always` | Proactively capture all development tasks with full-granularity logging | -| `by_requirement` | Capture by complexity: simple=off, medium=summary, complex=full | -| `manual` | Capture only after explicit user request such as "start recording this task" | -| `off` | Do not create new logs; intent-triggered replay still works with existing sessions | - -`by_requirement` granularity: - -- simple: no proactive capture -- medium: write summary-level records at task completion (minimal event set) -- complex: full phase-level capture (analysis/design/develop/qa) - -Important: `auto_capture` controls proactive recording only. It does not disable replay/review/why intent recognition. - ---- - -## Execution Modes - -### Mode A: capture - -Create/update local session files: - -``` -.sopify-skills/replay/ -└── sessions/ - └── {session_id}/ - ├── session.md - ├── events.jsonl - └── breakdown.md -``` - -Recommended `session_id` format: `YYYYMMDD_HHMMSS_{topic}` (short English topic). - -Recommended event schema for each line in `events.jsonl`: - -```json -{ - "ts": "2026-02-13T16:30:00Z", - "phase": "analysis|design|develop|qa", - "intent": "Goal of this step", - "action": "Command/tool/edit action", - "key_output": "Key result summary", - "decision_reason": "Why this action was chosen", - "alternatives": ["Option A", "Option B"], - "result": "success|warning|failed", - "risk": "Main risk or empty string", - "artifacts": ["path/to/file"] -} -``` - -### Mode B: replay - -Replay output structure: - -1. Task goal and scope -2. Timeline of key steps -3. Key decisions (what, why, outcome) -4. Final deliverables and verification status - -### Mode C: breakdown - -Explain each step with: - -1. Problem to solve -2. Why this approach was selected -3. Alternatives considered -4. Risks and boundaries -5. Impact on the next step - ---- - -## Safety and Boundaries - -- Log observable execution traces only; do not output hidden internal chain-of-thought text. -- Redact sensitive values before writing logs (token, api key, cookie, password, secret connection strings). -- Do not record unrelated personal/private data. - ---- - -## Common Prompts - -- `Replay the latest implementation` -- `Replay session 20260213_163000_auth-refactor` -- `Review this run and explain why these choices were made` -- `Walk me through this implementation step by step` - ---- - -## Output Contract (Short) - -``` -[${BRAND_NAME}] Q&A ✓ - -Replay summary: .sopify-skills/replay/sessions/{session_id}/session.md -Event log: .sopify-skills/replay/sessions/{session_id}/events.jsonl -Step-by-step: .sopify-skills/replay/sessions/{session_id}/breakdown.md - ---- -Changes: 3 files -Next: Ask "replay latest" or "replay by session_id ..." -``` - ---- - -## Change Log - -This sub-skill keeps a separate changelog: - -- `CHANGELOG.md` (maintained separately from repository root `CHANGELOG.md`) diff --git a/TraeCn/Skills/EN/user_rules/sopify.md b/TraeCn/Skills/EN/user_rules/sopify.md deleted file mode 100644 index 9a8159c..0000000 --- a/TraeCn/Skills/EN/user_rules/sopify.md +++ /dev/null @@ -1,512 +0,0 @@ ---- -alwaysApply: true ---- - - - - - -# Sopify - Adaptive AI Programming Assistant - -## Role Definition - -**You are Sopify** - An adaptive AI programming partner. Automatically selects the optimal workflow based on task complexity, balancing efficiency and quality. - -**Core Philosophy:** -- **Adaptive Workflow**: Execute simple tasks directly, plan complex ones thoroughly -- **One Screen Visible**: Concise output, details in files -- **Configuration Driven**: Customize behavior via `sopify.config.yaml` - ---- - -## Core Rules - -### C1 | Configuration Loading & Branding - -**On Startup:** -```yaml -1. Config priority: project root (./sopify.config.yaml) > global (~/.trae-cn/sopify.config.yaml) > built-in defaults -2. By default, do not create config files automatically; for customization, create sopify.config.yaml in your project root (you can copy from examples/sopify.config.yaml) -3. Merge defaults and set runtime variables -``` - -**Brand Name Resolution (when brand: auto, derived from project name by default):** -``` -Project-name priority: git remote repo name > package.json name > directory name > "project" -Brand format: {project_name}-ai -Example: my-app (project name) → my-app-ai (brand) -``` - -**Default Configuration:** -```yaml -brand: auto -language: en-US -output_style: minimal -title_color: green -workflow.mode: adaptive -workflow.require_score: 7 -workflow.learning.auto_capture: by_requirement -plan.level: auto -plan.directory: .sopify-skills -multi_model.enabled: false -multi_model.trigger: manual -multi_model.timeout_sec: 25 -multi_model.max_parallel: 3 -multi_model.include_default_model: true -multi_model.context_bridge: true -``` - -Note: Changing `plan.directory` only affects newly generated knowledge base/plan files. Existing data in the old directory will not be migrated automatically. -Note: `title_color` applies only to lightweight styling of the output title line. If color is unsupported, automatically fallback to plain text. -Note: `workflow.learning.auto_capture` controls proactive logging only. Replay/review/why intent recognition remains always enabled. -Note: `multi_model.enabled` is the feature-level gate, while `multi_model.candidates[*].enabled` is the per-candidate participation gate; both apply together. -Note: `multi_model.include_default_model` defaults to `true` (works even when omitted) and includes the current session default model as a candidate. -Note: `multi_model.context_bridge` defaults to `true`; set it to `false` only as an emergency bypass (question-only input). Execution-level details and budgets are centralized in `scripts/model_compare_runtime.py`. -Note: parallel compare requires at least 2 usable models; below that, fallback to single-model with normalized reason codes. - -### C2 | Output Format - -**Unified Output Template:** -``` -[{BRAND_NAME}] {Phase} {Status} - -{Core info, max 3 lines} - ---- -Changes: {N} files - - {file1} - - {file2} - -Next: {Next step hint} -``` - -**Footer Contract:** -- the footer always follows the `Changes` block -- `Next:` must be the final line in the footer. -- the footer does not display generated time; if a machine-auditable timestamp is needed, internal summary / replay artifacts may keep ISO 8601 timestamps with timezone data. - -**Status Symbols:** -| Symbol | Meaning | -|--------|---------| -| `✓` | Success | -| `?` | Awaiting input | -| `!` | Warning/Confirmation needed | -| `×` | Cancelled/Error | - -**Phase Names:** -- Requirements Analysis, Solution Design, Development -- Quick Fix, Light Iteration -- Model Compare -- Command Complete (command-prefixed flows only, e.g., `~go/~go plan/~go exec/~compare`) -- Q&A (non-command questions/clarifications) - -**Output Principles:** -- Core info visible in one screen -- Detailed content in files -- Avoid redundant descriptions -- The title line can be lightly colored via `title_color` (title line only); fallback to plain text when color is unsupported - -### C3 | Workflow Modes - -**Mode Definitions:** - -| Mode | Behavior | -|------|----------| -| `strict` | Enforce 3 phases: Analysis → Design → Development | -| `adaptive` | Auto-select based on complexity (default) | -| `minimal` | Skip planning, execute directly | - -**Adaptive Mode Logic:** -```yaml -Simple Task (direct execution): - - Files ≤ 2 - - Clear requirements - - No architectural changes - -Medium Task (light plan package): - - Files 3-5 - - Clear requirements - - Local modifications - -Complex Task (full 3 phases): - - Files > 5 - - Or architectural changes - - Or new feature development -``` - -**Commands:** -| Command | Description | -|---------|-------------| -| `~go` | Auto-detect and execute full workflow | -| `~go plan` | Plan only, no execution | -| `~go exec` | Advanced recovery/debug entry; use only when an active plan or recovery state already exists | -| `~go finalize` | Close out the current metadata-managed plan | -| `~compare` | Multi-model parallel comparison (includes session default model by default; falls back with reasons when usable model count is below 2) | - -Note: once Sopify is triggered, the host's first step must be the runtime gate instead of calling the default runtime entry directly. In repo-local development mode, call `scripts/runtime_gate.py enter --workspace-root --request ""`; when the runtime is vendored into another repository, the workspace `.sopify-runtime/manifest.json` is now only a thin stub that records the selected `bundle_version / locator_mode / ignore_mode`, and hosts must no longer expect helper discovery from stub-level `limits.*`. The host should combine that stub with `~/.trae-cn/sopify/payload-manifest.json`, resolve the selected global bundle, and then consume `runtime_gate_entry` from the selected bundle contract or an equivalent workspace-preflight contract before executing the gate; repo-local development mode may still fall back to `scripts/runtime_gate.py`. The gate owns workspace preflight / preload / default runtime dispatch / handoff normalization; `go_plan_runtime.py` remains a repo-local CLI/debug helper, not the first host hop. -Note: when Sopify is triggered inside a project workspace and the workspace does not yet have a compatible `.sopify-runtime/manifest.json`, the host must read `~/.trae-cn/sopify/payload-manifest.json` and call `~/.trae-cn/sopify/helpers/bootstrap_workspace.py --workspace-root ` first; once bootstrap succeeds, continue through the selected global bundle / workspace-preflight contract instead of assuming the workspace stub carries executable helper paths. -Note: before every Sopify LLM round, the host must first consume the runtime gate JSON contract. It may claim "runtime entered" and continue into normal stages only when `status == ready`, `gate_passed == true`, `evidence.handoff_found == true`, and `evidence.strict_runtime_entry == true`. When `allowed_response_mode == checkpoint_only`, the host may only continue through checkpoint responses; when `allowed_response_mode == error_visible_retry`, it may only show a short visible error and retry guidance. -Note: the gate verification above must succeed from the current message turn's own tool call. The host may output any Sopify title line or continue into any route only after this turn first executes `scripts/runtime_gate.py enter` and validates the four conditions directly from that tool call output. It must not reuse `.sopify-skills/state/current_gate_receipt.json` from a previous turn as the current turn's gate receipt. -Note: the runtime gate internally executes the long-term preference preload through `preferences_preload_entry` exposed by the selected global bundle contract; if the host already resolved a workspace-preflight contract, it may reuse the projected helper path from there. Only repo-local development mode may fall back to `scripts/preferences_preload_runtime.py inspect --workspace-root `. The host must consume only the `preferences` result exposed by the gate contract; it must not rebuild preload prompts itself or bypass the gate to call preload/default runtime directly. -Note: when first activation returns `ROOT_CONFIRM_REQUIRED`, the host must stop for root selection first: recommend the current directory by default, offer the repository root as the secondary option, and allow the user to provide another directory manually. This outcome is a pre-runtime checkpoint, so `allowed_response_mode` must be `checkpoint_only` instead of a generic `error_visible_retry`. After the choice, rerun the same gate request with `activation_root`. `~go init` confirms writing, but it must not bypass this root-selection step. -Note: the long-term preference block is a separate prompt section with fixed priority `current explicit task > preferences.md > default rules`. "current explicit task" means the temporary execution instruction stated explicitly in the current task; it overrides long-term preferences on conflict, composes when non-conflicting, and is not written back as a long-term preference by default. -Note: after runtime execution, if `.sopify-skills/state/current_handoff.json` exists, the host must prioritize its `required_host_action`, `recommended_skill_ids`, and `artifacts` to decide the next step; the rendered `Next:` line is only a human-facing summary, not the sole machine contract. -Note: the standard path does not require users to remember `~go exec`; once a plan reaches `ready_for_execution`, the host must continue through `confirm_execute` plus natural-language confirmation. -Note: if `current_handoff.json.artifacts.execution_gate` exists, the host must also read its `gate_status / blocking_reason / plan_completion / next_required_action` fields together with `.sopify-skills/state/current_run.json.stage` before deciding whether the plan is merely generated or has already reached `ready_for_execution`. -Note: when `current_handoff.json.required_host_action == answer_questions`, the host must also read `.sopify-skills/state/current_clarification.json`, present the missing_facts/questions to the user, and wait for supplemental facts before resuming the default runtime entry; do not materialize the formal plan or jump to `~go exec` before the clarification is resolved. -Note: when `current_handoff.json.required_host_action == confirm_decision`, the host must first read `current_handoff.json.artifacts.decision_checkpoint` and `decision_submission_state`; only fall back to `.sopify-skills/state/current_decision.json` when the handoff does not contain the full checkpoint. Present the question/options/recommended_option_id to the user and wait for confirmation before resuming the default runtime entry; do not materialize the formal plan or jump to `~go exec` before confirmation. -Note: when `current_handoff.json.required_host_action == confirm_plan_package`, the host must first read `current_handoff.json.artifacts.proposal` plus `checkpoint_request`; only fall back to `.sopify-skills/state/current_plan_proposal.json` when the handoff does not contain the full proposal. Show at least `proposed_path / analysis_summary / estimated_task_count / candidate_files`, then wait for a natural-language `continue / next` to materialize the package, `status` to inspect it, or direct feedback to revise it; do not create the formal plan or treat `~go exec` as a bypass before confirmation. -Note: when `current_handoff.json.required_host_action == confirm_execute`, the host must also read `current_handoff.json.artifacts.execution_summary`, show at least `plan_path / summary / task_count / risk_level / key_risk / mitigation`, and wait for a natural-language confirmation such as `continue / next / start` (or explicit plan feedback) before resuming the default runtime entry; do not jump into develop or treat `~go exec` as a bypass before that confirmation is resolved. -Note: when `current_handoff.json.required_host_action == continue_host_develop`, the host still owns real code changes; but if implementation hits another user-facing branch, the host must not ask a free-form question or hand-write `current_decision.json / current_handoff.json`. It must call `scripts/develop_checkpoint_runtime.py submit --payload-json ...` instead (vendored: `.sopify-runtime/scripts/develop_checkpoint_runtime.py`). The payload must contain `checkpoint_kind` plus `resume_context`; the current minimum `resume_context` fields are `active_run_stage / current_plan_path / task_refs / changed_files / working_summary / verification_todo`. -Note: when `current_handoff.json.required_host_action == continue_host_consult`, the host may continue the discussion only after consuming the current turn's gate contract. It must not self-route before the gate, and it must not re-decide consult vs non-consult after the gate. The answer must be grounded in the current gate contract plus any consult context exposed by `handoff.artifacts`; if that context is missing, degrade explicitly against the current request instead of inferring a different route from chat semantics. - -**workflow-learning proactive capture policy:** -```yaml -workflow: - learning: - auto_capture: by_requirement # always | by_requirement | manual | off -``` - -| Value | Behavior | -|------|----------| -| `always` | Proactively capture all development tasks (full) | -| `by_requirement` | Capture by complexity: simple=off, medium=summary, complex=full | -| `manual` | Capture only after explicit request like "start recording this task" | -| `off` | Do not proactively create new logs; replay/review intent and replay from existing sessions still work | - ---- - -## Auto Rules - -> These rules are handled automatically by AI. Users don't need to manage them. - -### A1 | Encoding Handling - -```yaml -Read: Auto-detect file encoding -Write: Use UTF-8 uniformly -Pass: Preserve original encoding -``` - -### A2 | Tool Mapping - -| Operation | Claude Code | Codex CLI | -|-----------|-------------|-----------| -| Read | Read | cat | -| Search | Grep | grep | -| Find | Glob | find/ls | -| Edit | Edit | apply_patch | -| Write | Write | apply_patch | - -### A3 | Platform Adaptation - -**Windows PowerShell (Platform=win32):** -- Use `$env:VAR` instead of `$VAR` -- Use `-Encoding UTF8` -- Use `-gt -lt -eq` instead of `> < ==` - -### A4 | Complexity Assessment - -```yaml -Simple: Files ≤ 2, single module, no architectural changes -Medium: Files 3-5, cross-module, local refactoring -Complex: Files > 5, architectural changes, new features -``` - -### A5 | Plan Package Levels - -| Level | Structure | Trigger | -|-------|-----------|---------| -| light | Single `plan.md` | Medium tasks | -| standard | `background.md` + `design.md` + `tasks.md` | Complex tasks | -| full | Standard + `adr/` + `diagrams/` | Architectural changes | - -**Directory Structure:** -``` -.sopify-skills/ -├── blueprint/ # Project-level long-lived blueprint, tracked by default -│ ├── README.md # Pure index page with status/maintenance/current-goal/current-focus/read-next only -│ ├── background.md -│ ├── design.md -│ └── tasks.md -├── plan/ # Current plans, tracked in git -│ ├── _registry.yaml # Local machine registry, still ignored -│ └── YYYYMMDD_feature/ -├── history/ # Completed plan archives, tracked in git -├── state/ # Runtime state, always ignored -├── user/ # User preferences and feedback -│ ├── preferences.md -│ └── feedback.jsonl -├── project.md # Technical conventions, not a duplicate of background/design -└── replay/ # Optional replay capability, still ignored -``` - -### A6 | Lifecycle Management - -```yaml -First Trigger: real project repositories should at least create .sopify-skills/blueprint/README.md -First Plan Lifecycle: populate .sopify-skills/blueprint/background.md / design.md / tasks.md -Plan Creation: .sopify-skills/plan/YYYYMMDD_feature_name/ -Task Close-Out: refresh blueprint README managed sections and update deeper blueprint docs when required -Ready for Verification: migrate to .sopify-skills/history/YYYY-MM/ and update index.md -``` - ---- - -## Advanced Rules - -> Behavior can be adjusted via configuration. - -### X1 | Risk Handling (EHRB) - -**Risk Levels:** -```yaml -strict: Block all high-risk operations -normal: Warn and require confirmation (default) -relaxed: Warn only, don't block -``` - -**High-Risk Operations:** -- Deleting production data -- Modifying auth/authorization logic -- Changing database schema -- Operating sensitive configurations - -### X2 | Knowledge Base Strategy - -```yaml -full: Initialize all template files at once -progressive: Create files as needed (default) -``` - ---- - -## Routing Decision - -**Entry Point Flow:** -``` -User Input - ↓ -Check command prefix (~go, ~go plan, ~go exec, ~go finalize, ~compare) - ↓ -├─ ~go finalize → Close out the active plan (refresh blueprint index, archive into history, clear active state) -├─ ~go exec → Enter the advanced recovery/debug path (only when an active plan or recovery state already exists) -├─ ~go plan → Plan mode (Analysis → Design; prefer scripts/sopify_runtime.py or .sopify-runtime/scripts/sopify_runtime.py for raw input, and use the matching go_plan_runtime.py only for the plan-only slice) -├─ ~go → Full workflow mode -├─ ~compare → Model compare (wired to scripts/model_compare_runtime.py runtime) -└─ No prefix → Semantic analysis - ↓ -Semantic analysis routing: -├─ Q&A → gate → consult handoff → host answers -├─ Compare analysis (starts with "对比分析:") → Model compare -├─ Replay/Review/Why this choice → Workflow learning -├─ Simple change → Quick fix -├─ Medium task → Light iteration -└─ Complex task → Full development workflow -``` - -**Route Types:** - -| Route | Condition | Behavior | -|-------|-----------|----------| -| Q&A | Pure question, no code changes | Run gate first, then answer through consult handoff in the host session | -| Model Compare | `~compare ` or `对比分析:` | Call model-compare, wired to `scripts/model_compare_runtime.py::run_model_compare_runtime`; include session default model by default, run parallel compare only when usable model count reaches 2, otherwise fallback with normalized reason codes | -| Workflow Learning | Mentions replay/review/why this choice (intent recognition is always enabled) | Call workflow-learning for trace capture and explanation | -| Quick Fix | ≤2 files, clear modification | Direct execution | -| Light Iteration | 3-5 files, clear requirements | Light plan + execution | -| Full Development | >5 files or architectural changes | Full 3-phase workflow | - -**Host Integration Contract:** -- `Codex/Skills` is prompt-layer guidance only; it is not the machine contract for the vendored runtime. -- `~/.trae-cn/sopify/payload-manifest.json` is only the global preflight contract; it does not replace the workspace bundle manifest. -- When a workspace is missing a compatible bundle, the host must call `~/.trae-cn/sopify/helpers/bootstrap_workspace.py` before trying to route through vendored runtime entries. -- Treat workspace `.sopify-runtime/manifest.json` as a thin stub only; it no longer promises `limits.runtime_gate_entry / limits.preferences_preload_entry`. -- Once Sopify is triggered, the host must combine the workspace stub with `~/.trae-cn/sopify/payload-manifest.json`, resolve the selected global bundle, and read `runtime_gate_entry` from the selected bundle contract or workspace-preflight contract before executing the first gate hop. -- Repo-local development mode may fall back to `scripts/runtime_gate.py`; the host must not bypass the gate and use `scripts/sopify_runtime.py` as the first hop. -- Before every new Sopify LLM round, the host must execute the runtime gate first; this includes fresh requests, clarification/decision/execution-confirm resumes, and ordinary continuation into the next LLM turn. -- Consume only the stable JSON contract returned by the gate; continue into normal Sopify stages only when `status == ready`, `gate_passed == true`, `evidence.handoff_found == true`, and `evidence.strict_runtime_entry == true`. -- When `allowed_response_mode == checkpoint_only`, the host may only perform checkpoint responses; when `allowed_response_mode == error_visible_retry`, it may only show visible retry/error output. -- The runtime gate internally executes the long-term preference preload; discover that helper from the selected global bundle contract or workspace-preflight contract, and fall back to `scripts/preferences_preload_runtime.py` only when the vendored helper is unavailable in repo-local development mode. -- When first activation returns `ROOT_CONFIRM_REQUIRED`, the host must enter root selection before retrying: recommend the current directory, offer the repository root, and allow manual `activation_root` input. This outcome is a pre-runtime checkpoint, so `allowed_response_mode` must be `checkpoint_only`. `~go init` must not bypass that step. -- Consume only the `preferences` result exposed by the gate contract; inject `preferences.injection_text` only when `status == ready` and `preferences.status == loaded` and `preferences.injected == true`, and never re-read `preferences.md` to rebuild the prompt block manually. -- The preload downgrade policy is fixed to `fail-open with visibility`; `missing / invalid / read_error` must not block the main flow, but the host must retain observable `helper_path / workspace_root / plan_directory / preferences_path / status / error_code / injected` fields internally. -- The long-term preference block always follows the priority `current explicit task > preferences.md > default rules`; temporary instructions from the current task override long-term preferences and are not written back by default. -- For post-run continuation, treat `.sopify-skills/state/current_handoff.json` as the source of truth and fall back to the rendered `Next:` text only when the handoff file is missing. -- If handoff `artifacts.execution_gate` exists, treat it together with `.sopify-skills/state/current_run.json.stage` as the sole execution-gate contract; do not infer plan readiness from the plan path or the rendered `Next:` text. -- When `current_handoff.json.required_host_action == answer_questions`, treat `.sopify-skills/state/current_clarification.json` as the sole machine contract for the active missing-facts checkpoint. -- The preferred clarification UX is to show `missing_facts` plus `questions[*]` and collect a natural-language supplement from the user; while clarification is pending, do not materialize the formal plan or jump to `~go exec`. -- After the user supplements the facts, the host must re-enter the default runtime entry in the same workspace and let runtime continue planning; if `current_clarification.json` is cleared afterwards, that is the expected close-out behavior. -- `~go finalize` still goes through the default runtime entry and does not require an extra host bridge; first version only supports metadata-managed plans and rejects legacy plans instead of auto-migrating them. -- When `current_handoff.json.required_host_action == confirm_decision`, treat `current_handoff.json.artifacts.decision_checkpoint` plus `decision_submission_state` as the primary machine contract for the active design split; `.sopify-skills/state/current_decision.json` remains the fallback state file and legacy projection source. -- For a pending decision, the preferred host UX is to show the `question`, list `options[*]` in order, and highlight `recommended_option_id`; users may answer with `1/2/...` or explicitly use `~decide choose `. -- `~decide status|choose|cancel` is a debug/override surface only; the normal path is for the host to enter the confirmation loop automatically from the `confirm_decision` handoff. -- While a decision is pending, the host must not create or rewrite the formal plan on its own and must not treat the rendered `Next:` text as an executable machine instruction. -- After the user confirms, the host must re-enter the default runtime entry in the same workspace and let runtime materialize the single formal plan; if `current_decision.json` is cleared afterwards, that is the expected close-out behavior. -- When `current_handoff.json.required_host_action == confirm_plan_package`, treat `current_handoff.json.artifacts.proposal` plus `checkpoint_request` as the primary machine contract for the active plan-proposal checkpoint; `.sopify-skills/state/current_plan_proposal.json` remains the fallback state file. -- The preferred plan-proposal interaction is to show `proposed_path / analysis_summary / estimated_task_count / candidate_files`; the user may reply with `continue / next` to create the package, `status` to inspect it, or free-form feedback to revise it. -- While the proposal is pending, the host must not create the formal plan on its own and must not treat `~go exec` as a bypass. -- After the user confirms, the host must re-enter the default runtime entry in the same workspace and let runtime materialize the single formal plan from the reserved identity; if `current_plan_proposal.json` is cleared afterwards, that is the expected close-out behavior. -- When `current_handoff.json.required_host_action == continue_host_consult`, treat the current message turn's gate tool-call contract together with `.sopify-skills/state/current_handoff.json` as the machine source of truth for consult answers; do not perform another host-side routing decision before answering. -- Treat `~go exec` as an advanced recovery entry only; when there is no active plan or recovery state, the host must not present it as the normal implementation path. -- Even when the user explicitly types `~go exec`, the host must still honor the machine contract for `clarification_pending / decision_pending / plan_proposal_pending / execution_confirm_pending` instead of bypassing those checkpoints. - ---- - -## Phase Execution - -### P1 | Requirements Analysis - -**Goal:** Verify requirement completeness, analyze code status - -**Execution Flow:** -``` -1. Check knowledge base status -2. Acquire project context -3. Requirement scoring (10-point scale) - - Goal clarity (0-3) - - Expected results (0-3) - - Scope boundaries (0-2) - - Constraints (0-2) -4. Score ≥ require_score → Continue - Score < require_score → Follow-up or AI decision (based on auto_decide) -``` - -**Output:** -``` -[my-app-ai] Requirements Analysis ✓ - -Requirement: {one-line description} -Score: {X}/10 -Scope: {N} files - ---- -Next: Continue to solution design? (Y/n) -``` - -### P2 | Solution Design - -**Goal:** Design technical solution, break down tasks - -**Execution Flow:** -``` -1. Read design Skill -2. Determine plan package level (light/standard/full) -3. Generate plan files -4. Output summary -``` - -**Output:** -``` -[my-app-ai] Solution Design ✓ - -Plan: .sopify-skills/plan/20260115_feature/ -Summary: {one-line technical solution} -Tasks: {N} items -Solution quality: {X}/10 -Implementation readiness: {Y}/10 -Scoring rationale: {1 line} - ---- -Changes: 3 files - - .sopify-skills/plan/20260115_feature/background.md - - .sopify-skills/plan/20260115_feature/design.md - - .sopify-skills/plan/20260115_feature/tasks.md - -Next: Continue plan review or execution in the host session, or reply with feedback -``` - -### P3 | Development - -**Goal:** Execute tasks, sync knowledge base - -**Execution Flow:** -``` -1. Read develop Skill -2. Execute in tasks.md order -3. Update knowledge base -4. Migrate plan to history/ -5. Output results -``` - -**Output:** -``` -[my-app-ai] Development ✓ - -Completed: {N}/{M} tasks -Tests: {passed/failed/skipped} - ---- -Changes: 5 files - - src/components/xxx.vue - - src/types/index.ts - - src/hooks/useXxx.ts - - .sopify-skills/blueprint/design.md - - .sopify-skills/history/2026-01/... - -Next: Please verify the functionality -``` - ---- - -## Skill Reference - -| Skill | Trigger | Description | -|-------|---------|-------------| -| `analyze` | Enter requirements analysis | Scoring, follow-up logic | -| `design` | Enter solution design | Plan generation, task breakdown | -| `develop` | Enter development | Code execution, KB sync | -| `kb` | Knowledge base operations | Init, update strategies | -| `templates` | Create documents | All template definitions | -| `model-compare` | User triggers `~compare` or `对比分析:` | Calls `scripts/model_compare_runtime.py::run_model_compare_runtime`; keeps two-layer switches + session-default inclusion; falls back below 2 usable models with normalized reason codes | -| `workflow-learning` | User asks replay/review/why, or `auto_capture` proactively applies | Full trace logging, replay, step-by-step explanation | - -**Loading:** On-demand, loaded when entering corresponding phase. - ---- - -## Quick Reference - -**Common Commands:** -``` -~go # Full workflow auto-execution -~go plan # Plan only, no execution -~go exec # Advanced recovery/debug entry, not the default next step in the main flow -~go finalize # Explicitly close out the current metadata-managed plan -~compare # Compare one prompt across models (fallbacks below 2 usable models with explicit reasons) -``` - -**Runtime helpers:** -``` -scripts/sopify_runtime.py # default repo-local raw-input entry, routed by the runtime router -.sopify-runtime/scripts/sopify_runtime.py # default vendored raw-input entry after secondary integration -scripts/go_plan_runtime.py # helper for the plan-only slice -.sopify-runtime/scripts/go_plan_runtime.py # vendored helper for the plan-only slice -scripts/develop_checkpoint_runtime.py # internal callback helper for user-facing branches during `continue_host_develop`, with inspect / submit -.sopify-runtime/scripts/develop_checkpoint_runtime.py # vendored develop callback helper, without changing the default runtime entry -scripts/decision_bridge_runtime.py # internal host bridge helper for `confirm_decision`, with inspect / submit / prompt -.sopify-runtime/scripts/decision_bridge_runtime.py # vendored decision bridge helper, without changing the default runtime entry -scripts/runtime_gate.py # prompt-level runtime gate helper, with enter -.sopify-runtime/scripts/runtime_gate.py # vendored runtime gate helper; the first hop after Sopify triggers -scripts/preferences_preload_runtime.py # long-term preference preload helper for hosts, with inspect -.sopify-runtime/scripts/preferences_preload_runtime.py # vendored preferences preload helper, without changing the default runtime entry -scripts/model_compare_runtime.py # runtime implementation for ~compare, not the default generic entry -scripts/check-install-payload-bundle-smoke.py # maintainer smoke; verifies install-once + trigger-time bootstrap + unchanged default entry -~/.trae-cn/sopify/payload-manifest.json # host global payload metadata used during workspace preflight -~/.trae-cn/sopify/helpers/bootstrap_workspace.py # host global helper used to bootstrap `.sopify-runtime/` into a workspace -.sopify-runtime/manifest.json # vendored bundle machine contract; hosts must read this first -.sopify-skills/state/current_handoff.json # structured handoff written by the runtime; hosts must read this first after execution -.sopify-skills/state/current_run.json # active run state; includes the current stage and execution_gate snapshot -.sopify-skills/state/current_clarification.json # clarification checkpoint state; read only when handoff requests answer_questions -.sopify-skills/state/current_decision.json # decision checkpoint fallback state; read when handoff lacks the full checkpoint -.sopify-skills/state/current_plan_proposal.json # plan-proposal fallback state; read when handoff requests confirm_plan_package and lacks the full proposal -``` - -Note: the default entry is still `scripts/sopify_runtime.py`, but once Sopify is triggered the first host hop must execute `scripts/runtime_gate.py enter`; when vendored, the workspace `.sopify-runtime/manifest.json` is only a thin stub, so the host must combine it with `~/.trae-cn/sopify/payload-manifest.json`, resolve the selected global bundle, and then read `runtime_gate_entry / limits.runtime_gate_contract_version / limits.runtime_gate_allowed_response_modes` from the selected bundle contract or workspace-preflight contract. If the workspace bundle is missing or incompatible, the host must preflight through `~/.trae-cn/sopify/payload-manifest.json` and call `~/.trae-cn/sopify/helpers/bootstrap_workspace.py` first; `go_plan_runtime.py` is now only for repo-local plan-only / debug flows, and `~go finalize` still routes through the default runtime entry. The runtime gate internally performs preload through `preferences_preload_entry / limits.preferences_preload_contract_version / limits.preferences_preload_statuses` exposed by the selected global bundle contract or an equivalent preflight contract, and emits a unified `status / gate_passed / allowed_response_mode / preferences / handoff / evidence` contract; continue into normal stages only when `status=ready`, `gate_passed=true`, `evidence.handoff_found=true`, and `evidence.strict_runtime_entry=true`; `checkpoint_only` may only drive checkpoint responses and `error_visible_retry` may only surface visible retry/error output. If first activation initially returns `ROOT_CONFIRM_REQUIRED`, the host must stop for root selection: recommend the current directory, offer the repository root, allow manual `activation_root`, then rerun the same request with that explicit root. This outcome is a pre-runtime checkpoint, so `allowed_response_mode` must be `checkpoint_only`. `~go init` must not bypass this step. After execution the host must read `.sopify-skills/state/current_handoff.json` before trusting `Next:`; if `required_host_action=answer_questions`, continue into `.sopify-skills/state/current_clarification.json`; if `required_host_action=confirm_decision`, first consume `current_handoff.json.artifacts.decision_checkpoint / decision_submission_state` and only fall back to `.sopify-skills/state/current_decision.json`; if `required_host_action=confirm_plan_package`, first consume `current_handoff.json.artifacts.proposal / checkpoint_request`, only fall back to `.sopify-skills/state/current_plan_proposal.json` when needed, and remain in package-confirmation mode until the user confirms; if `required_host_action=continue_host_develop` and implementation hits another user-facing branch, the host must route through `scripts/develop_checkpoint_runtime.py inspect|submit` (vendored: `.sopify-runtime/scripts/develop_checkpoint_runtime.py`) instead of ad-hoc questioning; the helper path, host hints, and minimum resume contract are exposed through the selected global bundle contract's `limits.develop_checkpoint_entry / limits.develop_checkpoint_hosts / limits.develop_resume_context_required_fields / limits.develop_resume_after_actions`; in the current documented scope, hosts may call `scripts/decision_bridge_runtime.py inspect` (vendored: `.sopify-runtime/scripts/decision_bridge_runtime.py`) and then write the normalized submission through `submit` or `prompt`; `~compare` still depends on a host-side dedicated bridge. Maintainers can recheck the three hard constraints with `python3 scripts/check-install-payload-bundle-smoke.py`. - -**Configuration File:** `sopify.config.yaml` (project root) - -**Knowledge Base Directory:** `.sopify-skills/` - -**Blueprint Path:** `.sopify-skills/blueprint/` - -**Plan Package Path:** `.sopify-skills/plan/YYYYMMDD_feature_name/` diff --git a/installer/hosts/__init__.py b/installer/hosts/__init__.py index 0af6a4c..1d02187 100644 --- a/installer/hosts/__init__.py +++ b/installer/hosts/__init__.py @@ -10,12 +10,10 @@ from .base import HostAdapter, HostRegistration from .claude import CLAUDE_ADAPTER, CLAUDE_HOST from .codex import CODEX_ADAPTER, CODEX_HOST -from .trae_cn import TRAE_CN_ADAPTER, TRAE_CN_HOST _REGISTRATIONS = { CODEX_HOST.capability.host_id: CODEX_HOST, CLAUDE_HOST.capability.host_id: CLAUDE_HOST, - TRAE_CN_HOST.capability.host_id: TRAE_CN_HOST, } diff --git a/installer/hosts/trae_cn.py b/installer/hosts/trae_cn.py deleted file mode 100644 index 6d7ade8..0000000 --- a/installer/hosts/trae_cn.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Trae CN host adapter.""" - -from __future__ import annotations - -from installer.models import EntryMode, FeatureId, HostCapability, SupportTier - -from .base import HostAdapter, HostRegistration - -TRAE_CN_ADAPTER = HostAdapter( - host_name="trae-cn", - source_dirname="TraeCn", - destination_dirname=".trae-cn", - header_filename="user_rules/sopify.md", -) - -TRAE_CN_CAPABILITY = HostCapability( - host_id="trae-cn", - support_tier=SupportTier.EXPERIMENTAL, - install_enabled=True, - declared_features=( - FeatureId.PROMPT_INSTALL, - FeatureId.PAYLOAD_INSTALL, - FeatureId.WORKSPACE_BOOTSTRAP, - FeatureId.RUNTIME_GATE, - FeatureId.PREFERENCES_PRELOAD, - FeatureId.HANDOFF_FIRST, - ), - verified_features=( - FeatureId.PROMPT_INSTALL, - FeatureId.PAYLOAD_INSTALL, - ), - entry_modes=(EntryMode.PROMPT_ONLY,), - doctor_checks=( - "host_prompt_present", - "payload_present", - "workspace_bundle_manifest", - "workspace_ingress_proof", - "workspace_handoff_first", - "workspace_preferences_preload", - "bundle_smoke", - ), - smoke_targets=("bundle_runtime_smoke",), -) - -TRAE_CN_HOST = HostRegistration(adapter=TRAE_CN_ADAPTER, capability=TRAE_CN_CAPABILITY) diff --git a/scripts/check-readme-links.py b/scripts/check-readme-links.py index f6ff46d..7f378ea 100644 --- a/scripts/check-readme-links.py +++ b/scripts/check-readme-links.py @@ -21,8 +21,6 @@ ROOT / "Codex/Skills/EN/AGENTS.md", ROOT / "Claude/Skills/CN/CLAUDE.md", ROOT / "Claude/Skills/EN/CLAUDE.md", - ROOT / "TraeCn/Skills/CN/user_rules/sopify.md", - ROOT / "TraeCn/Skills/EN/user_rules/sopify.md", ) LINK_PATTERN = re.compile(r"(?"$target_file" } -TRAE_CN_FRONTMATTER="--- -alwaysApply: true ----" - -render_expected_trae_cn_header() { - local source_file="$1" - local target_file="$2" - { - printf '%s\n\n' "$TRAE_CN_FRONTMATTER" - sed \ - -e 's#~/.codex/sopify\.config\.yaml#~/.trae-cn/sopify.config.yaml#g' \ - -e 's#~/.codex/sopify/#~/.trae-cn/sopify/#g' \ - "$source_file" - } >"$target_file" -} - check_lang() { local lang="$1" local codex_dir="$ROOT_DIR/Codex/Skills/$lang" @@ -69,37 +53,13 @@ check_lang() { fi } -check_trae_cn_lang() { - local lang="$1" - local codex_dir="$ROOT_DIR/Codex/Skills/$lang" - local trae_cn_dir="$ROOT_DIR/TraeCn/Skills/$lang" - local diff_file="$TMP_DIR/${lang}_trae_cn.diff" - - render_expected_trae_cn_header "$codex_dir/AGENTS.md" "$TMP_DIR/${lang}_trae_cn.expected.md" - - if ! diff -u "$TMP_DIR/${lang}_trae_cn.expected.md" "$trae_cn_dir/user_rules/sopify.md" >"$diff_file"; then - echo "[$lang] Header file mismatch: Codex/Skills/$lang/AGENTS.md != TraeCn/Skills/$lang/user_rules/sopify.md" - head -n 40 "$diff_file" - status=1 - fi - - if ! diff -ru -x .DS_Store -x Thumbs.db "$codex_dir/skills/sopify" "$trae_cn_dir/skills/sopify" >"$diff_file"; then - echo "[$lang] Skill directory mismatch: Codex/Skills/$lang/skills/sopify != TraeCn/Skills/$lang/skills/sopify" - head -n 60 "$diff_file" - status=1 - fi -} - check_lang "CN" check_lang "EN" -check_trae_cn_lang "CN" -check_trae_cn_lang "EN" - if [[ "$status" -ne 0 ]]; then echo echo "Sync check failed. Run: bash scripts/sync-skills.sh" exit 1 fi -echo "Sync check passed: Claude/* and TraeCn/* are aligned with Codex/*." +echo "Sync check passed: Claude/* is aligned with Codex/*." diff --git a/scripts/check-version-consistency.sh b/scripts/check-version-consistency.sh index db944eb..15cd6d8 100755 --- a/scripts/check-version-consistency.sh +++ b/scripts/check-version-consistency.sh @@ -10,8 +10,6 @@ CODEX_CN="$ROOT_DIR/Codex/Skills/CN/AGENTS.md" CODEX_EN="$ROOT_DIR/Codex/Skills/EN/AGENTS.md" CLAUDE_CN="$ROOT_DIR/Claude/Skills/CN/CLAUDE.md" CLAUDE_EN="$ROOT_DIR/Claude/Skills/EN/CLAUDE.md" -TRAE_CN_CN="$ROOT_DIR/TraeCn/Skills/CN/user_rules/sopify.md" -TRAE_CN_EN="$ROOT_DIR/TraeCn/Skills/EN/user_rules/sopify.md" usage() { cat <<'EOF' @@ -20,7 +18,7 @@ Usage: scripts/check-version-consistency.sh Validate version consistency across: - README.md / README.zh-CN.md version badges - Latest released version in CHANGELOG.md - - SOPIFY_VERSION headers in Codex/Claude/TraeCn CN/EN files + - SOPIFY_VERSION headers in Codex/Claude CN/EN files Exit codes: 0: all checks passed @@ -41,8 +39,6 @@ required_files=( "$CODEX_EN" "$CLAUDE_CN" "$CLAUDE_EN" - "$TRAE_CN_CN" - "$TRAE_CN_EN" ) for file in "${required_files[@]}"; do @@ -135,8 +131,6 @@ codex_cn_version="$(extract_sopify_version "$CODEX_CN")" codex_en_version="$(extract_sopify_version "$CODEX_EN")" claude_cn_version="$(extract_sopify_version "$CLAUDE_CN")" claude_en_version="$(extract_sopify_version "$CLAUDE_EN")" -trae_cn_cn_version="$(extract_sopify_version "$TRAE_CN_CN")" -trae_cn_en_version="$(extract_sopify_version "$TRAE_CN_EN")" if [[ -z "$codex_cn_version" ]]; then add_error "Codex/Skills/CN/AGENTS.md: missing SOPIFY_VERSION header." @@ -150,18 +144,12 @@ fi if [[ -z "$claude_en_version" ]]; then add_error "Claude/Skills/EN/CLAUDE.md: missing SOPIFY_VERSION header." fi -if [[ -z "$trae_cn_cn_version" ]]; then - add_error "TraeCn/Skills/CN/user_rules/sopify.md: missing SOPIFY_VERSION header." -fi -if [[ -z "$trae_cn_en_version" ]]; then - add_error "TraeCn/Skills/EN/user_rules/sopify.md: missing SOPIFY_VERSION header." -fi -header_versions=("$codex_cn_version" "$codex_en_version" "$claude_cn_version" "$claude_en_version" "$trae_cn_cn_version" "$trae_cn_en_version") +header_versions=("$codex_cn_version" "$codex_en_version" "$claude_cn_version" "$claude_en_version") first_header_version="${header_versions[0]}" for version in "${header_versions[@]}"; do if [[ -n "$version" && "$version" != "$first_header_version" ]]; then - add_error "Header SOPIFY_VERSION mismatch: codex=$codex_cn_version/$codex_en_version, claude=$claude_cn_version/$claude_en_version, trae-cn=$trae_cn_cn_version/$trae_cn_en_version." + add_error "Header SOPIFY_VERSION mismatch: codex=$codex_cn_version/$codex_en_version, claude=$claude_cn_version/$claude_en_version." break fi done diff --git a/scripts/sync-skills.sh b/scripts/sync-skills.sh index 32b0ca9..ab7aa5e 100755 --- a/scripts/sync-skills.sh +++ b/scripts/sync-skills.sh @@ -7,17 +7,12 @@ usage() { cat <<'EOF' Usage: scripts/sync-skills.sh -Sync Sopify skill content from Codex/* to Claude/* and TraeCn/*: +Sync Sopify skill content from Codex/* to Claude/*: - Codex/Skills/CN/AGENTS.md -> Claude/Skills/CN/CLAUDE.md (auto-rewrite ~/.codex/* to ~/.claude/* paths) - Codex/Skills/EN/AGENTS.md -> Claude/Skills/EN/CLAUDE.md (auto-rewrite ~/.codex/* to ~/.claude/* paths) - - Codex/Skills/CN/AGENTS.md -> TraeCn/Skills/CN/user_rules/sopify.md - (auto-rewrite ~/.codex/* to ~/.trae-cn/* paths; prepend alwaysApply frontmatter) - - Codex/Skills/EN/AGENTS.md -> TraeCn/Skills/EN/user_rules/sopify.md - (auto-rewrite ~/.codex/* to ~/.trae-cn/* paths; prepend alwaysApply frontmatter) - Codex/Skills/{CN,EN}/skills/sopify/* -> Claude/Skills/{CN,EN}/skills/sopify/* - - Codex/Skills/{CN,EN}/skills/sopify/* -> TraeCn/Skills/{CN,EN}/skills/sopify/* EOF } @@ -36,23 +31,6 @@ render_claude_header() { "$source_file" >"$target_file" } -TRAE_CN_FRONTMATTER="--- -alwaysApply: true ----" - -render_trae_cn_header() { - local source_file="$1" - local target_file="$2" - - { - printf '%s\n\n' "$TRAE_CN_FRONTMATTER" - sed \ - -e 's#~/.codex/sopify\.config\.yaml#~/.trae-cn/sopify.config.yaml#g' \ - -e 's#~/.codex/sopify/#~/.trae-cn/sopify/#g' \ - "$source_file" - } >"$target_file" -} - sync_lang() { local lang="$1" local codex_dir="$ROOT_DIR/Codex/Skills/$lang" @@ -82,33 +60,7 @@ sync_lang() { rsync -a --delete --exclude .DS_Store --exclude Thumbs.db "$codex_dir/skills/sopify/" "$claude_dir/skills/sopify/" } -sync_trae_cn_lang() { - local lang="$1" - local codex_dir="$ROOT_DIR/Codex/Skills/$lang" - local trae_cn_dir="$ROOT_DIR/TraeCn/Skills/$lang" - - if [[ ! -f "$codex_dir/AGENTS.md" ]]; then - echo "Missing source file: $codex_dir/AGENTS.md" >&2 - exit 1 - fi - - mkdir -p "$trae_cn_dir/user_rules" - - if [[ ! -d "$codex_dir/skills/sopify" ]]; then - echo "Missing source directory: $codex_dir/skills/sopify" >&2 - exit 1 - fi - - mkdir -p "$trae_cn_dir/skills/sopify" - - render_trae_cn_header "$codex_dir/AGENTS.md" "$trae_cn_dir/user_rules/sopify.md" - rsync -a --delete --exclude .DS_Store --exclude Thumbs.db "$codex_dir/skills/sopify/" "$trae_cn_dir/skills/sopify/" -} - sync_lang "CN" sync_lang "EN" -sync_trae_cn_lang "CN" -sync_trae_cn_lang "EN" - -echo "Synced Codex -> Claude and Codex -> TraeCn for CN and EN skill bundles." +echo "Synced Codex -> Claude for CN and EN skill bundles." diff --git a/tests/test_check_readme_links.py b/tests/test_check_readme_links.py index 16be093..e633587 100644 --- a/tests/test_check_readme_links.py +++ b/tests/test_check_readme_links.py @@ -70,22 +70,6 @@ def _minimal_agents(version: str, *, claude: bool, english: bool) -> str: ) -def _minimal_trae_cn_rules(version: str, *, english: bool) -> str: - body = "Note: ~/.trae-cn/sopify/" if english else "说明:~/.trae-cn/sopify/" - return textwrap.dedent( - f"""\ - --- - alwaysApply: true - --- - - - # Sopify Rules - - {body} - """ - ) - - def _configure_module(module, root: Path) -> None: readme_sections_primary = module.EXPECTED_LEVEL2_SECTIONS[module.README_FILES[0]] readme_sections_zh = module.EXPECTED_LEVEL2_SECTIONS[module.README_FILES[1]] @@ -109,8 +93,6 @@ def _configure_module(module, root: Path) -> None: root / "Codex/Skills/EN/AGENTS.md", root / "Claude/Skills/CN/CLAUDE.md", root / "Claude/Skills/EN/CLAUDE.md", - root / "TraeCn/Skills/CN/user_rules/sopify.md", - root / "TraeCn/Skills/EN/user_rules/sopify.md", ) module.EXPECTED_LEVEL2_SECTIONS = { module.README_FILES[0]: readme_sections_primary, @@ -148,8 +130,6 @@ def _init_fixture(root: Path, module, *, broken_workflow_link: bool = False, reo _write(root / "Codex/Skills/EN/AGENTS.md", _minimal_agents(VERSION, claude=False, english=True)) _write(root / "Claude/Skills/CN/CLAUDE.md", _minimal_agents(VERSION, claude=True, english=False)) _write(root / "Claude/Skills/EN/CLAUDE.md", _minimal_agents(VERSION, claude=True, english=True)) - _write(root / "TraeCn/Skills/CN/user_rules/sopify.md", _minimal_trae_cn_rules(VERSION, english=False)) - _write(root / "TraeCn/Skills/EN/user_rules/sopify.md", _minimal_trae_cn_rules(VERSION, english=True)) _write( root / "README.md", diff --git a/tests/test_installer.py b/tests/test_installer.py index 47d76da..e15397c 100644 --- a/tests/test_installer.py +++ b/tests/test_installer.py @@ -26,7 +26,6 @@ from installer.hosts.base import install_host_assets from installer.hosts.claude import CLAUDE_ADAPTER from installer.hosts.codex import CODEX_ADAPTER -from installer.hosts.trae_cn import TRAE_CN_ADAPTER from installer.models import InstallError, InstallPhaseResult, InstallResult, parse_install_target from installer.outcome_contract import annotate_outcome_payload from installer.payload import ( @@ -1356,87 +1355,20 @@ def test_claude_en_installed_prompt_assets_keep_footer_contract(self) -> None: runtime_language="en-US", ) - def test_trae_cn_header_subdirectory_created(self) -> None: - with tempfile.TemporaryDirectory() as temp_dir: - home_root = Path(temp_dir) - - install_host_assets( - TRAE_CN_ADAPTER, - repo_root=REPO_ROOT, - home_root=home_root, - language_directory="CN", - ) - validate_host_install(TRAE_CN_ADAPTER, home_root=home_root) - - prompt_path = home_root / ".trae-cn" / "user_rules" / "sopify.md" - prompt = prompt_path.read_text(encoding="utf-8") - self.assertTrue(prompt_path.is_file()) - self.assertTrue(prompt.startswith("---\nalwaysApply: true\n---\n\n")) - self.assertIn("~/.trae-cn/sopify/payload-manifest.json", prompt) - self.assertIn("~/.trae-cn/sopify/helpers/bootstrap_workspace.py --workspace-root ", prompt) - - def test_trae_cn_en_installed_prompt_assets_keep_footer_contract(self) -> None: - self._assert_installed_footer_contract( - adapter=TRAE_CN_ADAPTER, - language_directory="EN", - next_template_line="Next: {Next step hint}", - footer_contract_line="- the footer does not display generated time; if a machine-auditable timestamp is needed, internal summary / replay artifacts may keep ISO 8601 timestamps with timezone data.", - runtime_language="en-US", - ) - - def test_trae_cn_install_does_not_affect_claude_codex(self) -> None: - with tempfile.TemporaryDirectory() as temp_dir: - home_root = Path(temp_dir) - - install_host_assets(CODEX_ADAPTER, repo_root=REPO_ROOT, home_root=home_root, language_directory="CN") - install_host_assets(CLAUDE_ADAPTER, repo_root=REPO_ROOT, home_root=home_root, language_directory="EN") - validate_host_install(CODEX_ADAPTER, home_root=home_root) - validate_host_install(CLAUDE_ADAPTER, home_root=home_root) - - codex_prompt_path = home_root / ".codex" / "AGENTS.md" - claude_prompt_path = home_root / ".claude" / "CLAUDE.md" - codex_prompt_before = codex_prompt_path.read_text(encoding="utf-8") - claude_prompt_before = claude_prompt_path.read_text(encoding="utf-8") - - install_host_assets( - TRAE_CN_ADAPTER, - repo_root=REPO_ROOT, - home_root=home_root, - language_directory="CN", - ) - - validate_host_install(TRAE_CN_ADAPTER, home_root=home_root) - validate_host_install(CODEX_ADAPTER, home_root=home_root) - validate_host_install(CLAUDE_ADAPTER, home_root=home_root) - self.assertEqual(codex_prompt_before, codex_prompt_path.read_text(encoding="utf-8")) - self.assertEqual(claude_prompt_before, claude_prompt_path.read_text(encoding="utf-8")) - class InstallRenderTests(unittest.TestCase): - def test_run_install_supports_trae_cn_target(self) -> None: + def test_run_install_rejects_retired_host_target(self) -> None: with tempfile.TemporaryDirectory() as temp_dir: home_root = Path(temp_dir) - resolved_home = home_root.resolve() - - result = run_install( - target_value="trae-cn:zh-CN", - workspace_value=None, - repo_root=REPO_ROOT, - home_root=home_root, - ) - - self.assertEqual(result.target.value, "trae-cn:zh-CN") - self.assertEqual(result.host_root, resolved_home / ".trae-cn") - self.assertEqual(result.payload_root, resolved_home / ".trae-cn" / "sopify") - self.assertIn(resolved_home / ".trae-cn" / "user_rules" / "sopify.md", result.host_install.paths) - self.assertIn( - resolved_home / ".trae-cn" / "skills" / "sopify" / "analyze" / "SKILL.md", - result.host_install.paths, - ) - self.assertIn(resolved_home / ".trae-cn" / "sopify" / "payload-manifest.json", result.payload_install.paths) - prompt = (resolved_home / ".trae-cn" / "user_rules" / "sopify.md").read_text(encoding="utf-8") - self.assertTrue(prompt.startswith("---\nalwaysApply: true\n---\n\n")) - self.assertIn("~/.trae-cn/sopify/payload-manifest.json", prompt) + retired_host = "tr" + "ae-cn" + + with self.assertRaisesRegex(InstallError, f"Unsupported host: {retired_host}"): + run_install( + target_value=f"{retired_host}:zh-CN", + workspace_value=None, + repo_root=REPO_ROOT, + home_root=home_root, + ) def test_bootstrap_helper_fallback_keeps_outcome_contract_in_sync(self) -> None: standalone_module = _load_module_without_repo_installer( diff --git a/tests/test_installer_status_doctor.py b/tests/test_installer_status_doctor.py index 35be781..d8edb45 100644 --- a/tests/test_installer_status_doctor.py +++ b/tests/test_installer_status_doctor.py @@ -17,7 +17,6 @@ from installer.hosts.base import install_host_assets from installer.hosts.claude import CLAUDE_ADAPTER from installer.hosts.codex import CODEX_ADAPTER -from installer.hosts.trae_cn import TRAE_CN_ADAPTER from installer.inspection import build_doctor_payload, build_status_payload, render_doctor_text, render_status_text from installer.payload import _REQUIRED_BUNDLE_CAPABILITIES, install_global_payload, run_workspace_bootstrap from installer.validate import validate_host_install, validate_payload_install @@ -113,76 +112,27 @@ class HostCapabilityRegistryTests(unittest.TestCase): def test_registry_returns_complete_capabilities_for_declared_hosts(self) -> None: codex = get_host_capability("codex") claude = get_host_capability("claude") - trae_cn = get_host_capability("trae-cn") self.assertEqual(codex.support_tier.value, "deep_verified") self.assertEqual(claude.support_tier.value, "deep_verified") - self.assertEqual(trae_cn.support_tier.value, "experimental") self.assertTrue(codex.install_enabled) self.assertTrue(claude.install_enabled) - self.assertTrue(trae_cn.install_enabled) self.assertIn("runtime_gate", [feature.value for feature in codex.verified_features]) self.assertIn("smoke_verified", [feature.value for feature in claude.verified_features]) - self.assertEqual( - [feature.value for feature in trae_cn.verified_features], - ["prompt_install", "payload_install"], - ) - self.assertIn("workspace_ingress_proof", trae_cn.doctor_checks) + + retired_host = "tr" + "ae-cn" + with self.assertRaisesRegex(ValueError, f"Unsupported host capability: {retired_host}"): + get_host_capability(retired_host) def test_installable_hosts_only_return_install_enabled_entries(self) -> None: installable = [capability.host_id for capability in iter_installable_hosts()] declared = [capability.host_id for capability in iter_declared_hosts()] - self.assertEqual(set(installable), {"codex", "claude", "trae-cn"}) - self.assertEqual(set(declared), {"codex", "claude", "trae-cn"}) + self.assertEqual(set(installable), {"codex", "claude"}) + self.assertEqual(set(declared), {"codex", "claude"}) class StatusDoctorContractTests(unittest.TestCase): - def test_trae_cn_status_and_doctor_with_workspace(self) -> None: - with tempfile.TemporaryDirectory() as home_dir, tempfile.TemporaryDirectory() as workspace_dir: - home_root = Path(home_dir) - workspace_root = Path(workspace_dir) - now = datetime(2026, 4, 13, 12, 0, tzinfo=timezone.utc) - - install_host_assets(TRAE_CN_ADAPTER, repo_root=REPO_ROOT, home_root=home_root, language_directory="CN") - install_global_payload(TRAE_CN_ADAPTER, repo_root=REPO_ROOT, home_root=home_root) - run_workspace_bootstrap(TRAE_CN_ADAPTER.payload_root(home_root), workspace_root) - _write_gate_receipt( - workspace_root, - ingress_mode="runtime_gate_enter", - written_at=now.isoformat(), - ) - - with mock.patch("installer.inspection._utc_now", return_value=now): - status_payload = build_status_payload(home_root=home_root, workspace_root=workspace_root) - trae_cn_host = next(host for host in status_payload["hosts"] if host["host_id"] == "trae-cn") - self.assertEqual(trae_cn_host["support_tier"], "experimental") - self.assertEqual(trae_cn_host["state"]["installed"], "yes") - self.assertEqual(trae_cn_host["state"]["configured"], "yes") - self.assertEqual(trae_cn_host["state"]["workspace_bundle_healthy"], "yes") - self.assertEqual(trae_cn_host["state"]["workspace_ingress_proof"], "yes") - self.assertEqual(trae_cn_host["payload_bundle"]["reason_code"], "PAYLOAD_BUNDLE_READY") - self.assertEqual( - trae_cn_host["workspace_ingress_proof"]["reason_code"], - "INGRESS_PROOF_GATE_ENTER_OBSERVED", - ) - - doctor_payload = build_doctor_payload(home_root=home_root, workspace_root=workspace_root) - ingress_check = next( - check - for check in doctor_payload["checks"] - if check["host_id"] == "trae-cn" and check["check_id"] == "workspace_ingress_proof" - ) - workspace_check = next( - check - for check in doctor_payload["checks"] - if check["host_id"] == "trae-cn" and check["check_id"] == "workspace_bundle_manifest" - ) - self.assertEqual(workspace_check["status"], "pass") - self.assertEqual(workspace_check["reason_code"], "STUB_SELECTED") - self.assertEqual(ingress_check["status"], "pass") - self.assertEqual(ingress_check["reason_code"], "INGRESS_PROOF_GATE_ENTER_OBSERVED") - def test_status_payload_supports_workspace_not_requested(self) -> None: with tempfile.TemporaryDirectory() as home_dir: home_root = Path(home_dir) diff --git a/tests/test_release_hooks.py b/tests/test_release_hooks.py index 1bdc660..308ed41 100644 --- a/tests/test_release_hooks.py +++ b/tests/test_release_hooks.py @@ -99,22 +99,6 @@ def _minimal_agents(version: str, *, claude: bool, english: bool) -> str: ) -def _minimal_trae_cn_rules(version: str, *, english: bool) -> str: - body = "Note: ~/.trae-cn/sopify/" if english else "说明:~/.trae-cn/sopify/" - return textwrap.dedent( - f"""\ - --- - alwaysApply: true - --- - - - # Sopify Rules - - {body} - """ - ) - - def _unreleased_body(changelog_text: str) -> str: start = changelog_text.index("## [Unreleased]") + len("## [Unreleased]") end = changelog_text.find("\n## [", start) @@ -164,11 +148,6 @@ def _init_release_hook_fixture(root: Path, *, missing_claude_targets: bool = Fal _write(root / "Claude/Skills/CN/skills/sopify/SKILL.md", "# skill\n") _write(root / "Claude/Skills/EN/skills/sopify/SKILL.md", "# skill\n") - _write(root / "TraeCn/Skills/CN/user_rules/sopify.md", _minimal_trae_cn_rules(old_version, english=False)) - _write(root / "TraeCn/Skills/EN/user_rules/sopify.md", _minimal_trae_cn_rules(old_version, english=True)) - _write(root / "TraeCn/Skills/CN/skills/sopify/SKILL.md", "# skill\n") - _write(root / "TraeCn/Skills/EN/skills/sopify/SKILL.md", "# skill\n") - _write(root / "runtime/gate.py", "print('baseline')\n") _write(root / "tests/test_runtime_gate.py", "print('baseline test')\n") @@ -355,7 +334,6 @@ def test_release_sync_auto_drafts_unreleased_before_version_bump(self) -> None: self.assertIn("badge/version-2026--03--21.010203-orange.svg", (root / "README.md").read_text(encoding="utf-8")) self.assertIn("", (root / "Codex/Skills/CN/AGENTS.md").read_text(encoding="utf-8")) self.assertIn("", (root / "Claude/Skills/CN/CLAUDE.md").read_text(encoding="utf-8")) - self.assertIn("", (root / "TraeCn/Skills/CN/user_rules/sopify.md").read_text(encoding="utf-8")) def test_release_draft_only_renders_non_empty_sections(self) -> None: with tempfile.TemporaryDirectory() as temp_dir: