sparc-implement
它能做什么
这项技能涵盖 SPARC 方法的设计阶段:为每项需求编写伪代码,并规划架构。适用于希望在实施前有清晰设计的开发者。
适用场景
- ✓当功能需求已经确定,并且你需要在编码前进行设计的时候。
- ✓当你希望在编写代码前规划边界情况和错误路径的时候。
- ✓当你需要为某个功能定义模块边界和接口的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-sparc/skills/sparc-implement/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请根据已确定的需求,为新的通知功能设计伪代码和模块边界。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能会加载已保存的规格说明,为每项标准(包括错误路径)编写与语言无关的伪代码,然后定义架构和接口。它会保存该设计,以便后续阶段使用。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
SPARC Architecture + Implementation
Run Phases 2 and 3 of the SPARC methodology: design algorithms with pseudocode, then establish architecture with module boundaries and API contracts.
When to use
After the Specification phase is complete and its gate has been passed. This skill covers both the Pseudocode and Architecture phases as they are tightly coupled — algorithm design informs module boundaries and vice versa.
Steps
Retrieve specification — call
mcp__plugin_ruflo-core_ruflo__memory_searchwith namespacesparc-phasesand query for the feature's spec. Extract requirements, acceptance criteria, constraints, and edge cases.Retrieve phase state — call
mcp__plugin_ruflo-core_ruflo__memory_retrievewith namespacesparc-stateand exact keycurrent-phase-{feature-slug}to confirm we are in Phase 2 or 3.Search for architectural patterns — call
mcp__plugin_ruflo-core_ruflo__neural_predictwith the feature description to find relevant architectural decisions from past projectsPhase 2 — Pseudocode Design: a. For each acceptance criterion, write language-agnostic pseudocode that satisfies it b. Define core data structures with type annotations c. Map control flow including:
- Happy path
- Error/exception paths for each edge case
- Concurrent access handling if applicable d. Annotate algorithmic complexity (time and space) for critical paths e. Store pseudocode artifact:
- Call
mcp__plugin_ruflo-core_ruflo__memory_storewith namespacesparc-phases, keypseudo-{feature-slug} - Value:
{ status: "complete", algorithms: [...], dataStructures: [...], controlFlow: [...], complexity: {...} }
Phase 3 — Architecture Design: a. Define bounded contexts and aggregate roots following DDD patterns:
- Identify entity boundaries and value objects
- Define aggregate invariants
- Map domain events b. Design API contracts:
- Request/response schemas with TypeScript interfaces
- Error response codes and formats
- Versioning strategy if applicable c. Plan module boundaries:
- Directory structure
- Dependency direction rules (no circular dependencies)
- Public vs internal interfaces d. Specify infrastructure concerns:
- Persistence strategy (database, cache, file)
- Messaging patterns (sync, async, event-driven)
- Configuration and environment requirements e. Store architecture artifact:
- Call
mcp__plugin_ruflo-core_ruflo__memory_storewith namespacesparc-phases, keyarch-{feature-slug} - Value:
{ status: "complete", boundedContexts: [...], apiContracts: [...], moduleBoundaries: {...}, infrastructure: {...} }
Update phase state — call
mcp__plugin_ruflo-core_ruflo__memory_storewith namespacesparc-state, exact keycurrent-phase-{feature-slug}; preserve existing state fields, update current phase to 3 (Architecture) with both artifacts recorded, and setupdatedAtto the current ISO timestampRecord trajectory step — call
mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-stepwith architecture summaryBegin implementation — if the user confirms, proceed to write production code: a. Create files following the defined module boundaries b. Implement interfaces and types first c. Implement core logic following the pseudocode d. Write unit tests alongside implementation (TDD when possible) e. Run tests to verify acceptance criteria
Present architecture — display the architecture decision record and suggest running
/ruflo-sparc:ruflo-sparc advanceto pass the Phase 3 gate
Output format
# Pseudocode: {Feature Name}
## Core Algorithms
### Algorithm 1: {name}
```pseudocode
FUNCTION processRequest(input):
VALIDATE input against schema
IF invalid THEN THROW ValidationError
result <- TRANSFORM input
STORE result
RETURN result
Complexity: O(n) time, O(1) space
Data Structures
- {StructName}: { field1: type, field2: type }
Architecture: {Feature Name}
Bounded Contexts
- {ContextName}: {description}
- Aggregates: {list}
- Events: {list}
API Contracts
POST /api/{resource}
- Request: { field1: string, field2: number }
- Response: { id: string, ...fields }
- Errors: 400 (validation), 409 (conflict), 500 (internal)
Module Structure
src/{feature}/
{feature}.types.ts # Interfaces and types
{feature}
常见问题
使用前必须具备什么?
必须已完成规格阶段,且需求和验收标准已保存。
它会编写最终代码吗?
设计之后,这项技能会按照已保存的计划进入实施阶段。
阶段状态在哪里跟踪?
阶段状态保存在 sparc-state 记忆命名空间中。
详情
作者的原始描述
Run the SPARC Pseudocode and Architecture phases (2 and 3) — write algorithm pseudocode, design module boundaries and API contracts, then implement
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1695
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。