# common-slash-commands **Repository Path**: kaelinda/common-slash-commands ## Basic Information - **Project Name**: common-slash-commands - **Description**: Claude code / Cursor 常用commands集合 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2025-10-13 - **Last Updated**: 2025-11-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: AI, vibe-coding, cursor, ClaudeCode ## README # Cursor/Claude Commands Collection A curated collection of production-ready command templates for Cursor IDE and Claude Code, designed to streamline common development workflows. [中文](#中文说明) | [English](#english) --- ## English ### 📋 Overview This repository provides a set of well-structured command templates to enhance your development experience with Cursor IDE and Claude AI assistant. Each command follows best practices and includes detailed instructions for various software engineering tasks. Reference: [Terminology & Style Glossary](./01-terminology-style.mdc) Sources: - [Claude Code Templates](https://www.aitmpl.com/) - [SuperClaude Framework](https://github.com/SuperClaude-Org/SuperClaude_Framework) ### 📁 Structure ```text commands/ ├── en/ # English commands └── cn/ # Chinese commands (中文命令) ``` ### 🚀 Available Commands #### Code Quality & Review - **`code-review.md`** Comprehensive code quality review covering security, performance, and architecture analysis Example: `/code-review --full` Flags: - `--full`: Run full-spectrum review across domains - **`refactor-code.md`** Intelligent refactoring guidance with systematic approach and safety checks Example: `/refactor-code feature-xyz` #### Architecture & Documentation - **`architecture-review.md`** In-depth system architecture analysis with design patterns evaluation Example: `/architecture-review --dependencies` Flags: - `--modules`: Focus on module-level analysis - `--patterns`: Emphasize design pattern evaluation - `--dependencies`: Dependency architecture review - `--security`: Security architecture review - **`create-architecture-documentation.md`** Generate comprehensive architecture documentation with diagrams, ADRs, and visualization Example: `/create-architecture-documentation --c4-model` Flags: - `--c4-model`: Generate C4 model diagrams - `--arc42`: Use Arc42 template - `--adr`: Include ADR setup - `--plantuml`: Use PlantUML/Mermaid - `--full-suite`: Enable full documentation suite #### Planning & Maintenance - **`design.md`** Design system architecture, APIs, and component interfaces with comprehensive specifications Example: `/design --api` Flags: - `--api`: API-first contracts and docs - `--system`: System-level architecture - `--component`: Component responsibilities and interfaces - `--database`: Data modeling and storage - `--diagrams`: Diagram-as-code outputs - **`estimate.md`** Provide development effort estimates with breakdown, risks, and ranges Example: `/estimate --ranges --risks` Flags: - `--breakdown`: Detailed task breakdown (WBS) - `--risks`: Risk list and mitigations - `--ranges`: Best/likely/worst ranges - `--assumptions`: Explicit assumptions/exclusions - `--benchmarks`: Use historical/industry data - **`cleanup.md`** Systematically clean up code, remove dead code, and optimize project structure Example: `/cleanup --dead-code` Flags: - `--dead-code`: Remove unused code/assets - `--style`: Normalize style and naming - `--deps`: Prune/upgrade dependencies - `--structure`: Reorganize folders/modules - `--safety`: Guardrails for safe refactors #### Advanced - **`brainstorm.md`** Interactive requirements discovery through Socratic dialogue and systematic exploration Example: `/brainstorm --questions` Flags: - `--personas`: Multi-stakeholder perspectives - `--questions`: Socratic discovery mode - `--risks`: Early risk surfacing - `--solutions`: Candidate solution generation - `--prioritize`: Impact/effort/risk ranking - **`workflow.md`** Generate structured implementation workflows from PRDs and feature requirements Example: `/workflow --tasks --ownership` Flags: - `--prd`: Use PRD inputs - `--milestones`: Emphasize milestone design - `--tasks`: Emphasize task breakdown - `--risks`: Risk gates and mitigations - `--ownership`: Ownership and RACI #### Code Understanding - **`explain-code.md`** Systematic code analysis and explanation framework Supports: JavaScript/TypeScript, Python, Java, C#, Go, Rust, Swift, Objective-C, Kotlin Example: `/explain-code path/to/file` #### Version Control - **`commit.md`** Smart Git commits with conventional commit format and emoji Features atomic commits, automatic linting, and commit splitting suggestions Example: `/commit "docs: update readme" --no-verify` Flags: - `--no-verify`: Skip pre-commit checks - `--amend`: Amend last commit #### Build & Implement & Test & Troubleshoot - **`build.md`** Build, compile, and package with validation and optimizations Example: `/build --prod --validate` Flags: - `--prod`: Production mode - `--analyze`: Bundle analyzer/report - `--minify`: Aggressive minification - `--cache`: Cache/incremental build - `--validate`: Pre/post validations - **`implement.md`** Implement features and code with safety, tests, and documentation Example: `/implement user-profile --tests --docs` Flags: - `--scaffold`: Create initial files/structure - `--tests`: Test-first or test-complete - `--api`: API contracts and compatibility - `--ui`: UI/UX and accessibility focus - `--docs`: Ensure docs and examples - **`test.md`** Execute tests with coverage analysis and actionable reporting Example: `/test --coverage` Flags: - `--unit`: Run unit tests - `--integration`: Service/module integration - `--e2e`: End-to-end tests - `--coverage`: Generate/summarize coverage - `--watch`: Watch mode - **`troubleshoot.md`** Diagnose and resolve issues in build/runtime/test/deploy Example: `/troubleshoot --runtime` Flags: - `--build`: Build/compile issues - `--runtime`: Runtime/performance issues - `--test`: Failing/flaky tests - `--deploy`: Packaging/CI/CD issues - `--logs`: Collect/summarize logs ### 💡 Usage 1. **In Cursor IDE (Cursor 1.7+):** - Use slash commands directly in the command bar - Example: `/code-review --full` or `/build --prod --validate` - Setup: Put the needed command markdown files under `.cursor/commands/` in your project root - Example setup: ```bash mkdir -p .cursor/commands cp commands/en/*.md .cursor/commands/ # or only selected files cp commands/en/build.md .cursor/commands/ ``` - Or use script: ```bash ./setup.sh en # copy all EN commands ./setup.sh cn # copy all CN commands ./setup.sh en build.md test.md # copy selected EN files ``` 2. **With Claude:** - Copy the command content as context - Provide specific scope or arguments 3. **Customize:** - Fork and adapt to your team's workflow - Add project-specific conventions ### 🌟 Features - ✅ **Bilingual Support** - English and Chinese versions - ✅ **Production-Ready** - Battle-tested in real projects - ✅ **Comprehensive** - Covers full development lifecycle - ✅ **Structured** - Systematic approach to each task - ✅ **Best Practices** - Follows industry standards ### 🤝 Contributing Contributions are welcome! Feel free to: - Submit new command templates - Improve existing commands - Add support for more languages - Report issues or suggestions ### 📄 License MIT License - feel free to use in your projects. --- ## 中文说明 ### 📋 简介 本仓库提供了一套精心设计的命令模板,旨在提升 Cursor IDE 与 Claude AI 助手的开发体验。每个命令都遵循最佳实践,包含详细的指令以应对各类软件工程任务。 参考:[`术语与风格词汇表`](./01-terminology-style.mdc) 参考来源: - [Claude Code Templates](https://www.aitmpl.com/) - [SuperClaude Framework](https://github.com/SuperClaude-Org/SuperClaude_Framework) ### 📁 目录结构 ```text commands/ ├── en/ # 英文命令 └── cn/ # 中文命令 ``` ### 🚀 可用命令 #### 代码质量与评审 - **`code-review.md`** 全面的代码质量评审,涵盖安全、性能与架构分析 示例:`/code-review --full` 标志: - `--full`:跨域全面评审 - **`refactor-code.md`** 智能重构指南,包含系统化方法与安全检查 示例:`/refactor-code feature-xyz` #### 架构与文档 - **`architecture-review.md`** 深入的系统架构分析,包含设计模式评估 示例:`/architecture-review --dependencies` 标志: - `--modules`:关注模块级分析 - `--patterns`:强调设计模式评估 - `--dependencies`:依赖架构评审 - `--security`:安全架构评审 - **`create-architecture-documentation.md`** 生成全面的架构文档,包括图表、ADR 与可视化 示例:`/create-architecture-documentation --c4-model` 标志: - `--c4-model`:生成 C4 模型图 - `--arc42`:使用 Arc42 模板 - `--adr`:包含 ADR 配置 - `--plantuml`:使用 PlantUML/Mermaid - `--full-suite`:启用完整文档套件 #### 规划与维护 - **`design.md`** 进行系统架构、API 与组件设计,输出清晰规格 示例:`/design --api` 标志: - `--api`:API 优先合同与文档 - `--system`:系统级架构 - `--component`:组件职责与接口 - `--database`:数据建模与存储策略 - `--diagrams`:图即代码输出 - **`estimate.md`** 提供开发工作量评估(拆解、风险、区间) 示例:`/estimate --ranges --risks` 标志: - `--breakdown`:详细任务拆解(WBS) - `--risks`:风险清单与缓解 - `--ranges`:最优/可能/最差区间 - `--assumptions`:显式假设/不包含 - `--benchmarks`:历史/行业基准 - **`cleanup.md`** 系统化清理代码、移除死代码并优化结构 示例:`/cleanup --dead-code` 标志: - `--dead-code`:移除未使用代码/资源 - `--style`:统一风格与命名 - `--deps`:依赖精简与升级 - `--structure`:目录/模块重组 - `--safety`:安全重构护栏 #### 高级 - **`brainstorm.md`** 需求探索,采用苏格拉底式提问与结构化发散 示例:`/brainstorm --questions` 标志: - `--personas`:多干系人视角 - `--questions`:苏格拉底式发现 - `--risks`:及早暴露风险 - `--solutions`:候选方案枚举 - `--prioritize`:按影响/成本/风险排序 - **`workflow.md`** 基于 PRD/特性需求生成结构化实施工作流 示例:`/workflow --tasks --ownership` 标志: - `--prd`:使用 PRD 输入 - `--milestones`:强化里程碑设计 - `--tasks`:强化任务拆解 - `--risks`:风险关口与缓解 - `--ownership`:责任划分与 RACI #### 代码理解 - **`explain-code.md`** 系统化的代码分析与解释框架 支持:JavaScript/TypeScript、Python、Java、C#、Go、Rust、Swift、Objective-C、Kotlin 示例:`/explain-code path/to/file` #### 版本控制 - **`commit.md`** 智能 Git 提交,使用约定式提交格式与表情符号 特性包括原子化提交、自动 Lint 与提交拆分建议 示例:`/commit "docs: update readme" --no-verify` 标志: - `--no-verify`:跳过提交前检查 - `--amend`:修订上一次提交 #### 构建/实现/测试/排障 - **`build.md`** 构建、编译与打包,附校验与优化 示例:`/build --prod --validate` 标志: - `--prod`:生产模式 - `--analyze`:包体分析/报告 - `--minify`:强化压缩 - `--cache`:缓存/增量构建 - `--validate`:构建前后校验 - **`implement.md`** 在安全、测试与文档保障下实现功能与代码 示例:`/implement user-profile --tests --docs` 标志: - `--scaffold`:创建初始结构/文件 - `--tests`:测试优先/完善测试 - `--api`:API 合同与兼容性 - `--ui`:聚焦 UI/UX 与可访问性 - `--docs`:完善文档与示例 - **`test.md`** 执行测试并输出覆盖率与可执行的改进建议 示例:`/test --coverage` 标志: - `--unit`:单元测试 - `--integration`:集成测试 - `--e2e`:端到端测试 - `--coverage`:生成/汇总覆盖率 - `--watch`:监听模式 - **`troubleshoot.md`** 系统化诊断与解决构建/运行/测试/部署问题 示例:`/troubleshoot --runtime` 标志: - `--build`:构建/编译问题 - `--runtime`:运行时/性能问题 - `--test`:失败/不稳定测试 - `--deploy`:打包/CI/CD 问题 - `--logs`:收集/汇总日志 ### 💡 使用方式 1. **在 Cursor IDE(Cursor 1.7+)中:** - 直接使用斜杠命令(/)调用模板 - 示例:`/code-review --full` 或 `/build --prod --validate` - 使用前请将需要的命令 md 文件放入项目根目录的 `.cursor/commands/` 文件夹 - 快速设置示例: ```bash mkdir -p .cursor/commands cp commands/cn/*.md .cursor/commands/ # 或仅复制需要的文件 cp commands/cn/build.md .cursor/commands/ ``` - 或使用脚本: ```bash ./setup.sh cn # 复制中文命令(全部) ./setup.sh en # 复制英文命令(全部) ./setup.sh cn cleanup.md test.md # 仅复制指定中文文件 ``` 2. **与 Claude 配合:** - 将命令内容作为上下文复制 - 提供具体范围或参数 3. **自定义:** - Fork 并适配到团队工作流 - 添加项目特定约定 ### 🌟 特性 - ✅ **双语支持** - 中英文版本 - ✅ **生产就绪** - 经实际项目验证 - ✅ **全面覆盖** - 涵盖完整开发生命周期 - ✅ **结构化** - 每项任务都有系统化方法 - ✅ **最佳实践** - 遵循行业标准 ### 🤝 贡献 欢迎贡献!你可以: - 提交新的命令模板 - 改进现有命令 - 添加更多语言支持 - 报告问题或提出建议 ### 📄 许可证 MIT License - 可自由用于您的项目。 --- ### Made with ❤️ for developers using Cursor & Claude