Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add claude-world/director-mode-lite --skill "evolving-loop"
Install specific skill from multi-skill repository
# Description
Self-Evolving Development Loop - Dynamic skill generation with learning and evolution
# SKILL.md
name: evolving-loop
description: Self-Evolving Development Loop - Dynamic skill generation with learning and evolution
user-invocable: true
Self-Evolving Development Loop
Execute an autonomous development cycle that dynamically generates, validates, and evolves its own execution strategy. Integrates with Meta-Engineering memory system for pattern learning and tool evolution.
Architecture Details: See docs/EVOLVING-LOOP-ARCHITECTURE.md
Usage
# Start new task
/evolving-loop "Your task description
Acceptance Criteria:
- [ ] Criterion 1
- [ ] Criterion 2
"
# Flags
/evolving-loop --resume # Resume interrupted session
/evolving-loop --status # Check status
/evolving-loop --force # Clear and restart
/evolving-loop --evolve # Trigger manual evolution
/evolving-loop --memory # Show memory system status
How It Works
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 8-Phase Self-Evolving Loop β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Phase -2: CONTEXT_CHECK β Check token pressure β
β Phase -1A: PATTERN_LOOKUP β Match task patterns β
β β
β ββββββββββββββββ Main Loop ββββββββββββββββ β
β β Phase 1: ANALYZE β Extract AC β β
β β Phase 2: GENERATE β Create skills β β
β β Phase 3: EXECUTE β TDD implementation β β
β β Phase 4: VALIDATE β Score 0-100 β β
β β Phase 5: DECIDE β SHIP/FIX/EVOLVE β β
β β Phase 6: LEARN β Extract patterns β β
β β Phase 7: EVOLVE β Improve skills β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β
β Phase -1C: EVOLUTION β Update memory (on SHIP) β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Execution
When user runs /evolving-loop "$ARGUMENTS":
1. Handle Flags
STATE_DIR=".self-evolving-loop"
MEMORY_DIR=".claude/memory/meta-engineering"
CHECKPOINT="$STATE_DIR/state/checkpoint.json"
# --status: Show current state
if [[ "$ARGUMENTS" == *"--status"* ]]; then
/evolving-status
exit 0
fi
# --memory: Show memory system status
if [[ "$ARGUMENTS" == *"--memory"* ]]; then
echo "Memory System Status:"
if [ -d "$MEMORY_DIR" ]; then
echo "Tool Usage: $(jq '.tools | length' "$MEMORY_DIR/tool-usage.json" 2>/dev/null || echo "0") tools"
echo "Patterns: $(jq '.task_patterns | keys | length' "$MEMORY_DIR/patterns.json" 2>/dev/null || echo "0") patterns"
echo "Evolution: v$(jq -r '.version' "$MEMORY_DIR/evolution.json" 2>/dev/null || echo "0")"
else
echo "(Not initialized - will create on first run)"
fi
exit 0
fi
# --resume: Continue from checkpoint
if [[ "$ARGUMENTS" == *"--resume"* ]]; then
if [ ! -f "$CHECKPOINT" ] || [ "$(jq -r '.status' "$CHECKPOINT")" == "idle" ]; then
echo "No active session to resume."
exit 1
fi
fi
# --force: Clear old state
if [[ "$ARGUMENTS" == *"--force"* ]]; then
rm -rf "$STATE_DIR/state/*" "$STATE_DIR/reports/*" "$STATE_DIR/generated-skills/*"
fi
2. Initialize (First-Run Safe)
# Create directories (first-run safe)
mkdir -p "$MEMORY_DIR"
mkdir -p "$STATE_DIR"/{state,reports,generated-skills,history,backups}
# Helper: Read JSON with fallback
read_json_safe() {
local file="$1"
local default="$2"
if [ -f "$file" ]; then
cat "$file" 2>/dev/null || echo "$default"
else
echo "$default"
fi
}
# Detect first run
IS_FIRST_RUN=false
if [ ! -f "$MEMORY_DIR/patterns.json" ]; then
IS_FIRST_RUN=true
echo "π First run detected - initializing memory system..."
fi
# Initialize memory files if missing (see docs for full schema)
3. Delegate to Orchestrator
CRITICAL: Use context isolation - orchestrator runs in fork context.
Task(subagent_type="evolving-orchestrator", prompt="""
Request: $ARGUMENTS
Task Type: $TASK_TYPE (from pattern matching)
Execute phases in sequence, each in fork context.
Return only brief status updates (1 line per phase).
Store ALL detailed output in files.
Return format:
π CONTEXT: [OK/Warning] - [N]% usage
π PATTERNS: Matched [type], [N] recommendations
β
ANALYZE: [N] AC identified
β
GENERATE: Created v[N] skills
π EXECUTE: Iter [N] - [status]
β
VALIDATE: Score [N]/100
β‘οΈ DECIDE: [SHIP/FIX/EVOLVE]
""")
Output Example
π Starting Self-Evolving Loop (Meta-Engineering v2.0)...
π CONTEXT: OK - 15% usage
π PATTERNS: Matched 'auth', 3 recommendations
β
ANALYZE: 5 acceptance criteria identified
β
GENERATE: Created executor-v1, validator-v1, fixer-v1
π EXECUTE: Iteration 1 - 4 files modified, 3/5 tests passing
β
VALIDATE: Score 72/100
β‘οΈ DECIDE: FIX (minor test failures)
π EXECUTE: Iteration 2 - 2 files modified, 5/5 tests passing
β
VALIDATE: Score 94/100
β‘οΈ DECIDE: SHIP
π LEARN: 2 patterns identified
𧬠EVOLUTION: Updated memory
β
SHIP: All criteria met!
π Summary: 2 iterations, 6 files changed, 5/5 AC complete
Phase Agents
| Phase | Agent | Output File |
|---|---|---|
| ANALYZE | requirement-analyzer |
reports/analysis.json |
| GENERATE | skill-synthesizer |
generated-skills/*.md |
| EXECUTE | (generated executor) | codebase changes |
| VALIDATE | (generated validator) | reports/validation.json |
| DECIDE | completion-judge |
reports/decision.json |
| LEARN | experience-extractor |
reports/learning.json |
| EVOLVE | skill-evolver |
evolved skills |
State Files
.self-evolving-loop/ β Session state (temporary)
βββ state/checkpoint.json β Current state
βββ reports/*.json β Phase outputs
βββ generated-skills/*.md β Dynamic skills
βββ history/*.jsonl β Event logs
.claude/memory/meta-engineering/ β Persistent memory
βββ tool-usage.json β Usage statistics
βββ patterns.json β Learned patterns
βββ evolution.json β Evolution history
Stop / Resume
# Stop after current phase
touch .self-evolving-loop/state/stop
# Resume later
/evolving-loop --resume
Related
- /evolving-status - View status and memory
- evolving-orchestrator - Phase coordinator
- Architecture Details - Full technical docs
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.