From 96511a8ed08531b3e5492f8399fe70a2f82a490b Mon Sep 17 00:00:00 2001 From: AnnanRen Date: Sun, 24 May 2026 19:09:58 +0800 Subject: [PATCH 1/2] fix: add Python build detection, correct stale /opsx:new references - Add Python project detection in build_passes() via compileall - Replace all /opsx:new references with actual comet/openspec skill names across EN and ZH skill docs Co-Authored-By: Claude Opus 4.7 --- assets/skills-zh/comet-build/SKILL.md | 2 +- assets/skills-zh/comet/SKILL.md | 6 +++--- assets/skills/comet-build/SKILL.md | 2 +- assets/skills/comet/SKILL.md | 6 +++--- assets/skills/comet/scripts/comet-guard.sh | 7 +++++++ 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/assets/skills-zh/comet-build/SKILL.md b/assets/skills-zh/comet-build/SKILL.md index d07a989d..fde93932 100644 --- a/assets/skills-zh/comet-build/SKILL.md +++ b/assets/skills-zh/comet-build/SKILL.md @@ -142,7 +142,7 @@ bash "$COMET_STATE" set build_mode direct |------|---------|------| | 小 | 遗漏验收场景、边界条件 | 直接编辑 delta spec + design.md,追加 tasks.md 任务 | | 中 | 接口变更、新增组件、数据流变化 | 重新 `superpowers:brainstorming` 更新 Design Doc + delta spec | -| 大 | 全新 capability 需求 | `/opsx:new` 创建独立 change | +| 大 | 全新 capability 需求 | `/comet-open` 创建独立 change | **50% 阈值判定**:以 tasks.md 初始任务总数为基准,若新增任务数超过该总数的一半,视为超出原计划范围,应考虑拆分为新 change。 diff --git a/assets/skills-zh/comet/SKILL.md b/assets/skills-zh/comet/SKILL.md index f66ef03e..3e11ec1e 100644 --- a/assets/skills-zh/comet/SKILL.md +++ b/assets/skills-zh/comet/SKILL.md @@ -41,9 +41,9 @@ agent 做决策只需读本节,参考附录按需查阅。 | 多个 | `/comet`(无描述) | → 列出清单让用户选择 | -当用户选择「创建新变更」时,**必须调用 `/comet-open`**(禁止直接调用 `/opsx:new`)。 -`/comet-open` 负责完整双初始化:OpenSpec artifacts(由内部 `/opsx:new` 创建)+ `.comet.yaml` 状态文件。 -直接调用 `/opsx:new` 会缺失 `.comet.yaml`,导致后续阶段判定失败。 +当用户选择「创建新变更」时,**必须调用 `/comet-open`**(禁止直接调用 `openspec-new-change` 或 `openspec-propose` skill)。 +`/comet-open` 负责完整双初始化:OpenSpec artifacts(由内部 `openspec-new-change` 或 `openspec-propose` skill 创建)+ `.comet.yaml` 状态文件。 +直接调用 openspec skill 会缺失 `.comet.yaml`,导致后续阶段判定失败。 **Step 1: 读取 `.comet.yaml` 状态元数据** diff --git a/assets/skills/comet-build/SKILL.md b/assets/skills/comet-build/SKILL.md index b3513108..95f8b5f8 100644 --- a/assets/skills/comet-build/SKILL.md +++ b/assets/skills/comet-build/SKILL.md @@ -142,7 +142,7 @@ When the initial spec is found incomplete during implementation, handle by scale |------|-------------------|----------| | Small | Missing acceptance scenarios, edge cases | Directly edit delta spec + design.md, append tasks.md tasks | | Medium | Interface changes, new components, data flow changes | Re-run `superpowers:brainstorming` to update Design Doc + delta spec | -| Large | Brand-new capability requirements | `/opsx:new` to create independent change | +| Large | Brand-new capability requirements | `/comet-open` to create independent change | **50% Threshold Determination**: Using initial task count in tasks.md as baseline, if new tasks exceed half of that total, it's considered outside original plan scope, should consider splitting into new change. diff --git a/assets/skills/comet/SKILL.md b/assets/skills/comet/SKILL.md index 86427464..f8333813 100644 --- a/assets/skills/comet/SKILL.md +++ b/assets/skills/comet/SKILL.md @@ -35,9 +35,9 @@ Agents need only read this section for decision-making. Refer to the Reference A | Multiple | `/comet` with no description | → List changes for user selection | -When the user chooses "create a new change", **must invoke `/comet-open`**. Do not call `/opsx:new` directly. -`/comet-open` performs dual initialization: OpenSpec artifacts plus `.comet.yaml` state. -Calling `/opsx:new` directly leaves `.comet.yaml` missing and breaks later phase detection. +When the user chooses "create a new change", **must invoke `/comet-open`**. Do not call `openspec-new-change` or `openspec-propose` skill directly. +`/comet-open` performs dual initialization: OpenSpec artifacts (via `openspec-new-change` or `openspec-propose` skill) plus `.comet.yaml` state. +Calling openspec skills directly leaves `.comet.yaml` missing and breaks later phase detection. **Preset detection**: diff --git a/assets/skills/comet/scripts/comet-guard.sh b/assets/skills/comet/scripts/comet-guard.sh index cbaea2bd..783d0381 100644 --- a/assets/skills/comet/scripts/comet-guard.sh +++ b/assets/skills/comet/scripts/comet-guard.sh @@ -276,6 +276,13 @@ build_passes() { cargo build return $? fi + # Python project detection (compileall checks syntax + import resolution) + if command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1; then + local py_cmd + py_cmd="$(command -v python3 >/dev/null 2>&1 && echo 'python3' || echo 'python')" + "$py_cmd" -m compileall . -q + return $? + fi return 1 } From 880e18f8f247d6ade3ab8f7c2521caaa564707da Mon Sep 17 00:00:00 2001 From: AnnanRen Date: Sun, 24 May 2026 19:15:34 +0800 Subject: [PATCH 2/2] fixup: add Python project markers gate, correct comment - Gate Python detection behind project markers (pyproject.toml, setup.py, setup.cfg, requirements.txt) to prevent false positives on non-Python projects that happen to have Python installed - Correct comment: compileall checks syntax, not external import resolution Co-Authored-By: Claude Opus 4.7 --- assets/skills/comet/scripts/comet-guard.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/skills/comet/scripts/comet-guard.sh b/assets/skills/comet/scripts/comet-guard.sh index 783d0381..8cb46ba4 100644 --- a/assets/skills/comet/scripts/comet-guard.sh +++ b/assets/skills/comet/scripts/comet-guard.sh @@ -276,12 +276,14 @@ build_passes() { cargo build return $? fi - # Python project detection (compileall checks syntax + import resolution) - if command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1; then - local py_cmd - py_cmd="$(command -v python3 >/dev/null 2>&1 && echo 'python3' || echo 'python')" - "$py_cmd" -m compileall . -q - return $? + # Python project detection: require a project marker to avoid false positives + if [ -f "pyproject.toml" ] || [ -f "setup.py" ] || [ -f "setup.cfg" ] || [ -f "requirements.txt" ]; then + if command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1; then + local py_cmd + py_cmd="$(command -v python3 >/dev/null 2>&1 && echo 'python3' || echo 'python')" + "$py_cmd" -m compileall . -q + return $? + fi fi return 1 }