Skip to content
Skillpedia
General coding81k Β· #1696

sparc-refine

What it does

This skill covers the last two steps of the SPARC method: refining the code through review and testing, then completing the documentation and readiness checks. It is for developers bringing a feature to production quality.

When to use it

  • βœ“When a feature is built and needs a careful review against its specification.
  • βœ“When test coverage needs to be improved before release.
  • βœ“When a feature needs final documentation and a readiness check.

Skill link

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-sparc/skills/sparc-refine/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-sparc/skills/sparc-refine/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œReview the notification feature against its spec, improve the test coverage and prepare it for release.”

5 new skills a week. 1 minute to read.

How it works

The skill loads the earlier design artifacts, checks the code against each requirement, pattern and quality rule, then improves the tests. It finishes with validation, documentation and a readiness record, and skips work already marked complete.

Technical content (original SKILL.md)

Original text by the author, straight from 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

  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_retrieve with namespace sparc-state and exact key current-phase-{feature-slug} to confirm we are in Phase 4 (or Phase 5 when resuming completion). If status === "complete", report the existing completion and do not write again; stop on missing/malformed state.

  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:

    • 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
  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:

    • All acceptance criteria have passing tests
    • Code review has no critical or high-severity issues
    • Coverage meets the threshold
    • Performance constraints are satisfied
  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 }

    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, refresh updatedAt with 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", and updatedAt to the current ISO timestamp at the same key in sparc-state. When resuming Phase 5, do not repeat the Phase 4 transition.

  8. Record trajectory step β€” call mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step with refinement summary

Phase 5 β€” Completion

  1. Full regression β€” run the complete test suite to verify no regressions from refinement changes

  2. 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
  3. 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

  4. 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)
  5. 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

FAQ

What if the feature is already marked complete?

The skill reports the existing completion and does not write it again.

What does the review check?

Whether each acceptance criterion has code, whether module boundaries are kept, and whether code quality rules are met.

Does it deploy the feature?

It prepares deployment readiness. Deployment itself is a separate decision.

Details

Original description by the author

Run the SPARC Refinement and Completion phases β€” review code, improve test coverage, validate against specification, and generate documentation

repo: ruvnet/ruflo

Popularity

GitHub stars
81k
Ranking position
#1696
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills