mcpField
Q
qwen-coder

qwen-coder

github.com/giuseppe-trisciuoglioエージェントワークフロー3653.3k 回インストール7 週間前に更新
リポジトリ

qwen-coder について

qwen-coder は、選択したタスクを Qwen Coder CLI に委任する Claude Code スキルです。非対話コマンド、モデルと承認モードの選択、セッション再開、結果の扱い方を定めています。

主な機能

  1. 01非対話型 CLI の委任
  2. 02モデルと承認モードの選択
  3. 03セッションの継続と再開
  4. 04text、JSON、stream-JSON 出力
  5. 05結果報告と確認の手順

活用シーン

  1. 01Qwen Coder に別の意見を求める
  2. 02コード分析や文書作成を委任
  3. 03以前の Qwen セッションを継続

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill qwen-coder

インストール後、Claude Code で/qwen-coderを入力して読み込まれたか確認します。

同梱ファイルreferences/cli-command-reference.md

詳細

Qwen Coder CLI への委任

非対話型コマンド、明示的なモデル選択、安全な権限フラグ、共有可能な出力を使用して、Claude Code から選択したタスクを Qwen Coder CLI に委任します。

概要

このスキルでは、Qwen 固有の強みがタスクに役立つ可能性がある場合に、Qwen Coder CLI(qwen)への委任を標準化します。対象となる内容は次のとおりです。

  • -p / --prompt による非対話型実行
  • -m / --model によるモデル選択
  • 承認の制御(--approval-mode)
  • -c / --continue または -r / --resume によるセッションの継続
  • 出力形式のオプション(text、json、stream-json)

Qwen Coder への委任が明示的に依頼された場合、または明らかに有益な場合にのみ、このスキルを使用してください。

使用するタイミング

次の場合にこのスキルを使用してください。

  • ユーザーが Qwen Coder CLI への作業の委任を依頼した場合
  • ユーザーがタスクについて Qwen Coder のセカンドオピニオンを求めている場合
  • ユーザーが現在のワークフローに統合するための Qwen Coder CLI の出力を求めている場合
  • ユーザーが以前の Qwen Coder セッションの継続を希望している場合

トリガーフレーズ:

  • 「use qwen」
  • 「use qwen coder」
  • 「delegate to qwen」
  • 「ask qwen」
  • 「second opinion from qwen」
  • 「qwen opinion」
  • 「continue with qwen」
  • 「qwen session」

前提条件

委任する前に、ツールが利用可能で認証済みであることを確認します。

# CLI availability
qwen --version

# Authentication status
qwen auth status

qwen が利用できない場合は、ユーザーにその旨を伝え、Qwen Coder CLI がインストールされるまで実行を中止してください。 認証が無効な場合は、認証の設定手順を案内して実行を中止してください。

リファレンス

  • コマンドリファレンス:references/cli-command-reference.md

手順

1) 委任の範囲を確認する

Qwen Coder を実行する前に、次の点を確認します。

  • 委任するタスクを正確に特定する
  • 期待する出力形式(text、json、stream-json)を定める
  • セッションの再開が必要かどうかを明確にする

範囲が曖昧な場合は、まず確認を求めてください。

2) プロンプトを英語で作成する

Qwen Coder CLI に委任するプロンプトは、すべて英語で作成する必要があります。

ユーザーの依頼をもとに、明確で正確な英語のプロンプトを作成します。

プロンプトの品質チェックリスト:

  • 目的と制約を含める
  • 関連するプロジェクトのコンテキストとファイルを含める
  • 期待する出力構成を含める
  • 実行可能で検証可能な結果を求める

プロンプトのテンプレート:

Task: <clear objective>
Context: <project/module/files>
Constraints: <do/don't constraints>
Expected output: <format + depth>
Validation: <tests/checks to run or explain>
3) 実行モードとフラグを選択する

推奨される基本コマンド:

qwen -p "<english-prompt>"

