sparc-refine
它能做什么
这项技能涵盖 SPARC 方法的最后两个步骤:通过审查和测试改进代码,然后完成文档和就绪检查。适用于希望把功能提升到生产质量的开发者。
适用场景
- ✓当功能已构建完成,需要根据规格进行仔细审查的时候。
- ✓当发布前需要提高测试覆盖率的时候。
- ✓当功能需要最终文档和就绪检查的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-sparc/skills/sparc-refine/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请根据通知功能的规格进行审查,提高测试覆盖率,并为发布做好准备。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能会加载之前的设计成果,依据每项需求、模式和质量规则检查代码,然后改进测试。它最后会完成验证、文档和就绪记录,并跳过已标记为完成的工作。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
SPARC Refinement + Completion
Run Phases 4 and 5 of the SPARC methodology: iteratively improve through code review and testing, then finalize with validation, documentation, and deployment readiness.
When to use
After the Architecture phase is complete and its gate has been passed. This skill covers the final two phases that bring a feature from implemented to production-ready.
Steps
Phase 4 — Refinement
Retrieve all prior artifacts — call
mcp__plugin_ruflo-core_ruflo__memory_searchwith namespacesparc-phasesand query for the feature slug. Load spec (acceptance criteria), pseudocode, and architecture.Retrieve phase state — call
mcp__plugin_ruflo-core_ruflo__memory_retrievewith namespacesparc-stateand exact keycurrent-phase-{feature-slug}to confirm we are in Phase 4 (or Phase 5 when resuming completion). Ifstatus === "complete", report the existing completion and do not write again; stop on missing/malformed state.Code review — review the implementation against: a. Specification compliance: does every acceptance criterion have a corresponding code path? b. Architecture adherence: do modules follow the defined boundaries and dependency rules? c. Pseudocode fidelity: does the implementation match the designed algorithms? d. Code quality: naming conventions, single responsibility, error handling, no dead code e. Document findings as review comments
Test coverage analysis: a. Run existing tests and measure coverage b. Identify uncovered acceptance criteria c. Write missing tests:
- Unit tests for each public function
- Integration tests for cross-module interactions
- Edge case tests for each identified edge case from the spec d. Target coverage >= 80% on new code
Performance validation — if the spec includes performance constraints: a. Profile critical paths identified in the pseudocode b. Compare measured performance against constraint thresholds c. Optimize if thresholds are not met
Iterate — repeat steps 3-5 until:
- All acceptance criteria have passing tests
- Code review has no critical or high-severity issues
- Coverage meets the threshold
- Performance constraints are satisfied
Store refinement artifact — call
mcp__plugin_ruflo-core_ruflo__memory_storewith namespacesparc-phases, keyrefine-{feature-slug}, value:{ status: "complete", reviewFindings: [...], coveragePercent: N, performanceResults: {...}, iterations: N }Before moving to Phase 5, evaluate the Phase 4 gate (passing acceptance tests, approved review, coverage >= 80%) and store its evidence in
sparc-gates. On failure preserve phase, increment gateAttempts, refreshupdatedAtwith the current ISO timestamp at the exact current-phase key, report blockers and stop. On pass preserve existing state fields, set phase 5, phaseName "Completion", status "active", andupdatedAtto the current ISO timestamp at the same key insparc-state. When resuming Phase 5, do not repeat the Phase 4 transition.Record trajectory step — call
mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-stepwith refinement summary
Phase 5 — Completion
Full regression — run the complete test suite to verify no regressions from refinement changes
Traceability matrix — build a matrix mapping every acceptance criterion to:
- The test(s) that verify it
- The code file(s) that implement it
- The current pass/fail status
Documentation: a. Generate API documentation from code comments and type definitions b. Write usage examples for key public interfaces c. Update any existing documentation affected by the changes
Deployment readiness checklist:
- All tests passing
- Documentation complete
- Database migrations prepared (if applicable)
- Configuration changes documented
- Feature flags configured (if applicable)
- Rollback plan defined
- Security review complete (no secrets, inputs validated)
Evaluate the final Phase 5 gate — completion is allowed only when final gate evidence for every criterion passes: full regression actually ran and passed, documentation is complete, deployment checklist is verified, and traceability links every acceptance criterion to passing tests. Store the actual pass/fail evidence at
gate-5-{feature-slug}-{timestamp}in `sparc-ga
常见问题
如果功能已被标记为完成怎么办?
这项技能会报告已有的完成状态,而不会重复写入。
审查检查什么?
每项验收标准是否都有对应代码,模块边界是否得到保持,以及是否符合代码质量规则。
它会部署功能吗?
它只准备部署就绪状态。部署本身是另外的决定。
详情
作者的原始描述
Run the SPARC Refinement and Completion phases — review code, improve test coverage, validate against specification, and generate documentation
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1696
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。