Skip to content

feat: recommend lightweight Comet workflow paths - #248

Open
googs1025 wants to merge 3 commits into
rpamis:masterfrom
googs1025:feature/20260729/recommend-lightweight-workflow-paths-pr
Open

feat: recommend lightweight Comet workflow paths#248
googs1025 wants to merge 3 commits into
rpamis:masterfrom
googs1025:feature/20260729/recommend-lightweight-workflow-paths-pr

Conversation

@googs1025

@googs1025 googs1025 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add classic.workflow_intensity and typed Classic intent recommendation metadata for lightweight workflow suggestions.
  • Require /comet-open to present tweak/hotfix/full choices before continuing the full workflow.
  • Cover config parsing, route scoring, Skill contracts, runtime asset consistency, and Classic runtime CLI behavior.

Closes #213

Test Plan

  • npx vitest run test/domains/comet-classic/classic-intent.test.ts test/domains/comet-classic/classic-project-config.test.ts test/domains/comet-classic/classic-runtime.test.ts test/domains/skill/workflow-optimization-contract.test.ts test/domains/skill/skills.test.ts
  • pnpm run check:generated
  • pnpm lint
  • pnpm build
  • GitHub CI: Quality and coverage, Node 22 compatibility, runtime smoke, package install, security, and required checks passed.

Summary by CodeRabbit

  • New Features
    • Added configurable Classic workflow intensity: light, standard, or thorough.
    • Classic can now recommend lightweight tweak or hotfix workflows for suitable low-risk requests.
    • Recommendations include reasons and require explicit confirmation before continuing.
  • Workflow Improvements
    • Open workflows now present lightweight recommendations before creating artifacts.
    • Improved requirement and change-name resolution flow in English and Chinese.
  • Documentation
    • Updated configuration examples and workflow guidance.
  • Release
    • Updated version to 0.4.0-beta.11.

@sourcery-ai

sourcery-ai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a configurable Classic workflow intensity and typed lightweight route recommendations to the Comet intent runtime, wires that configuration into the Classic CLI and generated runtimes, and updates the /comet-open skill contracts and tests so small, low‑risk requests can choose tweak/hotfix before proceeding with full OpenSpec workflows.

Sequence diagram for lightweight workflow recommendation and confirmation

sequenceDiagram
  actor User
  participant CometClassicCLI as comet-classic
  participant ProjectConfig as readClassicWorkflowIntensity
  participant IntentRuntime as resolveCometIntentRoute
  participant CometOpenSkill as /comet-open

  User->>CometClassicCLI: classic-intent route (JSON input)
  CometClassicCLI->>CometClassicCLI: withConfiguredWorkflowIntensity(input)
  CometClassicCLI->>ProjectConfig: readClassicWorkflowIntensity()
  ProjectConfig-->>CometClassicCLI: ClassicWorkflowIntensityValue
  CometClassicCLI->>IntentRuntime: resolveCometIntentRoute(input+workflow_intensity)
  IntentRuntime-->>CometClassicCLI: CometIntentRoute{recommendation}
  CometClassicCLI-->>User: route + recommendation metadata

  User->>CometOpenSkill: start full /comet-open
  CometOpenSkill->>CometOpenSkill: [has recommendation]
  CometOpenSkill-->>User: present tweak/hotfix/full options
  User-->>CometOpenSkill: choose workflow
  CometOpenSkill->>CometOpenSkill: run openspec new change (only after confirmation)
Loading

File-Level Changes

Change Details Files
Introduce classic.workflow_intensity configuration and surface it in project config tooling and docs.
  • Add workflow_intensity enum and typed helper that reads the nested classic block, defaults to standard, and rejects invalid values.
  • Expose workflow_intensity comments in workflow contract project config comments for both English and Chinese.
  • Include workflow_intensity in managed Classic config fields rendered by platform-install so new projects get a default field.
  • Document workflow_intensity in README examples and CHANGELOG to describe tuning of lightweight recommendation aggressiveness.