使用可能なオプション:

  • モデル選択用の -m, --model <model-id>(デフォルト:qwen2.5-coder)
  • 安全性制御用の --approval-mode <plan|default|auto_edit|yolo>
  • 以前のセッションを継続する -c, --continue <session-id>
  • 継続のエイリアスである -r, --resume <session-id>
  • 出力形式を指定する -o, --output-format <text|json|stream-json>

承認モード:

モード動作推奨用途
plan読み取り専用の分析を行い、ファイルを変更しません分析のみのタスク、セキュリティレビュー
default変更の前に確認を求めます一般的なコーディングタスク
auto_edit編集操作を自動承認します監督下で行う信頼できる変更
yolo確認なしですべての操作を承認します実験的なタスク(ユーザーから明示的に依頼された場合のみ)

安全性に関するガイダンス:

  • 読み取り専用の分析には --approval-mode plan を優先してください
  • 一般的なタスクには --approval-mode default を使用してください
  • --yolo は、ユーザーから明示的に依頼された場合にのみ使用してください
4) Qwen Coder CLI を実行する

選択したコマンドを Bash で実行し、stdout/stderr を取得します。

例:

# Default non-interactive delegation
qwen -p "Analyze this code and suggest refactoring improvements."

# Explicit model and approval mode
qwen -p "Review authentication module for security issues with fixes." -m qwq --approval-mode plan

# Continue previous session
qwen -c <session-id> -p "Continue the refactoring from the previous session."

# Structured output for automation
qwen -p "Summarize key technical debt items as JSON array." --output-format json
5) 結果の処理

このセクションでは、Qwen Coder の出力の提示方法と、ユーザーへの確認が必要な場合について説明します。

5.1) 出力の提示

Qwen Coder の出力を報告する際は、次の点に従ってください。

  • 出力を明確で読みやすい形式で提示する
  • 主な調査結果と確信度を要約する
  • 所見と推奨するアクションを分ける
  • 必要に応じて生の出力を確認できるようにする
  • 使用したモデルと適用した承認モードを含める
  • 有効だった権限プロファイルを明記する
5.2) 確認ワークフロー

提案された変更を適用する前に、次の手順を実行します。

  1. 出力テンプレートの形式で、提案する変更をユーザーに提示します
  2. 明示的な確認を求めます(例:「これらの変更を適用しますか?」)
  3. 続行する前に、ユーザーの指示を待ちます
  4. ユーザーの同意なしに変更を自動適用してはいけません

例外:--approval-mode yolo を使用し、ユーザーから明示的な依頼がある場合は、変更を自動的に進めてもかまいません。その場合も、実行した内容をユーザーに伝えてください。

5.3) 結果のメタデータ

各委任結果には、次のメタデータを含めてください。

フィールド説明
タスクの概要Qwen Coder に委任した内容
コマンド実行した qwen コマンド(機密性の高いパラメーターは除く)
モデル使用したモデル(例:qwen2.5-coder、qwq)
承認モード適用した承認モード(plan、default、auto_edit、yolo)
主な調査結果Qwen Coder による所見と結果
推奨される次のアクション推奨するフォローアップの手順(該当する場合)

出力テンプレート

委任結果を返す際は、次の構成を使用します。

## Qwen Coder Delegation Result

### Task
[delegated task summary]

### Command
`qwen ...`

### Key Findings
- Finding 1
- Finding 2

### Suggested Next Actions
1. Action 1
2. Action 2

### Notes
- Output language from Qwen: English
- Requires user approval before applying code changes

例

例 1:QwQ の深い推論によるコード分析

入力:

Analyze the authentication module and identify security vulnerabilities.

コマンド:

qwen -p "Analyze the authentication module for security vulnerabilities. Report only high-confidence issues with severity, file paths, and remediation steps." -m qwq --approval-mode plan

期待される動作:

