mcpField
S
sc-implement

sc-implement

github.com/tony363开发2094 次安装30 周前更新
代码仓库

关于 sc-implement

sc-implement 是用于规划并执行软件功能开发的实现技能,适合从组件到 API、服务等任务。它按分析、计划、生成、验证和集成推进,并可结合质量检查、MCP 工具和迭代学习流程。

主要功能

  1. 01分析需求并制定实现计划
  2. 02生成组件、API、服务或功能
  3. 03执行安全、质量与原则验证
  4. 04按策略拆分和协调复杂任务
  5. 05支持迭代改进与技能学习

适用场景

  1. 01实现带测试的 API
  2. 02开发 React 或 Vue 组件
  3. 03编排复杂功能开发任务
  4. 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.py
loop_entry.py
run_tests.py
select_agent.py
skill_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

行为流程

  1. 分析 - 检查需求,识别技术上下文
  2. 规划 - 选择方案,启用相关角色
  3. 生成 - 遵循框架最佳实践创建实现
  4. 验证 - 执行安全、质量和原则验证
    • 运行 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
    • 如果受阻:重构代码以符合要求后再继续
  5. 集成 - 更新文档,提供测试建议

标志

标志类型默认值描述
--typestringfeaturecomponent、api、service、feature
--frameworkstringautoreact、vue、express 等
--safeboolfalse启用安全约束
--with-testsboolfalse同时生成测试
--fast-codexboolfalse精简流程,跳过多角色协作
--orchestrateboolfalse启用分层任务拆分
--strategystringsystematicsystematic、agile、enterprise、parallel、adaptive
--delegateboolfalse启用智能委派
--principlesbooltrue启用 KISS/Purity 验证
--strict-principlesboolfalse将原则警告视为错误

启用的角色

  • 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_TOOLCI/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 工具:

  1. 第 N 次迭代 - 实现功能
  2. PAL codereview - 评估质量(目标:70 分以上)
  3. PAL debug - 调查发现的任何问题
  4. 第 N+1 次迭代 - 应用改进
  5. 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 时,此技能会与技能持久化层集成,以支持跨会话学习:

学习机制
  1. 反馈记录 - 持久化每次迭代的质量评分和改进内容
  2. 技能提取 - 达到质量阈值时,提取成功模式
  3. 技能检索 - 将相关的已学习技能注入后续任务
  4. 效果跟踪 - 跟踪已应用技能的成功率
循环标志
标志类型默认值描述
--loopint3启用迭代改进(最多 5 次)
--learnbooltrue启用从本次会话中学习
--auto-promoteboolfalse自动提升高质量技能
学习示例
# 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

资源

评论

支持 Markdown