feat: 压缩 CLAUDE.md snippet 并在 apply 前强制询问用户#1
Open
akarizo wants to merge 2 commits into
Open
Conversation
把上游 OpenCode 模板迁移为 Claude Code 项目级安装器:
- .opencode/commands/*.md → template/.claude/commands/ (9 个 opsx-*)
- .opencode/skills/* → template/.claude/skills/ (9 个 openspec-*)
- .agents/skills/* → template/.claude/skills/ (5 个共享 skill)
- openspec/ → template/openspec/ (schema 内嵌可离线验证)
- 新增 template/openspec/changes/.gitkeep 让 openspec list 直接可用
删除上游 OpenCode 专属文件:
- opencode.json (Claude Code 不需要插件配置)
- AGENTS.md (OpenCode 专用)
- skills-lock.json (Claude Code 用户自行装 superpowers)
新增:
- install.sh: 双模式安装器 (本地 ./install.sh / curl pipe | bash)
- 幂等: 已存在文件 [skip] 不覆盖
- 自动建创目标目录
- openspec CLI 前置检查
- CLAUDE.md marker 块注入 (再装跳过, 已有 CLAUDE.md 安全追加)
- BSD/GNU find 双兼容 (macOS / Linux 均可)
- template/CLAUDE.md.snippet: 中文 workflow 简介, 9 命令速查, git 纪律
- README.md: 中文双安装入口, 与上游差异对照
- docs/WORKFLOW_zh.md: 5 阶段详解 + 端到端示例
- LICENSE: MIT, 保留上游归属
- CLAUDE.md.snippet 从 58 行压到 35 行,丢掉 CLI 详细命令、artifact 长描述、 skills 清单(这些在 .claude/skills/ 自查),保留 5-artifact 流程 + 命令表 + git 纪律。同时在 /opsx-apply 和 /opsx-bulk-apply 行标注开始前会确认。 - opsx-apply 命令与 openspec-apply-change skill 在 step 5(show progress)和 原 step 6(implement loop)之间插入新 step 6 MANDATORY confirm,用 AskUserQuestion 给 3 个选项:确认开始 / 先看完整 tasks / 取消。 guardrail 增加"必须先确认"。bulk-apply 派发的子 agent 显式 skip 此步。 - opsx-bulk-apply 命令与 skill 在创建 worktree 前加批量级一次性确认, 避免每个 subagent 单独问;子 agent 跳过自己的 per-change 确认。
Member
|
Thank you for the PR @akarizo . I will take a look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
template/CLAUDE.md.snippet58 → 35 行:保留 5-artifact 流程 + 命令表 + git 纪律;丢掉 CLI 详细命令、artifact 长描述、skills 清单(自查.claude/skills/)。opsx-apply命令与openspec-apply-changeskill 在 step 5 之后插入 MANDATORY step 6:用AskUserQuestion让用户在写代码前显式确认(确认开始/先看完整 tasks/取消),后续步骤号递推。opsx-bulk-apply命令与 skill 在创建 worktree 前加一次性批量级确认;子 agent 跳过 per-change 确认。Test plan
./install.sh /tmp/idt-smoke验证 snippet 注入和 marker 幂等openspec schema validate intent-driven仍通过/opsx-apply <change>,确认 step 6 会弹出 AskUserQuestion 三选项/opsx-bulk-apply只在父级问一次,子 agent 不再重复问