Skip to content

fix: migrate Qwen Code CLI from TOML to Markdown format (#1589)#1730

Open
fuyongde wants to merge 2 commits intogithub:mainfrom
fuyongde:fix/qwen-markdown-format
Open

fix: migrate Qwen Code CLI from TOML to Markdown format (#1589)#1730
fuyongde wants to merge 2 commits intogithub:mainfrom
fuyongde:fix/qwen-markdown-format

Conversation

@fuyongde
Copy link

@fuyongde fuyongde commented Mar 2, 2026

Summary

  • Migrate Qwen Code CLI from TOML format to Markdown format
  • Update release package generation scripts (bash and PowerShell)
  • Update documentation to reflect the format change
  • Add comprehensive test coverage for Qwen Markdown format

Background

Qwen Code CLI v0.10.0 deprecated the TOML format and fully switched to Markdown as the core format for configuration and interaction files. The
current spec-kit codebase still retained logic for adapting to Qwen Code CLI's TOML format, leading to compatibility issues with the latest version.

Reference: https://qwenlm.github.io/qwen-code-docs/en/users/features/commands/#4-custom-commands

Changes

1. Release Scripts

  • .github/workflows/scripts/create-release-packages.sh: Changed qwen case to generate .md files with $ARGUMENTS instead of .toml files with
    {{args}}
  • .github/workflows/scripts/create-release-packages.ps1: Applied same change for PowerShell script

2. Documentation

  • AGENTS.md:
    • Updated Qwen's format from TOML to Markdown in the supported agents table
    • Removed Qwen from the TOML format section (now only Gemini uses TOML)
    • Updated common pitfalls section to clarify TOML is only for Gemini

3. Tests

  • tests/test_ai_skills.py:
    • Added commands_dir_qwen fixture for Markdown-format Qwen commands
    • Added test_qwen_md_commands_dir_installs_skills to verify skills installation from Markdown templates
    • Added test_existing_commands_preserved_qwen to ensure existing commands are not removed

Test plan

  • Verify bash script generates correct Markdown files for qwen
  • Verify PowerShell script generates correct Markdown files for qwen
  • Verify documentation accurately reflects the format change
  • Verify new tests cover Qwen Markdown format scenarios
  • Run full test suite to ensure no regressions
  • Test specify init --ai qwen with Qwen Code CLI v0.10.0+

Compatibility

  • Breaking Change: Projects using older Qwen Code CLI versions with TOML format will need to upgrade to v0.10.0+
  • Migration Path: Users should upgrade Qwen Code CLI and regenerate command files using specify init --ai qwen

Fixes #1589

@fuyongde fuyongde requested a review from mnriem as a code owner March 2, 2026 08:32
@fuyongde fuyongde force-pushed the fix/qwen-markdown-format branch from 019c671 to 90e6436 Compare March 10, 2026 08:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates Qwen Code CLI support from TOML to Markdown across release packaging, documentation, and tests to match Qwen Code CLI v0.10.0+ expectations.

Changes:

  • Generate Qwen command files as .md with $ARGUMENTS in both bash and PowerShell release packaging scripts.
  • Update AGENTS.md to reflect Qwen’s Markdown command format (and remove it from the TOML list).
  • Add/extend tests to cover Qwen Markdown command directories and preservation of existing Qwen commands.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/test_ai_skills.py Adds Qwen Markdown fixtures/tests for skills installation and command preservation.
AGENTS.md Updates Qwen format documentation from TOML → Markdown.
.github/workflows/scripts/create-release-packages.sh Switches Qwen release package command generation to Markdown with $ARGUMENTS.
.github/workflows/scripts/create-release-packages.ps1 Mirrors the bash script change for Qwen in PowerShell packaging.
Comments suppressed due to low confidence (1)

tests/test_ai_skills.py:412

  • These test templates are written without an explicit encoding. Since install_ai_skills() reads templates as UTF-8, set encoding="utf-8" on these write_text() calls to avoid locale-dependent failures on Windows/CI.
        (cmds_dir / "speckit.specify.md").write_text(
            "---\ndescription: Create or update the feature specification.\n---\n\n# Specify\n\nBody.\n"
        )
        (cmds_dir / "speckit.plan.md").write_text(
            "---\ndescription: Generate implementation plan.\n---\n\n# Plan\n\nBody.\n"
        )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mnriem mnriem self-requested a review March 10, 2026 14:21
Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

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

Please address Copilot feedback where applicable. When not applicable, please explain why. Thanks!

@fuyongde fuyongde force-pushed the fix/qwen-markdown-format branch from 7ce57cb to f2866b2 Compare March 11, 2026 07:24
@fuyongde fuyongde closed this Mar 11, 2026
@fuyongde fuyongde reopened this Mar 11, 2026
@fuyongde fuyongde force-pushed the fix/qwen-markdown-format branch from f2866b2 to 5e72806 Compare March 12, 2026 01:15
@mnriem mnriem requested a review from Copilot March 12, 2026 15:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

AGENTS.md:375

  • The PR description says “now only Gemini uses TOML”, but this doc (and the release scripts) still list Tabnine as TOML-based. Please reconcile the PR description vs. the actual supported agents/formats (either update the description, or update docs/scripts if Tabnine is no longer TOML).
### TOML Format

Used by: Gemini, Tabnine

```toml
description = "Command description"

prompt = """
Command content with {SCRIPT} and {{args}} placeholders.
"""
</details>



---

💡 <a href="/github/spec-kit/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

Comment on lines 241 to 244
qwen)
mkdir -p "$base_dir/.qwen/commands"
generate_commands qwen toml "{{args}}" "$base_dir/.qwen/commands" "$script"
generate_commands qwen md "\$ARGUMENTS" "$base_dir/.qwen/commands" "$script"
[[ -f agent_templates/qwen/QWEN.md ]] && cp agent_templates/qwen/QWEN.md "$base_dir/QWEN.md" ;;
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Release packaging now generates Qwen command files as Markdown, but the extension command registration logic still treats qwen as TOML (CommandRegistrar.AGENT_CONFIGS['qwen'] in src/specify_cli/extensions.py is format: toml, args: {{args}}, extension: .toml). This will cause specify extension ... to continue writing .toml commands into .qwen/commands, conflicting with the new Qwen CLI expectations. Update the registrar config for qwen to Markdown ($ARGUMENTS, .md) and adjust any related comments (e.g., “TOML format for Gemini/Qwen”).

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review! This is already addressed in commit b06f599 — CommandRegistrar.AGENT_CONFIGS["qwen"] has been updated to format: markdown,
args: $ARGUMENTS, extension: .md. A test (test_qwen_agent_config_is_markdown) was also added to prevent regression.

'qwen' {
$cmdDir = Join-Path $baseDir ".qwen/commands"
Generate-Commands -Agent 'qwen' -Extension 'toml' -ArgFormat '{{args}}' -OutputDir $cmdDir -ScriptVariant $Script
Generate-Commands -Agent 'qwen' -Extension 'md' -ArgFormat '$ARGUMENTS' -OutputDir $cmdDir -ScriptVariant $Script
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Same as the bash release script: this change makes Qwen packages generate .md commands, but src/specify_cli/extensions.py still registers Qwen extension commands as TOML ({{args}}, .toml). That mismatch will break extension-installed commands for Qwen unless the registrar mapping is updated to Markdown.

Suggested change
Generate-Commands -Agent 'qwen' -Extension 'md' -ArgFormat '$ARGUMENTS' -OutputDir $cmdDir -ScriptVariant $Script
Generate-Commands -Agent 'qwen' -Extension 'toml' -ArgFormat '{{args}}' -OutputDir $cmdDir -ScriptVariant $Script

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

Thanks for catching this! This is already addressed in the follow-up commit b06f599 — CommandRegistrar.AGENT_CONFIGS["qwen"] has been updated to
format: markdown, args: $ARGUMENTS, extension: .md. A test (test_qwen_agent_config_is_markdown) was also added to prevent regression.

@mnriem mnriem self-requested a review March 12, 2026 16:41
Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

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

Please address Copilot feedback. If not applicable please explain why.

fuyongde and others added 2 commits March 13, 2026 09:36
Qwen Code CLI v0.10.0 deprecated TOML format and fully switched to
Markdown as the core format for configuration and interaction files.

- Update create-release-packages.sh: generate .md files with $ARGUMENTS
  instead of .toml files with {{args}} for qwen agent
- Update create-release-packages.ps1: same change for PowerShell script
- Update AGENTS.md: reflect Qwen's new Markdown format in docs and
  remove Qwen from TOML format section
- Update tests/test_ai_skills.py: add commands_dir_qwen fixture and
  tests covering Markdown-format skills installation for Qwen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
extensions.py CommandRegistrar.AGENT_CONFIGS['qwen'] was still set to
TOML format, causing `specify extension` to write .toml files into
.qwen/commands, conflicting with Qwen Code CLI v0.10.0+ expectations.

- Change qwen format from toml to markdown
- Change qwen args from {{args}} to $ARGUMENTS
- Change qwen extension from .toml to .md
- Add test to assert qwen config is Markdown format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fuyongde fuyongde force-pushed the fix/qwen-markdown-format branch from 5e72806 to b06f599 Compare March 13, 2026 01:44
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.

feat: Adapt to Qwen Code Cli's new format (deprecate TOML, adopt Markdown)

3 participants