name: sc description: 统一的SuperClaude工作流技能,具有分析、构建、文档化、git、实现等子命令。用于任何结构化开发工作流程。
SuperClaude统一工作流
全面的工作流程系统,包含17个子命令,用于结构化开发任务。
用法
/sc [command] [target] [options]
命令
| 命令 | 用途 | 关键选项 |
|---|---|---|
analyze |
代码质量、安全、性能分析 | --focus quality|security|performance|architecture, --depth quick|deep |
build |
构建、编译、打包项目 | --type dev|prod|test, --clean, --optimize |
cleanup |
移除死代码,优化结构 | --type code|imports|files|all, --safe|--aggressive, --dry-run |
design |
系统架构、API设计 | --type system|api|component, --document |
document |
为组件创建文档 | --type inline|external|api|guide, --style brief|detailed |
estimate |
时间/努力/复杂性估算 | --format brief|detailed, --include-risks |
explain |
解释代码、概念、行为 | --depth overview|detailed|deep, --audience beginner|intermediate|expert |
git |
Git操作,带有智能提交 | --smart-commit, --branch-strategy |
implement |
功能和代码实现 | --type component|api|service|feature, --with-tests, --safe |
improve |
质量、性能改进 | --focus quality|performance|security, --scope file|module|project |
index |
项目文档和知识库 | --type readme|api|structure, --format markdown|json |
load |
加载和分析项目上下文 | --scope files|dependencies|config|all |
spawn |
将复杂任务分解为协调的子任务 | --sequential|--parallel, --validate |
task |
工作流程管理,带有持久性 | --strategy systematic|agile|enterprise, --persist, --hierarchy |
test |
执行测试,生成报告 | --type unit|integration|e2e|all, --coverage, --watch |
troubleshoot |
诊断和解决问题 | --type bug|build|performance|deployment, --trace, --fix |
workflow |
生成实现工作流程 | --strategy systematic|agile|mvp, --output roadmap|tasks|detailed |
analyze
分析代码质量、安全、性能和架构。
何时使用
- 代码质量或技术债务分析
- 安全审计或漏洞评估
- 性能瓶颈识别
- 架构审查
用法
/sc analyze [target] [--focus quality|security|performance|architecture] [--depth quick|deep]
执行
- 发现和分类文件
- 应用分析工具和技术
- 生成带严重性评级的发现
- 创建可操作的建议
build
构建、编译和打包项目。
何时使用
- 构建或编译项目
- 诊断构建错误
- 生产优化
用法
/sc build [target] [--type dev|prod|test] [--clean] [--optimize]
执行
- 分析项目结构和构建配置
- 验证依赖
- 执行构建,监控错误
- 优化输出并报告结果
cleanup
清理代码、移除死代码、优化结构。
何时使用
- 移除死代码或未使用的导入
- 优化项目结构
- 技术债务清理
用法
/sc cleanup [target] [--type code|imports|files|all] [--safe|--aggressive] [--dry-run]
执行
- 分析清理机会
- 识别死代码、未使用的导入
- 创建清理计划,进行风险评估
- 执行,带有安全措施
- 验证和报告结果
design
设计系统架构、API和组件接口。
何时使用
- 系统或组件架构
- API设计
- 接口规划
用法
/sc design [target] [--type system|api|component] [--document]
执行
- 分析需求和约束
- 研究模式和最佳实践
- 创建架构提议
- 记录设计决策
document
为组件或功能创建专注的文档。
何时使用
- 代码文档
- API文档
- 用户指南
用法
/sc document [target] [--type inline|external|api|guide] [--style brief|detailed]
执行
- 分析目标组件
- 识别文档需求
- 生成文档
- 应用一致的格式
estimate
为任务提供开发估算。
何时使用
- 需要时间估算
- 努力评估
- 项目规模确定
用法
/sc estimate [task] [--format brief|detailed] [--include-risks]
执行
- 分析任务复杂性
- 识别依赖和风险
- 生成带置信水平的估算
- 记录假设
explain
提供代码、概念或行为的清晰解释。
何时使用
- 需要代码解释
- 概念澄清
- 行为理解
用法
/sc explain [target] [--depth overview|detailed|deep] [--audience beginner|intermediate|expert]
执行
- 分析目标代码/概念
- 识别关键组件
- 在适当级别生成解释
- 如果帮助,包括示例
git
Git操作,带有智能提交消息。
何时使用
- 提交带有好消息
- 分支管理
- 合并/重定基辅助
用法
/sc git [operation] [--smart-commit] [--branch-strategy]
执行
- 分析当前Git状态
- 执行请求的操作
- 生成智能提交消息
- 处理冲突并提供反馈
implement
功能和代码实现。
何时使用
- 实现功能或组件
- 新功能
- API或服务实现
用法
/sc implement [feature] [--type component|api|service|feature] [--with-tests] [--safe]
执行
- 分析需求,检测上下文
- 自动激活相关角色
- 使用最佳实践生成实现
- 应用安全和质量验证
- 提供测试建议
improve
对代码应用系统改进。
何时使用
- 重构代码
- 清理技术债务
- 优化性能
用法
/sc improve [target] [--focus quality|performance|security] [--scope file|module|project]
执行
- 分析当前状态
- 识别改进机会
- 按影响优先变更
- 系统应用改进
- 验证结果
index
生成项目文档和知识库。
何时使用
- 创建文档或README
- API文档
- 项目结构图
用法
/sc index [target] [--type readme|api|structure] [--format markdown|json]
执行
- 扫描项目结构
- 提取关键信息
- 生成文档
- 组织知识库
load
加载和分析项目上下文。
何时使用
- 开始项目工作
- 理解配置
- 分析依赖
用法
/sc load [target] [--scope files|dependencies|config|all]
执行
- 识别项目结构
- 加载配置
- 分析依赖
- 构建上下文摘要
spawn
将复杂任务分解为协调的子任务。
何时使用
- 复杂多步骤任务
- 并行工作编排
- 依赖管理
用法
/sc spawn [task] [--sequential|--parallel] [--validate]
执行
- 解析请求,创建任务分解
- 映射依赖
- 选择执行策略
- 执行,带进度监控
- 集成和验证结果
task
执行任务,带有工作流程管理和持久性。
何时使用
- 大型项目管理
- 跨会话进度跟踪
- 多阶段操作
用法
/sc task [action] [target] [--strategy systematic|agile|enterprise] [--persist] [--hierarchy]
动作
create- 创建任务层次execute- 执行,带有编排status- 查看任务状态analytics- 性能仪表板delegate- 多代理委派
策略
- systematic: 发现 → 规划 → 执行 → 验证 → 优化
- agile: 冲刺规划 → 迭代执行 → 自适应规划
- enterprise: 利益相关者分析 → 资源分配 → 风险管理
test
执行测试并生成报告。
何时使用
- 运行测试
- 检查覆盖率
- 设置测试基础设施
用法
/sc test [target] [--type unit|integration|e2e|all] [--coverage] [--watch]
执行
- 检测测试框架
- 执行适当的测试
- 收集覆盖率数据
- 生成报告,带建议
troubleshoot
诊断和解决问题。
何时使用
- 调试错误
- 构建失败
- 性能问题
- 部署问题
用法
/sc troubleshoot [issue] [--type bug|build|performance|deployment] [--trace] [--fix]
执行
- 分析问题描述
- 识别潜在根因
- 执行系统调试
- 提议和验证解决方案
- 应用修复和验证
workflow
从PRD生成结构化实现工作流程。
何时使用
- 规划功能实现
- 创建开发路线图
- 分解复杂功能
- 冲刺规划
用法
/sc workflow [prd|description] [--strategy systematic|agile|mvp] [--output roadmap|tasks|detailed]
策略
- systematic: 完整分析、架构、依赖、测试
- agile: 史诗、冲刺、MVP、迭代交付
- mvp: 核心功能、快速原型、验证
输出格式
- roadmap: 基于阶段的路线图,带里程碑
- tasks: 史诗/故事/任务层次
- detailed: 逐步步骤,带估算和标准
全局选项
| 选项 | 效果 |
|---|---|
--think |
启用扩展分析(4K tokens) |
--think-hard |
深度分析模式(10K tokens) |
--c7 |
启用Context7,用于框架模式 |
--seq |
启用顺序思考 |
--safe |
保守方法,带额外验证 |
--verbose |
详细输出 |
Claude代码集成
- Glob/Grep/Read: 文件发现和分析
- Edit/Write: 代码生成和修改
- Bash: 构建和测试执行
- Task tool: 复杂多步骤编排
- TodoWrite: 进度跟踪
示例
/sc analyze src/ --focus security --depth deep
/sc build --type prod --clean --optimize
/sc cleanup --type imports --dry-run
/sc implement user-auth --type feature --with-tests
/sc workflow docs/prd.md --strategy agile --output tasks
/sc troubleshoot "build failing" --type build --trace