/sc:implement
高级具备智能角色激活和 MCP 集成的功能与代码实现
语法
/sc:implement [选项] "[功能描述]"
选项
| 标志 | 值 | 描述 |
|---|---|---|
| --type | component, api, service, feature | 指定构件类型:'component'(组件)、'api'(接口)、'service'(服务)或 'feature'(功能)。 |
| --framework | react, vue, express 等 | 指定目标框架(如 react、vue)以定制代码生成模式。 |
| --safe | - | 启用保守模式:避免破坏性更改,专注于非破坏性更新。 |
| --with-tests | - | 自动生成单元测试和集成测试代码。 |
示例
React 组件实现
/sc:implement --type component --framework react "用户个人资料组件"
API 服务实现(安全模式 + 测试)
/sc:implement --type api --safe --with-tests "用户认证 API"
全栈功能
/sc:implement --type feature --with-tests "支付处理系统"
Vue 框架组件
/sc:implement --type component --framework vue "仪表板部件"
Express 后端服务
/sc:implement --type service --framework express --safe "文件上传服务"
React 安全组件(含测试)
/sc:implement --type component --framework react --safe --with-tests "管理员面板"
Next.js 页面实现
/sc:implement --type feature --framework nextjs "用户设置页面"
纯 API 实现(无测试)
/sc:implement --type api "通知端点"