关于 sc-implement
sc-implement 是用于规划并执行软件功能开发的实现技能,适合从组件到 API、服务等任务。它按分析、计划、生成、验证和集成推进,并可结合质量检查、MCP 工具和迭代学习流程。
主要功能
- 01分析需求并制定实现计划
- 02生成组件、API、服务或功能
- 03执行安全、质量与原则验证
- 04按策略拆分和协调复杂任务
- 05支持迭代改进与技能学习
适用场景
- 01实现带测试的 API
- 02开发 React 或 Vue 组件
- 03编排复杂功能开发任务
- 04通过循环审查改进实现
MCP 相关
该技能可调用 PAL MCP 进行架构评估、代码审查、调试和提交前检查,也可使用 Rube MCP 搜索集成工具并执行自动化任务。启用 loop 时,会在迭代间调用 MCP 工具。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ tony363/ superclaude --skill sc-implement安装后在 Claude Code 中输入/sc-implement确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
scripts/evidence_gate.pyloop_entry.pyrun_tests.pyselect_agent.pyskill_learn.py详细介绍
实现技能
通过协同专业知识和系统化开发,全面实现功能。
快速开始
# Basic implementation
/sc:implement [feature-description] --type component|api|service|feature
# With framework
/sc:implement dashboard widget --framework react|vue|express
# Complex orchestration
/sc:implement [task] --orchestrate --strategy systematic|agile|enterprise
行为流程
- 分析 - 检查需求,识别技术上下文
- 规划 - 选择方案,启用相关角色
- 生成 - 遵循框架最佳实践创建实现
- 验证 - 执行安全、质量和原则验证
- 运行 KISS 验证:
python .claude/skills/sc-principles/scripts/validate_kiss.py --scope-root . --json - 运行 Purity 验证:
python .claude/skills/sc-principles/scripts/validate_purity.py --scope-root . --json - 如果受阻:重构代码以符合要求后再继续
- 运行 KISS 验证:
- 集成 - 更新文档,提供测试建议
标志
| 标志 | 类型 | 默认值 | 描述 |
|---|---|---|---|
--type | string | feature | component、api、service、feature |
--framework | string | auto | react、vue、express 等 |
--safe | bool | false | 启用安全约束 |
--with-tests | bool | false | 同时生成测试 |
--fast-codex | bool | false | 精简流程,跳过多角色协作 |
--orchestrate | bool | false | 启用分层任务拆分 |
--strategy | string | systematic | systematic、agile、enterprise、parallel、adaptive |
--delegate | bool | false | 启用智能委派 |
--principles | bool | true | 启用 KISS/Purity 验证 |
--strict-principles | bool | false | 将原则警告视为错误 |
启用的角色
- architect - 系统设计、架构决策
- frontend - UI/组件实现
- backend - API/服务实现
- security - 安全验证、身份验证相关问题
- qa-specialist - 测试、质量保证
- devops - 基础设施、部署
- project-manager - 任务协调(配合 --orchestrate 使用)
- code-warden - 原则执行(KISS、Purity)
MCP 集成
PAL MCP(质量保障必用)
| 工具 | 使用时机 | 用途 |
|---|---|---|
mcp__pal__consensus | 架构决策 | 重大变更前进行多模型验证 |
mcp__pal__codereview | 代码质量 | 审查实现质量、安全性和性能 |
mcp__pal__precommit | 提交前 | 在 git commit 前验证所有变更 |
mcp__pal__debug | 实现问题 | 对遇到的错误进行根因分析 |
mcp__pal__thinkdeep | 复杂功能 | 对复杂实现进行多阶段分析 |
mcp__pal__planner | 大型功能 | 为多步骤实现制定循序渐进的计划 |
mcp__pal__apilookup | 依赖项 | 获取最新的 API/SDK 文档 |
mcp__pal__challenge | 代码审查反馈 | 批判性评估审查建议 |
PAL 使用模式
# Consensus for architectural decision
mcp__pal__consensus(
models=[
{"model": "gpt-5.2", "stance": "for"},
{"model": "gemini-3-pro", "stance": "against"},
{"model": "deepseek", "stance": "neutral"}
],
step="Evaluate: Should we use Redux or Context API for state management?"
)
# Pre-commit validation
mcp__pal__precommit(
path="/path/to/repo",
step="Validating implementation changes",
findings="Security, performance, completeness checks",
confidence="high"
)
# Code review after implementation
mcp__pal__codereview(
review_type="full",
step="Reviewing new authentication implementation",
findings="Quality, security, performance, architecture",
relevant_files=["/src/auth/login.ts", "/src/auth/middleware.ts"]
)
# Debug implementation issue
mcp__pal__debug(
step="Investigating why API returns 500 on edge case",
hypothesis="Null check missing for optional field",
confidence="medium"
)
Rube MCP(自动化与集成)
| 工具 | 使用时机 | 用途 |
|---|---|---|
mcp__rube__RUBE_SEARCH_TOOLS | 外部服务 | 查找 API、SDK 和集成 |
mcp__rube__RUBE_MULTI_EXECUTE_TOOL | CI/CD、通知 | 触发构建、通知团队、更新工单 |
mcp__rube__RUBE_REMOTE_WORKBENCH | 代码生成 | 批量代码操作、转换 |
mcp__rube__RUBE_CREATE_UPDATE_RECIPE | 可复用工作流 | 将实现模式保存为配方 |
mcp__rube__RUBE_MANAGE_CONNECTIONS | 验证集成 | 确保外部服务连接正常 |
Rube 使用模式
# Search for integration tools
mcp__rube__RUBE_SEARCH_TOOLS(queries=[
{"use_case": "send slack message", "known_fields": "channel_name:dev-updates"},
{"use_case": "create github pull request", "known_fields": "repo:myapp"}
])
# Notify team and update ticket on completion
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
{"tool_slug": "SLACK_SEND_MESSAGE", "arguments": {
"channel": "#dev-updates",
"text": "Feature implemented: User authentication flow"
}},
{"tool_slug": "JIRA_UPDATE_ISSUE", "arguments": {
"issue_key": "PROJ-123",
"status": "In Review"
}},
{"tool_slug": "GITHUB_CREATE_PULL_REQUEST", "arguments": {
"repo": "myapp",
"title": "feat: Add user authentication",
"base": "main",
"head": "feature/auth"
}}
])
# Save implementation workflow as recipe
mcp__rube__RUBE_CREATE_UPDATE_RECIPE(
name="Feature Implementation Workflow",
description="Standard flow for implementing features with notifications",
workflow_code="..."
)
MCP 驱动的循环模式
启用 --loop 后,迭代过程中会使用 MCP 工具:
- 第 N 次迭代 - 实现功能
- PAL codereview - 评估质量(目标:70 分以上)
- PAL debug - 调查发现的任何问题
- 第 N+1 次迭代 - 应用改进
- PAL precommit - 标记完成前进行最终验证
防护措施
- 以分析模式开始;在操作文件前制定明确的计划
- 只有在引用具体的仓库变更(文件名 + diff 代码块)时,才标记为已完成
- 如果无法使用工具,则返回计划 + 后续操作
- 优先采用最小可行变更;跳过推测性的脚手架
- 修改身份验证/密钥/权限前,先升级至安全角色
证据要求
此技能要求提供证据。你必须:
- 展示实际的文件差异或代码变更
- 引用测试结果或 lint 输出
- 绝不在没有证据的情况下声称代码存在
示例
React 组件
/sc:implement user profile component --type component --framework react
带测试的 API
/sc:implement user auth API --type api --safe --with-tests
复杂编排
/sc:implement "enterprise auth system" --orchestrate --strategy systematic --delegate
循环模式与学习
使用 --loop 时,此技能会与技能持久化层集成,以支持跨会话学习:
学习机制
- 反馈记录 - 持久化每次迭代的质量评分和改进内容
- 技能提取 - 达到质量阈值时,提取成功模式
- 技能检索 - 将相关的已学习技能注入后续任务
- 效果跟踪 - 跟踪已应用技能的成功率
循环标志
| 标志 | 类型 | 默认值 | 描述 |
|---|---|---|---|
--loop | int | 3 | 启用迭代改进(最多 5 次) |
--learn | bool | true | 启用从本次会话中学习 |
--auto-promote | bool | false | 自动提升高质量技能 |
学习示例
# Iterative implementation with learning
/sc:implement auth flow --loop 3 --learn
# View learned skills
python scripts/skill_learn.py '{"command": "stats"}'
# Retrieve relevant skills
python scripts/skill_learn.py '{"command": "retrieve", "task": "auth"}'
已学习技能的位置
已提升的技能存储在:
.claude/skills/learned/
├── SKILL.md # Index
├── learned-backend-auth/ # Example promoted skill
│ ├── SKILL.md
│ └── metadata.json
资源
- scripts/select_agent.py - Agent 选择逻辑
- scripts/evidence_gate.py - 证据验证
- scripts/skill_learn.py - 技能学习管理
评论
支持 Markdown