Skip to content

Commit 73a9af7

Browse files
feat: add Qwen Code support to Spec Kit
Add comprehensive Qwen Code integration following existing patterns: - Add Qwen as fourth AI assistant option in CLI - Update all documentation to include Qwen CLI references - Extend GitHub Actions workflow for Qwen template generation - Add Qwen support to shell scripts and templates - Maintain backward compatibility with existing assistants
1 parent 5170521 commit 73a9af7

6 files changed

Lines changed: 51 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,34 @@ jobs:
146146
generate_commands "copilot" "prompt.md" "\$ARGUMENTS" "sdd-copilot-package/.github/prompts"
147147
echo "Created GitHub Copilot package"
148148
149+
# Create Qwen CLI package
150+
mkdir -p sdd-qwen-package
151+
cp -r sdd-package-base/* sdd-qwen-package/
152+
mkdir -p sdd-qwen-package/.qwen/commands
153+
generate_commands "qwen" "md" "\$ARGUMENTS" "sdd-qwen-package/.qwen/commands"
154+
if [ -f "agent_templates/qwen/QWEN.md" ]; then
155+
cp agent_templates/qwen/QWEN.md sdd-qwen-package/QWEN.md
156+
fi
157+
echo "Created Qwen CLI package"
158+
149159
# Create archive files for each package
150160
cd sdd-claude-package && zip -r ../spec-kit-template-claude-${{ steps.get_tag.outputs.new_version }}.zip . && cd ..
151161
152162
cd sdd-gemini-package && zip -r ../spec-kit-template-gemini-${{ steps.get_tag.outputs.new_version }}.zip . && cd ..
153163
154164
cd sdd-copilot-package && zip -r ../spec-kit-template-copilot-${{ steps.get_tag.outputs.new_version }}.zip . && cd ..
155165
166+
cd sdd-qwen-package && zip -r ../spec-kit-template-qwen-${{ steps.get_tag.outputs.new_version }}.zip . && cd ..
167+
156168
# List contents for verification
157169
echo "Claude package contents:"
158170
unzip -l spec-kit-template-claude-${{ steps.get_tag.outputs.new_version }}.zip | head -10
159171
echo "Gemini package contents:"
160172
unzip -l spec-kit-template-gemini-${{ steps.get_tag.outputs.new_version }}.zip | head -10
161173
echo "Copilot package contents:"
162174
unzip -l spec-kit-template-copilot-${{ steps.get_tag.outputs.new_version }}.zip | head -10
175+
echo "Qwen package contents:"
176+
unzip -l spec-kit-template-qwen-${{ steps.get_tag.outputs.new_version }}.zip | head -10
163177
164178
- name: Generate release notes
165179
if: steps.check_release.outputs.exists == 'false'
@@ -183,12 +197,13 @@ jobs:
183197
cat > release_notes.md << EOF
184198
Template release ${{ steps.get_tag.outputs.new_version }}
185199
186-
Updated specification-driven development templates for GitHub Copilot, Claude Code, and Gemini CLI.
200+
Updated specification-driven development templates for GitHub Copilot, Claude Code, Gemini CLI, and Qwen Code.
187201
188202
Download the template for your preferred AI assistant:
189203
- spec-kit-template-copilot-${{ steps.get_tag.outputs.new_version }}.zip
190204
- spec-kit-template-claude-${{ steps.get_tag.outputs.new_version }}.zip
191-
- spec-kit-template-gemini-${{ steps.get_tag.outputs.new_version }}.zip
205+
- spec-kit-template-gemini-${{ steps.get_tag.outputs.new_version }}.zip
206+
- spec-kit-template-qwen-${{ steps.get_tag.outputs.new_version }}.zip
192207
EOF
193208
194209
echo "Generated release notes:"
@@ -205,6 +220,7 @@ jobs:
205220
spec-kit-template-copilot-${{ steps.get_tag.outputs.new_version }}.zip \
206221
spec-kit-template-claude-${{ steps.get_tag.outputs.new_version }}.zip \
207222
spec-kit-template-gemini-${{ steps.get_tag.outputs.new_version }}.zip \
223+
spec-kit-template-qwen-${{ steps.get_tag.outputs.new_version }}.zip \
208224
--title "Spec Kit Templates - $VERSION_NO_V" \
209225
--notes-file release_notes.md
210226
env:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ These are one time installations required to be able to test your changes locall
1111
1. Install [Python 3.11+](https://www.python.org/downloads/)
1212
1. Install [uv](https://docs.astral.sh/uv/) for package management
1313
1. Install [Git](https://git-scm.com/downloads)
14-
1. Have an AI coding agent available: [Claude Code](https://www.anthropic.com/claude-code), [GitHub Copilot](https://code.visualstudio.com/), or [Gemini CLI](https://github.com/google-gemini/gemini-cli)
14+
1. Have an AI coding agent available: [Claude Code](https://www.anthropic.com/claude-code), [GitHub Copilot](https://code.visualstudio.com/), [Gemini CLI](https://github.com/google-gemini/gemini-cli), or [Qwen CLI](https://github.com/QwenLM/qwen-code)
1515

1616
## Submitting a pull request
1717

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Our research and experimentation focus on:
110110
## 🔧 Prerequisites
111111

112112
- **Linux/macOS** (or WSL2 on Windows)
113-
- AI coding agent: [Claude Code](https://www.anthropic.com/claude-code), [GitHub Copilot](https://code.visualstudio.com/), or [Gemini CLI](https://github.com/google-gemini/gemini-cli)
113+
- AI coding agent: [Claude Code](https://www.anthropic.com/claude-code), [GitHub Copilot](https://code.visualstudio.com/), [Gemini CLI](https://github.com/google-gemini/gemini-cli), or [Qwen CLI](https://github.com/QwenLM/qwen-code)
114114
- [uv](https://docs.astral.sh/uv/) for package management
115115
- [Python 3.11+](https://www.python.org/downloads/)
116116
- [Git](https://git-scm.com/downloads)
@@ -147,11 +147,12 @@ You will be prompted to select the AI agent you are using. You can also proactiv
147147
specify init <project_name> --ai claude
148148
specify init <project_name> --ai gemini
149149
specify init <project_name> --ai copilot
150+
specify init <project_name> --ai qwen
150151
# Or in current directory:
151152
specify init --here --ai claude
152153
```
153154

154-
The CLI will check if you have Claude Code or Gemini CLI installed. If you do not, or you prefer to get the templates without checking for the right tools, use `--ignore-agent-tools` with your command:
155+
The CLI will check if you have Claude Code, Gemini CLI, or Qwen CLI installed. If you do not, or you prefer to get the templates without checking for the right tools, use `--ignore-agent-tools` with your command:
155156

156157
```bash
157158
specify init <project_name> --ai claude --ignore-agent-tools

scripts/update-agent-context.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ NEW_PLAN="$FEATURE_DIR/plan.md"
1414
CLAUDE_FILE="$REPO_ROOT/CLAUDE.md"
1515
GEMINI_FILE="$REPO_ROOT/GEMINI.md"
1616
COPILOT_FILE="$REPO_ROOT/.github/copilot-instructions.md"
17+
QWEN_FILE="$REPO_ROOT/QWEN.md"
1718

1819
# Allow override via argument
1920
AGENT_TYPE="$1"
@@ -197,20 +198,24 @@ case "$AGENT_TYPE" in
197198
"copilot")
198199
update_agent_file "$COPILOT_FILE" "GitHub Copilot"
199200
;;
201+
"qwen")
202+
update_agent_file "$QWEN_FILE" "Qwen Code"
203+
;;
200204
"")
201205
# Update all existing files
202206
[ -f "$CLAUDE_FILE" ] && update_agent_file "$CLAUDE_FILE" "Claude Code"
203207
[ -f "$GEMINI_FILE" ] && update_agent_file "$GEMINI_FILE" "Gemini CLI"
204208
[ -f "$COPILOT_FILE" ] && update_agent_file "$COPILOT_FILE" "GitHub Copilot"
209+
[ -f "$QWEN_FILE" ] && update_agent_file "$QWEN_FILE" "Qwen Code"
205210
206211
# If no files exist, create based on current directory or ask user
207-
if [ ! -f "$CLAUDE_FILE" ] && [ ! -f "$GEMINI_FILE" ] && [ ! -f "$COPILOT_FILE" ]; then
212+
if [ ! -f "$CLAUDE_FILE" ] && [ ! -f "$GEMINI_FILE" ] && [ ! -f "$COPILOT_FILE" ] && [ ! -f "$QWEN_FILE" ]; then
208213
echo "No agent context files found. Creating Claude Code context file by default."
209214
update_agent_file "$CLAUDE_FILE" "Claude Code"
210215
fi
211216
;;
212217
*)
213-
echo "ERROR: Unknown agent type '$AGENT_TYPE'. Use: claude, gemini, copilot, or leave empty for all."
218+
echo "ERROR: Unknown agent type '$AGENT_TYPE'. Use: claude, gemini, copilot, qwen, or leave empty for all."
214219
exit 1
215220
;;
216221
esac
@@ -227,8 +232,9 @@ if [ ! -z "$NEW_DB" ] && [ "$NEW_DB" != "N/A" ]; then
227232
fi
228233
229234
echo ""
230-
echo "Usage: $0 [claude|gemini|copilot]"
235+
echo "Usage: $0 [claude|gemini|copilot|qwen]"
231236
echo " - No argument: Update all existing agent context files"
232237
echo " - claude: Update only CLAUDE.md"
233238
echo " - gemini: Update only GEMINI.md"
234-
echo " - copilot: Update only .github/copilot-instructions.md"
239+
echo " - copilot: Update only .github/copilot-instructions.md"
240+
echo " - qwen: Update only QWEN.md"

src/specify_cli/__init__.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
AI_CHOICES = {
5252
"copilot": "GitHub Copilot",
5353
"claude": "Claude Code",
54-
"gemini": "Gemini CLI"
54+
"gemini": "Gemini CLI",
55+
"qwen": "Qwen Code"
5556
}
5657

5758
# ASCII Art Banner
@@ -638,7 +639,7 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, is_curr
638639
@app.command()
639640
def init(
640641
project_name: str = typer.Argument(None, help="Name for your new project directory (optional if using --here)"),
641-
ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, or copilot"),
642+
ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, copilot, or qwen"),
642643
ignore_agent_tools: bool = typer.Option(False, "--ignore-agent-tools", help="Skip checks for AI agent tools like Claude Code"),
643644
no_git: bool = typer.Option(False, "--no-git", help="Skip git repository initialization"),
644645
here: bool = typer.Option(False, "--here", help="Initialize project in the current directory instead of creating a new one"),
@@ -648,7 +649,7 @@ def init(
648649
649650
This command will:
650651
1. Check that required tools are installed (git is optional)
651-
2. Let you choose your AI assistant (Claude Code, Gemini CLI, or GitHub Copilot)
652+
2. Let you choose your AI assistant (Claude Code, Gemini CLI, GitHub Copilot, or Qwen Code)
652653
3. Download the appropriate template from GitHub
653654
4. Extract the template to a new project directory or current directory
654655
5. Initialize a fresh git repository (if not --no-git and no existing repo)
@@ -659,6 +660,7 @@ def init(
659660
specify init my-project --ai claude
660661
specify init my-project --ai gemini
661662
specify init my-project --ai copilot --no-git
663+
specify init my-project --ai qwen
662664
specify init --ignore-agent-tools my-project
663665
specify init --here --ai claude
664666
specify init --here
@@ -737,6 +739,10 @@ def init(
737739
if not check_tool("gemini", "Install from: https://github.com/google-gemini/gemini-cli"):
738740
console.print("[red]Error:[/red] Gemini CLI is required for Gemini projects")
739741
agent_tool_missing = True
742+
elif selected_ai == "qwen":
743+
if not check_tool("qwen", "Install from: https://github.com/QwenLM/qwen-code"):
744+
console.print("[red]Error:[/red] Qwen CLI is required for Qwen Code projects")
745+
agent_tool_missing = True
740746
# GitHub Copilot check is not needed as it's typically available in supported IDEs
741747

742748
if agent_tool_missing:
@@ -824,6 +830,12 @@ def init(
824830
steps_lines.append(" - See GEMINI.md for all available commands")
825831
elif selected_ai == "copilot":
826832
steps_lines.append(f"{step_num}. Open in Visual Studio Code and use [bold cyan]/specify[/], [bold cyan]/plan[/], [bold cyan]/tasks[/] commands with GitHub Copilot")
833+
elif selected_ai == "qwen":
834+
steps_lines.append(f"{step_num}. Use / commands with Qwen CLI")
835+
steps_lines.append(" - Run qwen /specify to create specifications")
836+
steps_lines.append(" - Run qwen /plan to create implementation plans")
837+
steps_lines.append(" - Run qwen /tasks to generate tasks")
838+
steps_lines.append(" - See QWEN.md for all available commands")
827839

828840
step_num += 1
829841
steps_lines.append(f"{step_num}. Update [bold magenta]CONSTITUTION.md[/bold magenta] with your project's non-negotiable principles")
@@ -856,11 +868,12 @@ def check():
856868
console.print("\n[cyan]Optional AI tools:[/cyan]")
857869
claude_ok = check_tool("claude", "Install from: https://docs.anthropic.com/en/docs/claude-code/setup")
858870
gemini_ok = check_tool("gemini", "Install from: https://github.com/google-gemini/gemini-cli")
871+
qwen_ok = check_tool("qwen", "Install from: https://github.com/QwenLM/qwen-code")
859872

860873
console.print("\n[green]✓ Specify CLI is ready to use![/green]")
861874
if not git_ok:
862875
console.print("[yellow]Consider installing git for repository management[/yellow]")
863-
if not (claude_ok or gemini_ok):
876+
if not (claude_ok or gemini_ok or qwen_ok):
864877
console.print("[yellow]Consider installing an AI assistant for the best experience[/yellow]")
865878

866879

templates/plan-template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
→ Update Progress Tracking: Initial Constitution Check
1717
4. Execute Phase 0 → research.md
1818
→ If NEEDS CLARIFICATION remain: ERROR "Resolve unknowns"
19-
5. Execute Phase 1 → contracts, data-model.md, quickstart.md, agent-specific template file (e.g., `CLAUDE.md` for Claude Code, `.github/copilot-instructions.md` for GitHub Copilot, or `GEMINI.md` for Gemini CLI).
19+
5. Execute Phase 1 → contracts, data-model.md, quickstart.md, agent-specific template file (e.g., `CLAUDE.md` for Claude Code, `.github/copilot-instructions.md` for GitHub Copilot, `GEMINI.md` for Gemini CLI, or `QWEN.md` for Qwen Code).
2020
6. Re-evaluate Constitution Check section
2121
→ If new violations: Refactor design, return to Phase 1
2222
→ Update Progress Tracking: Post-Design Constitution Check
@@ -171,7 +171,7 @@ ios/ or android/
171171
- Quickstart test = story validation steps
172172

173173
5. **Update agent file incrementally** (O(1) operation):
174-
- Run `/scripts/update-agent-context.sh [claude|gemini|copilot]` for your AI assistant
174+
- Run `/scripts/update-agent-context.sh [claude|gemini|copilot|qwen]` for your AI assistant
175175
- If exists: Add only NEW tech from current plan
176176
- Preserve manual additions between markers
177177
- Update recent changes (keep last 3)

0 commit comments

Comments
 (0)