Skip to content

feat: add auto transition config#74

Open
Ninzero wants to merge 8 commits into
rpamis:masterfrom
Ninzero:feat/toggle-auto-transition
Open

feat: add auto transition config#74
Ninzero wants to merge 8 commits into
rpamis:masterfrom
Ninzero:feat/toggle-auto-transition

Conversation

@Ninzero
Copy link
Copy Markdown

@Ninzero Ninzero commented Jun 5, 2026

✨ Summary

根据 Issue #65 修改. 为 Skill 间的自动流转添加配置项, 默认开启自动流转, 当 auto_transition 参数为 false 时, 仅打印提示用户进入下一阶段的指令.

用户可以在 openspec 目录下新增 comet.yaml 文件作为项目级配置. 每次创建新的 change 时, 会从 openspec/comet.yaml 中尝试读取 auto_transition 配置并写入本次 change 的 .comet.yaml 文件中. 如果不存在 openspec/comet.yaml 文件, 文件中找不到 auto_transition 配置, 或是 auto_transition 配置了 false 以外的值, 默认均会视为 auto_transition=true

🎯 Scope

  • CLI commands (init, status, doctor, update)
  • Core installer / platform detection
  • Comet skills (assets/skills/, assets/skills-zh/)
  • Comet shell scripts (assets/skills/comet/scripts/)
  • Tests / CI
  • Documentation / changelog
  • Other:

🧪 Testing

  • pnpm build
  • pnpm lint
  • pnpm format:check
  • pnpm test
  • pnpm test -- test/ts/comet-scripts.test.ts
  • pnpm test:shell
  • Not run:

✅ Checklist

  • PR title follows Conventional Commits, for example fix: handle project-scope init
  • User-facing behavior is documented in README.md, README-zh.md, or CONTRIBUTING.md
  • CHANGELOG.md is updated when behavior changes
  • Skill changes were made in Chinese first when applicable, then synced to English
  • New scripts are included in assets/manifest.json and relevant tests
  • Shell scripts remain portable across macOS, Linux, and Windows Git Bash
  • No unrelated generated files or local artifacts are included

👀 Notes for Reviewers

  • 我不确定 openspec/ 目录是否是放置 comet 项目级配置的合适位置? 但为此专门新增 comet 文件夹似乎有些多余
  • 我对于 CHANGELOG.md 如何更新有些疑虑, 我不确定是应该放在 0.3.6 的更新日志中还是新增 0.3.7 版本号?

Summary by CodeRabbit

  • New Features

    • Introduced auto_transition option to control automatic workflow phase progression (enabled by default); when disabled, workflows stop after a phase and require manual next-phase commands.
  • Documentation

    • Updated English and Chinese workflow docs to describe conditional auto-transition, required checks after phase guards, and manual continuation instructions.
  • Tests

    • Added regression coverage for auto_transition behaviors and related state/validation flows.
  • Chores

    • Added ignore rule to exclude local tooling directory from version control.

Ninzero and others added 7 commits June 3, 2026 23:21
Add a Change-level auto_transition setting copied from openspec/comet.yaml so Chinese Comet skills can pause before invoking the next phase while preserving state transitions.

Cover initialization defaults, state validation, YAML schema checks, and skill text safeguards for manual flow.

Co-Authored-By: Codex <noreply@openai.com>
Let scale assessment continue when a plan omits base-ref so it can use the Change base_ref fallback instead of exiting under pipefail.

Add a regression test covering committed changes with a plan file that lacks base-ref metadata.

Co-Authored-By: Codex <noreply@openai.com>
Archive the completed add-auto-transition-config change and sync its accepted requirements into the main comet-auto-transition spec.

Refs add-auto-transition-config

Co-Authored-By: Codex <noreply@openai.com>
Document the auto_transition manual-flow behavior in English Comet skills and add English safeguard assertions so future changes cannot drop the instructions.

Co-Authored-By: Codex <noreply@openai.com>
Document the auto-transition configuration and manual continuation behavior.

Also capture the scale fallback fix and related test coverage.

Co-Authored-By: Codex <noreply@openai.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Complex PR? Review this PR in Change Stack to move by importance, not file order.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cfd23fee-eed1-44a3-bd82-c46502ffa907

📥 Commits

Reviewing files that changed from the base of the PR and between 04915c4 and c22f446.

📒 Files selected for processing (1)
  • assets/skills-zh/comet/SKILL.md
✅ Files skipped from review due to trivial changes (1)
  • assets/skills-zh/comet/SKILL.md

📝 Walkthrough

Walkthrough

This PR introduces auto_transition, a new state field controlling automatic phase progression in the Comet workflow. When set to false, phases complete without invoking the next skill; users must manually continue. The change adds schema validation, init/default handling, docs updates (EN/ZH), and tests.