domains/comet-classic/classic-project-config.ts
domains/workflow-contract/project-config.ts
domains/skill/platform-install.ts
assets/skills/comet-native/scripts/comet-native-runtime.mjs
README.md
README-zh.md
CHANGELOG.md
Extend the Classic intent model and routing logic to compute lightweight workflow recommendations based on risk signals, scope, and workflow_intensity.
  • Add workflow_intensity to the intent context and a CometIntentRecommendation type on routes, plus recommendation null-initialization in validation.
  • Implement helper functions that detect small-scope evidence and low-risk utterances, and a recommendationFor function that returns tweak or hotfix metadata when appropriate.
  • Change route construction so requires_confirmation is driven by presence of a recommendation as well as ask_user/out_of_scope, and add recommendation as a route field.
  • Update resolveCometIntentRoute to use recommendationFor when user_explicit_workflow is absent, prefer full routes with recommendation, keep risk signals conservative, and normalize diagnostics to include recommendation changes.
domains/comet-classic/classic-intent.ts
assets/skills/comet/scripts/comet-runtime.mjs
test/domains/comet-classic/classic-intent.test.ts
Plumb workflow_intensity from Classic project config into the classic intent CLI so frames without an explicit intensity still honor project defaults.
  • Add a small isRecord helper and withConfiguredWorkflowIntensity function that merges configured intensity into the input context when missing.
  • Update classicIntentCommand to wrap parsed JSON input with withConfiguredWorkflowIntensity before resolving routes, and to treat generic Error as a CLI failure with a message.
  • Add tests that create a temporary project with a .comet/config.yaml defining classic.workflow_intensity and assert that classicIntentCommand routes use the configured intensity in normalized frames.
domains/comet-classic/classic-intent-command.ts
assets/skills/comet/scripts/comet-runtime.mjs
test/domains/comet-classic/classic-intent.test.ts
Update /comet-open skill contracts so the agent confirms lightweight path recommendations before creating OpenSpec artifacts, and renumber downstream steps.
  • Insert a new Lightweight Path Recommendation Confirmation section ahead of PRD split in both English and Chinese SKILL docs, describing the mutually exclusive tweak/hotfix/full options and prohibiting automatic downgrades or early artifact creation.
  • Shift the existing PRD split preflight and requirements/name resolution sections from 1a/1b to 1b/1c, and update all step references and guarding language accordingly.
  • Extend skill contract tests to assert that the new lightweight confirmation section exists, appears before any openspec new change mention, and that headings and step numbers in both languages match expectations.
assets/skills/comet-open/SKILL.md
assets/skills-zh/comet-open/SKILL.md
test/domains/skill/workflow-optimization-contract.test.ts
test/domains/skill/skills.test.ts
Regenerate runtime bundles and add design/plan documentation for the lightweight workflow recommendation feature.
  • Regenerate the Classic runtime and Native runtime bundles to reflect new config comments, workflow_intensity defaults, recommendation routing, and CLI behavior.
  • Adjust resume probe helper naming in the generated Classic runtime to avoid identifier collisions after adding new helpers.
  • Add a technical design spec and an execution plan document under docs/superpowers to capture the architecture, rules, and implementation tasks for lightweight path recommendations.
assets/skills/comet/scripts/comet-runtime.mjs
assets/skills/comet-native/scripts/comet-native-runtime.mjs
docs/superpowers/plans/2026-07-29-recommend-lightweight-workflow-paths.md
docs/superpowers/specs/2026-07-29-recommend-lightweight-workflow-paths-design.md

Assessment against linked issues

Issue Objective Addressed Explanation
#213 Implement Comet intent/runtime logic to detect small, low-risk tasks and attach lightweight workflow recommendations (tweak/hotfix vs full), influenced by classic.workflow_intensity, while keeping high-risk or unclear tasks on the full workflow.
#213 Update Comet Open workflow/skills and configuration to surface a user confirmation point for lightweight path recommendations before creating OpenSpec artifacts, including adding the classic.workflow_intensity config option and corresponding documentation.
#213 Add automated tests covering lightweight recommendation behavior across light/standard/thorough workflow_intensity settings and key boundary/risk scenarios.

Possibly linked issues

  • #(untracked/none): PR directly implements the issue’s lightweight path recommendation design, including workflow_intensity config, routing logic, and open-phase confirmation.
  • #(none provided): PR fully implements the issue’s workflow_intensity config and corresponding lightweight workflow recommendation behavior and validations.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Classic gains configurable workflow intensity and typed lightweight route recommendations. Routing now returns confirmation metadata for eligible low-risk requests, while risk signals retain full workflow handling. The Open skill adds a blocking recommendation choice before artifact creation in English and Chinese.

