A powerful collection of "hybrid prompt chaining" slash prompts for qwen-code
CLI tool. These prompts combine multi-shot analysis with single-shot efficiency, leveraging gemini-cli
integration to deliver 72% faster execution and 91.7% success rate across development workflows (tested across 5 repositories).
This repository contains 45 carefully crafted TOML prompt files that extend qwen-code's functionality with specialized commands for code analysis, project planning, security auditing, and more. Each prompt uses hybrid prompt chaining - a technique that combines the thoroughness of multi-shot prompts with the efficiency of single-shot execution, resulting in 36-83% fewer tokens while maintaining comprehensive analysis quality.
- Hybrid Prompt Chaining: Multi-shot thoroughness with single-shot efficiency (91.7% success rate, benchmarked)
- Intelligent Code Analysis: Deep codebase understanding with architecture mapping
- Project Planning: Sprint planning and strategic development roadmaps
- Security Auditing: Professional reports with severity levels and impact assessments
- Shell Integration: Advanced prompts with embedded shell command execution
- Quality Metrics: Code quality, technical debt, and performance analysis
- Documentation: Automated documentation generation and standards
- Performance Optimized: 72% faster execution with 36-83% fewer tokens than traditional approaches (see benchmarks)
Slash prompts have shell execution capabilities and can run commands on your system. Malicious prompts could potentially harm your system, access sensitive files, or exfiltrate data. Be responsible, and review prompts prior to installation.
Before installing:
- Read our SECURITY.md file completely
- Manually review each
.toml
file for suspicious commands - Test in isolated environments first
- Verify all shell commands (backticks) are safe
Never install prompts from untrusted sources without thorough review.
-
Security First: Read SECURITY.md and review all prompt files
-
Clone this repository:
git clone https://github.com/samestrin/qwen-prompts.git cd qwen-prompts
-
Review each prompt file in the
commands/
directory before copying -
Copy the command files to your qwen-code commands directory:
cp commands/*.toml ~/.qwen/commands/
-
Move to your project directory, start qwen-code, and use the slash commands:
cd your-project-directory qwen
Category | Command | Description | Type | Output |
---|---|---|---|---|
Analysis | /analyze:dependency |
Analyze project dependencies and relationships | Multi-shot | Console |
Analysis | /analyze:implementation |
Verify implementation against requirements | Multi-shot | Console |
Analysis | /analyze:performance |
Performance bottleneck analysis | Multi-shot | Console |
Analysis | /analyze:repo |
Comprehensive repository analysis with statistics | Single-shot + Shell | Console |
Analysis | /analyze:security |
Comprehensive security vulnerability assessment | Multi-shot | Console |
Analysis | /analyze:tech-debt |
Technical debt identification and prioritization | Multi-shot | Console |
Analysis | /analyze:vulnerabilities |
Comprehensive vulnerability scanning and assessment | Multi-shot | Console |
Code | /code:analysis |
High-level codebase analysis with architecture mapping | Multi-shot | Console |
Code | /code:quality |
Comprehensive code quality analysis and recommendations | Multi-shot | Console |
Code | /code:review |
Comprehensive code review with severity-based findings | Multi-shot | Console |
Comparison | /compare:dirs |
Compare and analyze directory structures | Multi-shot | Console |
Comparison | /compare:files |
Compare and analyze file differences | Multi-shot | Console |
Creation | /create:cost-analysis |
Project cost and resource analysis | Multi-shot | Console |
Creation | /create:prd |
Product Requirements Document generation | Multi-shot | Console |
Creation | /create:sprint |
Generate detailed sprint plans with shell integration | Multi-shot + Shell | Console |
Creation | /create:tdd |
Test-Driven Development documentation | Multi-shot | Console |
Creation | /create:tutorial |
Create step-by-step tutorials | Multi-shot | Console |
Documentation | /docs:create-standard |
Establish documentation standards | Multi-shot | Console |
Documentation | /docs:generate-from-standard |
Generate documentation following standards | Multi-shot | Console |
Documentation | /docs:update-standard |
Update existing documentation | Multi-shot | Console |
File | /file:delete |
Delete specified files with confirmation | Single-shot | Console |
File | /file:merge |
Merge multiple files into a single output file | Single-shot | File |
File | /file:save |
Save the last response to a specified filename | Single-shot | File |
Find | /find:patterns |
Find and analyze code patterns across projects | Multi-shot | Console |
Git | /git:add |
Stage files for commit with intelligent selection | Single-shot + Shell | Console |
Git | /git:add:fast |
Quick file staging with minimal prompts | Single-shot + Shell | Console |
Git | /git:branch |
Branch management and analysis | Single-shot + Shell | Console |
Git | /git:commit |
Create commits with comprehensive messaging | Single-shot + Shell | Console |
Git | /git:commit:fast |
Quick commit creation with minimal prompts | Single-shot + Shell | Console |
Git | /git:merge |
Merge branches with conflict resolution guidance | Single-shot + Shell | Console |
Git | /git:pull |
Pull changes with merge conflict handling | Single-shot + Shell | Console |
Git | /git:push |
Push changes with branch management | Single-shot + Shell | Console |
Git | /git:status |
Comprehensive repository status analysis | Single-shot + Shell | Console |
Git | /git:status:fast |
Quick repository status check | Single-shot + Shell | Console |
Initialize | /initialize:coding-rules |
Create platform-specific coding rules | Multi-shot | File |
Initialize | /initialize:coding-standard |
Generate base coding standard template | Single-shot | File |
Initialize | /initialize:gitignore |
Generate comprehensive .gitignore files | Single-shot | File |
Initialize | /initialize:planning |
Set up project planning directory structure | Single-shot | File |
Initialize | /initialize:update-coding-rules |
Update existing platform-specific rules | Multi-shot | File |
Save | /save:file |
Save content to specified file location | Single-shot | File |
Save | /save:merge |
Merge and save multiple content sources | Single-shot | File |
Single-Shot | /single:analyze:security |
Single-shot security analysis for benchmarking | Single-shot | Console |
Single-Shot | /single:code:analysis |
Single-shot code analysis variant | Single-shot | Console |
Strategy | /strategy:extract-business-logic |
Extract and analyze business logic patterns | Multi-shot | Console |
Strategy | /strategy:plan |
Create strategic implementation plans | Multi-shot | Console |
Test | /test:coverage |
Test coverage analysis and recommendations | Multi-shot | Console |
Test | /test:review-and-correct |
Generate review and correction documents for test failures | Multi-shot | Console |
Note: The /single:
namespace contains single-shot variants of existing commands designed for testing and benchmarking purposes. These commands provide a direct comparison point against their multi-stage counterparts to evaluate performance and output quality differences.
Comprehensive documentation is available for all commands:
- Complete Command Documentation - Detailed documentation for all 45 commands organized by category
- Quick Reference Guide - Command cheat sheet and common patterns
- Common Workflows - Step-by-step workflow examples for real-world scenarios
- Troubleshooting Guide - Solutions for common issues and problems
- Documentation Directory - Complete documentation overview with benchmarks and evaluations
- Security Guidelines - Important security considerations for shell-integrated workflows
Simple, direct commands that execute once and return results immediately.
Example: /code:analysis
prompt = """
The **MAIN_DIRECTORIES** is "`gemini -p ...`"
### Analysis
`gemini -p "{MAIN_DIRECTORIES} Provide comprehensive analysis..."`
"""
Advanced prompts that combine multi-shot thoroughness with single-shot efficiency. These prompts perform multiple analysis steps in a single execution, delivering comprehensive results with optimal performance.
Example: /code:analysis
with --comprehensive
flag
prompt = """
The **MAIN_DIRECTORIES** is "`gemini -p ...`"
### Analysis
`gemini -p "{MAIN_DIRECTORIES} Provide comprehensive analysis..."`
"""
Performance Benefits: 72% faster execution, 36-83% fewer tokens, 91.7% success rate (benchmarked)
Advanced prompts that leverage shell command execution for dynamic behavior and file system operations.
Example: /create:sprint
with sprint numbering
The **CURRENT_HIGHEST_SPRINT** is "`find ./planning/sprints/active ./planning/sprints/completed -name \"*.md\" 2>/dev/null | sed 's|.*/||' | sed 's/_.*$//' | grep -E '^[0-9]+(\\\\.[0-9]+)*$' | sort -V | tail -1`"
Prompts use various sophisticated approaches to detect relevant directories based on their specific purpose:
Package-Based Detection (Analysis & Strategy prompts):
package.json
(Node.js projects)pyproject.toml
(Python projects)composer.json
(PHP projects)
Test Directory Discovery (Test prompts):
- Searches for
*test*
,*spec*
,e2e
,integration
,cypress
,__tests__
directories - Excludes
node_modules
and.git
directories
Direct Shell Commands (Git & File prompts):
git status
,git branch
,find
commands for repository operations- File system operations with
date
,pwd
,wc
commands
No Directory Detection (Single-shot & Save prompts):
- Direct execution without directory analysis for maximum speed
Advanced prompts use backtick shell execution for:
- File system analysis
- Dynamic content generation
- Project state detection
- Automated numbering systems
Multi-layered analysis approach:
- Project Structure Analysis
- Architecture Assessment
- Security Evaluation
- Performance Review
- Documentation Audit
# Analyze entire codebase
/code:analysis
# Save your code analysis to a file, after running either previous command
/file:save @code_analysis.md
# Create sprint plan for new feature
/create:sprint Implement user authentication with JWT
# Plan database migration
/create:sprint Migrate user data to new schema
# Create focused review document for troublesome test suite
/test:review-and-correct @test_authentication.py
# This creates a sub-sprint document like:
# planning/sprints/active/1.1_review_and_correct_test_authentication.py.md
The /test:review-and-correct
command creates structured sub-sprint documents for systematic test resolution. When working through a main sprint (e.g., 1_add_jwt_authentication.md
) and encountering difficult test suites, this command generates focused review documents with:
- Systematic Resolution Strategy: Step-by-step checkboxes for environment setup, individual test resolution, and validation
- Detailed Failure Analysis: Specific error analysis with actual test method names and potential fixes
- Platform Detection: Automatic detection of testing framework (pytest, jest, phpunit) and appropriate commands
- Priority-Based Actions: Critical, important, and improvement actions organized by urgency
- Progress Tracking: Checkboxes for incremental completion and root cause analysis
This approach provides additional structure for coding agents when test suite completion becomes overly complex, ensuring no test failures are overlooked during sprint execution.
# General security audit
/analyze:security
# Focus on specific area
/analyze:security focusing on authentication and authorization
Complex prompts perform sequential analysis steps:
- Project discovery
- Architecture analysis
- Risk assessment
- Recommendation generation
Prompts adapt their analysis based on:
- Project type and language
- Existing architecture patterns
- Development stage
- Team size and complexity
Contributions are welcome! When adding new prompts:
- Follow the existing TOML structure
- Include comprehensive documentation headers
- Test with various project types
- Ensure proper shell command escaping
- Add usage examples
This collection is featured in the blog article "72% Faster AI Workflows: How Hybrid Prompt Chaining with Qwen Code and Gemini CLI Boosts Efficiency" on medium.com. The article demonstrates how Hybrid Prompt Chaining revolutionizes AI development workflows by combining the best of both multi-shot and single-shot approaches.
Proven Performance: Benchmarks across six diverse repositories consistently show:
- 72% faster execution compared to traditional multi-shot approaches
- 36-83% fewer tokens required for comprehensive analysis
- 91.7% success rate across all test scenarios
- Superior ROI through reduced API costs and faster development cycles
Current Version: 1.4.1
For detailed version history, feature updates, and breaking changes, see CHANGELOG.md.
If you find qwen-prompts
useful, please consider starring the repository and supporting the project:
MIT License - see LICENSE file for details.
- qwen-code - The main CLI tool
- gemini-cli - The underlying CLI tool
Note: These prompts are designed to work with qwen-code's interactive mode and leverage Gemini's capabilities for optimal performance and context handling.