Skip to content

fix: generate Qwen commands as Markdown#1085

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

fix: generate Qwen commands as Markdown#1085
tavaresgmg wants to merge 3 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 now emits Markdown command files with YAML frontmatter instead of TOML.
    • Init and Update flows automatically remove obsolete legacy Qwen command artifacts and report counts.
  • Documentation

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

    • Test suite updated to expect Markdown/YAML output and 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: 663dd90f-4e25-4718-b167-119911da485b

📥 Commits

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

📒 Files selected for processing (1)
  • .changeset/qwen-markdown-commands.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/qwen-markdown-commands.md

📝 Walkthrough

Walkthrough

Qwen command generation now emits Markdown (.md) files with YAML frontmatter; descriptions are YAML-escaped, colon-style command refs are converted to hyphen-style, a helper for legacy .toml paths is exported, and init/update flows remove obsolete Qwen TOML artifacts. Tests and docs updated.

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.
Release changeset
.changeset/qwen-markdown-commands.md
Adds a patch changeset noting the migration to Markdown command files and cleanup of legacy TOML artifacts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

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 clearly and concisely summarizes the main change: converting Qwen command generation from TOML to Markdown format.
Linked Issues check ✅ Passed All requirements from issue #838 are met: Qwen commands now generate as Markdown files with YAML frontmatter, file extensions changed from .toml to .md, command references transformed from /opsx:* to opsx-*, and legacy TOML files are removed.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the issue requirements: adapter conversion to Markdown, documentation updates, legacy cleanup functionality, and corresponding test updates to validate the new behavior.

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

✨ 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 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
Copy link
Copy Markdown
Collaborator

@alfred-openspec alfred-openspec left a comment

Choose a reason for hiding this comment

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

Code path looks right to me: Qwen docs now recommend Markdown commands with YAML frontmatter, the flat .qwen/commands/opsx-*.md filenames map to /opsx-*, and removing the old generated TOML files seems reasonable to avoid stale deprecated commands. Please add a patch changeset before merge since this is a user-visible package fix and our CI validates changesets.

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

2 participants