Changes

Lightweight workflow recommendations

Layer / File(s) Summary
Workflow intensity configuration
domains/comet-classic/classic-project-config.ts, domains/skill/platform-install.ts, domains/workflow-contract/project-config.ts, assets/skills/comet/scripts/comet-runtime.mjs, assets/skills/comet-native/scripts/comet-native-runtime.mjs, README*
Adds light, standard, and thorough configuration support, default rendering, validation, localized comments, runtime documentation, and examples.
Intent recommendation runtime
domains/comet-classic/classic-intent.ts, domains/comet-classic/classic-intent-command.ts, assets/skills/comet/scripts/comet-runtime.mjs
Adds typed recommendation metadata, intensity-aware eligibility, risk suppression, normalized full routes, confirmation requirements, diagnostics, configuration injection, and command error handling.
Open confirmation contract
assets/skills/comet-open/SKILL.md, assets/skills-zh/comet-open/SKILL.md
Adds a blocking lightweight-path choice before OpenSpec artifact creation and renumbers subsequent Open steps through Step 1c.
Routing and contract validation
test/domains/comet-classic/*, test/domains/skill/*, CHANGELOG.md, assets/manifest.json
Updates routing, configuration, bilingual skill-contract, integration, release-version, and changelog coverage for the new behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant comet-classic
  participant ClassicConfig
  participant IntentResolver
  participant comet-open
  User->>comet-classic: submit intent route
  comet-classic->>ClassicConfig: read workflow_intensity
  ClassicConfig-->>comet-classic: configured intensity or standard
  comet-classic->>IntentResolver: resolve intent with intensity
  IntentResolver-->>comet-classic: full route with recommendation and confirmation
  comet-classic-->>User: present recommendation options
  User->>comet-open: choose tweak, hotfix, or full
  comet-open-->>User: continue after explicit confirmation
Loading

Suggested reviewers: benym

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly summarizes the main change: recommending lightweight Comet workflow paths.
Linked Issues check ✅ Passed The PR implements lightweight-path recommendations, explicit user confirmation, workflow_intensity handling, and tests covering the requested behavior.
Out of Scope Changes check ✅ Passed The doc, changelog, manifest, runtime, skill, and test updates all support the lightweight workflow recommendation feature.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The WORKFLOW_INTENSITIES constants are now defined in multiple modules and generated runtimes; consider centralizing the definition in one source module and reusing it to reduce divergence risk between TypeScript and bundled runtime code.
  • The lowRiskEvidence regex currently triggers on generic words like small even when combined with riskier contexts (e.g., "small migration"); if this is too permissive long-term, consider tightening the pattern or adding more field-specific checks so that textual low-risk hints don’t overrule nuanced intent in future extensions.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `WORKFLOW_INTENSITIES` constants are now defined in multiple modules and generated runtimes; consider centralizing the definition in one source module and reusing it to reduce divergence risk between TypeScript and bundled runtime code.
- The `lowRiskEvidence` regex currently triggers on generic words like `small` even when combined with riskier contexts (e.g., "small migration"); if this is too permissive long-term, consider tightening the pattern or adding more field-specific checks so that textual low-risk hints don’t overrule nuanced intent in future extensions.

## Individual Comments

### Comment 1
<location path="domains/comet-classic/classic-intent.ts" line_range="420-424" />
<code_context>
+  return null;
+}
+
 function route(
   name: CometIntentRouteName,
   confidence: number,
   fallback_reason: string | null = null,
+  recommendation: CometIntentRecommendation | null = null,
 ): CometIntentRoute {
   const nextSkill: Record<CometIntentRouteName, CometIntentNextSkill | null> = {
</code_context>
<issue_to_address>
**issue (bug_risk):** route no longer returns the constructed CometIntentRoute object

This change removes the `CometIntentRoute` return value, so callers like `resolveCometIntentRoute` now receive `undefined` and will throw when accessing properties such as `resolved.name` or `resolved.recommendation`. Please restore the `return { ... }` for the constructed route object to preserve existing behavior.
</issue_to_address>

### Comment 2
<location path="assets/skills/comet/scripts/comet-runtime.mjs" line_range="12866-12869" />
<code_context>
-function route(name, confidence, fallback_reason = null) {
</code_context>
<issue_to_address>
**issue (bug_risk):** Runtime route helper also drops the return value, mirroring the TS bug

In the compiled runtime `route` helper, the constructed route object is not returned, so calls from `resolveCometIntentRoute` will receive `undefined` and trigger runtime errors when accessing its properties. Please update the runtime implementation to return the constructed route object, consistent with the TypeScript version.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread domains/comet-classic/classic-intent.ts
Comment thread assets/skills/comet/scripts/comet-runtime.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
domains/comet-classic/classic-intent.ts (1)

453-520: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

workflow_intensity: 'thorough' can bypass the new confirmation gate via legacy direct-routing branches. Both sites share one root cause: the fix_bug→hotfix and make_tweak→tweak legacy branches in resolveCometIntentRoute never check workflow_intensity, so when recommendationFor suppresses a recommendation under 'thorough' + weak evidence, these older branches still match on evidence alone and route directly to hotfix/tweak without confirmation — the opposite of "thorough: recommend the full workflow unless the task is clearly small".

  • domains/comet-classic/classic-intent.ts#L453-L520: gate the fix_bug/make_tweak/generic workflow_candidate evidence-based branches on frame.context.workflow_intensity !== 'thorough', falling through to a full route otherwise; add tests for thorough + non-small fix_bug/make_tweak + workflow_candidate evidence.
  • assets/skills/comet/scripts/comet-runtime.mjs#L12977-L12986: regenerate this bundle from the corrected TS source via the project's build step once the above fix lands; do not patch the generated file directly.
🤖 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 `@domains/comet-classic/classic-intent.ts` around lines 453 - 520, Update
resolveCometIntentRoute in domains/comet-classic/classic-intent.ts#L453-L520 so
the fix_bug→hotfix, make_tweak→tweak, and generic workflow_candidate evidence
branches only apply when frame.context.workflow_intensity is not 'thorough';
otherwise fall through to the full-workflow route, and add coverage for thorough
non-small fix_bug/make_tweak cases with workflow_candidate evidence. Regenerate
assets/skills/comet/scripts/comet-runtime.mjs#L12977-L12986 using the project
build step; do not edit the generated bundle directly.
🤖 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.

Inline comments:
In `@assets/skills/comet-open/SKILL.md`:
- Around line 55-66: Update the Step 1a lightweight recommendation confirmation
in assets/skills/comet-open/SKILL.md lines 55-66 to derive the presented choices
directly from recommendation.options, preserving each option’s existing switch
behavior and requiring the decision pause before artifact creation. Apply the
same synchronized guidance in assets/skills-zh/comet-open/SKILL.md lines 55-66;
do not hardcode or independently infer tweak/hotfix availability.

In `@docs/superpowers/plans/2026-07-29-recommend-lightweight-workflow-paths.md`:
- Line 3: 修正文档中的 design-doc 相对路径:将 `design-doc` 配置值从带有 `comet/` 前缀的路径更新为仓库内实际的
`docs/superpowers/specs/2026-07-29-recommend-lightweight-workflow-paths-design.md`,其余内容保持不变。

In `@test/domains/comet-classic/classic-project-config.test.ts`:
- Around line 69-91: Update the workflow_intensity tests around
readClassicWorkflowIntensity to use one parameterized case covering explicit
light, standard, and thorough values, asserting each value is returned with
source .comet/config.yaml. Keep the separate absent-value default assertion and
invalid-value rejection test, while removing the redundant light-only test.

In `@test/domains/skill/workflow-optimization-contract.test.ts`:
- Around line 56-59: Update the ordering assertions in the workflow optimization
test to also verify that skill.indexOf(guard) is less than
skill.indexOf('openspec new change'). Keep the existing heading presence and
ordering assertions unchanged.

---

Outside diff comments:
In `@domains/comet-classic/classic-intent.ts`:
- Around line 453-520: Update resolveCometIntentRoute in
domains/comet-classic/classic-intent.ts#L453-L520 so the fix_bug→hotfix,
make_tweak→tweak, and generic workflow_candidate evidence branches only apply
when frame.context.workflow_intensity is not 'thorough'; otherwise fall through
to the full-workflow route, and add coverage for thorough non-small
fix_bug/make_tweak cases with workflow_candidate evidence. Regenerate
assets/skills/comet/scripts/comet-runtime.mjs#L12977-L12986 using the project
build step; do not edit the generated bundle directly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e7bbb63f-f4b9-4a96-a75b-c0dd88168c66

📥 Commits

Reviewing files that changed from the base of the PR and between 2945693 and 3f426e2.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • README-zh.md
  • README.md
  • assets/skills-zh/comet-open/SKILL.md
  • assets/skills/comet-native/scripts/comet-native-runtime.mjs
  • assets/skills/comet-open/SKILL.md
  • assets/skills/comet/scripts/comet-runtime.mjs
  • docs/superpowers/plans/2026-07-29-recommend-lightweight-workflow-paths.md
  • docs/superpowers/specs/2026-07-29-recommend-lightweight-workflow-paths-design.md
  • domains/comet-classic/classic-intent-command.ts
  • domains/comet-classic/classic-intent.ts
  • domains/comet-classic/classic-project-config.ts
  • domains/skill/platform-install.ts
  • domains/workflow-contract/project-config.ts
  • test/domains/comet-classic/classic-intent.test.ts
  • test/domains/comet-classic/classic-project-config.test.ts
  • test/domains/skill/skills.test.ts
  • test/domains/skill/workflow-optimization-contract.test.ts

Comment thread assets/skills/comet-open/SKILL.md
Comment thread docs/superpowers/plans/2026-07-29-recommend-lightweight-workflow-paths.md Outdated
Comment thread test/domains/comet-classic/classic-project-config.test.ts Outdated
Comment thread test/domains/skill/workflow-optimization-contract.test.ts
@googs1025
googs1025 force-pushed the feature/20260729/recommend-lightweight-workflow-paths-pr branch from 3f426e2 to 4e47591 Compare July 29, 2026 06:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
test/domains/comet-classic/classic-intent.test.ts (1)

285-285: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

as never 绕过类型会掩盖真实的 context 类型错误。

workflow_intensity 已是 CometIntentFrame['context'] 的合法字段,无需 as never。更好的做法是放宽 frame() 的 overrides 类型(对嵌套对象使用 Partial),这样后续字段拼写错误仍能被编译器捕获。

♻️ 建议的辅助函数签名调整
-function frame(overrides: Partial<CometIntentFrame> = {}): CometIntentFrame {
+type FrameOverrides = Partial<Omit<CometIntentFrame, 'intent' | 'slots' | 'context' | 'proposed_route'>> & {
+  intent?: Partial<CometIntentFrame['intent']>;
+  slots?: Partial<CometIntentFrame['slots']>;
+  context?: Partial<CometIntentFrame['context']>;
+  proposed_route?: Partial<CometIntentFrame['proposed_route']>;
+};
+
+function frame(overrides: FrameOverrides = {}): CometIntentFrame {

随后即可去掉两处 as never

Also applies to: 309-309

🤖 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 `@test/domains/comet-classic/classic-intent.test.ts` at line 285, 调整测试辅助函数
frame() 的 overrides 类型,使其支持对嵌套 context 使用
Partial<CometIntentFrame['context']>,同时保留字段名校验;随后移除两处 context 对象上的 as never,确保
workflow_intensity 直接按合法字段传入。
🤖 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.

Inline comments:
In `@assets/skills/comet/scripts/comet-runtime.mjs`:
- Around line 13044-13060: 更新 withConfiguredWorkflowIntensity,仅当 input.context
已是 record 时才注入 workflow_intensity;对缺失、数组或字符串等无效 context 直接返回原 input,保留
validateFrame() 的对象校验。对有效 context 继续保留已有 intensity 时不覆盖的行为。
- Around line 12894-12921: Update recommendationFor so every tweak or hotfix
recommendation first requires hasSmallScopeEvidence(frame) to be true. Do not
treat workflow_intensity === "light" as a substitute, and ensure missing or
unknown risk/scope information cannot qualify as low risk; preserve the existing
recommendation branches only after this evidence gate passes.

In `@test/domains/comet-classic/classic-intent.test.ts`:
- Around line 498-549: Update the test around classicIntentCommand to inject
projectRoot through the supported ClassicConfigOptions.cwd path, allowing
readClassicWorkflowIntensity() to locate .comet/config.yaml without calling
process.chdir. Remove previousCwd capture, process.chdir, and restoration while
preserving the temporary directory cleanup and assertions.

---

Nitpick comments:
In `@test/domains/comet-classic/classic-intent.test.ts`:
- Line 285: 调整测试辅助函数 frame() 的 overrides 类型,使其支持对嵌套 context 使用
Partial<CometIntentFrame['context']>,同时保留字段名校验;随后移除两处 context 对象上的 as never,确保
workflow_intensity 直接按合法字段传入。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 46bd187b-39b5-4d47-afd4-8f4d1edb114f

📥 Commits

Reviewing files that changed from the base of the PR and between 3f426e2 and 4e47591.

📒 Files selected for processing (16)
  • CHANGELOG.md
  • README-zh.md
  • README.md
  • assets/skills-zh/comet-open/SKILL.md
  • assets/skills/comet-native/scripts/comet-native-runtime.mjs
  • assets/skills/comet-open/SKILL.md
  • assets/skills/comet/scripts/comet-runtime.mjs
  • domains/comet-classic/classic-intent-command.ts
  • domains/comet-classic/classic-intent.ts
  • domains/comet-classic/classic-project-config.ts
  • domains/skill/platform-install.ts
  • domains/workflow-contract/project-config.ts
  • test/domains/comet-classic/classic-intent.test.ts
  • test/domains/comet-classic/classic-project-config.test.ts
  • test/domains/skill/skills.test.ts
  • test/domains/skill/workflow-optimization-contract.test.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • assets/skills/comet-native/scripts/comet-native-runtime.mjs
  • CHANGELOG.md
  • domains/comet-classic/classic-intent-command.ts
  • domains/workflow-contract/project-config.ts
  • domains/skill/platform-install.ts
  • README-zh.md
  • domains/comet-classic/classic-project-config.ts
  • test/domains/skill/workflow-optimization-contract.test.ts
  • README.md
  • test/domains/skill/skills.test.ts
  • domains/comet-classic/classic-intent.ts
  • assets/skills-zh/comet-open/SKILL.md

Comment thread assets/skills/comet/scripts/comet-runtime.mjs Outdated
Comment thread assets/skills/comet/scripts/comet-runtime.mjs Outdated
Comment thread test/domains/comet-classic/classic-intent.test.ts
@googs1025 googs1025 changed the title Recommend lightweight Comet workflow paths feat: recommend lightweight Comet workflow paths Jul 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@domains/comet-classic/classic-cli.ts`:
- Around line 19-20: Update runClassicCli to accept the new cwd and homeDir
options and forward both alongside json when calling dispatch, allowing
withConfiguredWorkflowIntensity to read configuration from caller-specified
directories. Add coverage verifying custom directory overrides are propagated
and applied.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ed1f9546-8203-41ed-837d-a6527bf4b076

📥 Commits

Reviewing files that changed from the base of the PR and between 4e47591 and b883b0a.

📒 Files selected for processing (10)
  • assets/skills-zh/comet-open/SKILL.md
  • assets/skills/comet-open/SKILL.md
  • assets/skills/comet/scripts/comet-runtime.mjs
  • domains/comet-classic/classic-cli.ts
  • domains/comet-classic/classic-intent-command.ts
  • domains/comet-classic/classic-intent.ts
  • test/domains/comet-classic/classic-intent.test.ts
  • test/domains/comet-classic/classic-project-config.test.ts
  • test/domains/comet-classic/classic-runtime.test.ts
  • test/domains/skill/workflow-optimization-contract.test.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • test/domains/skill/workflow-optimization-contract.test.ts
  • test/domains/comet-classic/classic-project-config.test.ts
  • domains/comet-classic/classic-intent-command.ts
  • assets/skills-zh/comet-open/SKILL.md
  • test/domains/comet-classic/classic-intent.test.ts
  • domains/comet-classic/classic-intent.ts
  • assets/skills/comet/scripts/comet-runtime.mjs

Comment thread domains/comet-classic/classic-cli.ts Outdated
Comment on lines +19 to +20
cwd?: string;
homeDir?: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

转发 cwdhomeDir,否则配置注入不会生效。

虽然接口新增了这两个字段,但 runClassicCli 在 Line 119 仍只向 dispatch 传递 { json }。因此下游 withConfiguredWorkflowIntensity 收到的始终是默认选项,无法读取调用方指定目录中的配置,导致 workflow intensity 可能解析错误。请让 runClassicCli 接收并转发这两个字段,并补充自定义目录覆盖测试。

🤖 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 `@domains/comet-classic/classic-cli.ts` around lines 19 - 20, Update
runClassicCli to accept the new cwd and homeDir options and forward both
alongside json when calling dispatch, allowing withConfiguredWorkflowIntensity
to read configuration from caller-specified directories. Add coverage verifying
custom directory overrides are propagated and applied.

@benym

benym commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

现在这个方案把Agent推断的scope=small当成的推荐的硬性前置条件,但实际上scope是不准的,比如用户可能使用“小改动”等等词开启工作,但实际上又是一个大任务,scope目前也不在意图识别的必填槽位,他本身不太适合有依据的意图

建议调整判定方案,而不是只把 scope 补进意图识别的最小 Frame:

  1. 使用已有、且有 evidence 支持的 workflow_candidate 作为推荐路径的主要依据。
    tweak 表示单一 OpenSpec change、无需完整 Design/Plan,不应再通过 docs/prompt/small 等关键词重新定义。
  2. 移除 recommendationFor() 顶层的 !hasSmallScopeEvidence(frame) 拦截。scope 只用于 intensity:light 不增加 scope 限制,standard 排除明确 large,thorough 要求明确 small。
  3. 风险判断增加已有的 risk_signal entity;同时不要把 new_capability 一律视为 full,因为 Issue feat: 为 comet-open 增加小型低风险任务的轻量路径推荐 #213 明确包含小型 feature。
  4. 补充 evidence-backed tweak/hotfix、三档 intensity、risk_signal 和小型 feature 测试。

@googs1025
googs1025 force-pushed the feature/20260729/recommend-lightweight-workflow-paths-pr branch from 2906305 to 66d6955 Compare July 29, 2026 14:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
assets/skills/comet-open/SKILL.md (1)

198-198: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

为代码围栏添加语言标识。

两份 Skill 文档的 artifact 目录树代码块都触发 Markdownlint MD040;请将裸代码围栏改为 ```text

  • assets/skills/comet-open/SKILL.md#L198-L198: 将 ``` 改为 ```text
  • assets/skills-zh/comet-open/SKILL.md#L198-L198: 将 ``` 改为 ```text
🤖 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/comet-open/SKILL.md` at line 198, 为 artifact 目录树代码块添加语言标识:将
assets/skills/comet-open/SKILL.md 第198行和 assets/skills-zh/comet-open/SKILL.md
第198行的裸代码围栏改为 ```text,保持代码块内容不变。

Source: Linters/SAST tools

🧹 Nitpick comments (2)
domains/comet-classic/classic-project-config.ts (2)

30-30: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

补充配置根目录优先级测试。

请覆盖 projectRoot > cwd > invocationCwd > process.cwd() 的组合,并验证不同根目录存在配置时读取的是预期文件。当前提供的测试只证明了 cwd 路径。

As per coding guidelines,测试范围必须覆盖当前 TypeScript 改动的最小相关路径。

🤖 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 `@domains/comet-classic/classic-project-config.ts` at line 30, 为
classic-project-config 的配置根目录解析逻辑补充测试,覆盖 projectRoot、cwd、invocationCwd 和
process.cwd() 的优先级组合。为每种根目录分别创建可区分的配置文件,并验证读取结果来自最高优先级的预期目录;同时保留现有仅覆盖 cwd
的场景,确保覆盖当前 TypeScript 改动的最小相关路径。

Source: Coding guidelines


17-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

统一 workflow_intensity 的运行时允许值来源。

classic-project-config.tsclassic-intent.ts 各定义了一份相同的 WORKFLOW_INTENSITIES;配置读取和 intent 校验都依赖 allowlist,维护两份列表会有漂移风险。放到共用 contract 或导出常量让两端复用同一份。

🤖 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 `@domains/comet-classic/classic-project-config.ts` around lines 17 - 24, 将
workflow_intensity 的允许值集中到一个共享 contract 或导出常量中,移除 classic-project-config.ts 中与
classic-intent.ts 重复的 WORKFLOW_INTENSITIES 定义;更新 ClassicWorkflowIntensity
及相关配置解析逻辑以复用该共享来源,并确保配置读取与 intent 校验继续使用完全相同的运行时 allowlist。
🤖 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.

Outside diff comments:
In `@assets/skills/comet-open/SKILL.md`:
- Line 198: 为 artifact 目录树代码块添加语言标识:将 assets/skills/comet-open/SKILL.md 第198行和
assets/skills-zh/comet-open/SKILL.md 第198行的裸代码围栏改为 ```text,保持代码块内容不变。

---

Nitpick comments:
In `@domains/comet-classic/classic-project-config.ts`:
- Line 30: 为 classic-project-config 的配置根目录解析逻辑补充测试,覆盖
projectRoot、cwd、invocationCwd 和 process.cwd()
的优先级组合。为每种根目录分别创建可区分的配置文件,并验证读取结果来自最高优先级的预期目录;同时保留现有仅覆盖 cwd 的场景,确保覆盖当前
TypeScript 改动的最小相关路径。
- Around line 17-24: 将 workflow_intensity 的允许值集中到一个共享 contract 或导出常量中,移除
classic-project-config.ts 中与 classic-intent.ts 重复的 WORKFLOW_INTENSITIES 定义;更新
ClassicWorkflowIntensity 及相关配置解析逻辑以复用该共享来源,并确保配置读取与 intent 校验继续使用完全相同的运行时
allowlist。

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bd3266f-f92b-4e60-a2b2-7d73a97eda3e

📥 Commits

Reviewing files that changed from the base of the PR and between 2906305 and 66d6955.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • README-zh.md
  • README.md
  • assets/manifest.json
  • assets/skills-zh/comet-open/SKILL.md
  • assets/skills/comet-native/scripts/comet-native-runtime.mjs
  • assets/skills/comet-open/SKILL.md
  • assets/skills/comet/scripts/comet-runtime.mjs
  • domains/comet-classic/classic-intent-command.ts
  • domains/comet-classic/classic-intent.ts
  • domains/comet-classic/classic-project-config.ts
  • domains/skill/platform-install.ts
  • domains/workflow-contract/project-config.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • assets/skills/comet-native/scripts/comet-native-runtime.mjs
  • README.md
  • README-zh.md
  • domains/skill/platform-install.ts
  • domains/comet-classic/classic-intent-command.ts
  • assets/skills/comet/scripts/comet-runtime.mjs
  • domains/comet-classic/classic-intent.ts

@googs1025

googs1025 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

我根据 review comment 和 #213 重新调整了一下 lightweight workflow recommendation 的判断逻辑。

这次主要改动是:不再把 scope=small 当成推荐轻量路径的硬前置条件。之前的逻辑会要求先判断任务是 small,才可能推荐 tweak / hotfix,但这里的问题是 scope 本身不是必填 slot,而且也不是最可靠的推荐依据。现在改成以 intent runtime 已经解析出的、有 evidence 支撑的 workflow_candidate 作为主信号:只有当输入中确实被识别出 workflow_candidate=tweakworkflow_candidate=hotfix 时,才会推荐对应轻量路径。

scope 现在只影响推荐强度,而不是决定是否能推荐:

  • light:不额外限制 scope
  • standard:只排除明确的 large scope
  • thorough:要求有明确 small scope evidence

风险判断这块也做了调整。现在会把 risk_signal entity 纳入 lightweight recommendation 的阻断条件,例如 public API、schema、cross-module 这类明确风险仍然会阻止推荐轻量路径。但不再把 new_capability 一律视为高风险,因为 #213 的目标本身就包含“小型 feature 也可以推荐轻量路径”的场景。也就是说,小型、低风险的新能力如果有 workflow_candidate=tweak 证据,现在可以正常推荐 /comet-tweak

另外 /comet-open 仍然是默认 full path。即使 runtime 推荐了 /comet-tweak/comet-hotfix,也只是先展示推荐理由并暂停,让用户选择是否切换,不会自动降级或直接创建轻量 workflow。

我也补了对应测试覆盖,包括:

  • 有 evidence 的 tweak / hotfix 推荐
  • 缺少 scope 时仍可基于 workflow_candidate 推荐
  • docs / prompt / small 这类普通关键词不会被重新解释成 tweak
  • light / standard / thorough 三档 intensity 的 scope 行为
  • risk_signal 阻断轻量推荐
  • 小型 new_capability 可以走 tweak recommendation

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.

feat: 为 comet-open 增加小型低风险任务的轻量路径推荐

2 participants