
SPARC Refinement and Completion
FreeStreamline your code review and documentation process.
Free · Opens the source repo
What SPARC Refinement and Completion does
The SPARC Refinement and Completion skill is designed to facilitate the final phases of the SPARC methodology, specifically focusing on code refinement and documentation generation. This skill is particularly useful for development teams looking to ensure that their features are production-ready after the architecture phase has been completed. By following a structured approach, it helps teams review their code, improve test coverage, validate against specifications, and generate necessary documentation before deployment.
During the refinement phase, the skill begins by retrieving all prior artifacts related to the feature, allowing for a comprehensive review against the defined specifications, architecture, and pseudocode. It emphasizes code quality and adherence to best practices, ensuring that all acceptance criteria are met through rigorous testing and performance validation. The iterative nature of this phase means that teams can continuously improve their code until it meets the necessary standards.
Following refinement, the completion phase ensures that all aspects of the feature are thoroughly tested and documented. It includes building a traceability matrix that maps acceptance criteria to corresponding tests and code implementations, which is crucial for maintaining clarity and accountability. The skill also generates API documentation from code comments and prepares a deployment readiness checklist, ensuring that nothing is overlooked before the feature goes live.
This skill is ideal for developers and teams who want to adopt a disciplined approach to code refinement and documentation. It provides a clear framework for ensuring that features are not only functional but also maintainable and well-documented, ultimately leading to a smoother deployment process.
When to use it
Use this skill after completing the architecture phase of your project to refine and finalize features before deployment.
When not to use it
This skill is not suitable for initial development phases or for projects that do not follow the SPARC methodology.
What you can build with it
Finalizing a Feature for Deployment
After completing the architecture phase, use this skill to ensure that your feature meets all acceptance criteria and is ready for production.
Improving Test Coverage
Utilize this skill to identify gaps in test coverage and generate necessary tests to meet the required standards.
Generating Comprehensive Documentation
Employ this skill to automatically create documentation and a traceability matrix, ensuring clarity and completeness before deployment.
How to install SPARC Refinement and Completion
View source1. Install with the skills CLI
npx skills add ruvnet/ruflo/sparc-refine --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by ruvnetSPARC 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_searchwith namespacesparc-stateto confirm we are in Phase 4. -
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 } -
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)
-
Store completion artifact — call
mcp__plugin_ruflo-core_ruflo__memory_storewith namespacesparc-phases, keycomplete-{feature-slug}, value:{ status: "complete", traceabilityMatrix: [...], documentationFiles: [...], deploymentChecklist: {...}, regressionResult: "pass" } -
End trajectory — call
mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-endwith the full SPARC cycle summary -
Train neural patterns — call
mcp__plugin_ruflo-core_ruflo__neural_trainwith the successful SPARC cycle data to improve future predictions -
Store learned pattern — call
mcp__plugin_ruflo-core_ruflo__memory_storewith namespacepatterns, keysparc-{feature-slug}, value summarizing what worked, phase durations, and common blockers encountered -
Present completion report — display the traceability matrix, deployment checklist, and final status. Suggest running
/sparc advanceto pass the final gate, or/sparc reportfor the full methodology report.
Output format
# 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 report` for the full methodology report.
Frequently asked questions about SPARC Refinement and Completion
Similar skills
Quality Playbook Generator
Run comprehensive quality audits on any codebase.
PR Draft Summary
Automate PR summary generation for openai-agents-python.
Final Release Review
Streamline your release candidate audits with ease.
Unit Test Vue Pinia
Efficiently write and review unit tests for Vue 3 applications.
Slang Shader Expert
Optimize and integrate Slang shaders with ease.
Telemetry Standards
Ensure consistent event tracking in Supabase Studio.
