Skip to content

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

Open
fuyongde wants to merge 1 commit intogithub:mainfrom
fuyongde:fix/qwen-markdown-format
Open

fix: migrate Qwen Code CLI from TOML to Markdown format (#1589)#1730
fuyongde wants to merge 1 commit 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
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>
@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.

Comment on lines +139 to +142
cmd_dir.mkdir(parents=True, exist_ok=True)
for name in ["speckit.specify.md", "speckit.plan.md", "speckit.tasks.md"]:
(cmd_dir / name).write_text(f"# {name}\nContent here\n")
return cmd_dir
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The fixture writes Markdown files without an explicit encoding. Path.write_text() defaults to the platform locale, while install_ai_skills() reads with UTF-8, so this can fail on non-UTF-8 locales. Write these files with encoding="utf-8" (as the other fixtures in this file already do) to keep tests deterministic.

This issue also appears on line 407 of the same file.

Copilot uses AI. Check for mistakes.
Comment on lines +478 to +483
def test_existing_commands_preserved_qwen(self, project_dir, templates_dir, commands_dir_qwen):
"""install_ai_skills must NOT remove pre-existing .qwen/commands files."""
assert len(list(commands_dir_qwen.glob("speckit.*"))) == 3

install_ai_skills(project_dir, "qwen")

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

templates_dir is included as a fixture parameter but is not used by this test (and adds unrelated setup of .claude/commands). Drop the unused fixture to keep the test focused and reduce unnecessary work.

Copilot uses AI. Check for mistakes.
Comment on lines 363 to 366
### TOML Format

Used by: Gemini, Qwen, Tabnine
Used by: Gemini, Tabnine

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This section correctly removes Qwen from the TOML list, but the earlier “Markdown Format” section’s “Used by:” list still omits Qwen even though it’s now documented as Markdown in the supported agents table. Add Qwen there to keep the documentation consistent.

Copilot uses AI. Check for mistakes.
Comment on lines 156 to 159
# NOTE: We substitute {ARGS} internally. Outward tokens differ intentionally:
# * Markdown/prompt (claude, copilot, cursor-agent, opencode): $ARGUMENTS
# * TOML (gemini, qwen, tabnine): {{args}}
# * Markdown/prompt (claude, copilot, cursor-agent, opencode, qwen): $ARGUMENTS
# * TOML (gemini, tabnine): {{args}}
# This keeps formats readable without extra abstraction.
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This comment lists only a subset of Markdown/prompt agents, but many other agents in this script also use $ARGUMENTS. Consider either enumerating all Markdown-based agents here or rewording to avoid an incomplete list (e.g., “Markdown/prompt-based agents: $ARGUMENTS”).

Copilot uses AI. Check for mistakes.
@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!

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