Skip to content

fix: generate Qwen commands as Markdown#1085

Open
tavaresgmg wants to merge 2 commits into
Fission-AI:mainfrom
tavaresgmg:fix/qwen-markdown-commands
Open

fix: generate Qwen commands as Markdown#1085
tavaresgmg wants to merge 2 commits into
Fission-AI:mainfrom
tavaresgmg:fix/qwen-markdown-commands

Conversation

@tavaresgmg
Copy link
Copy Markdown

@tavaresgmg tavaresgmg commented May 12, 2026

Summary

  • generate Qwen Code commands as Markdown files with YAML description frontmatter
  • transform generated Qwen command references from /opsx:* to /opsx-* to match the flat command filenames
  • remove obsolete generated .qwen/commands/opsx-*.toml files during init/update so users do not keep stale TOML commands after upgrading
  • update supported-tools docs and Qwen adapter tests

Fixes #838.

Validation

  • ./node_modules/.bin/vitest run test/core/command-generation/adapters.test.ts test/core/command-generation/registry.test.ts test/core/init.test.ts test/core/update.test.ts test/core/legacy-cleanup.test.ts
  • node build.js
  • ./node_modules/.bin/eslint src/

Full ./node_modules/.bin/vitest run was also attempted: 1473 tests passed; 17 existing environment-sensitive zsh-installer.test.ts cases failed locally because Oh My Zsh was detected under the test HOME.

Generated with Codex using GPT-5.

Summary by CodeRabbit

  • New Features

    • Qwen adapter now emits Markdown command files with YAML frontmatter (replacing TOML).
    • Init and Update flows automatically remove obsolete legacy Qwen command artifacts and report counts.
  • Documentation

    • Supported-tools documentation updated to reflect the Markdown format for Qwen commands.
  • Tests

    • Test suite updated to expect Markdown/YAML output and to verify legacy artifact removal.

Review Change Stack

@tavaresgmg tavaresgmg requested a review from TabishB as a code owner May 12, 2026 12:56
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 783becfc-d773-4de6-9345-eb7fe23b10d4

📥 Commits

Reviewing files that changed from the base of the PR and between 0f1f510 and 17da539.

📒 Files selected for processing (2)
  • src/core/command-generation/adapters/qwen.ts
  • test/core/command-generation/adapters.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/core/command-generation/adapters.test.ts
  • src/core/command-generation/adapters/qwen.ts

📝 Walkthrough

Walkthrough

Qwen command generation now produces Markdown (.md) files with YAML frontmatter instead of TOML, escapes descriptions for YAML, converts colon-style command refs to hyphen-style, exports a legacy TOML path helper, and removes obsolete Qwen TOML files during init and update flows.

Changes

Qwen TOML-to-Markdown Format Migration

Layer / File(s) Summary
Qwen adapter format conversion
src/core/command-generation/adapters/qwen.ts
Adds escapeYamlValue helper, exports getLegacyQwenTomlFilePath, updates qwenAdapter.getFilePath to return .md and qwenAdapter.formatFile to emit YAML frontmatter with escaped description and hyphen-transformed body instead of TOML.
Documentation update for new Qwen format
docs/supported-tools.md
Supported tools table updated to reflect Qwen command files use opsx-<id>.md rather than .toml.
Init command legacy file cleanup integration
src/core/init.ts
Imports legacy path helper, extends generateSkillsAndCommands result with removedObsoleteCommandCount, calls removeObsoleteCommandFiles during setup, logs removed count, and implements helper that deletes workflow-specific legacy Qwen TOML files.
Update command legacy file cleanup integration
src/core/update.ts
Imports legacy path helper, adds removedObsoleteCommandCount accumulator, invokes removeObsoleteCommandFiles during command generation/update branches, and includes removal count in the post-update summary.
Test coverage for format migration and cleanup
test/core/command-generation/adapters.test.ts, test/core/command-generation/registry.test.ts, test/core/init.test.ts, test/core/update.test.ts
Adapter tests now expect .md output with YAML frontmatter, verify colon→hyphen command-ref conversion and YAML-escaping of description. Registry test removes qwen from noYamlFrontmatter. Init/update tests verify .md generation and removal of legacy .toml files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Fission-AI/OpenSpec#556: Updates qwen adapter to emit Markdown (.md) command files and remove legacy .toml artifacts — directly related.
  • Fission-AI/OpenSpec#626: Applies transformToHyphenCommands to adapters; related to colon→hyphen reference transformation used here.
  • Fission-AI/OpenSpec#250: Modifies Qwen command file handling and frontmatter formats; related to file-format changes.

Suggested reviewers

  • TabishB
  • alfred-openspec

Poem

🐰 From TOML folds to frontmatter's cheer,
I hop and reformat each Qwen command here.
Hyphens replace colons, old files swept away,
Markdown now sings at the start of the day.
A tiny hop for code, a carrot for play.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 'fix: generate Qwen commands as Markdown' clearly and concisely summarizes the main change in the pull request, which is generating Qwen commands as Markdown files instead of TOML.
Linked Issues check ✅ Passed The pull request fully addresses all coding requirements from issue #838: generates Qwen commands as Markdown files, changes file extensions from .toml to .md, formats content with YAML frontmatter, and removes obsolete TOML artifacts during init/update.
Out of Scope Changes check ✅ Passed All changes are directly related to the issue objectives: Markdown generation, YAML frontmatter formatting, file path updates, and cleanup of legacy TOML files. The addition of helper functions like getLegacyQwenTomlFilePath and escapeYamlValue are necessary to support the primary objectives.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown
Contributor

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

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 `@src/core/command-generation/adapters/qwen.ts`:
- Around line 15-22: The escapeYamlValue function detects carriage returns in
the needsQuoting regex but only escapes line feeds; update the escape logic in
escapeYamlValue to also replace '\r' with '\\r' (in addition to existing
replacements of backslash, double-quote, and '\n') so carriage returns are
properly serialized; locate the function named escapeYamlValue and add a
.replace(/\r/g, '\\r') step in the escaped string pipeline.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1a8f0123-7645-49be-98d1-9a359e11d62c

📥 Commits

Reviewing files that changed from the base of the PR and between 053d8a5 and 0f1f510.

📒 Files selected for processing (8)
  • docs/supported-tools.md
  • src/core/command-generation/adapters/qwen.ts
  • src/core/init.ts
  • src/core/update.ts
  • test/core/command-generation/adapters.test.ts
  • test/core/command-generation/registry.test.ts
  • test/core/init.test.ts
  • test/core/update.test.ts

Comment thread src/core/command-generation/adapters/qwen.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.

OpenSpec generates deprecated TOML commands for Qwen Code

1 participant