Web Analytics

commands

⭐ 662 stars Simplified Chinese by wshobson

🌐 语言

Claude Code 斜杠命令

适用于 Claude Code 的生产级斜杠命令,通过智能自动化加速开发。

52 个命令,组织如下:

🤝 需要 Claude Code 子代理

这些命令可与 Claude Code 子代理 配合使用,以实现编排能力。

安装

cd ~/.claude
git clone https://github.com/wshobson/commands.git
git clone https://github.com/wshobson/agents.git  # Required for subagent orchestration

可用命令

使用方法

命令按目录分为 tools/workflows/,使用时需加上目录前缀:

/tools:api-scaffold user management with authentication
/tools:security-scan check for vulnerabilities
/workflows:feature-development implement chat functionality

注意:如果您希望使用无前缀的命令,可以将目录结构展平成一层:

cp tools/*.md .
cp workflows/*.md .
Claude Code 会根据上下文自动推荐相关命令。

🤖 工作流

复杂任务的多子代理编排:

功能开发

开发流程

子代理编排工作流

🔧 工具(单一用途命令)

AI 与机器学习

架构与代码质量

数据与数据库

DevOps 与基础设施

开发与测试

安全与合规

调试与分析

依赖与配置

文档与协作

成本优化

入职与环境配置

子代理工具

功能特性

命令数量

总计:52 条可用于生产环境的斜杠命令,按以下分类:

🤖 工作流(14 条命令)

🔧 工具(38 条命令)

使用示例

🤖 工作流程示例

# Implement a complete feature
/workflows:feature-development Add user authentication with OAuth2

Comprehensive code review

/workflows:full-review Review the authentication module

Smart issue resolution

/workflows:smart-fix Fix performance degradation in API response times

Modernize legacy system

/workflows:legacy-modernize Migrate monolithic Java app to microservices

Build comprehensive multi-platform feature

/workflows:full-stack-feature User authentication with social login across web and mobile

Implement security-first architecture

/workflows:security-hardening Harden API endpoints and implement zero-trust security model

Create data-driven ML feature

/workflows:data-driven-feature Build recommendation engine with real-time personalization

Optimize entire application stack

/workflows:performance-optimization Improve response times and reduce infrastructure costs

Respond to production incident

/workflows:incident-response High CPU usage causing service degradation in production

🔧 工具示例(单一功能命令)

# Create a user management API
/tools:api-scaffold user CRUD operations with JWT auth and role-based access

Review microservices architecture

/tools:multi-agent-review analyze our microservices for coupling and scalability issues

Optimize LLM chat application

/tools:prompt-optimize reduce latency for customer support chatbot while maintaining accuracy

Create fraud detection pipeline

/tools:data-pipeline real-time fraud detection with feature store and monitoring

Debug production issue

/tools:error-trace analyze high memory usage in production pods

Secure container images

/tools:security-scan scan and fix vulnerabilities in Docker images

Generate API documentation

/tools:doc-generate create OpenAPI docs with examples for REST endpoints

Onboard new developer

/tools:onboard Setup development environment for React/Node.js project

Multi-perspective code review

/tools:multi-agent-review Review authentication module

Deep debugging

/tools:smart-debug Investigate memory leak in production workers

Full-stack optimization

/tools:multi-agent-optimize Optimize checkout flow for better conversion

Save project context

/tools:context-save Save current project state and architectural decisions

Restore project context

/tools:context-restore Load context from last week's sprint

增强命令

安全与DevOps

#### /security-scan

全面安全扫描与自动修复。

#### /docker-optimize

高级容器优化策略。

#### /k8s-manifest

生产级Kubernetes部署。

前端与数据

#### /db-migrate

高级数据库迁移策略。

工作流与工具的结合

真正的优势在于将工作流与工具结合,实现完整的开发周期:

示例:构建新功能

# 1. Use a workflow to implement the feature with multiple subagents
/workflows:feature-development Add real-time chat feature with WebSocket support

2. Use tools for specific enhancements

/tools:test-harness Add integration tests for WebSocket connections /tools:security-scan Check for WebSocket vulnerabilities /tools:docker-optimize Optimize container for WebSocket connections

3. Use a workflow for comprehensive review

/workflows:full-review Review the entire chat feature implementation

示例:现代化遗留代码

# 1. Start with the modernization workflow
/workflows:legacy-modernize Migrate Express.js v4 app to modern architecture

2. Use specific tools for cleanup

/tools:deps-upgrade Update all dependencies to latest versions /tools:refactor-clean Remove deprecated patterns and dead code /tools:test-harness Ensure 100% test coverage

3. Optimize and deploy

/tools:docker-optimize Create multi-stage production build /tools:k8s-manifest Deploy with zero-downtime strategy

命令编排模式

命令可以单独使用,也可以组合成强大的模式:

顺序执行

# Build → Test → Secure → Deploy pipeline
/tools:api-scaffold user management API
/tools:test-harness comprehensive test suite for user API  
/tools:security-scan check user API for vulnerabilities
/tools:k8s-manifest deploy user API to production

并行分析

# Multiple perspectives on the same codebase
/tools:multi-agent-review comprehensive architecture and code review
/tools:security-scan audit security posture  
/workflows:performance-optimization identify and fix bottlenecks

Then consolidate findings

迭代改进

# Start broad, then narrow focus
/workflows:feature-development implement payment processing
/tools:security-scan focus on payment security
/tools:compliance-check ensure PCI compliance
/tools:test-harness add payment-specific tests

跨域集成

# Frontend + Backend + Infrastructure
/tools:api-scaffold backend payment API
/tools:multi-agent-optimize optimize payment flow performance
/tools:docker-optimize containerize payment service
/tools:monitor-setup payment metrics and alerts

何时使用工作流与工具

🔀 工作流 & 子代理工具

🛠️ 专业工具

示例:

🔧 何时使用工具:

示例:

命令格式

斜线命令是简单的 Markdown 文件,其中:

最佳实践

命令选择

高效使用

贡献指南

故障排查

命令未找到

工作流缓慢:正常 - 它们协调多个子代理

输出太通用:请添加更具体的技术栈信息

集成问题:请验证文件路径和命令顺序

性能提示

命令选择:

优化建议:

添加新工作流:

添加新工具:

了解更多

--- Tranlated By Open Ai Tx | Last indexed: 2025-09-08 ---