Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/skills-zh/comet-build/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ bash "$COMET_STATE" set <name> 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。

Expand Down
6 changes: 3 additions & 3 deletions assets/skills-zh/comet/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ agent 做决策只需读本节,参考附录按需查阅。
| 多个 | `/comet`(无描述) | → 列出清单让用户选择 |

<IMPORTANT>
当用户选择「创建新变更」时,**必须调用 `/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`,导致后续阶段判定失败。
</IMPORTANT>

**Step 1: 读取 `.comet.yaml` 状态元数据**
Expand Down
2 changes: 1 addition & 1 deletion assets/skills/comet-build/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions assets/skills/comet/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

<IMPORTANT>
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.
</IMPORTANT>

**Preset detection**:
Expand Down
9 changes: 9 additions & 0 deletions assets/skills/comet/scripts/comet-guard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ build_passes() {
cargo build
return $?
fi
# 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里建议做一个最小修正:保留 Python fallback,但把它定位为 Python 的“字节码编译检查”,不要描述成完整 build 或 import/dependency 检查。

当前 python -m compileall . -q 能保证的是:仓库里的 Python 文件至少能被编译成 bytecode,也就是基本语法层面能过。它不能保证第三方依赖存在,也不能保证项目真正可运行,所以 PR 描述里的 “checks both syntax and import resolution” 需要改掉。

另外建议稍微收窄扫描范围,避免 compileall . 扫到虚拟环境或构建产物。最小可接受修改是排除常见目录,例如 .venvvenv__pycache__builddist

需要补的测试:

  • pyproject.toml / requirements.txt.py 文件语法正确时,guard 通过
  • 有 Python marker 但 .py 语法错误时,guard 失败
  • .venv / venv 里的坏 .py 不影响 guard
  • 已配置 build_command 时优先执行 build_command,不走 Python fallback

return $?
fi
fi
return 1
}

Expand Down
Loading