| name | cgf-optimize |
| description | Start or resume CGF (Claude Gradient Feedback) optimization on a context-engineering resource. Supports agents, skills, commands, and other resource types.
Invoke with resource name/path and optimization goal. Add --review for checkpoint mode where you can review and approve intermediate artifacts.
Supports two modes: - **Optimization mode**: Optimize an existing resource - **Creation mode**: Create and optimize a new resource from description (use /cgf-create)
<examples> - "/cgf-optimize python-expert async programming" - Optimize for async patterns - "/cgf-optimize typescript-expert --review" - With human review checkpoints - "/cgf-optimize research-team:research-specialist Context7 integration" - "/cgf-create Python async expert that helps with asyncio patterns" - "/cgf-create Kubernetes deployment agent --review" </examples>
|
| allowed-tools | Read, Write, Bash, Task, Glob, Grep |
| argument-hint | <resource|description> <goal> [--review] |
CGF Optimize Skill
This skill launches the CGF (Claude Gradient Feedback) optimization pipeline for a specified resource or creates a new resource from description.
Usage
Optimization Mode (Existing Resource)
/cgf-optimize <resource> <optimization_goal> [--review]
Creation Mode (New Resource)
/cgf-create <description> [--review]
Arguments
For optimization mode:
For creation mode:
Examples
Basic Optimization
/cgf-optimize python-expert async programming
Runs full optimization pipeline automatically.
With Review Checkpoints
/cgf-optimize typescript-expert --review
Pauses after research, test generation, and evaluation for your review.
Plugin Agent
/cgf-optimize research-team:research-specialist Context7 integration
Optimizes a plugin agent.
Create New Agent
/cgf-create Python async expert that helps with asyncio patterns
Creates initial agent draft using context-engineer, then optimizes.
Create With Review
/cgf-create Kubernetes deployment agent --review
Creates and optimizes with human review at each phase.
Workflow
Optimization Mode
- INIT: Creates workspace, detects resource type
- RESEARCH: Investigates domain best practices (via research-team)
- RESEARCH_ITERATE: Agentic optimization using research findings and LLM self-critique
- EVALUATE: Assesses results, recommends accept/refine/reject
- FINALIZE: Applies recommendation
Creation Mode
- INIT: Creates workspace, detects creation mode
- CREATE: Spawns context-engineer to create initial resource draft
- RESEARCH: Investigates domain best practices
- RESEARCH_ITERATE: Agentic optimization using research findings and LLM self-critique
- EVALUATE: Assesses results, recommends accept/refine/reject
- FINALIZE: Applies recommendation
Output
Results saved to workspace/{resource_id}/:
run_state.json - Current state (supports resume)
{resource_id}-v{N}.md - Optimized version
reviews/v{N}_review.md - Evaluation report
Resume
If optimization was interrupted, simply re-run the same command - it will resume from the last checkpoint.