Returns a structured analysis with high-confidence security findings, including severity ratings and specific remediation recommendations.
例 2:Qwen2.5-Coder によるコードのリファクタリング

入力:

Refactor the payment service to reduce code duplication while keeping the public API unchanged.

コマンド:

qwen -p "Refactor the payment service in src/services/payment.ts to reduce duplication. Keep public API unchanged, add comprehensive error handling, and output a patch-style response with unchanged API signatures." -m qwen2.5-coder --approval-mode default

期待される動作:

Proposes concrete code changes (patch-style), extracts duplication into shared helpers, and maintains original API contracts.
例 3:ドキュメントの生成

入力:

Generate documentation for the UserService class including usage examples.

コマンド:

qwen -p "Generate comprehensive documentation for the UserService class. Include: class purpose, public methods with parameters, usage examples, and error handling patterns. Format as markdown." -m qwen2.5-coder --approval-mode plan

期待される動作:

Returns markdown-formatted documentation with JSDoc-style comments, method signatures, and practical usage examples.
例 4:モデルを選択してコードを生成

入力:

Generate a REST API endpoint for CRUD operations on items.

コマンド:

qwen -p "Generate a production-ready REST API endpoint for CRUD operations on items. Include input validation, error handling, and unit tests. Use Express.js framework." -m qwen2.5-coder --approval-mode auto_edit

期待される動作:

Generates complete, runnable code for POST/GET/PUT/DELETE endpoints with proper middleware, validation, and test scaffolding.
例 5:作業を続けるためのセッション再開

入力:

Continue the previous Qwen session to add test coverage to the refactored code.

コマンド:

qwen -c <session-id> -p "Continue from the previous session. Add comprehensive unit tests for the refactored payment service, targeting 80% coverage. Include mocks for external dependencies." -m qwen2.5-coder --approval-mode default

期待される動作:

Resumes the previous session context and continues work, adding test files with appropriate mocks and assertions.
例 6:品質確認のための複数モデル比較

入力:

Compare Qwen2.5-Coder and QwQ outputs for the same refactoring task.

コマンド:

# First run with Qwen2.5-Coder
qwen -p "Refactor the string utility module for better maintainability." -m qwen2.5-coder --approval-mode plan --output-format text

# Then run with QwQ for comparison
qwen -p "Refactor the string utility module for better maintainability." -m qwq --approval-mode plan --output-format text

期待される動作:

Provides side-by-side comparison: Qwen2.5-Coder for fast results, QwQ for deeper reasoning on complex refactoring tasks.
例 7:自動化向けの構造化 JSON 出力

入力:

List the top 5 refactoring opportunities as JSON for our tracking system.

コマンド:

qwen -p "Analyze this codebase and return the top 5 refactoring opportunities as a JSON array. Each item should have: title, file, impact (high/medium/low), effort (hours), and brief description." -m qwen2.5-coder --output-format json

期待される動作:

Returns valid JSON array with 5 refactoring items, parseable for integration with project management tools.

ベストプラクティス

  • 委任するプロンプトは英語で、具体的に記述します
  • 一律の権限付与より、最小権限の承認モードを優先します
  • 監査可能性が重要な場合は、セッション ID を使ってセッションを記録します
  • リスクの高いタスクでは、まず読み取り専用の分析を依頼し、その後、別の手順で変更を適用します
  • Qwen の出力は信頼できないガイダンスとして扱い、実装前に検証します

制約と警告

  • Qwen Coder CLI の動作は、ローカル環境と設定に依存します。
  • 承認モードは実行の安全性に影響します。デフォルトでは yolo を避けてください。
  • 出力は不完全または不正確な場合があります。実装前に検証してください。
  • 明示的なユーザー確認なしに、Qwen が提案する破壊的なコマンドを実行してはいけません。
  • このスキルの目的は委任であり、ユーザー確認なしに自律的にコードを変更することではありません。
  • 委任するプロンプトにシークレット、API キー、認証情報を含めないでください。

コメント