source-command-sparc-refinement-optimization-mode

Refactors code, enforces file size limits, and optimizes system performance via SPARC mode.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/derbalimajd04-dot/al-wasat --skill source-command-sparc-refinement-optimization-mode-derbalimajd04-dot
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: source-command-sparc-refinement-optimization-mode
Source: https://github.com/derbalimajd04-dot/al-wasat/tree/main/.agents/skills/source-command-sparc-refinement-optimization-mode
Command: npx skills add https://github.com/derbalimajd04-dot/al-wasat --skill source-command-sparc-refinement-optimization-mode-derbalimajd04-dot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large, monolithic codebases with bloated files, tangled dependencies, and scattered inline configurations are hard to maintain and slow to evolve. This Skill runs the SPARC refinement-optimization-mode command to audit files, break oversized components into smaller modules, and improve overall system performance. ## Core Features & Use Cases - Code Auditing & Refactoring: Inspects files for clarity, modularity, and size, splitting components over 500 lines into smaller units. - Configuration Hygiene: Moves inline configs into environment files and decouples dependencies. - Flexible Execution: Runs through MCP tools (claude-flow sparc_mode), the NPX CLI, or a local Codex-flow installation, with memory integration for storing and querying optimization context. - Use Case: A team inherits a legacy service with 1,500-line modules and hardcoded settings. They invoke this mode to audit the codebase, delegate modularization tasks, and record decisions in namespaced memory for future sessions. ## Quick Start Ask the AI to run the SPARC refinement-optimization-mode on your project to audit file sizes, modularize large components, and optimize performance.

Frequently Asked Questions about source-command-sparc-refinement-optimization-mode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run the SPARC refinement-optimization-mode command?▼

Run it via MCP tools using mcp__claude-flow__sparc_mode with mode set to refinement-optimization-mode, or use the NPX CLI fallback: npx Codex-flow sparc run refinement-optimization-mode followed by your task description.

What does the refinement-optimization-mode do to large files?▼

It audits files for clarity, modularity, and size, then breaks components larger than 500 lines into smaller modules. It also moves inline configurations into environment files and decouples dependencies.

Can I run SPARC refinement-optimization-mode without MCP tools?▼

Yes, use the NPX CLI fallback with npx Codex-flow sparc run refinement-optimization-mode, or run ./Codex-flow sparc run if Codex-flow is installed locally. Both support namespace and non-interactive flags.

How do I store optimization context between SPARC sessions?▼

Use mcp__claude-flow__memory_usage with the store action and a namespaced key, or the CLI command npx Codex-flow memory store with the --namespace flag. Query previous work with memory_search or memory query.

When should I not use refinement-optimization-mode?▼

Avoid it for greenfield code that has not yet stabilized, since premature modularization adds overhead. It is designed for auditing and improving existing codebases with size, coupling, or configuration issues.