Changes

auto_transition State Control for Comet Workflow Phases

Layer / File(s) Summary
Schema validation and required field enforcement
assets/skills/comet/scripts/comet-yaml-validate.sh
Adds auto_transition to required fields with a new validate_required_enum helper that rejects empty/null values, ensuring .comet.yaml files validate correctly with the mandatory boolean field.
State initialization and default computation
assets/skills/comet/scripts/comet-state.sh
Implements project_auto_transition_default() to read and normalize auto_transition from openspec/comet.yaml, defaulting to true. The init command writes this value to .comet.yaml, and set validates updates. Also fixes base_ref fallback when plan lacks base-ref:.
Core Comet workflow control documentation
assets/skills/comet/SKILL.md, assets/skills-zh/comet/SKILL.md
Main Comet skill docs now specify that after phase guard --apply, the workflow must read auto_transition and conditionally invoke the next skill. Includes example state with the new field and field reference table describing the control behavior.
Phase skill documentation with conditional transitions
assets/skills/comet-{open,design,build,verify,hotfix,tweak}/SKILL.md, assets/skills-zh/comet-{open,design,build,verify,hotfix,tweak}/SKILL.md
All six phase skills are updated to read auto_transition after exiting their phase. When false, they print the appropriate next manual command instead of invoking the next skill. Both English and Chinese versions are synchronized.
Test coverage for initialization and validation
test/ts/comet-scripts.test.ts
New test cases verify auto_transition defaults to true when config is absent, propagates when explicitly false, rejects invalid values, and handles omitted fields. Existing test fixtures are updated to include auto_transition: true throughout.
Test assertions for manual-mode behavior
test/ts/skills.test.ts
Skills safeguards tests are extended to validate that AUTO_TRANSITION=false triggers manual-mode paths with correct next phase commands and state-update messaging across all phase transitions.
Changelog and configuration
CHANGELOG.md, .gitignore
Documents new fields and related fixes. Adds .codex/ directory to version control exclusions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through docs and schema trees,
I nudged each phase with gentle ease,
When auto_transition says "no", we wait,
You type the next /comet- command to navigate,*
English, Chinese guides aligned—hop, celebrate!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add auto transition config' accurately and clearly describes the main change—introducing a new auto_transition configuration feature for controlling automatic skill phase transitions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
assets/skills-zh/comet/SKILL.md (1)

201-201: ⚡ Quick win

Align auto_transition semantics with the English contract.

This line should also state that the value is copied from openspec/comet.yaml during init (fallback true), not only that default is true, to avoid EN/ZH behavior drift.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@assets/skills-zh/comet/SKILL.md` at line 201, Update the `auto_transition`
description in assets/skills-zh/comet/SKILL.md (the `auto_transition` row) to
match the English contract: state that the value is copied from
openspec/comet.yaml during initialization (with a fallback of `true`) rather
than merely saying the default is `true`, and keep the existing note that it
accepts `true` 或 `false` and controls whether the next Skill is automatically
invoked after a phase advances.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@assets/skills-zh/comet/SKILL.md`:
- Line 201: Update the `auto_transition` description in
assets/skills-zh/comet/SKILL.md (the `auto_transition` row) to match the English
contract: state that the value is copied from openspec/comet.yaml during
initialization (with a fallback of `true`) rather than merely saying the default
is `true`, and keep the existing note that it accepts `true` 或 `false` and
controls whether the next Skill is automatically invoked after a phase advances.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cb2195c-f718-4f82-899c-52a73a550bfc

📥 Commits

Reviewing files that changed from the base of the PR and between 5e8a6d7 and 04915c4.

📒 Files selected for processing (20)
  • .gitignore
  • CHANGELOG.md
  • assets/skills-zh/comet-build/SKILL.md
  • assets/skills-zh/comet-design/SKILL.md
  • assets/skills-zh/comet-hotfix/SKILL.md
  • assets/skills-zh/comet-open/SKILL.md
  • assets/skills-zh/comet-tweak/SKILL.md
  • assets/skills-zh/comet-verify/SKILL.md
  • assets/skills-zh/comet/SKILL.md
  • assets/skills/comet-build/SKILL.md
  • assets/skills/comet-design/SKILL.md
  • assets/skills/comet-hotfix/SKILL.md
  • assets/skills/comet-open/SKILL.md
  • assets/skills/comet-tweak/SKILL.md
  • assets/skills/comet-verify/SKILL.md
  • assets/skills/comet/SKILL.md
  • assets/skills/comet/scripts/comet-state.sh
  • assets/skills/comet/scripts/comet-yaml-validate.sh
  • test/ts/comet-scripts.test.ts
  • test/ts/skills.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant