-
Notifications
You must be signed in to change notification settings - Fork 6.5k
fix: migrate Qwen Code CLI from TOML to Markdown format (#1589) #1730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,6 +132,16 @@ def commands_dir_gemini(project_dir): | |
| return cmd_dir | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def commands_dir_qwen(project_dir): | ||
| """Create a populated .qwen/commands directory (Markdown format).""" | ||
| cmd_dir = project_dir / ".qwen" / "commands" | ||
| 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 | ||
|
Comment on lines
+139
to
+142
|
||
|
|
||
|
|
||
| # ===== _get_skills_dir Tests ===== | ||
|
|
||
| class TestGetSkillsDir: | ||
|
|
@@ -390,6 +400,28 @@ def test_non_md_commands_dir_falls_back(self, project_dir): | |
| # .toml commands should be untouched | ||
| assert (cmds_dir / "speckit.specify.toml").exists() | ||
|
|
||
| def test_qwen_md_commands_dir_installs_skills(self, project_dir): | ||
| """Qwen now uses Markdown format; skills should install directly from .qwen/commands/.""" | ||
| cmds_dir = project_dir / ".qwen" / "commands" | ||
| cmds_dir.mkdir(parents=True) | ||
| (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" | ||
| ) | ||
|
|
||
| result = install_ai_skills(project_dir, "qwen") | ||
|
|
||
| assert result is True | ||
| skills_dir = project_dir / ".qwen" / "skills" | ||
| assert skills_dir.exists() | ||
| skill_dirs = [d.name for d in skills_dir.iterdir() if d.is_dir()] | ||
| assert len(skill_dirs) >= 1 | ||
| # .md commands should be untouched | ||
| assert (cmds_dir / "speckit.specify.md").exists() | ||
| assert (cmds_dir / "speckit.plan.md").exists() | ||
|
|
||
| @pytest.mark.parametrize("agent_key", [k for k in AGENT_CONFIG.keys() if k != "generic"]) | ||
| def test_skills_install_for_all_agents(self, temp_dir, agent_key): | ||
| """install_ai_skills should produce skills for every configured agent.""" | ||
|
|
@@ -443,6 +475,15 @@ def test_existing_commands_preserved_gemini(self, project_dir, templates_dir, co | |
| remaining = list(commands_dir_gemini.glob("speckit.*")) | ||
| assert len(remaining) == 3 | ||
|
|
||
| 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") | ||
|
|
||
|
Comment on lines
+478
to
+483
|
||
| remaining = list(commands_dir_qwen.glob("speckit.*")) | ||
| assert len(remaining) == 3 | ||
|
|
||
| def test_commands_dir_not_removed(self, project_dir, templates_dir, commands_dir_claude): | ||
| """install_ai_skills must not remove the commands directory.""" | ||
| install_ai_skills(project_dir, "claude") | ||
|
|
||
There was a problem hiding this comment.
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”).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Qwen was changed to Markdown/prompt, I only need to move Qwen up from the TOML list in the comment, that’s all.