Skip to content

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented Sep 20, 2025

Summary by cubic

Moved conversion of invokable rules to slash commands from YAML parsing to config loading. This centralizes the logic and ensures all rules in the final merged config are converted consistently.

  • Refactors
    • Run rule-to-slash conversion in doLoadConfig after rules are assembled.
    • Remove conversion from loadYaml.ts.
    • Keep non-fatal error handling per rule conversion.

@sestinj sestinj requested a review from a team as a code owner September 20, 2025 04:09
@sestinj sestinj requested review from RomneyDa and removed request for a team September 20, 2025 04:09
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 20, 2025
Copy link

⚠️ 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
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.

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

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


<file name="core/config/profile/doLoadConfig.ts">

<violation number="1" location="core/config/profile/doLoadConfig.ts:164">
Potential silent no-op: using optional chaining when pushing to slashCommands can drop converted commands if the array is undefined. Initialize the array before pushing to ensure consistency with later code that assumes it exists.</violation>
</file>

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

if (rule.invokable) {
try {
const slashCommand = convertRuleBlockToSlashCommand(rule);
newConfig.slashCommands?.push(slashCommand);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 20, 2025

Choose a reason for hiding this comment

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

Potential silent no-op: using optional chaining when pushing to slashCommands can drop converted commands if the array is undefined. Initialize the array before pushing to ensure consistency with later code that assumes it exists.

Prompt for AI agents
Address the following comment on core/config/profile/doLoadConfig.ts at line 164:

<comment>Potential silent no-op: using optional chaining when pushing to slashCommands can drop converted commands if the array is undefined. Initialize the array before pushing to ensure consistency with later code that assumes it exists.</comment>

<file context>
@@ -155,6 +156,21 @@ export default async function doLoadConfig(options: {
+    if (rule.invokable) {
+      try {
+        const slashCommand = convertRuleBlockToSlashCommand(rule);
+        newConfig.slashCommands?.push(slashCommand);
+      } catch (e) {
+        errors.push({
</file context>
Suggested change
newConfig.slashCommands?.push(slashCommand);
(newConfig.slashCommands ??= []).push(slashCommand);
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant