Skip to content

Conversation

RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Oct 2, 2025

Description

Adds --workflow flag for workflow file support
Workflow files are pulled from the registry and parsed for rules, mcps/tool permissions, and model.
A workflow service keeps this state and is referenced by config and model services.


Summary by cubic

Adds workflow file support to the CLI via a --workflow flag and adds parsing/serialization for YAML-frontmatter workflow files.

  • New Features
    • Parse workflow markdown with YAML frontmatter into name, description, model, tools, rules, and prompt. Validated with zod; clear errors for missing/invalid name.
    • Serialize workflows back to markdown, filtering undefined fields.
    • Export new utilities from markdown index.
    • Add comprehensive tests covering invalid YAML, missing frontmatter, multiline prompts, and Windows/mixed line endings.

@RomneyDa RomneyDa requested a review from a team as a code owner October 2, 2025 18:33
@RomneyDa RomneyDa requested review from sestinj and removed request for a team October 2, 2025 18:33
@RomneyDa RomneyDa marked this pull request as draft October 2, 2025 18:33
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 2, 2025
Copy link

github-actions bot commented Oct 2, 2025

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

Copy link

github-actions bot commented Oct 2, 2025

✅ Review Complete

⚠️ AI review completed but no review output was generated.

Likely cause: Expired CONTINUE_API_KEY or missing continuedev/review-bot assistant

📋 View workflow logs for details.


Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@RomneyDa RomneyDa marked this pull request as ready for review October 3, 2025 00:16
@RomneyDa RomneyDa marked this pull request as draft October 3, 2025 00:16
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 3, 2025
Copy link

github-actions bot commented Oct 3, 2025

✅ Review Complete

⚠️ AI review completed but no review output was generated.

Likely cause: Expired CONTINUE_API_KEY or missing continuedev/review-bot assistant

📋 View workflow logs for details.


Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 31 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="extensions/cli/src/services/ToolPermissionService.ts">

<violation number="1" location="extensions/cli/src/services/ToolPermissionService.ts:162">
Workflow-specific policies now bypass plan/auto overrides, so plan mode no longer blocks write tools when a workflow is active, contradicting the documented &quot;complete override&quot; behavior.</violation>
</file>

<file name="packages/config-yaml/src/markdown/workflowFiles.ts">

<violation number="1" location="packages/config-yaml/src/markdown/workflowFiles.ts:126">
Trim the MCP server slug when parsing colon-delimited workflow tools so that whitespace around the colon doesn’t corrupt the server identifier.</violation>

<violation number="2" location="packages/config-yaml/src/markdown/workflowFiles.ts:127">
Trim the parsed MCP tool name so colon-separated entries with spaces (e.g., “owner/package: tool”) resolve to the correct tool identifier.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@RomneyDa RomneyDa marked this pull request as ready for review October 4, 2025 01:06
Copy link

github-actions bot commented Oct 4, 2025

✅ Review Complete

⚠️ AI review completed but no review output was generated.

Likely cause: Expired CONTINUE_API_KEY or missing continuedev/review-bot assistant

📋 View workflow logs for details.


Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

8 issues found across 58 files

Prompt for AI agents (all 8 issues)

Understand the root cause of the following 8 issues and fix them.


<file name="extensions/cli/src/hooks/useService.ts">

<violation number="1" location="extensions/cli/src/hooks/useService.ts:126">
Please include the service container in the getServiceStates dependency array so the callback is refreshed if the container context changes; otherwise the hook can keep using a stale container instance and miss updates.</violation>
</file>

<file name="extensions/cli/src/stream/streamChatResponse.modeSwitch.test.ts">

<violation number="1" location="extensions/cli/src/stream/streamChatResponse.modeSwitch.test.ts:16">
`Object.keys(SERVICE_NAMES)` returns the uppercase keys (&quot;TOOL_PERMISSIONS&quot;, &quot;AUTH&quot;, …), so the cleanup loop no longer removes the actual registered services (stored under the camelCase values). Please iterate over the SERVICE_NAMES values instead to avoid leaking service state between tests.</violation>
</file>

<file name="extensions/cli/src/services/index.initialization.test.ts">

<violation number="1" location="extensions/cli/src/services/index.initialization.test.ts:12">
Iterating with Object.keys hits the enum keys (&quot;AUTH&quot;, &quot;CONFIG&quot;), so the cleanup no longer deletes the registered services keyed by the lowercase values (&quot;auth&quot;, &quot;config&quot;), leaving stale state between tests.</violation>
</file>

<file name="extensions/cli/src/services/workflow-integration.test.ts">

<violation number="1" location="extensions/cli/src/services/workflow-integration.test.ts:462">
This assertion never checks that the workflow prompt was prefixed onto the CLI options. Because `enhanceConfig` clones the options object, `baseOptions.prompt` stays `[&#39;user-prompt&#39;]`, so the test always passes—even if no workflow prompt is injected—leaving the feature untested.</violation>
</file>

<file name="packages/config-yaml/src/markdown/workflowFiles.ts">

<violation number="1" location="packages/config-yaml/src/markdown/workflowFiles.ts:127">
MCP tool references with spaces after the colon are silently accepted, so the resulting toolName keeps the space and produces a policy like `mcp:owner/package: tool` that will never match the real tool identifier. Please reject colon-separated inputs that contain whitespace so workflows can’t silently misconfigure policies.

(Based on your team&#39;s feedback about ensuring MCP tool references reject colon-separated whitespace.) [FEEDBACK_USED]</violation>
</file>

<file name="extensions/cli/src/stream/streamChatResponse.ts">

<violation number="1" location="extensions/cli/src/stream/streamChatResponse.ts:340">
The headless flag is no longer passed into `processStreamingResponse`, so headless runs behave like interactive sessions—streaming output to stdout and attempting permission prompts—instead of enforcing the non-interactive headless flow.</violation>
</file>

<file name="extensions/cli/src/services/ConfigService.ts">

<violation number="1" location="extensions/cli/src/services/ConfigService.ts:59">
`injectedConfigOptions` is now read from the init object, but the caller still supplies the CLI overrides under `commandOptions`, so the overrides never reach `configEnhancer`. Update either the destructuring or the call to pass the correct property so CLI flags keep working.</violation>
</file>

<file name="extensions/cli/src/services/ToolPermissionService.ts">

<violation number="1" location="extensions/cli/src/services/ToolPermissionService.ts:86">
If a workflow requests only built-in tools, this list allows every tool—including MCP—because the wildcard allow is inserted before the MCP exclusion. Since permission checks rely on the first matching entry (as seen in the plan-mode policy ordering), the wildcard wins and the exclusion is never applied; reorder so the MCP exclusion comes before the wildcard.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Oct 6, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 6, 2025
@RomneyDa RomneyDa merged commit fec0510 into main Oct 6, 2025
81 of 84 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Oct 6, 2025
@RomneyDa RomneyDa deleted the dallin/workflow-files branch October 6, 2025 06:44
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2025
@sestinj
Copy link
Contributor

sestinj commented Oct 6, 2025

🎉 This PR is included in version 1.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 12, 2025

🎉 This PR is included in version 1.24.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 15, 2025

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

lgtm This PR has been approved by a maintainer released size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants