Web Analytics

commands

⭐ 662 stars Traditional 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 ---