fix(qwen): generate Markdown commands instead of deprecated TOML format
Summary
Qwen Code has deprecated TOML custom commands in favor of Markdown files with YAML frontmatter (docs). This PR updates the Qwen adapter to emit .qwen/commands/opsx-<id>.md and registers the old opsx-*.toml files as legacy artifacts so they are cleaned up on update.
Closes #838
Changes
qwenadapter now generates Markdown withdescriptionfrontmatter (YAML values escaped, same as thepi/claudeadapters)legacy-cleanupgains a.qwen/commands/opsx-*.tomlpattern, following the junie/opencode precedent- Tests updated for the new format, plus a YAML-escaping test and a negative test ensuring new
.mdfiles are not flagged as legacy docs/supported-tools.mdand changeset updated
Design decisions
- Args handling: the Markdown format supports
{{args}}, but the old TOML adapter relied on Qwen's default argument appending, so this PR intentionally preserves that behavior for parity. Explicit{{args}}injection could be a follow-up. - Migration path: existing
.qwen/commands/opsx-*.tomlfiles are cleaned up via the same legacy-cleanup mechanism used for the junie/opencode migrations (interactive confirm onupdate, auto with--force). Non-interactive runs without--forcewarn and leave the old files in place, matching existing behavior.
Testing
npx vitest runβ full suite passes (1664 tests)npx eslintclean on changed files
Generated with Claude (Cowork) using claude-fable-5.
Summary by CodeRabbit
-
New Features
- Qwen Code commands now use Markdown files with YAML frontmatter instead of TOML.
-
Bug Fixes
- Improved detection and cleanup of legacy TOML command artifacts during updates.
-
Documentation
- Updated docs to reflect the new Markdown-based Qwen command format and paths.
-
Tests
- Test coverage updated to validate Markdown/YAML output and legacy detection behavior.
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: 76780d06-5164-4368-8faa-ce336ef25de3
π₯ Commits
Reviewing files that changed from the base of the PR and between c19d62946eabcee1ce23fef7d5c1b918eab7ee95 and 930de0cfb79ae777414a0a79e9efff16ed1f1fe0.
π Files selected for processing (1)
test/core/command-generation/registry.test.ts
π Walkthrough
Walkthrough
This PR migrates Qwen command generation from deprecated TOML format to Markdown with YAML frontmatter, aligning with Qwen Code's current recommendations. The adapter gains a YAML-safe value escaper, legacy TOML artifacts are marked for cleanup detection, and tests are updated to validate the new format and proper character escaping.
Changes
Qwen Markdown Command Format Migration
| Layer / File(s) | Summary |
|---|---|
Markdown adapter with YAML frontmatter src/core/command-generation/adapters/qwen.ts, test/core/command-generation/adapters.test.ts |
Qwen adapter now generates .md files instead of .toml. A new escapeYamlValue helper safely quotes description values with YAML-special characters. Module docs and tests updated to validate YAML frontmatter output with proper escaping. |
Legacy TOML cleanup infrastructure src/core/legacy-cleanup.ts, test/core/legacy-cleanup.test.ts |
Legacy command path detection expanded to match both opsx-*.toml and openspec-*.toml patterns. Tests confirm old TOML files are flagged as legacy while new Markdown files are not. |
Documentation and integration updates .changeset/qwen-markdown-commands.md, docs/supported-tools.md, test/core/update.test.ts, test/core/command-generation/registry.test.ts |
Changeset documents the format migration. Supported tools table shows .md extension. Integration and registry tests validate generated commands produce Markdown with YAML frontmatter delimiters and description: fields and adjust the no-YAML-frontmatter allowlist. |
Estimated code review effort
π― 3 (Moderate) | β±οΈ ~20 minutes
Possibly related PRs
- Fission-AI/OpenSpec#250: Adds Qwen slash command configurators that generate
.qwen/commandsentries with YAML frontmatter, directly aligning with this PR's format migration. - Fission-AI/OpenSpec#317: Previous Qwen command-config generation logic that this PR replaces by switching from TOML to Markdown format with YAML frontmatter.
- Fission-AI/OpenSpec#760: Related legacy-cleanup changes that allow
LEGACY_SLASH_COMMAND_PATHS.patternto be a string or array, which this PR builds upon.
Suggested reviewers
- TabishB
- alfred-openspec
Poem
π° From TOML burrows deep to Markdown's sunny glade,
YAML ribbons wrap each command we've made,
I nibble at edge-cases, escape every quote,
Now Qwen's new commands proudly skip the old noteβ
Hop, code, hop! The format's fresh and ready to tote.
π₯ Pre-merge checks | β 5
β Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title check | β Passed | The title accurately summarizes the main change: updating Qwen adapter to generate Markdown commands instead of deprecated TOML format, which aligns with the primary objective. |
| Linked Issues check | β Passed | All coding requirements from issue #838 are met: file path changed to .md, TOML replaced with Markdown YAML frontmatter, YAML values escaped, and legacy cleanup implemented. |
| Out of Scope Changes check | β Passed | All changes directly support the migration from TOML to Markdown format and legacy cleanup; no unrelated modifications detected. |
| Docstring Coverage | β Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
βοΈ 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
Thanks for the review! Good point on registry.test.ts β pushed 930de0c removing qwen from the noYamlFrontmatter list, so the registry-level test now asserts frontmatter for qwen as well. The new commit auto-dismissed the approval; re-approval appreciated when you get a chance.