agentdb-advanced
Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems…
Run the SPARC Refinement and Completion phases — review code, improve test coverage, validate against specification, and generate documentation
$ npx -y skills add ruvnet/claude-flow --skill sparc-refine --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sparc-refineContext preview
The summary Claude sees to decide when to auto-load this skill.
Run the SPARC Refinement and Completion phases — review code, improve test coverage, validate against specification, and generate documentation
name: sparc-refine description: Run the SPARC Refinement and Completion phases — review code, improve test coverage, validate against specification, and generate documentation argument-hint: "" allowed-tools: mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__memory_retrieve mcp__plugin_ruflo-core_ruflo__task_create mcp__plugin_ruflo-core_ruflo__task_update mcp__plugin_ruflo-core_ruflo__task_complete mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-end mcp__plugin_ruflo-core_ruflo__neural_train mcp__plugin_ruflo-core_ruflo__neural_predict Bash Read Write Edit
Run Phases 4 and 5 of the SPARC methodology: iteratively improve through code review and testing, then finalize with validation, documentation, and deployment readiness.
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.
1. **Retrieve all prior artifacts** — call `mcp__plugin_ruflo-core_ruflo__memory_search` with namespace `sparc-phases` and query for the feature slug. Load spec (acceptance criteria), pseudocode, and architecture.
2. **Retrieve phase state** — call `mcp__plugin_ruflo-core_ruflo__memory_search` with namespace `sparc-state` to confirm we are in Phase 4.
3. **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
4. **Test coverage analysis**: a. Run existing tests and measure coverage b. Identify uncovered acceptance criteria c. Write missing tests:
d. Target coverage >= 80% on new code
5. **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
6. **Iterate** — repeat steps 3-5 until:
7. **Store refinement artifact** — call `mcp__plugin_ruflo-core_ruflo__memory_store` with namespace `sparc-phases`, key `refine-{feature-slug}`, value: `{ status: "complete", reviewFindings: [...], coveragePercent: N, performanceResults: {...}, iterations: N }`
8. **Record trajectory step** — call `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step` with refinement summary
9. **Full regression** — run the complete test suite to verify no regressions from refinement changes
10. **Traceability matrix** — build a matrix mapping every acceptance criterion to:
11. **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
12. **Deployment readiness checklist**:
13. **Store completion artifact** — call `mcp__plugin_ruflo-core_ruflo__memory_store` with namespace `sparc-phases`, key `complete-{feature-slug}`, value: `{ status: "complete", traceabilityMatrix: [...], documentationFiles: [...], deploymentChecklist: {...}, regressionResult: "pass" }`
14. **End trajectory** — call `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-end` with the full SPARC cycle summary
15. **Train neural patterns** — call `mcp__plugin_ruflo-core_ruflo__neural_train` with the successful SPARC cycle data to improve future predictions
16. **Store learned pattern** — call `mcp__plugin_ruflo-core_ruflo__memory_store` with namespace `patterns`, key `sparc-{feature-slug}`, value summarizing what worked, phase durations, and common blockers encountered
17. **Present completion report** — display the traceability matrix, deployment checklist, and final status. Suggest running `/sparc advance` to pass the final gate, or `/sparc report` for the full methodology report.
# Refinement: {Feature Name}
## Code Review Summary
- Critical issues: {N} (must be 0 to pass gate)
- High issues: {N}
- Medium issues: {N}
- Resolved: {N}/{total}
## Test Coverage
- Overall: {N}%
- New code: {N}%
- Acceptance criteria covered: {N}/{total}
## Performance
| Constraint | Target | Measured | Status |
|-----------|--------|----------|--------|
| Response time | <200ms | 145ms | Pass |
---
# Completion: {Feature Name}
## Traceability Matrix
| AC | Test | Code | Status |
|----|------|------|--------|
| AC-1 | test_xxx | service.ts:42 | Pass |
| AC-2 | test_yyy | controller.ts:18 | Pass |
| AC-3 | test_zzz | repository.ts:31 | Pass |
## Deployment Checklist
- [x] All tests passing
- [x] Documentation complete
- [x] Migrations prepared
- [x] Config documented
- [x] Rollback plan defined
- [x] Security reviewed
---
SPARC workflow complete. Run `/sparc reportAn agent meta-harness for Claude Code and Codex. 📖 RuFlo Explained — Build an AI Team That Plans, Remembers, Tests, and Improves A 14-chapter guide: from the basic idea to a first useful task, then memory, agent teams, plugins, cost and verification.
Repo: ruvnet/claude-flow
Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems…
Create and train AI learning plugins with AgentDB's 9 reinforcement learning algorithms. Includes Decision Transformer, Q-Learning, SARSA, Actor-Critic, and…
Implement persistent memory patterns for AI agents using AgentDB. Includes session memory, long-term storage, pattern learning, and context management. Use…
Optimize AgentDB performance with quantization (4-32x memory reduction), HNSW indexing (150x faster search), caching, and batch operations. Use when optimizing…
Implement semantic vector search with AgentDB for intelligent document retrieval, similarity matching, and context-aware querying. Use when building RAG…
Quantum-resistant, self-learning version control for AI agents with ReasoningBank intelligence and multi-agent coordination